Closed mewmew closed 11 months ago
Hi Robin, thanks for your detailed error description. Unfortunately using my blogpost instructions I haven't been able to reproduce the problem. It looks like somehow the libc-compat
library (that contains the versioned symbols) isn't properly linked into your Rust binary on the second run.
We're currently working on making consecutive runs more robust at #62.
Could you please try to remove the examples/hello_rust/var
directory before executing goa run
?
And if that doesn't solve the problem, could you post the output of the goa run with the --verbose
flag added?
goa $ rm -rf examples/hello_rust/var
goa $ goa run --verbose -C examples/hello_rust --versions-from-genode-dir path/to/genode --depot-dir path/to/genode/depot
I'll be on vacation from this afternoon, maybe @jschlatow finds time to have a look before I'm back.
Hi @atopia!
I tried re-running the goa command today, but it seems that is is now unable to download api/base/2023-08-21.tar.xz
from the depot URL.
https://depot.genode.org/genodelabs/api/base/2023-08-21.tar.xz
time goa run --verbose -C examples/hello_rust --versions-from-genode-dir ~/Desktop/genode --depot-dir ~/Desktop/depot
Error output:
[hello_rust] use 4 jobs according to /proc/cpuinfo
[hello_rust] process project 'hello_rust' with arguments: run --versions-from-genode-dir genode --depot-dir depot
[hello_rust] using recipe version 2023-08-23 for genodelabs/api/compat-libc
[hello_rust] using recipe version 2023-08-21 for genodelabs/api/base
[hello_rust] using recipe version 2023-05-26 for genodelabs/api/libc
[hello_rust] using recipe version 2020-05-17 for genodelabs/api/posix
[hello_rust] used APIs: genodelabs/api/compat-libc/2023-08-23 genodelabs/api/base/2023-08-21 genodelabs/api/libc/2023-05-26 genodelabs/api/posix/2020-05-17
[hello_rust] install depot archives via command: goa/share/goa/depot/download genodelabs/api/base/2023-08-21 genodelabs/api/compat-libc/2023-08-23 genodelabs/api/libc/2023-05-26 genodelabs/api/posix/2020-05-17 DEPOT_TOOL_DIR=goa/share/goa/depot DEPOT_DIR=depot PUBLIC_DIR=goa/examples/hello_rust/var/public REPOSITORIES=
download genodelabs/api/base/2023-08-21.tar.xz
Error: failed to download 'https://depot.genode.org/genodelabs/api/base/2023-08-21.tar.xz'
[hello_rust] Error: failed to download the following depot archives:
genodelabs/api/base/2023-08-21
genodelabs/api/compat-libc/2023-08-23
genodelabs/api/libc/2023-05-26
genodelabs/api/posix/2020-05-17
Wish you all the best and a lovely vacation Benjamin : )
Cheers, Robin
Sorry, regarding my last comment, I made a typo in the goa command invocation (I specified a non-existing directory (~/Desktop/depot
) for --depot-dir
path instead of ~/Desktop/genode/depot
).
When I re-run the command with the correct genode/depot
directory, I get the same link error as before.
Below follows the verbose output, when run from a clean clone of the goa repo (i.e. with examples/hello_rust/var/
removed).
time goa run --verbose -C examples/hello_rust --versions-from-genode-dir ~/Desktop/genode --depot-dir ~/Desktop/genode/depot
Error error:
[hello_rust] use 4 jobs according to /proc/cpuinfo
[hello_rust] process project 'hello_rust' with arguments: run --versions-from-genode-dir ~/Desktop/genode --depot-dir ~/Desktop/genode/depot
[hello_rust] using recipe version 2023-08-23 for genodelabs/api/compat-libc
[hello_rust] using recipe version 2023-08-21 for genodelabs/api/base
[hello_rust] using recipe version 2023-05-26 for genodelabs/api/libc
[hello_rust] using recipe version 2020-05-17 for genodelabs/api/posix
[hello_rust] used APIs: genodelabs/api/compat-libc/2023-08-23 genodelabs/api/base/2023-08-21 genodelabs/api/libc/2023-05-26 genodelabs/api/posix/2020-05-17
[hello_rust] build system: cargo
[hello_rust] generate ABI stubs via command: make -f ~/Desktop/goa/share/goa/lib/gen_abi_stubs.mk TOOL_DIR=~/Desktop/goa/share/goa DEPOT_DIR=~/Desktop/genode/depot CROSS_DEV_PREFIX=/usr/local/genode/tool/23.05/bin/genode-x86- APIS=genodelabs/api/compat-libc/2023-08-23 genodelabs/api/base/2023-08-21 genodelabs/api/libc/2023-05-26 genodelabs/api/posix/2020-05-17 ABI_DIR=~/Desktop/goa/examples/hello_rust/var/abi/x86_64 ARCH=x86_64 LD_MARCH=-melf_x86_64 CC_MARCH=-m64
[hello_rust:abi] mkdir -p ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/
[hello_rust:abi] sed -e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) T/.text; .global \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) U/.text; .global \1; movq \1@GOTPCREL(%rip), %rax/p" \
[hello_rust:abi] ~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/lib/symbols/ld > ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ld.symbols.s
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ld.symbols.s -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ld.symbols.o
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-ld -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ld.lib.so -soname ld.lib.so -shared --eh-frame-hdr -melf_x86_64 \
[hello_rust:abi] -T ~/Desktop/goa/share/goa/ld/genode_rel.ld \
[hello_rust:abi] ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ld.symbols.o
[hello_rust:abi] mkdir -p ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/
[hello_rust:abi] sed -e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) T/.text; .global \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) U/.text; .global \1; movq \1@GOTPCREL(%rip), %rax/p" \
[hello_rust:abi] ~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/lib/symbols/libc > ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.symbols.s
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.symbols.s -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.symbols.o
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-ld -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.lib.so -soname libc.lib.so -shared --eh-frame-hdr -melf_x86_64 \
[hello_rust:abi] -T ~/Desktop/goa/share/goa/ld/genode_rel.ld \
[hello_rust:abi] ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.symbols.o
[hello_rust:abi] mkdir -p ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/
[hello_rust:abi] sed -e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) T/.text; .global \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) U/.text; .global \1; movq \1@GOTPCREL(%rip), %rax/p" \
[hello_rust:abi] ~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/lib/symbols/libm > ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.symbols.s
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.symbols.s -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.symbols.o
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-ld -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.lib.so -soname libm.lib.so -shared --eh-frame-hdr -melf_x86_64 \
[hello_rust:abi] -T ~/Desktop/goa/share/goa/ld/genode_rel.ld \
[hello_rust:abi] ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.symbols.o
[hello_rust:abi] mkdir -p ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/
[hello_rust:abi] sed -e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) T/.text; .global \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%function; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%object; .size \1,\2; \1:/p" \
[hello_rust:abi] -e "s/^\(\w\+\) U/.text; .global \1; movq \1@GOTPCREL(%rip), %rax/p" \
[hello_rust:abi] ~/Desktop/genode/depot/genodelabs/api/posix/2020-05-17/lib/symbols/posix > ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/posix.symbols.s
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/posix.symbols.s -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/posix.symbols.o
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-ld -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/posix.lib.so -soname posix.lib.so -shared --eh-frame-hdr -melf_x86_64 \
[hello_rust:abi] -T ~/Desktop/goa/share/goa/ld/genode_rel.ld \
[hello_rust:abi] ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/posix.symbols.o
[hello_rust:abi] rm ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/posix.symbols.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.symbols.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.symbols.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ld.symbols.o
[hello_rust] generate ldso_support.lib.a via command: make -f ~/Desktop/goa/share/goa/lib/gen_ldso_support.mk TOOL_DIR=~/Desktop/goa/share/goa DEPOT_DIR=~/Desktop/genode/depot CROSS_DEV_PREFIX=/usr/local/genode/tool/23.05/bin/genode-x86- APIS=genodelabs/api/base/2023-08-21 ABI_DIR=~/Desktop/goa/examples/hello_rust/var/abi/x86_64 CC_MARCH=-m64
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/src/lib/ldso/so_support.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/so_support.o
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -fPIC -c ~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/src/lib/ldso/so_support.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/so_support.o
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-ar -rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ldso_so_support.lib.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/so_support.o
[hello_rust:abi] /usr/local/genode/tool/23.05/bin/genode-x86-ar -rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/ldso_so_support.lib.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/so_support.o
[hello_rust] generate static library stubs via command: make -f ~/Desktop/goa/share/goa/lib/gen_static_stubs.mk LIBS=execinfo pthread gcc_s c m rt util memstat kvm procstat devstat TOOL_DIR=~/Desktop/goa/share/goa CROSS_DEV_PREFIX=/usr/local/genode/tool/23.05/bin/genode-x86- ABI_DIR=~/Desktop/goa/examples/hello_rust/var/abi/x86_64 CC_MARCH=-m64 CFLAGS=-fPIC -O2 -D__GENODE__ -m64 -Wall -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/x86_64 -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/x86 -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/64bit -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86_64 -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86 -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include -I/usr/local/genode/tool/23.05/lib/gcc/x86_64-pc-elf/12.3.0/include -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/libc -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/libc-genode -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86/libc -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86_64/libc CPPFLAGS=-nostdinc -D__BSD_VISIBLE -D__FreeBSD__=8 -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/x86_64 -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/x86 -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/64bit -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86_64 -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86 -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include -I/usr/local/genode/tool/23.05/lib/gcc/x86_64-pc-elf/12.3.0/include -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/libc -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/libc-genode -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86/libc -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86_64/libc RUST_COMPAT_LIB=~/Desktop/genode/depot/genodelabs/api/compat-libc/2023-08-23/src/lib/compat-libc/compat.cc
[hello_rust:stubs] touch ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libexecinfo.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libexecinfo.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libexecinfo.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libpthread.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libpthread.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libpthread.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libgcc_s.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libgcc_s.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libgcc_s.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-g++ -fPIC -O2 -D__GENODE__ -m64 -Wall -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/x86_64 -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/x86 -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include/spec/64bit -I~/Desktop/genode/depot/genodelabs/api/base/2023-08-21/include -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86_64 -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86 -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include -I/usr/local/genode/tool/23.05/lib/gcc/x86_64-pc-elf/12.3.0/include -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/libc -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/libc-genode -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86/libc -I~/Desktop/genode/depot/genodelabs/api/libc/2023-05-26/include/spec/x86_64/libc -m64 -c ~/Desktop/genode/depot/genodelabs/api/compat-libc/2023-08-23/src/lib/compat-libc/compat.cc -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libc.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/librt.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/librt.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/librt.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libutil.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libutil.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libutil.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libmemstat.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libmemstat.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libmemstat.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libkvm.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libkvm.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libkvm.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libprocstat.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libprocstat.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libprocstat.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-gcc -m64 -c ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/empty.c -o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libdevstat.o
[hello_rust:stubs] /usr/local/genode/tool/23.05/bin/genode-x86-ar rcs ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libdevstat.a ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libdevstat.o
[hello_rust:stubs] rm ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libprocstat.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libkvm.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libutil.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libexecinfo.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libpthread.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libgcc_s.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libdevstat.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libmemstat.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/libm.o ~/Desktop/goa/examples/hello_rust/var/abi/x86_64/librt.o
[hello_rust] build via command cargo build -r --target x86_64-unknown-freebsd --config target.x86_64-unknown-freebsd.linker="/usr/local/genode/tool/23.05/bin/genode-x86-gcc" --config profile.release.panic="abort" -vv
Compiling hello-rust v0.1.0 (~/Desktop/goa/examples/hello_rust/var/build/x86_64)
Running `CARGO=~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=hello-rust CARGO_CRATE_NAME=hello_rust CARGO_MANIFEST_DIR=~/Desktop/goa/examples/hello_rust/var/build/x86_64 CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=hello-rust CARGO_PKG_README='' CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/release/deps:~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib' ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name hello_rust --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=191 --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=abort -C embed-bitcode=no -C metadata=a9607255aec190b5 -C extra-filename=-a9607255aec190b5 --out-dir ~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=/usr/local/genode/tool/23.05/bin/genode-x86-gcc -L dependency=~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps -L dependency=~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/release/deps -C link-arg=-Wl,-gc-sections -C link-arg=-Wl,-z -C link-arg=-Wl,max-page-size=0x1000 -C link-arg=-Wl,--eh-frame-hdr -C link-arg=-Wl,-rpath-link=. -C link-arg=-Wl,-melf_x86_64 -C link-arg=-Wl,-Ttext=0x01000000 -C link-arg=/usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/64/libgcc_eh.a -C link-arg=-nostartfiles -C link-arg=-nodefaultlibs -C link-arg=-static-libgcc -C link-arg=-L~/Desktop/goa/examples/hello_rust/var/abi/x86_64 -C 'link-arg=-l:libc.lib.so' -C 'link-arg=-l:libm.lib.so' -C 'link-arg=-l:posix.lib.so' -C link-arg=-Wl,--dynamic-linker=ld.lib.so -C link-arg=-Wl,--dynamic-list=~/Desktop/goa/share/goa/ld/genode_dyn.dl -C link-arg=-T -C link-arg=~/Desktop/goa/share/goa/ld/genode_dyn.ld -C 'link-arg=-l:ld.lib.so'`
error: linking with `/usr/local/genode/tool/23.05/bin/genode-x86-gcc` failed: exit status: 1
|
= note: LC_ALL="C" VSLANG="1033" "/usr/local/genode/tool/23.05/bin/genode-x86-gcc" "-m64" "/tmp/rustceSy5EC/symbols.o" "~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps/hello_rust-a9607255aec190b5.hello_rust.fb5cc627b83c156f-cgu.0.rcgu.o" "~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps/hello_rust-a9607255aec190b5.1ron4w5uqgjn6mul.rcgu.o" "-Wl,--as-needed" "-L" "~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps" "-L" "~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/release/deps" "-L" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib" "-Wl,-Bstatic" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-b98b1995c63467c0.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libpanic_abort-3083ee1d48d4d8cc.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libobject-8e379a4f11e3c509.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libmemchr-25d7b39788694420.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libaddr2line-f8f5d4439b8aa230.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libgimli-666bb17c7bfd381d.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_demangle-657fa5e611972ccd.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libstd_detect-14768ad75e01deb4.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libhashbrown-1d207c7c02020577.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_alloc-789ca6396400fbd5.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libminiz_oxide-c9c21df3a0204943.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libadler-ade28130672040b7.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libunwind-4aff70baba525730.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libcfg_if-13e5618c8b60ecc0.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/liblibc-e83f9a91e80ed3aa.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/liballoc-55d6fad4e320dfc7.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_core-b1cfd0905fccd682.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libcore-d930c9d2c04d9cdc.rlib" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libcompiler_builtins-1521c2dbdd3bbb52.rlib" "-Wl,-Bdynamic" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lmemstat" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib" "-o" "~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps/hello_rust-a9607255aec190b5" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-Wl,-gc-sections" "-Wl,-z" "-Wl,max-page-size=0x1000" "-Wl,--eh-frame-hdr" "-Wl,-rpath-link=." "-Wl,-melf_x86_64" "-Wl,-Ttext=0x01000000" "/usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/64/libgcc_eh.a" "-nostartfiles" "-nodefaultlibs" "-static-libgcc" "-L~/Desktop/goa/examples/hello_rust/var/abi/x86_64" "-l:libc.lib.so" "-l:libm.lib.so" "-l:posix.lib.so" "-Wl,--dynamic-linker=ld.lib.so" "-Wl,--dynamic-list=~/Desktop/goa/share/goa/ld/genode_dyn.dl" "-T" "~/Desktop/goa/share/goa/ld/genode_dyn.ld" "-l:ld.lib.so"
= note: /usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/../../../../x86_64-pc-elf/bin/ld: ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-b98b1995c63467c0.rlib(std-b98b1995c63467c0.std.c179cdd7ef8a0dd5-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::file_attr':
/rustc/1b198b3a196442e14fb06978166ab46a4618d131/library/std/src/sys/unix/fs.rs:1086: undefined reference to `fstat@FBSD_1.0'
/usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/../../../../x86_64-pc-elf/bin/ld: ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-b98b1995c63467c0.rlib(std-b98b1995c63467c0.std.c179cdd7ef8a0dd5-cgu.0.rcgu.o): in function `std::sys::unix::fs::stat::{{closure}}':
/rustc/1b198b3a196442e14fb06978166ab46a4618d131/library/std/src/sys/unix/fs.rs:1619: undefined reference to `stat@FBSD_1.0'
/usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/../../../../x86_64-pc-elf/bin/ld: /rustc/1b198b3a196442e14fb06978166ab46a4618d131/library/std/src/sys/unix/fs.rs:1619: undefined reference to `stat@FBSD_1.0'
/usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/../../../../x86_64-pc-elf/bin/ld: /rustc/1b198b3a196442e14fb06978166ab46a4618d131/library/std/src/sys/unix/fs.rs:1619: undefined reference to `stat@FBSD_1.0'
/usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/../../../../x86_64-pc-elf/bin/ld: ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-b98b1995c63467c0.rlib(std-b98b1995c63467c0.std.c179cdd7ef8a0dd5-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::file_attr':
/rustc/1b198b3a196442e14fb06978166ab46a4618d131/library/std/src/sys/unix/fs.rs:1086: undefined reference to `fstat@FBSD_1.0'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `hello-rust` (bin "hello-rust") due to previous error
Caused by:
process didn't exit successfully: `CARGO=~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=hello-rust CARGO_CRATE_NAME=hello_rust CARGO_MANIFEST_DIR=~/Desktop/goa/examples/hello_rust/var/build/x86_64 CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=hello-rust CARGO_PKG_README='' CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/release/deps:~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib' ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name hello_rust --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=191 --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=abort -C embed-bitcode=no -C metadata=a9607255aec190b5 -C extra-filename=-a9607255aec190b5 --out-dir ~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=/usr/local/genode/tool/23.05/bin/genode-x86-gcc -L dependency=~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/x86_64-unknown-freebsd/release/deps -L dependency=~/Desktop/goa/examples/hello_rust/var/build/x86_64/target/release/deps -C link-arg=-Wl,-gc-sections -C link-arg=-Wl,-z -C link-arg=-Wl,max-page-size=0x1000 -C link-arg=-Wl,--eh-frame-hdr -C link-arg=-Wl,-rpath-link=. -C link-arg=-Wl,-melf_x86_64 -C link-arg=-Wl,-Ttext=0x01000000 -C link-arg=/usr/local/genode/tool/23.05/bin/../lib/gcc/x86_64-pc-elf/12.3.0/64/libgcc_eh.a -C link-arg=-nostartfiles -C link-arg=-nodefaultlibs -C link-arg=-static-libgcc -C link-arg=-L~/Desktop/goa/examples/hello_rust/var/abi/x86_64 -C 'link-arg=-l:libc.lib.so' -C 'link-arg=-l:libm.lib.so' -C 'link-arg=-l:posix.lib.so' -C link-arg=-Wl,--dynamic-linker=ld.lib.so -C link-arg=-Wl,--dynamic-list=~/Desktop/goa/share/goa/ld/genode_dyn.dl -C link-arg=-T -C link-arg=~/Desktop/goa/share/goa/ld/genode_dyn.ld -C 'link-arg=-l:ld.lib.so'` (exit status: 1)
[hello_rust] Error: build via cargo failed: child process exited abnormally
Thanks @mewmew for trying out the rust support in Goa. I can reproduce your problem with the 23.05 Genode tool chain.
We haven't updated Goa to the new tool chain yet because it still bases on the depot archives from Sculpt OS 23.04, which have been built with the 21.05 tool chain. We are going to update Goa to the new tool chain with the upcoming Sculpt release tough.
Hi @jschlatow,
Thanks @mewmew for trying out the rust support in Goa. I can reproduce your problem with the 23.05 Genode tool chain.
That's good to hear. Glad it's reproducible so it's easier to resolve.
We haven't updated Goa to the new tool chain yet because it still bases on the depot archives from Sculpt OS 23.04, which have been built with the 21.05 tool chain. We are going to update Goa to the new tool chain with the upcoming Sculpt release tough.
Ah, that makes sense. I was just so excited to jump straight into it. I'll continue using the 21.05 tool chain until the next Sculpt release.
Cheers, Robin
@atopia Can you have a look at this?
@mewmew when side-by-side comparing the output of your 23.05 toolchain run and mine, the only discernible difference (safe for local installation paths and random file ordering) is that you were running a nightly toolchain. Even though I find the symptom somewhat confusing (especially when it works for you with the 21.05 toolchain), could you please try building with the 23.05 toolchain and the 1.72 Rust toolchain?
@mewmew when side-by-side comparing the output of your 23.05 toolchain run and mine, the only discernible difference (safe for local installation paths and random file ordering) is that you were running a nightly toolchain. Even though I find the symptom somewhat confusing (especially when it works for you with the 21.05 toolchain), could you please try building with the 23.05 toolchain and the 1.72 Rust toolchain?
@atopia Sure! Trying to provide the details below. Let me know if I missed something.
Using goa (at rev genodelabs/goa@96c82eac69607ec0126590fbc4d9185d5563c820) with the following diff:
+++ b/share/goa/lib/command_line.tcl
@@ -436,8 +436,8 @@ if {![info exists arch]} {
if {![info exists cross_dev_prefix]} {
switch $arch {
- arm_v8a { set cross_dev_prefix "/usr/local/genode/tool/21.05/bin/genode-aarch64-" }
- x86_64 { set cross_dev_prefix "/usr/local/genode/tool/21.05/bin/genode-x86-" }
+ arm_v8a { set cross_dev_prefix "/usr/local/genode/tool/23.05/bin/genode-aarch64-" }
+ x86_64 { set cross_dev_prefix "/usr/local/genode/tool/23.05/bin/genode-x86-" }
default { exit_with_error "tool-chain prefix is not defined" }
}
}
And rustup with version 1.72 installed for both 1.72.0-x86_64-unknown-linux-gnu
and 1.72.0-x86_64-unknown-freebsd
targets. Using 1.72.0-x86_64-unknown-linux-gnu
as the "default" toolchain as it's required to run cargo
on a Linux host.
The x86_64-unknown-freebsd
target should be picked up by the cargo -r --target x86_64-unknown-freebsd
parameter.
$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: /home/u/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu
nightly-2022-08-08-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.72.0-x86_64-unknown-freebsd
1.72.0-x86_64-unknown-linux-gnu (default)
installed targets for active toolchain
--------------------------------------
x86_64-unknown-freebsd
x86_64-unknown-linux-gnu
active toolchain
----------------
1.72.0-x86_64-unknown-linux-gnu (default)
rustc 1.72.0 (5680fa18f 2023-08-23)
@atopia, I think this issue was reproducible at @jschlatow machine as well (ref: https://github.com/genodelabs/goa/issues/63#issuecomment-1695361412).
I'm aware, I was just trying to reduce the differences in our setup :) Now, one noticeable difference between our outputs is that on my system, the order of the arguments to the rm
just before generate ldso_support.lib.a via command matches the
globbing of SYMBOL_FILES
in share/goa/lib/gen_abi_stubs.mk
(and thereafter the order of ABIS
), whereas in your output, the arguments always have a different order. Now I would assume that this is is probably just another unimportant globbing difference anyway, however although from the prefix the rm
has to originate from share/goa/lib/gen_abi_stubs.mk
, I cant seem to figure out where it originates from.
Anyway, the cargo invocation is basically the same, but on my system cargo's linker call to /usr/local/genode/tool/23.05/bin/genode-x86-gcc
succeeds, whereas on your systems it fails, which has me wondering if the ordering matters after all.
Thinking about it, probably the globbing difference is a dead end, but even though -lc
is present in the arguments passed to the linker, on your systems the linker somehow doesn't link against libc.a for whatever reason with the 23.05 toolchain (which of course leads to the missing symbols because they are in a mock libc.a).
I was thinking, perhaps it could be useful to compare the output for the build that fails (using goa with the 23.05 toolchain), vs. the build that succeeds (using goa with the 21.05 toolchain).
Below is the output of the build that succeeds (using the 21.05 toolchain and Rust 1.72.0):
update: Hmm, there doesn't seem to be any difference really. Besides using 21.05 instead of 23.05 for /usr/local/genode/tool/xxx
of course.
The only other places that have changed are one include path (used thrice) and a link path.
--21.05
++23.05
- -I/usr/local/genode/tool/xxx/lib/gcc/x86_64-pc-elf/10.3.0/include
+ -I/usr/local/genode/tool/xxx/lib/gcc/x86_64-pc-elf/12.3.0/include
- link-arg=/usr/local/genode/tool/xxx/bin/../lib/gcc/x86_64-pc-elf/10.3.0/64/libgcc_eh.a
+ link-arg=/usr/local/genode/tool/xxx/bin/../lib/gcc/x86_64-pc-elf/12.3.0/64/libgcc_eh.a
Then, the success vs. failure message at the end of the build:
--21.05
++23.05
- Finished release [optimized] target(s)
+ error: linking with `/usr/local/genode/tool/xxx/bin/genode-x86-gcc` failed: exit status: 1
The plot thickens!
Thinking about it, probably the globbing difference is a dead end, but even though
-lc
is present in the arguments passed to the linker, on your systems the linker somehow doesn't link against libc.a for whatever reason with the 23.05 toolchain (which of course leads to the missing symbols because they are in a mock libc.a).
With the 23.05 toolchain, -lc
looks for files named libc.lib.so
and libc.lib.a
first (https://github.com/genodelabs/genode/commit/44046a82d450e11da13dfa66aef503eaf5c97bd7), so maybe libc.lib.so
gets linked instead of libc.a
? It would not explain why it works on one system and not the other, though.
@cproc, thanks a lot for reminding me of that linker change. Your theory sounds plausible, I've pushed a commit that should fix the issue for @jschlatow and @mewmew if you're correct.
@atopia, wonderful! I can conform that the examples/hello_rust
example now builds and links successfully using the 23.05 toolchain, when using Goa from the 63-fix-linking-on-23.05 branch of Goa.
Great job! And thanks for everyone involved in the trouble-shooting.
I'll leave the issue open until https://github.com/atopia/goa/tree/63-fix-linking-on-23.05 is merged into the main repo of Goa. Feel free to close the issue by then.
Cheerful regards from a sunny Sweden, Robin
Edit: furthermore, I can confirm that linking works successfully both with Rust 1.72, and also with Rust nightly (1.74.0-nightly, ca2b74f1a 2023-09-14).
@mewmew great to hear the fix resolves your issue! @jschlatow if my fix works for you as well and seems reasonable to you, I can prepare a non-WIP commit for staging (or you can pick and amend my commit).
Tested and merged. Thanks @atopia
Wonderful. I'll close this issue as it has been resolved.
(Do you prefer to leave them open until the stable branch has the fix merged?)
@mewmew Yes, we prefer to leave the issues open until the commits entered the master branch.
@mewmew Yes, we prefer to leave the issues open until the commits entered the master branch.
Good to know. (I'll reopen a few issues I just recently closed then.)
First of, I'm very excited to see the recent love and well deserved attention being given to Goa. It will help nurture a rich ecosystem in the Genode world.
I was happy to see the article on Rust support being improved in the Genode 23.08 release, such that the official Rust toolchains could be used unmodified with the Goa tool. This is an incredible improvement in user experience. Thanks for working on this @ssumpf, @atopia and others of the Genode team!
I followed the instructions of the https://genodians.org/atopia/2023-08-24-enabling-the-upstream-rust-toolchain article using the 23.08 release of Genode.
The example code worked perfectly using the official Rust toolchain and the Genode 21.05 toolchain:
However, I noticed that the Goa tool is yet to be updated to use the 23.05 Genode toolchain (as it still relies on the Genode 21.05 toolchain):
https://github.com/genodelabs/goa/blob/96c82eac69607ec0126590fbc4d9185d5563c820/share/goa/lib/command_line.tcl#L440
So, to test it out, I switched from 21.05 to 23.05.
The hello world Rust example gave a link time error when compiled with the 23.05 toolchain, whereas the example compiled and ran perfectly when using the Genode 21.05 toolchain.
Error output:
Let me know if any additional information is required to troubleshoot this issue.
Cheerful summer wishes from Sweden, Robin