[Bug sanitizer/69839] cross-compiling programs w/-fsanitize=address fails: ld: warning: libstdc++.so.6, needed by libasan.so, not found (try using -rpath or -rpath-link)
joakim.tjernlund at infinera dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 25 15:26:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69839
--- Comment #6 from Joakim Tjernlund <joakim.tjernlund at infinera dot com> ---
(In reply to Jakub Jelinek from comment #5)
> Likely a bug on the Gentoo side.
> The linker handles differently libraries specified on the command line and
> libraries that are needed by those shared libraries, but are not mentioned
> on the command line. See binutils documentation.
Digging into this I noticed ld searches $sysroot/etc/ld.so.conf so
I tried adding /usr/lib/gcc/powerpc-g2.20-linux-gnu/4.9.3/, like so:
# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
/usr/powerpc-g2.20-linux-gnu/lib
/usr/lib/gcc/powerpc-g2.20-linux-gnu/4.9.3/
However I see using strace that ld tries to open:
"/usr/powerpc-g2.20-linux-gnu/usr/lib/gcc/powerpc-g2.20-linux-gnu/4.9.3/libstdc++.so.6
That is, ld prefixes every path in ld.so.conf with $sysroot.
Is that correct or a bug in binutils?
More information about the Gcc-bugs
mailing list