2 <title>Installation of GCC</title>
4 <para>This package is known to behave badly when you have changed its default
5 optimization flags (including the -march and -mcpu options). GCC is best
6 left alone, so we recommend you unsetting CFLAGS, CXXFLAGS and other
7 such variables/settings that would change the default optimization that
10 <para>Install GCC by running the following commands. These commands will build
11 the C and C++ compiler. Other compilers are available within the gcc
12 package. If you want to build all the other available compilers too,
13 leave out the --enable-languages=c,c++ option in the configure command.
14 See the GCC documentation for more details on which additional compilers
17 <para>Note: the build of other compilers is not tested by the people
18 who actively work on LFS.</para>
20 <para><screen><userinput>patch -Np1 -i ../gcc-&gcc-patch-version;.patch &&
21 mkdir ../gcc-build &&
22 cd ../gcc-build &&
23 ../gcc-&gcc-version;/configure --prefix=/usr --enable-shared \
24 --enable-languages=c,c++ --enable-threads=posix &&
25 make bootstrap &&
26 make install &&
28 ln -sf ../usr/bin/cpp &&
29 cd /usr/lib &&
30 ln -sf ../bin/cpp &&
31 cd /usr/bin &&
32 ln -sf gcc cc &&
33 rmdir /usr/*-gnu/include &&
34 rmdir /usr/*-gnu</userinput></screen></para>