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