source: chapter06/gcc.xml@ e1ca33a

Last change on this file since e1ca33a was 1a89152, checked in by Jeremy Huntwork <jhuntwork@…>, 19 years ago

Update dependency information. Thanks Chris Staub.

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

  • Property mode set to 100644
File size: 7.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-gcc" role="wrap">
7<title>GCC-&gcc-version;</title>
8<?dbhtml filename="gcc.html"?>
9
10<indexterm zone="ch-system-gcc"><primary sortas="a-GCC">GCC</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The GCC package contains the GNU compiler collection, which includes
14the C and C++ compilers.</para>
15
16<segmentedlist>
17<segtitle>&buildtime;</segtitle>
18<segtitle>&diskspace;</segtitle>
19<seglistitem><seg>11.7 SBU</seg><seg>451 MB</seg></seglistitem>
20</segmentedlist>
21
22<segmentedlist>
23<segtitle>&dependencies;</segtitle>
24<seglistitem><seg>Bash, Binutils, Coreutils, DejaGNU, Diffutils, Findutils,
25Expect, Gawk, Gettext, Glibc, Grep, Make, Patch, Perl, Sed, Tcl, and
26Texinfo</seg></seglistitem>
27</segmentedlist>
28</sect2>
29
30<sect2 role="installation">
31<title>Installation of GCC</title>
32
33<para>Apply a <command>sed</command> substitution that will suppress the
34installation of <filename class="libraryfile">libiberty.a</filename>. The
35version of <filename class="libraryfile">libiberty.a</filename> provided by
36Binutils will be used instead:</para>
37
38<screen><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
39
40<para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
41built GCC with the <option>-fomit-frame-pointer</option> compiler flag.
42Non-bootstrap builds omit this flag by default, so apply the following
43<command>sed</command> to use it in order to ensure consistent compiler builds.
44</para>
45
46<screen><userinput>sed -i 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in</userinput></screen>
47
48<para>The <command>fixincludes</command> script is known to occasionally
49erroneously attempt to &quot;fix&quot; the system headers installed so far. As
50the headers installed by GCC-&gcc-version; and Glibc-&glibc-version; are known
51to not require fixing, issue the following command to prevent the
52<command>fixincludes</command> script from running:</para>
53
54<screen><userinput>sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen>
55
56<para>The GCC documentation recommends building GCC outside of the source
57directory in a dedicated build directory:</para>
58
59<screen><userinput>mkdir -v ../gcc-build
60cd ../gcc-build</userinput></screen>
61
62<para>Prepare GCC for compilation:</para>
63
64<screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
65 --libexecdir=/usr/lib --enable-shared \
66 --enable-threads=posix --enable-__cxa_atexit \
67 --enable-clocale=gnu --enable-languages=c,c++</userinput></screen>
68
69<para>Compile the package:</para>
70
71<screen><userinput>make</userinput></screen>
72
73<important><para>In this section, the test suite for GCC is considered
74critical. Do not skip it under any circumstance.</para></important>
75
76<para>Test the results, but do not stop at errors:</para>
77
78<screen><userinput>make -k check</userinput></screen>
79
80<para>Some of the errors are known issues and were noted in the
81previous chapter. The test suite notes from <xref
82linkend="ch-tools-gcc-pass2" role=","/> are still relevant here. Be sure to
83refer back to them as necessary.</para>
84
85<para>Install the package:</para>
86
87<screen><userinput>make install</userinput></screen>
88
89<para>Some packages expect the C preprocessor to be installed in the
90<filename class="directory">/lib</filename> directory.
91To support those packages, create this symlink:</para>
92
93<screen><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
94
95<para>Many packages use the name <command>cc</command> to call the C
96compiler. To satisfy those packages, create a symlink:</para>
97
98<screen><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
99
100<note><para>At this point, it is strongly recommended to repeat the
101sanity check performed earlier in this chapter. Refer back to <xref
102linkend="ch-system-readjusting" role=","/> and repeat the check. If the results
103are in error, then the most likely reason is that the GCC Specs patch
104from <xref linkend="chapter-temporary-tools"/> was erroneously applied
105here.</para></note>
106
107</sect2>
108
109
110<sect2 id="contents-gcc" role="content"><title>Contents of GCC</title>
111
112<segmentedlist>
113<segtitle>Installed programs</segtitle>
114<segtitle>Installed libraries</segtitle>
115<seglistitem><seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and
116gcov</seg>
117<seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.[a,so], and libsupc++.a</seg></seglistitem>
118</segmentedlist>
119
120<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
121<?dbfo list-presentation="list"?>
122<?dbhtml list-presentation="table"?>
123
124<varlistentry id="cc">
125<term><command>cc</command></term>
126<listitem>
127<para>The C compiler</para>
128<indexterm zone="ch-system-gcc cc"><primary sortas="b-cc">cc</primary></indexterm>
129</listitem>
130</varlistentry>
131
132<varlistentry id="cpp">
133<term><command>cpp</command></term>
134<listitem>
135<para>The C preprocessor; it is used by the compiler to expand the
136#include, #define, and similar statements in the source files</para>
137<indexterm zone="ch-system-gcc cpp"><primary sortas="b-cpp">cpp</primary></indexterm>
138</listitem>
139</varlistentry>
140
141<varlistentry id="c">
142<term><command>c++</command></term>
143<listitem>
144<para>The C++ compiler</para>
145<indexterm zone="ch-system-gcc c"><primary sortas="b-c++">c++</primary></indexterm>
146</listitem>
147</varlistentry>
148
149<varlistentry id="g">
150<term><command>g++</command></term>
151<listitem>
152<para>The C++ compiler</para>
153<indexterm zone="ch-system-gcc g"><primary sortas="b-g++">g++</primary></indexterm>
154</listitem>
155</varlistentry>
156
157<varlistentry id="gcc">
158<term><command>gcc</command></term>
159<listitem>
160<para>The C compiler</para>
161<indexterm zone="ch-system-gcc gcc"><primary sortas="b-gcc">gcc</primary></indexterm>
162</listitem>
163</varlistentry>
164
165<varlistentry id="gccbug">
166<term><command>gccbug</command></term>
167<listitem>
168<para>A shell script used to help create useful bug reports</para>
169<indexterm zone="ch-system-gcc gccbug"><primary sortas="b-gccbug">gccbug</primary></indexterm>
170</listitem>
171</varlistentry>
172
173<varlistentry id="gcov">
174<term><command>gcov</command></term>
175<listitem>
176<para>A coverage testing tool; it is used to analyze programs to
177determine where optimizations will have the most effect</para>
178<indexterm zone="ch-system-gcc gcov"><primary sortas="b-gcov">gcov</primary></indexterm>
179</listitem>
180</varlistentry>
181
182<varlistentry id="libgcc">
183<term><filename class="libraryfile">libgcc</filename></term>
184<listitem>
185<para>Contains run-time support for <command>gcc</command></para>
186<indexterm zone="ch-system-gcc libgcc"><primary sortas="c-libgcc*">libgcc*</primary></indexterm>
187</listitem>
188</varlistentry>
189
190<varlistentry id="libstdc">
191<term><filename class="libraryfile">libstdc++</filename></term>
192<listitem>
193<para>The standard C++ library</para>
194<indexterm zone="ch-system-gcc libstdc"><primary sortas="c-libstdc++">libstdc++</primary></indexterm>
195</listitem>
196</varlistentry>
197
198<varlistentry id="libsupc">
199<term><filename class="libraryfile">libsupc++</filename></term>
200<listitem>
201<para>Provides supporting routines for the C++ programming language</para>
202<indexterm zone="ch-system-gcc libsupc"><primary sortas="c-libsupc++">libsupc++</primary></indexterm>
203</listitem>
204</varlistentry>
205</variablelist>
206
207</sect2>
208
209</sect1>
210
Note: See TracBrowser for help on using the repository browser.