[lfs-support] 6.17. GCC-4.8.1 - Linker search paths

William Harrington kb0iic at berzerkula.org
Tue Oct 1 12:33:56 PDT 2013


On Oct 1, 2013, at 2:23 PM, Craig Magee wrote:
>
> >
> > However, grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' returns
> > only:
> > SEARCH_DIR("/usr/lib")
> > SEARCH_DIR("/lib");
>
> You may want to run:
>
> strings /usr/bin/ld | grep SEARCH_DIR
>
> If you did not install binutils, you will get the result above instead
> of what is at 6.17 in LFS 7.4
>
> Sincerely,
>
> William Harrington
>
> I'm not sure where I went wrong, but you were on the right track  
> there, William.
>
> Figuring I'd made a mistake somewhere along the toolchain I went  
> back to 6.13. Binutils-2.23.2.  I'm not sure if I needed to rebuild  
> the gmp, mpfr, atd mpc libraries but did to be sure, and got up to  
> running the gcc make tests before passing out from sleep deprivation  
> myself.
> I get the expected result from the library search path toolchain  
> test! :D
>
> Thanks for your time and assistance, everyone.  And your ongoing  
> support of LFS.  It's highly valued.

The reason you got /usr/lib and /lib is becuase the linker built in  
binutils pass2 when rebuilding ld for the second time has the default  
lib path of /lib and /usr/lib:

http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass2.html

make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
cp -v ld/ld-new /tools/bin

If you forget to install binutils in ch6, you are still using ld-new  
which was copied to ld during the toolchain adjustment in ch6.
That ld has default SEARCH_DIR of /usr/lib:/lib
Sincerely,
William Harrington



More information about the lfs-support mailing list