2015-08-28 15:33:40 +00:00
< html lang = "en" >
< head >
< title > Prerequisites for GCC< / title >
< meta http-equiv = "Content-Type" content = "text/html" >
< meta name = "description" content = "Prerequisites for GCC" >
< meta name = "generator" content = "makeinfo 4.12" >
< link title = "Top" rel = "top" href = "#Top" >
< link href = "http://www.gnu.org/software/texinfo/" rel = "generator-home" title = "Texinfo Homepage" >
<!--
Copyright (C) 1988-2015 Free Software Foundation, Inc.
2012-03-27 23:13:14 +00:00
2015-08-28 15:33:40 +00:00
Permission is granted to copy, distribute and/or modify this document
2012-03-27 23:13:14 +00:00
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, the Front-Cover texts being (a) (see below), and
with the Back-Cover Texts being (b) (see below). A copy of the
2015-08-28 15:33:40 +00:00
license is included in the section entitled "GNU Free Documentation License".
2012-03-27 23:13:14 +00:00
(a) The FSF's Front-Cover Text is:
2015-08-28 15:33:40 +00:00
A GNU Manual
2012-03-27 23:13:14 +00:00
(b) The FSF's Back-Cover Text is:
2015-08-28 15:33:40 +00:00
You have freedom to copy and modify this GNU Manual, like GNU
2012-03-27 23:13:14 +00:00
software. Copies published by the Free Software Foundation raise
2015-08-28 15:33:40 +00:00
funds for GNU development.-->
< meta http-equiv = "Content-Style-Type" content = "text/css" >
< style type = "text/css" > < ! - -
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
-->< / style >
2012-03-27 23:13:14 +00:00
< / head >
2015-08-28 15:33:40 +00:00
< body >
< h1 class = "settitle" > Prerequisites for GCC< / h1 >
< a name = "index-Prerequisites-1" > < / a >
GCC requires that various tools and packages be available for use in the
2014-09-21 17:33:12 +00:00
build procedure. Modifying GCC sources requires additional tools
described below.
2015-08-28 15:33:40 +00:00
< h3 class = "heading" > < a name = "TOC0" > < / a > Tools/packages necessary for building GCC< / h3 >
< dl >
< dt > ISO C++98 compiler< dd > Necessary to bootstrap GCC, although versions of GCC prior
2014-09-21 17:33:12 +00:00
to 4.8 also allow bootstrapping with a ISO C89 compiler and versions
of GCC prior to 3.4 also allow bootstrapping with a traditional
(K& R) C compiler.
2015-08-28 15:33:40 +00:00
< p > To build all languages in a cross-compiler or other configuration where
2012-03-27 23:13:14 +00:00
3-stage bootstrap is not performed, you need to start with an existing
2014-09-21 17:33:12 +00:00
GCC binary (version 3.4 or later) because source code for language
2012-03-27 23:13:14 +00:00
frontends other than C might use GCC extensions.
2015-08-28 15:33:40 +00:00
< p > Note that to bootstrap GCC with versions of GCC earlier than 3.4, you
may need to use < samp > < span class = "option" > --disable-stage1-checking< / span > < / samp > , though
2014-09-21 17:33:12 +00:00
bootstrapping the compiler with such earlier compilers is strongly
discouraged.
2015-08-28 15:33:40 +00:00
< br > < dt > C standard library and headers< dd >
In order to build GCC, the C standard library and headers must be present
2014-09-21 17:33:12 +00:00
for all target variants for which target libraries will be built (and not
only the variant of the host C++ compiler).
2015-08-28 15:33:40 +00:00
< p > This affects the popular ‘ < samp > < span class = "samp" > x86_64-unknown-linux-gnu< / span > < / samp > ’ platform (among
other multilib targets), for which 64-bit (‘ < samp > < span class = "samp" > x86_64< / span > < / samp > ’ ) and 32-bit
(‘ < samp > < span class = "samp" > i386< / span > < / samp > ’ ) libc headers are usually packaged separately. If you do a
build of a native compiler on ‘ < samp > < span class = "samp" > x86_64-unknown-linux-gnu< / span > < / samp > ’ , make sure you
2014-09-21 17:33:12 +00:00
either have the 32-bit libc developer package properly installed (the exact
name of the package depends on your distro) or you must build GCC as a
64-bit only compiler by configuring with the option
2015-08-28 15:33:40 +00:00
< samp > < span class = "option" > --disable-multilib< / span > < / samp > . Otherwise, you may encounter an error such as
‘ < samp > < span class = "samp" > fatal error: gnu/stubs-32.h: No such file< / span > < / samp > ’
< br > < dt > GNAT< dd >
In order to build the Ada compiler (GNAT) you must already have GNAT
2012-03-27 23:13:14 +00:00
installed because portions of the Ada frontend are written in Ada (with
GNAT extensions.) Refer to the Ada installation instructions for more
specific information.
2015-08-28 15:33:40 +00:00
< br > < dt > A “ working” POSIX compatible shell, or GNU bash< dd >
Necessary when running < samp > < span class = "command" > configure< / span > < / samp > because some
< samp > < span class = "command" > /bin/sh< / span > < / samp > shells have bugs and may crash when configuring the
target libraries. In other cases, < samp > < span class = "command" > /bin/sh< / span > < / samp > or < samp > < span class = "command" > ksh< / span > < / samp >
2012-03-27 23:13:14 +00:00
have disastrous corner-case performance problems. This
2015-08-28 15:33:40 +00:00
can cause target < samp > < span class = "command" > configure< / span > < / samp > runs to literally take days to
2012-03-27 23:13:14 +00:00
complete in some cases.
2015-08-28 15:33:40 +00:00
< p > So on some platforms < samp > < span class = "command" > /bin/ksh< / span > < / samp > is sufficient, on others it
isn't. See the host/target specific instructions for your platform, or
use < samp > < span class = "command" > bash< / span > < / samp > to be sure. Then set < samp > < span class = "env" > CONFIG_SHELL< / span > < / samp > in your
2012-03-27 23:13:14 +00:00
environment to your “ good” shell prior to running
2015-08-28 15:33:40 +00:00
< samp > < span class = "command" > configure< / span > < / samp > /< samp > < span class = "command" > make< / span > < / samp > .
< p > < samp > < span class = "command" > zsh< / span > < / samp > is not a fully compliant POSIX shell and will not
2012-03-27 23:13:14 +00:00
work when configuring GCC.
2015-08-28 15:33:40 +00:00
< br > < dt > A POSIX or SVR4 awk< dd >
Necessary for creating some of the generated source files for GCC.
2012-03-27 23:13:14 +00:00
If in doubt, use a recent GNU awk version, as some of the older ones
are broken. GNU awk version 3.1.5 is known to work.
2015-08-28 15:33:40 +00:00
< br > < dt > GNU binutils< dd >
Necessary in some circumstances, optional in others. See the
2012-03-27 23:13:14 +00:00
host/target specific instructions for your platform for the exact
requirements.
2015-08-28 15:33:40 +00:00
< br > < dt > gzip version 1.2.4 (or later) or< dt > bzip2 version 1.0.2 (or later)< dd >
Necessary to uncompress GCC < samp > < span class = "command" > tar< / span > < / samp > files when source code is
2012-03-27 23:13:14 +00:00
obtained via FTP mirror sites.
2015-08-28 15:33:40 +00:00
< br > < dt > GNU make version 3.80 (or later)< dd >
You must have GNU make installed to build GCC.
< br > < dt > GNU tar version 1.14 (or later)< dd >
Necessary (only on some platforms) to untar the source code. Many
systems' < samp > < span class = "command" > tar< / span > < / samp > programs will also work, only try GNU
< samp > < span class = "command" > tar< / span > < / samp > if you have problems.
< br > < dt > Perl version 5.6.1 (or later)< dd >
Necessary when targeting Darwin, building ‘ < samp > < span class = "samp" > libstdc++< / span > < / samp > ’ ,
and not using < samp > < span class = "option" > --disable-symvers< / span > < / samp > .
Necessary when targeting Solaris 2 with Sun < samp > < span class = "command" > ld< / span > < / samp > and not using
< samp > < span class = "option" > --disable-symvers< / span > < / samp > . The bundled < samp > < span class = "command" > perl< / span > < / samp > in Solaris 8
2012-03-27 23:13:14 +00:00
and up works.
2015-08-28 15:33:40 +00:00
< p > Necessary when regenerating < samp > < span class = "file" > Makefile< / span > < / samp > dependencies in libiberty.
Necessary when regenerating < samp > < span class = "file" > libiberty/functions.texi< / span > < / samp > .
Necessary when generating manpages from Texinfo manuals.
2012-03-27 23:13:14 +00:00
Used by various scripts to generate some files included in SVN (mainly
Unicode-related and rarely changing) from source tables.
2015-08-28 15:33:40 +00:00
< br > < dt > < samp > < span class = "command" > jar< / span > < / samp > , or InfoZIP (< samp > < span class = "command" > zip< / span > < / samp > and < samp > < span class = "command" > unzip< / span > < / samp > )< dd >
Necessary to build libgcj, the GCJ runtime.
2012-03-27 23:13:14 +00:00
< / dl >
2015-08-28 15:33:40 +00:00
< p > Several support libraries are necessary to build GCC, some are required,
2012-03-27 23:13:14 +00:00
others optional. While any sufficiently new version of required tools
usually work, library requirements are generally stricter. Newer
2015-08-28 15:33:40 +00:00
versions may work in some cases, but it's safer to use the exact
2012-03-27 23:13:14 +00:00
versions documented. We appreciate bug reports about problems with
newer versions, though. If your OS vendor provides packages for the
support libraries then using those packages may be the simplest way to
install the libraries.
2015-08-28 15:33:40 +00:00
< dl >
< dt > GNU Multiple Precision Library (GMP) version 4.3.2 (or later)< dd >
Necessary to build GCC. If a GMP source distribution is found in a
subdirectory of your GCC sources named < samp > < span class = "file" > gmp< / span > < / samp > , it will be built
2012-03-27 23:13:14 +00:00
together with GCC. Alternatively, if GMP is already installed but it
is not in your library search path, you will have to configure with the
2015-08-28 15:33:40 +00:00
< samp > < span class = "option" > --with-gmp< / span > < / samp > configure option. See also < samp > < span class = "option" > --with-gmp-lib< / span > < / samp >
and < samp > < span class = "option" > --with-gmp-include< / span > < / samp > .
< br > < dt > MPFR Library version 2.4.2 (or later)< dd >
Necessary to build GCC. It can be downloaded from
2012-03-27 23:13:14 +00:00
< a href = "http://www.mpfr.org/" > http://www.mpfr.org/< / a > . If an MPFR source distribution is found
2015-08-28 15:33:40 +00:00
in a subdirectory of your GCC sources named < samp > < span class = "file" > mpfr< / span > < / samp > , it will be
2012-03-27 23:13:14 +00:00
built together with GCC. Alternatively, if MPFR is already installed
but it is not in your default library search path, the
2015-08-28 15:33:40 +00:00
< samp > < span class = "option" > --with-mpfr< / span > < / samp > configure option should be used. See also
< samp > < span class = "option" > --with-mpfr-lib< / span > < / samp > and < samp > < span class = "option" > --with-mpfr-include< / span > < / samp > .
< br > < dt > MPC Library version 0.8.1 (or later)< dd >
Necessary to build GCC. It can be downloaded from
2012-03-27 23:13:14 +00:00
< a href = "http://www.multiprecision.org/" > http://www.multiprecision.org/< / a > . If an MPC source distribution
2015-08-28 15:33:40 +00:00
is found in a subdirectory of your GCC sources named < samp > < span class = "file" > mpc< / span > < / samp > , it
2012-03-27 23:13:14 +00:00
will be built together with GCC. Alternatively, if MPC is already
installed but it is not in your default library search path, the
2015-08-28 15:33:40 +00:00
< samp > < span class = "option" > --with-mpc< / span > < / samp > configure option should be used. See also
< samp > < span class = "option" > --with-mpc-lib< / span > < / samp > and < samp > < span class = "option" > --with-mpc-include< / span > < / samp > .
< br > < dt > ISL Library version 0.14 (or 0.12.2)< dd >
Necessary to build GCC with the Graphite loop optimizations.
2014-09-21 17:33:12 +00:00
It can be downloaded from < a href = "ftp://gcc.gnu.org/pub/gcc/infrastructure/" > ftp://gcc.gnu.org/pub/gcc/infrastructure/< / a >
2015-08-28 15:33:40 +00:00
as < samp > < span class = "file" > isl-0.12.2.tar.bz2< / span > < / samp > . If an ISL source distribution is found
in a subdirectory of your GCC sources named < samp > < span class = "file" > isl< / span > < / samp > , it will be
built together with GCC. Alternatively, the < samp > < span class = "option" > --with-isl< / span > < / samp > configure
2014-09-21 17:33:12 +00:00
option should be used if ISL is not installed in your default library
search path.
2012-03-27 23:13:14 +00:00
2015-08-28 15:33:40 +00:00
< / dl >
< h3 class = "heading" > < a name = "TOC1" > < / a > Tools/packages necessary for modifying GCC< / h3 >
< dl >
< dt > autoconf version 2.64< dt > GNU m4 version 1.4.6 (or later)< dd >
Necessary when modifying < samp > < span class = "file" > configure.ac< / span > < / samp > , < samp > < span class = "file" > aclocal.m4< / span > < / samp > , etc.
to regenerate < samp > < span class = "file" > configure< / span > < / samp > and < samp > < span class = "file" > config.in< / span > < / samp > files.
< br > < dt > automake version 1.11.1< dd >
Necessary when modifying a < samp > < span class = "file" > Makefile.am< / span > < / samp > file to regenerate its
associated < samp > < span class = "file" > Makefile.in< / span > < / samp > .
< p > Much of GCC does not use automake, so directly edit the < samp > < span class = "file" > Makefile.in< / span > < / samp >
file. Specifically this applies to the < samp > < span class = "file" > gcc< / span > < / samp > , < samp > < span class = "file" > intl< / span > < / samp > ,
< samp > < span class = "file" > libcpp< / span > < / samp > , < samp > < span class = "file" > libiberty< / span > < / samp > , < samp > < span class = "file" > libobjc< / span > < / samp > directories as well
2012-03-27 23:13:14 +00:00
as any of their subdirectories.
2015-08-28 15:33:40 +00:00
< p > For directories that use automake, GCC requires the latest release in
2012-03-27 23:13:14 +00:00
the 1.11 series, which is currently 1.11.1. When regenerating a directory
to a newer version, please update all the directories using an older 1.11
to the latest released version.
2015-08-28 15:33:40 +00:00
< br > < dt > gettext version 0.14.5 (or later)< dd >
Needed to regenerate < samp > < span class = "file" > gcc.pot< / span > < / samp > .
< br > < dt > gperf version 2.7.2 (or later)< dd >
Necessary when modifying < samp > < span class = "command" > gperf< / span > < / samp > input files, e.g.
< samp > < span class = "file" > gcc/cp/cfns.gperf< / span > < / samp > to regenerate its associated header file, e.g.
< samp > < span class = "file" > gcc/cp/cfns.h< / span > < / samp > .
< br > < dt > DejaGnu 1.4.4< dt > Expect< dt > Tcl< dd >
Necessary to run the GCC testsuite; see the section on testing for
2014-09-21 17:33:12 +00:00
details. Tcl 8.6 has a known regression in RE pattern handling that
make parts of the testsuite fail. See
< a href = "http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f" > http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f< / a >
2015-08-28 15:33:40 +00:00
for more information. This bug has been fixed in 8.6.1.
< br > < dt > autogen version 5.5.4 (or later) and< dt > guile version 1.4.1 (or later)< dd >
Necessary to regenerate < samp > < span class = "file" > fixinc/fixincl.x< / span > < / samp > from
< samp > < span class = "file" > fixinc/inclhack.def< / span > < / samp > and < samp > < span class = "file" > fixinc/*.tpl< / span > < / samp > .
< p > Necessary to run ‘ < samp > < span class = "samp" > make check< / span > < / samp > ’ for < samp > < span class = "file" > fixinc< / span > < / samp > .
< p > Necessary to regenerate the top level < samp > < span class = "file" > Makefile.in< / span > < / samp > file from
< samp > < span class = "file" > Makefile.tpl< / span > < / samp > and < samp > < span class = "file" > Makefile.def< / span > < / samp > .
< br > < dt > Flex version 2.5.4 (or later)< dd >
Necessary when modifying < samp > < span class = "file" > *.l< / span > < / samp > files.
< p > Necessary to build GCC during development because the generated output
2012-03-27 23:13:14 +00:00
files are not included in the SVN repository. They are included in
releases.
2015-08-28 15:33:40 +00:00
< br > < dt > Texinfo version 4.7 (or later)< dd >
Necessary for running < samp > < span class = "command" > makeinfo< / span > < / samp > when modifying < samp > < span class = "file" > *.texi< / span > < / samp >
2012-03-27 23:13:14 +00:00
files to test your changes.
2015-08-28 15:33:40 +00:00
< p > Necessary for running < samp > < span class = "command" > make dvi< / span > < / samp > or < samp > < span class = "command" > make pdf< / span > < / samp > to
2012-03-27 23:13:14 +00:00
create printable documentation in DVI or PDF format. Texinfo version
2015-08-28 15:33:40 +00:00
4.8 or later is required for < samp > < span class = "command" > make pdf< / span > < / samp > .
< p > Necessary to build GCC documentation during development because the
2012-03-27 23:13:14 +00:00
generated output files are not included in the SVN repository. They are
included in releases.
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< br > < dt > TeX (any working version)< dd >
Necessary for running < samp > < span class = "command" > texi2dvi< / span > < / samp > and < samp > < span class = "command" > texi2pdf< / span > < / samp > , which
are used when running < samp > < span class = "command" > make dvi< / span > < / samp > or < samp > < span class = "command" > make pdf< / span > < / samp > to create
DVI or PDF files, respectively.
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< br > < dt > Sphinx version 1.0 (or later)< dd >
Necessary to regenerate < samp > < span class = "file" > jit/docs/_build/texinfo< / span > < / samp > from the < samp > < span class = "file" > .rst< / span > < / samp >
files in the directories below < samp > < span class = "file" > jit/docs< / span > < / samp > .
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< br > < dt > SVN (any version)< dt > SSH (any version)< dd >
Necessary to access the SVN repository. Public releases and weekly
snapshots of the development sources are also available via FTP.
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< br > < dt > GNU diffutils version 2.7 (or later)< dd >
Useful when submitting patches for the GCC source code.
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< br > < dt > patch version 2.5.4 (or later)< dd >
Necessary when applying patches, created with < samp > < span class = "command" > diff< / span > < / samp > , to one's
own sources.
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< br > < dt > ecj1< dt > gjavah< dd >
If you wish to modify < samp > < span class = "file" > .java< / span > < / samp > files in libjava, you will need to
configure with < samp > < span class = "option" > --enable-java-maintainer-mode< / span > < / samp > , and you will need
to have executables named < samp > < span class = "command" > ecj1< / span > < / samp > and < samp > < span class = "command" > gjavah< / span > < / samp > in your path.
The < samp > < span class = "command" > ecj1< / span > < / samp > executable should run the Eclipse Java compiler via
the GCC-specific entry point. You can download a suitable jar from
< a href = "ftp://sourceware.org/pub/java/" > ftp://sourceware.org/pub/java/< / a > , or by running the script
< samp > < span class = "command" > contrib/download_ecj< / span > < / samp > .
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< br > < dt > antlr.jar version 2.7.1 (or later)< dt > antlr binary< dd >
If you wish to build the < samp > < span class = "command" > gjdoc< / span > < / samp > binary in libjava, you will
need to have an < samp > < span class = "file" > antlr.jar< / span > < / samp > library available. The library is
searched for in system locations but can be specified with
< samp > < span class = "option" > --with-antlr-jar=< / span > < / samp > instead. When configuring with
< samp > < span class = "option" > --enable-java-maintainer-mode< / span > < / samp > , you will need to have one of
the executables named < samp > < span class = "command" > cantlr< / span > < / samp > , < samp > < span class = "command" > runantlr< / span > < / samp > or
< samp > < span class = "command" > antlr< / span > < / samp > in your path.
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< / dl >
2014-09-21 17:33:12 +00:00
2015-08-28 15:33:40 +00:00
< p > < hr / >
< p > < a href = "./index.html" > Return to the GCC Installation page< / a >
<!-- ***Downloading the source************************************************** -->
<!-- ***Configuration*********************************************************** -->
<!-- ***Building**************************************************************** -->
<!-- ***Testing***************************************************************** -->
<!-- ***Final install*********************************************************** -->
<!-- ***Binaries**************************************************************** -->
<!-- ***Specific**************************************************************** -->
<!-- ***Old documentation****************************************************** -->
<!-- ***GFDL******************************************************************** -->
<!-- *************************************************************************** -->
<!-- Part 6 The End of the Document -->
< / body > < / html >
2012-03-27 23:13:14 +00:00