1 | <sect2>
|
---|
2 | <title>Installation of GCC</title>
|
---|
3 |
|
---|
4 | <para>This package requires its patch to be applied before you can
|
---|
5 | install it. Make sure it's unpacked before running the installation
|
---|
6 | commands.</para>
|
---|
7 |
|
---|
8 | <para>This package is known to behave badly when you have changed its
|
---|
9 | default optimization flags (including the -march and -mcpu options). GCC is
|
---|
10 | best left alone. Therefore, if you have defined any environment variables
|
---|
11 | that override default optimizations, such as CFLAGS and CXXFLAGS, we
|
---|
12 | recommend unsetting or modifying them when building Gcc. You have
|
---|
13 | been warned.</para>
|
---|
14 |
|
---|
15 | <para>Install GCC by running the following commands. These commands will build
|
---|
16 | the C and C++ compiler. Other compilers are available within the gcc
|
---|
17 | package. If you want to build all the other available compilers too,
|
---|
18 | leave out the --enable-languages=c,c++ option in the configure command.
|
---|
19 | See the GCC documentation for more details on which additional compilers
|
---|
20 | are available.</para>
|
---|
21 |
|
---|
22 | <para>Note: the build of other compilers is not tested by the people
|
---|
23 | who actively work on LFS.</para>
|
---|
24 |
|
---|
25 | <para><screen><userinput>patch -Np1 -i ../gcc-&gcc-patch-version;.patch &&
|
---|
26 | mkdir ../gcc-build &&
|
---|
27 | cd ../gcc-build &&
|
---|
28 | ../gcc-&gcc-version;/configure --prefix=/usr --enable-shared \
|
---|
29 | --enable-languages=c,c++ --enable-threads=posix \
|
---|
30 | --with-slibdir=/lib --enable-__cxa_atexit \
|
---|
31 | --enable-clocale=gnu &&
|
---|
32 | make bootstrap &&
|
---|
33 | make install &&
|
---|
34 | ln -s ../usr/bin/cpp /lib &&
|
---|
35 | ln -s ../bin/cpp /usr/lib &&
|
---|
36 | ln -s gcc /usr/bin/cc</userinput></screen></para>
|
---|
37 |
|
---|
38 | </sect2>
|
---|
39 |
|
---|