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

clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since eb80690 was e11c91d, checked in by William Harrington <kb0iic@…>, 11 years ago

Move gdb py files to correct auto-load directory.

  • Property mode set to 100644
File size: 9.8 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> subsitution that will
34 suppress the execution of the <command>fixincludes</command> script:</para>
35
36<screen os="fix2"><userinput>cp -v gcc/Makefile.in{,.orig}
37sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in</userinput></screen>
38
39 <para os="d">Apply a <command>sed</command> substitution that will suppress the
40 installation of <filename class="libraryfile">libiberty.a</filename>. The
41 version of <filename class="libraryfile">libiberty.a</filename> provided by
42 Binutils will be used instead:</para>
43
44<screen os="e"><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
45
46 <para os="f">The GCC documentation recommends building GCC outside of the source
47 directory in a dedicated build directory:</para>
48
49<screen os="g"><userinput>mkdir -v ../gcc-build
50cd ../gcc-build</userinput></screen>
51
52 <para os="h">Prepare GCC for compilation:</para>
53
54<screen os="i"><userinput>CC="gcc -isystem /usr/include" \
55CXX="g++ -isystem /usr/include" \
56LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" \
57 ../gcc-&gcc-version;/configure --prefix=/usr \
58 --libexecdir=/usr/lib --enable-shared --enable-threads=posix \
59 --enable-__cxa_atexit --enable-c99 --enable-long-long \
60 --enable-clocale=gnu --enable-languages=c,c++ \
61 --disable-multilib --disable-libstdcxx-pch \
62 --enable-cloog-backend=isl --disable-isl-version-check --with-system-zlib \
63 --enable-checking=release --enable-libstdcxx-time \
64 --disable-install-libiberty</userinput></screen>
65
66 <para os="j">Compile the package:</para>
67
68<screen os="k"><userinput>make</userinput></screen>
69
70 <important os="l">
71 <para>The test suite for GCC is considered
72 critical. Do not skip it under any circumstance.</para>
73 </important>
74
75 <para os="m">Test the results, but do not stop at errors:</para>
76
77<screen os="n"><userinput>make -k check</userinput></screen>
78
79 <para os="o">The <parameter>-k</parameter> flag is used to make the test suite
80 run through to completion and not stop at the first failure. The GCC test
81 suite is very comprehensive and is almost guaranteed to generate a few
82 failures. To receive a summary of the test suite results, run:</para>
83
84<screen os="p"><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
85
86 <para os="q">For only the summaries, pipe the output through
87 <userinput>grep -A7 Summ</userinput>.</para>
88
89 <para os="r">A few unexpected failures cannot always be avoided. The
90 GCC developers are usually aware of these issues, but have not
91 resolved them yet.</para>
92
93 <para os="s">Install the package:</para>
94
95<screen os="t"><userinput>make install</userinput></screen>
96
97 <para os="u">Some packages expect the C preprocessor to be installed in the
98 <filename class="directory">/lib</filename> directory.
99 To support those packages, create this symlink:</para>
100
101<screen os="v"><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
102
103 <para os="w">Many packages use the name <command>cc</command> to call the C
104 compiler. To satisfy those packages, create a symlink:</para>
105
106<screen os="x"><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
107
108 <para os="y">Finally, move a misplaced file:</para>
109
110<screen os="z"><userinput>mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib</userinput></screen>
111
112 </sect2>
113
114 <sect2 id="contents-gcc" role="content">
115 <title>Contents of GCC</title>
116
117 <segmentedlist>
118 <segtitle>Installed programs</segtitle>
119 <segtitle>Installed libraries</segtitle>
120 <segtitle>Installed directories</segtitle>
121
122 <seglistitem>
123 <seg>c++, cc (link to gcc), cpp, g++, gcc, and gcov</seg>
124 <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libgcov.a, libgomp.[a,so],
125 libmudflap.[a,so], libmudflapth.[a,so], libssp.[a,so],
126 libssp_nonshared.a, libstdc++.[a,so], and libsupc++.a</seg>
127 <seg>/usr/include/c++, /usr/lib/gcc, /usr/share/gcc-&gcc-version;</seg>
128 </seglistitem>
129 </segmentedlist>
130
131 <variablelist>
132 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
133 <?dbfo list-presentation="list"?>
134 <?dbhtml list-presentation="table"?>
135
136 <varlistentry id="cc">
137 <term><command>cc</command></term>
138 <listitem>
139 <para>The C compiler</para>
140 <indexterm zone="ch-system-gcc cc">
141 <primary sortas="b-cc">cc</primary>
142 </indexterm>
143 </listitem>
144 </varlistentry>
145
146 <varlistentry id="cpp">
147 <term><command>cpp</command></term>
148 <listitem>
149 <para>The C preprocessor; it is used by the compiler to expand the
150 #include, #define, and similar statements in the source files</para>
151 <indexterm zone="ch-system-gcc cpp">
152 <primary sortas="b-cpp">cpp</primary>
153 </indexterm>
154 </listitem>
155 </varlistentry>
156
157 <varlistentry id="c">
158 <term><command>c++</command></term>
159 <listitem>
160 <para>The C++ compiler</para>
161 <indexterm zone="ch-system-gcc c">
162 <primary sortas="b-c++">c++</primary>
163 </indexterm>
164 </listitem>
165 </varlistentry>
166
167 <varlistentry id="g">
168 <term><command>g++</command></term>
169 <listitem>
170 <para>The C++ compiler</para>
171 <indexterm zone="ch-system-gcc g">
172 <primary sortas="b-g++">g++</primary>
173 </indexterm>
174 </listitem>
175 </varlistentry>
176
177 <varlistentry id="gcc">
178 <term><command>gcc</command></term>
179 <listitem>
180 <para>The C compiler</para>
181 <indexterm zone="ch-system-gcc gcc">
182 <primary sortas="b-gcc">gcc</primary>
183 </indexterm>
184 </listitem>
185 </varlistentry>
186
187 <varlistentry id="gcov">
188 <term><command>gcov</command></term>
189 <listitem>
190 <para>A coverage testing tool; it is used to analyze programs to
191 determine where optimizations will have the most effect</para>
192 <indexterm zone="ch-system-gcc gcov">
193 <primary sortas="b-gcov">gcov</primary>
194 </indexterm>
195 </listitem>
196 </varlistentry>
197
198 <varlistentry id="libgcc">
199 <term><filename class="libraryfile">libgcc</filename></term>
200 <listitem>
201 <para>Contains run-time support for <command>gcc</command></para>
202 <indexterm zone="ch-system-gcc libgcc">
203 <primary sortas="c-libgcc*">libgcc*</primary>
204 </indexterm>
205 </listitem>
206 </varlistentry>
207
208 <varlistentry id="libgcov">
209 <term><filename class="libraryfile">libgcov</filename></term>
210 <listitem>
211 <para>Library that is linked into a program when
212 <command>gcc</command> is instructed to enable profiling</para>
213 <indexterm zone="ch-system-gcc libgcov">
214 <primary sortas="c-libgcov">libgcov</primary>
215 </indexterm>
216 </listitem>
217 </varlistentry>
218
219 <varlistentry id="libgomp">
220 <term><filename class="libraryfile">libgomp</filename></term>
221 <listitem>
222 <para>GNU implementation of the OpenMP API for multi-platform
223 shared-memory parallel programming in C/C++ and Fortran</para>
224 <indexterm zone="ch-system-gcc libgomp">
225 <primary sortas="c-libgomp">libgomp</primary>
226 </indexterm>
227 </listitem>
228 </varlistentry>
229
230 <varlistentry id="libmudflap">
231 <term><filename class="libraryfile">libmudflap</filename></term>
232 <listitem>
233 <para>The libmudflap libraries are used by GCC for instrumenting
234 pointer and array dereferencing operations.</para>
235 <indexterm zone="ch-system-gcc libmudflap">
236 <primary sortas="c-libmudflap*">libmudflap*</primary>
237 </indexterm>
238 </listitem>
239 </varlistentry>
240
241 <varlistentry id="libssp">
242 <term><filename class="libraryfile">libssp</filename></term>
243 <listitem>
244 <para>Contains routines supporting GCC's stack-smashing protection
245 functionality</para>
246 <indexterm zone="ch-system-gcc libssp">
247 <primary sortas="c-libssp*">libssp*</primary>
248 </indexterm>
249 </listitem>
250 </varlistentry>
251
252 <varlistentry id="libstdc">
253 <term><filename class="libraryfile">libstdc++</filename></term>
254 <listitem>
255 <para>The standard C++ library</para>
256 <indexterm zone="ch-system-gcc libstdc">
257 <primary sortas="c-libstdc++">libstdc++</primary>
258 </indexterm>
259 </listitem>
260 </varlistentry>
261
262 <varlistentry id="libsupc">
263 <term><filename class="libraryfile">libsupc++</filename></term>
264 <listitem>
265 <para>Provides supporting routines for the C++ programming
266 language</para>
267 <indexterm zone="ch-system-gcc libsupc">
268 <primary sortas="c-libsupc++">libsupc++</primary>
269 </indexterm>
270 </listitem>
271 </varlistentry>
272
273 </variablelist>
274
275 </sect2>
276
277</sect1>
Note: See TracBrowser for help on using the repository browser.