%general-entities; ]> Cross GCC-&gcc-version; - Static GCC cross tools, static <para>The GCC package contains the GNU compiler collection, which includes the C and C++ compilers.</para> </sect2> <sect2 role="installation"> <title>Installation of Cross GCC Compiler with Static libgcc and no Threads To make sure that a couple of tools use the proper syntax, apply the following patch: patch -Np1 -i ../&gcc-posix-patch; The following patch is needed for GCC to build against uClibc: patch -Np1 -i ../&gcc-uclibc-patch; The following patch fixes the searching of multilib dirs for specs file.The patch standardizes the gcc drivers path iteration functions, ensuring multilib directories are searched in the correct order. This fixes various issues, most noticably with libtool on multilib systems: patch -Np1 -i ../&gcc-PR20425-patch; The following patch ensures that gcc does not search the /usr directory for libgcc_s.so when cross-compiling: patch -Np1 -i ../&gcc-cross_search-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-&gcc-version;/configure --prefix=${CLFS}/cross-tools \ --host=${CLFS_HOST} --target=${CLFS_TARGET} --disable-multilib \ --with-sysroot=${CLFS} --disable-nls --disable-shared --disable-threads \ --enable-languages=c --disable-threads 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 Glibc headers are created. --enable-languages=c This option ensures that only the C compiler is built. Continue with compiling the package: make all-gcc Install the package: make install-gcc <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para> </sect2> </sect1>