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