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

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

Created MIPS and ARM GCC-Static files & cleanup

x86 no longer is common with MIPS and ARM for GCC-Static, so it has
its own GCC-Static file. In the previous implementation, there
was a lot of duplication between the common and x86 GCC-Static files.
This removes the duplication by better referencing the common file
and also creates MIPS and ARM specific GCC-Static files.

In this way, everything that is common to all architectures goes into
the common file and each architecture's GCC-Static file is specific
to the architecture.

* PLEASE NOTE *: As of this commit, GCC-Final is BROKEN for x86!
It will be fixed shortly.
DO NOT MERGE THIS UNTIL GCC-FINAL IS FIXED FOR x86!

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