Using --sysroot with ld is not changing where libstdc++ is searched for
Mike Frysinger
vapier@gentoo.org
Wed Feb 20 06:23:00 GMT 2013
On Sunday 17 February 2013 01:01:27 Evan Warren Sangaline wrote:
> 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?
you should run gcc with -v -Wl,--verbose and examine the output
it would also help if you posted the full command you're running and the
output you're seeing. there are many variables in play here and trying to
guess at which are applicable can be a huge waste of time.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/binutils/attachments/20130220/d777efc3/attachment.sig>
More information about the Binutils
mailing list