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:</para>
12 <para><screen><userinput>patch -Np1 -i ../gcc-&gcc-patch-version;.patch &&
13 mkdir ../gcc-build &&
14 cd ../gcc-build &&
15 ../gcc-&gcc-version;/configure --prefix=/usr --enable-languages=c,c++ \
16 --disable-nls --disable-shared --enable-threads=posix &&
17 make BOOT_LDFLAGS=-static bootstrap &&
18 make prefix=$LFS/usr install &&
19 cd $LFS/lib &&
20 ln -sf ../usr/bin/cpp &&
21 cd $LFS/usr/lib &&
22 ln -sf ../bin/cpp &&
23 cd $LFS/usr/bin &&
24 ln -sf gcc cc &&
25 rmdir $LFS/usr/*-gnu/include &&
26 rmdir $LFS/usr/*-gnu</userinput></screen></para>