aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/gcc-inst.xml
blob: 42772db7298ee494f4d03f27ca7f9ecfce872d53 (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
<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). GCC is best
left alone, so we recommend you unsetting CFLAGS, CXXFLAGS and other
such variables/settings that would change the default optimization that
it comes with.</para>

<para>Install GCC by running the following commands. These commands will build
the C and C++ compiler. Other compilers are available within the gcc
package. If you want to build all the other available compilers too,
leave out the --enable-languages=c,c++ option in the configure command.
See the GCC documentation for more details on which additional compilers
are available.</para>

<para>Note: the build of other compilers is not tested by the people 
who actively work on LFS.</para>

<para><screen><userinput>patch -Np1 -i ../gcc-&gcc-patch-version;.patch &amp;&amp;
mkdir ../gcc-build &amp;&amp;
cd ../gcc-build &amp;&amp;
../gcc-&gcc-version;/configure --prefix=/usr --enable-shared \
&nbsp;&nbsp;&nbsp;--enable-languages=c,c++ --enable-threads=posix &amp;&amp;
make bootstrap &amp;&amp;
make install &amp;&amp;
cd /lib &amp;&amp;
ln -sf ../usr/bin/cpp &amp;&amp;
cd /usr/lib &amp;&amp;
ln -sf ../bin/cpp &amp;&amp;
cd /usr/bin &amp;&amp;
ln -sf gcc cc &amp;&amp;
rmdir /usr/*-gnu/include &amp;&amp;
rmdir /usr/*-gnu</userinput></screen></para>

</sect2>