Using --sysroot with ld is not changing where libstdc++ is searched for
Evan Warren Sangaline
esangaline@gmail.com
Sun Feb 17 06:01:00 GMT 2013
Hello,
I compiled binutils 2.23 using --with-sysroot=/path and
--with-build-sysroot=/path configure options. I'm now trying to
compile something using g++ where the necessary libraries are in
/path. I get the following message when I do this:
/opt/transfer/bin/ld: skipping incompatible /usr/lib/libstdc++.so.6
when searching for /usr/lib/libstdc++.so.6 /opt/transfer/bin/ld:
cannot find /usr/lib/libstdc++.so.6 ld returned 1 exit status
If I remove the /path directory then I additionally get many messages
about libraries not being found. This not found behavior is what I
would expect but it still complains about libstdc++ being an
incompatible version. If I instead swap the system
/usr/lib/libstdc++.so.6 out with the one in /path/usr/lib then the
linking works fine with no errors. It looks like ld is still looking
in /usr/lib for libstdc++ even when I pass it the --sysroot=/path
option.
Should ld be looking in /path/usr/lib or /usr/lib for libstdc++ when I
use --sysroot=/path? Is there any way that I can force it to look in
/path/usr/lib instead?
Thanks and best regards,
Evan
More information about the Binutils
mailing list