[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-static" role="wrap">
|
---|
| 9 | <?dbhtml filename="gcc-static.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Cross GCC-&gcc-version; - Static</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-cross-tools-gcc-static">
|
---|
| 14 | <primary sortas="a-GCC">GCC</primary>
|
---|
| 15 | <secondary>cross tools, static</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 Cross GCC Compiler with Static libgcc
|
---|
| 24 | and no Threads</title>
|
---|
| 25 |
|
---|
[2f33c50] | 26 | <para os="aa">Make a couple of essential adjustments to the specs file
|
---|
[f59f08e] | 27 | to ensure GCC uses our build environment:</para>
|
---|
[bf8c11f] | 28 |
|
---|
| 29 | <screen os="ab"><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
|
---|
| 30 |
|
---|
[cbfa0a3] | 31 | <para os="ac">To make sure that a couple of tools use the proper syntax,
|
---|
| 32 | apply the following patch:</para>
|
---|
[bf8c11f] | 33 |
|
---|
| 34 | <screen os="ad"><userinput>patch -Np1 -i ../&gcc-posix-patch;</userinput></screen>
|
---|
| 35 |
|
---|
| 36 | <para os="ae">The following patch ensures that <command>gcc</command> does not
|
---|
| 37 | search the <filename class="directory">/usr</filename> directory for
|
---|
| 38 | <filename class="libraryfile">libgcc_s.so</filename> when
|
---|
[f32f537] | 39 | cross-compiling:</para>
|
---|
[bf8c11f] | 40 |
|
---|
| 41 | <screen os="af"><userinput>patch -Np1 -i ../&gcc-cross_search-patch;</userinput></screen>
|
---|
| 42 |
|
---|
[f9b3685d] | 43 | <para os="ag">Change the StartFile Spec to point to the correct library
|
---|
[bf8c11f] | 44 | location:</para>
|
---|
| 45 |
|
---|
| 46 | <screen os="ah"><userinput>echo "
|
---|
| 47 | #undef STARTFILE_PREFIX_SPEC
|
---|
| 48 | #define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/linux.h</userinput></screen>
|
---|
| 49 |
|
---|
[4394b64] | 50 | <para os="ai">Now alter <command>gcc</command>'s c preprocessor's default
|
---|
[4c2d76e] | 51 | include search path to use <filename class="directory">/tools</filename> only:</para>
|
---|
[bf8c11f] | 52 |
|
---|
[61f8f69] | 53 | <screen os="aj"><userinput>cp -v gcc/Makefile.in{,.orig}
|
---|
[bf8c11f] | 54 | sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
|
---|
[a717694] | 55 | gcc/Makefile.in.orig > gcc/Makefile.in</userinput></screen>
|
---|
[bf8c11f] | 56 |
|
---|
| 57 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 58 | href="../../final-system/common/gcc.xml"
|
---|
| 59 | xpointer="xpointer(//*[@os='f'])"/>
|
---|
| 60 |
|
---|
| 61 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 62 | href="../../final-system/common/gcc.xml"
|
---|
| 63 | xpointer="xpointer(//*[@os='g'])"/>
|
---|
| 64 |
|
---|
| 65 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 66 | href="../../final-system/common/gcc.xml"
|
---|
| 67 | xpointer="xpointer(//*[@os='h'])"/>
|
---|
| 68 |
|
---|
[1b823a37] | 69 | <screen os="al"><userinput>../gcc-&gcc-version;/configure --prefix=/cross-tools \
|
---|
[9cb6b64] | 70 | --host=${CLFS_HOST} --target=${CLFS_TARGET} --disable-multilib \
|
---|
[bf8c11f] | 71 | --with-local-prefix=/tools --disable-nls --disable-shared \
|
---|
| 72 | --disable-threads --enable-languages=c</userinput></screen>
|
---|
| 73 |
|
---|
[1b823a37] | 74 | <variablelist os="am">
|
---|
[bf8c11f] | 75 | <title>The meaning of the configure options:</title>
|
---|
| 76 |
|
---|
| 77 | <varlistentry>
|
---|
| 78 | <term><parameter>--with-local-prefix=/tools</parameter></term>
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>The purpose of this switch is to remove <filename
|
---|
| 81 | class="directory">/usr/local/include</filename> from
|
---|
| 82 | <command>gcc</command>'s include search path. This is not
|
---|
| 83 | absolutely essential, however, it helps to minimize the
|
---|
| 84 | influence of the host system.</para>
|
---|
| 85 | </listitem>
|
---|
| 86 | </varlistentry>
|
---|
| 87 |
|
---|
| 88 | <varlistentry>
|
---|
| 89 | <term><parameter>--disable-shared</parameter></term>
|
---|
| 90 | <listitem>
|
---|
| 91 | <para>Disables the creation of the shared libraries.</para>
|
---|
| 92 | </listitem>
|
---|
| 93 | </varlistentry>
|
---|
| 94 |
|
---|
| 95 | <varlistentry>
|
---|
| 96 | <term><parameter>--disable-threads</parameter></term>
|
---|
| 97 | <listitem>
|
---|
[a812e49] | 98 | <para>This will prevent GCC from looking for the multi-thread
|
---|
[cbfa0a3] | 99 | include files, since they haven't been created for this architecture
|
---|
| 100 | yet. GCC will be able to find the multi-thread information after
|
---|
| 101 | the Glibc headers are created.</para>
|
---|
[bf8c11f] | 102 | </listitem>
|
---|
| 103 | </varlistentry>
|
---|
| 104 |
|
---|
| 105 | <varlistentry>
|
---|
| 106 | <term><parameter>--enable-languages=c</parameter></term>
|
---|
| 107 | <listitem>
|
---|
| 108 | <para>This option ensures that only the C compiler is built.</para>
|
---|
| 109 | </listitem>
|
---|
| 110 | </varlistentry>
|
---|
| 111 |
|
---|
| 112 | </variablelist>
|
---|
| 113 |
|
---|
[1b823a37] | 114 | <para os="an">Continue with compiling the package:</para>
|
---|
[bf8c11f] | 115 |
|
---|
[1b823a37] | 116 | <screen os="ao"><userinput>make all-gcc</userinput></screen>
|
---|
[bf8c11f] | 117 |
|
---|
[1b823a37] | 118 | <para os="ap">Install the package:</para>
|
---|
[bf8c11f] | 119 |
|
---|
[1b823a37] | 120 | <screen os="aq"><userinput>make install-gcc</userinput></screen>
|
---|
[bf8c11f] | 121 |
|
---|
| 122 | </sect2>
|
---|
| 123 |
|
---|
| 124 | <sect2 role="content">
|
---|
| 125 | <title/>
|
---|
| 126 |
|
---|
| 127 | <para>Details on this package are located in <xref
|
---|
| 128 | linkend="contents-gcc" role="."/></para>
|
---|
| 129 |
|
---|
| 130 | </sect2>
|
---|
| 131 |
|
---|
| 132 | </sect1>
|
---|