<html>
<head>
<title>Building egcs </title>
</head>
<body>
<h1 align="center">Building egcs</h1>

<p>Now that egcs is configured, you are ready to build the compiler and
runtime libraries.

<p>We <b>highly</b> recommend that egcs be built using gnu-make; other
versions may work, then again they might not.  To be safe build with gnu-make.

<p><b>Building a native compiler</b>
<p>For a native build issue the command "make bootstrap".  This will build
the entire egcs compiler system, which includes the following steps:

<ul>
  <li> Build host tools necessary to build the compiler such as texinfo, bison,
  gperf.<p>

  <li> Build target tools for use by the compiler such as gas, gld, and
  binutils if they have been properly unpacked into the egcs source tree.<p>

  <li> Perform a 3-stage bootstrap of the compiler.<p>

  <li> Perform a comparison test of the stage2 and stage3 compilers.<p>

  <li> Build runtime libraries using the stage3 compiler from the previous
  step.<p>
</ul>

<p>If you are short on disk space you might consider "make bootstrap-lean"
instead.  This is identical to "make bootstrap" except that object files
from the stage1 and stage2 of the 3-stage bootstrap of the compiler are
deleted as soon as they are no longer needed.

<p>If you want to save additional space during the bootstrap and in
the final installation as well, you can build the compiler binaries
without debugging information with "make CFLAGS='-O' LIBCFLAGS='-g
-O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap".  This will save
roughly 40% of disk space both for the bootstrap and the final installation.
(Libraries will still contain debugging information.)

<p>If you used the flag <tt>--enable-languages=...</tt> to restrict
the compilers to be built, only those you've actually enabled will be
built. This will of course only build those runtime libraries, for
which the particular compiler has been built.  Please note,
that re-defining LANGUAGES when calling <tt>make bootstrap</tt>
<b>*does not*</b> work anymore!

<p><b>Building a cross compiler</b>

<p> We recommend reading the
<a href="ftp://ftp.cygnus.com/pub/embedded/crossgcc/FAQ">
crossgcc FAQ</a> for information about building cross compilers.

<p>For a cross build, issue the command "make cross", which performs the
following steps:
<ul>
  <li> Build host tools necessary to build the compiler such as texinfo, bison,
  gperf.<p>

  <li> Build target tools for use by the compiler such as gas, gld, and
  binutils if they have been properly unpacked into the egcs source tree.<p>

  <li> Build the compiler (single stage only).<p>

  <li> Build runtime libraries using the compiler from the previous
  step.<p>
</ul>

<p>Note that if an error occurs in any step the make process will exit.

<p>
<hr>
<i>Last modified on Dec  6, 1998.</i>

<!--#include virtual="/glimpsebox.html"-->
</body>
</html>
