[Toybox] [landley/toybox] weak symbols hack broke the build (Issue #554)
Rob Landley
rob at landley.net
Wed Jul 2 14:40:59 PDT 2025
> clang: error: unknown argument '-static-libasan'; did you mean '-static-libsan'?
>
> you should just be able to delete that though, since that was your _previous_ workaround for gcc asan issues.
If you remove "--static-libasan" from the reproduction sequence in
commit 635f1e0391b0 then on my devuan daedalus (bookworm minus systemd)
laptop it fails to run with "ASan runtime does not come first in initial
library list; you should either link runtime to your application or
manually preload it with LD_PRELOAD."
The first argument on the gcc command line is "-fsanitize=address" and
gcc itself figured out when to suck in libc and libasan.
The first thing in ldd a.out is linux-vdso.so.1, the second is
libgtk3-nocsd.so.0 which I did not ask for and this isn't a gui program,
the third is libasan.so.8 and the fourth is libc.so.6. Then dl, pthread
(again did not ask), libm, libgcc_s, and ld-linux-x86-64.so.2.
The only library I listed on the command line was the -as-needed
libcrypt, which got optimized out by libasan (but works fine without
asan enabled). All the rest of that the distro's gcc sucked in itself,
in an order I do not control.
At one point you said you were going to poke the llvm guys about
accepting --static-libasan as an alias for --static-libsan but this is
an older version of ubuntu than that discussion:
http://lists.landley.net/pipermail/toybox-landley.net/2024-July/030444.html
I can try to teach portability.sh to check the compiler type when
setting up llvm and use the appropriate variant. A bit brittle for
comfort, but as it's an optional part of the build...
More information about the Toybox
mailing list