source: final-system/common/gcc.xml@ 91b682b

Last change on this file since 91b682b was bf8c11f, checked in by Jim Gifford <clfs@…>, 19 years ago

r627@server (orig r625): jim | 2005-10-31 12:59:34 -0800
Import of Cross-LFS Book

  • Property mode set to 100644
File size: 8.4 KB
RevLine 
[bf8c11f]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 <!ENTITY % patches-entities SYSTEM "../../patches.ent">
6 %general-entities;
7 %patches-entities;
8]>
9
10<sect1 id="ch-system-gcc" role="wrap">
11 <?dbhtml filename="gcc.html"?>
12
13 <title>GCC-&gcc-version;</title>
14
15 <indexterm zone="ch-system-gcc">
16 <primary sortas="a-GCC">GCC</primary>
17 </indexterm>
18
19 <sect2 role="package">
20 <title/>
21
22 <para>The GCC package contains the GNU compiler collection, which includes
23 the C and C++ compilers.</para>
24
25 <segmentedlist>
26 <segtitle>&buildtime;</segtitle>
27 <segtitle>&diskspace;</segtitle>
28
29 <seglistitem>
30 <seg>Not checked yet</seg>
31 <seg>Not checked yet</seg>
32 </seglistitem>
33 </segmentedlist>
34
35 <segmentedlist>
36 <segtitle>&dependencies;</segtitle>
37
38 <seglistitem>
39 <seg>Bash, Binutils, Coreutils, Diffutils, Findutils,
40 Gawk, Gettext, Glibc, Grep, Make, Perl, Sed, and Texinfo</seg>
41 </seglistitem>
42 </segmentedlist>
43
44 </sect2>
45
46 <sect2 role="installation">
47 <title>Installation of GCC</title>
48
49 <para os="a">This package is known to have issues when its default
50 optimization flags (including the <option>-march</option> and
51 <option>-mcpu</option> options) are changed. If any environment
52 variables that override default optimizations have been defined, such
53 as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
54 unset them when building GCC.</para>
55
56 <para os="d">Apply a <command>sed</command> substitution that will suppress the
57 installation of <filename class="libraryfile">libiberty.a</filename>. The
58 version of <filename class="libraryfile">libiberty.a</filename> provided by
59 Binutils will be used instead:</para>
60
61<screen os="e"><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
62
63 <para os="f">The GCC documentation recommends building GCC outside of the source
64 directory in a dedicated build directory:</para>
65
66<screen os="g"><userinput>mkdir ../gcc-build
67cd ../gcc-build</userinput></screen>
68
69 <para os="h">Prepare GCC for compilation:</para>
70
71<screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
72 --libexecdir=/usr/lib --enable-shared --enable-threads=posix \
73 --enable-__cxa_atexit --enable-c99 --enable-long-long \
74 --enable-clocale=gnu --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen>
75
76 <para os="i">Compile the package:</para>
77
78<screen os="j"><userinput>make</userinput></screen>
79
80 <important os="k">
81 <para>In this section, the test suite for GCC is considered
82 critical. Do not skip it under any circumstance.</para>
83 </important>
84
85 <para os="l">Test the results, but do not stop at errors:</para>
86
87<screen os="m"><userinput>make -k check</userinput></screen>
88
89 <para os="n">The <parameter>-k</parameter> flag is used to make the test suite
90 run through to completion and not stop at the first failure. The GCC test
91 suite is very comprehensive and is almost guaranteed to generate a few
92 failures. To receive a summary of the test suite results, run:</para>
93
94<screen os="o"><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
95
96 <para os="p">For only the summaries, pipe the output through
97 <userinput>grep -A7 Summ</userinput>.</para>
98
99 <para os="q">Results can be compared with those located at <ulink
100 url="&test-results;"/>.</para>
101
102 <para os="r">A few unexpected failures cannot always be avoided. The
103 GCC developers are usually aware of these issues, but have not
104 resolved them yet. Unless the test results are vastly different from
105 those at the above URL, it is safe to continue.</para>
106
107 <para os="s">Install the package:</para>
108
109<screen os="t"><userinput>make install</userinput></screen>
110
111 <para os="u">Some packages expect the C preprocessor to be installed in the
112 <filename class="directory">/lib</filename> directory.
113 To support those packages, create this symlink:</para>
114
115<screen os="v"><userinput>ln -s ../usr/bin/cpp /lib</userinput></screen>
116
117 <para os="w">Many packages use the name <command>cc</command> to call the C
118 compiler. To satisfy those packages, create a symlink:</para>
119
120<screen os="x"><userinput>ln -s gcc /usr/bin/cc</userinput></screen>
121
122 </sect2>
123
124 <sect2 id="contents-gcc" role="content">
125 <title>Contents of GCC</title>
126
127 <segmentedlist>
128 <segtitle>Installed programs</segtitle>
129 <segtitle>Installed libraries</segtitle>
130
131 <seglistitem>
132 <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
133 <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.[a,so], and
134 libsupc++.a</seg>
135 </seglistitem>
136 </segmentedlist>
137
138 <variablelist>
139 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
140 <?dbfo list-presentation="list"?>
141 <?dbhtml list-presentation="table"?>
142
143 <varlistentry id="cc">
144 <term><command>cc</command></term>
145 <listitem>
146 <para>The C compiler</para>
147 <indexterm zone="ch-system-gcc cc">
148 <primary sortas="b-cc">cc</primary>
149 </indexterm>
150 </listitem>
151 </varlistentry>
152
153 <varlistentry id="cpp">
154 <term><command>cpp</command></term>
155 <listitem>
156 <para>The C preprocessor; it is used by the compiler to expand the
157 #include, #define, and similar statements in the source files</para>
158 <indexterm zone="ch-system-gcc cpp">
159 <primary sortas="b-cpp">cpp</primary>
160 </indexterm>
161 </listitem>
162 </varlistentry>
163
164 <varlistentry id="c">
165 <term><command>c++</command></term>
166 <listitem>
167 <para>The C++ compiler</para>
168 <indexterm zone="ch-system-gcc c">
169 <primary sortas="b-c++">c++</primary>
170 </indexterm>
171 </listitem>
172 </varlistentry>
173
174 <varlistentry id="g">
175 <term><command>g++</command></term>
176 <listitem>
177 <para>The C++ compiler</para>
178 <indexterm zone="ch-system-gcc g">
179 <primary sortas="b-g++">g++</primary>
180 </indexterm>
181 </listitem>
182 </varlistentry>
183
184 <varlistentry id="gcc">
185 <term><command>gcc</command></term>
186 <listitem>
187 <para>The C compiler</para>
188 <indexterm zone="ch-system-gcc gcc">
189 <primary sortas="b-gcc">gcc</primary>
190 </indexterm>
191 </listitem>
192 </varlistentry>
193
194 <varlistentry id="gccbug">
195 <term><command>gccbug</command></term>
196 <listitem>
197 <para>A shell script used to help create useful bug reports</para>
198 <indexterm zone="ch-system-gcc gccbug">
199 <primary sortas="b-gccbug">gccbug</primary>
200 </indexterm>
201 </listitem>
202 </varlistentry>
203
204 <varlistentry id="gcov">
205 <term><command>gcov</command></term>
206 <listitem>
207 <para>A coverage testing tool; it is used to analyze programs to
208 determine where optimizations will have the most effect</para>
209 <indexterm zone="ch-system-gcc gcov">
210 <primary sortas="b-gcov">gcov</primary>
211 </indexterm>
212 </listitem>
213 </varlistentry>
214
215 <varlistentry id="libgcc">
216 <term><filename class="libraryfile">libgcc</filename></term>
217 <listitem>
218 <para>Contains run-time support for <command>gcc</command></para>
219 <indexterm zone="ch-system-gcc libgcc">
220 <primary sortas="c-libgcc*">libgcc*</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.