source: chapter06/gcc.xml@ ccc95be

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

Removed linkonce and no_fixinclude patches for gcc4. Also removed the command to remove the pthread.h and sigthread.h files.

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

  • Property mode set to 100644
File size: 6.8 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
[81fd230]34<para>This package is known to have issues when its default
35optimization flags (including the <parameter>-march</parameter> and
36<parameter>-mcpu</parameter> options) are changed. If any environment
37variables that override default optimizations have been defined, such
38as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
39unset them when building GCC.</para>
40
[bc2136e]41<para>Apply a <command>sed</command> substitution that will suppress the
42installation of <filename class="libraryfile">libiberty.a</filename>. The
43version of <filename class="libraryfile">libiberty.a</filename> provided by
[81fd230]44Binutils will be used instead:</para>
[37dcf2a]45
46<screen><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
[73aedd1d]47
[81fd230]48<para>The GCC documentation recommends building GCC outside of the source
49directory in a dedicated build directory:</para>
[73aedd1d]50
51<screen><userinput>mkdir ../gcc-build
52cd ../gcc-build</userinput></screen>
53
[81fd230]54<para>Prepare GCC for compilation:</para>
[73aedd1d]55
[673b0d8]56<screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
[d72e04a]57 --libexecdir=/usr/lib --enable-shared \
58 --enable-threads=posix --enable-__cxa_atexit \
59 --enable-clocale=gnu --enable-languages=c,c++</userinput></screen>
[73aedd1d]60
61<para>Compile the package:</para>
62
63<screen><userinput>make</userinput></screen>
64
[81fd230]65<important><para>In this section, the test suite for GCC is considered
66critical. Do not skip it under any circumstance.</para></important>
67
68<para>Test the results, but do not stop at errors:</para>
[73aedd1d]69
70<screen><userinput>make -k check</userinput></screen>
71
[81fd230]72<para>Some of the errors are known issues and were noted in the
73previous chapter. The test suite notes from <xref
74linkend="ch-tools-gcc-pass2" role=","/> are still relevant here. Be sure to
75refer back to them as necessary.</para>
[73aedd1d]76
[81fd230]77<para>Install the package:</para>
[73aedd1d]78
79<screen><userinput>make install</userinput></screen>
80
[bc2136e]81<para>Some packages expect the C preprocessor to be installed in the
[81fd230]82<filename class="directory">/lib</filename> directory.
83To support those packages, create this symlink:</para>
[73aedd1d]84
85<screen><userinput>ln -s ../usr/bin/cpp /lib</userinput></screen>
86
[81fd230]87<para>Many packages use the name <command>cc</command> to call the C
88compiler. To satisfy those packages, create a symlink:</para>
[73aedd1d]89
90<screen><userinput>ln -s gcc /usr/bin/cc</userinput></screen>
91
[81fd230]92<note><para>At this point, it is strongly recommended to repeat the
93sanity check performed earlier in this chapter. Refer back to <xref
94linkend="ch-system-readjusting" role=","/> and repeat the check. If the results
95are in error, then the most likely reason is that the GCC Specs patch
96from <xref linkend="chapter-temporary-tools"/> was erroneously applied
97here.</para></note>
[73aedd1d]98
99</sect2>
[6370fa6]100
[5888299]101
[c6cb3aa]102<sect2 id="contents-gcc" role="content"><title>Contents of GCC</title>
[673b0d8]103
[81fd230]104<segmentedlist>
105<segtitle>Installed programs</segtitle>
106<segtitle>Installed libraries</segtitle>
107<seglistitem><seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and
108gcov</seg>
109<seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.[a,so], and libsupc++.a</seg></seglistitem>
110</segmentedlist>
111
112<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
113<?dbfo list-presentation="list"?>
[8f97096]114<?dbhtml list-presentation="table"?>
[81fd230]115
116<varlistentry id="cc">
117<term><command>cc</command></term>
118<listitem>
119<para>The C compiler</para>
120<indexterm zone="ch-system-gcc cc"><primary sortas="b-cc">cc</primary></indexterm>
121</listitem>
122</varlistentry>
123
124<varlistentry id="cpp">
125<term><command>cpp</command></term>
126<listitem>
127<para>The C preprocessor; it is used by the compiler to expand the
128#include, #define, and similar statements in the source files</para>
129<indexterm zone="ch-system-gcc cpp"><primary sortas="b-cpp">cpp</primary></indexterm>
130</listitem>
131</varlistentry>
132
133<varlistentry id="c">
134<term><command>c++</command></term>
135<listitem>
136<para>The C++ compiler</para>
137<indexterm zone="ch-system-gcc c"><primary sortas="b-c++">c++</primary></indexterm>
138</listitem>
139</varlistentry>
140
141<varlistentry id="g">
142<term><command>g++</command></term>
143<listitem>
144<para>The C++ compiler</para>
145<indexterm zone="ch-system-gcc g"><primary sortas="b-g++">g++</primary></indexterm>
146</listitem>
147</varlistentry>
148
149<varlistentry id="gcc">
150<term><command>gcc</command></term>
151<listitem>
152<para>The C compiler</para>
153<indexterm zone="ch-system-gcc gcc"><primary sortas="b-gcc">gcc</primary></indexterm>
154</listitem>
155</varlistentry>
156
157<varlistentry id="gccbug">
158<term><command>gccbug</command></term>
159<listitem>
160<para>A shell script used to help create useful bug reports</para>
161<indexterm zone="ch-system-gcc gccbug"><primary sortas="b-gccbug">gccbug</primary></indexterm>
162</listitem>
163</varlistentry>
164
165<varlistentry id="gcov">
166<term><command>gcov</command></term>
167<listitem>
168<para>A coverage testing tool; it is used to analyze programs to
169determine where optimizations will have the most effect</para>
170<indexterm zone="ch-system-gcc gcov"><primary sortas="b-gcov">gcov</primary></indexterm>
171</listitem>
172</varlistentry>
173
174<varlistentry id="libgcc">
175<term><filename class="libraryfile">libgcc</filename></term>
176<listitem>
177<para>Contains run-time support for <command>gcc</command></para>
178<indexterm zone="ch-system-gcc libgcc"><primary sortas="c-libgcc*">libgcc*</primary></indexterm>
179</listitem>
180</varlistentry>
181
182<varlistentry id="libstdc">
183<term><filename class="libraryfile">libstdc++</filename></term>
184<listitem>
185<para>The standard C++ library</para>
186<indexterm zone="ch-system-gcc libstdc"><primary sortas="c-libstdc++">libstdc++</primary></indexterm>
187</listitem>
188</varlistentry>
189
190<varlistentry id="libsupc">
191<term><filename class="libraryfile">libsupc++</filename></term>
192<listitem>
193<para>Provides supporting routines for the C++ programming language</para>
194<indexterm zone="ch-system-gcc libsupc"><primary sortas="c-libsupc++">libsupc++</primary></indexterm>
195</listitem>
196</varlistentry>
197</variablelist>
[673b0d8]198
199</sect2>
200
201</sect1>
[81fd230]202
Note: See TracBrowser for help on using the repository browser.