Changeset ae0673a for general


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

Location:
general/prog
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • general/prog/gcc-ada.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-ada-buildsize     "5.1 GB (0.7 GB added if GNAT install dir is not removed)">
    12   <!ENTITY gcc-ada-time          "114 SBU (including 72 SBU for tests)">
     9  <!ENTITY gcc-md5sum            "d5525b1127d07d215960e6051c5da35e">
     10  <!ENTITY gcc-size              "91 MB">
     11  <!ENTITY gcc-ada-buildsize     "6.4 GB (0.7 GB added if GNAT install dir is not removed)">
     12  <!ENTITY gcc-ada-time          "125 SBU (including 73 SBU for tests)">
    1313
    1414  <!ENTITY gnat-download-http    "https://libre.adacore.com/download/">
     
    3838    <title>Introduction to the GCC Ada compiler</title>
    3939
    40     <para>Ada is a modern programming language designed for large, long-lived
    41     applications &mdash; and embedded systems in particular &mdash; where
    42     reliability and efficiency are essential. It has a set of unique technical
    43     features that make it highly effective for use in large, complex and
    44     safety-critical projects.</para>
    45 
    46     <para>The compiler and associated tools on this page are known as the
    47     <application>GNAT</application> technology, developed by the Adacore
    48     company, using the <application>GCC</application> backend. Since
    49     parts of the Ada compiler are written in Ada, there is a circular
    50     dependency on an Ada compiler. The instructions below first install
    51     a binary compiler.</para>
     40    <para>
     41      Ada is a modern programming language designed for large, long-lived
     42      applications &mdash; and embedded systems in particular &mdash; where
     43      reliability and efficiency are essential. It has a set of unique technical
     44      features that make it highly effective for use in large, complex and
     45      safety-critical projects.
     46    </para>
     47
     48    <para>
     49      The compiler and associated tools on this page are known as the
     50      <application>GNAT</application> technology, developed by the Adacore
     51      company, using the <application>GCC</application> backend. Since
     52      parts of the Ada compiler are written in Ada, there is a circular
     53      dependency on an Ada compiler. The instructions below first install
     54      a binary compiler. You do not need to do that if you already have built
     55      <application>GNAT</application> tools.
     56    </para>
    5257
    5358    &lfs77_checked;
    5459
    5560    <caution>
    56       <para>Using the instructions on this page will have the effect that
    57       the C and C++ compiler and libraries will be reinstalled, overwriting
    58       the ones on your system. This may lead to some issues. Please read the
    59       notes and caution on the <xref linkend="gcc"/> page.</para>
     61      <para>
     62        Using the instructions on this page will have the effect that
     63        the C and C++ compiler and libraries will be reinstalled, overwriting
     64        the ones on your system. This may lead to some issues. Please read the
     65        notes and caution on the <xref linkend="gcc"/> page.
     66      </para>
    6067    </caution>
     68
     69    <note>
     70      <para>
     71        If you want to install other compilers in the <application>GCC
     72        </application> collection, do that first, or specify ada in the
     73        <parameter>--enable-languages</parameter> switch to <command>
     74        configure</command>. If you rebuild <application>GCC</application>
     75        without enabling ada after running the instructions on this page,
     76        the new compiler will not be able to compile ADA anymore.
     77      </para>
     78    </note>
    6179
    6280    <bridgehead renderas="sect3">Package Information</bridgehead>
    6381    <itemizedlist spacing="compact">
    6482      <listitem>
    65         <para>Download (HTTP): <ulink url="&gcc-download-http;"/></para>
    66       </listitem>
    67       <listitem>
    68         <para>Download (FTP): <ulink url="&gcc-download-ftp;"/></para>
    69       </listitem>
    70       <listitem>
    71         <para>Download MD5 sum: &gcc-md5sum;</para>
    72       </listitem>
    73       <listitem>
    74         <para>Download size: &gcc-size;</para>
    75       </listitem>
    76       <listitem>
    77         <para>Estimated disk space required: &gcc-ada-buildsize;</para>
    78       </listitem>
    79       <listitem>
    80         <para>Estimated build time: &gcc-ada-time;</para>
     83        <para>
     84          Download (HTTP): <ulink url="&gcc-download-http;"/>
     85        </para>
     86      </listitem>
     87      <listitem>
     88        <para>
     89          Download (FTP): <ulink url="&gcc-download-ftp;"/>
     90        </para>
     91      </listitem>
     92      <listitem>
     93        <para>
     94          Download MD5 sum: &gcc-md5sum;
     95        </para>
     96      </listitem>
     97      <listitem>
     98        <para>
     99          Download size: &gcc-size;
     100        </para>
     101      </listitem>
     102      <listitem>
     103        <para>
     104          Estimated disk space required: &gcc-ada-buildsize;
     105        </para>
     106      </listitem>
     107      <listitem>
     108        <para>
     109          Estimated build time: &gcc-ada-time;
     110        </para>
    81111      </listitem>
    82112    </itemizedlist>
     
    84114    <bridgehead renderas="sect3">Additional Downloads</bridgehead>
    85115    <note>
    86       <para>You will need to install <application>GNAT</application>
    87       temporarily to satisfy the circular dependency. You may point your
    88       browser to the <ulink url="&gnat-download-http;">AdaCore download
    89       page</ulink>, choose your platform and 2014, then select the file
    90       to download. Alternatively, direct links to the 64 bit and 32 bit
    91       linux versions are given below.</para>
     116      <para>
     117        You will need to install <application>GNAT</application>
     118        temporarily to satisfy the circular dependency. You may point your
     119        browser to the <ulink url="&gnat-download-http;">AdaCore download
     120        page</ulink>, choose your platform and 2014, then select the file
     121        to download. Alternatively, direct links to the 64 bit and 32 bit
     122        linux versions are given below.
     123      </para>
    92124    </note>
    93125
     
    123155        </para>
    124156      </listitem>
    125 <!--      <listitem>
     157      <listitem>
    126158        <para>
    127159          Required patch:
    128           <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
    129         </para>
    130       </listitem>-->
     160          <ulink url="&patch-root;/gcc-&gcc-version;-upstream_libgomp_fix-1.patch"/>
     161        </para>
     162      </listitem>
    131163    </itemizedlist>
    132164
     
    146178    <title>Installation of the GNAT binary</title>
    147179
    148     <para>Before unpacking and changing into the GCC source directory, first
    149     unpack the <application>GNAT</application> tarball, and change to the
    150     GNAT directory. Then, install the <application>GNAT</application> binary
    151     by running the following command as the
    152     <systemitem class="username">root</systemitem> user:</para>
     180    <para>
     181      Before unpacking and changing into the GCC source directory, first
     182      unpack the <application>GNAT</application> tarball, and change to the
     183      GNAT directory. Then, install the <application>GNAT</application> binary
     184      by running the following command as the
     185      <systemitem class="username">root</systemitem> user:
     186    </para>
    153187
    154188<screen role="root"><userinput>make ins-all prefix=/opt/gnat</userinput></screen>
    155189
    156     <para>The <application>GNAT</application> compiler can be invoked by
    157     executing the <command>gcc</command> binary installed in <filename
    158     class="directory">/opt/gnat/bin</filename>.</para>
    159 
    160     <para>You may now remove the <application>GNAT</application>
    161     source directory if desired.</para>
    162 
    163     <para>Prepare to compile <application>GCC</application> by placing the
    164     <application>GNAT</application> version of <command>gcc</command> at the
    165     beginning of the <envar>PATH</envar> variable by using the following
    166     commands:</para>
     190    <para>
     191      The <application>GNAT</application> compiler can be invoked by
     192      executing the <command>gcc</command> binary installed in <filename
     193      class="directory">/opt/gnat/bin</filename>.
     194    </para>
     195
     196    <para>
     197      You may now remove the <application>GNAT</application>
     198      source directory if desired.
     199    </para>
     200
     201    <para>
     202      Prepare to compile <application>GCC</application> by placing the
     203      <application>GNAT</application> version of <command>gcc</command> at the
     204      beginning of the <envar>PATH</envar> variable by using the following
     205      commands:
     206    </para>
    167207
    168208<screen><userinput>PATH_HOLD=$PATH &amp;&amp;
    169209export PATH=/opt/gnat/bin:$PATH_HOLD</userinput></screen>
    170210
    171     <para>Doing so has the drawback that the <application>GCC</application>
    172     and <application>Binutils</application> executables are taken
    173     from the just installed <application>GNAT</application> package, but the
    174     versions of those executables are outdated compared to those installed in
    175     LFS. This is not important for the <application>GCC</application> compilers,
    176     since they recompile themselves during the bootstrap process. On the other
    177     hand, the outdated <command>ld</command> and <command>as</command> tools
    178     are used all along. In order to use the LFS tools, issue as the
    179     <systemitem class="username">root</systemitem> user:</para>
     211    <para>
     212      Doing so has the drawback that the <application>GCC</application>
     213      and <application>Binutils</application> executables are taken
     214      from the just installed <application>GNAT</application> package, but the
     215      versions of those executables are outdated compared to those installed in
     216      LFS. This is not important for the <application>GCC</application> compilers,
     217      since they recompile themselves during the bootstrap process. On the other
     218      hand, the outdated <command>ld</command> and <command>as</command> tools
     219      are used all along. In order to use the LFS tools, issue as the
     220      <systemitem class="username">root</systemitem> user:
     221    </para>
    180222
    181223<screen role="root"><userinput>find /opt/gnat -name ld -exec mv -v {} {}.old \;
     
    186228  <sect2 role="installation">
    187229    <title>Installation of GCC Ada</title>
    188 <!--
    189     <para>As in LFS, fix a problem identified upstream:</para>
    190 
    191 <screen><userinput>sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
    192 -->
    193 
    194     <para>Install <application>GCC Ada</application> by running the
    195     following commands:</para>
    196 
    197 <screen><userinput><!--
    198 patch -Np1 -i ../gcc-&gcc-version;-upstream_fixes-1.patch &amp;&amp;
    199 -->mkdir ../gcc-build &amp;&amp;
     230
     231    <para>
     232      As in LFS, fix a problem identified upstream with the libgomp library:
     233    </para>
     234
     235<screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-upstream_libgomp_fix-1.patch</userinput></screen>
     236
     237    <para>
     238      Install <application>GCC Ada</application> by running the
     239      following commands:
     240    </para>
     241
     242<screen><userinput>mkdir ../gcc-build &amp;&amp;
    200243cd    ../gcc-build &amp;&amp;
    201244
    202245../gcc-&gcc-version;/configure          \
    203246    --prefix=/usr               \
    204     --libdir=/usr/lib           \
    205     --enable-shared             \
    206     --enable-threads=posix      \
    207     --enable-__cxa_atexit       \
    208     --enable-clocale=gnu        \
    209247    --disable-multilib          \
    210248    --with-system-zlib          \
     
    212250make</userinput></screen>
    213251
    214     <para>If you have installed additional packages such as
    215     <application>Valgrind</application> and <application>GDB</application>,
    216     the <application>GCC</application> part of the testsuite will run more
    217     tests than in LFS. Some of those will report FAIL and others XPASS
    218     (pass when expected to FAIL). To run the tests, issue:</para>
     252    <para>
     253      If you have installed additional packages such as
     254      <application>Valgrind</application> and <application>GDB</application>,
     255      the <application>GCC</application> part of the testsuite will run more
     256      tests than in LFS. Some of those will report FAIL and others XPASS
     257      (pass when expected to FAIL). To run the tests, issue:
     258    </para>
    219259
    220260<screen><userinput>ulimit -s 32768 &amp;&amp;
     
    223263to be run. -->
    224264
    225     <para>The tests are very long, and the results may be hard to find in the
    226     logs, specially if you use parallel jobs with make. You can get a summary
    227     of the tests with:</para>
     265    <para>
     266      The tests are very long, and the results may be hard to find in the
     267      logs, specially if you use parallel jobs with make. You can get a summary
     268      of the tests with:
     269    </para>
    228270
    229271<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
    230272
    231     <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
     273    <para>
     274      Now, as the <systemitem class="username">root</systemitem> user:
     275    </para>
    232276
    233277<screen role="root"><userinput>make install &amp;&amp;
     
    240284    /usr/lib/gcc/*linux-gnu/&gcc-version;/ada{lib,include}</userinput></screen>
    241285
    242     <para>You should now remove the <application>GNAT</application>
    243     installation and perform other cleanups:</para>
    244 
    245 <screen><userinput>rm -rf /opt/gnat &amp;&amp;
    246 export PATH=$PATH_HOLD &amp;&amp;
     286    <para>
     287      You should now remove the <application>GNAT</application>
     288      installation and perform other cleanups. First, as the <systemitem
     289      class="username">root</systemitem> user:
     290    </para>
     291
     292<screen role="root"><userinput>rm -rf /opt/gnat</userinput></screen>
     293
     294    <para>
     295      Then, as a normal user:
     296    </para>
     297
     298<screen><userinput>export PATH=$PATH_HOLD &amp;&amp;
    247299unset PATH_HOLD</userinput></screen>
    248300
     
    251303  <sect2 role="commands">
    252304    <title>Command Explanations</title>
    253 <!--
    254     <para>
    255       <command>patch ... gcc-&gcc-version;-upstream_fixes-1.patch</command>:
    256       This patch corrects bugs in the C++ compiler, which lead to
    257       segmentation faults in some cases.
    258     </para>
    259 -->
    260 
    261     <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
    262     <application>GCC</application> documentation recommends
    263     building the package in a dedicated build directory.</para>
    264 
    265     <para><parameter>--enable-shared --enable-threads=posix
    266     --enable-__cxa_atexit</parameter>: These parameters are required to build
    267     the <application>C++</application> libraries to published standards.</para>
    268 
    269     <para><parameter>--enable-clocale=gnu</parameter>: This parameter is a
    270     failsafe for incomplete locale data.</para>
    271 
    272     <para><parameter>--disable-multilib</parameter>: This parameter ensures
    273     that files are created for the specific architecture of your computer.</para>
     305
     306    <para>
     307      <command>mkdir ../gcc-build; cd ../gcc-build</command>: The
     308      <application>GCC</application> documentation recommends
     309      building the package in a dedicated build directory.
     310    </para>
     311
     312    <para>
     313      <parameter>--disable-multilib</parameter>: This parameter ensures
     314      that files are created for the specific architecture of your computer.
     315    </para>
    274316
    275317    <para>
     
    288330    </para>
    289331
    290     <para><command>ulimit -s 32768</command>: This command prevents several
    291     tests from running out of stack space.</para>
    292 
    293     <para><command>make -k check</command>: This command runs the test suite
    294     without stopping if any errors are encountered.</para>
    295 
    296     <para><command>../gcc-&gcc-version;/contrib/test_summary</command>: This
    297     command will produce a summary of the test suite results. You can append
    298     <command>| grep -A7 Summ</command> to the command to produce an even more
    299     condensed version of the summary. You may also wish to redirect the output
    300     to a file for review and comparison later on.</para>
    301 
    302     <para><command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
    303     If the package is built by a user other than root, the ownership of the
    304     installed <filename class="directory">include</filename> and
    305     <filename class="directory">adalib</filename> directories (and their
    306     contents) will be incorrect. These commands change the ownership to the
    307     <systemitem class="username">root</systemitem> user and group.</para>
     332    <para>
     333      <option>--with-default-libstdcxx-abi=c++98</option>: Use this switch if you
     334      are building <application>GNAT</application> tools using a
     335      <application>GCC</application> version prior to 5.1.0,
     336      and you do not want to recompile all the libraries written in C++.
     337    </para>
     338
     339    <para>
     340      <command>ulimit -s 32768</command>: This command prevents several
     341      tests from running out of stack space.
     342    </para>
     343
     344    <para>
     345      <command>make -k check</command>: This command runs the test suite
     346      without stopping if any errors are encountered.
     347    </para>
     348
     349    <para>
     350      <command>../gcc-&gcc-version;/contrib/test_summary</command>: This
     351      command will produce a summary of the test suite results. You can append
     352      <command>| grep -A7 Summ</command> to the command to produce an even more
     353      condensed version of the summary. You may also wish to redirect the output
     354      to a file for review and comparison later on.
     355    </para>
     356
     357    <para>
     358      <command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
     359      If the package is built by a user other than root, the ownership of the
     360      installed <filename class="directory">include</filename> and
     361      <filename class="directory">adalib</filename> directories (and their
     362      contents) will be incorrect. These commands change the ownership to the
     363      <systemitem class="username">root</systemitem> user and group.
     364    </para>
    308365
    309366  </sect2>
     
    320377        <seg>
    321378          gnat, gnatbind, gnatchop, gnatclean, gnatfind, gnatkr,
    322           gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref,
    323           and a run-time executable, gnat1, in <filename class="directory">
    324           /usr/libexec/&lt;arch-triplet&gt;/&gcc-version;</filename>
     379          gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref
    325380        </seg>
    326381        <seg>
     
    334389    </segmentedlist>
    335390
    336     <para>Only the Ada specific files are listed here. Others can be found at
    337     <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
    338     initially installed during the building of LFS.</para>
     391    <para>
     392      Only the Ada specific files are listed here. Others can be found at
     393      <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
     394      initially installed during the building of LFS.
     395    </para>
    339396
    340397    <variablelist>
     
    346403        <term><command>gnat</command></term>
    347404        <listitem>
    348           <para>is a wrapper that accepts a number of commands and calls
    349           the corresponding tool from the list below.</para>
     405          <para>
     406            is a wrapper that accepts a number of commands and calls
     407            the corresponding tool from the list below.
     408          </para>
    350409          <indexterm zone="gcc-ada gnat">
    351410            <primary sortas="b-gnat">gnat</primary>
     
    357416        <term><command>gnatbind</command></term>
    358417        <listitem>
    359           <para>is used to bind compiled objects.</para>
     418          <para>
     419            is used to bind compiled objects.
     420          </para>
    360421          <indexterm zone="gcc-ada gnatbind">
    361422            <primary sortas="b-gnatbind">gnatbind</primary>
     
    367428        <term><command>gnatchop</command></term>
    368429        <listitem>
    369           <para>is useful for renaming files to meet the standard
    370           <application>Ada</application> default file naming conventions.</para>
     430          <para>
     431            is useful for renaming files to meet the standard
     432            <application>Ada</application> default file naming conventions.
     433          </para>
    371434          <indexterm zone="gcc-ada gnatchop">
    372435            <primary sortas="b-gnatchop">gnatchop</primary>
     
    378441        <term><command>gnatclean</command></term>
    379442        <listitem>
    380           <para>is used to remove files associated with a
    381           <application>GNAT</application> project.</para>
     443          <para>
     444            is used to remove files associated with a
     445            <application>GNAT</application> project.
     446          </para>
    382447          <indexterm zone="gcc-ada gnatclean">
    383448            <primary sortas="b-gnatclean">gnatclean</primary>
     
    389454        <term><command>gnatfind</command></term>
    390455        <listitem>
    391           <para> is intended for locating definition and/or references to
    392           specified entities in a <application>GNAT</application> project.</para>
     456          <para>
     457            is intended for locating definition and/or references to
     458            specified entities in a <application>GNAT</application> project.
     459          </para>
    393460          <indexterm zone="gcc-ada gnatfind">
    394461            <primary sortas="b-gnatfind">gnatfind</primary>
     
    400467        <term><command>gnatkr</command></term>
    401468        <listitem>
    402           <para>is used to determine the crunched name for a given file, when
    403           crunched to a specified maximum length.</para>
     469          <para>
     470            is used to determine the crunched name for a given file, when
     471            crunched to a specified maximum length.
     472          </para>
    404473          <indexterm zone="gcc-ada gnatkr">
    405474            <primary sortas="b-gnatkr">gnatkr</primary>
     
    411480        <term><command>gnatlink</command></term>
    412481        <listitem>
    413           <para>is used to link programs and build an executable file.</para>
     482          <para>
     483            is used to link programs and build an executable file.
     484          </para>
    414485          <indexterm zone="gcc-ada gnatlink">
    415486            <primary sortas="b-gnatlink">gnatlink</primary>
     
    421492        <term><command>gnatls</command></term>
    422493        <listitem>
    423           <para>is the compiled unit browser.</para>
     494          <para>
     495            is the compiled unit browser.
     496          </para>
    424497          <indexterm zone="gcc-ada gnatls">
    425498            <primary sortas="b-gnatls">gnatls</primary>
     
    431504        <term><command>gnatmake</command></term>
    432505        <listitem>
    433           <para>is the <application>Ada</application> compiler, which performs
    434           compilaton, binding and linking.</para>
     506          <para>
     507            is the <application>Ada</application> compiler, which performs
     508            compilaton, binding and linking.
     509          </para>
    435510          <indexterm zone="gcc-ada gnatmake">
    436511            <primary sortas="b-gnatmake">gnatmake</primary>
     
    442517        <term><command>gnatname</command></term>
    443518        <listitem>
    444           <para>will list the files associated with a
    445           <application>GNAT</application> project.</para>
     519          <para>
     520            will list the files associated with a
     521            <application>GNAT</application> project.
     522          </para>
    446523          <indexterm zone="gcc-ada gnatname">
    447524            <primary sortas="b-gnatname">gnatname</primary>
     
    453530        <term><command>gnatprep</command></term>
    454531        <listitem>
    455           <para>is the <application>GNAT</application> external
    456           preprocessor.</para>
     532          <para>
     533            is the <application>GNAT</application> external preprocessor.
     534          </para>
    457535          <indexterm zone="gcc-ada gnatprep">
    458536            <primary sortas="b-gnatprep">gnatprep</primary>
     
    464542        <term><command>gnatxref</command></term>
    465543        <listitem>
    466           <para>is similar to <command>gnatfind</command>, but generates
    467           a full report of all cross-references.</para>
     544          <para>
     545            is similar to <command>gnatfind</command>, but generates
     546            a full report of all cross-references.
     547          </para>
    468548          <indexterm zone="gcc-ada gnatxref">
    469549            <primary sortas="b-gnatxref">gnatxref</primary>
  • general/prog/gcc-java.xml

    rb39a80c rae0673a  
    55  %general-entities;
    66
    7   <!ENTITY gcc-java-download-http  "http://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
     7  <!ENTITY gcc-java-download-http  "https://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
    88  <!ENTITY gcc-java-download-ftp   "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
    9   <!ENTITY gcc-java-md5sum         "4df8ee253b7f3863ad0b86359cd39c43">
    10   <!ENTITY gcc-java-size           "86 MB">
    11   <!ENTITY gcc-java-buildsize      "3.0 GB">
    12   <!ENTITY gcc-java-time           "84 SBU (including 70 SBU for tests)">
     9  <!ENTITY gcc-java-md5sum         "d5525b1127d07d215960e6051c5da35e">
     10  <!ENTITY gcc-java-size           "91 MB">
     11  <!ENTITY gcc-java-buildsize      "4.1 GB">
     12  <!ENTITY gcc-java-time           "78 SBU (including 65 SBU for tests)">
    1313
    1414  <!ENTITY ecj-download-ftp    "ftp://sourceware.org/pub/java/ecj-latest.jar">
    1515
    16   <!ENTITY antlr-version       "4.2.2">
     16  <!ENTITY antlr-version       "4.5">
    1717  <!ENTITY antlr-download-http "http://www.antlr.org/download/antlr-&antlr-version;-complete.jar">
    1818]>
     
    2929
    3030  <indexterm zone="gcc">
    31     <primary sortas="a-gcc-java-4-0">GCC-Java-&gcc-version;</primary>
     31    <primary sortas="a-gcc-java-5-0">GCC-Java-&gcc-version;</primary>
    3232  </indexterm>
    3333
     
    3535    <title>Introduction to GCC-Java</title>
    3636
    37     <para>See the introduction to the Java language and system at
    38     <xref linkend="java"/>. The GNU Compiler Collection (GCC) contains
    39     a Java compiler to native code. Together with the
    40     <application>ecj</application> Java compiler from Eclipse (to bytecode),
    41     it provides a way to build an acceptable JVM from source. However, since
    42     the release of <application>OpenJDK</application>, the development
    43     of GCC-Java has almost stopped, and the built JVM is an old version.
    44     One reason to build
    45     this system is that it can be used to bootstrap <xref linkend="openjdk"/>,
    46     without the need for downloading a Java binary.</para>
     37    <para>
     38      See the introduction to the Java language and system at
     39      <xref linkend="java"/>. The GNU Compiler Collection (GCC) contains
     40      a Java compiler to native code. Together with the
     41      <application>ecj</application> Java compiler from Eclipse (to bytecode),
     42      it provides a way to build an acceptable JVM from source. However, since
     43      the release of <application>OpenJDK</application>, the development
     44      of GCC-Java has almost stopped, and the built JVM is an old version,
     45      which cannot be used for building <xref linkend="openjdk"/>.
     46    </para>
    4747
    4848    &lfs77_checked;
    4949
    5050    <caution>
    51       <para>Using the instructions on this page will have the effect that
    52       the C and C++ compiler and libraries will be reinstalled, overwriting
    53       the ones on your system. This may lead to some issues. Please read the
    54       note and caution on the <xref linkend="gcc"/> page.</para>
     51      <para>
     52        Using the instructions on this page will have the effect that
     53        the C and C++ compiler and libraries will be reinstalled, overwriting
     54        the ones on your system. This may lead to some issues. Please read the
     55        note and caution on the <xref linkend="gcc"/> page.
     56      </para>
    5557    </caution>
    5658
     
    5860    <itemizedlist spacing="compact">
    5961      <listitem>
    60         <para>Download (HTTP): <ulink url="&gcc-java-download-http;"/></para>
    61       </listitem>
    62       <listitem>
    63         <para>Download (FTP): <ulink url="&gcc-java-download-ftp;"/></para>
    64       </listitem>
    65       <listitem>
    66         <para>Download MD5 sum: &gcc-java-md5sum;</para>
    67       </listitem>
    68       <listitem>
    69         <para>Download size: &gcc-java-size;</para>
    70       </listitem>
    71       <listitem>
    72         <para>Estimated disk space required: &gcc-java-buildsize;</para>
    73       </listitem>
    74       <listitem>
    75         <para>Estimated build time: &gcc-java-time;</para>
     62        <para>
     63          Download (HTTP): <ulink url="&gcc-java-download-http;"/>
     64        </para>
     65      </listitem>
     66      <listitem>
     67        <para>
     68          Download (FTP): <ulink url="&gcc-java-download-ftp;"/>
     69        </para>
     70      </listitem>
     71      <listitem>
     72        <para>
     73          Download MD5 sum: &gcc-java-md5sum;
     74        </para>
     75      </listitem>
     76      <listitem>
     77        <para>
     78          Download size: &gcc-java-size;
     79        </para>
     80      </listitem>
     81      <listitem>
     82        <para>
     83          Estimated disk space required: &gcc-java-buildsize;
     84        </para>
     85      </listitem>
     86      <listitem>
     87        <para>
     88          Estimated build time: &gcc-java-time;
     89        </para>
    7690      </listitem>
    7791    </itemizedlist>
     
    8195      <listitem>
    8296        <para>
    83           Eclipse Java compiler:
    84           <ulink url="&ecj-download-ftp;"/>
     97          Eclipse Java compiler: <ulink url="&ecj-download-ftp;"/>
    8598        </para>
    8699      </listitem>
     
    91104        </para>
    92105      </listitem>
    93 <!--      <listitem>
     106      <listitem>
    94107        <para>
    95108          Required patch:
    96           <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
    97         </para>
    98       </listitem>-->
     109          <ulink url="&patch-root;/gcc-&gcc-version;-upstream_libgomp_fix-1.patch"/>
     110        </para>
     111      </listitem>
    99112    </itemizedlist>
    100113
    101     <bridgehead renderas="sect3">GCC Dependencies</bridgehead>
     114    <bridgehead renderas="sect3">GCC Java Dependencies</bridgehead>
    102115
    103116    <bridgehead renderas="sect4">Required</bridgehead>
    104117    <para role="required">
    105       <xref linkend="zip"/>,
    106       <xref linkend="unzip"/>, and
    107       <xref linkend="which"/>
     118      <xref linkend="unzip"/>,
     119      <xref linkend="which"/>, and
     120      <xref linkend="zip"/>
    108121    </para>
    109122
     
    129142    <title>Installation of GCC Java</title>
    130143
    131     <para>The instructions below assume that the C and C++ compilers have
    132     the same version as the one you are installing, so that a
    133     <quote>bootstrap</quote> is not necessary. If you are upgrading
    134     the GCC version, then remove the <option>--disable-bootstrap</option> from
    135     the <command>./configure</command> options below.</para>
    136 <!--
    137     <para>As in LFS, fix a problem identified upstream:</para>
    138 
    139 <screen><userinput>sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
    140 -->
    141 
    142     <para>Install <application>GCC Java</application> by running the
    143     following commands:</para>
     144    <para>
     145      The instructions below assume that the C and C++ compilers have
     146      the same version as the one you are installing, so that a
     147      <quote>bootstrap</quote> is not necessary. If you are upgrading
     148      the GCC version, then remove the <option>--disable-bootstrap</option> from
     149      the <command>./configure</command> options below.
     150    </para>
     151
     152    <para>
     153      As in LFS, fix a problem identified upstream with the libgomp library:
     154    </para>
     155
     156<screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-upstream_libgomp_fix-1.patch</userinput></screen>
     157
     158    <para>
     159      Install <application>GCC Java</application> by running the
     160      following commands:
     161    </para>
    144162
    145163<screen><userinput>sed -i 's/\(install.*:\) install-.*recursive/\1/' libffi/Makefile.in         &amp;&amp;
    146164sed -i 's/\(install-data-am:\).*/\1/'             libffi/include/Makefile.in &amp;&amp;
    147 <!--
    148 patch -Np1 -i ../gcc-&gcc-version;-upstream_fixes-1.patch &amp;&amp;
    149 -->
    150165
    151166cp ../ecj-latest.jar ./ecj.jar &amp;&amp;
     
    156171../gcc-&gcc-version;/configure           \
    157172    --prefix=/usr                \
    158     --libdir=/usr/lib            \
    159     --enable-shared              \
    160     --enable-threads=posix       \
    161     --enable-__cxa_atexit        \
    162     --enable-clocale=gnu         \
    163173    --disable-multilib           \
    164174    --with-system-zlib           \
     
    170180make</userinput></screen>
    171181
    172     <para>If you have installed additional packages such as
    173     <application>Valgrind</application> and <application>GDB</application>,
    174     the <application>GCC</application> part of the testsuite will run more
    175     tests than in LFS. Some of those will report FAIL and others XPASS
    176     (pass when expected to FAIL). To run the tests, issue:</para>
     182    <para>
     183      If you have installed additional packages such as
     184      <application>Valgrind</application> and <application>GDB</application>,
     185      the <application>GCC</application> part of the testsuite will run more
     186      tests than in LFS. Some of those will report FAIL and others XPASS
     187      (pass when expected to FAIL). To run the tests, issue:
     188    </para>
    177189
    178190<screen><userinput>ulimit -s 32768 &amp;&amp;
     
    181193to be run. -->
    182194
    183     <para>The tests are very long, and the results may be hard to find in the
    184     logs, specially if you use job control with make. You can get a summary
    185     of the tests with:</para>
     195    <para>
     196      The tests are very long, and the results may be hard to find in the
     197      logs, specially if you use job control with make. You can get a summary
     198      of the tests with:
     199    </para>
    186200
    187201<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
    188202
    189     <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
     203    <para>
     204      Now, as the <systemitem class="username">root</systemitem> user:
     205    </para>
    190206
    191207<screen role="root"><userinput>make install &amp;&amp;
     
    207223    <title>Command Explanations</title>
    208224
    209     <para>The two <command>sed</command> commands prevent the
    210     installation of the <application>libffi</application> library bundled
    211     with <application>GCC</application>, since it is outdated compared to
    212     <xref linkend="libffi"/>.</para>
    213 <!--
    214     <para>
    215       <command>patch ... gcc-&gcc-version;-upstream_fixes-1.patch</command>:
    216       This patch corrects bugs in the C++ compiler, which lead to
    217       segmentation faults in some cases.
    218     </para>
    219 -->
    220 
    221     <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
    222     <application>GCC</application> documentation recommends
    223     building the package in a dedicated build directory.</para>
    224 
    225     <para><parameter>--enable-shared --enable-threads=posix
    226     --enable-__cxa_atexit</parameter>: These parameters are required to build
    227     the <application>C++</application> libraries to published standards.</para>
    228 
    229     <para><parameter>--enable-clocale=gnu</parameter>: This parameter is a
    230     failsafe for incomplete locale data.</para>
    231 
    232     <para><parameter>--disable-multilib</parameter>: This parameter ensures
    233     that files are created for the specific architecture of your computer.</para>
     225    <para>
     226      The two <command>sed</command> commands prevent the
     227      installation of the <application>libffi</application> library bundled
     228      with <application>GCC</application>, since it is outdated compared to
     229      <xref linkend="libffi"/>.
     230    </para>
     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>
    234242
    235243    <para>
     
    262270
    263271    <para>
    264     <parameter>--enable-languages=java</parameter>:
    265     This command identifies which language to build. Note it is unavoidable
    266     that the <application>C</application> and <application>C++</application>
    267     compilers be built too.</para>
     272      <parameter>--enable-languages=java</parameter>:
     273      This command identifies which language to build. Note it is unavoidable
     274      that the <application>C</application> and <application>C++</application>
     275      compilers be built too.
     276    </para>
    268277
    269278    <para>
     
    273282    </para>
    274283
    275     <para><command>ulimit -s 32768</command>: This command prevents several
    276     tests from running out of stack space.</para>
    277 
    278     <para><command>make -k check</command>: This command runs the test suite
    279     without stopping if any errors are encountered.</para>
    280 
    281     <para><command>../gcc-&gcc-version;/contrib/test_summary</command>: This
    282     command will produce a summary of the test suite results. You can append
    283     <command>| grep -A7 Summ</command> to the command to produce an even more
    284     condensed version of the summary. You may also wish to redirect the output
    285     to a file for review and comparison later on.</para>
    286 
    287     <para><command>chown -v -R root:root
    288     /usr/lib/gcc/*linux-gnu/...</command>:
    289     If the package is built by a user other than root, the ownership of the
    290     installed <filename class="directory">include</filename> directory (and its
    291     content) will be incorrect. This commands changes the ownership to the
    292     <systemitem class="username">root</systemitem> user and group.</para>
     284    <para>
     285      <command>ulimit -s 32768</command>: This command prevents several
     286      tests from running out of stack space.
     287    </para>
     288
     289    <para>
     290      <command>make -k check</command>: This command runs the test suite
     291      without stopping if any errors are encountered.
     292    </para>
     293
     294    <para>
     295      <command>../gcc-&gcc-version;/contrib/test_summary</command>: This
     296      command will produce a summary of the test suite results. You can append
     297      <command>| grep -A7 Summ</command> to the command to produce an even more
     298      condensed version of the summary. You may also wish to redirect the output
     299      to a file for review and comparison later on.
     300    </para>
     301
     302    <para>
     303      <command>chown -v -R root:root
     304      /usr/lib/gcc/*linux-gnu/...</command>:
     305      If the package is built by a user other than root, the ownership of the
     306      installed <filename class="directory">include</filename> directory (and its
     307      content) will be incorrect. This commands changes the ownership to the
     308      <systemitem class="username">root</systemitem> user and group.
     309    </para>
    293310
    294311    <para>
     
    307324
    308325      <para>
    309         The configuration is the same as for <xref linkend="openjdk"/>,
     326        The configuration is the same as <xref linkend="ojdk-conf"/>,
    310327        replacing <filename class="directory">/opt/jdk</filename> with
    311328        <filename class="directory">/opt/gcj</filename>.
     
    341358        <seg>
    342359          /usr/include/c++/&gcc-version;/{gcj,gnu,java,javax,org,sun},
    343           /usr/lib/gcj-&gcc-version;-15,
    344           /usr/lib/security, /opt/gcj/{bin,jre,include,lib} and
    345           /usr/share/java
     360          /usr/lib/gcj-&gcc-version;-16, /usr/lib/jvm-exports,
     361          /usr/lib/security, /opt/gcj and /usr/share/java
    346362        </seg>
    347363      </seglistitem>
    348364    </segmentedlist>
    349365
    350     <para>Some program and library names and descriptions are not listed here,
    351     but can be found at
    352     <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
    353     initially installed during the building of LFS.</para>
     366    <para>
     367      Some program and library names and descriptions are not listed here,
     368      but can be found at
     369      <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
     370      initially installed during the building of LFS.
     371    </para>
    354372
    355373    <variablelist>
     
    361379        <term><command>aot-compile</command></term>
    362380        <listitem>
    363           <para>searches a directory for Java bytecode and uses
    364           <command>gcj</command> to compile it to native code.</para>
     381          <para>
     382            searches a directory for Java bytecode and uses
     383            <command>gcj</command> to compile it to native code.
     384          </para>
    365385          <indexterm zone="gcc aot-compile">
    366386            <primary sortas="b-aot-compile">aot-compile</primary>
     
    372392        <term><command>ecj</command></term>
    373393        <listitem>
    374           <para>is the eclipse compiler.</para>
     394          <para>
     395            is the eclipse compiler.
     396          </para>
    375397          <indexterm zone="gcc ecj">
    376398            <primary sortas="b-ecj">ecj</primary>
     
    382404        <term><command>gappletviewer</command></term>
    383405        <listitem>
    384           <para>loads and run a <application>Java</application> applet.</para>
     406          <para>
     407            loads and run a <application>Java</application> applet.
     408          </para>
    385409          <indexterm zone="gcc gappletviewer">
    386410            <primary sortas="b-gappletviewer">gappletviewer</primary>
     
    392416        <term><command>gc-analyze</command></term>
    393417        <listitem>
    394           <para>analyzes garbage collector (GC) memory dumps from
    395           <application>Java</application> code.</para>
     418          <para>
     419            analyzes garbage collector (GC) memory dumps from
     420            <application>Java</application> code.
     421          </para>
    396422          <indexterm zone="gcc gc-analyze">
    397423            <primary sortas="b-gc-analyze">gc-analyze</primary>
     
    403429        <term><command>gcj</command></term>
    404430        <listitem>
    405           <para>is an ahead-of-time compiler for the
    406           <application>Java</application> language.</para>
     431          <para>
     432            is an ahead-of-time compiler for the <application>Java</application>
     433            language.
     434          </para>
    407435          <indexterm zone="gcc gcj">
    408436            <primary sortas="b-gcj">gcj</primary>
     
    414442        <term><command>gcj-dbtool</command></term>
    415443        <listitem>
    416           <para>is a tool for creating and manipulating class file mapping
    417           databases.</para>
     444          <para>
     445            is a tool for creating and manipulating class file mapping databases.
     446          </para>
    418447          <indexterm zone="gcc gcj-dbtool">
    419448            <primary sortas="b-gcj-dbtool">gcj-dbtool</primary>
     
    425454        <term><command>gcjh</command></term>
    426455        <listitem>
    427           <para>generates header files from <application>Java</application>
    428           class files.</para>
     456          <para>
     457            generates header files from <application>Java</application> class files.
     458          </para>
    429459          <indexterm zone="gcc gcjh">
    430460            <primary sortas="b-gcjh">gcjh</primary>
     
    436466        <term><command>gij</command></term>
    437467        <listitem>
    438           <para>is the GNU interpreter for <application>Java</application>
    439           bytecode.</para>
     468          <para>
     469            is the GNU interpreter for <application>Java</application> bytecode.
     470          </para>
    440471          <indexterm zone="gcc gij">
    441472            <primary sortas="b-gij">gij</primary>
     
    447478        <term><command>gjar</command></term>
    448479        <listitem>
    449           <para>is an (partial) implementation of the <command>jar</command>
    450           utility that comes with Sun's JDK.</para>
     480          <para>
     481            is an (partial) implementation of the <command>jar</command>
     482            utility that comes with Sun's JDK.
     483          </para>
    451484          <indexterm zone="gcc gjar">
    452485            <primary sortas="b-gjar">gjar</primary>
     
    458491        <term><command>gjarsigner</command></term>
    459492        <listitem>
    460           <para>is a Java ARchive (JAR) file signing and verification
    461           tool.</para>
     493          <para>
     494            is a Java ARchive (JAR) file signing and verification tool.
     495          </para>
    462496          <indexterm zone="gcc gjarsigner">
    463497            <primary sortas="b-gjarsigner">gjarsigner</primary>
     
    469503        <term><command>gjavah</command></term>
    470504        <listitem>
    471           <para>generates header files from Java class files.</para>
     505          <para>
     506            generates header files from Java class files.
     507          </para>
    472508          <indexterm zone="gcc gjavah">
    473509            <primary sortas="b-gjavah">gjavah</primary>
     
    479515        <term><command>gjdoc</command></term>
    480516        <listitem>
    481           <para>is a documentation tool similar to <command>javadoc</command>.
     517          <para>
     518            is a documentation tool similar to <command>javadoc</command>.
    482519          </para>
    483520          <indexterm zone="gcc gjdoc">
     
    490527        <term><command>gkeytool</command></term>
    491528        <listitem>
    492           <para>manages private keys and public certificates in a
    493           <application>Java</application> environment.</para>
     529          <para>
     530            manages private keys and public certificates in a
     531            <application>Java</application> environment.
     532          </para>
    494533          <indexterm zone="gcc gkeytool">
    495534            <primary sortas="b-gkeytool">gkeytool</primary>
     
    501540        <term><command>gnative2ascii</command></term>
    502541        <listitem>
    503           <para>is an encoding converter for <application>Java</application>.</para>
     542          <para>
     543            is an encoding converter for <application>Java</application>.
     544          </para>
    504545          <indexterm zone="gcc gnative2ascii">
    505546            <primary sortas="b-gnative2ascii">gnative2ascii</primary>
     
    511552        <term><command>gorbd</command></term>
    512553        <listitem>
    513           <para>is an object request broker daemon.</para>
     554          <para>
     555            is an object request broker daemon.
     556          </para>
    514557          <indexterm zone="gcc gorbd">
    515558            <primary sortas="b-gorbd">gorbd</primary>
     
    521564        <term><command>grmic</command></term>
    522565        <listitem>
    523           <para>generates stubs for Remote Method Invocation.</para>
     566          <para>
     567            generates stubs for Remote Method Invocation.
     568          </para>
    524569          <indexterm zone="gcc grmic-gcc">
    525570            <primary sortas="b-grmic">grmic</primary>
     
    531576        <term><command>grmid</command></term>
    532577        <listitem>
    533           <para>RMI activation system daemon.</para>
     578          <para>
     579            RMI activation system daemon.
     580          </para>
    534581          <indexterm zone="gcc grmid-gcc">
    535582            <primary sortas="b-grmid">grmid</primary>
     
    541588        <term><command>grmiregistry</command></term>
    542589        <listitem>
    543           <para> starts a remote object registry on the current host.</para>
     590          <para>
     591            starts a remote object registry on the current host.
     592          </para>
    544593          <indexterm zone="gcc grmiregistry-gcc">
    545594            <primary sortas="b-grmiregistry">grmiregistry</primary>
     
    551600        <term><command>gserialver</command></term>
    552601        <listitem>
    553           <para> prints the serialVersionUID of the specified class.</para>
     602          <para>
     603            prints the serialVersionUID of the specified class.
     604          </para>
    554605          <indexterm zone="gcc gserialver">
    555606            <primary sortas="b-gserialver">gserialver</primary>
     
    561612        <term><command>gtnameserv</command></term>
    562613        <listitem>
    563           <para> starts a naming service.</para>
     614          <para>
     615            starts a naming service.
     616          </para>
    564617          <indexterm zone="gcc gtnameserv">
    565618            <primary sortas="b-gtnameserv">gtnameserv</primary>
     
    571624        <term><command>jcf-dump</command></term>
    572625        <listitem>
    573           <para>prints information about <application>Java</application>
    574           class files.</para>
     626          <para>
     627            prints information about <application>Java</application>
     628            class files.
     629          </para>
    575630          <indexterm zone="gcc jcf-dump">
    576631            <primary sortas="b-jcf-dump">jcf-dump</primary>
     
    582637        <term><command>jv-convert</command></term>
    583638        <listitem>
    584           <para>converts files from one encoding to another.</para>
     639          <para>
     640            converts files from one encoding to another.
     641          </para>
    585642          <indexterm zone="gcc jv-convert">
    586643            <primary sortas="b-jv-convert">jv-convert</primary>
     
    592649        <term><command>rebuild-gcj-db</command></term>
    593650        <listitem>
    594           <para>Merge the per-solib databases made by
    595           <application>aot-compile</application> into one system-wide
    596           database.</para>
     651          <para>
     652            Merge the per-solib databases made by
     653            <application>aot-compile</application> into one system-wide
     654            database.
     655          </para>
    597656          <indexterm zone="gcc rebuild-gcj-db">
    598657            <primary sortas="b-rebuild-gcj-db">rebuild-gcj-db</primary>
  • 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>
  • general/prog/prog.xml

    rb39a80c rae0673a  
    3434  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expect.xml"/>
    3535  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc.xml"/>
     36  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-java.xml"/>
    3637  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-ada.xml"/>
    37   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-java.xml"/>
    3838  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gc.xml"/>
    3939  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gdb.xml"/>
Note: See TracChangeset for help on using the changeset viewer.