gcc-exp.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. <sect2>
  2. <title>Command explanations</title>
  3. <para><userinput>patch -Np1 -i ../gcc-3.2-nofixincludes-2.patch:</userinput>
  4. This prevents the fixincludes script from running. This is needed because
  5. under normal circumstances the GCC installation will run the fixincludes
  6. scripts which scans your system for header files that need to be fixed. Say
  7. it finds Glibc header files. It will fix them and will end up in
  8. $LFS/static/lib/gcc-lib/i686-pc-linux-gnu/3.2. Later on in chapter 6 you
  9. will install Glibc which will install header files in /usr/include. Next
  10. you will install other programs which will use Glibc headers. GCC will look
  11. in /static/lib/gcc-lib before looking in /usr/include, whichhas the result
  12. of Glibc header files from your host distribution being found and used which
  13. are probably incompatible with the Glibc version actually in use on the LFS
  14. system.</para>
  15. <para><userinput>--prefix=/static:</userinput> This is NOT a typo. GCC hard
  16. codes some paths while compiling and so we need to pass /static as the
  17. prefix during ./configure. We pass the real install prefix during the
  18. make install command later.</para>
  19. <para><userinput>echo "#define HAVE_GAS_HIDDEN 1":</userinput>
  20. This defines the .hidden assembler directive so that we don't build
  21. a faulty Glibc later on.</para>
  22. <para><userinput>make BOOT_LDFLAGS=-static:</userinput>
  23. This is the equivalent to make LDFLAGS=-static as we use with other
  24. packages to compile them statically.</para>
  25. <para><userinput>ln -s gcc $LFS/static/bin/cc:</userinput> This
  26. creates the $LFS/static/bin/gcc symlink, which some packages need.</para>
  27. </sect2>