source: chapter06/gcc.xml@ 2a698a6

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 2a698a6 was 9829329, checked in by Matthew Burgess <matthew@…>, 19 years ago

Remove optimization related warnings from the toolchain packages

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

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