source: clfs-sysroot/BOOK/final-system/common/gcc.xml@ 442d78f

Last change on this file since 442d78f was 625455a, checked in by Joe Ciccone <jciccone@…>, 15 years ago

Fix compilation errors in the final system GCC.

  • Property mode set to 100644
File size: 8.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/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 &env-target;
26
27 <sect2 role="installation">
28 <title>Installation of GCC</title>
29
30 <para os="p1">To make sure that a couple of tools use the proper syntax,
31 apply the following patch:</para>
32
33<screen os="p2"><userinput>patch -Np1 -i ../&gcc-posix-patch;</userinput></screen>
34
35 <para os="p3">The following patch contains a number of updates to the
36 &gcc-version; branch by the GCC developers:</para>
37
38<screen os="p4"><userinput>patch -Np1 -i ../&gcc-branch_update-patch;</userinput></screen>
39
40 <para os="a">Apply a <command>sed</command> substitution that will suppress the
41 installation of <filename class="libraryfile">libiberty.a</filename>. The
42 version of <filename class="libraryfile">libiberty.a</filename> provided by
43 Binutils will be used instead:</para>
44
45<screen os="b"><userinput>cp libiberty/Makefile.in{,.orig}
46sed 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in.orig &gt; \
47 libiberty/Makefile.in</userinput></screen>
48
49 <para os="e1">GCC provides a <command>gccbug</command> script which detects at
50 compile time whether <command>mktemp</command> is present, and hardcodes
51 the result in a test. If <command>mktemp</command> is not found, the
52 script will fall back to using less random names for temporary files.
53 <command>mktemp</command> will be installed as part of Coreutils
54 later, so the following <command>sed</command> will simulate its presence:</para>
55
56<screen os="e2"><userinput>cp gcc/gccbug.in{,.orig}
57sed 's/@have_mktemp_command@/yes/' gcc/gccbug.in.orig &gt; gcc/gccbug.in</userinput></screen>
58
59 <para os="s1">The <command>fixincludes</command> script attempts to "fix"
60 the system headers installed so far. Since GCC is cross-compiled expecting
61 the system headers to be in <filename class="directory">/usr/include</filename>,
62 the script will be looking at the host system's headers. The following sed
63 prevents <command>fixincludes</command> from running:</para>
64
65<screen os="s2"><userinput>cp gcc/Makefile.in{,.orig}
66sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
67
68 <para os="c">The GCC documentation recommends building GCC outside of the source
69 directory in a dedicated build directory:</para>
70
71<screen os="d"><userinput>mkdir -v ../gcc-build
72cd ../gcc-build</userinput></screen>
73
74 <para os="e">Prepare GCC for compilation:</para>
75
76<screen os="f"><userinput>LDFLAGS="-Wl,-rpath-link,${CLFS}/cross-tools/${CLFS_TARGET}/lib" \
77 ../gcc-&gcc-version;/configure --prefix=/usr --libexecdir=/usr/lib \
78 --build=${CLFS_HOST} --host=${CLFS_TARGET} --target=${CLFS_TARGET} \
79 --enable-shared --enable-threads=posix --enable-__cxa_atexit \
80 --enable-c99 --enable-long-long --enable-clocale=gnu \
81 --enable-languages=c,c++ --disable-libstdcxx-pch</userinput></screen>
82
83 <para os="ts1">The following will prevent GCC from looking in the wrong
84 directories for headers and libraries:</para>
85
86<screen os="ts2"><userinput>cp Makefile{,.orig}
87sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" \
88 Makefile.orig &gt; Makefile</userinput></screen>
89
90 <para os="g">Compile the package:</para>
91
92<screen os="h"><userinput>make</userinput></screen>
93
94 <para os="i">Install the package:</para>
95
96<screen os="j"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
97
98 <para os="k">Some packages expect the C preprocessor to be installed in the
99 <filename class="directory">/lib</filename> directory.
100 To support those packages, create this symlink:</para>
101
102<screen os="l"><userinput>ln -sfv ../usr/bin/cpp ${CLFS}/lib</userinput></screen>
103
104 <para os="m">Many packages use the name <command>cc</command> to call the C
105 compiler. To satisfy those packages, create a symlink:</para>
106
107<screen os="o"><userinput>ln -sfv gcc ${CLFS}/usr/bin/cc</userinput></screen>
108
109 </sect2>
110
111 <sect2 id="contents-gcc" role="content">
112 <title>Contents of GCC</title>
113
114 <segmentedlist>
115 <segtitle>Installed programs</segtitle>
116 <segtitle>Installed libraries</segtitle>
117
118 <seglistitem>
119 <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg>
120 <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libgomp.[a,so], libmudflap.[a,so],
121 libmudflapth.[a,so], libssp.[a,so], libstdc++.[a,so], and
122 libsupc++.a</seg>
123 </seglistitem>
124 </segmentedlist>
125
126 <variablelist>
127 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
128 <?dbfo list-presentation="list"?>
129 <?dbhtml list-presentation="table"?>
130
131 <varlistentry id="cc">
132 <term><command>cc</command></term>
133 <listitem>
134 <para>The C compiler</para>
135 <indexterm zone="ch-system-gcc cc">
136 <primary sortas="b-cc">cc</primary>
137 </indexterm>
138 </listitem>
139 </varlistentry>
140
141 <varlistentry id="cpp">
142 <term><command>cpp</command></term>
143 <listitem>
144 <para>The C preprocessor; it is used by the compiler to expand the
145 #include, #define, and similar statements in the source files</para>
146 <indexterm zone="ch-system-gcc cpp">
147 <primary sortas="b-cpp">cpp</primary>
148 </indexterm>
149 </listitem>
150 </varlistentry>
151
152 <varlistentry id="c">
153 <term><command>c++</command></term>
154 <listitem>
155 <para>The C++ compiler</para>
156 <indexterm zone="ch-system-gcc c">
157 <primary sortas="b-c++">c++</primary>
158 </indexterm>
159 </listitem>
160 </varlistentry>
161
162 <varlistentry id="g">
163 <term><command>g++</command></term>
164 <listitem>
165 <para>The C++ compiler</para>
166 <indexterm zone="ch-system-gcc g">
167 <primary sortas="b-g++">g++</primary>
168 </indexterm>
169 </listitem>
170 </varlistentry>
171
172 <varlistentry id="gcc">
173 <term><command>gcc</command></term>
174 <listitem>
175 <para>The C compiler</para>
176 <indexterm zone="ch-system-gcc gcc">
177 <primary sortas="b-gcc">gcc</primary>
178 </indexterm>
179 </listitem>
180 </varlistentry>
181
182 <varlistentry id="gccbug">
183 <term><command>gccbug</command></term>
184 <listitem>
185 <para>A shell script used to help create useful bug reports</para>
186 <indexterm zone="ch-system-gcc gccbug">
187 <primary sortas="b-gccbug">gccbug</primary>
188 </indexterm>
189 </listitem>
190 </varlistentry>
191
192 <varlistentry id="gcov">
193 <term><command>gcov</command></term>
194 <listitem>
195 <para>A coverage testing tool; it is used to analyze programs to
196 determine where optimizations will have the most effect</para>
197 <indexterm zone="ch-system-gcc gcov">
198 <primary sortas="b-gcov">gcov</primary>
199 </indexterm>
200 </listitem>
201 </varlistentry>
202
203 <varlistentry id="libgcc">
204 <term><filename class="libraryfile">libgcc</filename></term>
205 <listitem>
206 <para>Contains run-time support for <command>gcc</command></para>
207 <indexterm zone="ch-system-gcc libgcc">
208 <primary sortas="c-libgcc*">libgcc*</primary>
209 </indexterm>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry id="libmudflap">
214 <term><filename class="libraryfile">libmudflap</filename></term>
215 <listitem>
216 <para>The libmudflap libraries are used by GCC for instrumenting
217 pointer and array dereferencing operations.</para>
218 <indexterm zone="ch-system-gcc libmudflap">
219 <primary sortas="c-libmudflap*">libmudflap*</primary>
220 </indexterm>
221 </listitem>
222 </varlistentry>
223
224 <varlistentry id="libstdc">
225 <term><filename class="libraryfile">libstdc++</filename></term>
226 <listitem>
227 <para>The standard C++ library</para>
228 <indexterm zone="ch-system-gcc libstdc">
229 <primary sortas="c-libstdc++">libstdc++</primary>
230 </indexterm>
231 </listitem>
232 </varlistentry>
233
234 <varlistentry id="libsupc">
235 <term><filename class="libraryfile">libsupc++</filename></term>
236 <listitem>
237 <para>Provides supporting routines for the C++ programming
238 language</para>
239 <indexterm zone="ch-system-gcc libsupc">
240 <primary sortas="c-libsupc++">libsupc++</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 </variablelist>
246
247 </sect2>
248
249</sect1>
Note: See TracBrowser for help on using the repository browser.