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

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 3788263 was 3788263, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Updated GCC to 4.2.4.

  • Property mode set to 100644
File size: 8.7 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<!--
29    <para os="p1">The following patch merges all updates from the &gcc-version; Branch
30    of GCC:</para>
31
32<screen os="p2"><userinput>patch -Np1 -i ../&gcc-branch_update-patch;</userinput></screen>
33-->
34
35    <para os="p3">The following patch enables fixes compilation errors with the kernel:</para>
36
37<screen os="p4"><userinput>patch -Np1 -i ../&gcc-PR31490-patch;</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="e1">GCC provides a <command>gccbug</command> script which detects at
47    compile time whether mktemp is present, and hardcodes the result in a test.
48    If mktemp is not found, the script will fall back to using less
49    random names for temporary files.  We will be installing mktemp
50    later, so the following sed will simulate its presence:</para>
51
52<screen os="e2"><userinput>sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in</userinput></screen>
53
54    <para os="f">The GCC documentation recommends building GCC outside of the source
55    directory in a dedicated build directory:</para>
56
57<screen os="g"><userinput>mkdir -v ../gcc-build
58cd ../gcc-build</userinput></screen>
59
60    <para os="h">Prepare GCC for compilation:</para>
61
62<screen os="i"><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
63    --libexecdir=/usr/lib --enable-shared --enable-threads=posix \
64    --enable-__cxa_atexit --enable-c99 --enable-long-long \
65    --enable-clocale=gnu --enable-languages=c,c++ \
66    --disable-multilib --disable-libstdcxx-pch</userinput></screen>
67
68    <para os="j">Compile the package:</para>
69
70<screen os="k"><userinput>make bootstrap</userinput></screen>
71
72    <important os="l">
73      <para>The test suite for GCC is considered
74      critical. Do not skip it under any circumstance.</para>
75    </important>
76
77    <para os="m">Test the results, but do not stop at errors:</para>
78
79<screen os="n"><userinput>make -k check</userinput></screen>
80
81    <para os="o">The <parameter>-k</parameter> flag is used to make the test suite
82    run through to completion and not stop at the first failure. The GCC test
83    suite is very comprehensive and is almost guaranteed to generate a few
84    failures. To receive a summary of the test suite results, run:</para>
85
86<screen os="p"><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
87
88    <para os="q">For only the summaries, pipe the output through
89    <userinput>grep -A7 Summ</userinput>.</para>
90
91    <para os="r">A few unexpected failures cannot always be avoided. The
92    GCC developers are usually aware of these issues, but have not
93    resolved them yet.</para>
94
95    <para os="s">Install the package:</para>
96
97<screen os="t"><userinput>make install</userinput></screen>
98
99    <para os="u">Some packages expect the C preprocessor to be installed in the
100    <filename class="directory">/lib</filename> directory.
101    To support those packages, create this symlink:</para>
102
103<screen os="v"><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
104
105    <para os="w">Many packages use the name <command>cc</command> to call the C
106    compiler. To satisfy those packages, create a symlink:</para>
107
108<screen os="x"><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
109
110  </sect2>
111
112  <sect2 id="contents-gcc" role="content">
113    <title>Contents of GCC</title>
114
115    <segmentedlist>
116      <segtitle>Installed programs</segtitle>
117      <segtitle>Installed libraries</segtitle>
118
119      <seglistitem>
120        <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
121        <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libgomp.[a,so], libmudflap.[a,so],
122        libmudflapth.[a,so], libssp.[a,so], libstdc++.[a,so], and
123        libsupc++.a</seg>
124      </seglistitem>
125    </segmentedlist>
126
127    <variablelist>
128      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
129      <?dbfo list-presentation="list"?>
130      <?dbhtml list-presentation="table"?>
131
132      <varlistentry id="cc">
133        <term><command>cc</command></term>
134        <listitem>
135          <para>The C compiler</para>
136          <indexterm zone="ch-system-gcc cc">
137            <primary sortas="b-cc">cc</primary>
138          </indexterm>
139        </listitem>
140      </varlistentry>
141
142      <varlistentry id="cpp">
143        <term><command>cpp</command></term>
144        <listitem>
145          <para>The C preprocessor; it is used by the compiler to expand the
146          #include, #define, and similar statements in the source files</para>
147          <indexterm zone="ch-system-gcc cpp">
148            <primary sortas="b-cpp">cpp</primary>
149          </indexterm>
150        </listitem>
151      </varlistentry>
152
153      <varlistentry id="c">
154        <term><command>c++</command></term>
155        <listitem>
156          <para>The C++ compiler</para>
157          <indexterm zone="ch-system-gcc c">
158            <primary sortas="b-c++">c++</primary>
159          </indexterm>
160        </listitem>
161      </varlistentry>
162
163      <varlistentry id="g">
164        <term><command>g++</command></term>
165        <listitem>
166          <para>The C++ compiler</para>
167          <indexterm zone="ch-system-gcc g">
168            <primary sortas="b-g++">g++</primary>
169          </indexterm>
170        </listitem>
171      </varlistentry>
172
173      <varlistentry id="gcc">
174        <term><command>gcc</command></term>
175        <listitem>
176          <para>The C compiler</para>
177          <indexterm zone="ch-system-gcc gcc">
178            <primary sortas="b-gcc">gcc</primary>
179          </indexterm>
180        </listitem>
181      </varlistentry>
182
183      <varlistentry id="gccbug">
184        <term><command>gccbug</command></term>
185        <listitem>
186          <para>A shell script used to help create useful bug reports</para>
187          <indexterm zone="ch-system-gcc gccbug">
188            <primary sortas="b-gccbug">gccbug</primary>
189          </indexterm>
190        </listitem>
191      </varlistentry>
192
193      <varlistentry id="gcov">
194        <term><command>gcov</command></term>
195        <listitem>
196          <para>A coverage testing tool; it is used to analyze programs to
197          determine where optimizations will have the most effect</para>
198          <indexterm zone="ch-system-gcc gcov">
199            <primary sortas="b-gcov">gcov</primary>
200          </indexterm>
201        </listitem>
202      </varlistentry>
203
204      <varlistentry id="libgcc">
205        <term><filename class="libraryfile">libgcc</filename></term>
206        <listitem>
207          <para>Contains run-time support for <command>gcc</command></para>
208          <indexterm zone="ch-system-gcc libgcc">
209            <primary sortas="c-libgcc*">libgcc*</primary>
210          </indexterm>
211        </listitem>
212      </varlistentry>
213
214      <varlistentry id="libmudflap">
215        <term><filename class="libraryfile">libmudflap</filename></term>
216        <listitem>
217          <para>The libmudflap libraries are used by GCC for instrumenting
218          pointer and array dereferencing operations.</para>
219          <indexterm zone="ch-system-gcc libmudflap">
220            <primary sortas="c-libmudflap*">libmudflap*</primary>
221          </indexterm>
222        </listitem>
223      </varlistentry>
224
225      <varlistentry id="libstdc">
226        <term><filename class="libraryfile">libstdc++</filename></term>
227        <listitem>
228          <para>The standard C++ library</para>
229          <indexterm zone="ch-system-gcc libstdc">
230            <primary sortas="c-libstdc++">libstdc++</primary>
231          </indexterm>
232        </listitem>
233      </varlistentry>
234
235      <varlistentry id="libsupc">
236        <term><filename class="libraryfile">libsupc++</filename></term>
237        <listitem>
238          <para>Provides supporting routines for the C++ programming
239          language</para>
240          <indexterm zone="ch-system-gcc libsupc">
241            <primary sortas="c-libsupc++">libsupc++</primary>
242          </indexterm>
243        </listitem>
244      </varlistentry>
245
246    </variablelist>
247
248  </sect2>
249
250</sect1>
Note: See TracBrowser for help on using the repository browser.