Ignore:
Timestamp:
02/10/2013 08:46:59 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
49f0ce04
Parents:
dc6bfb82
Message:

Added GNAT and Go build instructions to GCC page thanks to Pierre Labastie.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • general/prog/gcc.xml

    rdc6bfb82 r034eda7  
    99  <!ENTITY gcc-md5sum         "cc308a0891e778cfda7a151ab8a6e762">
    1010  <!ENTITY gcc-size           "80 MB">
    11   <!ENTITY gcc-buildsize      "~3.5 GB (build, test and install all compilers)">
    12   <!ENTITY gcc-time           "126 SBU (build, test and install all compilers)">
     11  <!ENTITY gcc-buildsize      "~6.1 GB (build, test and install all compilers)">
     12  <!ENTITY gcc-time           "150 SBU (build, test and install all compilers)">
    1313
    1414  <!ENTITY gnat-download-http "https://libre.adacore.com/download/">
     
    3737    <para>The <application>GCC</application> package contains GNU compilers.
    3838    This package is useful for compiling programs written in C, C++, Fortran,
    39     Java, Objective C, and Objective C++. You should ensure you actually
    40     need one of these additional compilers (C and C++ are installed in LFS)
    41     before you install them. Additionally, there are instructions in the BLFS
    42     book to install <xref linkend="openjdk"/>, which can be used instead of
    43     the Java provided by the <application>GCC</application> package. Many
    44     consider the Iced Tea version to be a more robust Java environment than the
    45     one provided by <application>GCC</application>.</para>
     39    Java, Objective C, Objective C++, Ada, and Go. You should ensure you
     40    actually need one of these additional compilers (C and C++ are installed
     41    in LFS) before you install them. Additionally, there are instructions in
     42    the BLFS book to install <xref linkend="openjdk"/>, which can be used
     43    instead of the Java provided by the <application>GCC</application> package.
     44    Many consider the Iced Tea version to be a more robust Java environment
     45    than the one provided by <application>GCC</application>.</para>
    4646
    4747    &lfs72_checked;
     
    8989    <para role="recommended"><xref linkend="dejagnu"/></para>
    9090
     91    <bridgehead renderas="sect4">Required if building java</bridgehead>
     92    <para role="required">
     93      <xref linkend="zip"/>,
     94      <xref linkend="unzip"/>, and
     95      <xref linkend="which"/>
     96    </para>
     97
    9198    <note>
    92       <para>Building Ada from source is no longer supported by BLFS.  The
    93       upstream binary package is based on gcc-4.5.4 and is not suitable
    94       for building Ada from the current <application>GCC</application>
    95       package.</para>
     99      <para>If you plan to compile Ada, you will need to install
     100      <application>GNAT</application> temporarily to satisfy the circular
     101      dependency when you recompile <application>GCC</application>
     102      to include Ada. At the AdaCore download page, choose your platform and
     103      2011, then select the file to download. You probably want the x86-linux
     104      or x86_64-linux file.</para>
    96105    </note>
    97 <!--
    98     <bridgehead renderas="sect3">GNAT GPL 2012 Package Information</bridgehead>
     106<!-- Using 2011, because 2012 does not compile GCC-4.7.2 -->
     107    <bridgehead renderas="sect3">GNAT GPL 2011 Package Information</bridgehead>
    99108    <itemizedlist spacing="compact">
    100109      <listitem>
     
    102111      </listitem>
    103112    </itemizedlist>
    104 -->
     113
    105114    <para condition="html" role="usernotes">User Notes:
    106115    <ulink url="&blfs-wiki;/gcc"/></para>
    107116
    108117  </sect2>
    109 <!--
     118
    110119  <sect2 role="installation">
    111120    <title>Installation of GNAT</title>
    112121
    113     <para>Before unpacking and changing into the GCC build directory, first
     122    <para>Before unpacking and changing into the GCC source directory, first
    114123    unpack the <application>GNAT</application> tarball and change into the
    115124    newly created directory and install <application>GNAT</application> by
     
    127136
    128137<screen><userinput>cd .. &amp;&amp;
    129 rm -rf gnat-2010-i686-gnu-linux-libc2.3-bin</userinput></screen>
     138rm -rf gnat-2011-*</userinput></screen>
    130139
    131140    <para>Prepare to compile <application>GCC</application> by placing the
     
    137146export PATH=<replaceable>&lt;Your build directory&gt;</replaceable>/gnat/bin:$PATH_HOLD</userinput></screen>
    138147
     148    <para>Doing so has the drawback that the <application>GCC</application>
     149    and <application>Binutils</application> executables are taken
     150    from the just installed <application>GNAT</application> package, but the
     151    versions of those executables are outdated compared to those installed in
     152    LFS. This is not important for the <application>GCC</application> compilers,
     153    since they recompile themselves during the bootstrap process. On the other
     154    hand, the outdated <command>ld</command> and <command>as</command> tools
     155    are used all along. In order to use the LFS tools, issue:</para>
     156
     157<screen><userinput>find <replaceable>&lt;Your build directory&gt;</replaceable>/gnat -name ld -exec mv -v \{\} \{\}.old \;
     158find <replaceable>&lt;Your build directory&gt;</replaceable>/gnat -name as -exec mv -v \{\} \{\}.old \;</userinput></screen>
     159
    139160  </sect2>
    140 -->
     161
    141162  <sect2 role="installation">
    142163    <title>Installation of GCC</title>
     
    149170      <para>The installation process may overwrite your existing
    150171      <application>GCC</application> <command>gcc</command> and
    151       <command>c++</command> compilers and libraries. Having the the
     172      <command>c++</command> compilers and libraries. Having the
    152173      <application>Tcl</application>, <application>Expect</application> and
    153174      <application>DejaGnu</application> packages installed before beginning
     
    165186    </important>
    166187
    167     <para>The instructions below perform a <quote><command>make
    168     bootstrap</command></quote> instead of just a plain
    169     <quote><command>make</command></quote> intentionally. Even though it is
    170     assumed that the current version of <application>GCC</application> is
    171     installed in LFS, a bootstrap is recommended for robustness.  </para>
    172 
    173 <screen><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &amp;&amp;
     188    <para>The instructions below let the build machinery perform a
     189    <quote>bootstrap</quote> intentionally. This is necessary if you
     190    install the <application>ADA</application> compiler anyway. Even
     191    if you don't, a bootstrap is recommended for robustness.</para>
     192
     193<screen><userinput>sed -i 's/\(install.*:\) install-.*recursive/\1/' libffi/Makefile.in &amp;&amp;
     194sed -i 's/\(install-data-am:\).*/\1/' libffi/include/Makefile.in &amp;&amp;
     195sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &amp;&amp;
    174196sed -i 's@\./fixinc\.sh@-c true@'        gcc/Makefile.in       &amp;&amp;
    175197
     
    183205../gcc-&gcc-version;/configure         \
    184206    --prefix=/usr              \
     207    --libdir=/usr/lib          \
    185208    --libexecdir=/usr/lib      \
    186209    --with-system-zlib         \
     
    189212    --enable-__cxa_atexit      \
    190213    --disable-multilib         \
    191     --enable-bootstrap         \
    192214    --enable-clocale=gnu       \
    193     --enable-languages=c,c++,fortran,java,objc,obj-c++ &amp;&amp;
    194 
    195 make bootstrap &amp;&amp;
     215    --enable-lto               \
     216    --enable-languages=c,c++,fortran,ada,go,java,objc,obj-c++ &amp;&amp;
     217
     218make &amp;&amp;
    196219make -k check  &amp;&amp;
    197220
     
    203226
    204227ln -v -sf ../usr/bin/cpp /lib &amp;&amp;
    205 ln -v -sf gcc /usr/bin/cc </userinput></screen>
    206 
    207 <!--
     228ln -v -sf gcc /usr/bin/cc &amp;&amp;
     229
    208230chown -v -R root:root \
    209     /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include \
    210     /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/ada{lib,include}</userinput></screen>
    211 -->
     231    /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed} \
     232    /usr/lib/gcc/*linux-gnu/&gcc-version;/ada{lib,include}</userinput></screen>
     233<!-- Not needed since we do not install libffi
    212234    <para>The <filename class='libraryfile'>libffi</filename> interface header
    213235    is installed in a location where other packages will not be able to find
     
    216238    remedy this:</para>
    217239
    218 <screen role="root"><userinput>ln -v -sf `find /usr/lib/gcc -name ffitarget.h` /usr/include</userinput></screen>
    219 
    220 <!--
     240<screen role="root"><userinput>ln -v -sf `find /usr/lib/gcc -name ffitarget.h` /usr/include</userinput></screen>-->
     241
    221242    <para>You should now become the unprivileged user and remove the
    222243    <application>GNAT</application> installation and perform other
    223244    cleanups:</para>
    224245
    225 <screen><userinput>rm -rf <replaceable>&lt;Your build directory&gt;</replaceable>/gnat</userinput></screen>
    226 
    227 <screen><userinput>export PATH=$PATH_HOLD &amp;&amp;
     246<screen><userinput>rm -rf <replaceable>&lt;Your build directory&gt;</replaceable>/gnat &amp;&amp;
     247export PATH=$PATH_HOLD &amp;&amp;
    228248unset PATH_HOLD</userinput></screen>
    229 -->
     249
    230250  </sect2>
    231251
     
    233253    <title>Command Explanations</title>
    234254
    235     <para>The three <command>sed</command> commands are the same ones used
    236     during the build of LFS.</para>
     255    <para>The first two <command>sed</command> commands prevent the
     256    installation of the <application>libffi</application> library bundled
     257    with <application>GCC</application>, since it is outdated compared to
     258    <xref linkend="libffi"/>. The three other <command>sed</command> commands
     259    are the same ones used during the build of LFS.</para>
    237260
    238261    <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
     
    247270    that files are created for the specific architecture of your computer.</para>
    248271
    249     <para><parameter>--enable-bootstrap</parameter>: This parameter is used
     272<!-- Double dashes are forbidden in comments, so use "- -". Change it to
     273     double dash if you ever remove this comment!
     274    <para><parameter>- -enable-bootstrap</parameter>: This parameter is used
    250275    so that a bootstrap installation is performed.</para>
    251 
     276-->
    252277    <para><parameter>--enable-clocale=gnu</parameter>: This parameter is a
    253278    failsafe for incomplete locale data.</para>
    254279
     280    <para><parameter>--enable-lto</parameter>: Setting this parameter allows
     281    to build a compiler which is able to perform <quote>link time
     282    optimization (lto)</quote>.</para>
     283
    255284    <para>
    256     <parameter>--enable-languages=c,c++,fortran,java,objc,obj-c++</parameter>:
    257     This command identifies which languages to build. You may modify this command
    258     to remove undesired languages.</para>
     285    <parameter>--enable-languages=c,c++,fortran,java,objc,obj-c++,ada,go</parameter>:
     286    This command identifies which languages to build. You may modify
     287    this command to remove undesired languages.</para>
    259288
    260289    <para><command>make -k check</command>: This command runs the test suite
     
    274303    <para><command>ln -v -sf gcc /usr/bin/cc</command>: This link is created as
    275304    some packages refer to the C compiler using an alternate name.</para>
    276 <!--
     305
    277306    <para><command>chown -v -R root:root
    278     /usr/lib/gcc/i686-pc-linux-gnu/...</command>:
     307    /usr/lib/gcc/*linux-gnu/...</command>:
    279308    If the package is built by a user other than root, the ownership of the
    280309    installed <filename class='directory'>include</filename> and
     
    284313    command changing the Ada directories if you did not include Ada as one of
    285314    the installed languages.</para>
    286 -->
     315
    287316  </sect2>
    288317
     
    296325
    297326      <seglistitem>
    298         <seg>addr2name.awk, fastjar, gcj, gcj-dbtool,gcjh, gfortran, gij,
    299         gjnih, gprmake,
    300         grepjar, grmic, grmiregistry, gtreelang, jcf-dump, jv-convert, jv-scan
    301         and architecture specific names for gcj and gcjh</seg>
    302         <seg>libffi.{so,a}, libgcj.{so,a}, libgfortran.{so,a},
    303         libgfortranbegin.a, libgij.{so,a}, libobjc.{so,a} and numerous other
     327        <seg>aot-compile, gappletviewer, gc-analyze, gccgo, gcj, gcj-dbtool,
     328        gcjh, gfortran, gij, gjar, gjarsigner, gjavah, gkeytool,
     329        gnat, gnatbind, gnatchop, gnatclean, gnatfind, gnative2ascii, gnatkr,
     330        gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref, gorbd,
     331        grmic, grmid, grmiregistry, gserialver, gtnameserv, jcf-dump,
     332        jv-convert, rebuild-gcj-db, and architecture specific names</seg>
     333        <seg>libgcj_bc.so, libgcj.so, libgcj-tools.so, libgfortran.{so,a},
     334        libgij.so, libgo.{so,a}, libgobegin.a, libobjc.{so,a} and numerous other
    304335        run-time libraries and executables in /usr/lib/gcc</seg>
    305         <seg>/usr/include/c++/&gcc-version;/{gcj,gnu,java,javax,org},
    306         /usr/lib/gcj-&gcc-version;,
     336        <seg>/usr/include/c++/&gcc-version;/{gcj,gnu,java,javax,org,sun},
     337        /usr/lib/gcc/&lt;arch-model&gt;-linux-gnu/&gcc-version;/ada{include,lib},
     338        /usr/lib/gcj-&gcc-version;-13,
     339        /usr/lib/go,
    307340        /usr/lib/security,
    308341        and /usr/share/java</seg>
     
    320353      <?dbhtml list-presentation="table"?>
    321354
    322       <varlistentry id="addr2name.awk">
    323         <term><command>addr2name.awk</command></term>
    324         <listitem>
    325           <para> emulates some of the functionality of addr2line.</para>
    326           <indexterm zone="gcc addr2name.awk">
    327             <primary sortas="b-addr2name.awk">addr2name.awk</primary>
    328           </indexterm>
    329         </listitem>
    330       </varlistentry>
    331 
    332       <varlistentry id="fastjar-gcc">
    333         <term><command>fastjar</command></term>
    334         <listitem>
    335           <para>is an archive tool for <application>Java</application> archives.</para>
    336           <indexterm zone="gcc fastjar-gcc">
    337             <primary sortas="b-fastjar">fastjar</primary>
     355      <varlistentry id="aot-compile">
     356        <term><command>aot-compile</command></term>
     357        <listitem>
     358          <para>searches a directory for Java bytecode and uses
     359          <command>gcj</command> to compile it to native code.</para>
     360          <indexterm zone="gcc aot-compile">
     361            <primary sortas="b-aot-compile">aot-compile</primary>
     362          </indexterm>
     363        </listitem>
     364      </varlistentry>
     365
     366      <varlistentry id="gappletviewer">
     367        <term><command>gappletviewer</command></term>
     368        <listitem>
     369          <para>loads and run a <application>Java</application> applet.</para>
     370          <indexterm zone="gcc gappletviewer">
     371            <primary sortas="b-gappletviewer">gappletviewer</primary>
     372          </indexterm>
     373        </listitem>
     374      </varlistentry>
     375
     376      <varlistentry id="gc-analyze">
     377        <term><command>gc-analyze</command></term>
     378        <listitem>
     379          <para>analyzes garbage collector (GC) memory dumps from
     380          <application>Java</application> code.</para>
     381          <indexterm zone="gcc gc-analyze">
     382            <primary sortas="b-gc-analyze">gc-analyze</primary>
     383          </indexterm>
     384        </listitem>
     385      </varlistentry>
     386
     387      <varlistentry id="gccgo">
     388        <term><command>gccgo</command></term>
     389        <listitem>
     390          <para>is a GCC-based compiler for the
     391          <application>Go</application> language.</para>
     392          <indexterm zone="gcc gccgo">
     393            <primary sortas="b-gccgo">gccgo</primary>
    338394          </indexterm>
    339395        </listitem>
     
    395451      </varlistentry>
    396452
    397       <varlistentry id="gjnih">
    398         <term><command>gjnij</command></term>
    399         <listitem>
    400           <para>is used to generate JNI header files from class files. Running
    401           it is equivalent to running <command>gcjh -jni</command>.</para>
    402           <indexterm zone="gcc gjnih">
    403             <primary sortas="b-gjnih">gjnih</primary>
    404           </indexterm>
    405         </listitem>
    406       </varlistentry>
    407 <!--
     453      <varlistentry id="gjar">
     454        <term><command>gjar</command></term>
     455        <listitem>
     456          <para>is an (partial) implementation of the <command>jar</command>
     457          utility that comes with Sun's JDK.</para>
     458          <indexterm zone="gcc gjar">
     459            <primary sortas="b-gjar">gjar</primary>
     460          </indexterm>
     461        </listitem>
     462      </varlistentry>
     463
     464      <varlistentry id="gjarsigner">
     465        <term><command>gjarsigner</command></term>
     466        <listitem>
     467          <para>is a Java ARchive (JAR) file signing and verification
     468          tool.</para>
     469          <indexterm zone="gcc gjarsigner">
     470            <primary sortas="b-gjarsigner">gjarsigner</primary>
     471          </indexterm>
     472        </listitem>
     473      </varlistentry>
     474
     475      <varlistentry id="gjavah">
     476        <term><command>gjavah</command></term>
     477        <listitem>
     478          <para>generates header files from Java class files.</para>
     479          <indexterm zone="gcc gjavah">
     480            <primary sortas="b-gjavah">gjavah</primary>
     481          </indexterm>
     482        </listitem>
     483      </varlistentry>
     484
     485      <varlistentry id="gkeytool">
     486        <term><command>gkeytool</command></term>
     487        <listitem>
     488          <para>manages private keys and public certificates in a
     489          <application>Java</application> environment.</para>
     490          <indexterm zone="gcc gkeytool">
     491            <primary sortas="b-gkeytool">gkeytool</primary>
     492          </indexterm>
     493        </listitem>
     494      </varlistentry>
     495
    408496      <varlistentry id="gnat">
    409497        <term><command>gnat</command></term>
     
    427515      </varlistentry>
    428516
    429       <varlistentry id="gnatbl">
    430         <term><command>gnatbl</command></term>
    431         <listitem>
    432           <para>is the <application>Ada</application> linker.</para>
    433           <indexterm zone="gcc gnatbl">
    434             <primary sortas="b-gnatbl">gnatbl</primary>
    435           </indexterm>
    436         </listitem>
    437       </varlistentry>
    438 
    439517      <varlistentry id="gnatchop">
    440518        <term><command>gnatchop</command></term>
     
    469547      </varlistentry>
    470548
     549      <varlistentry id="gnative2ascii">
     550        <term><command>gnative2ascii</command></term>
     551        <listitem>
     552          <para>is an encoding converter for <application>Java</application>.</para>
     553          <indexterm zone="gcc gnative2ascii">
     554            <primary sortas="b-gnative2ascii">gnative2ascii</primary>
     555          </indexterm>
     556        </listitem>
     557      </varlistentry>
     558
    471559      <varlistentry id="gnatkr">
    472560        <term><command>gnatkr</command></term>
     
    540628        </listitem>
    541629      </varlistentry>
    542 -->
    543       <varlistentry id="gprmake">
    544         <term><command>gprmake</command></term>
    545         <listitem>
    546           <para>is a tool used to create <filename>Makefile</filename>s that
    547           support compilation by multiple languages.</para>
    548           <indexterm zone="gcc gprmake">
    549             <primary sortas="b-gprmake">gprmake</primary>
    550           </indexterm>
    551         </listitem>
    552       </varlistentry>
    553 
    554       <varlistentry id="grepjar">
    555         <term><command>grepjar</command></term>
    556         <listitem>
    557           <para>searches <filename>jar</filename> files for a pattern.</para>
    558           <indexterm zone="gcc grepjar">
    559             <primary sortas="b-grepjar">grepjar</primary>
     630
     631      <varlistentry id="gorbd">
     632        <term><command>gorbd</command></term>
     633        <listitem>
     634          <para>is an object request broker daemon.</para>
     635          <indexterm zone="gcc gorbd">
     636            <primary sortas="b-gorbd">gorbd</primary>
    560637          </indexterm>
    561638        </listitem>
     
    572649      </varlistentry>
    573650
     651      <varlistentry id="grmid-gcc">
     652        <term><command>grmid</command></term>
     653        <listitem>
     654          <para>RMI activation system daemon.</para>
     655          <indexterm zone="gcc grmid-gcc">
     656            <primary sortas="b-grmid">grmid</primary>
     657          </indexterm>
     658        </listitem>
     659      </varlistentry>
     660
    574661      <varlistentry id="grmiregistry-gcc">
    575662        <term><command>grmiregistry</command></term>
     
    582669      </varlistentry>
    583670
    584       <varlistentry id="gtreelang">
    585         <term><command>gtreelang</command></term>
    586         <listitem>
    587           <para>is largely a cut down version of C, designed to showcase the
    588           features of the <application>GCC</application> code generation back
    589           end. Only those features that are directly supported by the
    590           <application>GCC</application> code generation back end are
    591           implemented. Features are implemented in a manner which is easiest
    592           and clearest to implement. Not all or even most code generation back
    593           end features are implemented. The intention is to add features
    594           incrementally until most features of the
    595           <application>GCC</application> back end are implemented in
    596           Treelang.</para>
    597           <indexterm zone="gcc gtreelang">
    598             <primary sortas="b-gtreelang">gtreelang</primary>
     671      <varlistentry id="gserialver">
     672        <term><command>gserialver</command></term>
     673        <listitem>
     674          <para> prints the serialVersionUID of the specified class.</para>
     675          <indexterm zone="gcc gserialver">
     676            <primary sortas="b-gserialver">gserialver</primary>
     677          </indexterm>
     678        </listitem>
     679      </varlistentry>
     680
     681      <varlistentry id="gtnameserv">
     682        <term><command>gtnameserv</command></term>
     683        <listitem>
     684          <para> starts a naming service.</para>
     685          <indexterm zone="gcc gtnameserv">
     686            <primary sortas="b-gtnameserv">gtnameserv</primary>
    599687          </indexterm>
    600688        </listitem>
     
    622710      </varlistentry>
    623711
    624       <varlistentry id="jv-scan">
    625         <term><command>jv-scan</command></term>
    626         <listitem>
    627           <para>prints information about <application>Java</application>
    628           source files.</para>
    629           <indexterm zone="gcc jv-scan">
    630             <primary sortas="b-jv-scan">jv-scan</primary>
     712      <varlistentry id="rebuild-gcj-db">
     713        <term><command>rebuild-gcj-db</command></term>
     714        <listitem>
     715          <para>Merge the per-solib databases made by
     716          <application>aot-compile</application> into one system-wide
     717          database.</para>
     718          <indexterm zone="gcc rebuild-gcj-db">
     719            <primary sortas="b-rebuild-gcj-db">rebuild-gcj-db</primary>
    631720          </indexterm>
    632721        </listitem>
Note: See TracChangeset for help on using the changeset viewer.