source: general/prog/gcc.xml@ 229d069

11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 229d069 was 229d069, checked in by Douglas R. Reno <renodr@…>, 3 years ago

Update to gcc-11.1.0
Update to systemd-248
Update to Python-3.9.5

  • Property mode set to 100644
File size: 16.2 KB
RevLine 
[52d29f7]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[52d29f7]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[8dfc5c3]7 <!ENTITY gcc-download-http "&gnu-http;/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.xz">
8 <!ENTITY gcc-download-ftp "&gnu-ftp;/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.xz">
[229d069]9 <!ENTITY gcc-md5sum "77f6252be0861ab918042acf42bc10ff">
10 <!ENTITY gcc-size "75 MB">
11 <!ENTITY gcc-buildsize "10.1 GB (2.4 GB installed with all listed languages; add 1.3 GB for tests)">
12 <!ENTITY gcc-time "28 SBU (with parallelism=4, add 73 SBU for tests with parallelism=4)">
[52d29f7]13]>
14
[58bd309a]15<sect1 id="gcc" xreflabel="GCC-&gcc-version;">
[70e3220]16 <?dbhtml filename="gcc.html" ?>
17
18 <sect1info>
19 <date>$Date$</date>
20 </sect1info>
21
22 <title>GCC-&gcc-version;</title>
23
24 <indexterm zone="gcc">
[ae0673a]25 <primary sortas="a-gcc-5-0">GCC-&gcc-version;</primary>
[70e3220]26 </indexterm>
27
28 <sect2 role="package">
29 <title>Introduction to GCC</title>
30
[ae0673a]31 <para>
32 The <application>GCC</application> package contains the GNU Compiler
33 Collection. This page describes the installation of compilers for the
[0f1cd72e]34 following languages: C, C++, D, Fortran, Objective C, Objective C++, and Go.
[0a4d6ef0]35 <!--One additional language, Ada, is available in the collection. It has
[0f18e26]36 a binary bootstrap requirement for the first installation, so it is
[0a4d6ef0]37 described on a separate page (<xref linkend="gcc-ada"/>) but can be added
[0f18e26]38 here if you are performing a rebuild or upgrade. Since C and C++ are
39 installed in LFS, this page is either for upgrading C and C++, or for
[0a4d6ef0]40 installing additional compilers.-->
[ae0673a]41 </para>
[5512e64]42
[4a2c778d]43 &lfs101_checked;
[625d5fe5]44
[636acbb1]45 <caution>
[ae0673a]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>
[e9cab664]62 Some system headers need to be fixed to be used with GCC. This is done
63 during the installation of GCC, and the <quote>fixed</quote> headers
64 are installed in <filename class="directory">
65 /usr/lib/gcc/&lt;machine triplet&gt;/&lt;GCC version&gt;/include-fixed
66 </filename>. This is harmless if GCC is built during the LFS stage. But
67 if you reinstall GCC in BLFS, some of the BLFS packages may be
68 <quote>fixed</quote>. If one of those packages is reinstalled
69 afterwards, the <quote>fixed</quote> headers are not updated, which may
70 lead to version mismatches. In case that happens, the
71 <quote>fixed</quote> headers must be updated by running (as
72 <systemitem class="username">root</systemitem>):
73 <command>
[da8e9f9]74 /usr/libexec/gcc/x86_64-pc-linux-gnu/&gcc-version;/install-tools/mkheaders
[e9cab664]75 </command>. The machine triplet may be different on a 32bit system.
[ae0673a]76 </para>
[636acbb1]77 </caution>
78
[70e3220]79 <bridgehead renderas="sect3">Package Information</bridgehead>
80 <itemizedlist spacing="compact">
81 <listitem>
[ae0673a]82 <para>
83 Download (HTTP): <ulink url="&gcc-download-http;"/>
84 </para>
[70e3220]85 </listitem>
86 <listitem>
[ae0673a]87 <para>
88 Download (FTP): <ulink url="&gcc-download-ftp;"/>
89 </para>
[70e3220]90 </listitem>
91 <listitem>
[ae0673a]92 <para>
93 Download MD5 sum: &gcc-md5sum;
94 </para>
[70e3220]95 </listitem>
96 <listitem>
[ae0673a]97 <para>
98 Download size: &gcc-size;
99 </para>
[70e3220]100 </listitem>
101 <listitem>
[ae0673a]102 <para>
103 Estimated disk space required: &gcc-buildsize;
104 </para>
[70e3220]105 </listitem>
106 <listitem>
[ae0673a]107 <para>
108 Estimated build time: &gcc-time;
109 </para>
[70e3220]110 </listitem>
111 </itemizedlist>
[ae0673a]112
[87532434]113<!-- <bridgehead renderas="sect3">Additional Downloads</bridgehead>
[18310d86]114 <itemizedlist spacing="compact">
115 <listitem>
116 <para>
117 Required patch:
[5fd1f25b]118 <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
[18310d86]119 </para>
120 </listitem>
121 </itemizedlist>
[87532434]122-->
[8ddc247]123
[70e3220]124 <bridgehead renderas="sect3">GCC Dependencies</bridgehead>
[f4002c5]125<!--
[7cadfea]126 <bridgehead renderas="sect4">Recommended</bridgehead>
127 <para role="recommended">
[eb631ac]128 <xref linkend="dejagnu"/>, for tests
[7cadfea]129 </para>
[f4002c5]130-->
[a7e88c5c]131 <bridgehead renderas="sect4">Optional</bridgehead>
132 <para role="optional">
[1a8a995]133 <xref linkend="gdb"/>,
134 <xref linkend="valgrind"/> (for tests), and
135 <ulink url="https://repo.or.cz/isl.git">ISL</ulink> (to enable graphite optimization)
[a7e88c5c]136 </para>
137
[ae0673a]138 <para condition="html" role="usernotes">
139 User Notes: <ulink url="&blfs-wiki;/gcc"/>
140 </para>
[1039de3]141
[70e3220]142 </sect2>
[034eda7]143
[70e3220]144 <sect2 role="installation">
145 <title>Installation of GCC</title>
146
147 <important>
[ae0673a]148 <para>
149 Even if you specify only languages other than C and C++ to the
150 <command>./configure</command> command below, the
151 installation process will overwrite your existing
152 <application>GCC</application> C and C++ compilers and libraries.
[229d069]153 <!--Having the <application>Tcl</application>,
[ae0673a]154 <application>Expect</application> and <application>DejaGnu</application>
155 packages installed before beginning the build is highly recommended so
[229d069]156 you can run the full suite of tests.-->
157 Running the full squite of tests is recommended.
[ae0673a]158 </para>
159
160 <para>
161 Do not continue with the <command>make install</command> command
162 until you are confident the build was successful. You can compare your
163 test results with those found at <ulink
[579bdb04]164 url="https://gcc.gnu.org/ml/gcc-testresults/"/>. You may also want to
[ae0673a]165 refer to the information found in the <application>GCC</application>
[f0dc9578]166 section of Chapter 8 in the LFS book (<ulink
167 url="&lfs-root;/chapter08/gcc.html"/>).
[ae0673a]168 </para>
[70e3220]169 </important>
170
[ae0673a]171 <para>
172 The instructions below are intentionally performing a
173 <quote>bootstrap</quote> process. Bootstrapping is needed for robustness
174 and is highly recommended when upgrading the compilers version. To disable
175 bootstrap anyways, add <parameter>--disable-bootstrap</parameter> to the
176 <command>./configure</command> options below.
177 </para>
[c6bfee88]178
[ae0673a]179 <para>
180 Install <application>GCC</application> by running the following commands:
181 </para>
182
[92245989]183<screen><userinput>case $(uname -m) in
184 x86_64)
[df0e196]185 sed -i.orig '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
[92245989]186 ;;
187esac
188
[adbf61f]189mkdir build &amp;&amp;
190cd build &amp;&amp;
191
192../configure \
193 --prefix=/usr \
194 --disable-multilib \
195 --with-system-zlib \
196 --enable-languages=c,c++,d,fortran,go,objc,obj-c++ &amp;&amp;
[7cadfea]197make</userinput></screen>
[5512e64]198
[ae0673a]199 <para>
200 If you have installed additional packages such as
201 <application>Valgrind</application> and <application>GDB</application>,
202 the <application>GCC</application> part of the testsuite will run more
203 tests than in LFS. Some of those will report FAIL and others XPASS
[7e7e322]204 (pass when expected to FAIL). As of gcc-10.2.0, about 90 FAIL occur
[3b187ea]205 in the <quote>guality</quote> suite, as well as miscellaneous failures
206 throughout the rest of the test suite. If all the compilers above are
[229d069]207 built, there will be around 107 unexpected failures out of over
[4c22625]208 468,000 tests. To run the tests, issue:
[ae0673a]209 </para>
[d3757f1c]210
[7cadfea]211<screen><userinput>ulimit -s 32768 &amp;&amp;
[b10cfc81]212make -k check</userinput></screen>
213<!-- The command above may error out, so using && may prevent the summary
214to be run. -->
215
[ae0673a]216 <para>
217 The tests are very long, and the results may be hard to find in the
218 logs, specially if you use parallel jobs with make. You can get a summary
219 of the tests with:
220 </para>
[5512e64]221
[0e64979]222<screen><userinput>../contrib/test_summary</userinput></screen>
[8c9ec303]223
[ae0673a]224 <para>
225 Now, as the <systemitem class="username">root</systemitem> user:
226 </para>
[8c9ec303]227
[70e3220]228<screen role="root"><userinput>make install &amp;&amp;
[5512e64]229
[7cadfea]230mkdir -pv /usr/share/gdb/auto-load/usr/lib &amp;&amp;
231mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib &amp;&amp;
232
[38485e5c]233chown -v -R root:root \
[09aa329]234 /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed}
235
236rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/&gcc-version;/include-fixed/bits/</userinput></screen>
[f182eed]237
[ae0673a]238 <para>
239 Some packages expect to find the C preprocessor in
240 <filename class="directory">/lib</filename> or may refer to the C compiler
241 under the name <command>cc</command>. The following symbolic links are not
242 needed if you have followed the LFS instructions, since they
243 have been already created. If you do not have them on your system, issue
244 as the <systemitem class="username">root</systemitem> user:
245 </para>
[70e3220]246
[ae0673a]247<screen role="root"><userinput>ln -v -sf ../usr/bin/cpp /lib &amp;&amp;
248ln -v -sf gcc /usr/bin/cc &amp;&amp;
249install -v -dm755 /usr/lib/bfd-plugins &amp;&amp;
250ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so /usr/lib/bfd-plugins/</userinput></screen>
[034eda7]251
[70e3220]252 </sect2>
253
254 <sect2 role="commands">
255 <title>Command Explanations</title>
[8ddc247]256
[2d488eb]257 <para>
[0e64979]258 <command>mkdir build; cd build</command>: The
[2d488eb]259 <application>GCC</application> documentation recommends
260 building the package in a dedicated build directory.
261 </para>
[70e3220]262
[2d488eb]263 <para>
264 <parameter>--disable-multilib</parameter>: This parameter ensures
265 that files are created for the specific architecture of your computer.
266 </para>
[7cadfea]267
[2d488eb]268 <para>
[fa200b8]269 <parameter>--with-system-zlib</parameter>: Uses the system
[2d488eb]270 <application>zlib</application> instead of the bundled one.
271 <application>zlib</application> is used for compressing
272 and uncompressing <application>GCC</application>'s intermediate
273 language in LTO (Link Time Optimization) object files.
274 </para>
[034eda7]275
[800c9c3]276 <para>
[adbf61f]277 <parameter>--enable-languages=c,c++,d,fortran,go,objc,obj-c++</parameter>:
[2d488eb]278 This command identifies which languages to build. You may modify
[229d069]279 this command to remove undesired languages. Three other languages can be
280 added, including ADA, BRIG (add
[3d9141c]281 <parameter>brig</parameter> to the list of enabled languages), a binary
[9562b375]282 format for HSAIL (Heterogeneous System Architecture Intermediate
[3d9141c]283 Language), and JIT (add <parameter>jit</parameter> to the list of enabled
[0f18e26]284 languages), a library which can be linked into interpreters that want to
285 generate machine code <quote>on the fly</quote> at run-time. They have not
286 been tested by the BLFS developers.
[2d488eb]287 </para>
[a7e88c5c]288 <!-- It's been three major versions now, and many years.
289 Commenting out unless needed somewhere. -renodr
[ae0673a]290 <para>
[a7e88c5c]291 <option>- -with-default-libstdcxx-abi=gcc4-compatible</option>: Use this
[0e64979]292 switch if you are upgrading from a <application>GCC</application>
293 version prior to 5.1.0, and you do not want to recompile all the
294 libraries written in C++.
[ae0673a]295 </para>
[a7e88c5c]296 -->
[ae0673a]297
[2d488eb]298 <para>
299 <command>ulimit -s 32768</command>: This command prevents several
300 tests from running out of stack space.
301 </para>
302
303 <para>
304 <command>make -k check</command>: This command runs the test suite
305 without stopping if any errors are encountered.
306 </para>
307
308 <para>
[9562b375]309 <command>../contrib/test_summary</command>: This command will produce
310 a summary of the test suite results. You can append <command>| grep
311 -A7 Summ</command> to the command to produce an even more condensed
312 version of the summary. You may also wish to redirect the output
[2d488eb]313 to a file for review and comparison later on.
314 </para>
315
316 <para>
317 <command>mv -v /usr/lib/*gdb.py ...</command>: The installation
318 stage puts some files used by <application>gdb</application> under the
319 <filename class="directory">/usr/lib</filename> directory. This generates
320 spurious error messages when performing <command>ldconfig</command>. This
321 command moves the files to another location.
322 </para>
323
324 <para>
325 <command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
326 If the package is built by a user other than root, the ownership of the
327 installed <filename class="directory">include</filename> directory (and
328 its content) will be incorrect. This command changes the ownership to the
329 <systemitem class="username">root</systemitem> user and group.
330 </para>
[034eda7]331
[09aa329]332 <para>
333 <command>rm -rf .../include-fixed/bits/</command>: Remove an erroneous
334 file in gcc added by the fixincludes process.
335 </para>
336
[70e3220]337 </sect2>
338
339 <sect2 role="content">
340 <title>Contents</title>
341
[ae0673a]342 <para>
343 Some program and library names and descriptions are not listed here,
344 but can be found at
[f0dc9578]345 <ulink url="&lfs-root;/chapter08/gcc.html#contents-gcc"/> as they were
[ae0673a]346 initially installed during the building of LFS.
347 </para>
[2d488eb]348
[70e3220]349 <segmentedlist>
350 <segtitle>Installed Programs</segtitle>
351 <segtitle>Installed Libraries</segtitle>
352 <segtitle>Installed Directories</segtitle>
353
354 <seglistitem>
[7cadfea]355 <seg>
[4c22625]356 gccgo, gdc, gfortran, go, and gofmt, hard-linked to architecture
[adbf61f]357 specific names
[7cadfea]358 </seg>
359 <seg>
[d7d743f0]360 libgfortran.{so,a},
[adbf61f]361 libgdruntime.{so,a}, libgphobos.{so,a}
[9562b375]362 libgo.{so,a}, libgobegin.a, libgolibbegin.a,
[d7d743f0]363 libobjc.{so,a}, and numerous other run-time libraries and executables
[7cadfea]364 </seg>
365 <seg>
[d5e9aa8]366 /usr/lib/go
[7cadfea]367 </seg>
[70e3220]368 </seglistitem>
369 </segmentedlist>
370
371 <variablelist>
372 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
373 <?dbfo list-presentation="list"?>
374 <?dbhtml list-presentation="table"?>
375
[034eda7]376 <varlistentry id="gccgo">
377 <term><command>gccgo</command></term>
378 <listitem>
[ae0673a]379 <para>
[5b55f9b3]380 is a GCC-based compiler for the <application>Go</application>
[4c24eb0a]381 language
[ae0673a]382 </para>
[034eda7]383 <indexterm zone="gcc gccgo">
384 <primary sortas="b-gccgo">gccgo</primary>
[70e3220]385 </indexterm>
386 </listitem>
387 </varlistentry>
388
[87532434]389 <varlistentry id="go">
390 <term><command>go</command></term>
391 <listitem>
392 <para>
[4c24eb0a]393 is a tool for managing <application>Go</application> source code
[87532434]394 </para>
395 <indexterm zone="gcc go">
396 <primary sortas="b-go">go</primary>
397 </indexterm>
398 </listitem>
399 </varlistentry>
400
401 <varlistentry id="gofmt">
402 <term><command>gofmt</command></term>
403 <listitem>
404 <para>
[4c24eb0a]405 is a tool for formatting <application>Go</application> source code
[87532434]406 </para>
407 <indexterm zone="gcc gofmt">
408 <primary sortas="b-gofmt">gofmt</primary>
409 </indexterm>
410 </listitem>
411 </varlistentry>
412
[adbf61f]413 <varlistentry id="gdc">
414 <term><command>gdc</command></term>
415 <listitem>
416 <para>
417 is a GCC-based compiler for the <application>D</application>
[4c24eb0a]418 language
[adbf61f]419 </para>
420 <indexterm zone="gcc gdc">
421 <primary sortas="b-gdc">gdc</primary>
422 </indexterm>
423 </listitem>
424 </varlistentry>
425
[800c9c3]426 <varlistentry id="gfortran">
427 <term><command>gfortran</command></term>
428 <listitem>
[ae0673a]429 <para>
430 is a GCC-based compiler for the <application>Fortran</application>
[4c24eb0a]431 language
[ae0673a]432 </para>
[800c9c3]433 <indexterm zone="gcc gfortran">
434 <primary sortas="b-gfortran">gfortran</primary>
435 </indexterm>
436 </listitem>
437 </varlistentry>
438
[70e3220]439 </variablelist>
440
441 </sect2>
[1a686a1]442
443</sect1>
Note: See TracBrowser for help on using the repository browser.