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: sysroot and lib-path


On Thu, Nov 08, 2018 at 08:23:25AM +0100, Christer Solskogen wrote:
> Hi!
> 
> I'm a bit confused on how binutils (or really ld.bfd / gold)  works when
> building a cross compiler.
> For instance, if I build binutils like this:
> --target=arm-linux-gnueabihf
> --with-sysroot=/opt/cross/sysroot.arm-linux-gnueabihf
> 
>  /opt/cross/bin/arm-linux-gnueabihf-ld --verbose | grep SEAR
> SEARCH_DIR("=/opt/cross/arm-linux-gnueabihf/lib");
> SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");

You don't get the first SEARCH_DIR line you show if you are using the
FSF binutils sources with the configure options you state.  I suspect
you also configured with --prefix=/opt/cross.

> Why is directories on the host in SEARCH_DIR? And not
> $sysroot/lib:$sysroot:usr/lib ?

But these are all in the sysroot.  The sysroot is substituted for the
'=' in the search paths by ld.  This allows ld's configure time
sysroot to be overridden on the ld command line with --sysroot=.

-- 
Alan Modra
Australia Development Lab, IBM


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