[a9e389d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[bd48e48] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[a9e389d] | 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 |
|
---|
| 18 | <sect2 role="package">
|
---|
| 19 | <title/>
|
---|
| 20 |
|
---|
| 21 | <para>The GCC package contains the GNU compiler collection, which includes
|
---|
| 22 | the C and C++ compilers.</para>
|
---|
| 23 |
|
---|
| 24 | </sect2>
|
---|
| 25 |
|
---|
| 26 | <sect2 role="installation">
|
---|
| 27 | <title>Installation of Cross GCC Compiler with Static libgcc
|
---|
| 28 | and no Threads</title>
|
---|
| 29 |
|
---|
| 30 | <para os="c">The GCC documentation recommends building GCC outside of the source
|
---|
| 31 | directory in a dedicated build directory:</para>
|
---|
| 32 |
|
---|
| 33 | <screen os="d"><userinput>mkdir -v ../gcc-build
|
---|
| 34 | cd ../gcc-build</userinput></screen>
|
---|
| 35 |
|
---|
| 36 | <para os="e">Prepare GCC for compilation:</para>
|
---|
| 37 |
|
---|
[35e0963] | 38 | <screen os="ae"><userinput>AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
|
---|
[e1b2402] | 39 | ../gcc-&gcc-version;/configure --prefix=${CLFS}/cross-tools \
|
---|
| 40 | --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \
|
---|
| 41 | --with-sysroot=${CLFS} --disable-nls --disable-shared \
|
---|
[35e0963] | 42 | --with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \
|
---|
[9ee1843] | 43 | --with-mpc=${CLFS}/cross-tools --without-headers --with-newlib \
|
---|
| 44 | --disable-decimal-float --disable-libgomp --disable-libmudflap \
|
---|
| 45 | --disable-libssp --disable-threads --enable-languages=c</userinput></screen>
|
---|
[a9e389d] | 46 |
|
---|
| 47 | <variablelist os="af">
|
---|
| 48 | <title>The meaning of the configure options:</title>
|
---|
| 49 |
|
---|
[5058de7] | 50 | <varlistentry os="af1">
|
---|
| 51 | <term><parameter>--prefix=${CLFS}/cross-tools</parameter></term>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>This tells the configure script to prepare to install the
|
---|
| 54 | package in the <filename class="directory">${CLFS}/cross-tools</filename>
|
---|
| 55 | directory.</para>
|
---|
| 56 | </listitem>
|
---|
| 57 | </varlistentry>
|
---|
| 58 |
|
---|
| 59 | <varlistentry os="af2">
|
---|
| 60 | <term><parameter>--build=${CLFS_HOST}</parameter></term>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>This tells the configure script the triplet to use to build GCC.
|
---|
| 63 | It will use ${CLFS_HOST} as that's where it's being built.</para>
|
---|
| 64 | </listitem>
|
---|
| 65 | </varlistentry>
|
---|
| 66 |
|
---|
| 67 | <varlistentry os="af3">
|
---|
| 68 | <term><parameter>--host=${CLFS_HOST}</parameter></term>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>This tells the configure script the triplet of the machine GCC
|
---|
| 71 | will be executed on when actually cross compiling. It will use
|
---|
| 72 | ${CLFS_HOST} as that's where GCC will execute when cross compiling
|
---|
| 73 | software later.</para>
|
---|
| 74 | </listitem>
|
---|
| 75 | </varlistentry>
|
---|
| 76 |
|
---|
| 77 | <varlistentry os="af4">
|
---|
| 78 | <term><parameter>--target=${CLFS_TARGET}</parameter></term>
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>This tells the configure script the triplet of the machine GCC
|
---|
| 81 | will build executables for. It will use ${CLFS_TARGET} so that software
|
---|
| 82 | compiled with this version of GCC can be executed on the embedded machine
|
---|
| 83 | target.</para>
|
---|
| 84 | </listitem>
|
---|
| 85 | </varlistentry>
|
---|
| 86 |
|
---|
| 87 | <varlistentry os="af5">
|
---|
| 88 | <term><parameter>--with-sysroot=${CLFS}</parameter></term>
|
---|
| 89 | <listitem>
|
---|
| 90 | <para>This tells configure that ${CLFS} is going to be the root
|
---|
| 91 | of our system. It will now use the specified sysroot, ${CLFS}, as
|
---|
| 92 | a prefix of the default search paths.</para>
|
---|
| 93 | </listitem>
|
---|
| 94 | </varlistentry>
|
---|
| 95 |
|
---|
| 96 | <varlistentry os="af6">
|
---|
| 97 | <term><parameter>--disable-nls</parameter></term>
|
---|
| 98 | <listitem>
|
---|
| 99 | <para>This disables internationalization as i18n is not needed for the
|
---|
| 100 | cross-compile tools.</para>
|
---|
| 101 | </listitem>
|
---|
| 102 | </varlistentry>
|
---|
| 103 |
|
---|
| 104 | <varlistentry os="af7">
|
---|
[a9e389d] | 105 | <term><parameter>--disable-shared</parameter></term>
|
---|
| 106 | <listitem>
|
---|
| 107 | <para>Disables the creation of the shared libraries.</para>
|
---|
| 108 | </listitem>
|
---|
| 109 | </varlistentry>
|
---|
| 110 |
|
---|
[5058de7] | 111 | <varlistentry os="af8">
|
---|
| 112 | <term><parameter>--with-mpfr=${CLFS}/cross-tools</parameter></term>
|
---|
| 113 | <listitem>
|
---|
| 114 | <para>Tells configure where to find the
|
---|
| 115 | <filename class="directory">lib</filename> and
|
---|
| 116 | <filename class="directory">include</filename> directories
|
---|
| 117 | that contain MPFR which was built earlier.</para>
|
---|
| 118 | </listitem>
|
---|
| 119 | </varlistentry>
|
---|
| 120 |
|
---|
| 121 | <varlistentry os="af9">
|
---|
| 122 | <term><parameter>--with-gmp=${CLFS}/cross-tools</parameter></term>
|
---|
| 123 | <listitem>
|
---|
| 124 | <para>Tells configure where to find the
|
---|
| 125 | <filename class="directory">lib</filename> and
|
---|
| 126 | <filename class="directory">include</filename> directories
|
---|
| 127 | that contain GMP which was built earlier.</para>
|
---|
| 128 | </listitem>
|
---|
| 129 | </varlistentry>
|
---|
| 130 |
|
---|
[9ee1843] | 131 | <varlistentry os="af10">
|
---|
| 132 | <term><parameter>--with-mpc=${CLFS}/cross-tools</parameter></term>
|
---|
| 133 | <listitem>
|
---|
| 134 | <para>Tells configure where to find the
|
---|
| 135 | <filename class="directory">lib</filename> and
|
---|
| 136 | <filename class="directory">include</filename> directories
|
---|
| 137 | that contain MPC which was built earlier.</para>
|
---|
| 138 | </listitem>
|
---|
| 139 | </varlistentry>
|
---|
| 140 |
|
---|
[5058de7] | 141 | <varlistentry os="af11">
|
---|
| 142 | <term><parameter>--without-headers</parameter></term>
|
---|
| 143 | <listitem>
|
---|
| 144 | <para>Tells configure to not use any headers from any C libraries.
|
---|
| 145 | This is needed as we haven't yet built the C library and to prevent
|
---|
| 146 | influence from the host environment.</para>
|
---|
| 147 | </listitem>
|
---|
| 148 | </varlistentry>
|
---|
| 149 |
|
---|
| 150 | <varlistentry os="af12">
|
---|
| 151 | <term><parameter>--with-newlib</parameter></term>
|
---|
| 152 | <listitem>
|
---|
| 153 | <para>Tells configure to build libgcc without needing any C
|
---|
| 154 | libraries.</para>
|
---|
| 155 | </listitem>
|
---|
| 156 | </varlistentry>
|
---|
| 157 |
|
---|
| 158 | <varlistentry os="af13">
|
---|
| 159 | <term><parameter>--disable-decimal-float</parameter></term>
|
---|
| 160 | <listitem>
|
---|
| 161 | <para>Tells configure to disable IEEE 754-2008 decimal floating
|
---|
| 162 | point support. Decimal floating point support isn't needed yet.</para>
|
---|
| 163 | </listitem>
|
---|
| 164 | </varlistentry>
|
---|
| 165 |
|
---|
| 166 | <varlistentry os="af14">
|
---|
| 167 | <term><parameter>--disable-libgomp</parameter></term>
|
---|
| 168 | <listitem>
|
---|
| 169 | <para>Tells configure to not build the GOMP run-time libraries.
|
---|
| 170 | GOMP is the GNU implementation of OpenMP, a API for shared-memory
|
---|
| 171 | parallel programming.</para>
|
---|
| 172 | </listitem>
|
---|
| 173 | </varlistentry>
|
---|
| 174 |
|
---|
| 175 | <varlistentry os="af15">
|
---|
| 176 | <term><parameter>--disable-libmudflap</parameter></term>
|
---|
| 177 | <listitem>
|
---|
| 178 | <para>Tells configure to not build libmudflap. Mudflap is a
|
---|
| 179 | library that can be used to help check for proper pointer usage.</para>
|
---|
| 180 | </listitem>
|
---|
| 181 | </varlistentry>
|
---|
| 182 |
|
---|
| 183 | <varlistentry os="af16">
|
---|
| 184 | <term><parameter>--disable-libssp</parameter></term>
|
---|
| 185 | <listitem>
|
---|
| 186 | <para>Tells configure not to build run-time libraries for stack
|
---|
| 187 | smashing detection.</para>
|
---|
| 188 | </listitem>
|
---|
| 189 | </varlistentry>
|
---|
| 190 |
|
---|
| 191 | <varlistentry os="af17">
|
---|
[a9e389d] | 192 | <term><parameter>--disable-threads</parameter></term>
|
---|
| 193 | <listitem>
|
---|
| 194 | <para>This will prevent GCC from looking for the multi-thread
|
---|
| 195 | include files, since they haven't been created for this architecture
|
---|
| 196 | yet. GCC will be able to find the multi-thread information after
|
---|
[5058de7] | 197 | the glib headers are created.</para>
|
---|
[a9e389d] | 198 | </listitem>
|
---|
| 199 | </varlistentry>
|
---|
| 200 |
|
---|
[5058de7] | 201 | <varlistentry os="af18">
|
---|
[a9e389d] | 202 | <term><parameter>--enable-languages=c</parameter></term>
|
---|
| 203 | <listitem>
|
---|
| 204 | <para>This option ensures that only the C compiler is built.</para>
|
---|
| 205 | </listitem>
|
---|
| 206 | </varlistentry>
|
---|
| 207 |
|
---|
| 208 | </variablelist>
|
---|
| 209 |
|
---|
| 210 | <para os="ag">Continue with compiling the package:</para>
|
---|
| 211 |
|
---|
[35e0963] | 212 | <screen os="ah"><userinput>make all-gcc all-target-libgcc</userinput></screen>
|
---|
[a9e389d] | 213 |
|
---|
| 214 | <para os="ai">Install the package:</para>
|
---|
| 215 |
|
---|
[35e0963] | 216 | <screen os="aj"><userinput>make install-gcc install-target-libgcc</userinput></screen>
|
---|
[a9e389d] | 217 |
|
---|
| 218 | </sect2>
|
---|
| 219 |
|
---|
| 220 | <sect2 role="content">
|
---|
| 221 | <title/>
|
---|
| 222 |
|
---|
| 223 | <para>Details on this package are located in <xref
|
---|
| 224 | linkend="contents-gcc" role="."/></para>
|
---|
| 225 |
|
---|
| 226 | </sect2>
|
---|
| 227 |
|
---|
| 228 | </sect1>
|
---|