source: general/prog/gcc.xml@ a7e1ac8

systemd-13485
Last change on this file since a7e1ac8 was 7ff0948, checked in by Douglas R. Reno <renodr@…>, 9 years ago

Update to boost-1.59.0
Update to ruby-2.2.3
Update to OpenSSH-7.0p1
Update to libreoffice-5.0.0
Update to unbound-1.5.4
Update to BIND and BIND-Utilities-9.10.2p3
Update to sendmail-8.15.2
Update to exim-4.86
Update to apache-2.4.16
Update to vsftpd-3.0.3
Update to mariadb-10.0.21
Update to postfix-3.0.2
Update to OpenLDAP-2.4.42
Update to stunnel-5.22
Update to GCC-5.2.0 (including the ADA and Java compilers)
Update to php-5.6.12

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@16351 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 14.2 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 <!ENTITY gcc-download-http "http://ftpmirror.gnu.org/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
8 <!ENTITY gcc-download-ftp "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
9 <!ENTITY gcc-md5sum "a51bcfeb3da7dd4c623e27207ed43467">
10 <!ENTITY gcc-size "91 MB">
11 <!ENTITY gcc-buildsize "5.9 GB">
12 <!ENTITY gcc-time "132 SBU (including 82 SBU for tests)">
13]>
14
15<sect1 id="gcc" xreflabel="GCC-&gcc-version;">
16 <?dbhtml filename="gcc.html" ?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>GCC-&gcc-version;</title>
24
25 <indexterm zone="gcc">
26 <primary sortas="a-gcc-5-0">GCC-&gcc-version;</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to GCC</title>
31
32 <para>
33 The <application>GCC</application> package contains the GNU Compiler
34 Collection. This page describes the installation of compilers for the
35 following languages: C, C++, Fortran, Objective C, Objective C++, and Go.
36 Two additional languages , Ada and Java are available in the collection.
37 They have specific requirements, so they are described in separate pages
38 (<xref linkend="gcc-ada"/> and <xref linkend="gcc-java"/>). Since C and
39 C++ are installed in LFS, this page is either for upgrading C and C++,
40 or for installing additional compilers.
41 </para>
42
43 &lfs77_checked;
44
45 <caution>
46 <para>
47 If you are upgrading <application>GCC</application> from any other
48 version prior to &gcc-version;, then you must be careful compiling 3rd
49 party kernel modules. You should ensure that the kernel and all its
50 native modules are also compiled using the same version of
51 <application>GCC</application> that you use to build the 3rd party module.
52 This issue does not affect native kernel (and kernel modules) updates,
53 as the instructions below are a complete reinstallation of
54 <application>GCC</application>. If you have existing 3rd party modules
55 installed, ensure they are recompiled using the updated version of
56 <application>GCC</application>. As always, never update the kernel
57 headers from the ones used when <application>Glibc</application> was
58 compiled during LFS.
59 </para>
60
61 <para>
62 The 5.1.0 version of GCC introduces an incompatible ABI change in the
63 C++ library <filename>libstdc++.so</filename>. This does not prevent
64 using programs compiled with the previous version of <application>GCC
65 </application>, since both old and new symbols are available in the
66 library. But compiling, with the new version, programs which use libraries
67 compiled with the old version is likely to give errors. So, if you are
68 upgrading from any previous version prior to 5.1.0, you have two solutions:
69 recompile all the libraries with the new version, or use the <option>
70 --with-default-libstdcxx-abi</option> switch to configure.
71 </para>
72 </caution>
73
74 <bridgehead renderas="sect3">Package Information</bridgehead>
75 <itemizedlist spacing="compact">
76 <listitem>
77 <para>
78 Download (HTTP): <ulink url="&gcc-download-http;"/>
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 Download (FTP): <ulink url="&gcc-download-ftp;"/>
84 </para>
85 </listitem>
86 <listitem>
87 <para>
88 Download MD5 sum: &gcc-md5sum;
89 </para>
90 </listitem>
91 <listitem>
92 <para>
93 Download size: &gcc-size;
94 </para>
95 </listitem>
96 <listitem>
97 <para>
98 Estimated disk space required: &gcc-buildsize;
99 </para>
100 </listitem>
101 <listitem>
102 <para>
103 Estimated build time: &gcc-time;
104 </para>
105 </listitem>
106 </itemizedlist>
107
108<!-- <bridgehead renderas="sect3">Additional Downloads</bridgehead>
109 <itemizedlist spacing="compact">
110 <listitem>
111 <para>
112 Required patch:
113 <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
114 </para>
115 </listitem>
116 </itemizedlist>
117-->
118
119 <bridgehead renderas="sect3">GCC Dependencies</bridgehead>
120
121 <bridgehead renderas="sect4">Recommended</bridgehead>
122 <para role="recommended">
123 <xref linkend="dejagnu"/>, for tests
124 </para>
125
126 <para condition="html" role="usernotes">
127 User Notes: <ulink url="&blfs-wiki;/gcc"/>
128 </para>
129
130 </sect2>
131
132 <sect2 role="installation">
133 <title>Installation of GCC</title>
134
135 <important>
136 <para>
137 Even if you specify only languages other than C and C++ to the
138 <command>./configure</command> command below, the
139 installation process will overwrite your existing
140 <application>GCC</application> C and C++ compilers and libraries.
141 Having the <application>Tcl</application>,
142 <application>Expect</application> and <application>DejaGnu</application>
143 packages installed before beginning the build is highly recommended so
144 you can run the full suite of tests.
145 </para>
146
147 <para>
148 Do not continue with the <command>make install</command> command
149 until you are confident the build was successful. You can compare your
150 test results with those found at <ulink
151 url="http://gcc.gnu.org/ml/gcc-testresults/"/>. You may also want to
152 refer to the information found in the <application>GCC</application>
153 section of Chapter 6 in the LFS book (<ulink
154 url="&lfs-root;/chapter06/gcc.html"/>).
155 </para>
156 </important>
157
158 <para>
159 The instructions below are intentionally performing a
160 <quote>bootstrap</quote> process. Bootstrapping is needed for robustness
161 and is highly recommended when upgrading the compilers version. To disable
162 bootstrap anyways, add <parameter>--disable-bootstrap</parameter> to the
163 <command>./configure</command> options below.
164 </para>
165
166 <para>
167 Install <application>GCC</application> by running the following commands:
168 </para>
169
170<screen><userinput>mkdir ../gcc-build &amp;&amp;
171cd ../gcc-build &amp;&amp;
172
173../gcc-&gcc-version;/configure \
174 --prefix=/usr \
175 --disable-multilib \
176 --with-system-zlib \
177 --enable-languages=c,c++,fortran,go,objc,obj-c++ &amp;&amp;
178make</userinput></screen>
179
180 <para>
181 If you have installed additional packages such as
182 <application>Valgrind</application> and <application>GDB</application>,
183 the <application>GCC</application> part of the testsuite will run more
184 tests than in LFS. Some of those will report FAIL and others XPASS
185 (pass when expected to FAIL). To run the tests, issue:
186 </para>
187
188<screen><userinput>ulimit -s 32768 &amp;&amp;
189make -k check</userinput></screen>
190<!-- The command above may error out, so using && may prevent the summary
191to be run. -->
192
193 <para>
194 The tests are very long, and the results may be hard to find in the
195 logs, specially if you use parallel jobs with make. You can get a summary
196 of the tests with:
197 </para>
198
199<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
200
201 <para>
202 Now, as the <systemitem class="username">root</systemitem> user:
203 </para>
204
205<screen role="root"><userinput>make install &amp;&amp;
206
207mkdir -pv /usr/share/gdb/auto-load/usr/lib &amp;&amp;
208mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib &amp;&amp;
209
210chown -v -R root:root \
211 /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed}</userinput></screen>
212
213 <para>
214 Some packages expect to find the C preprocessor in
215 <filename class="directory">/lib</filename> or may refer to the C compiler
216 under the name <command>cc</command>. The following symbolic links are not
217 needed if you have followed the LFS instructions, since they
218 have been already created. If you do not have them on your system, issue
219 as the <systemitem class="username">root</systemitem> user:
220 </para>
221
222<screen role="root"><userinput>ln -sfv ../usr/bin/cpp /lib &amp;&amp;
223ln -sfv gcc /usr/bin/cc &amp;&amp;
224install -v -dm755 /usr/lib/bfd-plugins &amp;&amp;
225ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so /usr/lib/bfd-plugins/</userinput></screen>
226
227 </sect2>
228
229 <sect2 role="commands">
230 <title>Command Explanations</title>
231
232 <para>
233 <command>mkdir ../gcc-build; cd ../gcc-build</command>: The
234 <application>GCC</application> documentation recommends
235 building the package in a dedicated build directory.
236 </para>
237
238 <para>
239 <parameter>--disable-multilib</parameter>: This parameter ensures
240 that files are created for the specific architecture of your computer.
241 </para>
242
243 <para>
244 <parameter>--with-system-zlib</parameter>: Uses the system
245 <application>zlib</application> instead of the bundled one.
246 <application>zlib</application> is used for compressing
247 and uncompressing <application>GCC</application>'s intermediate
248 language in LTO (Link Time Optimization) object files.
249 </para>
250
251 <para>
252 <parameter>--enable-languages=c,c++,fortran,go,objc,obj-c++</parameter>:
253 This command identifies which languages to build. You may modify
254 this command to remove undesired languages.
255 </para>
256
257 <para>
258 <option>--with-default-libstdcxx-abi=c++98</option>: Use this switch if you
259 are upgrading from a <application>GCC</application> version prior to 5.1.0,
260 and you do not want to recompile all the libraries written in C++.
261 </para>
262
263 <para>
264 <command>ulimit -s 32768</command>: This command prevents several
265 tests from running out of stack space.
266 </para>
267
268 <para>
269 <command>make -k check</command>: This command runs the test suite
270 without stopping if any errors are encountered.
271 </para>
272
273 <para>
274 <command>../gcc-&gcc-version;/contrib/test_summary</command>: This
275 command will produce a summary of the test suite results. You can append
276 <command>| grep -A7 Summ</command> to the command to produce an even more
277 condensed version of the summary. You may also wish to redirect the output
278 to a file for review and comparison later on.
279 </para>
280
281 <para>
282 <command>mv -v /usr/lib/*gdb.py ...</command>: The installation
283 stage puts some files used by <application>gdb</application> under the
284 <filename class="directory">/usr/lib</filename> directory. This generates
285 spurious error messages when performing <command>ldconfig</command>. This
286 command moves the files to another location.
287 </para>
288
289 <para>
290 <command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
291 If the package is built by a user other than root, the ownership of the
292 installed <filename class="directory">include</filename> directory (and
293 its content) will be incorrect. This command changes the ownership to the
294 <systemitem class="username">root</systemitem> user and group.
295 </para>
296
297 </sect2>
298
299 <sect2 role="content">
300 <title>Contents</title>
301
302 <para>
303 Some program and library names and descriptions are not listed here,
304 but can be found at
305 <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
306 initially installed during the building of LFS.
307 </para>
308
309 <segmentedlist>
310 <segtitle>Installed Programs</segtitle>
311 <segtitle>Installed Libraries</segtitle>
312 <segtitle>Installed Directories</segtitle>
313
314 <seglistitem>
315 <seg>
316 gccgo, go, gofmt, and gfortran, hard-linked to architecture specific
317 names
318 </seg>
319 <seg>
320 libgfortran.{so,a},
321 libgo.{so,a}, libgobegin.a, libgolibbegin.a, libnetgo.a,
322 libobjc.{so,a}, and numerous other run-time libraries and executables
323 in <filename class="directory">/usr/lib/gcc</filename>,
324 <filename class="directory">/usr/libexec/gcc</filename>, and
325 <filename class="directory">/usr/lib/go</filename>
326 </seg>
327 <seg>
328 /usr/lib/gcc/&lt;arch-triplet&gt;/&gcc-version;/include/objc and
329 /usr/lib/go
330 </seg>
331 </seglistitem>
332 </segmentedlist>
333
334 <variablelist>
335 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
336 <?dbfo list-presentation="list"?>
337 <?dbhtml list-presentation="table"?>
338
339 <varlistentry id="gccgo">
340 <term><command>gccgo</command></term>
341 <listitem>
342 <para>
343 is a GCC-based compiler for the <application>Go</application> language.
344 </para>
345 <indexterm zone="gcc gccgo">
346 <primary sortas="b-gccgo">gccgo</primary>
347 </indexterm>
348 </listitem>
349 </varlistentry>
350
351 <varlistentry id="go">
352 <term><command>go</command></term>
353 <listitem>
354 <para>
355 is a tool for managing <application>Go</application> source code.
356 </para>
357 <indexterm zone="gcc go">
358 <primary sortas="b-go">go</primary>
359 </indexterm>
360 </listitem>
361 </varlistentry>
362
363 <varlistentry id="gofmt">
364 <term><command>gofmt</command></term>
365 <listitem>
366 <para>
367 is a tool for formatting <application>Go</application> source code.
368 </para>
369 <indexterm zone="gcc gofmt">
370 <primary sortas="b-gofmt">gofmt</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374
375 <varlistentry id="gfortran">
376 <term><command>gfortran</command></term>
377 <listitem>
378 <para>
379 is a GCC-based compiler for the <application>Fortran</application>
380 language.
381 </para>
382 <indexterm zone="gcc gfortran">
383 <primary sortas="b-gfortran">gfortran</primary>
384 </indexterm>
385 </listitem>
386 </varlistentry>
387
388 </variablelist>
389
390 </sect2>
391
392</sect1>
Note: See TracBrowser for help on using the repository browser.