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

Last change on this file since 96ab1c3 was 6368159, checked in by Andrew Bradford <andrew@…>, 9 years ago

gcc-static: Add --disable-lib{quadmath,atomic}

They aren't needed for static build of gcc.

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