5.10. Cross GCC-4.4.1 - Static

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

5.10.1. Installation of Cross GCC Compiler with Static libgcc and no Threads

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

patch -Np1 -i ../gcc-4.4.1-branch_update-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:

AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
    ../gcc-4.4.1/configure --prefix=${CLFS}/cross-tools \
    --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \
    --disable-multilib --with-sysroot=${CLFS} --disable-nls \
    --without-headers --with-newlib --disable-decimal-float \
    --disable-libgomp --disable-libmudflap --disable-libssp \
    --with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \
    --with-ppl=${CLFS}/cross-tools --with-cloog=${CLFS}/cross-tools \
    --disable-shared --disable-threads --enable-languages=c

The meaning of the configure options:

--disable-shared

Disables the creation of the shared libraries.

--disable-threads

This will prevent GCC from looking for the multi-thread include files, since they haven't been created for this architecture yet. GCC will be able to find the multi-thread information after the EGLIBC headers are created.

--enable-languages=c

This option ensures that only the C compiler is built.

Continue with compiling the package:

make all-gcc all-target-libgcc

Install the package:

make install-gcc install-target-libgcc

Details on this package are located in Section 6.11.3, “Contents of GCC.”