source: chapter06/gcc.xml@ 72d7e28

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 72d7e28 was 72d7e28, checked in by Jeremy Huntwork <jhuntwork@…>, 18 years ago

Moved all dependency information to a new page, Appendix C.
Appendix C also contains information concerning the build order.
While there might need to be a few tweaks yet, this information is complete
enough at this point to close out the long-standing ticket #684.
Many thanks to Chris Staub, Dan Nicholson and Manuel Canales Esparcia for
helping get this finished.

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

  • Property mode set to 100644
File size: 8.6 KB
Line 
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 %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 <segmentedlist>
24 <segtitle>&buildtime;</segtitle>
25 <segtitle>&diskspace;</segtitle>
26
27 <seglistitem>
28 <seg>11.7 SBU</seg>
29 <seg>451 MB</seg>
30 </seglistitem>
31 </segmentedlist>
32
33 </sect2>
34
35 <sect2 role="installation">
36 <title>Installation of GCC</title>
37
38 <para>Apply a <command>sed</command> substitution that will suppress the
39 installation of <filename class="libraryfile">libiberty.a</filename>. The
40 version of <filename class="libraryfile">libiberty.a</filename> provided by
41 Binutils will be used instead:</para>
42
43<screen><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
44
45 <para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
46 built GCC with the <option>-fomit-frame-pointer</option> compiler flag.
47 Non-bootstrap builds omit this flag by default, so apply the following
48 <command>sed</command> to use it in order to ensure consistent compiler
49 builds.</para>
50
51<screen><userinput>sed -i 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in</userinput></screen>
52
53 <para>The <command>fixincludes</command> script is known to occasionally
54 erroneously attempt to &quot;fix&quot; the system headers installed so far. As
55 the headers installed by GCC-&gcc-version; and Glibc-&glibc-version; are known
56 to not require fixing, issue the following command to prevent the
57 <command>fixincludes</command> script from running:</para>
58
59<screen><userinput>sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen>
60
61 <para>GCC provides a <command>gccbug</command> script which detects at
62 compile time whether mktemp is present, and hardcodes the result in a test.
63 This will cause the script to fall back to using less random names for
64 temporary files. We will be installing mktemp later, so the following sed
65 will simulate its presence.</para>
66
67<screen><userinput>sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in</userinput></screen>
68
69 <para>The GCC documentation recommends building GCC outside of the source
70 directory in a dedicated build directory:</para>
71
72<screen><userinput>mkdir -v ../gcc-build
73cd ../gcc-build</userinput></screen>
74
75 <para>Prepare GCC for compilation:</para>
76
77<screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
78 --libexecdir=/usr/lib --enable-shared \
79 --enable-threads=posix --enable-__cxa_atexit \
80 --enable-clocale=gnu --enable-languages=c,c++</userinput></screen>
81
82 <para>Compile the package:</para>
83
84<screen><userinput>make</userinput></screen>
85
86 <important>
87 <para>In this section, the test suite for GCC is considered
88 critical. Do not skip it under any circumstance.</para>
89 </important>
90
91 <para>Test the results, but do not stop at errors:</para>
92
93<screen><userinput>make -k check</userinput></screen>
94
95 <para>Some of the errors are known issues and were noted in the
96 previous chapter. The test suite notes from <xref
97 linkend="ch-tools-gcc-pass2" role=","/> are still relevant here. Be sure to
98 refer back to them as necessary.</para>
99
100 <para>Install the package:</para>
101
102<screen><userinput>make install</userinput></screen>
103
104 <para>Some packages expect the C preprocessor to be installed in the
105 <filename class="directory">/lib</filename> directory.
106 To support those packages, create this symlink:</para>
107
108<screen><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
109
110 <para>Many packages use the name <command>cc</command> to call the C
111 compiler. To satisfy those packages, create a symlink:</para>
112
113<screen><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
114
115 <note>
116 <para>At this point, it is strongly recommended to repeat the sanity
117 check performed earlier in this chapter. Refer back to <xref
118 linkend="ch-system-readjusting" role=","/> and repeat the check. If
119 the results are in error, then the most likely reason is that the GCC
120 Specs patch from <xref linkend="chapter-temporary-tools"/> was
121 erroneously applied here.</para>
122 </note>
123
124 </sect2>
125
126 <sect2 id="contents-gcc" role="content">
127 <title>Contents of GCC</title>
128
129 <segmentedlist>
130 <segtitle>Installed programs</segtitle>
131 <segtitle>Installed libraries</segtitle>
132
133 <seglistitem>
134 <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
135 <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.{a,so}, and
136 libsupc++.a</seg>
137 </seglistitem>
138 </segmentedlist>
139
140 <variablelist>
141 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
142 <?dbfo list-presentation="list"?>
143 <?dbhtml list-presentation="table"?>
144
145 <varlistentry id="cc">
146 <term><command>cc</command></term>
147 <listitem>
148 <para>The C compiler</para>
149 <indexterm zone="ch-system-gcc cc">
150 <primary sortas="b-cc">cc</primary>
151 </indexterm>
152 </listitem>
153 </varlistentry>
154
155 <varlistentry id="cpp">
156 <term><command>cpp</command></term>
157 <listitem>
158 <para>The C preprocessor; it is used by the compiler to expand the
159 #include, #define, and similar statements in the source files</para>
160 <indexterm zone="ch-system-gcc cpp">
161 <primary sortas="b-cpp">cpp</primary>
162 </indexterm>
163 </listitem>
164 </varlistentry>
165
166 <varlistentry id="c">
167 <term><command>c++</command></term>
168 <listitem>
169 <para>The C++ compiler</para>
170 <indexterm zone="ch-system-gcc c">
171 <primary sortas="b-c++">c++</primary>
172 </indexterm>
173 </listitem>
174 </varlistentry>
175
176 <varlistentry id="g">
177 <term><command>g++</command></term>
178 <listitem>
179 <para>The C++ compiler</para>
180 <indexterm zone="ch-system-gcc g">
181 <primary sortas="b-g++">g++</primary>
182 </indexterm>
183 </listitem>
184 </varlistentry>
185
186 <varlistentry id="gcc">
187 <term><command>gcc</command></term>
188 <listitem>
189 <para>The C compiler</para>
190 <indexterm zone="ch-system-gcc gcc">
191 <primary sortas="b-gcc">gcc</primary>
192 </indexterm>
193 </listitem>
194 </varlistentry>
195
196 <varlistentry id="gccbug">
197 <term><command>gccbug</command></term>
198 <listitem>
199 <para>A shell script used to help create useful bug reports</para>
200 <indexterm zone="ch-system-gcc gccbug">
201 <primary sortas="b-gccbug">gccbug</primary>
202 </indexterm>
203 </listitem>
204 </varlistentry>
205
206 <varlistentry id="gcov">
207 <term><command>gcov</command></term>
208 <listitem>
209 <para>A coverage testing tool; it is used to analyze programs to
210 determine where optimizations will have the most effect</para>
211 <indexterm zone="ch-system-gcc gcov">
212 <primary sortas="b-gcov">gcov</primary>
213 </indexterm>
214 </listitem>
215 </varlistentry>
216
217 <varlistentry id="libgcc">
218 <term><filename class="libraryfile">libgcc</filename></term>
219 <listitem>
220 <para>Contains run-time support for <command>gcc</command></para>
221 <indexterm zone="ch-system-gcc libgcc">
222 <primary sortas="c-libgcc*">libgcc*</primary>
223 </indexterm>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry id="libstdc">
228 <term><filename class="libraryfile">libstdc++</filename></term>
229 <listitem>
230 <para>The standard C++ library</para>
231 <indexterm zone="ch-system-gcc libstdc">
232 <primary sortas="c-libstdc++">libstdc++</primary>
233 </indexterm>
234 </listitem>
235 </varlistentry>
236
237 <varlistentry id="libsupc">
238 <term><filename class="libraryfile">libsupc++</filename></term>
239 <listitem>
240 <para>Provides supporting routines for the C++ programming
241 language</para>
242 <indexterm zone="ch-system-gcc libsupc">
243 <primary sortas="c-libsupc++">libsupc++</primary>
244 </indexterm>
245 </listitem>
246 </varlistentry>
247
248 </variablelist>
249
250 </sect2>
251
252</sect1>
Note: See TracBrowser for help on using the repository browser.