Not able to find libraries if sysroot= tooldir

Christer Solskogen christer.solskogen@gmail.com
Fri Jan 18 07:10:00 GMT 2019


On 18.01.2019 03:39, Alan Modra wrote:
> On Thu, Jan 17, 2019 at 10:12:48AM +0100, Christer Solskogen wrote:
>> /opt/cross/x86_64-blug-linux-gnu/bin/ld: cannot find crti.o: No such file or
>> directory
> 
> This one isn't anything to do with ld.  gcc isn't finding crti.o and
> thus isn't passing the full path to ld.
> 

Which is weird. Is gcc to blame?

builder@centos6-builder:/tmp$ x86_64-blug-linux-gnu-gcc -print-sysroot
/opt/cross/x86_64-blug-linux-gnu
builder@centos6-builder:/tmp$ x86_64-blug-linux-gnu-ld -print-sysroot
/opt/cross/bin/../x86_64-blug-linux-gnu

Both of them point to the same sysroot.

>> /opt/cross/x86_64-blug-linux-gnu/bin/ld: cannot find -lc
> 
> If your libc.so is a script as it usually is on linux, do you have the
> paths correct in the script?  They shouldn't include the sysroot
> prefix..
> 

As I've said: If sysroot it set to 
/opt/cross/x86_64-blug-linux-gnu/sysroot or 
/opt/cross/x86_64-blug-linux-gnu.sysroot - the error does not occur.



More information about the Binutils mailing list