Ignore:
Timestamp:
05/24/2015 05:43:45 PM (9 years ago)
Author:
Pierre Labastie <pieere@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, nosym, perl-modules, 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
Children:
64eb9189
Parents:
b39a80c
Message:

Update to GCC-5.1.0:
+ a lot of indentation redone
+ change to the order of gcc-java and ada: Ada must be built last.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@16022 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • general/prog/gcc.xml

    rb39a80c rae0673a  
    55  %general-entities;
    66
    7   <!ENTITY gcc-download-http  "http://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
     7  <!ENTITY gcc-download-http  "https://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
    88  <!ENTITY gcc-download-ftp   "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
    9   <!ENTITY gcc-md5sum         "4df8ee253b7f3863ad0b86359cd39c43">
    10   <!ENTITY gcc-size           "86 MB">
    11   <!ENTITY gcc-buildsize      "5.2 GB">
    12   <!ENTITY gcc-time           "138 SBU (including 95 SBU for tests)">
     9  <!ENTITY gcc-md5sum         "d5525b1127d07d215960e6051c5da35e">
     10  <!ENTITY gcc-size           "91 MB">
     11  <!ENTITY gcc-buildsize      "6.7 GB">
     12  <!ENTITY gcc-time           "130 SBU (including 80 SBU for tests)">
    1313]>
    1414
     
    2424
    2525  <indexterm zone="gcc">
    26     <primary sortas="a-gcc-4-0">GCC-&gcc-version;</primary>
     26    <primary sortas="a-gcc-5-0">GCC-&gcc-version;</primary>
    2727  </indexterm>
    2828
     
    3030    <title>Introduction to GCC</title>
    3131
    32     <para>The <application>GCC</application> package contains the GNU Compiler
    33     Collection. This page describes the installation of compilers for the
    34     following languages: C, C++, Fortran, Objective C, Objective C++, and Go.
    35     Two additional languages , Ada and Java are available in the collection.
    36     They have specific requirements, so they are described in separate pages
    37     (<xref linkend="gcc-ada"/> and <xref linkend="gcc-java"/>). Since C and
    38     C++ are installed in LFS, this page is either for upgrading C and C++,
    39     or for installing additional compilers.</para>
     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>
    4042
    4143    &lfs77_checked;
    4244
    4345    <caution>
    44       <para>If you are upgrading <application>GCC</application> from any other
    45       version prior to &gcc-version;, then you must be careful compiling 3rd
    46       party kernel modules. You should ensure that the kernel and all its
    47       native modules are also compiled using the same version of
    48       <application>GCC</application> that you use to build the 3rd party module.
    49       This issue does not affect native kernel (and kernel modules) updates,
    50       as the instructions below are a complete reinstallation of
    51       <application>GCC</application>. If you have existing 3rd party modules
    52       installed, ensure they are recompiled using the updated version of
    53       <application>GCC</application>. As always, never update the kernel
    54       headers from the ones used when <application>Glibc</application> was
    55       compiled during LFS.</para>
     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>
    5672    </caution>
    5773
     
    5975    <itemizedlist spacing="compact">
    6076      <listitem>
    61         <para>Download (HTTP): <ulink url="&gcc-download-http;"/></para>
    62       </listitem>
    63       <listitem>
    64         <para>Download (FTP): <ulink url="&gcc-download-ftp;"/></para>
    65       </listitem>
    66       <listitem>
    67         <para>Download MD5 sum: &gcc-md5sum;</para>
    68       </listitem>
    69       <listitem>
    70         <para>Download size: &gcc-size;</para>
    71       </listitem>
    72       <listitem>
    73         <para>Estimated disk space required: &gcc-buildsize;</para>
    74       </listitem>
    75       <listitem>
    76         <para>Estimated build time: &gcc-time;</para>
     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>
    77105      </listitem>
    78106    </itemizedlist>
    79 <!--
     107
    80108    <bridgehead renderas="sect3">Additional Downloads</bridgehead>
    81109    <itemizedlist spacing="compact">
     
    83111        <para>
    84112          Required patch:
    85           <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
     113          <ulink url="&patch-root;/gcc-&gcc-version;-upstream_libgomp_fix-1.patch"/>
    86114        </para>
    87115      </listitem>
    88116    </itemizedlist>
    89 -->
     117
    90118
    91119    <bridgehead renderas="sect3">GCC Dependencies</bridgehead>
     
    96124    </para>
    97125
    98     <para condition="html" role="usernotes">User Notes:
    99     <ulink url="&blfs-wiki;/gcc"/></para>
     126    <para condition="html" role="usernotes">
     127      User Notes: <ulink url="&blfs-wiki;/gcc"/>
     128    </para>
    100129
    101130  </sect2>
     
    105134
    106135    <important>
    107       <para>Even if you specify only languages other than C and C++ to the
    108       <command>./configure</command> command below, the
    109       installation process will overwrite your existing
    110       <application>GCC</application> C and C++ compilers and libraries.
    111       Having the <application>Tcl</application>,
    112       <application>Expect</application> and <application>DejaGnu</application>
    113       packages installed before beginning the build is highly recommended so
    114       you can run the full suite of tests.</para>
    115 
    116       <para>Do not continue with the <command>make install</command> command
    117       until you are confident the build was successful. You can compare your
    118       test results with those found at <ulink
    119       url="http://gcc.gnu.org/ml/gcc-testresults/"/>.  You may also want to
    120       refer to the information found in the <application>GCC</application>
    121       section of Chapter 6 in the LFS book (<ulink
    122       url="&lfs-root;/chapter06/gcc.html"/>).</para>
     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>
    123156    </important>
    124157
    125     <para>The instructions below are intentionally performing a
    126     <quote>bootstrap</quote> process. Bootstrapping is needed for robustness
    127     and is highly recommended when upgrading the compilers version. To disable
    128     bootstrap anyways, add <parameter>--disable-bootstrap</parameter> to the
    129     <command>./configure</command> options below.</para>
    130 <!--
    131     <para>As in LFS, fix a problem identified upstream:</para>
    132 
    133 <screen><userinput>sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
    134 -->
    135 
    136     <para>Install <application>GCC</application> by running the
    137     following commands:</para>
    138 
    139 <screen><userinput><!--
    140 patch -Np1 -i ../gcc-&gcc-version;-upstream_fixes-1.patch    &amp;&amp;
    141 -->mkdir ../gcc-build                                   &amp;&amp;
     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      As in LFS, fix a problem identified upstream with the libgomp library:
     168    </para>
     169
     170<screen><userinput>patch -Np1 -i ../gcc-5.1.0-upstream_libgomp_fix-1.patch</userinput></screen>
     171
     172
     173    <para>
     174      Install <application>GCC</application> by running the following commands:
     175    </para>
     176
     177<screen><userinput>mkdir ../gcc-build                                   &amp;&amp;
    142178cd    ../gcc-build                                   &amp;&amp;
    143179
    144180../gcc-&gcc-version;/configure                               \
    145181    --prefix=/usr                                    \
    146     --libdir=/usr/lib                                \
    147     --enable-shared                                  \
    148     --enable-threads=posix                           \
    149     --enable-__cxa_atexit                            \
    150     --enable-clocale=gnu                             \
    151182    --disable-multilib                               \
    152183    --with-system-zlib                               \
     
    154185make</userinput></screen>
    155186
    156     <para>If you have installed additional packages such as
    157     <application>Valgrind</application> and <application>GDB</application>,
    158     the <application>GCC</application> part of the testsuite will run more
    159     tests than in LFS. Some of those will report FAIL and others XPASS
    160     (pass when expected to FAIL). To run the tests, issue:</para>
     187    <para>
     188      If you have installed additional packages such as
     189      <application>Valgrind</application> and <application>GDB</application>,
     190      the <application>GCC</application> part of the testsuite will run more
     191      tests than in LFS. Some of those will report FAIL and others XPASS
     192      (pass when expected to FAIL). To run the tests, issue:
     193    </para>
    161194
    162195<screen><userinput>ulimit -s 32768 &amp;&amp;
     
    165198to be run. -->
    166199
    167     <para>The tests are very long, and the results may be hard to find in the
    168     logs, specially if you use parallel jobs with make. You can get a summary
    169     of the tests with:</para>
     200    <para>
     201      The tests are very long, and the results may be hard to find in the
     202      logs, specially if you use parallel jobs with make. You can get a summary
     203      of the tests with:
     204    </para>
    170205
    171206<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
    172207
    173     <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
     208    <para>
     209      Now, as the <systemitem class="username">root</systemitem> user:
     210    </para>
    174211
    175212<screen role="root"><userinput>make install &amp;&amp;
     
    181218    /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed}</userinput></screen>
    182219
    183     <para>Some packages expect to find the C preprocessor in
    184     <filename class="directory">/lib</filename> or may refer to the C compiler
    185     under the name <command>cc</command>. The following symbolic links are not
    186     needed if you have followed the LFS instructions, since they
    187     have been already created. If you do not have them on your system, issue
    188     as the <systemitem class="username">root</systemitem> user:</para>
    189 
    190 <screen role="root"><userinput>ln -v -sf ../usr/bin/cpp /lib &amp;&amp;
    191 ln -v -sf gcc /usr/bin/cc</userinput></screen>
     220    <para>
     221      Some packages expect to find the C preprocessor in
     222      <filename class="directory">/lib</filename> or may refer to the C compiler
     223      under the name <command>cc</command>. The following symbolic links are not
     224      needed if you have followed the LFS instructions, since they
     225      have been already created. If you do not have them on your system, issue
     226      as the <systemitem class="username">root</systemitem> user:
     227    </para>
     228
     229<screen role="root"><userinput>ln -v -sf ../usr/bin/cpp /lib          &amp;&amp;
     230ln -v -sf gcc /usr/bin/cc              &amp;&amp;
     231install -v -dm755 /usr/lib/bfd-plugins &amp;&amp;
     232ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so /usr/lib/bfd-plugins/</userinput></screen>
    192233
    193234  </sect2>
     
    195236  <sect2 role="commands">
    196237    <title>Command Explanations</title>
    197 <!--
    198     <para>
    199       <command>patch ... gcc-&gcc-version;-upstream_fixes-1.patch</command>:
    200       This patch corrects bugs in the C++ compiler, which lead to
    201       segmentation faults in some cases.
    202     </para>
    203 -->
    204238
    205239    <para>
     
    208242      building the package in a dedicated build directory.
    209243    </para>
    210 
    211     <para>
    212       <parameter>--enable-shared --enable-threads=posix
    213       --enable-__cxa_atexit</parameter>: These parameters are required to build
    214       the <application>C++</application> libraries to published standards.
    215     </para>
    216 
    217     <para>
    218       <parameter>--enable-clocale=gnu</parameter>: This parameter is a
    219     failsafe for incomplete locale data.</para>
    220244
    221245    <para>
     
    239263
    240264    <para>
     265      <option>--with-default-libstdcxx-abi=c++98</option>: Use this switch if you
     266      are upgrading from a <application>GCC</application> version prior to 5.1.0,
     267      and you do not want to recompile all the libraries written in C++.
     268    </para>
     269
     270    <para>
    241271      <command>ulimit -s 32768</command>: This command prevents several
    242272      tests from running out of stack space.
     
    277307    <title>Contents</title>
    278308
    279     <para>Some program and library names and descriptions are not listed here,
    280     but can be found at
    281     <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
    282     initially installed during the building of LFS.</para>
     309    <para>
     310      Some program and library names and descriptions are not listed here,
     311      but can be found at
     312      <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
     313      initially installed during the building of LFS.
     314    </para>
    283315
    284316    <segmentedlist>
     
    289321      <seglistitem>
    290322        <seg>
    291           gccgo and gfortran,
    292           hard-linked to architecture specific names
     323          gccgo and gfortran, hard-linked to architecture specific names
    293324        </seg>
    294325        <seg>
    295326          libgfortran.{so,a},
    296           libgo.{so,a}, libgobegin.a, libobjc.{so,a}, and numerous other
    297           run-time libraries and executables in <filename class="directory">
     327          libgo.{so,a}, libgobegin.a, libnetgo.a, libobjc.{so,a}, and numerous
     328          other run-time libraries and executables in <filename class="directory">
    298329          /usr/lib/gcc</filename>, <filename class="directory">
    299330          /usr/libexec/gcc</filename>, and <filename class="directory">
     
    315346        <term><command>gccgo</command></term>
    316347        <listitem>
    317           <para>is a GCC-based compiler for the
    318           <application>Go</application> language.</para>
     348          <para>
     349            is a GCC-based compiler for the <application>Go</application> language.
     350          </para>
    319351          <indexterm zone="gcc gccgo">
    320352            <primary sortas="b-gccgo">gccgo</primary>
     
    326358        <term><command>gfortran</command></term>
    327359        <listitem>
    328           <para>is a GCC-based compiler for the
    329           <application>Fortran</application> language.</para>
     360          <para>
     361            is a GCC-based compiler for the <application>Fortran</application>
     362            language.
     363          </para>
    330364          <indexterm zone="gcc gfortran">
    331365            <primary sortas="b-gfortran">gfortran</primary>
Note: See TracChangeset for help on using the changeset viewer.