source: chapter06/gcc.xml@ ca17032

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 ca17032 was ca17032, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Including patches.ent from general.ent

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