gcc-exp.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <sect2>
  2. <title>Command explanations</title>
  3. <para><userinput>--prefix=/static:</userinput> This is NOT a typo. GCC hard
  4. codes some paths while compiling and so we need to pass /static as the
  5. prefix during ./configure. We pass the real install prefix during the
  6. make install command later.</para>
  7. <para><userinput>--with-as and --with-ld:</userinput> GCC can be
  8. miscompiled if your host distribution's Binutils package is quite old. We
  9. need a good working static GCC until we reinstall GCC later in chapter 6.
  10. So by using <filename>as</filename> and <filename>ld</filename> from the
  11. Binutils package we just compiled we ensure that GCC will work
  12. correctly.</para>
  13. <para><userinput>make BOOT_LDFLAGS="-static":</userinput>
  14. This is the equivalent to make LDFLAGS="-static" as we use with other
  15. packages to compile them statically.</para>
  16. <para><userinput>make install-no-fixedincludes:</userinput>
  17. This prevents the fixincludes script from running. Preventing this is
  18. necessary because under normal circumstances the GCC installation will run
  19. the fixincludes script which scans your system for header files that need to
  20. be fixed. It might find that the Glibc header files of your host system need
  21. to be fixed. If so, it will fix them and put them in
  22. <filename>$LFS/static/lib/gcc-lib/i686-pc-linux-gnu/3.2</filename>.
  23. Later on in chapter 6 you will install Glibc which will put its header
  24. files in <filename>/usr/include</filename>. Next you will install other
  25. programs that use the Glibc headers. GCC will look in
  26. <filename>/static/lib/gcc-lib</filename> before looking in
  27. <filename>/usr/include</filename>, with the result of finding and using
  28. the fixed Glibc header files from your host distribution, which are probably
  29. incompatible with the Glibc version actually used on the LFS system.</para>
  30. <para><userinput>ln -s gcc $LFS/static/bin/cc:</userinput> This
  31. creates the $LFS/static/bin/gcc symlink, which some packages need.</para>
  32. </sect2>