source: clfs-embedded/BOOK/cross-tools/common/gcc-static.xml @ 13d7c4f

Last change on this file since 13d7c4f was 13d7c4f, checked in by Andrew Bradford <andrew@…>, 11 years ago

gcc: Use new sysroot dir

  • Property mode set to 100644
File size: 7.8 KB
RevLine 
[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
[b128a0e]8<!-- Common GCC-Static -->
9
[a9e389d]10<sect1 id="ch-cross-tools-gcc-static" role="wrap">
11  <?dbhtml filename="gcc-static.html"?>
12
13  <title>Cross GCC-&gcc-version; - Static</title>
14
15  <indexterm zone="ch-cross-tools-gcc-static">
16    <primary sortas="a-GCC">GCC</primary>
17    <secondary>cross tools, static</secondary>
18  </indexterm>
19
20  <sect2 role="package">
21    <title/>
22
23    <para>The GCC package contains the GNU compiler collection, which includes
24    the C and C++ compilers.</para>
25
26  </sect2>
27
28  <sect2 role="installation">
[ae51e2a]29    <title os="a">Installation of Cross GCC Compiler with Static libgcc
[a9e389d]30    and no Threads</title>
31
[8a77fbd]32    <para os="b">GCC requires the GMP, MPFR, and MPC packages to either be
33    present on the host or to be present in source form within the gcc source
34    tree.  Unpack these into the GCC directory after unpacking GCC:</para>
35
36<screen os="ba"><userinput>tar xf ../mpfr-&mpfr-version;.tar.bz2
37mv -v mpfr-&mpfr-version; mpfr
38tar xf ../gmp-&gmp-version;.tar.bz2
39mv -v gmp-&gmp-version; gmp
40tar xf ../mpc-&mpc-version;.tar.gz
41mv -v mpc-&mpc-version; mpc</userinput></screen>
42
[a9e389d]43    <para os="c">The GCC documentation recommends building GCC outside of the source
44    directory in a dedicated build directory:</para>
45
46<screen os="d"><userinput>mkdir -v ../gcc-build
47cd ../gcc-build</userinput></screen>
48
49    <para os="e">Prepare GCC for compilation:</para>
50
[ae51e2a]51<!-- This is the common configure line for GCC-Static. -->
52<!-- It's not actually used by any arch but is here for reference. -->
[146587b]53<screen os="ae"><userinput>../gcc-&gcc-version;/configure \
[54fde8f]54  --prefix=${CLFS}/cross-tools \
55  --build=${CLFS_HOST} \
56  --host=${CLFS_HOST} \
57  --target=${CLFS_TARGET} \
[13d7c4f]58  --with-sysroot=${CLFS}/cross-tools/sysroot \
[54fde8f]59  --disable-nls  \
60  --disable-shared \
61  --without-headers \
62  --with-newlib \
63  --disable-decimal-float \
64  --disable-libgomp \
65  --disable-libmudflap \
66  --disable-libssp \
67  --disable-threads \
68  --enable-languages=c \
[0f33b23]69  --disable-multilib</userinput></screen>
[a9e389d]70
71    <variablelist os="af">
72      <title>The meaning of the configure options:</title>
73
[f704d3f]74      <varlistentry os="af1">
75        <term><parameter>--prefix=${CLFS}/cross-tools</parameter></term>
76        <listitem>
77          <para>This tells the configure script to prepare to install the
78          package in the <filename class="directory">${CLFS}/cross-tools</filename>
79          directory.</para>
80        </listitem>
81      </varlistentry>
82
83      <varlistentry os="af2">
84        <term><parameter>--build=${CLFS_HOST}</parameter></term>
85        <listitem>
86          <para>This tells the configure script the triplet to use to build GCC.
87          It will use ${CLFS_HOST} as that's where it's being built.</para>
88        </listitem>
89      </varlistentry>
90
91      <varlistentry os="af3">
92        <term><parameter>--host=${CLFS_HOST}</parameter></term>
93        <listitem>
94          <para>This tells the configure script the triplet of the machine GCC
95          will be executed on when actually cross compiling.  It will use
96          ${CLFS_HOST} as that's where GCC will execute when cross compiling
97          software later.</para>
98        </listitem>
99      </varlistentry>
100
101      <varlistentry os="af4">
102        <term><parameter>--target=${CLFS_TARGET}</parameter></term>
103        <listitem>
104          <para>This tells the configure script the triplet of the machine GCC
105          will build executables for.  It will use ${CLFS_TARGET} so that software
106          compiled with this version of GCC can be executed on the embedded machine
107          target.</para>
108        </listitem>
109      </varlistentry>
110
111      <varlistentry os="af5">
[13d7c4f]112        <term><parameter>--with-sysroot=${CLFS}/cross-tools/sysroot</parameter></term>
[f704d3f]113        <listitem>
[13d7c4f]114          <para>This tells configure that ${CLFS}/cross-tools/sysroot is going
115          to be the temporary root of our system. It will now use the specified
116          sysroot as a prefix of the default search paths.</para>
[f704d3f]117        </listitem>
118      </varlistentry>
119
120      <varlistentry os="af6">
121        <term><parameter>--disable-nls</parameter></term>
122        <listitem>
123          <para>This disables internationalization as i18n is not needed for the
124          cross-compile tools.</para>
125        </listitem>
126      </varlistentry>
127
128      <varlistentry os="af7">
[a9e389d]129        <term><parameter>--disable-shared</parameter></term>
130        <listitem>
131          <para>Disables the creation of the shared libraries.</para>
132        </listitem>
133      </varlistentry>
134
[f704d3f]135      <varlistentry os="af11">
136        <term><parameter>--without-headers</parameter></term>
137        <listitem>
138          <para>Tells configure to not use any headers from any C libraries.
139          This is needed as we haven't yet built the C library and to prevent
140          influence from the host environment.</para>
141        </listitem>
142      </varlistentry>
143
144      <varlistentry os="af12">
145        <term><parameter>--with-newlib</parameter></term>
146        <listitem>
147          <para>Tells configure to build libgcc without needing any C
148          libraries.</para>
149        </listitem>
150      </varlistentry>
151
152      <varlistentry os="af13">
153        <term><parameter>--disable-decimal-float</parameter></term>
154        <listitem>
155          <para>Tells configure to disable IEEE 754-2008 decimal floating
156          point support.  Decimal floating point support isn't needed yet.</para>
157        </listitem>
158      </varlistentry>
159
160      <varlistentry os="af14">
161        <term><parameter>--disable-libgomp</parameter></term>
162        <listitem>
163          <para>Tells configure to not build the GOMP run-time libraries.
164          GOMP is the GNU implementation of OpenMP, a API for shared-memory
165          parallel programming.</para>
166        </listitem>
167      </varlistentry>
168
169      <varlistentry os="af15">
170        <term><parameter>--disable-libmudflap</parameter></term>
171        <listitem>
172          <para>Tells configure to not build libmudflap.  Mudflap is a
173          library that can be used to help check for proper pointer usage.</para>
174        </listitem>
175      </varlistentry>
176
177      <varlistentry os="af16">
178        <term><parameter>--disable-libssp</parameter></term>
179        <listitem>
180          <para>Tells configure not to build run-time libraries for stack
181          smashing detection.</para>
182        </listitem>
183      </varlistentry>
184
185      <varlistentry os="af17">
[a9e389d]186        <term><parameter>--disable-threads</parameter></term>
187        <listitem>
188          <para>This will prevent GCC from looking for the multi-thread
189          include files, since they haven't been created for this architecture
190          yet. GCC will be able to find the multi-thread information after
[f704d3f]191          the glib headers are created.</para>
[a9e389d]192        </listitem>
193      </varlistentry>
194
[f704d3f]195      <varlistentry os="af18">
[a9e389d]196        <term><parameter>--enable-languages=c</parameter></term>
197        <listitem>
198          <para>This option ensures that only the C compiler is built.</para>
199        </listitem>
200      </varlistentry>
201
[0f33b23]202    <varlistentry os="af19">
203      <term><parameter>--disable-multilib</parameter></term>
204      <listitem>
205        <para>This option specifies that multiple target libraries should
206        not be built.</para>
207      </listitem>
208    </varlistentry>
209
[a9e389d]210    </variablelist>
211
[ae51e2a]212    <para os="ah">Continue with compiling the package:</para>
[a9e389d]213
[ae51e2a]214<screen os="ai"><userinput>make all-gcc all-target-libgcc</userinput></screen>
[a9e389d]215
[ae51e2a]216    <para os="aj">Install the package:</para>
[a9e389d]217
[ae51e2a]218<screen os="ak"><userinput>make install-gcc install-target-libgcc</userinput></screen>
[a9e389d]219
220  </sect2>
221
222  <sect2 role="content">
223    <title/>
224
225    <para>Details on this package are located in <xref
226    linkend="contents-gcc" role="."/></para>
227
228  </sect2>
229
230</sect1>
Note: See TracBrowser for help on using the repository browser.