[lfs-support] LFS-BOOK-7​.0; Chapter 5.2 Toolchain Technical Notes - clarificat​ions

Emerson Yesupatham yemerson1976 at gmail.com
Mon Sep 3 11:55:42 PDT 2012

Hi Team,
My below mail got bounced. By mistake I sent it o lfs-support-request.


I am going through toolchain technical notes for the second time to
understand it better.

>From the Book:
 "Slightly adjusting the name of the working platform, by changing the
"vendor" field target triplet by way of the LFS_TGT variable, ensures
that the first build of Binutils and GCC produces a compatible
cross-linker and cross-compiler. Instead of producing binaries for
another architecture, the cross-linker and cross-compiler will produce
binaries compatible with the current hardware."

In order to understand the above point, I have cross-compiled the
binutils as per pass-1 configure instructions. Also I have compiled it
separately for my config.guess target (basically not cross-compiling)
and ran the below command and took the difference

>>./ld --verbose | grep SEARCH

The search path shows that the cross-linker searches only inside
/tools/target-triplet/lib folder and not searching in HOST's folders
like /usr/lib, /usr/local/lib and /lib, thus removes dependency on
host system.  This part is fine, I could understand.

Coming to the next point.
"The temporary libraries are cross-compiled. Because a cross-compiler
by its nature cannot rely on anything from its host system, this
method removes potential contamination of the target system by
lessening the chance of headers or libraries from the host being
incorporated into the new tools."

When we say librarires are cross-compiled, what exactly we mean? In
libraries also any hard-wired PATHS are present and they are modified
to /tools/target-triplet/ ?
 I mean, when we cross-compile the linker (above) it limits its search
folder within /tools/  , without cross-compilation it would have
searched in /usr/lib/ etc. Similarly any changes (path names, inculde
path etc) happens in the library files (say libc.so/.a)?

or by cross-compilation of libraries we mean libraries which are
present inside /tools/i686-lfs-linux-gnu/lib ONLY are used hence forth
by cross-linker and cross-compiler?

Thanks for bearing the questions. Looking forward your inputs.


More information about the lfs-support mailing list