Tuesday, June 1, 2010

Chapter 5.8 Toolchain

Getting a bit scary...Reading technical notes because I really do not know what they are talking about. The purpose of this discussion is, I believe, to demonstrate that I am NOT supposed to see ANYTHING in the text that refers to /usr or /lib.

  1. Name of the platform? I dutifully unpacked binutils and ran the command ./config.guess (I got a "command not found" without the dot) and I have: i686-pc-linux-gnu.
  2. Platform's dynamic linker*. A random binary? I tried gcc. readelf -l /usr/bin/gcc | grep interpreter

    [Requesting program interpreter: /lib/ld-linux.so.2]
  3. Linker library search order: ld --verbose | grep SEARCH

    SEARCH_DIR("/usr/i586-mandriva-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
  4. Detailed information about the preprocessor, compilation, and assembly stages, gcc dummy.c -Wl,--verbose 2>&1 | grep succeeded

    Several lines that look like: "attempt to open /lib/ld-linux.so.2 succeeded"
(*) definition: "dynamic linker provided by Glibc finds and loads the shared libraries needed by a program, prepares the program to run, and then runs it)"



I believe that the next commands will change the environment. It is therefore not important from which directory they are run. I do not understand what the SPECS is doing but note that it is unset at the end. Meaning, it has no meaning in my current environment (not lfs yet).

OK, this looks good! Before all this, in the technical notes section, I had obtained /lib/ld-linux.so.2. Now, when I run: readelf -l a.out | grep ': /tools', I get:  [Requesting program interpreter: /tools/lib/ld-linux.so.2]

All paths should have the word tools in them!

No comments:

Post a Comment