https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69839
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Joakim Tjernlund from comment #6) > (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? That is correct.