On Wed, Jan 3, 2018 at 7:35 PM, Baho Utot <[email protected]> wrote:
> I can not figure this out.
>
> I have rebuilt the whole thing from beginning to end and I always get the
> following upon the test for this chapter. All previous tests are good.
>
> I made a script to do the test which give me the command followed by the
> result then the line with Book: is what I am supposted to get.
>
>
> I simply can not figure out why I get the results I do.
>
> If any one has some insight please educate me on why the difference with
> the book.
>
>
> readelf -l a.out | grep ': /lib'
>
> [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
> Book: [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
>
> grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
>
> /usr/lib/../lib/crt1.o succeeded
> /usr/lib/../lib/crti.o succeeded
> /usr/lib/../lib/crtn.o succeeded
> Book: /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crt1.o
> succeeded
> Book: /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crti.o
> succeeded
> Book: /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crtn.o
> succeeded
>
>
> grep -B4 '^ /usr/include' dummy.log
>
> #include <...> search starts here:
> /usr/include
> Book: #include <...> search starts here:
> Book: /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include
> Book: /usr/local/include
> Book: /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed
> Book: /usr/include
>
> grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
>
> SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib64")
> SEARCH_DIR("/usr/lib")
> SEARCH_DIR("/lib")
> SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib");
> Book: SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
> Book: SEARCH_DIR("/usr/local/lib64")
> Book: SEARCH_DIR("/lib64")
> Book: SEARCH_DIR("/usr/lib64")
> Book: SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
> Book: SEARCH_DIR("/usr/local/lib")
> Book: SEARCH_DIR("/lib")
> Book: SEARCH_DIR("/usr/lib");
>
>
>
> grep "/lib.*/libc.so.6 " dummy.log
>
> attempt to open /lib/libc.so.6 succeeded
> Book: attempt to open /lib/libc.so.6 succeeded
>
>
> grep found dummy.log
>
> found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2
> Book: found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2
>
> removed 'dummy.c'
> removed 'a.out'
> removed 'dummy.log'
>
>
The difference in the book is due to paths being different between
architectures. GCC is programmed for i686 predominantly, and the paths are
changed with symlinks like shown above for x86_64.
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Do not top post on this list.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
http://en.wikipedia.org/wiki/Posting_style