gcc-2953-inst.xml 2.1 KB

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