[bf8c11f] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | <!ENTITY % patches-entities SYSTEM "../../patches.ent">
|
---|
| 6 | %general-entities;
|
---|
| 7 | %patches-entities;
|
---|
| 8 | ]>
|
---|
| 9 |
|
---|
| 10 | <sect1 id="ch-temp-system-gcc" role="wrap">
|
---|
| 11 | <?dbhtml filename="gcc.html"?>
|
---|
| 12 |
|
---|
| 13 | <title>GCC-&gcc-version;</title>
|
---|
| 14 |
|
---|
| 15 | <indexterm zone="ch-temp-system-gcc">
|
---|
| 16 | <primary sortas="a-GCC">GCC</primary>
|
---|
| 17 | <secondary>temporary system</secondary>
|
---|
| 18 | </indexterm>
|
---|
| 19 |
|
---|
[98b2c00] | 20 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 21 | href="../../final-system/common/gcc.xml"
|
---|
| 22 | xpointer="xpointer(//*[@role='package'])"/>
|
---|
[bf8c11f] | 23 |
|
---|
| 24 | <sect2 role="installation">
|
---|
| 25 | <title>Installation of GCC</title>
|
---|
| 26 |
|
---|
| 27 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 28 | href="../../cross-tools/x86/gcc-static.xml"
|
---|
| 29 | xpointer="xpointer(//*[@os='aa'])"/>
|
---|
| 30 |
|
---|
| 31 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 32 | href="../../cross-tools/x86/gcc-static.xml"
|
---|
| 33 | xpointer="xpointer(//*[@os='ab'])"/>
|
---|
| 34 |
|
---|
| 35 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 36 | href="../../cross-tools/x86/gcc-static.xml"
|
---|
| 37 | xpointer="xpointer(//*[@os='ac'])"/>
|
---|
| 38 |
|
---|
| 39 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 40 | href="../../cross-tools/x86/gcc-static.xml"
|
---|
| 41 | xpointer="xpointer(//*[@os='ad'])"/>
|
---|
| 42 |
|
---|
| 43 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 44 | href="../../cross-tools/x86/gcc-static.xml"
|
---|
| 45 | xpointer="xpointer(//*[@os='ae'])"/>
|
---|
| 46 |
|
---|
| 47 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 48 | href="../../cross-tools/x86/gcc-static.xml"
|
---|
| 49 | xpointer="xpointer(//*[@os='af'])"/>
|
---|
| 50 |
|
---|
| 51 | <para os="cd">Now we will change <command>cpp</command>'s search path not to look in
|
---|
| 52 | <filename class="directory">/usr/include</filename>:</para>
|
---|
| 53 |
|
---|
| 54 | <screen os="ce"><userinput>cp gcc/cppdefault.c{,.orig}
|
---|
| 55 | sed -e '/#define STANDARD_INCLUDE_DIR/s@"/usr/include"@0@g' \
|
---|
| 56 | gcc/cppdefault.c.orig > gcc/cppdefault.c</userinput></screen>
|
---|
| 57 |
|
---|
| 58 | <para os="cf">Also, we need to set the directory searched by the fixincludes
|
---|
| 59 | process for system headers, so it won't look at the host's headers:</para>
|
---|
| 60 |
|
---|
| 61 | <screen os="cg"><userinput>cp gcc/Makefile.in{,.orig}
|
---|
| 62 | sed -e 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \
|
---|
| 63 | gcc/Makefile.in.orig > gcc/Makefile.in</userinput></screen>
|
---|
| 64 |
|
---|
| 65 | <para os="ch">Use our cross-complier instead of the one GCC builds, named
|
---|
| 66 | <command>xgcc</command>:</para>
|
---|
| 67 |
|
---|
| 68 | <screen os="ci"><userinput>cp gcc/mklibgcc.in{,.orig}
|
---|
| 69 | sed -e "s@\./xgcc@/cross-tools/bin/${CC}@g" \
|
---|
| 70 | gcc/mklibgcc.in.orig > gcc/mklibgcc.in</userinput></screen>
|
---|
| 71 |
|
---|
| 72 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 73 | href="../../cross-tools/x86/gcc-static.xml"
|
---|
| 74 | xpointer="xpointer(//*[@os='ak'])"/>
|
---|
| 75 |
|
---|
| 76 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 77 | href="../../final-system/common/gcc.xml"
|
---|
| 78 | xpointer="xpointer(//*[@os='f'])"/>
|
---|
| 79 |
|
---|
| 80 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 81 | href="../../final-system/common/gcc.xml"
|
---|
| 82 | xpointer="xpointer(//*[@os='g'])"/>
|
---|
| 83 |
|
---|
| 84 | <para os="cj">Before starting to build GCC, remember to unset any environment
|
---|
| 85 | variables that override the default optimization flags.</para>
|
---|
| 86 |
|
---|
| 87 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 88 | href="../../final-system/common/gcc.xml"
|
---|
| 89 | xpointer="xpointer(//*[@os='h'])"/>
|
---|
| 90 |
|
---|
| 91 | <screen><userinput>../gcc-&gcc-version;/configure --prefix=/tools \
|
---|
| 92 | --build=${LFS_HOST} --host=${LFS_TARGET} --target=${LFS_TARGET} \
|
---|
| 93 | --libexecdir=/tools/lib --with-local-prefix=/tools --enable-long-long \
|
---|
| 94 | --enable-c99 --enable-shared --enable-threads=posix --enable-__cxa_atexit \
|
---|
| 95 | --disable-nls --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen>
|
---|
| 96 |
|
---|
| 97 | <variablelist os="ck">
|
---|
| 98 | <title>The meaning of the new configure options:</title>
|
---|
| 99 |
|
---|
| 100 | <varlistentry os="ck1">
|
---|
| 101 | <term><parameter>--libexecdir=/tools/lib</parameter></term>
|
---|
| 102 | <listitem>
|
---|
| 103 | <para>This do ...</para>
|
---|
| 104 | </listitem>
|
---|
| 105 | </varlistentry>
|
---|
| 106 |
|
---|
| 107 | <varlistentry os="ck2">
|
---|
| 108 | <term><parameter>--disable-libstdcxx-pch</parameter></term>
|
---|
| 109 | <listitem>
|
---|
| 110 | <para>Do not build the pre-compiled header (PCH) for
|
---|
| 111 | <filename class="libraryfile">libstdc++</filename>. It takes
|
---|
| 112 | up a lot of space, and we have no use for it.</para>
|
---|
| 113 | </listitem>
|
---|
| 114 | </varlistentry>
|
---|
| 115 |
|
---|
| 116 | </variablelist>
|
---|
| 117 |
|
---|
| 118 | <para>Compile the package:</para>
|
---|
| 119 |
|
---|
| 120 | <screen><userinput>make AS_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-as" \
|
---|
| 121 | LD_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-ld"</userinput></screen>
|
---|
| 122 |
|
---|
| 123 | <para>Install the package:</para>
|
---|
| 124 |
|
---|
| 125 | <screen><userinput>make install</userinput></screen>
|
---|
| 126 |
|
---|
| 127 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 128 | href="../../final-system/common/gcc.xml"
|
---|
| 129 | xpointer="xpointer(//*[@os='w'])"/>
|
---|
| 130 |
|
---|
| 131 | <screen><userinput>ln -s gcc /tools/bin/cc</userinput></screen>
|
---|
| 132 |
|
---|
| 133 | </sect2>
|
---|
| 134 |
|
---|
| 135 | <sect2 role="content">
|
---|
| 136 | <title/>
|
---|
| 137 |
|
---|
| 138 | <para>Details on this package are located in <xref
|
---|
| 139 | linkend="contents-gcc" role="."/></para>
|
---|
| 140 |
|
---|
| 141 | </sect2>
|
---|
| 142 |
|
---|
| 143 | </sect1>
|
---|