source: chapter06/gcc.xml@ e747759

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since e747759 was e747759, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added sect1info blocks to packages pages.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8366 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 13.4 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 <sect1info condition="script">
12 <productname>gcc</productname>
13 <productnumber>&gcc-version;</productnumber>
14 <address>&gcc-url;</address>
15 </sect1info>
16
17 <title>GCC-&gcc-version;</title>
18
19 <indexterm zone="ch-system-gcc">
20 <primary sortas="a-GCC">GCC</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The GCC package contains the GNU compiler collection, which includes
27 the C and C++ compilers.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
34 <seg>&gcc-ch6-sbu;</seg>
35 <seg>&gcc-ch6-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of GCC</title>
43
44 <para>Apply a <command>sed</command> substitution that will suppress the
45 installation of <filename class="libraryfile">libiberty.a</filename>. The
46 version of <filename class="libraryfile">libiberty.a</filename> provided by
47 Binutils will be used instead:</para>
48
49<screen><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
50
51 <para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
52 built GCC with the <option>-fomit-frame-pointer</option> compiler flag.
53 Non-bootstrap builds omit this flag by default, so apply the following
54 <command>sed</command> to use it in order to ensure consistent compiler
55 builds:</para>
56
57<screen><userinput>sed -i 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in</userinput></screen>
58
59 <para>The <command>fixincludes</command> script is known to occasionally
60 erroneously attempt to &quot;fix&quot; the system headers installed so far. As
61 the headers installed by GCC-&gcc-version; and Glibc-&glibc-version; are known
62 to not require fixing, issue the following command to prevent the
63 <command>fixincludes</command> script from running:</para>
64
65<screen><userinput>sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen>
66
67 <para>GCC provides a <command>gccbug</command> script which detects at
68 compile time whether mktemp is present, and hardcodes the result in a test.
69 This will cause the script to fall back to using less random names for
70 temporary files. We will be installing mktemp later, so the following sed
71 will simulate its presence:</para>
72
73<screen><userinput>sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in</userinput></screen>
74
75 <para>The GCC documentation recommends building GCC outside of the source
76 directory in a dedicated build directory:</para>
77
78<screen><userinput>mkdir -v ../gcc-build
79cd ../gcc-build</userinput></screen>
80
81 <para>Prepare GCC for compilation:</para>
82
83<screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
84 --libexecdir=/usr/lib --enable-shared \
85 --enable-threads=posix --enable-__cxa_atexit \
86 --enable-clocale=gnu --enable-languages=c,c++</userinput></screen>
87
88 <para>Compile the package:</para>
89
90<screen><userinput>make</userinput></screen>
91
92 <important>
93 <para>In this section, the test suite for GCC is considered
94 critical. Do not skip it under any circumstance.</para>
95 </important>
96
97 <para>Test the results, but do not stop at errors:</para>
98
99<screen><userinput>make -k check</userinput></screen>
100
101 <para>To receive a summary of the test suite results, run:</para>
102
103<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
104
105 <para>For only the summaries, pipe the output through
106 <userinput>grep -A7 Summ</userinput>.</para>
107
108 <para>Results can be compared with those located at <ulink
109 url="&test-results;"/>.</para>
110
111 <para>A few unexpected failures cannot always be avoided. The GCC developers
112 are usually aware of these issues, but have not resolved them yet. In
113 particular, the <filename class="libraryfile">libmudflap</filename> tests
114 are known be particularly problematic as a result of a bug in GCC
115 (<ulink url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20003"/>).
116 Unless the test results are vastly different from those at the above URL,
117 it is safe to continue.</para>
118
119 <para>Install the package:</para>
120
121<screen><userinput>make install</userinput></screen>
122
123 <para>Some packages expect the C preprocessor to be installed in the
124 <filename class="directory">/lib</filename> directory.
125 To support those packages, create this symlink:</para>
126
127<screen><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
128
129 <para>Many packages use the name <command>cc</command> to call the C
130 compiler. To satisfy those packages, create a symlink:</para>
131
132<screen><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
133
134 <para>Now that our final toolchain is in place, it is important to again ensure
135 that compiling and linking will work as expected. We do this by performing
136 the same sanity checks as we did earlier in the chapter:</para>
137
138 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
139 href="readjusting.xml"
140 xpointer="xpointer(//*[@os='a'])"/>
141
142 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
143 href="readjusting.xml"
144 xpointer="xpointer(//*[@os='b'])"/>
145
146 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
147 href="readjusting.xml"
148 xpointer="xpointer(//*[@os='c'])"/>
149
150 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
151 href="readjusting.xml"
152 xpointer="xpointer(//*[@os='d'])"/>
153
154 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
155 href="readjusting.xml"
156 xpointer="xpointer(//*[@os='e'])"/>
157
158 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
159 href="readjusting.xml"
160 xpointer="xpointer(//*[@os='f'])"/>
161
162<screen><computeroutput>/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crt1.o succeeded
163/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crti.o succeeded
164/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crtn.o succeeded</computeroutput></screen>
165
166 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
167 href="readjusting.xml"
168 xpointer="xpointer(//*[@os='g'])"/>
169
170<screen><userinput>grep -B3 '^ /usr/include' dummy.log</userinput></screen>
171
172 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
173 href="readjusting.xml"
174 xpointer="xpointer(//*[@os='h'])"/>
175
176<screen><computeroutput>#include &lt;...&gt; search starts here:
177 /usr/local/include
178 /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include
179 /usr/include</computeroutput></screen>
180
181 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
182 href="readjusting.xml"
183 xpointer="xpointer(//*[@os='i'])"/>
184
185 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
186 href="readjusting.xml"
187 xpointer="xpointer(//*[@os='j'])"/>
188
189 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
190 href="readjusting.xml"
191 xpointer="xpointer(//*[@os='k'])"/>
192
193<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
194SEARCH_DIR("/usr/local/lib")
195SEARCH_DIR("/lib")
196SEARCH_DIR("/usr/lib");</computeroutput></screen>
197
198 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
199 href="readjusting.xml"
200 xpointer="xpointer(//*[@os='l'])"/>
201
202 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
203 href="readjusting.xml"
204 xpointer="xpointer(//*[@os='m'])"/>
205
206 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
207 href="readjusting.xml"
208 xpointer="xpointer(//*[@os='n'])"/>
209
210 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
211 href="readjusting.xml"
212 xpointer="xpointer(//*[@os='o'])"/>
213
214 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
215 href="readjusting.xml"
216 xpointer="xpointer(//*[@os='p'])"/>
217
218 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
219 href="readjusting.xml"
220 xpointer="xpointer(//*[@os='q'])"/>
221
222 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
223 href="readjusting.xml"
224 xpointer="xpointer(//*[@os='r'])"/>
225
226 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
227 href="readjusting.xml"
228 xpointer="xpointer(//*[@os='s'])"/>
229
230 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
231 href="readjusting.xml"
232 xpointer="xpointer(//*[@os='t'])"/>
233
234 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
235 href="readjusting.xml"
236 xpointer="xpointer(//*[@os='u'])"/>
237
238 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
239 href="readjusting.xml"
240 xpointer="xpointer(//*[@os='v'])"/>
241
242 </sect2>
243
244 <sect2 id="contents-gcc" role="content">
245 <title>Contents of GCC</title>
246
247 <segmentedlist>
248 <segtitle>Installed programs</segtitle>
249 <segtitle>Installed libraries</segtitle>
250
251 <seglistitem>
252 <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
253 <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libmudflap.{a,so},
254 libssp.{a,so}libstdc++.{a,so}, and libsupc++.a</seg>
255 </seglistitem>
256 </segmentedlist>
257
258 <variablelist>
259 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
260 <?dbfo list-presentation="list"?>
261 <?dbhtml list-presentation="table"?>
262
263 <varlistentry id="c">
264 <term><command>c++</command></term>
265 <listitem>
266 <para>The C++ compiler</para>
267 <indexterm zone="ch-system-gcc c">
268 <primary sortas="b-c++">c++</primary>
269 </indexterm>
270 </listitem>
271 </varlistentry>
272
273 <varlistentry id="cc">
274 <term><command>cc</command></term>
275 <listitem>
276 <para>The C compiler</para>
277 <indexterm zone="ch-system-gcc cc">
278 <primary sortas="b-cc">cc</primary>
279 </indexterm>
280 </listitem>
281 </varlistentry>
282
283 <varlistentry id="cpp">
284 <term><command>cpp</command></term>
285 <listitem>
286 <para>The C preprocessor; it is used by the compiler to expand the
287 #include, #define, and similar statements in the source files</para>
288 <indexterm zone="ch-system-gcc cpp">
289 <primary sortas="b-cpp">cpp</primary>
290 </indexterm>
291 </listitem>
292 </varlistentry>
293
294 <varlistentry id="g">
295 <term><command>g++</command></term>
296 <listitem>
297 <para>The C++ compiler</para>
298 <indexterm zone="ch-system-gcc g">
299 <primary sortas="b-g++">g++</primary>
300 </indexterm>
301 </listitem>
302 </varlistentry>
303
304 <varlistentry id="gcc">
305 <term><command>gcc</command></term>
306 <listitem>
307 <para>The C compiler</para>
308 <indexterm zone="ch-system-gcc gcc">
309 <primary sortas="b-gcc">gcc</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry id="gccbug">
315 <term><command>gccbug</command></term>
316 <listitem>
317 <para>A shell script used to help create useful bug reports</para>
318 <indexterm zone="ch-system-gcc gccbug">
319 <primary sortas="b-gccbug">gccbug</primary>
320 </indexterm>
321 </listitem>
322 </varlistentry>
323
324 <varlistentry id="gcov">
325 <term><command>gcov</command></term>
326 <listitem>
327 <para>A coverage testing tool; it is used to analyze programs to
328 determine where optimizations will have the most effect</para>
329 <indexterm zone="ch-system-gcc gcov">
330 <primary sortas="b-gcov">gcov</primary>
331 </indexterm>
332 </listitem>
333 </varlistentry>
334
335 <varlistentry id="libgcc">
336 <term><filename class="libraryfile">libgcc</filename></term>
337 <listitem>
338 <para>Contains run-time support for <command>gcc</command></para>
339 <indexterm zone="ch-system-gcc libgcc">
340 <primary sortas="c-libgcc*">libgcc*</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="libmudflap">
346 <term><filename class="libraryfile">libmudflap</filename></term>
347 <listitem>
348 <para>Contains routines that support GCC's bounds checking
349 functionality</para>
350 <indexterm zone="ch-system-gcc libmudflap">
351 <primary sortas="c-libmudflap*">libmudflap*</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 </variablelist>
389
390 </sect2>
391
392</sect1>
Note: See TracBrowser for help on using the repository browser.