Command explanations
--prefix=/static: This is NOT a typo. GCC hard
codes some paths while compiling and so we need to pass /static as the
prefix during ./configure. We pass the real install prefix during the
make install command later.
--with-as and --with-ld: GCC can be
miscompiled if your host distribution's Binutils package is quite old. We
need a good working static GCC until we reinstall GCC later in chapter 6.
So by using as and ld from the
Binutils package we just compiled we ensure that GCC will work
correctly.
make BOOT_LDFLAGS="-static":
This is the equivalent to make LDFLAGS="-static" as we use with other
packages to compile them statically.
make install-no-fixedincludes:
This prevents the fixincludes script from running. Preventing this is
necessary because under normal circumstances the GCC installation will run
the fixincludes script which scans your system for header files that need to
be fixed. It might find that the Glibc header files of your host system need
to be fixed. If so, it will fix them and put them in
$LFS/static/lib/gcc-lib/i686-pc-linux-gnu/3.2.
Later on in chapter 6 you will install Glibc which will put its header
files in /usr/include. Next you will install other
programs that use the Glibc headers. GCC will look in
/static/lib/gcc-lib before looking in
/usr/include, with the result of finding and using
the fixed Glibc header files from your host distribution, which are probably
incompatible with the Glibc version actually used on the LFS system.
ln -s gcc $LFS/static/bin/cc: This
creates the $LFS/static/bin/gcc symlink, which some packages need.