gcc-exp.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  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 fixed header files from being installed. This is needed
  18. because under normal circumstances the GCC installation will run the
  19. fixincludes scripts which scans your system for header files that need to be
  20. fixed. Say it finds Glibc header files. It will fix them and will end up in
  21. $LFS/static/lib/gcc-lib/i686-pc-linux-gnu/ Later on in chapter 6 you
  22. will install Glibc which will install header files in /usr/include. Next
  23. you will install other programs which will use Glibc headers. GCC will look
  24. in /static/lib/gcc-lib before looking in /usr/include, which has the result
  25. of Glibc header files from your host distribution being found and used which
  26. are probably incompatible with the Glibc version actually in use on the LFS
  27. system.</para>
  28. <para><userinput>ln -s gcc $LFS/static/bin/cc:</userinput> This
  29. creates the $LFS/static/bin/gcc symlink, which some packages need.</para>
  30. </sect2>