This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Using --sysroot with ld is not changing where libstdc++ is searched for
- From: Evan Warren Sangaline <esangaline at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 16 Feb 2013 22:01:27 -0800
- Subject: Using --sysroot with ld is not changing where libstdc++ is searched for
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