6.11. GCC-4.3.3 - Cross Compiler Final

The GCC package contains the GNU compiler collection, which includes the C and C++ compilers.

6.11.1. Installation of GCC Cross Compiler

The following patch contains a number of updates to the 4.3.3 branch by the GCC developers:

patch -Np1 -i ../gcc-4.3.3-branch_update-5.patch

To make sure that a couple of tools use the proper syntax, apply the following patch:

patch -Np1 -i ../gcc-4.3.3-posix-1.patch

The GCC documentation recommends building GCC outside of the source directory in a dedicated build directory:

mkdir -v ../gcc-build
cd ../gcc-build

Prepare GCC for compilation:

../gcc-4.3.3/configure --prefix=${CLFS}/cross-tools \
  --build=${CLFS_HOST} --target=${CLFS_TARGET} --host=${CLFS_HOST} \
  --with-sysroot=${CLFS} --disable-nls --enable-shared \
  --enable-languages=c --enable-c99 --enable-long-long \
  --with-mpfr=/cross-tools --with-gmp=/cross-tools

The meaning of the new configure options:

--enable-languages=c

This option ensures that only the C compiler is built.

--enable-c99

Enable C99 support for C programs.

--enable-long-long

Enables long long support in the compiler.

Continue with compiling the package:

make

Install the package:

make install

6.11.2. Contents of GCC

Installed programs: cc (link to gcc), gcc, gccbug, and gcov
Installed libraries: libgcc.a, libgcc_eh.a, libgcc_s.so, libmudflap.[a,so], and libmudflapth.[a,so]

Short Descriptions

cc

The C compiler

gcc

The C compiler

gccbug

A shell script used to help create useful bug reports

gcov

A coverage testing tool; it is used to analyze programs to determine where optimizations will have the most effect

libgcc

Contains run-time support for gcc

libmudflap

The libmudflap libraries are used by GCC for instrumenting pointer and array dereferencing operations.