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

sysvinit
Last change on this file since b2eff36 was 428d8a4, checked in by Chris Staub <chris@…>, 9 years ago

Provided explanation for --disable-bootstrap

  • Property mode set to 100644
File size: 15.0 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<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
28 <para os="p1">The following patch contains a number of updates to the
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
33 <para os="fix1">Apply a <command>sed</command> substitution that will
34 suppress the execution of the <command>fixincludes</command> script:</para>
35
36<screen os="fix2"><userinput>sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen>
37
38 <para os="f">The GCC documentation recommends building GCC outside of the source
39 directory in a dedicated build directory:</para>
40
41<screen os="g"><userinput>mkdir -v ../gcc-build
42cd ../gcc-build</userinput></screen>
43
44 <para os="h">Prepare GCC for compilation:</para>
45
46<screen os="i"><userinput>SED=sed CC="gcc -isystem /usr/include" \
47CXX="g++ -isystem /usr/include" \
48LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" \
49 ../gcc-&gcc-version;/configure --prefix=/usr \
50 --libexecdir=/usr/lib --enable-languages=c,c++ \
51 --disable-multilib --with-system-zlib \
52 --enable-install-libiberty --disable-bootstrap</userinput></screen>
53
54 <variablelist os="i1">
55 <title>The meaning of the new configure options:</title>
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
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
79 </variablelist>
80
81 <para os="j">Compile the package:</para>
82
83<screen os="k"><userinput>make</userinput></screen>
84
85 <important os="l">
86 <para>Due to GCC's critical role in a properly functioning system,
87 the CLFS developers strongly recommend running the testsuite.</para>
88 </important>
89
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
94 <para os="m">Test the results, but do not stop at errors:</para>
95
96<screen os="n"><userinput remap="test">make -k check</userinput></screen>
97
98 <para os="o">The <parameter>-k</parameter> flag is used to make the test suite
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
103<screen os="p"><userinput remap="test">../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
104
105 <para os="q">For only the summaries, pipe the output through
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
110 resolved them yet.</para>
111
112 <para os="s">Install the package:</para>
113
114<screen os="t"><userinput>make install</userinput></screen>
115
116 <para os="w">Create a link to satisfy FHS requirements:</para>
117
118<screen os="x"><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
119
120 <para os="y">Many packages use the name <command>cc</command> to call the C
121 compiler. To satisfy those packages, create a symlink:</para>
122
123<screen os="z"><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
124
125 <para os="aa">Finally, move a misplaced file:</para>
126
127<screen os="ab"><userinput>mv -v /usr/lib/libstdc++*gdb.py /usr/share/gdb/auto-load/usr/lib</userinput></screen>
128
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>
137 <segtitle>Installed directories</segtitle>
138
139 <seglistitem>
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>
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
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
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
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">
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>
266 </indexterm>
267 </listitem>
268 </varlistentry>
269
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
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
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>
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>
313 </varlistentry>
314
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
326 <varlistentry id="liblsan">
327 <term><filename class="libraryfile">liblsan</filename></term>
328 <listitem>
329 <para>The Leak Sanitizer runtime library</para>
330 <indexterm zone="ch-system-gcc liblsan">
331 <primary sortas="c-liblsan">liblsan</primary>
332 </indexterm>
333 </listitem>
334 </varlistentry>
335
336 <varlistentry id="liblto_plugin">
337 <term><filename class="libraryfile">liblto_plugin</filename></term>
338 <listitem>
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>
342 </indexterm>
343 </listitem>
344 </varlistentry>
345
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
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
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
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
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
418 </variablelist>
419
420 </sect2>
421
422</sect1>
Note: See TracBrowser for help on using the repository browser.