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