source: clfs-sysroot/BOOK/final-system/common/gcc.xml @ 02095ae

Last change on this file since 02095ae was 02095ae, checked in by Jim Gifford <clfs@…>, 18 years ago

r3633@server (orig r1649): jciccone | 2006-05-25 16:48:42 -0700
Added the Initial clfs-2.0 branch using sysroot builds.

  • Property mode set to 100644
File size: 7.7 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  </sect2>
24
25  <sect2 role="installation">
26    <title>Installation of GCC</title>
27
28    <para os="p1">The following patch fixes an issue where gcc doesn't generate
29    some code properly:</para>
30
31<screen os="p2"><userinput>patch -Np1 -i ../&gcc-PR26763-patch;</userinput></screen>
32
33    <para os="p3">The following patch fixes the searching of multilib dirs for
34    specs file:</para>
35
36<screen os="p4"><userinput>patch -Np1 -i ../&gcc-PR20425-patch;</userinput></screen>
37
38    <para os="a">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 os="b"><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen>
44
45    <para os="e1">GCC provides a <command>gccbug</command> script which detects at
46    compile time whether mktemp is present, and hardcodes the result in a test.
47    If mktemp is not found, the script will fall back to using less
48    random names for temporary files.  We will be installing mktemp
49    later, so the following sed will simulate its presence:</para>
50
51<screen os="e2"><userinput>sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in</userinput></screen>
52
53    <para os="c">The GCC documentation recommends building GCC outside of the source
54    directory in a dedicated build directory:</para>
55
56<screen os="d"><userinput>mkdir -v ../gcc-build
57cd ../gcc-build</userinput></screen>
58
59    <para os="e">Prepare GCC for compilation:</para>
60
61<screen os="f"><userinput>../gcc-4.1.0/configure --prefix=/usr --libexecdir=/usr/lib \
62    --build=${LFS_HOST} --host=${LFS_TARGET} --target=${LFS_TARGET} \
63    --enable-shared --enable-threads=posix --enable-__cxa_atexit \
64    --enable-c99 --enable-long-long --enable-clocale=gnu \
65    --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen>
66
67    <para os="g">Compile the package:</para>
68
69<screen os="h"><userinput>make</userinput></screen>
70
71    <para os="i">Install the package:</para>
72
73<screen os="j"><userinput>make DESTDIR=${LFS} install</userinput></screen>
74
75    <para os="k">Some packages expect the C preprocessor to be installed in the
76    <filename class="directory">/lib</filename> directory.
77    To support those packages, create this symlink:</para>
78
79<screen os="l"><userinput>ln -sv ../usr/bin/cpp ${LFS}/lib</userinput></screen>
80
81    <para os="m">Many packages use the name <command>cc</command> to call the C
82    compiler. To satisfy those packages, create a symlink:</para>
83
84<screen os="o"><userinput>ln -sv gcc ${LFS}/usr/bin/cc</userinput></screen>
85
86  </sect2>
87
88  <sect2 id="contents-gcc" role="content">
89    <title>Contents of GCC</title>
90
91    <segmentedlist>
92      <segtitle>Installed programs</segtitle>
93      <segtitle>Installed libraries</segtitle>
94
95      <seglistitem>
96        <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
97        <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libmudflap.[a,so],
98        libmudflapth.[a,so], libstdc++.[a,so], and
99        libsupc++.a</seg>
100      </seglistitem>
101    </segmentedlist>
102
103    <variablelist>
104      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
105      <?dbfo list-presentation="list"?>
106      <?dbhtml list-presentation="table"?>
107
108      <varlistentry id="cc">
109        <term><command>cc</command></term>
110        <listitem>
111          <para>The C compiler</para>
112          <indexterm zone="ch-system-gcc cc">
113            <primary sortas="b-cc">cc</primary>
114          </indexterm>
115        </listitem>
116      </varlistentry>
117
118      <varlistentry id="cpp">
119        <term><command>cpp</command></term>
120        <listitem>
121          <para>The C preprocessor; it is used by the compiler to expand the
122          #include, #define, and similar statements in the source files</para>
123          <indexterm zone="ch-system-gcc cpp">
124            <primary sortas="b-cpp">cpp</primary>
125          </indexterm>
126        </listitem>
127      </varlistentry>
128
129      <varlistentry id="c">
130        <term><command>c++</command></term>
131        <listitem>
132          <para>The C++ compiler</para>
133          <indexterm zone="ch-system-gcc c">
134            <primary sortas="b-c++">c++</primary>
135          </indexterm>
136        </listitem>
137      </varlistentry>
138
139      <varlistentry id="g">
140        <term><command>g++</command></term>
141        <listitem>
142          <para>The C++ compiler</para>
143          <indexterm zone="ch-system-gcc g">
144            <primary sortas="b-g++">g++</primary>
145          </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">
154            <primary sortas="b-gcc">gcc</primary>
155          </indexterm>
156        </listitem>
157      </varlistentry>
158
159      <varlistentry id="gccbug">
160        <term><command>gccbug</command></term>
161        <listitem>
162          <para>A shell script used to help create useful bug reports</para>
163          <indexterm zone="ch-system-gcc gccbug">
164            <primary sortas="b-gccbug">gccbug</primary>
165          </indexterm>
166        </listitem>
167      </varlistentry>
168
169      <varlistentry id="gcov">
170        <term><command>gcov</command></term>
171        <listitem>
172          <para>A coverage testing tool; it is used to analyze programs to
173          determine where optimizations will have the most effect</para>
174          <indexterm zone="ch-system-gcc gcov">
175            <primary sortas="b-gcov">gcov</primary>
176          </indexterm>
177        </listitem>
178      </varlistentry>
179
180      <varlistentry id="libgcc">
181        <term><filename class="libraryfile">libgcc</filename></term>
182        <listitem>
183          <para>Contains run-time support for <command>gcc</command></para>
184          <indexterm zone="ch-system-gcc libgcc">
185            <primary sortas="c-libgcc*">libgcc*</primary>
186          </indexterm>
187        </listitem>
188      </varlistentry>
189
190      <varlistentry id="libmudflap">
191        <term><filename class="libraryfile">libmudflap</filename></term>
192        <listitem>
193          <para>The libmudflap libraries are used by GCC for instrumenting
194          pointer and array dereferencing operations.</para>
195          <indexterm zone="ch-system-gcc libmudflap">
196            <primary sortas="c-libmudflap*">libmudflap*</primary>
197          </indexterm>
198        </listitem>
199      </varlistentry>
200
201      <varlistentry id="libstdc">
202        <term><filename class="libraryfile">libstdc++</filename></term>
203        <listitem>
204          <para>The standard C++ library</para>
205          <indexterm zone="ch-system-gcc libstdc">
206            <primary sortas="c-libstdc++">libstdc++</primary>
207          </indexterm>
208        </listitem>
209      </varlistentry>
210
211      <varlistentry id="libsupc">
212        <term><filename class="libraryfile">libsupc++</filename></term>
213        <listitem>
214          <para>Provides supporting routines for the C++ programming
215          language</para>
216          <indexterm zone="ch-system-gcc libsupc">
217            <primary sortas="c-libsupc++">libsupc++</primary>
218          </indexterm>
219        </listitem>
220      </varlistentry>
221
222    </variablelist>
223
224  </sect2>
225
226</sect1>
Note: See TracBrowser for help on using the repository browser.