Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (22 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28dir.info
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/INSTALL/build.html

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    1 <html lang="en"><head>
     1   <html lang="en">
     2<head>
    23<title>Installing GCC: Building</title>
    34<meta http-equiv="Content-Type" content="text/html">
    4 <meta name=description content="Installing GCC: Building">
    5 <meta name=generator content="makeinfo 4.0">
    6 <link href="http://texinfo.org/" rel=generator-home>
    7 </head><body>
    8 
    9 <p>N<p>ow that GCC is configured, you are ready to build the compiler and
     5<meta name="description" content="Installing GCC: Building">
     6<meta name="generator" content="makeinfo 4.6">
     7<!--
     8Copyright &copy; 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
     91999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
     10<br><p>
     11   <p>Permission is granted to copy, distribute and/or modify this document
     12under the terms of the GNU Free Documentation License, Version 1.2 or
     13any later version published by the Free Software Foundation; with no
     14Invariant Sections, the Front-Cover texts being (a) (see below), and
     15with the Back-Cover Texts being (b) (see below).  A copy of the
     16license is included in the section entitled "<a href="./gfdl.html">GNU Free Documentation License</a>".
     17
     18   <p>(a) The FSF's Front-Cover Text is:
     19
     20   <p>A GNU Manual
     21
     22   <p>(b) The FSF's Back-Cover Text is:
     23
     24   <p>You have freedom to copy and modify this GNU Manual, like GNU
     25     software.  Copies published by the Free Software Foundation raise
     26     funds for GNU development.-->
     27<meta http-equiv="Content-Style-Type" content="text/css">
     28<style type="text/css"><!--
     29  pre.display { font-family:inherit }
     30  pre.format  { font-family:inherit }
     31  pre.smalldisplay { font-family:inherit; font-size:smaller }
     32  pre.smallformat  { font-family:inherit; font-size:smaller }
     33  pre.smallexample { font-size:smaller }
     34  pre.smalllisp    { font-size:smaller }
     35--></style>
     36</head>
     37<body>
     38<h1 class="settitle">Installing GCC: Building</h1>
     39Now that GCC is configured, you are ready to build the compiler and
    1040runtime libraries.
    1141
    12 <p>We <strong>highly</strong> recommend that GCC be built using GNU make;
     42   <p>We <strong>highly</strong> recommend that GCC be built using GNU make;
    1343other versions may work, then again they might not.
    1444GNU make is required for compiling GNAT (the Ada compiler) and the Java
    1545runtime library.
    1646
    17 <p>(For example, many broken versions of make will fail if you use the
     47   <p>(For example, many broken versions of make will fail if you use the
    1848recommended setup where <var>objdir</var> is different from <var>srcdir</var>.
    1949Other broken versions may recompile parts of the compiler when
    2050installing the compiler.)
    2151
    22 <p>Some commands executed when making the compiler may fail (return a
     52   <p>Some commands executed when making the compiler may fail (return a
    2353nonzero status) and be ignored by <code>make</code>.  These failures, which
    2454are often due to files that were not found, are expected, and can safely
    2555be ignored.
    2656
    27 <p>It is normal to have compiler warnings when compiling certain files.
     57   <p>It is normal to have compiler warnings when compiling certain files.
    2858Unless you are a GCC developer, you can generally ignore these warnings
    2959unless they cause compilation to fail.
    3060
    31 <p>On certain old systems, defining certain environment variables such as
     61   <p>On certain old systems, defining certain environment variables such as
    3262<code>CC</code> can interfere with the functioning of <code>make</code>.
    3363
    34 <p>If you encounter seemingly strange errors when trying to build the
     64   <p>If you encounter seemingly strange errors when trying to build the
    3565compiler in a directory other than the source directory, it could be
    3666because you have previously configured the compiler in the source
    3767directory.  Make sure you have done all the necessary preparations.
    3868
    39 <p>If you build GCC on a BSD system using a directory stored in an old System
     69   <p>If you build GCC on a BSD system using a directory stored in an old System
    4070V file system, problems may occur in running <code>fixincludes</code> if the
    4171System V file system doesn't support symbolic links.  These problems
     
    4474that type mismatches occur, this could be the cause.
    4575
    46 <p>The solution is not to use such a directory for building GCC.
    47 
    48 <p>When building from CVS or snapshots, or if you modify parser sources,
     76   <p>The solution is not to use such a directory for building GCC.
     77
     78   <p>When building from CVS or snapshots, or if you modify parser sources,
    4979you need the Bison parser generator installed.  Any version 1.25 or
    5080later should work; older versions may also work.  If you do not modify
     
    5282not need Bison installed to build them.
    5383
    54 <p>When building from CVS or snapshots, or if you modify Texinfo
    55 documentation, you need version 4.1 or later of Texinfo installed if you
     84   <p>When building from CVS or snapshots, or if you modify Texinfo
     85documentation, you need version 4.2 or later of Texinfo installed if you
    5686want Info documentation to be regenerated.  Releases contain Info
    5787documentation pre-built for the unmodified documentation in the release.
    5888
    59 <h2><a name="TOC0">Building a native compiler</h2>
     89<h3 class="section"><a name="TOC0"></a>Building a native compiler</h3>
    6090
    6191<p>For a native build issue the command <code>make bootstrap</code>.  This
    6292will build the entire GCC system, which includes the following steps:
    6393
    64 <ul>
     94     <ul>
    6595<li>Build host tools necessary to build the compiler such as texinfo, bison,
    6696gperf.
    6797
    68 <li>Build target tools for use by the compiler such as binutils (bfd,
     98     <li>Build target tools for use by the compiler such as binutils (bfd,
    6999binutils, gas, gprof, ld, and opcodes)
    70100if they have been individually linked
    71101or moved into the top level GCC source tree before configuring.
    72102
    73 <li>Perform a 3-stage bootstrap of the compiler.
    74 
    75 <li>Perform a comparison test of the stage2 and stage3 compilers.
    76 
    77 <li>Build runtime libraries using the stage3 compiler from the previous step.
    78 
    79 </ul>
    80 
    81 <p>If you are short on disk space you might consider <code>make
     103     <li>Perform a 3-stage bootstrap of the compiler.
     104
     105     <li>Perform a comparison test of the stage2 and stage3 compilers.
     106
     107     <li>Build runtime libraries using the stage3 compiler from the previous step.
     108
     109   </ul>
     110
     111   <p>If you are short on disk space you might consider <code>make
    82112bootstrap-lean</code> instead.  This is identical to <code>make
    83113bootstrap</code> except that object files from the stage1 and
     
    85115soon as they are no longer needed.
    86116
    87 <p>If you want to save additional space during the bootstrap and in
     117   <p>If you want to save additional space during the bootstrap and in
    88118the final installation as well, you can build the compiler binaries
    89119without debugging information as in the following example.  This will save
     
    91121(Libraries will still contain debugging information.)
    92122
    93 <pre>     make CFLAGS='-O' LIBCFLAGS='-g -O2' \
    94        LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap
    95 </pre>
    96 
    97 <p>If you wish to use non-default GCC flags when compiling the stage2 and
     123<pre class="example">          make CFLAGS='-O' LIBCFLAGS='-g -O2' \
     124            LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap
     125     </pre>
     126
     127   <p>If you wish to use non-default GCC flags when compiling the stage2 and
    98128stage3 compilers, set <code>BOOT_CFLAGS</code> on the command line when doing
    99129<code>make bootstrap</code>.  Non-default optimization flags are less well
     
    106136bootstrap4</code> to increase the number of stages of bootstrap.
    107137
    108 <p>If you used the flag <code>--enable-languages=<small>...</small></code> to restrict
     138   <p>If you used the flag <code>--enable-languages=...</code> to restrict
    109139the compilers to be built, only those you've actually enabled will be
    110140built.  This will of course only build those runtime libraries, for
     
    113143<strong>does not</strong> work anymore!
    114144
    115 <p>If the comparison of stage2 and stage3 fails, this normally indicates
     145   <p>If the comparison of stage2 and stage3 fails, this normally indicates
    116146that the stage2 compiler has compiled GCC incorrectly, and is therefore
    117147a potentially serious bug which you should investigate and report.  (On
     
    120150need to disable comparison in the <code>Makefile</code>.)
    121151
    122 <h2><a name="TOC1">Building a cross compiler</h2>
     152<h3 class="section"><a name="TOC1"></a>Building a cross compiler</h3>
    123153
    124154<p>We recommend reading the
     
    126156for information about building cross compilers.
    127157
    128 <p>When building a cross compiler, it is not generally possible to do a
     158   <p>When building a cross compiler, it is not generally possible to do a
    1291593-stage bootstrap of the compiler.  This makes for an interesting problem
    130160as parts of GCC can only be built with GCC.
    131161
    132 <p>To build a cross compiler, we first recommend building and installing a
     162   <p>To build a cross compiler, we first recommend building and installing a
    133163native compiler.  You can then use the native GCC compiler to build the
    134164cross compiler.  The installed native compiler needs to be GCC version
    1351652.95 or later.
    136166
    137 <p>Assuming you have already installed a native copy of GCC and configured
     167   <p>Assuming you have already installed a native copy of GCC and configured
    138168your cross compiler, issue the command <code>make</code>, which performs the
    139169following steps:
    140170
    141 <ul>
     171     <ul>
    142172<li>Build host tools necessary to build the compiler such as texinfo, bison,
    143173gperf.
    144174
    145 <li>Build target tools for use by the compiler such as binutils (bfd,
     175     <li>Build target tools for use by the compiler such as binutils (bfd,
    146176binutils, gas, gprof, ld, and opcodes)
    147177if they have been individually linked or moved into the top level GCC source
    148178tree before configuring.
    149179
    150 <li>Build the compiler (single stage only).
    151 
    152 <li>Build runtime libraries using the compiler from the previous step.
     180     <li>Build the compiler (single stage only).
     181
     182     <li>Build runtime libraries using the compiler from the previous step.
    153183</ul>
    154184
    155 <p>Note that if an error occurs in any step the make process will exit.
    156 
    157 <h2><a name="TOC2">Building in parallel</h2>
    158 
    159 <p>If you have a multiprocessor system you can use <code>make bootstrap
    160 MAKE="make -j 2" -j 2</code> or just <code>make -j 2 bootstrap</code>
    161 for GNU Make 3.79 and above instead of just <code>make bootstrap</code>
    162 when building GCC.  You can use a bigger number instead of two if
    163 you like.  In most cases, it won't help to use a number bigger than
    164 the number of processors in your machine.
    165 
    166 <h2><a name="TOC3">Building the Ada compiler</h2>
     185   <p>Note that if an error occurs in any step the make process will exit.
     186
     187<h3 class="section"><a name="TOC2"></a>Building in parallel</h3>
     188
     189<p>You can use <code>make bootstrap MAKE="make -j 2" -j 2</code>, or just
     190<code>make -j 2 bootstrap</code> for GNU Make 3.79 and above, instead of
     191<code>make bootstrap</code> to build GCC in parallel.
     192You can also specify a bigger number, and in most cases using a value
     193greater than the number of processors in your machine will result in
     194fewer and shorter I/O latency hits, thus improving overall throughput;
     195this is especially true for slow drives and network filesystems.
     196
     197<h3 class="section"><a name="TOC3"></a>Building the Ada compiler</h3>
    167198
    168199<p>In order to build GNAT, the Ada compiler, you need a working GNAT
     
    171202GNAT-specific extensions), and GNU make.
    172203
    173 <p>However, you do not need a full installation of GNAT, just the GNAT
     204   <p>However, you do not need a full installation of GNAT, just the GNAT
    174205binary <code>gnat1</code>, a copy of <code>gnatbind</code>, and a compiler driver
    175206which can deal with Ada input (by invoking the <code>gnat1</code> binary).
     
    184215used to disable building the Ada front end.
    185216
    186 <p>Additional build tools (such as <code>gnatmake</code>) or a working GNAT
     217   <p>Additional build tools (such as <code>gnatmake</code>) or a working GNAT
    187218run-time library installation are usually <em>not</em> required.  However,
    188219if you want to bootstrap the compiler using a minimal version of GNAT,
     
    191222source distribution):
    192223
    193 <pre>    cd <var>srcdir</var>/gcc/ada
    194     touch treeprs.ads [es]info.h nmake.ad[bs]
    195 </pre>
    196 
    197 <p>At the moment, the GNAT library and several tools for GNAT are not built
     224<pre class="example">         cd <var>srcdir</var>/gcc/ada
     225         touch treeprs.ads [es]info.h nmake.ad[bs]
     226     </pre>
     227
     228   <p>At the moment, the GNAT library and several tools for GNAT are not built
    198229by <code>make bootstrap</code>.  You have to invoke
    199 <code>make gnatlib_and_tools</code> in the <code><var>objdir</var>/gcc</code>
     230<code>make gnatlib_and_tools</code> in the <code></code><var>objdir</var><code>/gcc</code>
    200231subdirectory before proceeding with the next steps.
    201232
    202 <p>For example, you can build a native Ada compiler by issuing the
     233   <p>For example, you can build a native Ada compiler by issuing the
    203234following commands (assuming <code>make</code> is GNU make):
    204235
    205 <pre>    cd <var>objdir</var>
    206     <var>srcdir</var>/configure --enable-languages=c,ada
    207     cd <var>srcdir</var>/gcc/ada
    208     touch treeprs.ads [es]info.h nmake.ad[bs]
    209     cd <var>objdir</var>
    210     make bootstrap
    211     cd gcc
    212     make gnatlib_and_tools
    213     cd ..
    214 </pre>
    215 
    216 <p>Currently, when compiling the Ada front end, you cannot use the parallel
     236<pre class="example">         cd <var>objdir</var>
     237         <var>srcdir</var>/configure --enable-languages=c,ada
     238         cd <var>srcdir</var>/gcc/ada
     239         touch treeprs.ads [es]info.h nmake.ad[bs]
     240         cd <var>objdir</var>
     241         make bootstrap
     242         cd gcc
     243         make gnatlib_and_tools
     244         cd ..
     245     </pre>
     246
     247   <p>Currently, when compiling the Ada front end, you cannot use the parallel
    217248build feature described in the previous section.
    218249
    219 <hr />
     250   <hr />
    220251<p>
    221252<a href="./index.html">Return to the GCC Installation page</a>
    222253
    223 </body></html>
    224 
     254   </body></html>
     255
Note: See TracChangeset for help on using the changeset viewer.