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

systemd
Last change on this file since 773bdf4f was c4ebdab, checked in by William Harrington <kb0iic@…>, 9 years ago

Upgrade GCC from 5.2.0 to 5.3.0.

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