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

Last change on this file since 54fde8f was 54fde8f, checked in by Andrew Bradford <andrew@…>, 10 years ago

gcc: Linewrap configure options

No changes, just linewrapping for easier reading such that one option
goes on each line. This will make it easier to see what changes in
diffs between book edits, plus it's easier to read in the rendered book,
too.

  • Property mode set to 100644
File size: 7.8 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<!-- Common GCC-Static -->
9
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">
29    <title os="a">Installation of Cross GCC Compiler with Static libgcc
30    and no Threads</title>
31
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
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
51<!-- This is the common configure line for GCC-Static. -->
52<!-- It's not actually used by any arch but is here for reference. -->
53<screen os="ae"><userinput>AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
54  ../gcc-&gcc-version;/configure \
55  --prefix=${CLFS}/cross-tools \
56  --build=${CLFS_HOST} \
57  --host=${CLFS_HOST} \
58  --target=${CLFS_TARGET} \
59  --with-sysroot=${CLFS} \
60  --disable-nls  \
61  --disable-shared \
62  --without-headers \
63  --with-newlib \
64  --disable-decimal-float \
65  --disable-libgomp \
66  --disable-libmudflap \
67  --disable-libssp \
68  --disable-threads \
69  --enable-languages=c \
70  --disable-multilib</userinput></screen>
71
72    <variablelist os="af">
73      <title>The meaning of the configure options:</title>
74
75      <varlistentry os="af1">
76        <term><parameter>--prefix=${CLFS}/cross-tools</parameter></term>
77        <listitem>
78          <para>This tells the configure script to prepare to install the
79          package in the <filename class="directory">${CLFS}/cross-tools</filename>
80          directory.</para>
81        </listitem>
82      </varlistentry>
83
84      <varlistentry os="af2">
85        <term><parameter>--build=${CLFS_HOST}</parameter></term>
86        <listitem>
87          <para>This tells the configure script the triplet to use to build GCC.
88          It will use ${CLFS_HOST} as that's where it's being built.</para>
89        </listitem>
90      </varlistentry>
91
92      <varlistentry os="af3">
93        <term><parameter>--host=${CLFS_HOST}</parameter></term>
94        <listitem>
95          <para>This tells the configure script the triplet of the machine GCC
96          will be executed on when actually cross compiling.  It will use
97          ${CLFS_HOST} as that's where GCC will execute when cross compiling
98          software later.</para>
99        </listitem>
100      </varlistentry>
101
102      <varlistentry os="af4">
103        <term><parameter>--target=${CLFS_TARGET}</parameter></term>
104        <listitem>
105          <para>This tells the configure script the triplet of the machine GCC
106          will build executables for.  It will use ${CLFS_TARGET} so that software
107          compiled with this version of GCC can be executed on the embedded machine
108          target.</para>
109        </listitem>
110      </varlistentry>
111
112      <varlistentry os="af5">
113        <term><parameter>--with-sysroot=${CLFS}</parameter></term>
114        <listitem>
115          <para>This tells configure that ${CLFS} is going to be the root
116          of our system. It will now use the specified sysroot, ${CLFS}, as
117          a prefix of the default search paths.</para>
118        </listitem>
119      </varlistentry>
120
121      <varlistentry os="af6">
122        <term><parameter>--disable-nls</parameter></term>
123        <listitem>
124          <para>This disables internationalization as i18n is not needed for the
125          cross-compile tools.</para>
126        </listitem>
127      </varlistentry>
128
129      <varlistentry os="af7">
130        <term><parameter>--disable-shared</parameter></term>
131        <listitem>
132          <para>Disables the creation of the shared libraries.</para>
133        </listitem>
134      </varlistentry>
135
136      <varlistentry os="af11">
137        <term><parameter>--without-headers</parameter></term>
138        <listitem>
139          <para>Tells configure to not use any headers from any C libraries.
140          This is needed as we haven't yet built the C library and to prevent
141          influence from the host environment.</para>
142        </listitem>
143      </varlistentry>
144
145      <varlistentry os="af12">
146        <term><parameter>--with-newlib</parameter></term>
147        <listitem>
148          <para>Tells configure to build libgcc without needing any C
149          libraries.</para>
150        </listitem>
151      </varlistentry>
152
153      <varlistentry os="af13">
154        <term><parameter>--disable-decimal-float</parameter></term>
155        <listitem>
156          <para>Tells configure to disable IEEE 754-2008 decimal floating
157          point support.  Decimal floating point support isn't needed yet.</para>
158        </listitem>
159      </varlistentry>
160
161      <varlistentry os="af14">
162        <term><parameter>--disable-libgomp</parameter></term>
163        <listitem>
164          <para>Tells configure to not build the GOMP run-time libraries.
165          GOMP is the GNU implementation of OpenMP, a API for shared-memory
166          parallel programming.</para>
167        </listitem>
168      </varlistentry>
169
170      <varlistentry os="af15">
171        <term><parameter>--disable-libmudflap</parameter></term>
172        <listitem>
173          <para>Tells configure to not build libmudflap.  Mudflap is a
174          library that can be used to help check for proper pointer usage.</para>
175        </listitem>
176      </varlistentry>
177
178      <varlistentry os="af16">
179        <term><parameter>--disable-libssp</parameter></term>
180        <listitem>
181          <para>Tells configure not to build run-time libraries for stack
182          smashing detection.</para>
183        </listitem>
184      </varlistentry>
185
186      <varlistentry os="af17">
187        <term><parameter>--disable-threads</parameter></term>
188        <listitem>
189          <para>This will prevent GCC from looking for the multi-thread
190          include files, since they haven't been created for this architecture
191          yet. GCC will be able to find the multi-thread information after
192          the glib headers are created.</para>
193        </listitem>
194      </varlistentry>
195
196      <varlistentry os="af18">
197        <term><parameter>--enable-languages=c</parameter></term>
198        <listitem>
199          <para>This option ensures that only the C compiler is built.</para>
200        </listitem>
201      </varlistentry>
202
203    <varlistentry os="af19">
204      <term><parameter>--disable-multilib</parameter></term>
205      <listitem>
206        <para>This option specifies that multiple target libraries should
207        not be built.</para>
208      </listitem>
209    </varlistentry>
210
211    </variablelist>
212
213    <para os="ah">Continue with compiling the package:</para>
214
215<screen os="ai"><userinput>make all-gcc all-target-libgcc</userinput></screen>
216
217    <para os="aj">Install the package:</para>
218
219<screen os="ak"><userinput>make install-gcc install-target-libgcc</userinput></screen>
220
221  </sect2>
222
223  <sect2 role="content">
224    <title/>
225
226    <para>Details on this package are located in <xref
227    linkend="contents-gcc" role="."/></para>
228
229  </sect2>
230
231</sect1>
Note: See TracBrowser for help on using the repository browser.