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