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