1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <sect1 id="ch-system-gcc-2953">
|
---|
7 | <title>GCC-&gcc-2953-version;</title>
|
---|
8 | <?dbhtml filename="gcc-2953.html"?>
|
---|
9 |
|
---|
10 | <indexterm zone="ch-system-gcc-2953"><primary sortas="a-GCC-2953">GCC-2953</primary></indexterm>
|
---|
11 |
|
---|
12 | <screen>&buildtime; 1.5 SBU
|
---|
13 | &buildtime; 130 MB</screen>
|
---|
14 |
|
---|
15 | <sect2>
|
---|
16 | <title>Installation of GCC</title>
|
---|
17 |
|
---|
18 | <para>This package is known to behave badly when you have changed its
|
---|
19 | default optimization flags (including the -march and -mcpu options).
|
---|
20 | Therefore, if you have defined any environment variables that override
|
---|
21 | default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
|
---|
22 | or modifying them when building GCC.</para>
|
---|
23 |
|
---|
24 | <para>This is an older release of GCC which we are going to install for the
|
---|
25 | purpose of compiling the Linux kernel in <xref linkend="chapter-bootable"/>.
|
---|
26 | This version is recommended by the kernel developers when you need absolute
|
---|
27 | stability. Later versions of GCC have not received as much testing for Linux
|
---|
28 | kernel compilation. Using a later version is likely to work, however, we
|
---|
29 | recommend adhering to the kernel developer's advice and using the version here
|
---|
30 | to compile your kernel.</para>
|
---|
31 |
|
---|
32 | <note><para>We don't install the C++ compiler or libraries here. However, there
|
---|
33 | may be reasons why you would want to install them. More information can be found
|
---|
34 | at <ulink url="&blfs-root;view/stable/general/gcc2.html"/>.</para></note>
|
---|
35 |
|
---|
36 | <para>We'll install this older release of GCC into the non-standard prefix of
|
---|
37 | <filename class="directory">/opt</filename> so as to avoid interfering with
|
---|
38 | the system GCC already installed in <filename class="directory">/usr</filename>
|
---|
39 | .</para>
|
---|
40 |
|
---|
41 | <para>Apply the patches and make a small adjustment:</para>
|
---|
42 |
|
---|
43 | <screen><userinput>patch -Np1 -i ../gcc-&gcc-2953-version;-2.patch
|
---|
44 | patch -Np1 -i ../gcc-&gcc-2953-version;-no-fixinc.patch
|
---|
45 | patch -Np1 -i ../gcc-&gcc-2953-version;-returntype-fix.patch
|
---|
46 | echo timestamp > gcc/cstamp-h.in</userinput></screen>
|
---|
47 |
|
---|
48 | <para>The GCC documentation recommends building GCC outside of the source
|
---|
49 | directory in a dedicated build directory:</para>
|
---|
50 |
|
---|
51 | <screen><userinput>mkdir ../gcc-2-build
|
---|
52 | cd ../gcc-2-build</userinput></screen>
|
---|
53 |
|
---|
54 | <para>Compile and install the compiler:</para>
|
---|
55 |
|
---|
56 | <screen><userinput>../gcc-&gcc-2953-version;/configure --prefix=/opt/gcc-&gcc-2953-version; \
|
---|
57 | --enable-shared --enable-languages=c \
|
---|
58 | --enable-threads=posix
|
---|
59 | make bootstrap
|
---|
60 | make install</userinput></screen>
|
---|
61 |
|
---|
62 | </sect2>
|
---|
63 |
|
---|
64 | </sect1>
|
---|