source: BOOK/final-system/common/gcc.xml@ aa0f524

systemd
Last change on this file since aa0f524 was cc9f07c, checked in by Chris Staub <chris@…>, 9 years ago

Provided explanation for --disable-bootstrap

  • Property mode set to 100644
File size: 15.0 KB
RevLine 
[3f8be484]1<?xml version="1.0" encoding="ISO-8859-1"?>
[aa18ac0]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[3f8be484]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-gcc" role="wrap">
9 <?dbhtml filename="gcc.html"?>
10
11 <title>GCC-&gcc-version;</title>
12
13 <indexterm zone="ch-system-gcc">
14 <primary sortas="a-GCC">GCC</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The GCC package contains the GNU compiler collection, which includes
21 the C and C++ compilers.</para>
22
23 </sect2>
24
25 <sect2 role="installation">
26 <title>Installation of GCC</title>
27
[24b004c]28 <para os="p1">The following patch contains a number of updates to the
[cc858ed]29 &gcc-version; branch by the GCC developers:</para>
30
31 <screen os="p2"><userinput>patch -Np1 -i ../&gcc-branch_update-patch;</userinput></screen>
32
[7eea5e4]33 <para os="fix1">Apply a <command>sed</command> substitution that will
[7327f1f]34 suppress the execution of the <command>fixincludes</command> script:</para>
35
[aaa3150]36<screen os="fix2"><userinput>sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen>
[7327f1f]37
[3f8be484]38 <para os="f">The GCC documentation recommends building GCC outside of the source
39 directory in a dedicated build directory:</para>
40
[94e6142]41<screen os="g"><userinput>mkdir -v ../gcc-build
[3f8be484]42cd ../gcc-build</userinput></screen>
43
44 <para os="h">Prepare GCC for compilation:</para>
45
[ab871d9]46<screen os="i"><userinput>SED=sed CC="gcc -isystem /usr/include" \
[b6831b6]47CXX="g++ -isystem /usr/include" \
48LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" \
49 ../gcc-&gcc-version;/configure --prefix=/usr \
[f6853e3]50 --libexecdir=/usr/lib --enable-languages=c,c++ \
[feeb523]51 --disable-multilib --with-system-zlib \
[f6853e3]52 --enable-install-libiberty --disable-bootstrap</userinput></screen>
[3f8be484]53
[46d4942]54 <variablelist os="i1">
[cc9f07c]55 <title>The meaning of the new configure options:</title>
[46d4942]56
57 <varlistentry>
58 <term><parameter>SED=sed</parameter></term>
59 <listitem>
60 <para>This prevents a hard-coded path to
61 <filename>/tools/bin/sed</filename> in the <command>fixincl</command>
62 program.</para>
63 </listitem>
64 </varlistentry>
65
[cc9f07c]66 <varlistentry>
67 <term><parameter>--disable-bootstrap</parameter></term>
68 <listitem>
69 <para>For a native build, GCC defaults to performing a 3-stage
70 "bootstrap" of the compiler. This means that GCC is compiled a total
71 of 3 times - it is compiled once, the first stage compiler is used
72 to build itself again, and the second stage compiler builds itself
73 once more. The second and third passes are then compared, verifying
74 that GCC is able to reproduce itself successfully. However, there is
75 no need for this with the CLFS build process so we disable it here.</para>
76 </listitem>
77 </varlistentry>
78
[46d4942]79 </variablelist>
80
[d55f00bc]81 <para os="j">Compile the package:</para>
[3f8be484]82
[f568131]83<screen os="k"><userinput>make</userinput></screen>
[3f8be484]84
[d55f00bc]85 <important os="l">
[d4469fc]86 <para>Due to GCC's critical role in a properly functioning system,
87 the CLFS developers strongly recommend running the testsuite.</para>
[3f8be484]88 </important>
89
[16fb2c3c]90 <para os="s1">Increase the stack size prior to running the tests:</para>
91
92<screen os="s2"><userinput remap="test">ulimit -s 32768</userinput></screen>
93
[d55f00bc]94 <para os="m">Test the results, but do not stop at errors:</para>
[3f8be484]95
[686839b]96<screen os="n"><userinput remap="test">make -k check</userinput></screen>
[3f8be484]97
[d55f00bc]98 <para os="o">The <parameter>-k</parameter> flag is used to make the test suite
[3f8be484]99 run through to completion and not stop at the first failure. The GCC test
100 suite is very comprehensive and is almost guaranteed to generate a few
101 failures. To receive a summary of the test suite results, run:</para>
102
[686839b]103<screen os="p"><userinput remap="test">../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
[3f8be484]104
[d55f00bc]105 <para os="q">For only the summaries, pipe the output through
[3f8be484]106 <userinput>grep -A7 Summ</userinput>.</para>
107
108 <para os="r">A few unexpected failures cannot always be avoided. The
109 GCC developers are usually aware of these issues, but have not
[d55f00bc]110 resolved them yet.</para>
[3f8be484]111
112 <para os="s">Install the package:</para>
113
114<screen os="t"><userinput>make install</userinput></screen>
115
[f6853e3]116 <para os="w">Create a link to satisfy FHS requirements:</para>
[3f8be484]117
[3d66e17]118<screen os="x"><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
[3f8be484]119
[3d66e17]120 <para os="y">Many packages use the name <command>cc</command> to call the C
[3f8be484]121 compiler. To satisfy those packages, create a symlink:</para>
122
[3d66e17]123<screen os="z"><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
[3f8be484]124
[55581cc]125 <para os="aa">Finally, move a misplaced file:</para>
126
[2db9f66]127<screen os="ab"><userinput>mv -v /usr/lib/libstdc++*gdb.py /usr/share/gdb/auto-load/usr/lib</userinput></screen>
[55581cc]128
[3f8be484]129 </sect2>
130
131 <sect2 id="contents-gcc" role="content">
132 <title>Contents of GCC</title>
133
134 <segmentedlist>
135 <segtitle>Installed programs</segtitle>
136 <segtitle>Installed libraries</segtitle>
[61ad0b7f]137 <segtitle>Installed directories</segtitle>
[3f8be484]138
139 <seglistitem>
[f6853e3]140 <seg>c++, cc (link to gcc), cpp, g++, gcc, gcov, gcov-tool</seg>
141 <seg>libasan.[a,so], libatomic.[a,so], libcc1.so, libcilkrts.[a,so],
142 libgcc.a, libgcc_eh.a, libgcc_s.so, libgcov.a, libgomp.[a,so],
143 libiberty.a, libitm.[a,so], liblsan.[a,so], liblto_plugin.so,
144 libquadmath.[a,so], libssp.[a,so], libssp_nonshared.a,
145 libstdc++.[a,so], libsupc++.a, libtsan.[a,so], libubsan.[a,so],
146 libvtv.[a,so]</seg>
147 <seg>/usr/include/[c++,libiberty], /usr/lib/gcc,
148 /usr/share/gcc-&gcc-version;</seg>
[3f8be484]149 </seglistitem>
150 </segmentedlist>
151
152 <variablelist>
153 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
154 <?dbfo list-presentation="list"?>
155 <?dbhtml list-presentation="table"?>
156
157 <varlistentry id="cc">
158 <term><command>cc</command></term>
159 <listitem>
160 <para>The C compiler</para>
161 <indexterm zone="ch-system-gcc cc">
162 <primary sortas="b-cc">cc</primary>
163 </indexterm>
164 </listitem>
165 </varlistentry>
166
167 <varlistentry id="cpp">
168 <term><command>cpp</command></term>
169 <listitem>
170 <para>The C preprocessor; it is used by the compiler to expand the
171 #include, #define, and similar statements in the source files</para>
172 <indexterm zone="ch-system-gcc cpp">
173 <primary sortas="b-cpp">cpp</primary>
174 </indexterm>
175 </listitem>
176 </varlistentry>
177
178 <varlistentry id="c">
179 <term><command>c++</command></term>
180 <listitem>
181 <para>The C++ compiler</para>
182 <indexterm zone="ch-system-gcc c">
183 <primary sortas="b-c++">c++</primary>
184 </indexterm>
185 </listitem>
186 </varlistentry>
187
188 <varlistentry id="g">
189 <term><command>g++</command></term>
190 <listitem>
191 <para>The C++ compiler</para>
192 <indexterm zone="ch-system-gcc g">
193 <primary sortas="b-g++">g++</primary>
194 </indexterm>
195 </listitem>
196 </varlistentry>
197
198 <varlistentry id="gcc">
199 <term><command>gcc</command></term>
200 <listitem>
201 <para>The C compiler</para>
202 <indexterm zone="ch-system-gcc gcc">
203 <primary sortas="b-gcc">gcc</primary>
204 </indexterm>
205 </listitem>
206 </varlistentry>
207
208 <varlistentry id="gcov">
209 <term><command>gcov</command></term>
210 <listitem>
211 <para>A coverage testing tool; it is used to analyze programs to
212 determine where optimizations will have the most effect</para>
213 <indexterm zone="ch-system-gcc gcov">
214 <primary sortas="b-gcov">gcov</primary>
215 </indexterm>
216 </listitem>
217 </varlistentry>
218
[f6853e3]219 <varlistentry id="gcovtool">
220 <term><command>gcov-tool</command></term>
221 <listitem>
222 <para>An offline tool to handle gcda counts</para>
223 <indexterm zone="ch-system-gcc gcovtool">
224 <primary sortas="b-gcov-tool">gcov-tool</primary>
225 </indexterm>
226 </listitem>
227 </varlistentry>
228
[01aa1cc]229 <varlistentry id="libasan">
230 <term><filename class="libraryfile">libasan</filename></term>
231 <listitem>
232 <para>The Address Sanitizer runtime library</para>
233 <indexterm zone="ch-system-gcc libasan">
234 <primary sortas="c-libasan">libasan</primary>
235 </indexterm>
236 </listitem>
237 </varlistentry>
238
[d1f79ab]239 <varlistentry id="libatomic">
240 <term><filename class="libraryfile">libatomic</filename></term>
241 <listitem>
242 <para>A GCC support runtime library for atomic operations not
243 supported by hardware</para>
244 <indexterm zone="ch-system-gcc libatomic">
[f6853e3]245 <primary sortas="c-libatomic">libatomic</primary>
246 </indexterm>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry id="libcc1">
251 <term><filename class="libraryfile">libcc1</filename></term>
252 <listitem>
253 <para>Translates API into RPC calls</para>
254 <indexterm zone="ch-system-gcc libcc1">
255 <primary sortas="c-libcc1">libcc1</primary>
256 </indexterm>
257 </listitem>
258 </varlistentry>
259
260 <varlistentry id="libcilkrts">
261 <term><filename class="libraryfile">libcilkrts</filename></term>
262 <listitem>
263 <para>Intel&reg; Cilk&trade; Plus runtime library</para>
264 <indexterm zone="ch-system-gcc libcilkrts">
265 <primary sortas="c-libcilkrts">libcilkrts</primary>
[d1f79ab]266 </indexterm>
267 </listitem>
268 </varlistentry>
269
[3f8be484]270 <varlistentry id="libgcc">
271 <term><filename class="libraryfile">libgcc</filename></term>
272 <listitem>
273 <para>Contains run-time support for <command>gcc</command></para>
274 <indexterm zone="ch-system-gcc libgcc">
275 <primary sortas="c-libgcc*">libgcc*</primary>
276 </indexterm>
277 </listitem>
278 </varlistentry>
279
[2cca6fd]280 <varlistentry id="libgcov">
281 <term><filename class="libraryfile">libgcov</filename></term>
282 <listitem>
283 <para>Library that is linked into a program when
284 <command>gcc</command> is instructed to enable profiling</para>
285 <indexterm zone="ch-system-gcc libgcov">
286 <primary sortas="c-libgcov">libgcov</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
290
[188b6b2]291 <varlistentry id="libgomp">
292 <term><filename class="libraryfile">libgomp</filename></term>
293 <listitem>
294 <para>GNU implementation of the OpenMP API for multi-platform
295 shared-memory parallel programming in C/C++ and Fortran</para>
296 <indexterm zone="ch-system-gcc libgomp">
297 <primary sortas="c-libgomp">libgomp</primary>
298 </indexterm>
299 </listitem>
[3d66e17]300 </varlistentry>
301
302 <varlistentry id="libiberty">
303 <term><filename class="libraryfile">libiberty</filename></term>
304 <listitem>
305 <para>Contains routines used by various GNU programs, including
306 <command>getopt</command>, <command>obstack</command>,
307 <command>strerror</command>, <command>strtol</command>, and
308 <command>strtoul</command></para>
309 <indexterm zone="ch-system-gcc libiberty">
310 <primary sortas="c-libiberty">libiberty</primary>
311 </indexterm>
312 </listitem>
[188b6b2]313 </varlistentry>
314
[d1f79ab]315 <varlistentry id="libitm">
316 <term><filename class="libraryfile">libitm</filename></term>
317 <listitem>
318 <para>The GNU Transactional Memory Library, which provides
319 transaction support for accesses to a process's memory</para>
320 <indexterm zone="ch-system-gcc libitm">
321 <primary sortas="c-libitm*">libitm*</primary>
322 </indexterm>
323 </listitem>
324 </varlistentry>
325
[f6853e3]326 <varlistentry id="liblsan">
327 <term><filename class="libraryfile">liblsan</filename></term>
[d1f79ab]328 <listitem>
[f6853e3]329 <para>The Leak Sanitizer runtime library</para>
330 <indexterm zone="ch-system-gcc liblsan">
331 <primary sortas="c-liblsan">liblsan</primary>
[d1f79ab]332 </indexterm>
333 </listitem>
334 </varlistentry>
335
[f6853e3]336 <varlistentry id="liblto_plugin">
337 <term><filename class="libraryfile">liblto_plugin</filename></term>
[12a457e]338 <listitem>
[f6853e3]339 <para>Runtime library for GCC's link-time optimization plugin</para>
340 <indexterm zone="ch-system-gcc liblto_plugin">
341 <primary sortas="c-liblto_plugin">liblto_plugin</primary>
[12a457e]342 </indexterm>
343 </listitem>
344 </varlistentry>
345
[d1f79ab]346 <varlistentry id="libquadmath">
347 <term><filename class="libraryfile">libquadmath</filename></term>
348 <listitem>
349 <para>The GCC Quad-Precision Math Libarary API</para>
350 <indexterm zone="ch-system-gcc libquadmath">
351 <primary sortas="c-libquadmath*">libquadmath*</primary>
352 </indexterm>
353 </listitem>
354 </varlistentry>
355
[188b6b2]356 <varlistentry id="libssp">
357 <term><filename class="libraryfile">libssp</filename></term>
358 <listitem>
359 <para>Contains routines supporting GCC's stack-smashing protection
360 functionality</para>
361 <indexterm zone="ch-system-gcc libssp">
362 <primary sortas="c-libssp*">libssp*</primary>
363 </indexterm>
364 </listitem>
365 </varlistentry>
366
[3f8be484]367 <varlistentry id="libstdc">
368 <term><filename class="libraryfile">libstdc++</filename></term>
369 <listitem>
370 <para>The standard C++ library</para>
371 <indexterm zone="ch-system-gcc libstdc">
372 <primary sortas="c-libstdc++">libstdc++</primary>
373 </indexterm>
374 </listitem>
375 </varlistentry>
376
377 <varlistentry id="libsupc">
378 <term><filename class="libraryfile">libsupc++</filename></term>
379 <listitem>
380 <para>Provides supporting routines for the C++ programming
381 language</para>
382 <indexterm zone="ch-system-gcc libsupc">
383 <primary sortas="c-libsupc++">libsupc++</primary>
384 </indexterm>
385 </listitem>
386 </varlistentry>
387
[8c09b88]388 <varlistentry id="libtsan">
389 <term><filename class="libraryfile">libtsan</filename></term>
390 <listitem>
391 <para>The Thread Sanitizer runtime library</para>
392 <indexterm zone="ch-system-gcc libtsan">
393 <primary sortas="c-libtsan">libtsan</primary>
394 </indexterm>
395 </listitem>
396 </varlistentry>
397
[f6853e3]398 <varlistentry id="libubsan">
399 <term><filename class="libraryfile">libubsan</filename></term>
400 <listitem>
401 <para>The Undefined Beahvior Sanitizer runtime library</para>
402 <indexterm zone="ch-system-gcc libubsan">
403 <primary sortas="c-libubsan">libubsan</primary>
404 </indexterm>
405 </listitem>
406 </varlistentry>
407
408 <varlistentry id="libvtv">
409 <term><filename class="libraryfile">libvtv</filename></term>
410 <listitem>
411 <para>The Virtual Table Verification runtime library</para>
412 <indexterm zone="ch-system-gcc libvtv">
413 <primary sortas="c-libvtv">libvtv</primary>
414 </indexterm>
415 </listitem>
416 </varlistentry>
417
[3f8be484]418 </variablelist>
419
420 </sect2>
421
422</sect1>
Note: See TracBrowser for help on using the repository browser.