prerequisites.html 14 KB

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