Christer Solskogen
2018-11-08 07:23:25 UTC
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");
Why is directories on the host in SEARCH_DIR? And not
$sysroot/lib:$sysroot:usr/lib ?
/opt/cross/bin/arm-linux-gnueabihf-ld --print-sysroot
/opt/cross/sysroot.arm-linux-gnueabihf
I see that LFS (Linux from scratch) adds --with-lib-path to configure
their temporary cross compiler, but their way confuses me even more as
they point their lib-path to somewhere on the host system that will
contain libraries for the host and not for the target.
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");
Why is directories on the host in SEARCH_DIR? And not
$sysroot/lib:$sysroot:usr/lib ?
/opt/cross/bin/arm-linux-gnueabihf-ld --print-sysroot
/opt/cross/sysroot.arm-linux-gnueabihf
I see that LFS (Linux from scratch) adds --with-lib-path to configure
their temporary cross compiler, but their way confuses me even more as
they point their lib-path to somewhere on the host system that will
contain libraries for the host and not for the target.