Hello,
I'm doing some toolchain/library experimentation, and have been working on an LFS build up through section "5.10. GCC-4.9.1 - Pass 2". What this appears to leave me with, is a functional gcc in /tools/bin, that uses glibc that was compiled (as shown by ldd). This is exactly what I'm after.
The issue comes here- If I prepend /tools/bin to my PATH (as stated earlier in the LFS build doc), ldd shows /tools/bin/gcc using the libraries in the proper /tools/ tree. However, if I don't prepend /tools/bin to my PATH, running ldd on that same executable shows it using system libraries. If relevant, I'm working on Centos 6.6 x64.
Can someone explain to me why this is so? Why does only changing my PATH change library locations as well? Is it possible to force gcc to use a specific c library location regardless of the PATH being set?
Also, looking at the instructions for building gcc (such as 5.5. GCC-4.9.1 - Pass 1), I wanted to make sure I'm understanding what the sed statements are doing:
Code:
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
From what I know of sed (not much) and looking at file diffs, if I understand this correctly, the statements:
- Use the @ symbol as the delimiter
- The first one searches for /lib64, /lib32, and /lib/ld and replaces any instances with /tools (this one is my main confusion)
- The second statement looks for /usr and replaces it with /tools
Are these assumptions correct?