This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using --sysroot with ld is not changing where libstdc++ is searched for


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

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]