Le 10/12/2013 23:38, John Burrell a écrit : > . >> I do not quite understand what you have done. Your first build was linux >> headers then glibc? Without doing anything with gcc? > Well I'm building the archive files using a machine running LFS so gcc is > version 4.8.2 > >> If so, you cannot expect >> gcc to know about the glibc you built. All those SEARCH_DIR lines come from >> gcc. Sorry, my bad! those lines are from ld, which is called by gcc under the name "collect2". They are set from the -rpath and -rpath-link option. I suggest you have a look at those 2 options in "man ld". > That's my question - how do I get gcc to 'see' the libraries that I created > in the glibc archive file instead of using the libraries on LFS which are > under /lib64? > >> You can tweak the spec file of gcc. How to do that is described in the gcc >> manual "gcc.info", section 3.15 "Specifying subprocesses and switches to pass >> to them". It used to be described in LFS as "a bit of black magic" >> >> basically, you run: >> gcc -dumpspecs> spec-filename >> then you edit spec-filename >> then each time you use gcc, you have to type: >> gcc -specs=spec-filename > That's what I've done and you can see from my original output that gcc is > using the headers from the linux-headers archive and it's picking up the > correct dynamic linker from the glibc archive because I specified it in the > specs file. But it doesn't pick up the correct libc.so.6 file. It's getting > it from /lib64 from LFS whereas I want it to use the files in the glibc > archive. Hence my question above - how do I get gcc to use the libraries in > the glibc archive? If I can get the first SEARCH _DIR in the list to be the > library location in the glibc archive file, then gcc will find the correct > library files, will it not? > > jb. As how to automate the setting of rpath under gcc, I guess you can with the specs, but I have never done it. You can see what the actual call to ld (collect2) is by running "gcc -v". And you can add -Wl,-verbose (the l in the preceding is "ell"), to see what ld is actually doing.
Regards Pierre -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page