prerequisites.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <html lang="en">
  2. <head>
  3. <title>Prerequisites for GCC</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="Prerequisites for GCC">
  6. <meta name="generator" content="makeinfo 4.12">
  7. <link title="Top" rel="top" href="#Top">
  8. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  9. <!--
  10. Copyright (C) 1988-2015 Free Software Foundation, Inc.
  11. Permission is granted to copy, distribute and/or modify this document
  12. under the terms of the GNU Free Documentation License, Version 1.3 or
  13. any later version published by the Free Software Foundation; with no
  14. Invariant Sections, the Front-Cover texts being (a) (see below), and
  15. with the Back-Cover Texts being (b) (see below). A copy of the
  16. license is included in the section entitled "GNU Free Documentation License".
  17. (a) The FSF's Front-Cover Text is:
  18. A GNU Manual
  19. (b) The FSF's Back-Cover Text is:
  20. You have freedom to copy and modify this GNU Manual, like GNU
  21. software. Copies published by the Free Software Foundation raise
  22. funds for GNU development.-->
  23. <meta http-equiv="Content-Style-Type" content="text/css">
  24. <style type="text/css"><!--
  25. pre.display { font-family:inherit }
  26. pre.format { font-family:inherit }
  27. pre.smalldisplay { font-family:inherit; font-size:smaller }
  28. pre.smallformat { font-family:inherit; font-size:smaller }
  29. pre.smallexample { font-size:smaller }
  30. pre.smalllisp { font-size:smaller }
  31. span.sc { font-variant:small-caps }
  32. span.roman { font-family:serif; font-weight:normal; }
  33. span.sansserif { font-family:sans-serif; font-weight:normal; }
  34. --></style>
  35. </head>
  36. <body>
  37. <h1 class="settitle">Prerequisites for GCC</h1>
  38. <a name="index-Prerequisites-1"></a>
  39. GCC requires that various tools and packages be available for use in the
  40. build procedure. Modifying GCC sources requires additional tools
  41. described below.
  42. <h3 class="heading"><a name="TOC0"></a>Tools/packages necessary for building GCC</h3>
  43. <dl>
  44. <dt>ISO C++98 compiler<dd>Necessary to bootstrap GCC, although versions of GCC prior
  45. to 4.8 also allow bootstrapping with a ISO C89 compiler and versions
  46. of GCC prior to 3.4 also allow bootstrapping with a traditional
  47. (K&amp;R) C compiler.
  48. <p>To build all languages in a cross-compiler or other configuration where
  49. 3-stage bootstrap is not performed, you need to start with an existing
  50. GCC binary (version 3.4 or later) because source code for language
  51. frontends other than C might use GCC extensions.
  52. <p>Note that to bootstrap GCC with versions of GCC earlier than 3.4, you
  53. may need to use <samp><span class="option">--disable-stage1-checking</span></samp>, though
  54. bootstrapping the compiler with such earlier compilers is strongly
  55. discouraged.
  56. <br><dt>C standard library and headers<dd>
  57. In order to build GCC, the C standard library and headers must be present
  58. for all target variants for which target libraries will be built (and not
  59. only the variant of the host C++ compiler).
  60. <p>This affects the popular &lsquo;<samp><span class="samp">x86_64-unknown-linux-gnu</span></samp>&rsquo; platform (among
  61. other multilib targets), for which 64-bit (&lsquo;<samp><span class="samp">x86_64</span></samp>&rsquo;) and 32-bit
  62. (&lsquo;<samp><span class="samp">i386</span></samp>&rsquo;) libc headers are usually packaged separately. If you do a
  63. build of a native compiler on &lsquo;<samp><span class="samp">x86_64-unknown-linux-gnu</span></samp>&rsquo;, make sure you
  64. either have the 32-bit libc developer package properly installed (the exact
  65. name of the package depends on your distro) or you must build GCC as a
  66. 64-bit only compiler by configuring with the option
  67. <samp><span class="option">--disable-multilib</span></samp>. Otherwise, you may encounter an error such as
  68. &lsquo;<samp><span class="samp">fatal error: gnu/stubs-32.h: No such file</span></samp>&rsquo;
  69. <br><dt>GNAT<dd>
  70. In order to build the Ada compiler (GNAT) you must already have GNAT
  71. installed because portions of the Ada frontend are written in Ada (with
  72. GNAT extensions.) Refer to the Ada installation instructions for more
  73. specific information.
  74. <br><dt>A &ldquo;working&rdquo; POSIX compatible shell, or GNU bash<dd>
  75. Necessary when running <samp><span class="command">configure</span></samp> because some
  76. <samp><span class="command">/bin/sh</span></samp> shells have bugs and may crash when configuring the
  77. target libraries. In other cases, <samp><span class="command">/bin/sh</span></samp> or <samp><span class="command">ksh</span></samp>
  78. have disastrous corner-case performance problems. This
  79. can cause target <samp><span class="command">configure</span></samp> runs to literally take days to
  80. complete in some cases.
  81. <p>So on some platforms <samp><span class="command">/bin/ksh</span></samp> is sufficient, on others it
  82. isn't. See the host/target specific instructions for your platform, or
  83. use <samp><span class="command">bash</span></samp> to be sure. Then set <samp><span class="env">CONFIG_SHELL</span></samp> in your
  84. environment to your &ldquo;good&rdquo; shell prior to running
  85. <samp><span class="command">configure</span></samp>/<samp><span class="command">make</span></samp>.
  86. <p><samp><span class="command">zsh</span></samp> is not a fully compliant POSIX shell and will not
  87. work when configuring GCC.
  88. <br><dt>A POSIX or SVR4 awk<dd>
  89. Necessary for creating some of the generated source files for GCC.
  90. If in doubt, use a recent GNU awk version, as some of the older ones
  91. are broken. GNU awk version 3.1.5 is known to work.
  92. <br><dt>GNU binutils<dd>
  93. Necessary in some circumstances, optional in others. See the
  94. host/target specific instructions for your platform for the exact
  95. requirements.
  96. <br><dt>gzip version 1.2.4 (or later) or<dt>bzip2 version 1.0.2 (or later)<dd>
  97. Necessary to uncompress GCC <samp><span class="command">tar</span></samp> files when source code is
  98. obtained via FTP mirror sites.
  99. <br><dt>GNU make version 3.80 (or later)<dd>
  100. You must have GNU make installed to build GCC.
  101. <br><dt>GNU tar version 1.14 (or later)<dd>
  102. Necessary (only on some platforms) to untar the source code. Many
  103. systems' <samp><span class="command">tar</span></samp> programs will also work, only try GNU
  104. <samp><span class="command">tar</span></samp> if you have problems.
  105. <br><dt>Perl version 5.6.1 (or later)<dd>
  106. Necessary when targeting Darwin, building &lsquo;<samp><span class="samp">libstdc++</span></samp>&rsquo;,
  107. and not using <samp><span class="option">--disable-symvers</span></samp>.
  108. Necessary when targeting Solaris 2 with Sun <samp><span class="command">ld</span></samp> and not using
  109. <samp><span class="option">--disable-symvers</span></samp>. The bundled <samp><span class="command">perl</span></samp> in Solaris&nbsp;8
  110. and up works.
  111. <p>Necessary when regenerating <samp><span class="file">Makefile</span></samp> dependencies in libiberty.
  112. Necessary when regenerating <samp><span class="file">libiberty/functions.texi</span></samp>.
  113. Necessary when generating manpages from Texinfo manuals.
  114. Used by various scripts to generate some files included in SVN (mainly
  115. Unicode-related and rarely changing) from source tables.
  116. <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>
  117. Necessary to build libgcj, the GCJ runtime.
  118. </dl>
  119. <p>Several support libraries are necessary to build GCC, some are required,
  120. others optional. While any sufficiently new version of required tools
  121. usually work, library requirements are generally stricter. Newer
  122. versions may work in some cases, but it's safer to use the exact
  123. versions documented. We appreciate bug reports about problems with
  124. newer versions, though. If your OS vendor provides packages for the
  125. support libraries then using those packages may be the simplest way to
  126. install the libraries.
  127. <dl>
  128. <dt>GNU Multiple Precision Library (GMP) version 4.3.2 (or later)<dd>
  129. Necessary to build GCC. If a GMP source distribution is found in a
  130. subdirectory of your GCC sources named <samp><span class="file">gmp</span></samp>, it will be built
  131. together with GCC. Alternatively, if GMP is already installed but it
  132. is not in your library search path, you will have to configure with the
  133. <samp><span class="option">--with-gmp</span></samp> configure option. See also <samp><span class="option">--with-gmp-lib</span></samp>
  134. and <samp><span class="option">--with-gmp-include</span></samp>.
  135. <br><dt>MPFR Library version 2.4.2 (or later)<dd>
  136. Necessary to build GCC. It can be downloaded from
  137. <a href="http://www.mpfr.org/">http://www.mpfr.org/</a>. If an MPFR source distribution is found
  138. in a subdirectory of your GCC sources named <samp><span class="file">mpfr</span></samp>, it will be
  139. built together with GCC. Alternatively, if MPFR is already installed
  140. but it is not in your default library search path, the
  141. <samp><span class="option">--with-mpfr</span></samp> configure option should be used. See also
  142. <samp><span class="option">--with-mpfr-lib</span></samp> and <samp><span class="option">--with-mpfr-include</span></samp>.
  143. <br><dt>MPC Library version 0.8.1 (or later)<dd>
  144. Necessary to build GCC. It can be downloaded from
  145. <a href="http://www.multiprecision.org/">http://www.multiprecision.org/</a>. If an MPC source distribution
  146. is found in a subdirectory of your GCC sources named <samp><span class="file">mpc</span></samp>, it
  147. will be built together with GCC. Alternatively, if MPC is already
  148. installed but it is not in your default library search path, the
  149. <samp><span class="option">--with-mpc</span></samp> configure option should be used. See also
  150. <samp><span class="option">--with-mpc-lib</span></samp> and <samp><span class="option">--with-mpc-include</span></samp>.
  151. <br><dt>ISL Library version 0.14 (or 0.12.2)<dd>
  152. Necessary to build GCC with the Graphite loop optimizations.
  153. It can be downloaded from <a href="ftp://gcc.gnu.org/pub/gcc/infrastructure/">ftp://gcc.gnu.org/pub/gcc/infrastructure/</a>
  154. as <samp><span class="file">isl-0.12.2.tar.bz2</span></samp>. If an ISL source distribution is found
  155. in a subdirectory of your GCC sources named <samp><span class="file">isl</span></samp>, it will be
  156. built together with GCC. Alternatively, the <samp><span class="option">--with-isl</span></samp> configure
  157. option should be used if ISL is not installed in your default library
  158. search path.
  159. </dl>
  160. <h3 class="heading"><a name="TOC1"></a>Tools/packages necessary for modifying GCC</h3>
  161. <dl>
  162. <dt>autoconf version 2.64<dt>GNU m4 version 1.4.6 (or later)<dd>
  163. Necessary when modifying <samp><span class="file">configure.ac</span></samp>, <samp><span class="file">aclocal.m4</span></samp>, etc.
  164. to regenerate <samp><span class="file">configure</span></samp> and <samp><span class="file">config.in</span></samp> files.
  165. <br><dt>automake version 1.11.1<dd>
  166. Necessary when modifying a <samp><span class="file">Makefile.am</span></samp> file to regenerate its
  167. associated <samp><span class="file">Makefile.in</span></samp>.
  168. <p>Much of GCC does not use automake, so directly edit the <samp><span class="file">Makefile.in</span></samp>
  169. file. Specifically this applies to the <samp><span class="file">gcc</span></samp>, <samp><span class="file">intl</span></samp>,
  170. <samp><span class="file">libcpp</span></samp>, <samp><span class="file">libiberty</span></samp>, <samp><span class="file">libobjc</span></samp> directories as well
  171. as any of their subdirectories.
  172. <p>For directories that use automake, GCC requires the latest release in
  173. the 1.11 series, which is currently 1.11.1. When regenerating a directory
  174. to a newer version, please update all the directories using an older 1.11
  175. to the latest released version.
  176. <br><dt>gettext version 0.14.5 (or later)<dd>
  177. Needed to regenerate <samp><span class="file">gcc.pot</span></samp>.
  178. <br><dt>gperf version 2.7.2 (or later)<dd>
  179. Necessary when modifying <samp><span class="command">gperf</span></samp> input files, e.g.
  180. <samp><span class="file">gcc/cp/cfns.gperf</span></samp> to regenerate its associated header file, e.g.
  181. <samp><span class="file">gcc/cp/cfns.h</span></samp>.
  182. <br><dt>DejaGnu 1.4.4<dt>Expect<dt>Tcl<dd>
  183. Necessary to run the GCC testsuite; see the section on testing for
  184. details. Tcl 8.6 has a known regression in RE pattern handling that
  185. make parts of the testsuite fail. See
  186. <a href="http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f">http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f</a>
  187. for more information. This bug has been fixed in 8.6.1.
  188. <br><dt>autogen version 5.5.4 (or later) and<dt>guile version 1.4.1 (or later)<dd>
  189. Necessary to regenerate <samp><span class="file">fixinc/fixincl.x</span></samp> from
  190. <samp><span class="file">fixinc/inclhack.def</span></samp> and <samp><span class="file">fixinc/*.tpl</span></samp>.
  191. <p>Necessary to run &lsquo;<samp><span class="samp">make check</span></samp>&rsquo; for <samp><span class="file">fixinc</span></samp>.
  192. <p>Necessary to regenerate the top level <samp><span class="file">Makefile.in</span></samp> file from
  193. <samp><span class="file">Makefile.tpl</span></samp> and <samp><span class="file">Makefile.def</span></samp>.
  194. <br><dt>Flex version 2.5.4 (or later)<dd>
  195. Necessary when modifying <samp><span class="file">*.l</span></samp> files.
  196. <p>Necessary to build GCC during development because the generated output
  197. files are not included in the SVN repository. They are included in
  198. releases.
  199. <br><dt>Texinfo version 4.7 (or later)<dd>
  200. Necessary for running <samp><span class="command">makeinfo</span></samp> when modifying <samp><span class="file">*.texi</span></samp>
  201. files to test your changes.
  202. <p>Necessary for running <samp><span class="command">make dvi</span></samp> or <samp><span class="command">make pdf</span></samp> to
  203. create printable documentation in DVI or PDF format. Texinfo version
  204. 4.8 or later is required for <samp><span class="command">make pdf</span></samp>.
  205. <p>Necessary to build GCC documentation during development because the
  206. generated output files are not included in the SVN repository. They are
  207. included in releases.
  208. <br><dt>TeX (any working version)<dd>
  209. Necessary for running <samp><span class="command">texi2dvi</span></samp> and <samp><span class="command">texi2pdf</span></samp>, which
  210. are used when running <samp><span class="command">make dvi</span></samp> or <samp><span class="command">make pdf</span></samp> to create
  211. DVI or PDF files, respectively.
  212. <br><dt>Sphinx version 1.0 (or later)<dd>
  213. Necessary to regenerate <samp><span class="file">jit/docs/_build/texinfo</span></samp> from the <samp><span class="file">.rst</span></samp>
  214. files in the directories below <samp><span class="file">jit/docs</span></samp>.
  215. <br><dt>SVN (any version)<dt>SSH (any version)<dd>
  216. Necessary to access the SVN repository. Public releases and weekly
  217. snapshots of the development sources are also available via FTP.
  218. <br><dt>GNU diffutils version 2.7 (or later)<dd>
  219. Useful when submitting patches for the GCC source code.
  220. <br><dt>patch version 2.5.4 (or later)<dd>
  221. Necessary when applying patches, created with <samp><span class="command">diff</span></samp>, to one's
  222. own sources.
  223. <br><dt>ecj1<dt>gjavah<dd>
  224. If you wish to modify <samp><span class="file">.java</span></samp> files in libjava, you will need to
  225. configure with <samp><span class="option">--enable-java-maintainer-mode</span></samp>, and you will need
  226. to have executables named <samp><span class="command">ecj1</span></samp> and <samp><span class="command">gjavah</span></samp> in your path.
  227. The <samp><span class="command">ecj1</span></samp> executable should run the Eclipse Java compiler via
  228. the GCC-specific entry point. You can download a suitable jar from
  229. <a href="ftp://sourceware.org/pub/java/">ftp://sourceware.org/pub/java/</a>, or by running the script
  230. <samp><span class="command">contrib/download_ecj</span></samp>.
  231. <br><dt>antlr.jar version 2.7.1 (or later)<dt>antlr binary<dd>
  232. If you wish to build the <samp><span class="command">gjdoc</span></samp> binary in libjava, you will
  233. need to have an <samp><span class="file">antlr.jar</span></samp> library available. The library is
  234. searched for in system locations but can be specified with
  235. <samp><span class="option">--with-antlr-jar=</span></samp> instead. When configuring with
  236. <samp><span class="option">--enable-java-maintainer-mode</span></samp>, you will need to have one of
  237. the executables named <samp><span class="command">cantlr</span></samp>, <samp><span class="command">runantlr</span></samp> or
  238. <samp><span class="command">antlr</span></samp> in your path.
  239. </dl>
  240. <p><hr />
  241. <p><a href="./index.html">Return to the GCC Installation page</a>
  242. <!-- ***Downloading the source************************************************** -->
  243. <!-- ***Configuration*********************************************************** -->
  244. <!-- ***Building**************************************************************** -->
  245. <!-- ***Testing***************************************************************** -->
  246. <!-- ***Final install*********************************************************** -->
  247. <!-- ***Binaries**************************************************************** -->
  248. <!-- ***Specific**************************************************************** -->
  249. <!-- ***Old documentation****************************************************** -->
  250. <!-- ***GFDL******************************************************************** -->
  251. <!-- *************************************************************************** -->
  252. <!-- Part 6 The End of the Document -->
  253. </body></html>