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