| [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 | %general-entities; | 
|---|
|  | 6 | ]> | 
|---|
|  | 7 |  | 
|---|
|  | 8 | <sect1 id="ch-cross-tools-gcc-final" role="wrap"> | 
|---|
|  | 9 | <?dbhtml filename="gcc-final.html"?> | 
|---|
|  | 10 |  | 
|---|
|  | 11 | <title>GCC-&gcc-version; - Cross Compiler Final</title> | 
|---|
|  | 12 |  | 
|---|
|  | 13 | <indexterm zone="ch-cross-tools-gcc-final"> | 
|---|
|  | 14 | <primary sortas="a-GCC">GCC</primary> | 
|---|
|  | 15 | <secondary>cross tools, final</secondary> | 
|---|
|  | 16 | </indexterm> | 
|---|
|  | 17 |  | 
|---|
| [48f8316] | 18 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 19 | href="../../final-system/common/gcc.xml" | 
|---|
|  | 20 | xpointer="xpointer(//*[@role='package'])"/> | 
|---|
| [bf8c11f] | 21 |  | 
|---|
|  | 22 | <sect2 role="installation"> | 
|---|
|  | 23 | <title>Installation of GCC Cross Compiler</title> | 
|---|
|  | 24 |  | 
|---|
| [a9fe0ce] | 25 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 26 | href="../../final-system/common/gcc.xml" | 
|---|
|  | 27 | xpointer="xpointer(//*[@os='p1'])"/> | 
|---|
|  | 28 |  | 
|---|
|  | 29 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 30 | href="../../final-system/common/gcc.xml" | 
|---|
|  | 31 | xpointer="xpointer(//*[@os='p2'])"/> | 
|---|
|  | 32 |  | 
|---|
| [ec33b65f] | 33 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 34 | href="../../final-system/common/gcc.xml" | 
|---|
|  | 35 | xpointer="xpointer(//*[@os='p3'])"/> | 
|---|
|  | 36 |  | 
|---|
|  | 37 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 38 | href="../../final-system/common/gcc.xml" | 
|---|
|  | 39 | xpointer="xpointer(//*[@os='p4'])"/> | 
|---|
|  | 40 |  | 
|---|
| [bf8c11f] | 41 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 42 | href="gcc-static.xml" | 
|---|
|  | 43 | xpointer="xpointer(//*[@os='aa'])"/> | 
|---|
|  | 44 |  | 
|---|
|  | 45 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 46 | href="gcc-static.xml" | 
|---|
|  | 47 | xpointer="xpointer(//*[@os='ab'])"/> | 
|---|
|  | 48 |  | 
|---|
|  | 49 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 50 | href="gcc-static.xml" | 
|---|
|  | 51 | xpointer="xpointer(//*[@os='ac'])"/> | 
|---|
|  | 52 |  | 
|---|
|  | 53 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 54 | href="gcc-static.xml" | 
|---|
|  | 55 | xpointer="xpointer(//*[@os='ad'])"/> | 
|---|
|  | 56 |  | 
|---|
|  | 57 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 58 | href="gcc-static.xml" | 
|---|
|  | 59 | xpointer="xpointer(//*[@os='ae'])"/> | 
|---|
|  | 60 |  | 
|---|
|  | 61 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 62 | href="gcc-static.xml" | 
|---|
|  | 63 | xpointer="xpointer(//*[@os='af'])"/> | 
|---|
|  | 64 |  | 
|---|
|  | 65 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 66 | href="gcc-static.xml" | 
|---|
|  | 67 | xpointer="xpointer(//*[@os='ag'])"/> | 
|---|
|  | 68 |  | 
|---|
|  | 69 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 70 | href="gcc-static.xml" | 
|---|
|  | 71 | xpointer="xpointer(//*[@os='ah'])"/> | 
|---|
|  | 72 |  | 
|---|
|  | 73 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 74 | href="gcc-static.xml" | 
|---|
|  | 75 | xpointer="xpointer(//*[@os='ai'])"/> | 
|---|
|  | 76 |  | 
|---|
|  | 77 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 78 | href="gcc-static.xml" | 
|---|
|  | 79 | xpointer="xpointer(//*[@os='aj'])"/> | 
|---|
|  | 80 |  | 
|---|
|  | 81 | <para os="bd">Finally, disable <option>-B</option> in <filename>configure</filename>, | 
|---|
|  | 82 | so it doesn't pick up the host's header files:</para> | 
|---|
|  | 83 |  | 
|---|
| [61f8f69] | 84 | <screen os="be"><userinput>cp -v configure{,.orig} | 
|---|
| [bf8c11f] | 85 | sed -e  '/FLAGS_FOR_TARGET.*\/lib\//s@-B[^ ]*/lib/@@g' configure.orig >configure</userinput></screen> | 
|---|
|  | 86 |  | 
|---|
|  | 87 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 88 | href="gcc-static.xml" | 
|---|
|  | 89 | xpointer="xpointer(//*[@os='ak'])"/> | 
|---|
|  | 90 |  | 
|---|
|  | 91 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 92 | href="gcc-static.xml" | 
|---|
|  | 93 | xpointer="xpointer(//*[@os='f'])"/> | 
|---|
|  | 94 |  | 
|---|
|  | 95 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 96 | href="gcc-static.xml" | 
|---|
|  | 97 | xpointer="xpointer(//*[@os='g'])"/> | 
|---|
|  | 98 |  | 
|---|
|  | 99 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" | 
|---|
|  | 100 | href="gcc-static.xml" | 
|---|
|  | 101 | xpointer="xpointer(//*[@os='h'])"/> | 
|---|
|  | 102 |  | 
|---|
| [1b823a37] | 103 | <screen os="bf"><userinput>../gcc-&gcc-version;/configure --prefix=/cross-tools \ | 
|---|
| [bf8c11f] | 104 | --target=${LFS_TARGET} --host=${LFS_HOST} --disable-multilib \ | 
|---|
|  | 105 | --with-local-prefix=/tools --disable-nls --enable-shared \ | 
|---|
|  | 106 | --enable-languages=c,c++ --enable-__cxa_atexit \ | 
|---|
|  | 107 | --enable-c99 --enable-long-long --enable-threads=posix</userinput></screen> | 
|---|
|  | 108 |  | 
|---|
| [1b823a37] | 109 | <variablelist os="bg"> | 
|---|
| [bf8c11f] | 110 | <title>The meaning of the new configure options:</title> | 
|---|
|  | 111 |  | 
|---|
| [1b823a37] | 112 | <varlistentry os="bg1"> | 
|---|
| [bf8c11f] | 113 | <term><parameter>--enable-languages=c,c++</parameter></term> | 
|---|
|  | 114 | <listitem> | 
|---|
| [f32f537] | 115 | <para>This option ensures that only the C and C++ compilers are built.</para> | 
|---|
| [bf8c11f] | 116 | </listitem> | 
|---|
|  | 117 | </varlistentry> | 
|---|
|  | 118 |  | 
|---|
| [1b823a37] | 119 | <varlistentry os="bg2"> | 
|---|
| [bf8c11f] | 120 | <term><parameter>--enable-__cxa_atexit</parameter></term> | 
|---|
|  | 121 | <listitem> | 
|---|
|  | 122 | <para>This option allows use of __cxa_atexit, rather than atexit, | 
|---|
|  | 123 | to register C++ destructors for local statics and global objects | 
|---|
|  | 124 | and is essential for fully standards-compliant handling of destructors. | 
|---|
|  | 125 | It also affects the C++ ABI and therefore results in C++ shared libraries | 
|---|
|  | 126 | and C++ programs that are interoperable with other Linux distributions.</para> | 
|---|
|  | 127 | </listitem> | 
|---|
|  | 128 | </varlistentry> | 
|---|
|  | 129 |  | 
|---|
| [1b823a37] | 130 | <varlistentry os="bg3"> | 
|---|
| [bf8c11f] | 131 | <term><parameter>--enable-c99</parameter></term> | 
|---|
|  | 132 | <listitem> | 
|---|
|  | 133 | <para>Enable C99 support for C programs.</para> | 
|---|
|  | 134 | </listitem> | 
|---|
|  | 135 | </varlistentry> | 
|---|
|  | 136 |  | 
|---|
| [1b823a37] | 137 | <varlistentry os="bg4"> | 
|---|
| [bf8c11f] | 138 | <term><parameter>--enable-long-long</parameter></term> | 
|---|
|  | 139 | <listitem> | 
|---|
|  | 140 | <para>Enables long long support in the compiler.</para> | 
|---|
|  | 141 | </listitem> | 
|---|
|  | 142 | </varlistentry> | 
|---|
|  | 143 |  | 
|---|
| [1b823a37] | 144 | <varlistentry os="bg5"> | 
|---|
| [bf8c11f] | 145 | <term><parameter>--enable-threads=posix</parameter></term> | 
|---|
|  | 146 | <listitem> | 
|---|
|  | 147 | <para>This enables C++ exception handling for multi-threaded code.</para> | 
|---|
|  | 148 | </listitem> | 
|---|
|  | 149 | </varlistentry> | 
|---|
|  | 150 |  | 
|---|
|  | 151 | </variablelist> | 
|---|
|  | 152 |  | 
|---|
| [1b823a37] | 153 | <para os="bh">Continue with compiling the package:</para> | 
|---|
| [bf8c11f] | 154 |  | 
|---|
| [1b823a37] | 155 | <screen os="bi"><userinput>make AS_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-as" \ | 
|---|
| [bf8c11f] | 156 | LD_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-ld"</userinput></screen> | 
|---|
|  | 157 |  | 
|---|
| [1b823a37] | 158 | <para os="bj">Install the package:</para> | 
|---|
| [bf8c11f] | 159 |  | 
|---|
| [1b823a37] | 160 | <screen os="bk"><userinput>make install</userinput></screen> | 
|---|
| [bf8c11f] | 161 |  | 
|---|
|  | 162 | </sect2> | 
|---|
|  | 163 |  | 
|---|
|  | 164 | <sect2 role="content"> | 
|---|
|  | 165 | <title/> | 
|---|
|  | 166 |  | 
|---|
|  | 167 | <para>Details on this package are located in <xref | 
|---|
|  | 168 | linkend="contents-gcc" role="."/></para> | 
|---|
|  | 169 |  | 
|---|
|  | 170 | </sect2> | 
|---|
|  | 171 |  | 
|---|
|  | 172 | </sect1> | 
|---|