gcc-2953.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-gcc-2953">
  7. <title>GCC-&gcc-2953-version;</title>
  8. <?dbhtml filename="gcc-2953.html"?>
  9. <indexterm zone="ch-system-gcc-2953"><primary sortas="a-GCC-2953">GCC-2953</primary></indexterm>
  10. <screen>&buildtime; 1.5 SBU
  11. &buildtime; 130 MB</screen>
  12. <sect2>
  13. <title>Installation of GCC</title>
  14. <para>This package is known to behave badly when you have changed its
  15. default optimization flags (including the -march and -mcpu options).
  16. Therefore, if you have defined any environment variables that override
  17. default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
  18. or modifying them when building GCC.</para>
  19. <para>This is an older release of GCC which we are going to install for the
  20. purpose of compiling the Linux kernel in <xref linkend="chapter-bootable"/>.
  21. This version is recommended by the kernel developers when you need absolute
  22. stability. Later versions of GCC have not received as much testing for Linux
  23. kernel compilation. Using a later version is likely to work, however, we
  24. recommend adhering to the kernel developer's advice and using the version here
  25. to compile your kernel.</para>
  26. <note><para>We don't install the C++ compiler or libraries here. However, there
  27. may be reasons why you would want to install them. More information can be found
  28. at <ulink url="&blfs-root;view/stable/general/gcc2.html"/>.</para></note>
  29. <para>We'll install this older release of GCC into the non-standard prefix of
  30. <filename class="directory">/opt</filename> so as to avoid interfering with
  31. the system GCC already installed in <filename class="directory">/usr</filename>
  32. .</para>
  33. <para>Apply the patches and make a small adjustment:</para>
  34. <screen><userinput>patch -Np1 -i ../gcc-&gcc-2953-version;-2.patch
  35. patch -Np1 -i ../gcc-&gcc-2953-version;-no-fixinc.patch
  36. patch -Np1 -i ../gcc-&gcc-2953-version;-returntype-fix.patch
  37. echo timestamp &gt; gcc/cstamp-h.in</userinput></screen>
  38. <para>The GCC documentation recommends building GCC outside of the source
  39. directory in a dedicated build directory:</para>
  40. <screen><userinput>mkdir ../gcc-2-build
  41. cd ../gcc-2-build</userinput></screen>
  42. <para>Compile and install the compiler:</para>
  43. <screen><userinput>../gcc-&gcc-2953-version;/configure --prefix=/opt/gcc-&gcc-2953-version; \
  44. --enable-shared --enable-languages=c \
  45. --enable-threads=posix
  46. make bootstrap
  47. make install</userinput></screen>
  48. </sect2>
  49. </sect1>