Home | History | Annotate | Line # | Download | only in INSTALL
prerequisites.html revision 1.11
      1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2 <html>
      3 <!-- Copyright (C) 1988-2018 Free Software Foundation, Inc.
      4 
      5 Permission is granted to copy, distribute and/or modify this document
      6 under the terms of the GNU Free Documentation License, Version 1.3 or
      7 any later version published by the Free Software Foundation; with no
      8 Invariant Sections, the Front-Cover texts being (a) (see below), and
      9 with the Back-Cover Texts being (b) (see below).  A copy of the
     10 license is included in the section entitled "GNU
     11 Free Documentation License".
     12 
     13 (a) The FSF's Front-Cover Text is:
     14 
     15 A GNU Manual
     16 
     17 (b) The FSF's Back-Cover Text is:
     18 
     19 You have freedom to copy and modify this GNU Manual, like GNU
     20      software.  Copies published by the Free Software Foundation raise
     21      funds for GNU development. -->
     22 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
     23 <head>
     24 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     25 <title>Installing GCC</title>
     26 
     27 <meta name="description" content="Installing GCC">
     28 <meta name="keywords" content="Installing GCC">
     29 <meta name="resource-type" content="document">
     30 <meta name="distribution" content="global">
     31 <meta name="Generator" content="makeinfo">
     32 <style type="text/css">
     33 <!--
     34 a.summary-letter {text-decoration: none}
     35 blockquote.indentedblock {margin-right: 0em}
     36 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
     37 blockquote.smallquotation {font-size: smaller}
     38 div.display {margin-left: 3.2em}
     39 div.example {margin-left: 3.2em}
     40 div.lisp {margin-left: 3.2em}
     41 div.smalldisplay {margin-left: 3.2em}
     42 div.smallexample {margin-left: 3.2em}
     43 div.smalllisp {margin-left: 3.2em}
     44 kbd {font-style: oblique}
     45 pre.display {font-family: inherit}
     46 pre.format {font-family: inherit}
     47 pre.menu-comment {font-family: serif}
     48 pre.menu-preformatted {font-family: serif}
     49 pre.smalldisplay {font-family: inherit; font-size: smaller}
     50 pre.smallexample {font-size: smaller}
     51 pre.smallformat {font-family: inherit; font-size: smaller}
     52 pre.smalllisp {font-size: smaller}
     53 span.nolinebreak {white-space: nowrap}
     54 span.roman {font-family: initial; font-weight: normal}
     55 span.sansserif {font-family: sans-serif; font-weight: normal}
     56 ul.no-bullet {list-style: none}
     57 -->
     58 </style>
     59 
     60 
     61 </head>
     62 
     63 <body lang="en">
     64 <h1 class="settitle" align="center">Installing GCC</h1>
     65 
     66 
     67 
     68 
     69 
     70 
     71 
     72 
     73 
     74 
     75 
     76 
     77 
     78 
     79 
     80 
     81 
     82 <a name="index-Prerequisites"></a>
     83 
     84 <p>GCC requires that various tools and packages be available for use in the
     85 build procedure.  Modifying GCC sources requires additional tools
     86 described below.
     87 </p>
     88 <a name="Tools_002fpackages-necessary-for-building-GCC"></a>
     89 <h3 class="heading">Tools/packages necessary for building GCC</h3>
     90 <dl compact="compact">
     91 <dt>ISO C++98 compiler</dt>
     92 <dd><p>Necessary to bootstrap GCC, although versions of GCC prior
     93 to 4.8 also allow bootstrapping with a ISO C89 compiler and versions
     94 of GCC prior to 3.4 also allow bootstrapping with a traditional
     95 (K&amp;R) C compiler.
     96 </p>
     97 <p>To build all languages in a cross-compiler or other configuration where
     98 3-stage bootstrap is not performed, you need to start with an existing
     99 GCC binary (version 3.4 or later) because source code for language
    100 frontends other than C might use GCC extensions.
    101 </p>
    102 <p>Note that to bootstrap GCC with versions of GCC earlier than 3.4, you
    103 may need to use <samp>--disable-stage1-checking</samp>, though
    104 bootstrapping the compiler with such earlier compilers is strongly
    105 discouraged.
    106 </p>
    107 </dd>
    108 <dt>C standard library and headers</dt>
    109 <dd>
    110 <p>In order to build GCC, the C standard library and headers must be present
    111 for all target variants for which target libraries will be built (and not
    112 only the variant of the host C++ compiler).
    113 </p>
    114 <p>This affects the popular &lsquo;<samp>x86_64-unknown-linux-gnu</samp>&rsquo; platform (among
    115 other multilib targets), for which 64-bit (&lsquo;<samp>x86_64</samp>&rsquo;) and 32-bit
    116 (&lsquo;<samp>i386</samp>&rsquo;) libc headers are usually packaged separately. If you do a
    117 build of a native compiler on &lsquo;<samp>x86_64-unknown-linux-gnu</samp>&rsquo;, make sure you
    118 either have the 32-bit libc developer package properly installed (the exact
    119 name of the package depends on your distro) or you must build GCC as a
    120 64-bit only compiler by configuring with the option
    121 <samp>--disable-multilib</samp>.  Otherwise, you may encounter an error such as
    122 &lsquo;<samp>fatal error: gnu/stubs-32.h: No such file</samp>&rsquo;
    123 </p>
    124 </dd>
    125 <dt>GNAT</dt>
    126 <dd>
    127 <p>In order to build the Ada compiler (GNAT) you must already have GNAT
    128 installed because portions of the Ada frontend are written in Ada (with
    129 GNAT extensions.)  Refer to the Ada installation instructions for more
    130 specific information.
    131 </p>
    132 </dd>
    133 <dt>A &ldquo;working&rdquo; POSIX compatible shell, or GNU bash</dt>
    134 <dd>
    135 <p>Necessary when running <code>configure</code> because some
    136 <code>/bin/sh</code> shells have bugs and may crash when configuring the
    137 target libraries.  In other cases, <code>/bin/sh</code> or <code>ksh</code>
    138 have disastrous corner-case performance problems.  This
    139 can cause target <code>configure</code> runs to literally take days to
    140 complete in some cases.
    141 </p>
    142 <p>So on some platforms <code>/bin/ksh</code> is sufficient, on others it
    143 isn&rsquo;t.  See the host/target specific instructions for your platform, or
    144 use <code>bash</code> to be sure.  Then set <code>CONFIG_SHELL</code> in your
    145 environment to your &ldquo;good&rdquo; shell prior to running
    146 <code>configure</code>/<code>make</code>.
    147 </p>
    148 <p><code>zsh</code> is not a fully compliant POSIX shell and will not
    149 work when configuring GCC.
    150 </p>
    151 </dd>
    152 <dt>A POSIX or SVR4 awk</dt>
    153 <dd>
    154 <p>Necessary for creating some of the generated source files for GCC.
    155 If in doubt, use a recent GNU awk version, as some of the older ones
    156 are broken.  GNU awk version 3.1.5 is known to work.
    157 </p>
    158 </dd>
    159 <dt>GNU binutils</dt>
    160 <dd>
    161 <p>Necessary in some circumstances, optional in others.  See the
    162 host/target specific instructions for your platform for the exact
    163 requirements.
    164 </p>
    165 </dd>
    166 <dt>gzip version 1.2.4 (or later) or</dt>
    167 <dt>bzip2 version 1.0.2 (or later)</dt>
    168 <dd>
    169 <p>Necessary to uncompress GCC <code>tar</code> files when source code is
    170 obtained via FTP mirror sites.
    171 </p>
    172 </dd>
    173 <dt>GNU make version 3.80 (or later)</dt>
    174 <dd>
    175 <p>You must have GNU make installed to build GCC.
    176 </p>
    177 </dd>
    178 <dt>GNU tar version 1.14 (or later)</dt>
    179 <dd>
    180 <p>Necessary (only on some platforms) to untar the source code.  Many
    181 systems&rsquo; <code>tar</code> programs will also work, only try GNU
    182 <code>tar</code> if you have problems.
    183 </p>
    184 </dd>
    185 <dt>Perl version between 5.6.1 and 5.6.24</dt>
    186 <dd>
    187 <p>Necessary when targeting Darwin, building &lsquo;<samp>libstdc++</samp>&rsquo;,
    188 and not using <samp>--disable-symvers</samp>.
    189 Necessary when targeting Solaris 2 with Sun <code>ld</code> and not using
    190 <samp>--disable-symvers</samp>.  The bundled <code>perl</code> in Solaris&nbsp;8
    191 and up works.
    192 </p>
    193 <p>Necessary when regenerating <samp>Makefile</samp> dependencies in libiberty.
    194 Necessary when regenerating <samp>libiberty/functions.texi</samp>.
    195 Necessary when generating manpages from Texinfo manuals.
    196 Used by various scripts to generate some files included in the source
    197 repository (mainly Unicode-related and rarely changing) from source
    198 tables.
    199 </p>
    200 <p>Used by <code>automake</code>.
    201 </p>
    202 </dd>
    203 </dl>
    204 
    205 <p>Several support libraries are necessary to build GCC, some are required,
    206 others optional.  While any sufficiently new version of required tools
    207 usually work, library requirements are generally stricter.  Newer
    208 versions may work in some cases, but it&rsquo;s safer to use the exact
    209 versions documented.  We appreciate bug reports about problems with
    210 newer versions, though.  If your OS vendor provides packages for the
    211 support libraries then using those packages may be the simplest way to
    212 install the libraries.
    213 </p>
    214 <dl compact="compact">
    215 <dt>GNU Multiple Precision Library (GMP) version 4.3.2 (or later)</dt>
    216 <dd>
    217 <p>Necessary to build GCC.  If a GMP source distribution is found in a
    218 subdirectory of your GCC sources named <samp>gmp</samp>, it will be built
    219 together with GCC.  Alternatively, if GMP is already installed but it
    220 is not in your library search path, you will have to configure with the
    221 <samp>--with-gmp</samp> configure option.  See also <samp>--with-gmp-lib</samp>
    222 and <samp>--with-gmp-include</samp>.
    223 The in-tree build is only supported with the GMP version that
    224 download_prerequisites installs.
    225 </p>
    226 </dd>
    227 <dt>MPFR Library version 2.4.2 (or later)</dt>
    228 <dd>
    229 <p>Necessary to build GCC.  It can be downloaded from
    230 <a href="http://www.mpfr.org/">http://www.mpfr.org/</a>.  If an MPFR source distribution is found
    231 in a subdirectory of your GCC sources named <samp>mpfr</samp>, it will be
    232 built together with GCC.  Alternatively, if MPFR is already installed
    233 but it is not in your default library search path, the
    234 <samp>--with-mpfr</samp> configure option should be used.  See also
    235 <samp>--with-mpfr-lib</samp> and <samp>--with-mpfr-include</samp>.
    236 The in-tree build is only supported with the MPFR version that
    237 download_prerequisites installs.
    238 </p>
    239 </dd>
    240 <dt>MPC Library version 0.8.1 (or later)</dt>
    241 <dd>
    242 <p>Necessary to build GCC.  It can be downloaded from
    243 <a href="http://www.multiprecision.org/">http://www.multiprecision.org/</a>.  If an MPC source distribution
    244 is found in a subdirectory of your GCC sources named <samp>mpc</samp>, it
    245 will be built together with GCC.  Alternatively, if MPC is already
    246 installed but it is not in your default library search path, the
    247 <samp>--with-mpc</samp> configure option should be used.  See also
    248 <samp>--with-mpc-lib</samp> and <samp>--with-mpc-include</samp>.
    249 The in-tree build is only supported with the MPC version that
    250 download_prerequisites installs.
    251 </p>
    252 </dd>
    253 <dt>isl Library version 0.15 or later.</dt>
    254 <dd>
    255 <p>Necessary to build GCC with the Graphite loop optimizations.
    256 It can be downloaded from <a href="ftp://gcc.gnu.org/pub/gcc/infrastructure/">ftp://gcc.gnu.org/pub/gcc/infrastructure/</a>.
    257 If an isl source distribution is found
    258 in a subdirectory of your GCC sources named <samp>isl</samp>, it will be
    259 built together with GCC.  Alternatively, the <samp>--with-isl</samp> configure
    260 option should be used if isl is not installed in your default library
    261 search path.
    262 </p>
    263 </dd>
    264 </dl>
    265 
    266 <a name="Tools_002fpackages-necessary-for-modifying-GCC"></a>
    267 <h3 class="heading">Tools/packages necessary for modifying GCC</h3>
    268 <dl compact="compact">
    269 <dt>autoconf version 2.64</dt>
    270 <dt>GNU m4 version 1.4.6 (or later)</dt>
    271 <dd>
    272 <p>Necessary when modifying <samp>configure.ac</samp>, <samp>aclocal.m4</samp>, etc.
    273 to regenerate <samp>configure</samp> and <samp>config.in</samp> files.
    274 </p>
    275 </dd>
    276 <dt>automake version 1.11.6</dt>
    277 <dd>
    278 <p>Necessary when modifying a <samp>Makefile.am</samp> file to regenerate its
    279 associated <samp>Makefile.in</samp>.
    280 </p>
    281 <p>Much of GCC does not use automake, so directly edit the <samp>Makefile.in</samp>
    282 file.  Specifically this applies to the <samp>gcc</samp>, <samp>intl</samp>,
    283 <samp>libcpp</samp>, <samp>libiberty</samp>, <samp>libobjc</samp> directories as well
    284 as any of their subdirectories.
    285 </p>
    286 <p>For directories that use automake, GCC requires the latest release in
    287 the 1.11 series, which is currently 1.11.6.  When regenerating a directory
    288 to a newer version, please update all the directories using an older 1.11
    289 to the latest released version.
    290 </p>
    291 <p>Note that <code>automake</code> 1.11.6 is incompatible with
    292 <code>perl</code> version 5.6.26.
    293 </p>
    294 </dd>
    295 <dt>gettext version 0.14.5 (or later)</dt>
    296 <dd>
    297 <p>Needed to regenerate <samp>gcc.pot</samp>.
    298 </p>
    299 </dd>
    300 <dt>gperf version 2.7.2 (or later)</dt>
    301 <dd>
    302 <p>Necessary when modifying <code>gperf</code> input files, e.g.
    303 <samp>gcc/cp/cfns.gperf</samp> to regenerate its associated header file, e.g.
    304 <samp>gcc/cp/cfns.h</samp>.
    305 </p>
    306 </dd>
    307 <dt>DejaGnu 1.4.4</dt>
    308 <dt>Expect</dt>
    309 <dt>Tcl</dt>
    310 <dd>
    311 <p>Necessary to run the GCC testsuite; see the section on testing for
    312 details.  Tcl 8.6 has a known regression in RE pattern handling that
    313 make parts of the testsuite fail.  See
    314 <a href="http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f">http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f</a>
    315 for more information.  This bug has been fixed in 8.6.1.
    316 </p>
    317 </dd>
    318 <dt>autogen version 5.5.4 (or later) and</dt>
    319 <dt>guile version 1.4.1 (or later)</dt>
    320 <dd>
    321 <p>Necessary to regenerate <samp>fixinc/fixincl.x</samp> from
    322 <samp>fixinc/inclhack.def</samp> and <samp>fixinc/*.tpl</samp>.
    323 </p>
    324 <p>Necessary to run &lsquo;<samp>make check</samp>&rsquo; for <samp>fixinc</samp>.
    325 </p>
    326 <p>Necessary to regenerate the top level <samp>Makefile.in</samp> file from
    327 <samp>Makefile.tpl</samp> and <samp>Makefile.def</samp>.
    328 </p>
    329 </dd>
    330 <dt>Flex version 2.5.4 (or later)</dt>
    331 <dd>
    332 <p>Necessary when modifying <samp>*.l</samp> files.
    333 </p>
    334 <p>Necessary to build GCC during development because the generated output
    335 files are not included in the version-controlled source repository.
    336 They are included in releases.
    337 </p>
    338 </dd>
    339 <dt>Texinfo version 4.7 (or later)</dt>
    340 <dd>
    341 <p>Necessary for running <code>makeinfo</code> when modifying <samp>*.texi</samp>
    342 files to test your changes.
    343 </p>
    344 <p>Necessary for running <code>make dvi</code> or <code>make pdf</code> to
    345 create printable documentation in DVI or PDF format.  Texinfo version
    346 4.8 or later is required for <code>make pdf</code>.
    347 </p>
    348 <p>Necessary to build GCC documentation during development because the
    349 generated output files are not included in the repository.  They are
    350 included in releases.
    351 </p>
    352 </dd>
    353 <dt>TeX (any working version)</dt>
    354 <dd>
    355 <p>Necessary for running <code>texi2dvi</code> and <code>texi2pdf</code>, which
    356 are used when running <code>make dvi</code> or <code>make pdf</code> to create
    357 DVI or PDF files, respectively.
    358 </p>
    359 </dd>
    360 <dt>Sphinx version 1.0 (or later)</dt>
    361 <dd>
    362 <p>Necessary to regenerate <samp>jit/docs/_build/texinfo</samp> from the <samp>.rst</samp>
    363 files in the directories below <samp>jit/docs</samp>.
    364 </p>
    365 </dd>
    366 <dt>git (any version)</dt>
    367 <dt>SSH (any version)</dt>
    368 <dd>
    369 <p>Necessary to access the source repository.  Public releases and weekly
    370 snapshots of the development sources are also available via HTTPS.
    371 </p>
    372 </dd>
    373 <dt>GNU diffutils version 2.7 (or later)</dt>
    374 <dd>
    375 <p>Useful when submitting patches for the GCC source code.
    376 </p>
    377 </dd>
    378 <dt>patch version 2.5.4 (or later)</dt>
    379 <dd>
    380 <p>Necessary when applying patches, created with <code>diff</code>, to one&rsquo;s
    381 own sources.
    382 </p>
    383 </dd>
    384 </dl>
    385 
    386 <hr />
    387 <p>
    388 <p><a href="./index.html">Return to the GCC Installation page</a>
    389 </p>
    390 
    391 
    392 
    393 
    394 
    395 
    396 
    397 
    398 
    399 
    400 
    401 
    402 
    403 </body>
    404 </html>
    405