gcc-2953-inst.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 Chapter 8. This version is recommended
  11. by the kernel developers when you need absolute stability. Later versions of
  12. GCC have not received as much testing for Linux kernel compilation. Using a
  13. later version is likely to work, however, we recommend adhering to the kernel
  14. developer's advice and using the version here to compile your kernel.</para>
  15. <note><para>We don't install the C++ compiler or libraries here. However, there
  16. may be reasons why you would want to install them. More information can be found
  17. at <ulink url="&blfs-root;view/stable/general/gcc2.html"/>.</para></note>
  18. <para>We'll install this older release of GCC into the non-standard prefix of
  19. <filename class="directory">/opt</filename> so as to avoid interfering with
  20. the system GCC already installed in <filename class="directory">/usr</filename>
  21. .</para>
  22. <para>Apply the patches and make a small adjustment:</para>
  23. <screen><userinput>patch -Np1 -i ../&gcc-2953-patch;
  24. patch -Np1 -i ../&gcc-2953-no-fixinc-patch;
  25. patch -Np1 -i ../&gcc-2953-returntype-fix-patch;
  26. echo timestamp &gt; gcc/cstamp-h.in</userinput></screen>
  27. <para>The GCC documentation recommends building GCC outside of the source
  28. directory in a dedicated build directory:</para>
  29. <screen><userinput>mkdir ../gcc-2-build
  30. cd ../gcc-2-build</userinput></screen>
  31. <para>Compile and install gcc:</para>
  32. <screen><userinput>../gcc-2.95.3/configure --prefix=/opt/gcc-2.95.3 \
  33. &nbsp;&nbsp;&nbsp;&nbsp;--enable-shared --enable-languages=c \
  34. &nbsp;&nbsp;&nbsp;&nbsp;--enable-threads=posix
  35. make bootstrap
  36. make install</userinput></screen>
  37. </sect2>