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

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

Added identifier comment to common/gcc-static.xml

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