%general-entities; %patches-entities; ]> GCC-&gcc-version; GCC temporary system <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../../final-system/common/gcc.xml" xpointer="xpointer(//*[@role='package']/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> <seg>Not checked yet</seg> <seg>Not checked yet</seg> </seglistitem> </segmentedlist> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../../final-system/common/gcc.xml" xpointer="xpointer(//*[@role='package']/segmentedlist[2])"/> </sect2> <sect2 role="installation"> <title>Installation of GCC Now we will change cpp's search path not to look in /usr/include: cp gcc/cppdefault.c{,.orig} sed -e '/#define STANDARD_INCLUDE_DIR/s@"/usr/include"@0@g' \ gcc/cppdefault.c.orig > gcc/cppdefault.c Also, we need to set the directory searched by the fixincludes process for system headers, so it won't look at the host's headers: cp gcc/Makefile.in{,.orig} sed -e 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \ gcc/Makefile.in.orig > gcc/Makefile.in Use our cross-complier instead of the one GCC builds, named xgcc: cp gcc/mklibgcc.in{,.orig} sed -e "s@\./xgcc@/cross-tools/bin/${CC}@g" \ gcc/mklibgcc.in.orig > gcc/mklibgcc.in Before starting to build GCC, remember to unset any environment variables that override the default optimization flags. ../gcc-&gcc-version;/configure --prefix=/tools \ --build=${LFS_HOST} --host=${LFS_TARGET} --target=${LFS_TARGET} \ --libexecdir=/tools/lib --with-local-prefix=/tools --enable-long-long \ --enable-c99 --enable-shared --enable-threads=posix --enable-__cxa_atexit \ --disable-nls --enable-languages=c,c++ --disable-libstdcxx-pch The meaning of the new configure options: --libexecdir=/tools/lib This do ... --disable-libstdcxx-pch Do not build the pre-compiled header (PCH) for libstdc++. It takes up a lot of space, and we have no use for it. Compile the package: make AS_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-as" \ LD_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-ld" Install the package: make install ln -s gcc /tools/bin/cc <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para> </sect2> </sect1>