gcc-2953.xml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <sect1 id="ch-system-gcc-2953">
  2. <title>Installing GCC-2.95.3</title>
  3. <?dbhtml filename="gcc-2953.html" dir="chapter06"?>
  4. <screen>&buildtime; &gcc-2953-time;
  5. &diskspace; &gcc-2953-compsize;</screen>
  6. <sect2><title></title>
  7. <literallayout>Official download location for GCC-2 (&gcc-2953-version;):
  8. <ulink url="ftp://ftp.gnu.org/pub/gnu/gcc/"/>
  9. And for the GCC-2 Patch:
  10. <ulink url="&patches-root;&gcc-2953-patch;"/>
  11. And for the GCC-2 No-Fixincludes Patch:
  12. <ulink url="&patches-root;&gcc-2953-no-fixinc-patch;"/>
  13. And for the GCC-2 Return-Type Patch:
  14. <ulink url="&patches-root;&gcc-2953-returntype-fix-patch;"/></literallayout>
  15. </sect2>
  16. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  17. <sect2>
  18. <title>Installation of GCC</title>
  19. <para>This package is known to behave badly when you have changed its
  20. default optimization flags (including the -march and -mcpu options).
  21. Therefore, if you have defined any environment variables that override
  22. default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
  23. or modifying them when building GCC.</para>
  24. <para>This is an older release of GCC which we are going to install for the
  25. purpose of compiling the Linux kernel in <xref linkend="chapter-mixture"/>. This
  26. version is recommended
  27. by the kernel developers when you need absolute stability. Later versions of
  28. GCC have not received as much testing for Linux kernel compilation. Using a
  29. later version is likely to work, however, we recommend adhering to the kernel
  30. developer's advice and using the version here to compile your kernel.</para>
  31. <note><para>We don't install the C++ compiler or libraries here. However, there
  32. may be reasons why you would want to install them. More information can be found
  33. at <ulink url="&blfs-root;view/stable/general/gcc2.html"/>.</para></note>
  34. <para>We'll install this older release of GCC into the non-standard prefix of
  35. <filename class="directory">/opt</filename> so as to avoid interfering with
  36. the system GCC already installed in <filename class="directory">/usr</filename>
  37. .</para>
  38. <para>Apply the patches and make a small adjustment:</para>
  39. <screen><userinput>patch -Np1 -i ../&gcc-2953-patch;
  40. patch -Np1 -i ../&gcc-2953-no-fixinc-patch;
  41. patch -Np1 -i ../&gcc-2953-returntype-fix-patch;
  42. echo timestamp &gt; gcc/cstamp-h.in</userinput></screen>
  43. <para>The GCC documentation recommends building GCC outside of the source
  44. directory in a dedicated build directory:</para>
  45. <screen><userinput>mkdir ../gcc-2-build
  46. cd ../gcc-2-build</userinput></screen>
  47. <para>Compile and install the compiler:</para>
  48. <screen><userinput>../&gcc-2953-dir;/configure --prefix=/opt/&gcc-2953-dir; \
  49. &nbsp;&nbsp;&nbsp;&nbsp;--enable-shared --enable-languages=c \
  50. &nbsp;&nbsp;&nbsp;&nbsp;--enable-threads=posix
  51. make bootstrap
  52. make install</userinput></screen>
  53. </sect2>
  54. </sect1>