%general-entities; ]> gcc &gcc-version;
&gcc-url;
GCC-&gcc-version; - Pass 1 GCC tools, pass 1 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/gcc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> <seg>&gcc-ch5p1-sbu;</seg> <seg>&gcc-ch5p1-du;</seg> </seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Cross GCC GCC now requires the GMP and MPFR packages. As these packages may not be included in your host distribution, they will be built with GCC: tar -jxf ../mpfr-&mpfr-version;.tar.bz2 mv -v mpfr-&mpfr-version; mpfr tar -jxf ../gmp-&gmp-version;.tar.bz2 mv -v gmp-&gmp-version; gmp 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 \ --target=$LFS_TGT --prefix=/tools \ --disable-nls --disable-shared --disable-multilib \ --disable-decimal-float --disable-threads \ --disable-libmudflap --disable-libssp \ --disable-libgomp --enable-languages=c The meaning of the configure options: --disable-shared This switch forces GCC to link its internal libraries statically. We do this to avoid possible issues with the host system. --disable-decimal-float, --disable-threads, --disable-libmudflap, --disable-libssp, --disable-libgomp These switches disable support for the decimal floating point extension, threading, libmudflap, libssp and libgomp respectively. These features will fail to compile when building a cross-compiler and are not necessary for the task of cross-compiling the temporary libc. --disable-multilib On x86_64, LFS does not yet support a multilib configuration. This switch is harmless for x86. --enable-languages=c This option ensures that only the C compiler is built. This is the only language needed now. Compile GCC by running: make Compilation is now complete. At this point, the test suite would normally be run, but, as mentioned before, the test suite framework is not in place yet. The benefits of running the tests at this point are minimal since the programs from this first pass will soon be replaced. Install the package: make install Using --disable-shared means that the libgcc_eh.a file isn't created and installed. The Glibc package depends on this library as it uses -lgcc_eh within its build system. This dependency can be satisfied by creating a symlink to libgcc.a, since that file will end up containing the objects normally contained in libgcc_eh.a: ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \ sed 's/libgcc/&_eh/'` <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para> </sect2> </sect1>