gcc-2953.xml 2.3 KB

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