]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/install.texi
876b04f9c455a40d7aefe9541a394448e1aee24d
[thirdparty/gcc.git] / gcc / doc / install.texi
1 \input texinfo.tex @c -*-texinfo-*-
2 @c @ifnothtml
3 @c %**start of header
4 @setfilename gccinstall.info
5 @setchapternewpage odd
6 @c %**end of header
7 @c @end ifnothtml
8
9 @include gcc-common.texi
10
11 @c Specify title for specific html page
12 @ifset indexhtml
13 @settitle Installing GCC
14 @end ifset
15 @ifset specifichtml
16 @settitle Host/Target specific installation notes for GCC
17 @end ifset
18 @ifset prerequisiteshtml
19 @settitle Prerequisites for GCC
20 @end ifset
21 @ifset downloadhtml
22 @settitle Downloading GCC
23 @end ifset
24 @ifset configurehtml
25 @settitle Installing GCC: Configuration
26 @end ifset
27 @ifset buildhtml
28 @settitle Installing GCC: Building
29 @end ifset
30 @ifset testhtml
31 @settitle Installing GCC: Testing
32 @end ifset
33 @ifset finalinstallhtml
34 @settitle Installing GCC: Final installation
35 @end ifset
36 @ifset binarieshtml
37 @settitle Installing GCC: Binaries
38 @end ifset
39 @ifset oldhtml
40 @settitle Installing GCC: Old documentation
41 @end ifset
42 @ifset gfdlhtml
43 @settitle Installing GCC: GNU Free Documentation License
44 @end ifset
45
46 @c Copyright (C) 1988-2020 Free Software Foundation, Inc.
47 @c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
48
49 @c IMPORTANT: whenever you modify this file, run `install.texi2html' to
50 @c test the generation of HTML documents for the gcc.gnu.org web pages.
51 @c
52 @c Do not use @footnote{} in this file as it breaks install.texi2html!
53
54 @c Include everything if we're not making html
55 @ifnothtml
56 @set indexhtml
57 @set specifichtml
58 @set prerequisiteshtml
59 @set downloadhtml
60 @set configurehtml
61 @set buildhtml
62 @set testhtml
63 @set finalinstallhtml
64 @set binarieshtml
65 @set oldhtml
66 @set gfdlhtml
67 @end ifnothtml
68
69 @c Part 2 Summary Description and Copyright
70 @copying
71 Copyright @copyright{} 1988-2020 Free Software Foundation, Inc.
72 @sp 1
73 Permission is granted to copy, distribute and/or modify this document
74 under the terms of the GNU Free Documentation License, Version 1.3 or
75 any later version published by the Free Software Foundation; with no
76 Invariant Sections, the Front-Cover texts being (a) (see below), and
77 with the Back-Cover Texts being (b) (see below). A copy of the
78 license is included in the section entitled ``@uref{./gfdl.html,,GNU
79 Free Documentation License}''.
80
81 (a) The FSF's Front-Cover Text is:
82
83 A GNU Manual
84
85 (b) The FSF's Back-Cover Text is:
86
87 You have freedom to copy and modify this GNU Manual, like GNU
88 software. Copies published by the Free Software Foundation raise
89 funds for GNU development.
90 @end copying
91 @ifinfo
92 @insertcopying
93 @end ifinfo
94 @dircategory Software development
95 @direntry
96 * gccinstall: (gccinstall). Installing the GNU Compiler Collection.
97 @end direntry
98
99 @c Part 3 Titlepage and Copyright
100 @titlepage
101 @title Installing GCC
102 @versionsubtitle
103
104 @c The following two commands start the copyright page.
105 @page
106 @vskip 0pt plus 1filll
107 @insertcopying
108 @end titlepage
109
110 @c Part 4 Top node, Master Menu, and/or Table of Contents
111 @ifinfo
112 @node Top, , , (dir)
113 @comment node-name, next, Previous, up
114
115 @menu
116 * Installing GCC:: This document describes the generic installation
117 procedure for GCC as well as detailing some target
118 specific installation instructions.
119
120 * Specific:: Host/target specific installation notes for GCC.
121 * Binaries:: Where to get pre-compiled binaries.
122
123 * Old:: Old installation documentation.
124
125 * GNU Free Documentation License:: How you can copy and share this manual.
126 * Concept Index:: This index has two entries.
127 @end menu
128 @end ifinfo
129
130 @iftex
131 @contents
132 @end iftex
133
134 @c Part 5 The Body of the Document
135 @c ***Installing GCC**********************************************************
136 @ifnothtml
137 @comment node-name, next, previous, up
138 @node Installing GCC, Binaries, , Top
139 @end ifnothtml
140 @ifset indexhtml
141 @ifnothtml
142 @chapter Installing GCC
143 @end ifnothtml
144
145 The latest version of this document is always available at
146 @uref{http://gcc.gnu.org/install/,,http://gcc.gnu.org/install/}.
147 It refers to the current development sources, instructions for
148 specific released versions are included with the sources.
149
150 This document describes the generic installation procedure for GCC as well
151 as detailing some target specific installation instructions.
152
153 GCC includes several components that previously were separate distributions
154 with their own installation instructions. This document supersedes all
155 package-specific installation instructions.
156
157 @emph{Before} starting the build/install procedure please check the
158 @ifnothtml
159 @ref{Specific, host/target specific installation notes}.
160 @end ifnothtml
161 @ifhtml
162 @uref{specific.html,,host/target specific installation notes}.
163 @end ifhtml
164 We recommend you browse the entire generic installation instructions before
165 you proceed.
166
167 Lists of successful builds for released versions of GCC are
168 available at @uref{http://gcc.gnu.org/buildstat.html}.
169 These lists are updated as new information becomes available.
170
171 The installation procedure itself is broken into five steps.
172
173 @ifinfo
174 @menu
175 * Prerequisites::
176 * Downloading the source::
177 * Configuration::
178 * Building::
179 * Testing:: (optional)
180 * Final install::
181 @end menu
182 @end ifinfo
183 @ifhtml
184 @enumerate
185 @item
186 @uref{prerequisites.html,,Prerequisites}
187 @item
188 @uref{download.html,,Downloading the source}
189 @item
190 @uref{configure.html,,Configuration}
191 @item
192 @uref{build.html,,Building}
193 @item
194 @uref{test.html,,Testing} (optional)
195 @item
196 @uref{finalinstall.html,,Final install}
197 @end enumerate
198 @end ifhtml
199
200 Please note that GCC does not support @samp{make uninstall} and probably
201 won't do so in the near future as this would open a can of worms. Instead,
202 we suggest that you install GCC into a directory of its own and simply
203 remove that directory when you do not need that specific version of GCC
204 any longer, and, if shared libraries are installed there as well, no
205 more binaries exist that use them.
206
207 @ifhtml
208 There are also some @uref{old.html,,old installation instructions},
209 which are mostly obsolete but still contain some information which has
210 not yet been merged into the main part of this manual.
211 @end ifhtml
212
213 @html
214 <hr />
215 <p>
216 @end html
217 @ifhtml
218 @uref{./index.html,,Return to the GCC Installation page}
219
220 @insertcopying
221 @end ifhtml
222 @end ifset
223
224 @c ***Prerequisites**************************************************
225 @ifnothtml
226 @comment node-name, next, previous, up
227 @node Prerequisites, Downloading the source, , Installing GCC
228 @end ifnothtml
229 @ifset prerequisiteshtml
230 @ifnothtml
231 @chapter Prerequisites
232 @end ifnothtml
233 @cindex Prerequisites
234
235 GCC requires that various tools and packages be available for use in the
236 build procedure. Modifying GCC sources requires additional tools
237 described below.
238
239 @heading Tools/packages necessary for building GCC
240 @table @asis
241 @item ISO C++98 compiler
242 Necessary to bootstrap GCC, although versions of GCC prior
243 to 4.8 also allow bootstrapping with a ISO C89 compiler and versions
244 of GCC prior to 3.4 also allow bootstrapping with a traditional
245 (K&R) C compiler.
246
247 To build all languages in a cross-compiler or other configuration where
248 3-stage bootstrap is not performed, you need to start with an existing
249 GCC binary (version 3.4 or later) because source code for language
250 frontends other than C might use GCC extensions.
251
252 Note that to bootstrap GCC with versions of GCC earlier than 3.4, you
253 may need to use @option{--disable-stage1-checking}, though
254 bootstrapping the compiler with such earlier compilers is strongly
255 discouraged.
256
257 @item C standard library and headers
258
259 In order to build GCC, the C standard library and headers must be present
260 for all target variants for which target libraries will be built (and not
261 only the variant of the host C++ compiler).
262
263 This affects the popular @samp{x86_64-pc-linux-gnu} platform (among
264 other multilib targets), for which 64-bit (@samp{x86_64}) and 32-bit
265 (@samp{i386}) libc headers are usually packaged separately. If you do a
266 build of a native compiler on @samp{x86_64-pc-linux-gnu}, make sure you
267 either have the 32-bit libc developer package properly installed (the exact
268 name of the package depends on your distro) or you must build GCC as a
269 64-bit only compiler by configuring with the option
270 @option{--disable-multilib}. Otherwise, you may encounter an error such as
271 @samp{fatal error: gnu/stubs-32.h: No such file}
272
273 @item @anchor{GNAT-prerequisite}GNAT
274
275 In order to build GNAT, the Ada compiler, you need a working GNAT
276 compiler (GCC version 4.7 or later).
277
278 This includes GNAT tools such as @command{gnatmake} and
279 @command{gnatlink}, since the Ada front end is written in Ada and
280 uses some GNAT-specific extensions.
281
282 In order to build a cross compiler, it is strongly recommended to install
283 the new compiler as native first, and then use it to build the cross
284 compiler. Other native compiler versions may work but this is not guaranteed and
285 will typically fail with hard to understand compilation errors during the
286 build.
287
288 Similarly, it is strongly recommended to use an older version of GNAT to build
289 GNAT. More recent versions of GNAT than the version built are not guaranteed
290 to work and will often fail during the build with compilation errors.
291
292 Note that @command{configure} does not test whether the GNAT installation works
293 and has a sufficiently recent version; if too old a GNAT version is
294 installed and @option{--enable-languages=ada} is used, the build will fail.
295
296 @env{ADA_INCLUDE_PATH} and @env{ADA_OBJECT_PATH} environment variables
297 must not be set when building the Ada compiler, the Ada tools, or the
298 Ada runtime libraries. You can check that your build environment is clean
299 by verifying that @samp{gnatls -v} lists only one explicit path in each
300 section.
301
302 @item A ``working'' POSIX compatible shell, or GNU bash
303
304 Necessary when running @command{configure} because some
305 @command{/bin/sh} shells have bugs and may crash when configuring the
306 target libraries. In other cases, @command{/bin/sh} or @command{ksh}
307 have disastrous corner-case performance problems. This
308 can cause target @command{configure} runs to literally take days to
309 complete in some cases.
310
311 So on some platforms @command{/bin/ksh} is sufficient, on others it
312 isn't. See the host/target specific instructions for your platform, or
313 use @command{bash} to be sure. Then set @env{CONFIG_SHELL} in your
314 environment to your ``good'' shell prior to running
315 @command{configure}/@command{make}.
316
317 @command{zsh} is not a fully compliant POSIX shell and will not
318 work when configuring GCC@.
319
320 @item A POSIX or SVR4 awk
321
322 Necessary for creating some of the generated source files for GCC@.
323 If in doubt, use a recent GNU awk version, as some of the older ones
324 are broken. GNU awk version 3.1.5 is known to work.
325
326 @item GNU binutils
327
328 Necessary in some circumstances, optional in others. See the
329 host/target specific instructions for your platform for the exact
330 requirements.
331
332 @item gzip version 1.2.4 (or later) or
333 @itemx bzip2 version 1.0.2 (or later)
334
335 Necessary to uncompress GCC @command{tar} files when source code is
336 obtained via HTTPS mirror sites.
337
338 @item GNU make version 3.80 (or later)
339
340 You must have GNU make installed to build GCC@.
341
342 @item GNU tar version 1.14 (or later)
343
344 Necessary (only on some platforms) to untar the source code. Many
345 systems' @command{tar} programs will also work, only try GNU
346 @command{tar} if you have problems.
347
348 @item Perl version between 5.6.1 and 5.6.24
349
350 Necessary when targeting Darwin, building @samp{libstdc++},
351 and not using @option{--disable-symvers}.
352 Necessary when targeting Solaris 2 with Solaris @command{ld} and not using
353 @option{--disable-symvers}.
354
355 Necessary when regenerating @file{Makefile} dependencies in libiberty.
356 Necessary when regenerating @file{libiberty/functions.texi}.
357 Necessary when generating manpages from Texinfo manuals.
358 Used by various scripts to generate some files included in the source
359 repository (mainly Unicode-related and rarely changing) from source
360 tables.
361
362 Used by @command{automake}.
363
364 @end table
365
366 Several support libraries are necessary to build GCC, some are required,
367 others optional. While any sufficiently new version of required tools
368 usually work, library requirements are generally stricter. Newer
369 versions may work in some cases, but it's safer to use the exact
370 versions documented. We appreciate bug reports about problems with
371 newer versions, though. If your OS vendor provides packages for the
372 support libraries then using those packages may be the simplest way to
373 install the libraries.
374
375 @table @asis
376 @item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
377
378 Necessary to build GCC@. If a GMP source distribution is found in a
379 subdirectory of your GCC sources named @file{gmp}, it will be built
380 together with GCC. Alternatively, if GMP is already installed but it
381 is not in your library search path, you will have to configure with the
382 @option{--with-gmp} configure option. See also @option{--with-gmp-lib}
383 and @option{--with-gmp-include}.
384 The in-tree build is only supported with the GMP version that
385 download_prerequisites installs.
386
387 @item MPFR Library version 3.1.0 (or later)
388
389 Necessary to build GCC@. It can be downloaded from
390 @uref{https://www.mpfr.org}. If an MPFR source distribution is found
391 in a subdirectory of your GCC sources named @file{mpfr}, it will be
392 built together with GCC. Alternatively, if MPFR is already installed
393 but it is not in your default library search path, the
394 @option{--with-mpfr} configure option should be used. See also
395 @option{--with-mpfr-lib} and @option{--with-mpfr-include}.
396 The in-tree build is only supported with the MPFR version that
397 download_prerequisites installs.
398
399 @item MPC Library version 1.0.1 (or later)
400
401 Necessary to build GCC@. It can be downloaded from
402 @uref{http://www.multiprecision.org/mpc/}. If an MPC source distribution
403 is found in a subdirectory of your GCC sources named @file{mpc}, it
404 will be built together with GCC. Alternatively, if MPC is already
405 installed but it is not in your default library search path, the
406 @option{--with-mpc} configure option should be used. See also
407 @option{--with-mpc-lib} and @option{--with-mpc-include}.
408 The in-tree build is only supported with the MPC version that
409 download_prerequisites installs.
410
411 @item isl Library version 0.15 or later.
412
413 Necessary to build GCC with the Graphite loop optimizations.
414 It can be downloaded from @uref{https://gcc.gnu.org/pub/gcc/infrastructure/}.
415 If an isl source distribution is found
416 in a subdirectory of your GCC sources named @file{isl}, it will be
417 built together with GCC. Alternatively, the @option{--with-isl} configure
418 option should be used if isl is not installed in your default library
419 search path.
420
421 @item zstd Library.
422
423 Necessary to build GCC with zstd compression used for LTO bytecode.
424 The library is searched in your default library patch search.
425 Alternatively, the @option{--with-zstd} configure option should be used.
426
427 @end table
428
429 @heading Tools/packages necessary for modifying GCC
430 @table @asis
431 @item autoconf version 2.69
432 @itemx GNU m4 version 1.4.6 (or later)
433
434 Necessary when modifying @file{configure.ac}, @file{aclocal.m4}, etc.@:
435 to regenerate @file{configure} and @file{config.in} files.
436
437 @item automake version 1.15.1
438
439 Necessary when modifying a @file{Makefile.am} file to regenerate its
440 associated @file{Makefile.in}.
441
442 Much of GCC does not use automake, so directly edit the @file{Makefile.in}
443 file. Specifically this applies to the @file{gcc}, @file{intl},
444 @file{libcpp}, @file{libiberty}, @file{libobjc} directories as well
445 as any of their subdirectories.
446
447 For directories that use automake, GCC requires the latest release in
448 the 1.15 series, which is currently 1.15.1. When regenerating a directory
449 to a newer version, please update all the directories using an older 1.15
450 to the latest released version.
451
452 @item gettext version 0.14.5 (or later)
453
454 Needed to regenerate @file{gcc.pot}.
455
456 @item gperf version 2.7.2 (or later)
457
458 Necessary when modifying @command{gperf} input files, e.g.@:
459 @file{gcc/cp/cfns.gperf} to regenerate its associated header file, e.g.@:
460 @file{gcc/cp/cfns.h}.
461
462 @item DejaGnu 1.4.4
463 @itemx Expect
464 @itemx Tcl
465
466 Necessary to run the GCC testsuite; see the section on testing for
467 details.
468
469 @item autogen version 5.5.4 (or later) and
470 @itemx guile version 1.4.1 (or later)
471
472 Necessary to regenerate @file{fixinc/fixincl.x} from
473 @file{fixinc/inclhack.def} and @file{fixinc/*.tpl}.
474
475 Necessary to run @samp{make check} for @file{fixinc}.
476
477 Necessary to regenerate the top level @file{Makefile.in} file from
478 @file{Makefile.tpl} and @file{Makefile.def}.
479
480 @item Flex version 2.5.4 (or later)
481
482 Necessary when modifying @file{*.l} files.
483
484 Necessary to build GCC during development because the generated output
485 files are not included in the version-controlled source repository.
486 They are included in releases.
487
488 @item Texinfo version 4.7 (or later)
489
490 Necessary for running @command{makeinfo} when modifying @file{*.texi}
491 files to test your changes.
492
493 Necessary for running @command{make dvi} or @command{make pdf} to
494 create printable documentation in DVI or PDF format. Texinfo version
495 4.8 or later is required for @command{make pdf}.
496
497 Necessary to build GCC documentation during development because the
498 generated output files are not included in the repository. They are
499 included in releases.
500
501 @item @TeX{} (any working version)
502
503 Necessary for running @command{texi2dvi} and @command{texi2pdf}, which
504 are used when running @command{make dvi} or @command{make pdf} to create
505 DVI or PDF files, respectively.
506
507 @item Sphinx version 1.0 (or later)
508
509 Necessary to regenerate @file{jit/docs/_build/texinfo} from the @file{.rst}
510 files in the directories below @file{jit/docs}.
511
512 @item git (any version)
513 @itemx SSH (any version)
514
515 Necessary to access the source repository. Public releases and weekly
516 snapshots of the development sources are also available via HTTPS@.
517
518 @item GNU diffutils version 2.7 (or later)
519
520 Useful when submitting patches for the GCC source code.
521
522 @item patch version 2.5.4 (or later)
523
524 Necessary when applying patches, created with @command{diff}, to one's
525 own sources.
526
527 @end table
528
529 @html
530 <hr />
531 <p>
532 @end html
533 @ifhtml
534 @uref{./index.html,,Return to the GCC Installation page}
535 @end ifhtml
536 @end ifset
537
538 @c ***Downloading the source**************************************************
539 @ifnothtml
540 @comment node-name, next, previous, up
541 @node Downloading the source, Configuration, Prerequisites, Installing GCC
542 @end ifnothtml
543 @ifset downloadhtml
544 @ifnothtml
545 @chapter Downloading GCC
546 @end ifnothtml
547 @cindex Downloading GCC
548 @cindex Downloading the Source
549
550 GCC is distributed via @uref{http://gcc.gnu.org/git.html,,git} and via
551 HTTPS as tarballs compressed with @command{gzip} or @command{bzip2}.
552
553 Please refer to the @uref{http://gcc.gnu.org/releases.html,,releases web page}
554 for information on how to obtain GCC@.
555
556 The source distribution includes the C, C++, Objective-C, Fortran,
557 and Ada (in the case of GCC 3.1 and later) compilers, as well as
558 runtime libraries for C++, Objective-C, and Fortran.
559 For previous versions these were downloadable as separate components such
560 as the core GCC distribution, which included the C language front end and
561 shared components, and language-specific distributions including the
562 language front end and the language runtime (where appropriate).
563
564 If you also intend to build binutils (either to upgrade an existing
565 installation or for use in place of the corresponding tools of your
566 OS), unpack the binutils distribution either in the same directory or
567 a separate one. In the latter case, add symbolic links to any
568 components of the binutils you intend to build alongside the compiler
569 (@file{bfd}, @file{binutils}, @file{gas}, @file{gprof}, @file{ld},
570 @file{opcodes}, @dots{}) to the directory containing the GCC sources.
571
572 Likewise the GMP, MPFR and MPC libraries can be automatically built
573 together with GCC. You may simply run the
574 @command{contrib/download_prerequisites} script in the GCC source directory
575 to set up everything.
576 Otherwise unpack the GMP, MPFR and/or MPC source
577 distributions in the directory containing the GCC sources and rename
578 their directories to @file{gmp}, @file{mpfr} and @file{mpc},
579 respectively (or use symbolic links with the same name).
580
581 @html
582 <hr />
583 <p>
584 @end html
585 @ifhtml
586 @uref{./index.html,,Return to the GCC Installation page}
587 @end ifhtml
588 @end ifset
589
590 @c ***Configuration***********************************************************
591 @ifnothtml
592 @comment node-name, next, previous, up
593 @node Configuration, Building, Downloading the source, Installing GCC
594 @end ifnothtml
595 @ifset configurehtml
596 @ifnothtml
597 @chapter Installing GCC: Configuration
598 @end ifnothtml
599 @cindex Configuration
600 @cindex Installing GCC: Configuration
601
602 Like most GNU software, GCC must be configured before it can be built.
603 This document describes the recommended configuration procedure
604 for both native and cross targets.
605
606 We use @var{srcdir} to refer to the toplevel source directory for
607 GCC; we use @var{objdir} to refer to the toplevel build/object directory.
608
609 If you obtained the sources by cloning the repository, @var{srcdir}
610 must refer to the top @file{gcc} directory, the one where the
611 @file{MAINTAINERS} file can be found, and not its @file{gcc}
612 subdirectory, otherwise the build will fail.
613
614 If either @var{srcdir} or @var{objdir} is located on an automounted NFS
615 file system, the shell's built-in @command{pwd} command will return
616 temporary pathnames. Using these can lead to various sorts of build
617 problems. To avoid this issue, set the @env{PWDCMD} environment
618 variable to an automounter-aware @command{pwd} command, e.g.,
619 @command{pawd} or @samp{amq -w}, during the configuration and build
620 phases.
621
622 First, we @strong{highly} recommend that GCC be built into a
623 separate directory from the sources which does @strong{not} reside
624 within the source tree. This is how we generally build GCC; building
625 where @var{srcdir} == @var{objdir} should still work, but doesn't
626 get extensive testing; building where @var{objdir} is a subdirectory
627 of @var{srcdir} is unsupported.
628
629 If you have previously built GCC in the same directory for a
630 different target machine, do @samp{make distclean} to delete all files
631 that might be invalid. One of the files this deletes is @file{Makefile};
632 if @samp{make distclean} complains that @file{Makefile} does not exist
633 or issues a message like ``don't know how to make distclean'' it probably
634 means that the directory is already suitably clean. However, with the
635 recommended method of building in a separate @var{objdir}, you should
636 simply use a different @var{objdir} for each target.
637
638 Second, when configuring a native system, either @command{cc} or
639 @command{gcc} must be in your path or you must set @env{CC} in
640 your environment before running configure. Otherwise the configuration
641 scripts may fail.
642
643 @ignore
644 Note that the bootstrap compiler and the resulting GCC must be link
645 compatible, else the bootstrap will fail with linker errors about
646 incompatible object file formats. Several multilibed targets are
647 affected by this requirement, see
648 @ifnothtml
649 @ref{Specific, host/target specific installation notes}.
650 @end ifnothtml
651 @ifhtml
652 @uref{specific.html,,host/target specific installation notes}.
653 @end ifhtml
654 @end ignore
655
656 To configure GCC:
657
658 @smallexample
659 % mkdir @var{objdir}
660 % cd @var{objdir}
661 % @var{srcdir}/configure [@var{options}] [@var{target}]
662 @end smallexample
663
664 @heading Distributor options
665
666 If you will be distributing binary versions of GCC, with modifications
667 to the source code, you should use the options described in this
668 section to make clear that your version contains modifications.
669
670 @table @code
671 @item --with-pkgversion=@var{version}
672 Specify a string that identifies your package. You may wish
673 to include a build number or build date. This version string will be
674 included in the output of @command{gcc --version}. This suffix does
675 not replace the default version string, only the @samp{GCC} part.
676
677 The default value is @samp{GCC}.
678
679 @item --with-bugurl=@var{url}
680 Specify the URL that users should visit if they wish to report a bug.
681 You are of course welcome to forward bugs reported to you to the FSF,
682 if you determine that they are not bugs in your modifications.
683
684 The default value refers to the FSF's GCC bug tracker.
685
686 @item --with-documentation-root-url=@var{url}
687 Specify the URL root that contains GCC option documentation. The @var{url}
688 should end with a @code{/} character.
689
690 The default value is @uref{https://gcc.gnu.org/onlinedocs/,,https://gcc.gnu.org/onlinedocs/}.
691
692 @item --with-changes-root-url=@var{url}
693 Specify the URL root that contains information about changes in GCC
694 releases like @code{gcc-@var{version}/changes.html}.
695 The @var{url} should end with a @code{/} character.
696
697 The default value is @uref{https://gcc.gnu.org/,,https://gcc.gnu.org/}.
698
699 @end table
700
701 @heading Target specification
702 @itemize @bullet
703 @item
704 GCC has code to correctly determine the correct value for @var{target}
705 for nearly all native systems. Therefore, we highly recommend you do
706 not provide a configure target when configuring a native compiler.
707
708 @item
709 @var{target} must be specified as @option{--target=@var{target}}
710 when configuring a cross compiler; examples of valid targets would be
711 m68k-elf, sh-elf, etc.
712
713 @item
714 Specifying just @var{target} instead of @option{--target=@var{target}}
715 implies that the host defaults to @var{target}.
716 @end itemize
717
718
719 @heading Options specification
720
721 Use @var{options} to override several configure time options for
722 GCC@. A list of supported @var{options} follows; @samp{configure
723 --help} may list other options, but those not listed below may not
724 work and should not normally be used.
725
726 Note that each @option{--enable} option has a corresponding
727 @option{--disable} option and that each @option{--with} option has a
728 corresponding @option{--without} option.
729
730 @table @code
731 @item --prefix=@var{dirname}
732 Specify the toplevel installation
733 directory. This is the recommended way to install the tools into a directory
734 other than the default. The toplevel installation directory defaults to
735 @file{/usr/local}.
736
737 We @strong{highly} recommend against @var{dirname} being the same or a
738 subdirectory of @var{objdir} or vice versa. If specifying a directory
739 beneath a user's home directory tree, some shells will not expand
740 @var{dirname} correctly if it contains the @samp{~} metacharacter; use
741 @env{$HOME} instead.
742
743 The following standard @command{autoconf} options are supported. Normally you
744 should not need to use these options.
745 @table @code
746 @item --exec-prefix=@var{dirname}
747 Specify the toplevel installation directory for architecture-dependent
748 files. The default is @file{@var{prefix}}.
749
750 @item --bindir=@var{dirname}
751 Specify the installation directory for the executables called by users
752 (such as @command{gcc} and @command{g++}). The default is
753 @file{@var{exec-prefix}/bin}.
754
755 @item --libdir=@var{dirname}
756 Specify the installation directory for object code libraries and
757 internal data files of GCC@. The default is @file{@var{exec-prefix}/lib}.
758
759 @item --libexecdir=@var{dirname}
760 Specify the installation directory for internal executables of GCC@.
761 The default is @file{@var{exec-prefix}/libexec}.
762
763 @item --with-slibdir=@var{dirname}
764 Specify the installation directory for the shared libgcc library. The
765 default is @file{@var{libdir}}.
766
767 @item --datarootdir=@var{dirname}
768 Specify the root of the directory tree for read-only architecture-independent
769 data files referenced by GCC@. The default is @file{@var{prefix}/share}.
770
771 @item --infodir=@var{dirname}
772 Specify the installation directory for documentation in info format.
773 The default is @file{@var{datarootdir}/info}.
774
775 @item --datadir=@var{dirname}
776 Specify the installation directory for some architecture-independent
777 data files referenced by GCC@. The default is @file{@var{datarootdir}}.
778
779 @item --docdir=@var{dirname}
780 Specify the installation directory for documentation files (other
781 than Info) for GCC@. The default is @file{@var{datarootdir}/doc}.
782
783 @item --htmldir=@var{dirname}
784 Specify the installation directory for HTML documentation files.
785 The default is @file{@var{docdir}}.
786
787 @item --pdfdir=@var{dirname}
788 Specify the installation directory for PDF documentation files.
789 The default is @file{@var{docdir}}.
790
791 @item --mandir=@var{dirname}
792 Specify the installation directory for manual pages. The default is
793 @file{@var{datarootdir}/man}. (Note that the manual pages are only extracts
794 from the full GCC manuals, which are provided in Texinfo format. The manpages
795 are derived by an automatic conversion process from parts of the full
796 manual.)
797
798 @item --with-gxx-include-dir=@var{dirname}
799 Specify
800 the installation directory for G++ header files. The default depends
801 on other configuration options, and differs between cross and native
802 configurations.
803
804 @item --with-specs=@var{specs}
805 Specify additional command line driver SPECS.
806 This can be useful if you need to turn on a non-standard feature by
807 default without modifying the compiler's source code, for instance
808 @option{--with-specs=%@{!fcommon:%@{!fno-common:-fno-common@}@}}.
809 @ifnothtml
810 @xref{Spec Files,, Specifying subprocesses and the switches to pass to them,
811 gcc, Using the GNU Compiler Collection (GCC)},
812 @end ifnothtml
813 @ifhtml
814 See ``Spec Files'' in the main manual
815 @end ifhtml
816
817 @end table
818
819 @item --program-prefix=@var{prefix}
820 GCC supports some transformations of the names of its programs when
821 installing them. This option prepends @var{prefix} to the names of
822 programs to install in @var{bindir} (see above). For example, specifying
823 @option{--program-prefix=foo-} would result in @samp{gcc}
824 being installed as @file{/usr/local/bin/foo-gcc}.
825
826 @item --program-suffix=@var{suffix}
827 Appends @var{suffix} to the names of programs to install in @var{bindir}
828 (see above). For example, specifying @option{--program-suffix=-3.1}
829 would result in @samp{gcc} being installed as
830 @file{/usr/local/bin/gcc-3.1}.
831
832 @item --program-transform-name=@var{pattern}
833 Applies the @samp{sed} script @var{pattern} to be applied to the names
834 of programs to install in @var{bindir} (see above). @var{pattern} has to
835 consist of one or more basic @samp{sed} editing commands, separated by
836 semicolons. For example, if you want the @samp{gcc} program name to be
837 transformed to the installed program @file{/usr/local/bin/myowngcc} and
838 the @samp{g++} program name to be transformed to
839 @file{/usr/local/bin/gspecial++} without changing other program names,
840 you could use the pattern
841 @option{--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/'}
842 to achieve this effect.
843
844 All three options can be combined and used together, resulting in more
845 complex conversion patterns. As a basic rule, @var{prefix} (and
846 @var{suffix}) are prepended (appended) before further transformations
847 can happen with a special transformation script @var{pattern}.
848
849 As currently implemented, this option only takes effect for native
850 builds; cross compiler binaries' names are not transformed even when a
851 transformation is explicitly asked for by one of these options.
852
853 For native builds, some of the installed programs are also installed
854 with the target alias in front of their name, as in
855 @samp{i686-pc-linux-gnu-gcc}. All of the above transformations happen
856 before the target alias is prepended to the name---so, specifying
857 @option{--program-prefix=foo-} and @option{program-suffix=-3.1}, the
858 resulting binary would be installed as
859 @file{/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1}.
860
861 As a last shortcoming, none of the installed Ada programs are
862 transformed yet, which will be fixed in some time.
863
864 @item --with-local-prefix=@var{dirname}
865 Specify the
866 installation directory for local include files. The default is
867 @file{/usr/local}. Specify this option if you want the compiler to
868 search directory @file{@var{dirname}/include} for locally installed
869 header files @emph{instead} of @file{/usr/local/include}.
870
871 You should specify @option{--with-local-prefix} @strong{only} if your
872 site has a different convention (not @file{/usr/local}) for where to put
873 site-specific files.
874
875 The default value for @option{--with-local-prefix} is @file{/usr/local}
876 regardless of the value of @option{--prefix}. Specifying
877 @option{--prefix} has no effect on which directory GCC searches for
878 local header files. This may seem counterintuitive, but actually it is
879 logical.
880
881 The purpose of @option{--prefix} is to specify where to @emph{install
882 GCC}. The local header files in @file{/usr/local/include}---if you put
883 any in that directory---are not part of GCC@. They are part of other
884 programs---perhaps many others. (GCC installs its own header files in
885 another directory which is based on the @option{--prefix} value.)
886
887 Both the local-prefix include directory and the GCC-prefix include
888 directory are part of GCC's ``system include'' directories. Although these
889 two directories are not fixed, they need to be searched in the proper
890 order for the correct processing of the include_next directive. The
891 local-prefix include directory is searched before the GCC-prefix
892 include directory. Another characteristic of system include directories
893 is that pedantic warnings are turned off for headers in these directories.
894
895 Some autoconf macros add @option{-I @var{directory}} options to the
896 compiler command line, to ensure that directories containing installed
897 packages' headers are searched. When @var{directory} is one of GCC's
898 system include directories, GCC will ignore the option so that system
899 directories continue to be processed in the correct order. This
900 may result in a search order different from what was specified but the
901 directory will still be searched.
902
903 GCC automatically searches for ordinary libraries using
904 @env{GCC_EXEC_PREFIX}. Thus, when the same installation prefix is
905 used for both GCC and packages, GCC will automatically search for
906 both headers and libraries. This provides a configuration that is
907 easy to use. GCC behaves in a manner similar to that when it is
908 installed as a system compiler in @file{/usr}.
909
910 Sites that need to install multiple versions of GCC may not want to
911 use the above simple configuration. It is possible to use the
912 @option{--program-prefix}, @option{--program-suffix} and
913 @option{--program-transform-name} options to install multiple versions
914 into a single directory, but it may be simpler to use different prefixes
915 and the @option{--with-local-prefix} option to specify the location of the
916 site-specific files for each version. It will then be necessary for
917 users to specify explicitly the location of local site libraries
918 (e.g., with @env{LIBRARY_PATH}).
919
920 The same value can be used for both @option{--with-local-prefix} and
921 @option{--prefix} provided it is not @file{/usr}. This can be used
922 to avoid the default search of @file{/usr/local/include}.
923
924 @strong{Do not} specify @file{/usr} as the @option{--with-local-prefix}!
925 The directory you use for @option{--with-local-prefix} @strong{must not}
926 contain any of the system's standard header files. If it did contain
927 them, certain programs would be miscompiled (including GNU Emacs, on
928 certain targets), because this would override and nullify the header
929 file corrections made by the @command{fixincludes} script.
930
931 Indications are that people who use this option use it based on mistaken
932 ideas of what it is for. People use it as if it specified where to
933 install part of GCC@. Perhaps they make this assumption because
934 installing GCC creates the directory.
935
936 @item --with-gcc-major-version-only
937 Specifies that GCC should use only the major number rather than
938 @var{major}.@var{minor}.@var{patchlevel} in filesystem paths.
939
940 @item --with-native-system-header-dir=@var{dirname}
941 Specifies that @var{dirname} is the directory that contains native system
942 header files, rather than @file{/usr/include}. This option is most useful
943 if you are creating a compiler that should be isolated from the system
944 as much as possible. It is most commonly used with the
945 @option{--with-sysroot} option and will cause GCC to search
946 @var{dirname} inside the system root specified by that option.
947
948 @item --enable-shared[=@var{package}[,@dots{}]]
949 Build shared versions of libraries, if shared libraries are supported on
950 the target platform. Unlike GCC 2.95.x and earlier, shared libraries
951 are enabled by default on all platforms that support shared libraries.
952
953 If a list of packages is given as an argument, build shared libraries
954 only for the listed packages. For other packages, only static libraries
955 will be built. Package names currently recognized in the GCC tree are
956 @samp{libgcc} (also known as @samp{gcc}), @samp{libstdc++} (not
957 @samp{libstdc++-v3}), @samp{libffi}, @samp{zlib}, @samp{boehm-gc},
958 @samp{ada}, @samp{libada}, @samp{libgo}, @samp{libobjc}, and @samp{libphobos}.
959 Note @samp{libiberty} does not support shared libraries at all.
960
961 Use @option{--disable-shared} to build only static libraries. Note that
962 @option{--disable-shared} does not accept a list of package names as
963 argument, only @option{--enable-shared} does.
964
965 Contrast with @option{--enable-host-shared}, which affects @emph{host}
966 code.
967
968 @item --enable-host-shared
969 Specify that the @emph{host} code should be built into position-independent
970 machine code (with -fPIC), allowing it to be used within shared libraries,
971 but yielding a slightly slower compiler.
972
973 This option is required when building the libgccjit.so library.
974
975 Contrast with @option{--enable-shared}, which affects @emph{target}
976 libraries.
977
978 @item @anchor{with-gnu-as}--with-gnu-as
979 Specify that the compiler should assume that the
980 assembler it finds is the GNU assembler. However, this does not modify
981 the rules to find an assembler and will result in confusion if the
982 assembler found is not actually the GNU assembler. (Confusion may also
983 result if the compiler finds the GNU assembler but has not been
984 configured with @option{--with-gnu-as}.) If you have more than one
985 assembler installed on your system, you may want to use this option in
986 connection with @option{--with-as=@var{pathname}} or
987 @option{--with-build-time-tools=@var{pathname}}.
988
989 The following systems are the only ones where it makes a difference
990 whether you use the GNU assembler. On any other system,
991 @option{--with-gnu-as} has no effect.
992
993 @itemize @bullet
994 @item @samp{hppa1.0-@var{any}-@var{any}}
995 @item @samp{hppa1.1-@var{any}-@var{any}}
996 @item @samp{sparc-sun-solaris2.@var{any}}
997 @item @samp{sparc64-@var{any}-solaris2.@var{any}}
998 @end itemize
999
1000 @item @anchor{with-as}--with-as=@var{pathname}
1001 Specify that the compiler should use the assembler pointed to by
1002 @var{pathname}, rather than the one found by the standard rules to find
1003 an assembler, which are:
1004 @itemize @bullet
1005 @item
1006 Unless GCC is being built with a cross compiler, check the
1007 @file{@var{libexec}/gcc/@var{target}/@var{version}} directory.
1008 @var{libexec} defaults to @file{@var{exec-prefix}/libexec};
1009 @var{exec-prefix} defaults to @var{prefix}, which
1010 defaults to @file{/usr/local} unless overridden by the
1011 @option{--prefix=@var{pathname}} switch described above. @var{target}
1012 is the target system triple, such as @samp{sparc-sun-solaris2.7}, and
1013 @var{version} denotes the GCC version, such as 3.0.
1014
1015 @item
1016 If the target system is the same that you are building on, check
1017 operating system specific directories (e.g.@: @file{/usr/ccs/bin} on
1018 Solaris 2).
1019
1020 @item
1021 Check in the @env{PATH} for a tool whose name is prefixed by the
1022 target system triple.
1023
1024 @item
1025 Check in the @env{PATH} for a tool whose name is not prefixed by the
1026 target system triple, if the host and target system triple are
1027 the same (in other words, we use a host tool if it can be used for
1028 the target as well).
1029 @end itemize
1030
1031 You may want to use @option{--with-as} if no assembler
1032 is installed in the directories listed above, or if you have multiple
1033 assemblers installed and want to choose one that is not found by the
1034 above rules.
1035
1036 @item @anchor{with-gnu-ld}--with-gnu-ld
1037 Same as @uref{#with-gnu-as,,@option{--with-gnu-as}}
1038 but for the linker.
1039
1040 @item --with-ld=@var{pathname}
1041 Same as @uref{#with-as,,@option{--with-as}}
1042 but for the linker.
1043
1044 @item --with-stabs
1045 Specify that stabs debugging
1046 information should be used instead of whatever format the host normally
1047 uses. Normally GCC uses the same debug format as the host system.
1048
1049 @item --with-tls=@var{dialect}
1050 Specify the default TLS dialect, for systems were there is a choice.
1051 For ARM targets, possible values for @var{dialect} are @code{gnu} or
1052 @code{gnu2}, which select between the original GNU dialect and the GNU TLS
1053 descriptor-based dialect.
1054
1055 @item --enable-multiarch
1056 Specify whether to enable or disable multiarch support. The default is
1057 to check for glibc start files in a multiarch location, and enable it
1058 if the files are found. The auto detection is enabled for native builds,
1059 and for cross builds configured with @option{--with-sysroot}, and without
1060 @option{--with-native-system-header-dir}.
1061 More documentation about multiarch can be found at
1062 @uref{https://wiki.debian.org/Multiarch}.
1063
1064 @item --enable-sjlj-exceptions
1065 Force use of the @code{setjmp}/@code{longjmp}-based scheme for exceptions.
1066 @samp{configure} ordinarily picks the correct value based on the platform.
1067 Only use this option if you are sure you need a different setting.
1068
1069 @item --enable-vtable-verify
1070 Specify whether to enable or disable the vtable verification feature.
1071 Enabling this feature causes libstdc++ to be built with its virtual calls
1072 in verifiable mode. This means that, when linked with libvtv, every
1073 virtual call in libstdc++ will verify the vtable pointer through which the
1074 call will be made before actually making the call. If not linked with libvtv,
1075 the verifier will call stub functions (in libstdc++ itself) and do nothing.
1076 If vtable verification is disabled, then libstdc++ is not built with its
1077 virtual calls in verifiable mode at all. However the libvtv library will
1078 still be built (see @option{--disable-libvtv} to turn off building libvtv).
1079 @option{--disable-vtable-verify} is the default.
1080
1081 @item --disable-gcov
1082 Specify that the run-time library used for coverage analysis
1083 and associated host tools should not be built.
1084
1085 @item --disable-multilib
1086 Specify that multiple target
1087 libraries to support different target variants, calling
1088 conventions, etc.@: should not be built. The default is to build a
1089 predefined set of them.
1090
1091 Some targets provide finer-grained control over which multilibs are built
1092 (e.g., @option{--disable-softfloat}):
1093 @table @code
1094 @item arm-*-*
1095 fpu, 26bit, underscore, interwork, biendian, nofmult.
1096
1097 @item m68*-*-*
1098 softfloat, m68881, m68000, m68020.
1099
1100 @item mips*-*-*
1101 single-float, biendian, softfloat.
1102
1103 @item msp430-*-*
1104 no-exceptions
1105
1106 @item powerpc*-*-*, rs6000*-*-*
1107 aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian,
1108 sysv, aix.
1109
1110 @end table
1111
1112 @item --with-multilib-list=@var{list}
1113 @itemx --without-multilib-list
1114 Specify what multilibs to build. @var{list} is a comma separated list of
1115 values, possibly consisting of a single value. Currently only implemented
1116 for aarch64*-*-*, arm*-*-*, riscv*-*-*, sh*-*-* and x86-64-*-linux*. The
1117 accepted values and meaning for each target is given below.
1118
1119 @table @code
1120 @item aarch64*-*-*
1121 @var{list} is a comma separated list of @code{ilp32}, and @code{lp64}
1122 to enable ILP32 and LP64 run-time libraries, respectively. If
1123 @var{list} is empty, then there will be no multilibs and only the
1124 default run-time library will be built. If @var{list} is
1125 @code{default} or --with-multilib-list= is not specified, then the
1126 default set of libraries is selected based on the value of
1127 @option{--target}.
1128
1129 @item arm*-*-*
1130 @var{list} is a comma separated list of @code{aprofile} and
1131 @code{rmprofile} to build multilibs for A or R and M architecture
1132 profiles respectively. Note that, due to some limitation of the current
1133 multilib framework, using the combined @code{aprofile,rmprofile}
1134 multilibs selects in some cases a less optimal multilib than when using
1135 the multilib profile for the architecture targetted. The special value
1136 @code{default} is also accepted and is equivalent to omitting the
1137 option, i.e., only the default run-time library will be enabled.
1138
1139 @var{list} may instead contain @code{@@name}, to use the multilib
1140 configuration Makefile fragment @file{name} in @file{gcc/config/arm} in
1141 the source tree (it is part of the corresponding sources, after all).
1142 It is recommended, but not required, that files used for this purpose to
1143 be named starting with @file{t-ml-}, to make their intended purpose
1144 self-evident, in line with GCC conventions. Such files enable custom,
1145 user-chosen multilib lists to be configured. Whether multiple such
1146 files can be used together depends on the contents of the supplied
1147 files. See @file{gcc/config/arm/t-multilib} and its supplementary
1148 @file{gcc/config/arm/t-*profile} files for an example of what such
1149 Makefile fragments might look like for this version of GCC. The macros
1150 expected to be defined in these fragments are not stable across GCC
1151 releases, so make sure they define the @code{MULTILIB}-related macros
1152 expected by the version of GCC you are building.
1153 @ifnothtml
1154 @xref{Target Fragment,, Target Makefile Fragments, gccint, GNU Compiler
1155 Collection (GCC) Internals}.
1156 @end ifnothtml
1157 @ifhtml
1158 See ``Target Makefile Fragments'' in the internals manual.
1159 @end ifhtml
1160
1161 The table below gives the combination of ISAs, architectures, FPUs and
1162 floating-point ABIs for which multilibs are built for each predefined
1163 profile. The union of these options is considered when specifying both
1164 @code{aprofile} and @code{rmprofile}.
1165
1166 @multitable @columnfractions .15 .28 .30
1167 @item Option @tab aprofile @tab rmprofile
1168 @item ISAs
1169 @tab @code{-marm} and @code{-mthumb}
1170 @tab @code{-mthumb}
1171 @item Architectures@*@*@*@*@*@*
1172 @tab default architecture@*
1173 @code{-march=armv7-a}@*
1174 @code{-march=armv7ve}@*
1175 @code{-march=armv8-a}@*@*@*
1176 @tab default architecture@*
1177 @code{-march=armv6s-m}@*
1178 @code{-march=armv7-m}@*
1179 @code{-march=armv7e-m}@*
1180 @code{-march=armv8-m.base}@*
1181 @code{-march=armv8-m.main}@*
1182 @code{-march=armv7}
1183 @item FPUs@*@*@*@*@*
1184 @tab none@*
1185 @code{-mfpu=vfpv3-d16}@*
1186 @code{-mfpu=neon}@*
1187 @code{-mfpu=vfpv4-d16}@*
1188 @code{-mfpu=neon-vfpv4}@*
1189 @code{-mfpu=neon-fp-armv8}
1190 @tab none@*
1191 @code{-mfpu=vfpv3-d16}@*
1192 @code{-mfpu=fpv4-sp-d16}@*
1193 @code{-mfpu=fpv5-sp-d16}@*
1194 @code{-mfpu=fpv5-d16}@*
1195 @item floating-point@/ ABIs@*@*
1196 @tab @code{-mfloat-abi=soft}@*
1197 @code{-mfloat-abi=softfp}@*
1198 @code{-mfloat-abi=hard}
1199 @tab @code{-mfloat-abi=soft}@*
1200 @code{-mfloat-abi=softfp}@*
1201 @code{-mfloat-abi=hard}
1202 @end multitable
1203
1204 @item riscv*-*-*
1205 @var{list} is a single ABI name. The target architecture must be either
1206 @code{rv32gc} or @code{rv64gc}. This will build a single multilib for the
1207 specified architecture and ABI pair. If @code{--with-multilib-list} is not
1208 given, then a default set of multilibs is selected based on the value of
1209 @option{--target}. This is usually a large set of multilibs.
1210
1211 @item sh*-*-*
1212 @var{list} is a comma separated list of CPU names. These must be of the
1213 form @code{sh*} or @code{m*} (in which case they match the compiler option
1214 for that processor). The list should not contain any endian options -
1215 these are handled by @option{--with-endian}.
1216
1217 If @var{list} is empty, then there will be no multilibs for extra
1218 processors. The multilib for the secondary endian remains enabled.
1219
1220 As a special case, if an entry in the list starts with a @code{!}
1221 (exclamation point), then it is added to the list of excluded multilibs.
1222 Entries of this sort should be compatible with @samp{MULTILIB_EXCLUDES}
1223 (once the leading @code{!} has been stripped).
1224
1225 If @option{--with-multilib-list} is not given, then a default set of
1226 multilibs is selected based on the value of @option{--target}. This is
1227 usually the complete set of libraries, but some targets imply a more
1228 specialized subset.
1229
1230 Example 1: to configure a compiler for SH4A only, but supporting both
1231 endians, with little endian being the default:
1232 @smallexample
1233 --with-cpu=sh4a --with-endian=little,big --with-multilib-list=
1234 @end smallexample
1235
1236 Example 2: to configure a compiler for both SH4A and SH4AL-DSP, but with
1237 only little endian SH4AL:
1238 @smallexample
1239 --with-cpu=sh4a --with-endian=little,big \
1240 --with-multilib-list=sh4al,!mb/m4al
1241 @end smallexample
1242
1243 @item x86-64-*-linux*
1244 @var{list} is a comma separated list of @code{m32}, @code{m64} and
1245 @code{mx32} to enable 32-bit, 64-bit and x32 run-time libraries,
1246 respectively. If @var{list} is empty, then there will be no multilibs
1247 and only the default run-time library will be enabled.
1248
1249 If @option{--with-multilib-list} is not given, then only 32-bit and
1250 64-bit run-time libraries will be enabled.
1251 @end table
1252
1253 @item --with-endian=@var{endians}
1254 Specify what endians to use.
1255 Currently only implemented for sh*-*-*.
1256
1257 @var{endians} may be one of the following:
1258 @table @code
1259 @item big
1260 Use big endian exclusively.
1261 @item little
1262 Use little endian exclusively.
1263 @item big,little
1264 Use big endian by default. Provide a multilib for little endian.
1265 @item little,big
1266 Use little endian by default. Provide a multilib for big endian.
1267 @end table
1268
1269 @item --enable-threads
1270 Specify that the target
1271 supports threads. This affects the Objective-C compiler and runtime
1272 library, and exception handling for other languages like C++.
1273 On some systems, this is the default.
1274
1275 In general, the best (and, in many cases, the only known) threading
1276 model available will be configured for use. Beware that on some
1277 systems, GCC has not been taught what threading models are generally
1278 available for the system. In this case, @option{--enable-threads} is an
1279 alias for @option{--enable-threads=single}.
1280
1281 @item --disable-threads
1282 Specify that threading support should be disabled for the system.
1283 This is an alias for @option{--enable-threads=single}.
1284
1285 @item --enable-threads=@var{lib}
1286 Specify that
1287 @var{lib} is the thread support library. This affects the Objective-C
1288 compiler and runtime library, and exception handling for other languages
1289 like C++. The possibilities for @var{lib} are:
1290
1291 @table @code
1292 @item aix
1293 AIX thread support.
1294 @item dce
1295 DCE thread support.
1296 @item lynx
1297 LynxOS thread support.
1298 @item mipssde
1299 MIPS SDE thread support.
1300 @item no
1301 This is an alias for @samp{single}.
1302 @item posix
1303 Generic POSIX/Unix98 thread support.
1304 @item rtems
1305 RTEMS thread support.
1306 @item single
1307 Disable thread support, should work for all platforms.
1308 @item tpf
1309 TPF thread support.
1310 @item vxworks
1311 VxWorks thread support.
1312 @item win32
1313 Microsoft Win32 API thread support.
1314 @end table
1315
1316 @item --enable-tls
1317 Specify that the target supports TLS (Thread Local Storage). Usually
1318 configure can correctly determine if TLS is supported. In cases where
1319 it guesses incorrectly, TLS can be explicitly enabled or disabled with
1320 @option{--enable-tls} or @option{--disable-tls}. This can happen if
1321 the assembler supports TLS but the C library does not, or if the
1322 assumptions made by the configure test are incorrect.
1323
1324 @item --disable-tls
1325 Specify that the target does not support TLS.
1326 This is an alias for @option{--enable-tls=no}.
1327
1328 @item --disable-tm-clone-registry
1329 Disable TM clone registry in libgcc. It is enabled in libgcc by default.
1330 This option helps to reduce code size for embedded targets which do
1331 not use transactional memory.
1332
1333 @item --with-cpu=@var{cpu}
1334 @itemx --with-cpu-32=@var{cpu}
1335 @itemx --with-cpu-64=@var{cpu}
1336 Specify which cpu variant the compiler should generate code for by default.
1337 @var{cpu} will be used as the default value of the @option{-mcpu=} switch.
1338 This option is only supported on some targets, including ARC, ARM, i386, M68k,
1339 PowerPC, and SPARC@. It is mandatory for ARC@. The @option{--with-cpu-32} and
1340 @option{--with-cpu-64} options specify separate default CPUs for
1341 32-bit and 64-bit modes; these options are only supported for i386,
1342 x86-64, PowerPC, and SPARC@.
1343
1344 @item --with-schedule=@var{cpu}
1345 @itemx --with-arch=@var{cpu}
1346 @itemx --with-arch-32=@var{cpu}
1347 @itemx --with-arch-64=@var{cpu}
1348 @itemx --with-tune=@var{cpu}
1349 @itemx --with-tune-32=@var{cpu}
1350 @itemx --with-tune-64=@var{cpu}
1351 @itemx --with-abi=@var{abi}
1352 @itemx --with-fpu=@var{type}
1353 @itemx --with-float=@var{type}
1354 These configure options provide default values for the @option{-mschedule=},
1355 @option{-march=}, @option{-mtune=}, @option{-mabi=}, and @option{-mfpu=}
1356 options and for @option{-mhard-float} or @option{-msoft-float}. As with
1357 @option{--with-cpu}, which switches will be accepted and acceptable values
1358 of the arguments depend on the target.
1359
1360 @item --with-mode=@var{mode}
1361 Specify if the compiler should default to @option{-marm} or @option{-mthumb}.
1362 This option is only supported on ARM targets.
1363
1364 @item --with-stack-offset=@var{num}
1365 This option sets the default for the -mstack-offset=@var{num} option,
1366 and will thus generally also control the setting of this option for
1367 libraries. This option is only supported on Epiphany targets.
1368
1369 @item --with-fpmath=@var{isa}
1370 This options sets @option{-mfpmath=sse} by default and specifies the default
1371 ISA for floating-point arithmetics. You can select either @samp{sse} which
1372 enables @option{-msse2} or @samp{avx} which enables @option{-mavx} by default.
1373 This option is only supported on i386 and x86-64 targets.
1374
1375 @item --with-fp-32=@var{mode}
1376 On MIPS targets, set the default value for the @option{-mfp} option when using
1377 the o32 ABI. The possibilities for @var{mode} are:
1378 @table @code
1379 @item 32
1380 Use the o32 FP32 ABI extension, as with the @option{-mfp32} command-line
1381 option.
1382 @item xx
1383 Use the o32 FPXX ABI extension, as with the @option{-mfpxx} command-line
1384 option.
1385 @item 64
1386 Use the o32 FP64 ABI extension, as with the @option{-mfp64} command-line
1387 option.
1388 @end table
1389 In the absence of this configuration option the default is to use the o32
1390 FP32 ABI extension.
1391
1392 @item --with-odd-spreg-32
1393 On MIPS targets, set the @option{-modd-spreg} option by default when using
1394 the o32 ABI.
1395
1396 @item --without-odd-spreg-32
1397 On MIPS targets, set the @option{-mno-odd-spreg} option by default when using
1398 the o32 ABI. This is normally used in conjunction with
1399 @option{--with-fp-32=64} in order to target the o32 FP64A ABI extension.
1400
1401 @item --with-nan=@var{encoding}
1402 On MIPS targets, set the default encoding convention to use for the
1403 special not-a-number (NaN) IEEE 754 floating-point data. The
1404 possibilities for @var{encoding} are:
1405 @table @code
1406 @item legacy
1407 Use the legacy encoding, as with the @option{-mnan=legacy} command-line
1408 option.
1409 @item 2008
1410 Use the 754-2008 encoding, as with the @option{-mnan=2008} command-line
1411 option.
1412 @end table
1413 To use this configuration option you must have an assembler version
1414 installed that supports the @option{-mnan=} command-line option too.
1415 In the absence of this configuration option the default convention is
1416 the legacy encoding, as when neither of the @option{-mnan=2008} and
1417 @option{-mnan=legacy} command-line options has been used.
1418
1419 @item --with-divide=@var{type}
1420 Specify how the compiler should generate code for checking for
1421 division by zero. This option is only supported on the MIPS target.
1422 The possibilities for @var{type} are:
1423 @table @code
1424 @item traps
1425 Division by zero checks use conditional traps (this is the default on
1426 systems that support conditional traps).
1427 @item breaks
1428 Division by zero checks use the break instruction.
1429 @end table
1430
1431 @c If you make --with-llsc the default for additional targets,
1432 @c update the --with-llsc description in the MIPS section below.
1433
1434 @item --with-llsc
1435 On MIPS targets, make @option{-mllsc} the default when no
1436 @option{-mno-llsc} option is passed. This is the default for
1437 Linux-based targets, as the kernel will emulate them if the ISA does
1438 not provide them.
1439
1440 @item --without-llsc
1441 On MIPS targets, make @option{-mno-llsc} the default when no
1442 @option{-mllsc} option is passed.
1443
1444 @item --with-synci
1445 On MIPS targets, make @option{-msynci} the default when no
1446 @option{-mno-synci} option is passed.
1447
1448 @item --without-synci
1449 On MIPS targets, make @option{-mno-synci} the default when no
1450 @option{-msynci} option is passed. This is the default.
1451
1452 @item --with-lxc1-sxc1
1453 On MIPS targets, make @option{-mlxc1-sxc1} the default when no
1454 @option{-mno-lxc1-sxc1} option is passed. This is the default.
1455
1456 @item --without-lxc1-sxc1
1457 On MIPS targets, make @option{-mno-lxc1-sxc1} the default when no
1458 @option{-mlxc1-sxc1} option is passed. The indexed load/store
1459 instructions are not directly a problem but can lead to unexpected
1460 behaviour when deployed in an application intended for a 32-bit address
1461 space but run on a 64-bit processor. The issue is seen because all
1462 known MIPS 64-bit Linux kernels execute o32 and n32 applications
1463 with 64-bit addressing enabled which affects the overflow behaviour
1464 of the indexed addressing mode. GCC will assume that ordinary
1465 32-bit arithmetic overflow behaviour is the same whether performed
1466 as an @code{addu} instruction or as part of the address calculation
1467 in @code{lwxc1} type instructions. This assumption holds true in a
1468 pure 32-bit environment and can hold true in a 64-bit environment if
1469 the address space is accurately set to be 32-bit for o32 and n32.
1470
1471 @item --with-madd4
1472 On MIPS targets, make @option{-mmadd4} the default when no
1473 @option{-mno-madd4} option is passed. This is the default.
1474
1475 @item --without-madd4
1476 On MIPS targets, make @option{-mno-madd4} the default when no
1477 @option{-mmadd4} option is passed. The @code{madd4} instruction
1478 family can be problematic when targeting a combination of cores that
1479 implement these instructions differently. There are two known cores
1480 that implement these as fused operations instead of unfused (where
1481 unfused is normally expected). Disabling these instructions is the
1482 only way to ensure compatible code is generated; this will incur
1483 a performance penalty.
1484
1485 @item --with-mips-plt
1486 On MIPS targets, make use of copy relocations and PLTs.
1487 These features are extensions to the traditional
1488 SVR4-based MIPS ABIs and require support from GNU binutils
1489 and the runtime C library.
1490
1491 @item --with-stack-clash-protection-guard-size=@var{size}
1492 On certain targets this option sets the default stack clash protection guard
1493 size as a power of two in bytes. On AArch64 @var{size} is required to be either
1494 12 (4KB) or 16 (64KB).
1495
1496 @item --enable-__cxa_atexit
1497 Define if you want to use __cxa_atexit, rather than atexit, to
1498 register C++ destructors for local statics and global objects.
1499 This is essential for fully standards-compliant handling of
1500 destructors, but requires __cxa_atexit in libc. This option is currently
1501 only available on systems with GNU libc. When enabled, this will cause
1502 @option{-fuse-cxa-atexit} to be passed by default.
1503
1504 @item --enable-gnu-indirect-function
1505 Define if you want to enable the @code{ifunc} attribute. This option is
1506 currently only available on systems with GNU libc on certain targets.
1507
1508 @item --enable-target-optspace
1509 Specify that target
1510 libraries should be optimized for code space instead of code speed.
1511 This is the default for the m32r platform.
1512
1513 @item --with-cpp-install-dir=@var{dirname}
1514 Specify that the user visible @command{cpp} program should be installed
1515 in @file{@var{prefix}/@var{dirname}/cpp}, in addition to @var{bindir}.
1516
1517 @item --enable-comdat
1518 Enable COMDAT group support. This is primarily used to override the
1519 automatically detected value.
1520
1521 @item --enable-initfini-array
1522 Force the use of sections @code{.init_array} and @code{.fini_array}
1523 (instead of @code{.init} and @code{.fini}) for constructors and
1524 destructors. Option @option{--disable-initfini-array} has the
1525 opposite effect. If neither option is specified, the configure script
1526 will try to guess whether the @code{.init_array} and
1527 @code{.fini_array} sections are supported and, if they are, use them.
1528
1529 @item --enable-link-mutex
1530 When building GCC, use a mutex to avoid linking the compilers for
1531 multiple languages at the same time, to avoid thrashing on build
1532 systems with limited free memory. The default is not to use such a mutex.
1533
1534 @item --enable-maintainer-mode
1535 The build rules that regenerate the Autoconf and Automake output files as
1536 well as the GCC master message catalog @file{gcc.pot} are normally
1537 disabled. This is because it can only be rebuilt if the complete source
1538 tree is present. If you have changed the sources and want to rebuild the
1539 catalog, configuring with @option{--enable-maintainer-mode} will enable
1540 this. Note that you need a recent version of the @code{gettext} tools
1541 to do so.
1542
1543 @item --disable-bootstrap
1544 For a native build, the default configuration is to perform
1545 a 3-stage bootstrap of the compiler when @samp{make} is invoked,
1546 testing that GCC can compile itself correctly. If you want to disable
1547 this process, you can configure with @option{--disable-bootstrap}.
1548
1549 @item --enable-bootstrap
1550 In special cases, you may want to perform a 3-stage build
1551 even if the target and host triplets are different.
1552 This is possible when the host can run code compiled for
1553 the target (e.g.@: host is i686-linux, target is i486-linux).
1554 Starting from GCC 4.2, to do this you have to configure explicitly
1555 with @option{--enable-bootstrap}.
1556
1557 @item --enable-generated-files-in-srcdir
1558 Neither the .c and .h files that are generated from Bison and flex nor the
1559 info manuals and man pages that are built from the .texi files are present
1560 in the repository development tree. When building GCC from that development tree,
1561 or from one of our snapshots, those generated files are placed in your
1562 build directory, which allows for the source to be in a readonly
1563 directory.
1564
1565 If you configure with @option{--enable-generated-files-in-srcdir} then those
1566 generated files will go into the source directory. This is mainly intended
1567 for generating release or prerelease tarballs of the GCC sources, since it
1568 is not a requirement that the users of source releases to have flex, Bison,
1569 or makeinfo.
1570
1571 @item --enable-version-specific-runtime-libs
1572 Specify
1573 that runtime libraries should be installed in the compiler specific
1574 subdirectory (@file{@var{libdir}/gcc}) rather than the usual places. In
1575 addition, @samp{libstdc++}'s include files will be installed into
1576 @file{@var{libdir}} unless you overruled it by using
1577 @option{--with-gxx-include-dir=@var{dirname}}. Using this option is
1578 particularly useful if you intend to use several versions of GCC in
1579 parallel. The default is @samp{yes} for @samp{libada}, and @samp{no} for
1580 the remaining libraries.
1581
1582 @item @anchor{WithAixSoname}--with-aix-soname=@samp{aix}, @samp{svr4} or @samp{both}
1583 Traditional AIX shared library versioning (versioned @code{Shared Object}
1584 files as members of unversioned @code{Archive Library} files named
1585 @samp{lib.a}) causes numerous headaches for package managers. However,
1586 @code{Import Files} as members of @code{Archive Library} files allow for
1587 @strong{filename-based versioning} of shared libraries as seen on Linux/SVR4,
1588 where this is called the "SONAME". But as they prevent static linking,
1589 @code{Import Files} may be used with @code{Runtime Linking} only, where the
1590 linker does search for @samp{libNAME.so} before @samp{libNAME.a} library
1591 filenames with the @samp{-lNAME} linker flag.
1592
1593 @anchor{AixLdCommand}For detailed information please refer to the AIX
1594 @uref{https://www.ibm.com/support/knowledgecenter/search/%22the%20ld%20command%2C%20also%20called%20the%20linkage%20editor%20or%20binder%22,,ld
1595 Command} reference.
1596
1597 As long as shared library creation is enabled, upon:
1598 @table @code
1599 @item --with-aix-soname=aix
1600 @item --with-aix-soname=both
1601 A (traditional AIX) @code{Shared Archive Library} file is created:
1602 @itemize @bullet
1603 @item using the @samp{libNAME.a} filename scheme
1604 @item with the @code{Shared Object} file as archive member named
1605 @samp{libNAME.so.V} (except for @samp{libgcc_s}, where the @code{Shared
1606 Object} file is named @samp{shr.o} for backwards compatibility), which
1607 @itemize @minus
1608 @item is used for runtime loading from inside the @samp{libNAME.a} file
1609 @item is used for dynamic loading via
1610 @code{dlopen("libNAME.a(libNAME.so.V)", RTLD_MEMBER)}
1611 @item is used for shared linking
1612 @item is used for static linking, so no separate @code{Static Archive
1613 Library} file is needed
1614 @end itemize
1615 @end itemize
1616 @item --with-aix-soname=both
1617 @item --with-aix-soname=svr4
1618 A (second) @code{Shared Archive Library} file is created:
1619 @itemize @bullet
1620 @item using the @samp{libNAME.so.V} filename scheme
1621 @item with the @code{Shared Object} file as archive member named
1622 @samp{shr.o}, which
1623 @itemize @minus
1624 @item is created with the @code{-G linker flag}
1625 @item has the @code{F_LOADONLY} flag set
1626 @item is used for runtime loading from inside the @samp{libNAME.so.V} file
1627 @item is used for dynamic loading via @code{dlopen("libNAME.so.V(shr.o)",
1628 RTLD_MEMBER)}
1629 @end itemize
1630 @item with the @code{Import File} as archive member named @samp{shr.imp},
1631 which
1632 @itemize @minus
1633 @item refers to @samp{libNAME.so.V(shr.o)} as the "SONAME", to be recorded
1634 in the @code{Loader Section} of subsequent binaries
1635 @item indicates whether @samp{libNAME.so.V(shr.o)} is 32 or 64 bit
1636 @item lists all the public symbols exported by @samp{lib.so.V(shr.o)},
1637 eventually decorated with the @code{@samp{weak} Keyword}
1638 @item is necessary for shared linking against @samp{lib.so.V(shr.o)}
1639 @end itemize
1640 @end itemize
1641 A symbolic link using the @samp{libNAME.so} filename scheme is created:
1642 @itemize @bullet
1643 @item pointing to the @samp{libNAME.so.V} @code{Shared Archive Library} file
1644 @item to permit the @code{ld Command} to find @samp{lib.so.V(shr.imp)} via
1645 the @samp{-lNAME} argument (requires @code{Runtime Linking} to be enabled)
1646 @item to permit dynamic loading of @samp{lib.so.V(shr.o)} without the need
1647 to specify the version number via @code{dlopen("libNAME.so(shr.o)",
1648 RTLD_MEMBER)}
1649 @end itemize
1650 @end table
1651
1652 As long as static library creation is enabled, upon:
1653 @table @code
1654 @item --with-aix-soname=svr4
1655 A @code{Static Archive Library} is created:
1656 @itemize @bullet
1657 @item using the @samp{libNAME.a} filename scheme
1658 @item with all the @code{Static Object} files as archive members, which
1659 @itemize @minus
1660 @item are used for static linking
1661 @end itemize
1662 @end itemize
1663 @end table
1664
1665 While the aix-soname=@samp{svr4} option does not create @code{Shared Object}
1666 files as members of unversioned @code{Archive Library} files any more, package
1667 managers still are responsible to
1668 @uref{./specific.html#TransferAixShobj,,transfer} @code{Shared Object} files
1669 found as member of a previously installed unversioned @code{Archive Library}
1670 file into the newly installed @code{Archive Library} file with the same
1671 filename.
1672
1673 @emph{WARNING:} Creating @code{Shared Object} files with @code{Runtime Linking}
1674 enabled may bloat the TOC, eventually leading to @code{TOC overflow} errors,
1675 requiring the use of either the @option{-Wl,-bbigtoc} linker flag (seen to
1676 break with the @code{GDB} debugger) or some of the TOC-related compiler flags,
1677 @ifnothtml
1678 @xref{RS/6000 and PowerPC Options,, RS/6000 and PowerPC Options, gcc,
1679 Using the GNU Compiler Collection (GCC)}.
1680 @end ifnothtml
1681 @ifhtml
1682 see ``RS/6000 and PowerPC Options'' in the main manual.
1683 @end ifhtml
1684
1685 @option{--with-aix-soname} is currently supported by @samp{libgcc_s} only, so
1686 this option is still experimental and not for normal use yet.
1687
1688 Default is the traditional behavior @option{--with-aix-soname=@samp{aix}}.
1689
1690 @item --enable-languages=@var{lang1},@var{lang2},@dots{}
1691 Specify that only a particular subset of compilers and
1692 their runtime libraries should be built. For a list of valid values for
1693 @var{langN} you can issue the following command in the
1694 @file{gcc} directory of your GCC source tree:@*
1695 @smallexample
1696 grep ^language= */config-lang.in
1697 @end smallexample
1698 Currently, you can use any of the following:
1699 @code{all}, @code{default}, @code{ada}, @code{c}, @code{c++}, @code{d},
1700 @code{fortran}, @code{go}, @code{jit}, @code{lto}, @code{objc}, @code{obj-c++}.
1701 Building the Ada compiler has special requirements, see below.
1702 If you do not pass this flag, or specify the option @code{default}, then the
1703 default languages available in the @file{gcc} sub-tree will be configured.
1704 Ada, D, Go, Jit, and Objective-C++ are not default languages. LTO is not a
1705 default language, but is built by default because @option{--enable-lto} is
1706 enabled by default. The other languages are default languages. If
1707 @code{all} is specified, then all available languages are built. An
1708 exception is @code{jit} language, which requires
1709 @option{--enable-host-shared} to be included with @code{all}.
1710
1711 @item --enable-stage1-languages=@var{lang1},@var{lang2},@dots{}
1712 Specify that a particular subset of compilers and their runtime
1713 libraries should be built with the system C compiler during stage 1 of
1714 the bootstrap process, rather than only in later stages with the
1715 bootstrapped C compiler. The list of valid values is the same as for
1716 @option{--enable-languages}, and the option @code{all} will select all
1717 of the languages enabled by @option{--enable-languages}. This option is
1718 primarily useful for GCC development; for instance, when a development
1719 version of the compiler cannot bootstrap due to compiler bugs, or when
1720 one is debugging front ends other than the C front end. When this
1721 option is used, one can then build the target libraries for the
1722 specified languages with the stage-1 compiler by using @command{make
1723 stage1-bubble all-target}, or run the testsuite on the stage-1 compiler
1724 for the specified languages using @command{make stage1-start check-gcc}.
1725
1726 @item --disable-libada
1727 Specify that the run-time libraries and tools used by GNAT should not
1728 be built. This can be useful for debugging, or for compatibility with
1729 previous Ada build procedures, when it was required to explicitly
1730 do a @samp{make -C gcc gnatlib_and_tools}.
1731
1732 @item --disable-libsanitizer
1733 Specify that the run-time libraries for the various sanitizers should
1734 not be built.
1735
1736 @item --disable-libssp
1737 Specify that the run-time libraries for stack smashing protection
1738 should not be built or linked against. On many targets library support
1739 is provided by the C library instead.
1740
1741 @item --disable-libquadmath
1742 Specify that the GCC quad-precision math library should not be built.
1743 On some systems, the library is required to be linkable when building
1744 the Fortran front end, unless @option{--disable-libquadmath-support}
1745 is used.
1746
1747 @item --disable-libquadmath-support
1748 Specify that the Fortran front end and @code{libgfortran} do not add
1749 support for @code{libquadmath} on systems supporting it.
1750
1751 @item --disable-libgomp
1752 Specify that the GNU Offloading and Multi Processing Runtime Library
1753 should not be built.
1754
1755 @item --disable-libvtv
1756 Specify that the run-time libraries used by vtable verification
1757 should not be built.
1758
1759 @item --with-dwarf2
1760 Specify that the compiler should
1761 use DWARF 2 debugging information as the default.
1762
1763 @item --with-advance-toolchain=@var{at}
1764 On 64-bit PowerPC Linux systems, configure the compiler to use the
1765 header files, library files, and the dynamic linker from the Advance
1766 Toolchain release @var{at} instead of the default versions that are
1767 provided by the Linux distribution. In general, this option is
1768 intended for the developers of GCC, and it is not intended for general
1769 use.
1770
1771 @item --enable-targets=all
1772 @itemx --enable-targets=@var{target_list}
1773 Some GCC targets, e.g.@: powerpc64-linux, build bi-arch compilers.
1774 These are compilers that are able to generate either 64-bit or 32-bit
1775 code. Typically, the corresponding 32-bit target, e.g.@:
1776 powerpc-linux for powerpc64-linux, only generates 32-bit code. This
1777 option enables the 32-bit target to be a bi-arch compiler, which is
1778 useful when you want a bi-arch compiler that defaults to 32-bit, and
1779 you are building a bi-arch or multi-arch binutils in a combined tree.
1780 On mips-linux, this will build a tri-arch compiler (ABI o32/n32/64),
1781 defaulted to o32.
1782 Currently, this option only affects sparc-linux, powerpc-linux, x86-linux,
1783 mips-linux and s390-linux.
1784
1785 @item --enable-default-pie
1786 Turn on @option{-fPIE} and @option{-pie} by default.
1787
1788 @item --enable-secureplt
1789 This option enables @option{-msecure-plt} by default for powerpc-linux.
1790 @ifnothtml
1791 @xref{RS/6000 and PowerPC Options,, RS/6000 and PowerPC Options, gcc,
1792 Using the GNU Compiler Collection (GCC)},
1793 @end ifnothtml
1794 @ifhtml
1795 See ``RS/6000 and PowerPC Options'' in the main manual
1796 @end ifhtml
1797
1798 @item --enable-default-ssp
1799 Turn on @option{-fstack-protector-strong} by default.
1800
1801 @item --enable-cld
1802 This option enables @option{-mcld} by default for 32-bit x86 targets.
1803 @ifnothtml
1804 @xref{i386 and x86-64 Options,, i386 and x86-64 Options, gcc,
1805 Using the GNU Compiler Collection (GCC)},
1806 @end ifnothtml
1807 @ifhtml
1808 See ``i386 and x86-64 Options'' in the main manual
1809 @end ifhtml
1810
1811 @item --enable-large-address-aware
1812 The @option{--enable-large-address-aware} option arranges for MinGW
1813 executables to be linked using the @option{--large-address-aware}
1814 option, that enables the use of more than 2GB of memory. If GCC is
1815 configured with this option, its effects can be reversed by passing the
1816 @option{-Wl,--disable-large-address-aware} option to the so-configured
1817 compiler driver.
1818
1819 @item --enable-win32-registry
1820 @itemx --enable-win32-registry=@var{key}
1821 @itemx --disable-win32-registry
1822 The @option{--enable-win32-registry} option enables Microsoft Windows-hosted GCC
1823 to look up installations paths in the registry using the following key:
1824
1825 @smallexample
1826 @code{HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\@var{key}}
1827 @end smallexample
1828
1829 @var{key} defaults to GCC version number, and can be overridden by the
1830 @option{--enable-win32-registry=@var{key}} option. Vendors and distributors
1831 who use custom installers are encouraged to provide a different key,
1832 perhaps one comprised of vendor name and GCC version number, to
1833 avoid conflict with existing installations. This feature is enabled
1834 by default, and can be disabled by @option{--disable-win32-registry}
1835 option. This option has no effect on the other hosts.
1836
1837 @item --nfp
1838 Specify that the machine does not have a floating point unit. This
1839 option only applies to @samp{m68k-sun-sunos@var{n}}. On any other
1840 system, @option{--nfp} has no effect.
1841
1842 @item --enable-werror
1843 @itemx --disable-werror
1844 @itemx --enable-werror=yes
1845 @itemx --enable-werror=no
1846 When you specify this option, it controls whether certain files in the
1847 compiler are built with @option{-Werror} in bootstrap stage2 and later.
1848 If you don't specify it, @option{-Werror} is turned on for the main
1849 development trunk. However it defaults to off for release branches and
1850 final releases. The specific files which get @option{-Werror} are
1851 controlled by the Makefiles.
1852
1853 @item --enable-checking
1854 @itemx --disable-checking
1855 @itemx --enable-checking=@var{list}
1856 This option controls performing internal consistency checks in the compiler.
1857 It does not change the generated code, but adds error checking of the
1858 requested complexity. This slows down the compiler and may only work
1859 properly if you are building the compiler with GCC@.
1860
1861 When the option is not specified, the active set of checks depends on context.
1862 Namely, bootstrap stage 1 defaults to @samp{--enable-checking=yes}, builds
1863 from release branches or release archives default to
1864 @samp{--enable-checking=release}, and otherwise
1865 @samp{--enable-checking=yes,extra} is used. When the option is
1866 specified without a @var{list}, the result is the same as
1867 @samp{--enable-checking=yes}. Likewise, @samp{--disable-checking} is
1868 equivalent to @samp{--enable-checking=no}.
1869
1870 The categories of checks available in @var{list} are @samp{yes} (most common
1871 checks @samp{assert,misc,gc,gimple,rtlflag,runtime,tree,types}), @samp{no}
1872 (no checks at all), @samp{all} (all but @samp{valgrind}), @samp{release}
1873 (cheapest checks @samp{assert,runtime}) or @samp{none} (same as @samp{no}).
1874 @samp{release} checks are always on and to disable them
1875 @samp{--disable-checking} or @samp{--enable-checking=no[,<other checks>]}
1876 must be explicitly requested. Disabling assertions makes the compiler and
1877 runtime slightly faster but increases the risk of undetected internal errors
1878 causing wrong code to be generated.
1879
1880 Individual checks can be enabled with these flags: @samp{assert}, @samp{df},
1881 @samp{extra}, @samp{fold}, @samp{gc}, @samp{gcac}, @samp{gimple},
1882 @samp{misc}, @samp{rtl}, @samp{rtlflag}, @samp{runtime}, @samp{tree},
1883 @samp{types} and @samp{valgrind}. @samp{extra} extends @samp{misc}
1884 checking with extra checks that might affect code generation and should
1885 therefore not differ between stage1 and later stages in bootstrap.
1886
1887 The @samp{valgrind} check requires the external @command{valgrind} simulator,
1888 available from @uref{http://valgrind.org/}. The @samp{rtl} checks are
1889 expensive and the @samp{df}, @samp{gcac} and @samp{valgrind} checks are very
1890 expensive.
1891
1892 @item --disable-stage1-checking
1893 @itemx --enable-stage1-checking
1894 @itemx --enable-stage1-checking=@var{list}
1895 This option affects only bootstrap build. If no @option{--enable-checking}
1896 option is specified the stage1 compiler is built with @samp{yes} checking
1897 enabled, otherwise the stage1 checking flags are the same as specified by
1898 @option{--enable-checking}. To build the stage1 compiler with
1899 different checking options use @option{--enable-stage1-checking}.
1900 The list of checking options is the same as for @option{--enable-checking}.
1901 If your system is too slow or too small to bootstrap a released compiler
1902 with checking for stage1 enabled, you can use @samp{--disable-stage1-checking}
1903 to disable checking for the stage1 compiler.
1904
1905 @item --enable-coverage
1906 @itemx --enable-coverage=@var{level}
1907 With this option, the compiler is built to collect self coverage
1908 information, every time it is run. This is for internal development
1909 purposes, and only works when the compiler is being built with gcc. The
1910 @var{level} argument controls whether the compiler is built optimized or
1911 not, values are @samp{opt} and @samp{noopt}. For coverage analysis you
1912 want to disable optimization, for performance analysis you want to
1913 enable optimization. When coverage is enabled, the default level is
1914 without optimization.
1915
1916 @item --enable-gather-detailed-mem-stats
1917 When this option is specified more detailed information on memory
1918 allocation is gathered. This information is printed when using
1919 @option{-fmem-report}.
1920
1921 @item --enable-valgrind-annotations
1922 Mark selected memory related operations in the compiler when run under
1923 valgrind to suppress false positives.
1924
1925 @item --enable-nls
1926 @itemx --disable-nls
1927 The @option{--enable-nls} option enables Native Language Support (NLS),
1928 which lets GCC output diagnostics in languages other than American
1929 English. Native Language Support is enabled by default if not doing a
1930 canadian cross build. The @option{--disable-nls} option disables NLS@.
1931
1932 @item --with-included-gettext
1933 If NLS is enabled, the @option{--with-included-gettext} option causes the build
1934 procedure to prefer its copy of GNU @command{gettext}.
1935
1936 @item --with-catgets
1937 If NLS is enabled, and if the host lacks @code{gettext} but has the
1938 inferior @code{catgets} interface, the GCC build procedure normally
1939 ignores @code{catgets} and instead uses GCC's copy of the GNU
1940 @code{gettext} library. The @option{--with-catgets} option causes the
1941 build procedure to use the host's @code{catgets} in this situation.
1942
1943 @item --with-libiconv-prefix=@var{dir}
1944 Search for libiconv header files in @file{@var{dir}/include} and
1945 libiconv library files in @file{@var{dir}/lib}.
1946
1947 @item --enable-obsolete
1948 Enable configuration for an obsoleted system. If you attempt to
1949 configure GCC for a system (build, host, or target) which has been
1950 obsoleted, and you do not specify this flag, configure will halt with an
1951 error message.
1952
1953 All support for systems which have been obsoleted in one release of GCC
1954 is removed entirely in the next major release, unless someone steps
1955 forward to maintain the port.
1956
1957 @item --enable-decimal-float
1958 @itemx --enable-decimal-float=yes
1959 @itemx --enable-decimal-float=no
1960 @itemx --enable-decimal-float=bid
1961 @itemx --enable-decimal-float=dpd
1962 @itemx --disable-decimal-float
1963 Enable (or disable) support for the C decimal floating point extension
1964 that is in the IEEE 754-2008 standard. This is enabled by default only
1965 on PowerPC, i386, and x86_64 GNU/Linux systems. Other systems may also
1966 support it, but require the user to specifically enable it. You can
1967 optionally control which decimal floating point format is used (either
1968 @samp{bid} or @samp{dpd}). The @samp{bid} (binary integer decimal)
1969 format is default on i386 and x86_64 systems, and the @samp{dpd}
1970 (densely packed decimal) format is default on PowerPC systems.
1971
1972 @item --enable-fixed-point
1973 @itemx --disable-fixed-point
1974 Enable (or disable) support for C fixed-point arithmetic.
1975 This option is enabled by default for some targets (such as MIPS) which
1976 have hardware-support for fixed-point operations. On other targets, you
1977 may enable this option manually.
1978
1979 @item --with-long-double-128
1980 Specify if @code{long double} type should be 128-bit by default on selected
1981 GNU/Linux architectures. If using @code{--without-long-double-128},
1982 @code{long double} will be by default 64-bit, the same as @code{double} type.
1983 When neither of these configure options are used, the default will be
1984 128-bit @code{long double} when built against GNU C Library 2.4 and later,
1985 64-bit @code{long double} otherwise.
1986
1987 @item --with-long-double-format=ibm
1988 @itemx --with-long-double-format=ieee
1989 Specify whether @code{long double} uses the IBM extended double format
1990 or the IEEE 128-bit floating point format on PowerPC Linux systems.
1991 This configuration switch will only work on little endian PowerPC
1992 Linux systems and on big endian 64-bit systems where the default cpu
1993 is at least power7 (i.e.@: @option{--with-cpu=power7},
1994 @option{--with-cpu=power8}, or @option{--with-cpu=power9} is used).
1995
1996 If you use the @option{--with-long-double-64} configuration option,
1997 the @option{--with-long-double-format=ibm} and
1998 @option{--with-long-double-format=ieee} options are ignored.
1999
2000 The default @code{long double} format is to use IBM extended double.
2001 Until all of the libraries are converted to use IEEE 128-bit floating
2002 point, it is not recommended to use
2003 @option{--with-long-double-format=ieee}.
2004
2005 On little endian PowerPC Linux systems, if you explicitly set the
2006 @code{long double} type, it will build multilibs to allow you to
2007 select either @code{long double} format, unless you disable multilibs
2008 with the @code{--disable-multilib} option. At present,
2009 @code{long double} multilibs are not built on big endian PowerPC Linux
2010 systems. If you are building multilibs, you will need to configure
2011 the compiler using the @option{--with-system-zlib} option.
2012
2013 If you do not set the @code{long double} type explicitly, no multilibs
2014 will be generated.
2015
2016 @item --enable-fdpic
2017 On SH Linux systems, generate ELF FDPIC code.
2018
2019 @item --with-gmp=@var{pathname}
2020 @itemx --with-gmp-include=@var{pathname}
2021 @itemx --with-gmp-lib=@var{pathname}
2022 @itemx --with-mpfr=@var{pathname}
2023 @itemx --with-mpfr-include=@var{pathname}
2024 @itemx --with-mpfr-lib=@var{pathname}
2025 @itemx --with-mpc=@var{pathname}
2026 @itemx --with-mpc-include=@var{pathname}
2027 @itemx --with-mpc-lib=@var{pathname}
2028 If you want to build GCC but do not have the GMP library, the MPFR
2029 library and/or the MPC library installed in a standard location and
2030 do not have their sources present in the GCC source tree then you
2031 can explicitly specify the directory where they are installed
2032 (@samp{--with-gmp=@var{gmpinstalldir}},
2033 @samp{--with-mpfr=@/@var{mpfrinstalldir}},
2034 @samp{--with-mpc=@/@var{mpcinstalldir}}). The
2035 @option{--with-gmp=@/@var{gmpinstalldir}} option is shorthand for
2036 @option{--with-gmp-lib=@/@var{gmpinstalldir}/lib} and
2037 @option{--with-gmp-include=@/@var{gmpinstalldir}/include}. Likewise the
2038 @option{--with-mpfr=@/@var{mpfrinstalldir}} option is shorthand for
2039 @option{--with-mpfr-lib=@/@var{mpfrinstalldir}/lib} and
2040 @option{--with-mpfr-include=@/@var{mpfrinstalldir}/include}, also the
2041 @option{--with-mpc=@/@var{mpcinstalldir}} option is shorthand for
2042 @option{--with-mpc-lib=@/@var{mpcinstalldir}/lib} and
2043 @option{--with-mpc-include=@/@var{mpcinstalldir}/include}. If these
2044 shorthand assumptions are not correct, you can use the explicit
2045 include and lib options directly. You might also need to ensure the
2046 shared libraries can be found by the dynamic linker when building and
2047 using GCC, for example by setting the runtime shared library path
2048 variable (@env{LD_LIBRARY_PATH} on GNU/Linux and Solaris systems).
2049
2050 These flags are applicable to the host platform only. When building
2051 a cross compiler, they will not be used to configure target libraries.
2052
2053 @item --with-isl=@var{pathname}
2054 @itemx --with-isl-include=@var{pathname}
2055 @itemx --with-isl-lib=@var{pathname}
2056 If you do not have the isl library installed in a standard location and you
2057 want to build GCC, you can explicitly specify the directory where it is
2058 installed (@samp{--with-isl=@/@var{islinstalldir}}). The
2059 @option{--with-isl=@/@var{islinstalldir}} option is shorthand for
2060 @option{--with-isl-lib=@/@var{islinstalldir}/lib} and
2061 @option{--with-isl-include=@/@var{islinstalldir}/include}. If this
2062 shorthand assumption is not correct, you can use the explicit
2063 include and lib options directly.
2064
2065 These flags are applicable to the host platform only. When building
2066 a cross compiler, they will not be used to configure target libraries.
2067
2068 @item --with-stage1-ldflags=@var{flags}
2069 This option may be used to set linker flags to be used when linking
2070 stage 1 of GCC. These are also used when linking GCC if configured with
2071 @option{--disable-bootstrap}. If @option{--with-stage1-libs} is not set to a
2072 value, then the default is @samp{-static-libstdc++ -static-libgcc}, if
2073 supported.
2074
2075 @item --with-stage1-libs=@var{libs}
2076 This option may be used to set libraries to be used when linking stage 1
2077 of GCC. These are also used when linking GCC if configured with
2078 @option{--disable-bootstrap}.
2079
2080 @item --with-boot-ldflags=@var{flags}
2081 This option may be used to set linker flags to be used when linking
2082 stage 2 and later when bootstrapping GCC. If --with-boot-libs
2083 is not is set to a value, then the default is
2084 @samp{-static-libstdc++ -static-libgcc}.
2085
2086 @item --with-boot-libs=@var{libs}
2087 This option may be used to set libraries to be used when linking stage 2
2088 and later when bootstrapping GCC.
2089
2090 @item --with-debug-prefix-map=@var{map}
2091 Convert source directory names using @option{-fdebug-prefix-map} when
2092 building runtime libraries. @samp{@var{map}} is a space-separated
2093 list of maps of the form @samp{@var{old}=@var{new}}.
2094
2095 @item --enable-linker-build-id
2096 Tells GCC to pass @option{--build-id} option to the linker for all final
2097 links (links performed without the @option{-r} or @option{--relocatable}
2098 option), if the linker supports it. If you specify
2099 @option{--enable-linker-build-id}, but your linker does not
2100 support @option{--build-id} option, a warning is issued and the
2101 @option{--enable-linker-build-id} option is ignored. The default is off.
2102
2103 @item --with-linker-hash-style=@var{choice}
2104 Tells GCC to pass @option{--hash-style=@var{choice}} option to the
2105 linker for all final links. @var{choice} can be one of
2106 @samp{sysv}, @samp{gnu}, and @samp{both} where @samp{sysv} is the default.
2107
2108 @item --enable-gnu-unique-object
2109 @itemx --disable-gnu-unique-object
2110 Tells GCC to use the gnu_unique_object relocation for C++ template
2111 static data members and inline function local statics. Enabled by
2112 default for a toolchain with an assembler that accepts it and
2113 GLIBC 2.11 or above, otherwise disabled.
2114
2115 @item --with-diagnostics-color=@var{choice}
2116 Tells GCC to use @var{choice} as the default for @option{-fdiagnostics-color=}
2117 option (if not used explicitly on the command line). @var{choice}
2118 can be one of @samp{never}, @samp{auto}, @samp{always}, and @samp{auto-if-env}
2119 where @samp{auto} is the default. @samp{auto-if-env} makes
2120 @option{-fdiagnostics-color=auto} the default if @env{GCC_COLORS}
2121 is present and non-empty in the environment of the compiler, and
2122 @option{-fdiagnostics-color=never} otherwise.
2123
2124 @item --with-diagnostics-urls=@var{choice}
2125 Tells GCC to use @var{choice} as the default for @option{-fdiagnostics-urls=}
2126 option (if not used explicitly on the command line). @var{choice}
2127 can be one of @samp{never}, @samp{auto}, @samp{always}, and @samp{auto-if-env}
2128 where @samp{auto} is the default. @samp{auto-if-env} makes
2129 @option{-fdiagnostics-urls=auto} the default if @env{GCC_URLS}
2130 or @env{TERM_URLS} is present and non-empty in the environment of the
2131 compiler, and @option{-fdiagnostics-urls=never} otherwise.
2132
2133 @item --enable-lto
2134 @itemx --disable-lto
2135 Enable support for link-time optimization (LTO). This is enabled by
2136 default, and may be disabled using @option{--disable-lto}.
2137
2138 @item --enable-linker-plugin-configure-flags=FLAGS
2139 @itemx --enable-linker-plugin-flags=FLAGS
2140 By default, linker plugins (such as the LTO plugin) are built for the
2141 host system architecture. For the case that the linker has a
2142 different (but run-time compatible) architecture, these flags can be
2143 specified to build plugins that are compatible to the linker. For
2144 example, if you are building GCC for a 64-bit x86_64
2145 (@samp{x86_64-pc-linux-gnu}) host system, but have a 32-bit x86
2146 GNU/Linux (@samp{i686-pc-linux-gnu}) linker executable (which is
2147 executable on the former system), you can configure GCC as follows for
2148 getting compatible linker plugins:
2149
2150 @smallexample
2151 % @var{srcdir}/configure \
2152 --host=x86_64-pc-linux-gnu \
2153 --enable-linker-plugin-configure-flags=--host=i686-pc-linux-gnu \
2154 --enable-linker-plugin-flags='CC=gcc\ -m32\ -Wl,-rpath,[...]/i686-pc-linux-gnu/lib'
2155 @end smallexample
2156
2157 @item --with-plugin-ld=@var{pathname}
2158 Enable an alternate linker to be used at link-time optimization (LTO)
2159 link time when @option{-fuse-linker-plugin} is enabled.
2160 This linker should have plugin support such as gold starting with
2161 version 2.20 or GNU ld starting with version 2.21.
2162 See @option{-fuse-linker-plugin} for details.
2163
2164 @item --enable-canonical-system-headers
2165 @itemx --disable-canonical-system-headers
2166 Enable system header path canonicalization for @file{libcpp}. This can
2167 produce shorter header file paths in diagnostics and dependency output
2168 files, but these changed header paths may conflict with some compilation
2169 environments. Enabled by default, and may be disabled using
2170 @option{--disable-canonical-system-headers}.
2171
2172 @item --with-glibc-version=@var{major}.@var{minor}
2173 Tell GCC that when the GNU C Library (glibc) is used on the target it
2174 will be version @var{major}.@var{minor} or later. Normally this can
2175 be detected from the C library's header files, but this option may be
2176 needed when bootstrapping a cross toolchain without the header files
2177 available for building the initial bootstrap compiler.
2178
2179 If GCC is configured with some multilibs that use glibc and some that
2180 do not, this option applies only to the multilibs that use glibc.
2181 However, such configurations may not work well as not all the relevant
2182 configuration in GCC is on a per-multilib basis.
2183
2184 @item --enable-as-accelerator-for=@var{target}
2185 Build as offload target compiler. Specify offload host triple by @var{target}.
2186
2187 @item --enable-offload-targets=@var{target1}[=@var{path1}],@dots{},@var{targetN}[=@var{pathN}]
2188 Enable offloading to targets @var{target1}, @dots{}, @var{targetN}.
2189 Offload compilers are expected to be already installed. Default search
2190 path for them is @file{@var{exec-prefix}}, but it can be changed by
2191 specifying paths @var{path1}, @dots{}, @var{pathN}.
2192
2193 @smallexample
2194 % @var{srcdir}/configure \
2195 --enable-offload-targets=x86_64-intelmicemul-linux-gnu=/path/to/x86_64/compiler,nvptx-none,hsa
2196 @end smallexample
2197
2198 If @samp{hsa} is specified as one of the targets, the compiler will be
2199 built with support for HSA GPU accelerators. Because the same
2200 compiler will emit the accelerator code, no path should be specified.
2201
2202 @item --with-hsa-runtime=@var{pathname}
2203 @itemx --with-hsa-runtime-include=@var{pathname}
2204 @itemx --with-hsa-runtime-lib=@var{pathname}
2205
2206 If you configure GCC with HSA offloading but do not have the HSA
2207 run-time library installed in a standard location then you can
2208 explicitly specify the directory where they are installed. The
2209 @option{--with-hsa-runtime=@/@var{hsainstalldir}} option is a
2210 shorthand for
2211 @option{--with-hsa-runtime-lib=@/@var{hsainstalldir}/lib} and
2212 @option{--with-hsa-runtime-include=@/@var{hsainstalldir}/include}.
2213
2214 @item --enable-cet
2215 @itemx --disable-cet
2216 Enable building target run-time libraries with control-flow
2217 instrumentation, see @option{-fcf-protection} option. When
2218 @code{--enable-cet} is specified target libraries are configured
2219 to add @option{-fcf-protection} and, if needed, other target
2220 specific options to a set of building options.
2221
2222 The option is disabled by default. When @code{--enable-cet=auto}
2223 is used, it is enabled on Linux/x86 if target binutils
2224 supports @code{Intel CET} instructions and disabled otherwise.
2225 In this case the target libraries are configured to get additional
2226 @option{-fcf-protection} option.
2227
2228 @item --with-riscv-attribute=@samp{yes}, @samp{no} or @samp{default}
2229 Generate RISC-V attribute by default, in order to record extra build
2230 information in object.
2231
2232 The option is disabled by default. It is enabled on RISC-V/ELF (bare-metal)
2233 target if target binutils supported.
2234 @end table
2235
2236 @subheading Cross-Compiler-Specific Options
2237 The following options only apply to building cross compilers.
2238
2239 @table @code
2240 @item --with-toolexeclibdir=@var{dir}
2241 Specify the installation directory for libraries built with a cross compiler.
2242 The default is @option{$@{gcc_tooldir@}/lib}.
2243
2244 @item --with-sysroot
2245 @itemx --with-sysroot=@var{dir}
2246 Tells GCC to consider @var{dir} as the root of a tree that contains
2247 (a subset of) the root filesystem of the target operating system.
2248 Target system headers, libraries and run-time object files will be
2249 searched for in there. More specifically, this acts as if
2250 @option{--sysroot=@var{dir}} was added to the default options of the built
2251 compiler. The specified directory is not copied into the
2252 install tree, unlike the options @option{--with-headers} and
2253 @option{--with-libs} that this option obsoletes. The default value,
2254 in case @option{--with-sysroot} is not given an argument, is
2255 @option{$@{gcc_tooldir@}/sys-root}. If the specified directory is a
2256 subdirectory of @option{$@{exec_prefix@}}, then it will be found relative to
2257 the GCC binaries if the installation tree is moved.
2258
2259 This option affects the system root for the compiler used to build
2260 target libraries (which runs on the build system) and the compiler newly
2261 installed with @code{make install}; it does not affect the compiler which is
2262 used to build GCC itself.
2263
2264 If you specify the @option{--with-native-system-header-dir=@var{dirname}}
2265 option then the compiler will search that directory within @var{dirname} for
2266 native system headers rather than the default @file{/usr/include}.
2267
2268 @item --with-build-sysroot
2269 @itemx --with-build-sysroot=@var{dir}
2270 Tells GCC to consider @var{dir} as the system root (see
2271 @option{--with-sysroot}) while building target libraries, instead of
2272 the directory specified with @option{--with-sysroot}. This option is
2273 only useful when you are already using @option{--with-sysroot}. You
2274 can use @option{--with-build-sysroot} when you are configuring with
2275 @option{--prefix} set to a directory that is different from the one in
2276 which you are installing GCC and your target libraries.
2277
2278 This option affects the system root for the compiler used to build
2279 target libraries (which runs on the build system); it does not affect
2280 the compiler which is used to build GCC itself.
2281
2282 If you specify the @option{--with-native-system-header-dir=@var{dirname}}
2283 option then the compiler will search that directory within @var{dirname} for
2284 native system headers rather than the default @file{/usr/include}.
2285
2286 @item --with-headers
2287 @itemx --with-headers=@var{dir}
2288 Deprecated in favor of @option{--with-sysroot}.
2289 Specifies that target headers are available when building a cross compiler.
2290 The @var{dir} argument specifies a directory which has the target include
2291 files. These include files will be copied into the @file{gcc} install
2292 directory. @emph{This option with the @var{dir} argument is required} when
2293 building a cross compiler, if @file{@var{prefix}/@var{target}/sys-include}
2294 doesn't pre-exist. If @file{@var{prefix}/@var{target}/sys-include} does
2295 pre-exist, the @var{dir} argument may be omitted. @command{fixincludes}
2296 will be run on these files to make them compatible with GCC@.
2297
2298 @item --without-headers
2299 Tells GCC not use any target headers from a libc when building a cross
2300 compiler. When crossing to GNU/Linux, you need the headers so GCC
2301 can build the exception handling for libgcc.
2302
2303 @item --with-libs
2304 @itemx --with-libs="@var{dir1} @var{dir2} @dots{} @var{dirN}"
2305 Deprecated in favor of @option{--with-sysroot}.
2306 Specifies a list of directories which contain the target runtime
2307 libraries. These libraries will be copied into the @file{gcc} install
2308 directory. If the directory list is omitted, this option has no
2309 effect.
2310
2311 @item --with-newlib
2312 Specifies that @samp{newlib} is
2313 being used as the target C library. This causes @code{__eprintf} to be
2314 omitted from @file{libgcc.a} on the assumption that it will be provided by
2315 @samp{newlib}.
2316
2317 @html
2318 <a name="avr"></a>
2319 @end html
2320 @item --with-avrlibc
2321 Only supported for the AVR target. Specifies that @samp{AVR-Libc} is
2322 being used as the target C@tie{} library. This causes float support
2323 functions like @code{__addsf3} to be omitted from @file{libgcc.a} on
2324 the assumption that it will be provided by @file{libm.a}. For more
2325 technical details, cf. @uref{http://gcc.gnu.org/PR54461,,PR54461}.
2326 It is not supported for
2327 RTEMS configurations, which currently use newlib. The option is
2328 supported since version 4.7.2 and is the default in 4.8.0 and newer.
2329
2330 @item --with-double=@{32|64|32,64|64,32@}
2331 @itemx --with-long-double=@{32|64|32,64|64,32|double@}
2332 Only supported for the AVR target since version@tie{}10.
2333 Specify the default layout available for the C/C++ @samp{double}
2334 and @samp{long double} type, respectively. The following rules apply:
2335 @itemize
2336 @item
2337 The first value after the @samp{=} specifies the default layout (in bits)
2338 of the type and also the default for the @option{-mdouble=} resp.
2339 @option{-mlong-double=} compiler option.
2340 @item
2341 If more than one value is specified, respective multilib variants are
2342 available, and @option{-mdouble=} resp. @option{-mlong-double=} acts
2343 as a multilib option.
2344 @item
2345 If @option{--with-long-double=double} is specified, @samp{double} and
2346 @samp{long double} will have the same layout.
2347 @item
2348 The defaults are @option{--with-long-double=64,32} and
2349 @option{--with-double=32,64}. The default @samp{double} layout imposed by
2350 the latter is compatible with older versions of the compiler that implement
2351 @samp{double} as a 32-bit type, which does not comply to the language standard.
2352 @end itemize
2353 Not all combinations of @option{--with-double=} and
2354 @option{--with-long-double=} are valid. For example, the combination
2355 @option{--with-double=32,64} @option{--with-long-double=32} will be
2356 rejected because the first option specifies the availability of
2357 multilibs for @samp{double}, whereas the second option implies
2358 that @samp{long double} --- and hence also @samp{double} --- is always
2359 32@tie{}bits wide.
2360
2361 @item --with-double-comparison=@{tristate|bool|libf7@}
2362 Only supported for the AVR target since version@tie{}10.
2363 Specify what result format is returned by library functions that
2364 compare 64-bit floating point values (@code{DFmode}).
2365 The GCC default is @samp{tristate}. If the floating point
2366 implementation returns a boolean instead, set it to @samp{bool}.
2367
2368 @item --with-libf7=@{libgcc|math|math-symbols|no@}
2369 Only supported for the AVR target since version@tie{}10.
2370 Specify to which degree code from LibF7 is included in libgcc.
2371 LibF7 is an ad-hoc, AVR-specific, 64-bit floating point emulation
2372 written in C and (inline) assembly. @samp{libgcc} adds support
2373 for functions that one would usually expect in libgcc like double addition,
2374 double comparisons and double conversions. @samp{math} also adds routines
2375 that one would expect in @file{libm.a}, but with @code{__} (two underscores)
2376 prepended to the symbol names as specified by @file{math.h}.
2377 @samp{math-symbols} also defines weak aliases for the functions
2378 declared in @file{math.h}. However, @code{--with-libf7} won't
2379 install no @file{math.h} header file whatsoever, this file must come
2380 from elsewhere. This option sets @option{--with-double-comparison}
2381 to @samp{bool}.
2382
2383 @item --with-nds32-lib=@var{library}
2384 Specifies that @var{library} setting is used for building @file{libgcc.a}.
2385 Currently, the valid @var{library} is @samp{newlib} or @samp{mculib}.
2386 This option is only supported for the NDS32 target.
2387
2388 @item --with-build-time-tools=@var{dir}
2389 Specifies where to find the set of target tools (assembler, linker, etc.)
2390 that will be used while building GCC itself. This option can be useful
2391 if the directory layouts are different between the system you are building
2392 GCC on, and the system where you will deploy it.
2393
2394 For example, on an @samp{ia64-hp-hpux} system, you may have the GNU
2395 assembler and linker in @file{/usr/bin}, and the native tools in a
2396 different path, and build a toolchain that expects to find the
2397 native tools in @file{/usr/bin}.
2398
2399 When you use this option, you should ensure that @var{dir} includes
2400 @command{ar}, @command{as}, @command{ld}, @command{nm},
2401 @command{ranlib} and @command{strip} if necessary, and possibly
2402 @command{objdump}. Otherwise, GCC may use an inconsistent set of
2403 tools.
2404 @end table
2405
2406 @subsubheading Overriding @command{configure} test results
2407
2408 Sometimes, it might be necessary to override the result of some
2409 @command{configure} test, for example in order to ease porting to a new
2410 system or work around a bug in a test. The toplevel @command{configure}
2411 script provides three variables for this:
2412
2413 @table @code
2414
2415 @item build_configargs
2416 @cindex @code{build_configargs}
2417 The contents of this variable is passed to all build @command{configure}
2418 scripts.
2419
2420 @item host_configargs
2421 @cindex @code{host_configargs}
2422 The contents of this variable is passed to all host @command{configure}
2423 scripts.
2424
2425 @item target_configargs
2426 @cindex @code{target_configargs}
2427 The contents of this variable is passed to all target @command{configure}
2428 scripts.
2429
2430 @end table
2431
2432 In order to avoid shell and @command{make} quoting issues for complex
2433 overrides, you can pass a setting for @env{CONFIG_SITE} and set
2434 variables in the site file.
2435
2436 @subheading Objective-C-Specific Options
2437
2438 The following options apply to the build of the Objective-C runtime library.
2439
2440 @table @code
2441 @item --enable-objc-gc
2442 Specify that an additional variant of the GNU Objective-C runtime library
2443 is built, using an external build of the Boehm-Demers-Weiser garbage
2444 collector (@uref{https://www.hboehm.info/gc/}). This library needs to be
2445 available for each multilib variant, unless configured with
2446 @option{--enable-objc-gc=@samp{auto}} in which case the build of the
2447 additional runtime library is skipped when not available and the build
2448 continues.
2449
2450 @item --with-target-bdw-gc=@var{list}
2451 @itemx --with-target-bdw-gc-include=@var{list}
2452 @itemx --with-target-bdw-gc-lib=@var{list}
2453 Specify search directories for the garbage collector header files and
2454 libraries. @var{list} is a comma separated list of key value pairs of the
2455 form @samp{@var{multilibdir}=@var{path}}, where the default multilib key
2456 is named as @samp{.} (dot), or is omitted (e.g.@:
2457 @samp{--with-target-bdw-gc=/opt/bdw-gc,32=/opt-bdw-gc32}).
2458
2459 The options @option{--with-target-bdw-gc-include} and
2460 @option{--with-target-bdw-gc-lib} must always be specified together
2461 for each multilib variant and they take precedence over
2462 @option{--with-target-bdw-gc}. If @option{--with-target-bdw-gc-include}
2463 is missing values for a multilib, then the value for the default
2464 multilib is used (e.g.@: @samp{--with-target-bdw-gc-include=/opt/bdw-gc/include}
2465 @samp{--with-target-bdw-gc-lib=/opt/bdw-gc/lib64,32=/opt-bdw-gc/lib32}).
2466 If none of these options are specified, the library is assumed in
2467 default locations.
2468 @end table
2469
2470 @subheading D-Specific Options
2471
2472 The following options apply to the build of the D runtime library.
2473
2474 @table @code
2475 @item --enable-libphobos-checking
2476 @itemx --disable-libphobos-checking
2477 @itemx --enable-libphobos-checking=@var{list}
2478 This option controls whether run-time checks and contracts are compiled into
2479 the D runtime library. When the option is not specified, the library is built
2480 with @samp{release} checking. When the option is specified without a
2481 @var{list}, the result is the same as @samp{--enable-libphobos-checking=yes}.
2482 Likewise, @samp{--disable-libphobos-checking} is equivalent to
2483 @samp{--enable-libphobos-checking=no}.
2484
2485 The categories of checks available in @var{list} are @samp{yes} (compiles
2486 libphobos with @option{-fno-release}), @samp{no} (compiles libphobos with
2487 @option{-frelease}), @samp{all} (same as @samp{yes}), @samp{none} or
2488 @samp{release} (same as @samp{no}).
2489
2490 Individual checks available in @var{list} are @samp{assert} (compiles libphobos
2491 with an extra option @option{-fassert}).
2492
2493 @item --with-libphobos-druntime-only
2494 @itemx --with-libphobos-druntime-only=@var{choice}
2495 Specify whether to build only the core D runtime library (druntime), or both
2496 the core and standard library (phobos) into libphobos. This is useful for
2497 targets that have full support in druntime, but no or incomplete support
2498 in phobos. @var{choice} can be one of @samp{auto}, @samp{yes}, and @samp{no}
2499 where @samp{auto} is the default.
2500
2501 When the option is not specified, the default choice @samp{auto} means that it
2502 is inferred whether the target has support for the phobos standard library.
2503 When the option is specified without a @var{choice}, the result is the same as
2504 @samp{--with-libphobos-druntime-only=yes}.
2505
2506 @item --with-target-system-zlib
2507 Use installed @samp{zlib} rather than that included with GCC@. This needs
2508 to be available for each multilib variant, unless configured with
2509 @option{--with-target-system-zlib=@samp{auto}} in which case the GCC@ included
2510 @samp{zlib} is only used when the system installed library is not available.
2511 @end table
2512
2513 @html
2514 <hr />
2515 <p>
2516 @end html
2517 @ifhtml
2518 @uref{./index.html,,Return to the GCC Installation page}
2519 @end ifhtml
2520 @end ifset
2521
2522 @c ***Building****************************************************************
2523 @ifnothtml
2524 @comment node-name, next, previous, up
2525 @node Building, Testing, Configuration, Installing GCC
2526 @end ifnothtml
2527 @ifset buildhtml
2528 @ifnothtml
2529 @chapter Building
2530 @end ifnothtml
2531 @cindex Installing GCC: Building
2532
2533 Now that GCC is configured, you are ready to build the compiler and
2534 runtime libraries.
2535
2536 Some commands executed when making the compiler may fail (return a
2537 nonzero status) and be ignored by @command{make}. These failures, which
2538 are often due to files that were not found, are expected, and can safely
2539 be ignored.
2540
2541 It is normal to have compiler warnings when compiling certain files.
2542 Unless you are a GCC developer, you can generally ignore these warnings
2543 unless they cause compilation to fail. Developers should attempt to fix
2544 any warnings encountered, however they can temporarily continue past
2545 warnings-as-errors by specifying the configure flag
2546 @option{--disable-werror}.
2547
2548 On certain old systems, defining certain environment variables such as
2549 @env{CC} can interfere with the functioning of @command{make}.
2550
2551 If you encounter seemingly strange errors when trying to build the
2552 compiler in a directory other than the source directory, it could be
2553 because you have previously configured the compiler in the source
2554 directory. Make sure you have done all the necessary preparations.
2555
2556 If you build GCC on a BSD system using a directory stored in an old System
2557 V file system, problems may occur in running @command{fixincludes} if the
2558 System V file system doesn't support symbolic links. These problems
2559 result in a failure to fix the declaration of @code{size_t} in
2560 @file{sys/types.h}. If you find that @code{size_t} is a signed type and
2561 that type mismatches occur, this could be the cause.
2562
2563 The solution is not to use such a directory for building GCC@.
2564
2565 Similarly, when building from the source repository or snapshots, or if you modify
2566 @file{*.l} files, you need the Flex lexical analyzer generator
2567 installed. If you do not modify @file{*.l} files, releases contain
2568 the Flex-generated files and you do not need Flex installed to build
2569 them. There is still one Flex-based lexical analyzer (part of the
2570 build machinery, not of GCC itself) that is used even if you only
2571 build the C front end.
2572
2573 When building from the source repository or snapshots, or if you modify Texinfo
2574 documentation, you need version 4.7 or later of Texinfo installed if you
2575 want Info documentation to be regenerated. Releases contain Info
2576 documentation pre-built for the unmodified documentation in the release.
2577
2578 @section Building a native compiler
2579
2580 For a native build, the default configuration is to perform
2581 a 3-stage bootstrap of the compiler when @samp{make} is invoked.
2582 This will build the entire GCC system and ensure that it compiles
2583 itself correctly. It can be disabled with the @option{--disable-bootstrap}
2584 parameter to @samp{configure}, but bootstrapping is suggested because
2585 the compiler will be tested more completely and could also have
2586 better performance.
2587
2588 The bootstrapping process will complete the following steps:
2589
2590 @itemize @bullet
2591 @item
2592 Build tools necessary to build the compiler.
2593
2594 @item
2595 Perform a 3-stage bootstrap of the compiler. This includes building
2596 three times the target tools for use by the compiler such as binutils
2597 (bfd, binutils, gas, gprof, ld, and opcodes) if they have been
2598 individually linked or moved into the top level GCC source tree before
2599 configuring.
2600
2601 @item
2602 Perform a comparison test of the stage2 and stage3 compilers.
2603
2604 @item
2605 Build runtime libraries using the stage3 compiler from the previous step.
2606
2607 @end itemize
2608
2609 If you are short on disk space you might consider @samp{make
2610 bootstrap-lean} instead. The sequence of compilation is the
2611 same described above, but object files from the stage1 and
2612 stage2 of the 3-stage bootstrap of the compiler are deleted as
2613 soon as they are no longer needed.
2614
2615 If you wish to use non-default GCC flags when compiling the stage2
2616 and stage3 compilers, set @code{BOOT_CFLAGS} on the command line when
2617 doing @samp{make}. For example, if you want to save additional space
2618 during the bootstrap and in the final installation as well, you can
2619 build the compiler binaries without debugging information as in the
2620 following example. This will save roughly 40% of disk space both for
2621 the bootstrap and the final installation. (Libraries will still contain
2622 debugging information.)
2623
2624 @smallexample
2625 make BOOT_CFLAGS='-O' bootstrap
2626 @end smallexample
2627
2628 You can place non-default optimization flags into @code{BOOT_CFLAGS}; they
2629 are less well tested here than the default of @samp{-g -O2}, but should
2630 still work. In a few cases, you may find that you need to specify special
2631 flags such as @option{-msoft-float} here to complete the bootstrap; or,
2632 if the native compiler miscompiles the stage1 compiler, you may need
2633 to work around this, by choosing @code{BOOT_CFLAGS} to avoid the parts
2634 of the stage1 compiler that were miscompiled, or by using @samp{make
2635 bootstrap4} to increase the number of stages of bootstrap.
2636
2637 @code{BOOT_CFLAGS} does not apply to bootstrapped target libraries.
2638 Since these are always compiled with the compiler currently being
2639 bootstrapped, you can use @code{CFLAGS_FOR_TARGET} to modify their
2640 compilation flags, as for non-bootstrapped target libraries.
2641 Again, if the native compiler miscompiles the stage1 compiler, you may
2642 need to work around this by avoiding non-working parts of the stage1
2643 compiler. Use @code{STAGE1_TFLAGS} to this end.
2644
2645 If you used the flag @option{--enable-languages=@dots{}} to restrict
2646 the compilers to be built, only those you've actually enabled will be
2647 built. This will of course only build those runtime libraries, for
2648 which the particular compiler has been built. Please note,
2649 that re-defining @env{LANGUAGES} when calling @samp{make}
2650 @strong{does not} work anymore!
2651
2652 If the comparison of stage2 and stage3 fails, this normally indicates
2653 that the stage2 compiler has compiled GCC incorrectly, and is therefore
2654 a potentially serious bug which you should investigate and report. (On
2655 a few systems, meaningful comparison of object files is impossible; they
2656 always appear ``different''. If you encounter this problem, you will
2657 need to disable comparison in the @file{Makefile}.)
2658
2659 If you do not want to bootstrap your compiler, you can configure with
2660 @option{--disable-bootstrap}. In particular cases, you may want to
2661 bootstrap your compiler even if the target system is not the same as
2662 the one you are building on: for example, you could build a
2663 @code{powerpc-unknown-linux-gnu} toolchain on a
2664 @code{powerpc64-unknown-linux-gnu} host. In this case, pass
2665 @option{--enable-bootstrap} to the configure script.
2666
2667 @code{BUILD_CONFIG} can be used to bring in additional customization
2668 to the build. It can be set to a whitespace-separated list of names.
2669 For each such @code{NAME}, top-level @file{config/@code{NAME}.mk} will
2670 be included by the top-level @file{Makefile}, bringing in any settings
2671 it contains. The default @code{BUILD_CONFIG} can be set using the
2672 configure option @option{--with-build-config=@code{NAME}...}. Some
2673 examples of supported build configurations are:
2674
2675 @table @asis
2676 @item @samp{bootstrap-O1}
2677 Removes any @option{-O}-started option from @code{BOOT_CFLAGS}, and adds
2678 @option{-O1} to it. @samp{BUILD_CONFIG=bootstrap-O1} is equivalent to
2679 @samp{BOOT_CFLAGS='-g -O1'}.
2680
2681 @item @samp{bootstrap-O3}
2682 @itemx @samp{bootstrap-Og}
2683 Analogous to @code{bootstrap-O1}.
2684
2685 @item @samp{bootstrap-lto}
2686 Enables Link-Time Optimization for host tools during bootstrapping.
2687 @samp{BUILD_CONFIG=bootstrap-lto} is equivalent to adding
2688 @option{-flto} to @samp{BOOT_CFLAGS}. This option assumes that the host
2689 supports the linker plugin (e.g.@: GNU ld version 2.21 or later or GNU gold
2690 version 2.21 or later).
2691
2692 @item @samp{bootstrap-lto-noplugin}
2693 This option is similar to @code{bootstrap-lto}, but is intended for
2694 hosts that do not support the linker plugin. Without the linker plugin
2695 static libraries are not compiled with link-time optimizations. Since
2696 the GCC middle end and back end are in @file{libbackend.a} this means
2697 that only the front end is actually LTO optimized.
2698
2699 @item @samp{bootstrap-lto-lean}
2700 This option is similar to @code{bootstrap-lto}, but is intended for
2701 faster build by only using LTO in the final bootstrap stage.
2702 With @samp{make profiledbootstrap} the LTO frontend
2703 is trained only on generator files.
2704
2705 @item @samp{bootstrap-debug}
2706 Verifies that the compiler generates the same executable code, whether
2707 or not it is asked to emit debug information. To this end, this
2708 option builds stage2 host programs without debug information, and uses
2709 @file{contrib/compare-debug} to compare them with the stripped stage3
2710 object files. If @code{BOOT_CFLAGS} is overridden so as to not enable
2711 debug information, stage2 will have it, and stage3 won't. This option
2712 is enabled by default when GCC bootstrapping is enabled, if
2713 @code{strip} can turn object files compiled with and without debug
2714 info into identical object files. In addition to better test
2715 coverage, this option makes default bootstraps faster and leaner.
2716
2717 @item @samp{bootstrap-debug-big}
2718 Rather than comparing stripped object files, as in
2719 @code{bootstrap-debug}, this option saves internal compiler dumps
2720 during stage2 and stage3 and compares them as well, which helps catch
2721 additional potential problems, but at a great cost in terms of disk
2722 space. It can be specified in addition to @samp{bootstrap-debug}.
2723
2724 @item @samp{bootstrap-debug-lean}
2725 This option saves disk space compared with @code{bootstrap-debug-big},
2726 but at the expense of some recompilation. Instead of saving the dumps
2727 of stage2 and stage3 until the final compare, it uses
2728 @option{-fcompare-debug} to generate, compare and remove the dumps
2729 during stage3, repeating the compilation that already took place in
2730 stage2, whose dumps were not saved.
2731
2732 @item @samp{bootstrap-debug-lib}
2733 This option tests executable code invariance over debug information
2734 generation on target libraries, just like @code{bootstrap-debug-lean}
2735 tests it on host programs. It builds stage3 libraries with
2736 @option{-fcompare-debug}, and it can be used along with any of the
2737 @code{bootstrap-debug} options above.
2738
2739 There aren't @code{-lean} or @code{-big} counterparts to this option
2740 because most libraries are only build in stage3, so bootstrap compares
2741 would not get significant coverage. Moreover, the few libraries built
2742 in stage2 are used in stage3 host programs, so we wouldn't want to
2743 compile stage2 libraries with different options for comparison purposes.
2744
2745 @item @samp{bootstrap-debug-ckovw}
2746 Arranges for error messages to be issued if the compiler built on any
2747 stage is run without the option @option{-fcompare-debug}. This is
2748 useful to verify the full @option{-fcompare-debug} testing coverage. It
2749 must be used along with @code{bootstrap-debug-lean} and
2750 @code{bootstrap-debug-lib}.
2751
2752 @item @samp{bootstrap-cet}
2753 This option enables Intel CET for host tools during bootstrapping.
2754 @samp{BUILD_CONFIG=bootstrap-cet} is equivalent to adding
2755 @option{-fcf-protection} to @samp{BOOT_CFLAGS}. This option
2756 assumes that the host supports Intel CET (e.g.@: GNU assembler version
2757 2.30 or later).
2758
2759 @item @samp{bootstrap-time}
2760 Arranges for the run time of each program started by the GCC driver,
2761 built in any stage, to be logged to @file{time.log}, in the top level of
2762 the build tree.
2763
2764 @end table
2765
2766 @section Building a cross compiler
2767
2768 When building a cross compiler, it is not generally possible to do a
2769 3-stage bootstrap of the compiler. This makes for an interesting problem
2770 as parts of GCC can only be built with GCC@.
2771
2772 To build a cross compiler, we recommend first building and installing a
2773 native compiler. You can then use the native GCC compiler to build the
2774 cross compiler. The installed native compiler needs to be GCC version
2775 2.95 or later.
2776
2777 Assuming you have already installed a native copy of GCC and configured
2778 your cross compiler, issue the command @command{make}, which performs the
2779 following steps:
2780
2781 @itemize @bullet
2782 @item
2783 Build host tools necessary to build the compiler.
2784
2785 @item
2786 Build target tools for use by the compiler such as binutils (bfd,
2787 binutils, gas, gprof, ld, and opcodes)
2788 if they have been individually linked or moved into the top level GCC source
2789 tree before configuring.
2790
2791 @item
2792 Build the compiler (single stage only).
2793
2794 @item
2795 Build runtime libraries using the compiler from the previous step.
2796 @end itemize
2797
2798 Note that if an error occurs in any step the make process will exit.
2799
2800 If you are not building GNU binutils in the same source tree as GCC,
2801 you will need a cross-assembler and cross-linker installed before
2802 configuring GCC@. Put them in the directory
2803 @file{@var{prefix}/@var{target}/bin}. Here is a table of the tools
2804 you should put in this directory:
2805
2806 @table @file
2807 @item as
2808 This should be the cross-assembler.
2809
2810 @item ld
2811 This should be the cross-linker.
2812
2813 @item ar
2814 This should be the cross-archiver: a program which can manipulate
2815 archive files (linker libraries) in the target machine's format.
2816
2817 @item ranlib
2818 This should be a program to construct a symbol table in an archive file.
2819 @end table
2820
2821 The installation of GCC will find these programs in that directory,
2822 and copy or link them to the proper place to for the cross-compiler to
2823 find them when run later.
2824
2825 The easiest way to provide these files is to build the Binutils package.
2826 Configure it with the same @option{--host} and @option{--target}
2827 options that you use for configuring GCC, then build and install
2828 them. They install their executables automatically into the proper
2829 directory. Alas, they do not support all the targets that GCC
2830 supports.
2831
2832 If you are not building a C library in the same source tree as GCC,
2833 you should also provide the target libraries and headers before
2834 configuring GCC, specifying the directories with
2835 @option{--with-sysroot} or @option{--with-headers} and
2836 @option{--with-libs}. Many targets also require ``start files'' such
2837 as @file{crt0.o} and
2838 @file{crtn.o} which are linked into each executable. There may be several
2839 alternatives for @file{crt0.o}, for use with profiling or other
2840 compilation options. Check your target's definition of
2841 @code{STARTFILE_SPEC} to find out what start files it uses.
2842
2843 @section Building in parallel
2844
2845 GNU Make 3.80 and above, which is necessary to build GCC, support
2846 building in parallel. To activate this, you can use @samp{make -j 2}
2847 instead of @samp{make}. You can also specify a bigger number, and
2848 in most cases using a value greater than the number of processors in
2849 your machine will result in fewer and shorter I/O latency hits, thus
2850 improving overall throughput; this is especially true for slow drives
2851 and network filesystems.
2852
2853 @section Building the Ada compiler
2854
2855 @ifnothtml
2856 @ref{GNAT-prerequisite}.
2857 @end ifnothtml
2858 @ifhtml
2859 @uref{prerequisites.html#GNAT-prerequisite,,GNAT prerequisites}.
2860 @end ifhtml
2861
2862 @section Building with profile feedback
2863
2864 It is possible to use profile feedback to optimize the compiler itself. This
2865 should result in a faster compiler binary. Experiments done on x86 using gcc
2866 3.3 showed approximately 7 percent speedup on compiling C programs. To
2867 bootstrap the compiler with profile feedback, use @code{make profiledbootstrap}.
2868
2869 When @samp{make profiledbootstrap} is run, it will first build a @code{stage1}
2870 compiler. This compiler is used to build a @code{stageprofile} compiler
2871 instrumented to collect execution counts of instruction and branch
2872 probabilities. Training run is done by building @code{stagetrain}
2873 compiler. Finally a @code{stagefeedback} compiler is built
2874 using the information collected.
2875
2876 Unlike standard bootstrap, several additional restrictions apply. The
2877 compiler used to build @code{stage1} needs to support a 64-bit integral type.
2878 It is recommended to only use GCC for this.
2879
2880 On Linux/x86_64 hosts with some restrictions (no virtualization) it is
2881 also possible to do autofdo build with @samp{make
2882 autoprofiledback}. This uses Linux perf to sample branches in the
2883 binary and then rebuild it with feedback derived from the profile.
2884 Linux perf and the @code{autofdo} toolkit needs to be installed for
2885 this.
2886
2887 Only the profile from the current build is used, so when an error
2888 occurs it is recommended to clean before restarting. Otherwise
2889 the code quality may be much worse.
2890
2891 @html
2892 <hr />
2893 <p>
2894 @end html
2895 @ifhtml
2896 @uref{./index.html,,Return to the GCC Installation page}
2897 @end ifhtml
2898 @end ifset
2899
2900 @c ***Testing*****************************************************************
2901 @ifnothtml
2902 @comment node-name, next, previous, up
2903 @node Testing, Final install, Building, Installing GCC
2904 @end ifnothtml
2905 @ifset testhtml
2906 @ifnothtml
2907 @chapter Installing GCC: Testing
2908 @end ifnothtml
2909 @cindex Testing
2910 @cindex Installing GCC: Testing
2911 @cindex Testsuite
2912
2913 Before you install GCC, we encourage you to run the testsuites and to
2914 compare your results with results from a similar configuration that have
2915 been submitted to the
2916 @uref{http://gcc.gnu.org/ml/gcc-testresults/,,gcc-testresults mailing list}.
2917 Some of these archived results are linked from the build status lists
2918 at @uref{http://gcc.gnu.org/buildstat.html}, although not everyone who
2919 reports a successful build runs the testsuites and submits the results.
2920 This step is optional and may require you to download additional software,
2921 but it can give you confidence in your new GCC installation or point out
2922 problems before you install and start using your new GCC@.
2923
2924 First, you must have @uref{download.html,,downloaded the testsuites}.
2925 These are part of the full distribution, but if you downloaded the
2926 ``core'' compiler plus any front ends, you must download the testsuites
2927 separately.
2928
2929 Second, you must have the testing tools installed. This includes
2930 @uref{http://www.gnu.org/software/dejagnu/,,DejaGnu}, Tcl, and Expect;
2931 the DejaGnu site has links to these. For running the BRIG frontend
2932 tests, a tool to assemble the binary BRIGs from HSAIL text,
2933 @uref{https://github.com/HSAFoundation/HSAIL-Tools/,,HSAILasm} must
2934 be installed.
2935
2936 If the directories where @command{runtest} and @command{expect} were
2937 installed are not in the @env{PATH}, you may need to set the following
2938 environment variables appropriately, as in the following example (which
2939 assumes that DejaGnu has been installed under @file{/usr/local}):
2940
2941 @smallexample
2942 TCL_LIBRARY = /usr/local/share/tcl8.0
2943 DEJAGNULIBS = /usr/local/share/dejagnu
2944 @end smallexample
2945
2946 (On systems such as Cygwin, these paths are required to be actual
2947 paths, not mounts or links; presumably this is due to some lack of
2948 portability in the DejaGnu code.)
2949
2950
2951 Finally, you can run the testsuite (which may take a long time):
2952 @smallexample
2953 cd @var{objdir}; make -k check
2954 @end smallexample
2955
2956 This will test various components of GCC, such as compiler
2957 front ends and runtime libraries. While running the testsuite, DejaGnu
2958 might emit some harmless messages resembling
2959 @samp{WARNING: Couldn't find the global config file.} or
2960 @samp{WARNING: Couldn't find tool init file} that can be ignored.
2961
2962 If you are testing a cross-compiler, you may want to run the testsuite
2963 on a simulator as described at @uref{http://gcc.gnu.org/simtest-howto.html}.
2964
2965 @section How can you run the testsuite on selected tests?
2966
2967 In order to run sets of tests selectively, there are targets
2968 @samp{make check-gcc} and language specific @samp{make check-c},
2969 @samp{make check-c++}, @samp{make check-d} @samp{make check-fortran},
2970 @samp{make check-ada}, @samp{make check-objc}, @samp{make check-obj-c++},
2971 @samp{make check-lto}
2972 in the @file{gcc} subdirectory of the object directory. You can also
2973 just run @samp{make check} in a subdirectory of the object directory.
2974
2975
2976 A more selective way to just run all @command{gcc} execute tests in the
2977 testsuite is to use
2978
2979 @smallexample
2980 make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
2981 @end smallexample
2982
2983 Likewise, in order to run only the @command{g++} ``old-deja'' tests in
2984 the testsuite with filenames matching @samp{9805*}, you would use
2985
2986 @smallexample
2987 make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
2988 @end smallexample
2989
2990 The file-matching expression following @var{filename}@command{.exp=} is treated
2991 as a series of whitespace-delimited glob expressions so that multiple patterns
2992 may be passed, although any whitespace must either be escaped or surrounded by
2993 single quotes if multiple expressions are desired. For example,
2994
2995 @smallexample
2996 make check-g++ RUNTESTFLAGS="old-deja.exp=9805*\ virtual2.c @var{other-options}"
2997 make check-g++ RUNTESTFLAGS="'old-deja.exp=9805* virtual2.c' @var{other-options}"
2998 @end smallexample
2999
3000 The @file{*.exp} files are located in the testsuite directories of the GCC
3001 source, the most important ones being @file{compile.exp},
3002 @file{execute.exp}, @file{dg.exp} and @file{old-deja.exp}.
3003 To get a list of the possible @file{*.exp} files, pipe the
3004 output of @samp{make check} into a file and look at the
3005 @samp{Running @dots{} .exp} lines.
3006
3007 @section Passing options and running multiple testsuites
3008
3009 You can pass multiple options to the testsuite using the
3010 @samp{--target_board} option of DejaGNU, either passed as part of
3011 @samp{RUNTESTFLAGS}, or directly to @command{runtest} if you prefer to
3012 work outside the makefiles. For example,
3013
3014 @smallexample
3015 make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
3016 @end smallexample
3017
3018 will run the standard @command{g++} testsuites (``unix'' is the target name
3019 for a standard native testsuite situation), passing
3020 @samp{-O3 -fmerge-constants} to the compiler on every test, i.e.,
3021 slashes separate options.
3022
3023 You can run the testsuites multiple times using combinations of options
3024 with a syntax similar to the brace expansion of popular shells:
3025
3026 @smallexample
3027 @dots{}"--target_board=arm-sim\@{-mhard-float,-msoft-float\@}\@{-O1,-O2,-O3,\@}"
3028 @end smallexample
3029
3030 (Note the empty option caused by the trailing comma in the final group.)
3031 The following will run each testsuite eight times using the @samp{arm-sim}
3032 target, as if you had specified all possible combinations yourself:
3033
3034 @smallexample
3035 --target_board='arm-sim/-mhard-float/-O1 \
3036 arm-sim/-mhard-float/-O2 \
3037 arm-sim/-mhard-float/-O3 \
3038 arm-sim/-mhard-float \
3039 arm-sim/-msoft-float/-O1 \
3040 arm-sim/-msoft-float/-O2 \
3041 arm-sim/-msoft-float/-O3 \
3042 arm-sim/-msoft-float'
3043 @end smallexample
3044
3045 They can be combined as many times as you wish, in arbitrary ways. This
3046 list:
3047
3048 @smallexample
3049 @dots{}"--target_board=unix/-Wextra\@{-O3,-fno-strength\@}\@{-fomit-frame,\@}"
3050 @end smallexample
3051
3052 will generate four combinations, all involving @samp{-Wextra}.
3053
3054 The disadvantage to this method is that the testsuites are run in serial,
3055 which is a waste on multiprocessor systems. For users with GNU Make and
3056 a shell which performs brace expansion, you can run the testsuites in
3057 parallel by having the shell perform the combinations and @command{make}
3058 do the parallel runs. Instead of using @samp{--target_board}, use a
3059 special makefile target:
3060
3061 @smallexample
3062 make -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{option2}/@dots{}
3063 @end smallexample
3064
3065 For example,
3066
3067 @smallexample
3068 make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
3069 @end smallexample
3070
3071 will run three concurrent ``make-gcc'' testsuites, eventually testing all
3072 ten combinations as described above. Note that this is currently only
3073 supported in the @file{gcc} subdirectory. (To see how this works, try
3074 typing @command{echo} before the example given here.)
3075
3076
3077 @section How to interpret test results
3078
3079 The result of running the testsuite are various @file{*.sum} and @file{*.log}
3080 files in the testsuite subdirectories. The @file{*.log} files contain a
3081 detailed log of the compiler invocations and the corresponding
3082 results, the @file{*.sum} files summarize the results. These summaries
3083 contain status codes for all tests:
3084
3085 @itemize @bullet
3086 @item
3087 PASS: the test passed as expected
3088 @item
3089 XPASS: the test unexpectedly passed
3090 @item
3091 FAIL: the test unexpectedly failed
3092 @item
3093 XFAIL: the test failed as expected
3094 @item
3095 UNSUPPORTED: the test is not supported on this platform
3096 @item
3097 ERROR: the testsuite detected an error
3098 @item
3099 WARNING: the testsuite detected a possible problem
3100 @end itemize
3101
3102 It is normal for some tests to report unexpected failures. At the
3103 current time the testing harness does not allow fine grained control
3104 over whether or not a test is expected to fail. This problem should
3105 be fixed in future releases.
3106
3107
3108 @section Submitting test results
3109
3110 If you want to report the results to the GCC project, use the
3111 @file{contrib/test_summary} shell script. Start it in the @var{objdir} with
3112
3113 @smallexample
3114 @var{srcdir}/contrib/test_summary -p your_commentary.txt \
3115 -m gcc-testresults@@gcc.gnu.org |sh
3116 @end smallexample
3117
3118 This script uses the @command{Mail} program to send the results, so
3119 make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is
3120 prepended to the testsuite summary and should contain any special
3121 remarks you have on your results or your build environment. Please
3122 do not edit the testsuite result block or the subject line, as these
3123 messages may be automatically processed.
3124
3125 @html
3126 <hr />
3127 <p>
3128 @end html
3129 @ifhtml
3130 @uref{./index.html,,Return to the GCC Installation page}
3131 @end ifhtml
3132 @end ifset
3133
3134 @c ***Final install***********************************************************
3135 @ifnothtml
3136 @comment node-name, next, previous, up
3137 @node Final install, , Testing, Installing GCC
3138 @end ifnothtml
3139 @ifset finalinstallhtml
3140 @ifnothtml
3141 @chapter Installing GCC: Final installation
3142 @end ifnothtml
3143
3144 Now that GCC has been built (and optionally tested), you can install it with
3145 @smallexample
3146 cd @var{objdir} && make install
3147 @end smallexample
3148
3149 We strongly recommend to install into a target directory where there is
3150 no previous version of GCC present. Also, the GNAT runtime should not
3151 be stripped, as this would break certain features of the debugger that
3152 depend on this debugging information (catching Ada exceptions for
3153 instance).
3154
3155 That step completes the installation of GCC; user level binaries can
3156 be found in @file{@var{prefix}/bin} where @var{prefix} is the value
3157 you specified with the @option{--prefix} to configure (or
3158 @file{/usr/local} by default). (If you specified @option{--bindir},
3159 that directory will be used instead; otherwise, if you specified
3160 @option{--exec-prefix}, @file{@var{exec-prefix}/bin} will be used.)
3161 Headers for the C++ library are installed in
3162 @file{@var{prefix}/include}; libraries in @file{@var{libdir}}
3163 (normally @file{@var{prefix}/lib}); internal parts of the compiler in
3164 @file{@var{libdir}/gcc} and @file{@var{libexecdir}/gcc}; documentation
3165 in info format in @file{@var{infodir}} (normally
3166 @file{@var{prefix}/info}).
3167
3168 When installing cross-compilers, GCC's executables
3169 are not only installed into @file{@var{bindir}}, that
3170 is, @file{@var{exec-prefix}/bin}, but additionally into
3171 @file{@var{exec-prefix}/@var{target-alias}/bin}, if that directory
3172 exists. Typically, such @dfn{tooldirs} hold target-specific
3173 binutils, including assembler and linker.
3174
3175 Installation into a temporary staging area or into a @command{chroot}
3176 jail can be achieved with the command
3177
3178 @smallexample
3179 make DESTDIR=@var{path-to-rootdir} install
3180 @end smallexample
3181
3182 @noindent
3183 where @var{path-to-rootdir} is the absolute path of
3184 a directory relative to which all installation paths will be
3185 interpreted. Note that the directory specified by @code{DESTDIR}
3186 need not exist yet; it will be created if necessary.
3187
3188 There is a subtle point with tooldirs and @code{DESTDIR}:
3189 If you relocate a cross-compiler installation with
3190 e.g.@: @samp{DESTDIR=@var{rootdir}}, then the directory
3191 @file{@var{rootdir}/@var{exec-prefix}/@var{target-alias}/bin} will
3192 be filled with duplicated GCC executables only if it already exists,
3193 it will not be created otherwise. This is regarded as a feature,
3194 not as a bug, because it gives slightly more control to the packagers
3195 using the @code{DESTDIR} feature.
3196
3197 You can install stripped programs and libraries with
3198
3199 @smallexample
3200 make install-strip
3201 @end smallexample
3202
3203 If you are bootstrapping a released version of GCC then please
3204 quickly review the build status page for your release, available from
3205 @uref{http://gcc.gnu.org/buildstat.html}.
3206 If your system is not listed for the version of GCC that you built,
3207 send a note to
3208 @email{gcc@@gcc.gnu.org} indicating
3209 that you successfully built and installed GCC@.
3210 Include the following information:
3211
3212 @itemize @bullet
3213 @item
3214 Output from running @file{@var{srcdir}/config.guess}. Do not send
3215 that file itself, just the one-line output from running it.
3216
3217 @item
3218 The output of @samp{gcc -v} for your newly installed @command{gcc}.
3219 This tells us which version of GCC you built and the options you passed to
3220 configure.
3221
3222 @item
3223 Whether you enabled all languages or a subset of them. If you used a
3224 full distribution then this information is part of the configure
3225 options in the output of @samp{gcc -v}, but if you downloaded the
3226 ``core'' compiler plus additional front ends then it isn't apparent
3227 which ones you built unless you tell us about it.
3228
3229 @item
3230 If the build was for GNU/Linux, also include:
3231 @itemize @bullet
3232 @item
3233 The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
3234 this information should be available from @file{/etc/issue}.
3235
3236 @item
3237 The version of the Linux kernel, available from @samp{uname --version}
3238 or @samp{uname -a}.
3239
3240 @item
3241 The version of glibc you used; for RPM-based systems like Red Hat,
3242 Mandrake, and SuSE type @samp{rpm -q glibc} to get the glibc version,
3243 and on systems like Debian and Progeny use @samp{dpkg -l libc6}.
3244 @end itemize
3245 For other systems, you can include similar information if you think it is
3246 relevant.
3247
3248 @item
3249 Any other information that you think would be useful to people building
3250 GCC on the same configuration. The new entry in the build status list
3251 will include a link to the archived copy of your message.
3252 @end itemize
3253
3254 We'd also like to know if the
3255 @ifnothtml
3256 @ref{Specific, host/target specific installation notes}
3257 @end ifnothtml
3258 @ifhtml
3259 @uref{specific.html,,host/target specific installation notes}
3260 @end ifhtml
3261 didn't include your host/target information or if that information is
3262 incomplete or out of date. Send a note to
3263 @email{gcc@@gcc.gnu.org} detailing how the information should be changed.
3264
3265 If you find a bug, please report it following the
3266 @uref{../bugs/,,bug reporting guidelines}.
3267
3268 If you want to print the GCC manuals, do @samp{cd @var{objdir}; make
3269 dvi}. You will need to have @command{texi2dvi} (version at least 4.7)
3270 and @TeX{} installed. This creates a number of @file{.dvi} files in
3271 subdirectories of @file{@var{objdir}}; these may be converted for
3272 printing with programs such as @command{dvips}. Alternately, by using
3273 @samp{make pdf} in place of @samp{make dvi}, you can create documentation
3274 in the form of @file{.pdf} files; this requires @command{texi2pdf}, which
3275 is included with Texinfo version 4.8 and later. You can also
3276 @uref{https://shop.fsf.org/,,buy printed manuals from the
3277 Free Software Foundation}, though such manuals may not be for the most
3278 recent version of GCC@.
3279
3280 If you would like to generate online HTML documentation, do @samp{cd
3281 @var{objdir}; make html} and HTML will be generated for the gcc manuals in
3282 @file{@var{objdir}/gcc/HTML}.
3283
3284 @html
3285 <hr />
3286 <p>
3287 @end html
3288 @ifhtml
3289 @uref{./index.html,,Return to the GCC Installation page}
3290 @end ifhtml
3291 @end ifset
3292
3293 @c ***Binaries****************************************************************
3294 @ifnothtml
3295 @comment node-name, next, previous, up
3296 @node Binaries, Specific, Installing GCC, Top
3297 @end ifnothtml
3298 @ifset binarieshtml
3299 @ifnothtml
3300 @chapter Installing GCC: Binaries
3301 @end ifnothtml
3302 @cindex Binaries
3303 @cindex Installing GCC: Binaries
3304
3305 We are often asked about pre-compiled versions of GCC@. While we cannot
3306 provide these for all platforms, below you'll find links to binaries for
3307 various platforms where creating them by yourself is not easy due to various
3308 reasons.
3309
3310 Please note that we did not create these binaries, nor do we
3311 support them. If you have any problems installing them, please
3312 contact their makers.
3313
3314 @itemize
3315 @item
3316 AIX:
3317 @itemize
3318 @item
3319 @uref{http://www.bullfreeware.com,,Bull's Open Source Software Archive for
3320 for AIX 6 and AIX 7};
3321
3322 @item
3323 @uref{http://www.perzl.org/aix/,,AIX Open Source Packages (AIX5L AIX 6.1
3324 AIX 7.1)}.
3325 @end itemize
3326
3327 @item
3328 DOS---@uref{http://www.delorie.com/djgpp/,,DJGPP}.
3329
3330 @item
3331 HP-UX:
3332 @itemize
3333 @item
3334 @uref{http://hpux.connect.org.uk/,,HP-UX Porting Center};
3335 @end itemize
3336
3337 @item
3338 Solaris 2 (SPARC, Intel):
3339 @itemize
3340 @item
3341 @uref{https://www.opencsw.org/,,OpenCSW}
3342 @end itemize
3343
3344 @item
3345 macOS:
3346 @itemize
3347 @item
3348 The @uref{https://brew.sh,,Homebrew} package manager;
3349 @item
3350 @uref{https://www.macports.org,,MacPorts}.
3351 @end itemize
3352
3353 @item
3354 Microsoft Windows:
3355 @itemize
3356 @item
3357 The @uref{https://sourceware.org/cygwin/,,Cygwin} project;
3358 @item
3359 The @uref{http://www.mingw.org/,,MinGW} and
3360 @uref{http://mingw-w64.org/doku.php,,mingw-w64} projects.
3361 @end itemize
3362
3363 @item
3364 @uref{http://www.openpkg.org/,,OpenPKG} offers binaries for quite a
3365 number of platforms.
3366
3367 @item
3368 The @uref{http://gcc.gnu.org/wiki/GFortranBinaries,,GFortran Wiki} has
3369 links to GNU Fortran binaries for several platforms.
3370 @end itemize
3371
3372 @html
3373 <hr />
3374 <p>
3375 @end html
3376 @ifhtml
3377 @uref{./index.html,,Return to the GCC Installation page}
3378 @end ifhtml
3379 @end ifset
3380
3381 @c ***Specific****************************************************************
3382 @ifnothtml
3383 @comment node-name, next, previous, up
3384 @node Specific, Old, Binaries, Top
3385 @end ifnothtml
3386 @ifset specifichtml
3387 @ifnothtml
3388 @chapter Host/target specific installation notes for GCC
3389 @end ifnothtml
3390 @cindex Specific
3391 @cindex Specific installation notes
3392 @cindex Target specific installation
3393 @cindex Host specific installation
3394 @cindex Target specific installation notes
3395
3396 Please read this document carefully @emph{before} installing the
3397 GNU Compiler Collection on your machine.
3398
3399 Note that this list of install notes is @emph{not} a list of supported
3400 hosts or targets. Not all supported hosts and targets are listed
3401 here, only the ones that require host-specific or target-specific
3402 information have to.
3403
3404 @ifhtml
3405 @itemize
3406 @item
3407 @uref{#aarch64-x-x,,aarch64*-*-*}
3408 @item
3409 @uref{#alpha-x-x,,alpha*-*-*}
3410 @item
3411 @uref{#amd64-x-solaris2,,amd64-*-solaris2*}
3412 @item
3413 @uref{#arm-x-eabi,,arm-*-eabi}
3414 @item
3415 @uref{#avr,,avr}
3416 @item
3417 @uref{#bfin,,Blackfin}
3418 @item
3419 @uref{#dos,,DOS}
3420 @item
3421 @uref{#x-x-freebsd,,*-*-freebsd*}
3422 @item
3423 @uref{#h8300-hms,,h8300-hms}
3424 @item
3425 @uref{#hppa-hp-hpux,,hppa*-hp-hpux*}
3426 @item
3427 @uref{#hppa-hp-hpux10,,hppa*-hp-hpux10}
3428 @item
3429 @uref{#hppa-hp-hpux11,,hppa*-hp-hpux11}
3430 @item
3431 @uref{#x-x-linux-gnu,,*-*-linux-gnu}
3432 @item
3433 @uref{#ix86-x-linux,,i?86-*-linux*}
3434 @item
3435 @uref{#ix86-x-solaris2,,i?86-*-solaris2*}
3436 @item
3437 @uref{#ia64-x-linux,,ia64-*-linux}
3438 @item
3439 @uref{#ia64-x-hpux,,ia64-*-hpux*}
3440 @item
3441 @uref{#x-ibm-aix,,*-ibm-aix*}
3442 @item
3443 @uref{#iq2000-x-elf,,iq2000-*-elf}
3444 @item
3445 @uref{#lm32-x-elf,,lm32-*-elf}
3446 @item
3447 @uref{#lm32-x-uclinux,,lm32-*-uclinux}
3448 @item
3449 @uref{#m32c-x-elf,,m32c-*-elf}
3450 @item
3451 @uref{#m32r-x-elf,,m32r-*-elf}
3452 @item
3453 @uref{#m68k-x-x,,m68k-*-*}
3454 @item
3455 @uref{#m68k-uclinux,,m68k-uclinux}
3456 @item
3457 @uref{#microblaze-x-elf,,microblaze-*-elf}
3458 @item
3459 @uref{#mips-x-x,,mips-*-*}
3460 @item
3461 @uref{#nds32le-x-elf,,nds32le-*-elf}
3462 @item
3463 @uref{#nds32be-x-elf,,nds32be-*-elf}
3464 @item
3465 @uref{#nvptx-x-none,,nvptx-*-none}
3466 @item
3467 @uref{#or1k-x-elf,,or1k-*-elf}
3468 @item
3469 @uref{#or1k-x-linux,,or1k-*-linux}
3470 @item
3471 @uref{#powerpc-x-x,,powerpc*-*-*}
3472 @item
3473 @uref{#powerpc-x-darwin,,powerpc-*-darwin*}
3474 @item
3475 @uref{#powerpc-x-elf,,powerpc-*-elf}
3476 @item
3477 @uref{#powerpc-x-linux-gnu,,powerpc*-*-linux-gnu*}
3478 @item
3479 @uref{#powerpc-x-netbsd,,powerpc-*-netbsd*}
3480 @item
3481 @uref{#powerpc-x-eabisim,,powerpc-*-eabisim}
3482 @item
3483 @uref{#powerpc-x-eabi,,powerpc-*-eabi}
3484 @item
3485 @uref{#powerpcle-x-elf,,powerpcle-*-elf}
3486 @item
3487 @uref{#powerpcle-x-eabisim,,powerpcle-*-eabisim}
3488 @item
3489 @uref{#powerpcle-x-eabi,,powerpcle-*-eabi}
3490 @item
3491 @uref{#riscv32-x-elf,,riscv32-*-elf}
3492 @item
3493 @uref{#riscv32-x-linux,,riscv32-*-linux}
3494 @item
3495 @uref{#riscv64-x-elf,,riscv64-*-elf}
3496 @item
3497 @uref{#riscv64-x-linux,,riscv64-*-linux}
3498 @item
3499 @uref{#s390-x-linux,,s390-*-linux*}
3500 @item
3501 @uref{#s390x-x-linux,,s390x-*-linux*}
3502 @item
3503 @uref{#s390x-ibm-tpf,,s390x-ibm-tpf*}
3504 @item
3505 @uref{#x-x-solaris2,,*-*-solaris2*}
3506 @item
3507 @uref{#sparc-x-x,,sparc*-*-*}
3508 @item
3509 @uref{#sparc-sun-solaris2,,sparc-sun-solaris2*}
3510 @item
3511 @uref{#sparc-x-linux,,sparc-*-linux*}
3512 @item
3513 @uref{#sparc64-x-solaris2,,sparc64-*-solaris2*}
3514 @item
3515 @uref{#sparcv9-x-solaris2,,sparcv9-*-solaris2*}
3516 @item
3517 @uref{#c6x-x-x,,c6x-*-*}
3518 @item
3519 @uref{#tilegx-x-linux,,tilegx-*-linux*}
3520 @item
3521 @uref{#tilegxbe-x-linux,,tilegxbe-*-linux*}
3522 @item
3523 @uref{#tilepro-x-linux,,tilepro-*-linux*}
3524 @item
3525 @uref{#visium-x-elf, visium-*-elf}
3526 @item
3527 @uref{#x-x-vxworks,,*-*-vxworks*}
3528 @item
3529 @uref{#x86-64-x-x,,x86_64-*-*, amd64-*-*}
3530 @item
3531 @uref{#x86-64-x-solaris2,,x86_64-*-solaris2*}
3532 @item
3533 @uref{#xtensa-x-elf,,xtensa*-*-elf}
3534 @item
3535 @uref{#xtensa-x-linux,,xtensa*-*-linux*}
3536 @item
3537 @uref{#windows,,Microsoft Windows}
3538 @item
3539 @uref{#x-x-cygwin,,*-*-cygwin}
3540 @item
3541 @uref{#x-x-mingw32,,*-*-mingw32}
3542 @item
3543 @uref{#os2,,OS/2}
3544 @item
3545 @uref{#older,,Older systems}
3546 @end itemize
3547
3548 @itemize
3549 @item
3550 @uref{#elf,,all ELF targets} (SVR4, Solaris 2, etc.)
3551 @end itemize
3552 @end ifhtml
3553
3554
3555 @html
3556 <!-- -------- host/target specific issues start here ---------------- -->
3557 <hr />
3558 @end html
3559 @anchor{aarch64-x-x}
3560 @heading aarch64*-*-*
3561 Binutils pre 2.24 does not have support for selecting @option{-mabi} and
3562 does not support ILP32. If it is used to build GCC 4.9 or later, GCC will
3563 not support option @option{-mabi=ilp32}.
3564
3565 To enable a workaround for the Cortex-A53 erratum number 835769 by default
3566 (for all CPUs regardless of -mcpu option given) at configure time use the
3567 @option{--enable-fix-cortex-a53-835769} option. This will enable the fix by
3568 default and can be explicitly disabled during compilation by passing the
3569 @option{-mno-fix-cortex-a53-835769} option. Conversely,
3570 @option{--disable-fix-cortex-a53-835769} will disable the workaround by
3571 default. The workaround is disabled by default if neither of
3572 @option{--enable-fix-cortex-a53-835769} or
3573 @option{--disable-fix-cortex-a53-835769} is given at configure time.
3574
3575 To enable a workaround for the Cortex-A53 erratum number 843419 by default
3576 (for all CPUs regardless of -mcpu option given) at configure time use the
3577 @option{--enable-fix-cortex-a53-843419} option. This workaround is applied at
3578 link time. Enabling the workaround will cause GCC to pass the relevant option
3579 to the linker. It can be explicitly disabled during compilation by passing the
3580 @option{-mno-fix-cortex-a53-843419} option. Conversely,
3581 @option{--disable-fix-cortex-a53-843419} will disable the workaround by default.
3582 The workaround is disabled by default if neither of
3583 @option{--enable-fix-cortex-a53-843419} or
3584 @option{--disable-fix-cortex-a53-843419} is given at configure time.
3585
3586 To enable Branch Target Identification Mechanism and Return Address Signing by
3587 default at configure time use the @option{--enable-standard-branch-protection}
3588 option. This is equivalent to having @option{-mbranch-protection=standard}
3589 during compilation. This can be explicitly disabled during compilation by
3590 passing the @option{-mbranch-protection=none} option which turns off all
3591 types of branch protections. Conversely,
3592 @option{--disable-standard-branch-protection} will disable both the
3593 protections by default. This mechanism is turned off by default if neither
3594 of the options are given at configure time.
3595
3596 @html
3597 <hr />
3598 @end html
3599 @anchor{alpha-x-x}
3600 @heading alpha*-*-*
3601 This section contains general configuration information for all
3602 Alpha-based platforms using ELF@. In addition to reading this
3603 section, please read all other sections that match your target.
3604
3605 @html
3606 <hr />
3607 @end html
3608 @anchor{amd64-x-solaris2}
3609 @heading amd64-*-solaris2*
3610 This is a synonym for @samp{x86_64-*-solaris2*}.
3611
3612 @html
3613 <hr />
3614 @end html
3615 @anchor{amdgcn-x-amdhsa}
3616 @heading amdgcn-*-amdhsa
3617 AMD GCN GPU target.
3618
3619 Instead of GNU Binutils, you will need to install LLVM 6, or later, and copy
3620 @file{bin/llvm-mc} to @file{amdgcn-amdhsa/bin/as},
3621 @file{bin/lld} to @file{amdgcn-amdhsa/bin/ld},
3622 @file{bin/llvm-nm} to @file{amdgcn-amdhsa/bin/nm}, and
3623 @file{bin/llvm-ar} to both @file{bin/amdgcn-amdhsa-ar} and
3624 @file{bin/amdgcn-amdhsa-ranlib}.
3625
3626 Use Newlib (2019-01-16, or newer).
3627
3628 To run the binaries, install the HSA Runtime from the
3629 @uref{https://rocm.github.io,,ROCm Platform}, and use
3630 @file{libexec/gcc/amdhsa-amdhsa/@var{version}/gcn-run} to launch them
3631 on the GPU.
3632
3633 @html
3634 <hr />
3635 @end html
3636 @anchor{arc-x-elf32}
3637 @heading arc-*-elf32
3638
3639 Use @samp{configure --target=arc-elf32 --with-cpu=@var{cpu} --enable-languages="c,c++"}
3640 to configure GCC, with @var{cpu} being one of @samp{arc600}, @samp{arc601},
3641 or @samp{arc700}@.
3642
3643 @html
3644 <hr />
3645 @end html
3646 @anchor{arc-linux-uclibc}
3647 @heading arc-linux-uclibc
3648
3649 Use @samp{configure --target=arc-linux-uclibc --with-cpu=arc700 --enable-languages="c,c++"} to configure GCC@.
3650
3651 @html
3652 <hr />
3653 @end html
3654 @anchor{arm-x-eabi}
3655 @heading arm-*-eabi
3656 ARM-family processors.
3657
3658 Building the Ada frontend commonly fails (an infinite loop executing
3659 @code{xsinfo}) if the host compiler is GNAT 4.8. Host compilers built from the
3660 GNAT 4.6, 4.9 or 5 release branches are known to succeed.
3661
3662 @html
3663 <hr />
3664 @end html
3665 @anchor{avr}
3666 @heading avr
3667 ATMEL AVR-family micro controllers. These are used in embedded
3668 applications. There are no standard Unix configurations.
3669 @ifnothtml
3670 @xref{AVR Options,, AVR Options, gcc, Using the GNU Compiler
3671 Collection (GCC)},
3672 @end ifnothtml
3673 @ifhtml
3674 See ``AVR Options'' in the main manual
3675 @end ifhtml
3676 for the list of supported MCU types.
3677
3678 Use @samp{configure --target=avr --enable-languages="c"} to configure GCC@.
3679
3680 Further installation notes and other useful information about AVR tools
3681 can also be obtained from:
3682
3683 @itemize @bullet
3684 @item
3685 @uref{http://www.nongnu.org/avr/,,http://www.nongnu.org/avr/}
3686 @item
3687 @uref{http://www.amelek.gda.pl/avr/,,http://www.amelek.gda.pl/avr/}
3688 @end itemize
3689
3690 The following error:
3691 @smallexample
3692 Error: register required
3693 @end smallexample
3694
3695 indicates that you should upgrade to a newer version of the binutils.
3696
3697 @html
3698 <hr />
3699 @end html
3700 @anchor{bfin}
3701 @heading Blackfin
3702 The Blackfin processor, an Analog Devices DSP.
3703 @ifnothtml
3704 @xref{Blackfin Options,, Blackfin Options, gcc, Using the GNU Compiler
3705 Collection (GCC)},
3706 @end ifnothtml
3707 @ifhtml
3708 See ``Blackfin Options'' in the main manual
3709 @end ifhtml
3710
3711 More information, and a version of binutils with support for this processor,
3712 are available at @uref{https://sourceforge.net/projects/adi-toolchain/}.
3713
3714 @html
3715 <hr />
3716 @end html
3717 @anchor{cr16}
3718 @heading CR16
3719 The CR16 CompactRISC architecture is a 16-bit architecture. This
3720 architecture is used in embedded applications.
3721
3722 @ifnothtml
3723 @xref{CR16 Options,, CR16 Options, gcc, Using and Porting the GNU Compiler
3724 Collection (GCC)},
3725 @end ifnothtml
3726
3727 @ifhtml
3728 See ``CR16 Options'' in the main manual for a list of CR16-specific options.
3729 @end ifhtml
3730
3731 Use @samp{configure --target=cr16-elf --enable-languages=c,c++} to configure
3732 GCC@ for building a CR16 elf cross-compiler.
3733
3734 Use @samp{configure --target=cr16-uclinux --enable-languages=c,c++} to
3735 configure GCC@ for building a CR16 uclinux cross-compiler.
3736
3737 @html
3738 <hr />
3739 @end html
3740 @anchor{cris}
3741 @heading CRIS
3742 CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
3743 series. These are used in embedded applications.
3744
3745 @ifnothtml
3746 @xref{CRIS Options,, CRIS Options, gcc, Using the GNU Compiler
3747 Collection (GCC)},
3748 @end ifnothtml
3749 @ifhtml
3750 See ``CRIS Options'' in the main manual
3751 @end ifhtml
3752 for a list of CRIS-specific options.
3753
3754 There are a few different CRIS targets:
3755 @table @code
3756 @item cris-axis-elf
3757 Mainly for monolithic embedded systems. Includes a multilib for the
3758 @samp{v10} core used in @samp{ETRAX 100 LX}.
3759 @item cris-axis-linux-gnu
3760 A GNU/Linux port for the CRIS architecture, currently targeting
3761 @samp{ETRAX 100 LX} by default.
3762 @end table
3763
3764 Pre-packaged tools can be obtained from
3765 @uref{ftp://ftp.axis.com/@/pub/@/axis/@/tools/@/cris/@/compiler-kit/}. More
3766 information about this platform is available at
3767 @uref{http://developer.axis.com/}.
3768
3769 @html
3770 <hr />
3771 @end html
3772 @anchor{dos}
3773 @heading DOS
3774 Please have a look at the @uref{binaries.html,,binaries page}.
3775
3776 You cannot install GCC by itself on MSDOS; it will not compile under
3777 any MSDOS compiler except itself. You need to get the complete
3778 compilation package DJGPP, which includes binaries as well as sources,
3779 and includes all the necessary compilation tools and libraries.
3780
3781 @html
3782 <hr />
3783 @end html
3784 @anchor{epiphany-x-elf}
3785 @heading epiphany-*-elf
3786 Adapteva Epiphany.
3787 This configuration is intended for embedded systems.
3788
3789 @html
3790 <hr />
3791 @end html
3792 @anchor{x-x-freebsd}
3793 @heading *-*-freebsd*
3794 Support for FreeBSD 1 was discontinued in GCC 3.2. Support for
3795 FreeBSD 2 (and any mutant a.out variants of FreeBSD 3) was
3796 discontinued in GCC 4.0.
3797
3798 In order to better utilize FreeBSD base system functionality and match
3799 the configuration of the system compiler, GCC 4.5 and above as well as
3800 GCC 4.4 past 2010-06-20 leverage SSP support in libc (which is present
3801 on FreeBSD 7 or later) and the use of @code{__cxa_atexit} by default
3802 (on FreeBSD 6 or later). The use of @code{dl_iterate_phdr} inside
3803 @file{libgcc_s.so.1} and boehm-gc (on FreeBSD 7 or later) is enabled
3804 by GCC 4.5 and above.
3805
3806 We support FreeBSD using the ELF file format with DWARF 2 debugging
3807 for all CPU architectures. You may use @option{-gstabs} instead of
3808 @option{-g}, if you really want the old debugging format. There are
3809 no known issues with mixing object files and libraries with different
3810 debugging formats. Otherwise, this release of GCC should now match
3811 more of the configuration used in the stock FreeBSD configuration of
3812 GCC@. In particular, @option{--enable-threads} is now configured by
3813 default. However, as a general user, do not attempt to replace the
3814 system compiler with this release. Known to bootstrap and check with
3815 good results on FreeBSD 7.2-STABLE@. In the past, known to bootstrap
3816 and check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3, 4.4,
3817 4.5, 4.8, 4.9 and 5-CURRENT@.
3818
3819 The version of binutils installed in @file{/usr/bin} probably works
3820 with this release of GCC@. Bootstrapping against the latest GNU
3821 binutils and/or the version found in @file{/usr/ports/devel/binutils} has
3822 been known to enable additional features and improve overall testsuite
3823 results. However, it is currently known that boehm-gc may not configure
3824 properly on FreeBSD prior to the FreeBSD 7.0 release with GNU binutils
3825 after 2.16.1.
3826
3827 @html
3828 <hr />
3829 @end html
3830 @anchor{ft32-x-elf}
3831 @heading ft32-*-elf
3832 The FT32 processor.
3833 This configuration is intended for embedded systems.
3834
3835 @html
3836 <hr />
3837 @end html
3838 @anchor{h8300-hms}
3839 @heading h8300-hms
3840 Renesas H8/300 series of processors.
3841
3842 Please have a look at the @uref{binaries.html,,binaries page}.
3843
3844 The calling convention and structure layout has changed in release 2.6.
3845 All code must be recompiled. The calling convention now passes the
3846 first three arguments in function calls in registers. Structures are no
3847 longer a multiple of 2 bytes.
3848
3849 @html
3850 <hr />
3851 @end html
3852 @anchor{hppa-hp-hpux}
3853 @heading hppa*-hp-hpux*
3854 Support for HP-UX version 9 and older was discontinued in GCC 3.4.
3855
3856 We require using gas/binutils on all hppa platforms. Version 2.19 or
3857 later is recommended.
3858
3859 It may be helpful to configure GCC with the
3860 @uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
3861 @option{--with-as=@dots{}} options to ensure that GCC can find GAS@.
3862
3863 The HP assembler should not be used with GCC. It is rarely tested and may
3864 not work. It shouldn't be used with any languages other than C due to its
3865 many limitations.
3866
3867 Specifically, @option{-g} does not work (HP-UX uses a peculiar debugging
3868 format which GCC does not know about). It also inserts timestamps
3869 into each object file it creates, causing the 3-stage comparison test to
3870 fail during a bootstrap. You should be able to continue by saying
3871 @samp{make all-host all-target} after getting the failure from @samp{make}.
3872
3873 Various GCC features are not supported. For example, it does not support weak
3874 symbols or alias definitions. As a result, explicit template instantiations
3875 are required when using C++. This makes it difficult if not impossible to
3876 build many C++ applications.
3877
3878 There are two default scheduling models for instructions. These are
3879 PROCESSOR_7100LC and PROCESSOR_8000. They are selected from the pa-risc
3880 architecture specified for the target machine when configuring.
3881 PROCESSOR_8000 is the default. PROCESSOR_7100LC is selected when
3882 the target is a @samp{hppa1*} machine.
3883
3884 The PROCESSOR_8000 model is not well suited to older processors. Thus,
3885 it is important to completely specify the machine architecture when
3886 configuring if you want a model other than PROCESSOR_8000. The macro
3887 TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different
3888 default scheduling model is desired.
3889
3890 As of GCC 4.0, GCC uses the UNIX 95 namespace for HP-UX 10.10
3891 through 11.00, and the UNIX 98 namespace for HP-UX 11.11 and later.
3892 This namespace change might cause problems when bootstrapping with
3893 an earlier version of GCC or the HP compiler as essentially the same
3894 namespace is required for an entire build. This problem can be avoided
3895 in a number of ways. With HP cc, @env{UNIX_STD} can be set to @samp{95}
3896 or @samp{98}. Another way is to add an appropriate set of predefines
3897 to @env{CC}. The description for the @option{munix=} option contains
3898 a list of the predefines used with each standard.
3899
3900 More specific information to @samp{hppa*-hp-hpux*} targets follows.
3901
3902 @html
3903 <hr />
3904 @end html
3905 @anchor{hppa-hp-hpux10}
3906 @heading hppa*-hp-hpux10
3907 For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
3908 @code{PHCO_19798} from HP@.
3909
3910 The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces are
3911 used for one-only code and data. This resolves many of the previous
3912 problems in using C++ on this target. However, the ABI is not compatible
3913 with the one implemented under HP-UX 11 using secondary definitions.
3914
3915 @html
3916 <hr />
3917 @end html
3918 @anchor{hppa-hp-hpux11}
3919 @heading hppa*-hp-hpux11
3920 GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot
3921 be used to compile GCC 3.0 and up.
3922
3923 The libffi library haven't been ported to 64-bit HP-UX@ and doesn't build.
3924
3925 Refer to @uref{binaries.html,,binaries} for information about obtaining
3926 precompiled GCC binaries for HP-UX@. Precompiled binaries must be obtained
3927 to build the Ada language as it cannot be bootstrapped using C@. Ada is
3928 only available for the 32-bit PA-RISC runtime.
3929
3930 Starting with GCC 3.4 an ISO C compiler is required to bootstrap. The
3931 bundled compiler supports only traditional C; you will need either HP's
3932 unbundled compiler, or a binary distribution of GCC@.
3933
3934 It is possible to build GCC 3.3 starting with the bundled HP compiler,
3935 but the process requires several steps. GCC 3.3 can then be used to
3936 build later versions.
3937
3938 There are several possible approaches to building the distribution.
3939 Binutils can be built first using the HP tools. Then, the GCC
3940 distribution can be built. The second approach is to build GCC
3941 first using the HP tools, then build binutils, then rebuild GCC@.
3942 There have been problems with various binary distributions, so it
3943 is best not to start from a binary distribution.
3944
3945 On 64-bit capable systems, there are two distinct targets. Different
3946 installation prefixes must be used if both are to be installed on
3947 the same system. The @samp{hppa[1-2]*-hp-hpux11*} target generates code
3948 for the 32-bit PA-RISC runtime architecture and uses the HP linker.
3949 The @samp{hppa64-hp-hpux11*} target generates 64-bit code for the
3950 PA-RISC 2.0 architecture.
3951
3952 The script config.guess now selects the target type based on the compiler
3953 detected during configuration. You must define @env{PATH} or @env{CC} so
3954 that configure finds an appropriate compiler for the initial bootstrap.
3955 When @env{CC} is used, the definition should contain the options that are
3956 needed whenever @env{CC} is used.
3957
3958 Specifically, options that determine the runtime architecture must be
3959 in @env{CC} to correctly select the target for the build. It is also
3960 convenient to place many other compiler options in @env{CC}. For example,
3961 @env{CC="cc -Ac +DA2.0W -Wp,-H16376 -D_CLASSIC_TYPES -D_HPUX_SOURCE"}
3962 can be used to bootstrap the GCC 3.3 branch with the HP compiler in
3963 64-bit K&R/bundled mode. The @option{+DA2.0W} option will result in
3964 the automatic selection of the @samp{hppa64-hp-hpux11*} target. The
3965 macro definition table of cpp needs to be increased for a successful
3966 build with the HP compiler. _CLASSIC_TYPES and _HPUX_SOURCE need to
3967 be defined when building with the bundled compiler, or when using the
3968 @option{-Ac} option. These defines aren't necessary with @option{-Ae}.
3969
3970 It is best to explicitly configure the @samp{hppa64-hp-hpux11*} target
3971 with the @option{--with-ld=@dots{}} option. This overrides the standard
3972 search for ld. The two linkers supported on this target require different
3973 commands. The default linker is determined during configuration. As a
3974 result, it's not possible to switch linkers in the middle of a GCC build.
3975 This has been reported to sometimes occur in unified builds of binutils
3976 and GCC@.
3977
3978 A recent linker patch must be installed for the correct operation of
3979 GCC 3.3 and later. @code{PHSS_26559} and @code{PHSS_24304} are the
3980 oldest linker patches that are known to work. They are for HP-UX
3981 11.00 and 11.11, respectively. @code{PHSS_24303}, the companion to
3982 @code{PHSS_24304}, might be usable but it hasn't been tested. These
3983 patches have been superseded. Consult the HP patch database to obtain
3984 the currently recommended linker patch for your system.
3985
3986 The patches are necessary for the support of weak symbols on the
3987 32-bit port, and for the running of initializers and finalizers. Weak
3988 symbols are implemented using SOM secondary definition symbols. Prior
3989 to HP-UX 11, there are bugs in the linker support for secondary symbols.
3990 The patches correct a problem of linker core dumps creating shared
3991 libraries containing secondary symbols, as well as various other
3992 linking issues involving secondary symbols.
3993
3994 GCC 3.3 uses the ELF DT_INIT_ARRAY and DT_FINI_ARRAY capabilities to
3995 run initializers and finalizers on the 64-bit port. The 32-bit port
3996 uses the linker @option{+init} and @option{+fini} options for the same
3997 purpose. The patches correct various problems with the +init/+fini
3998 options, including program core dumps. Binutils 2.14 corrects a
3999 problem on the 64-bit port resulting from HP's non-standard use of
4000 the .init and .fini sections for array initializers and finalizers.
4001
4002 Although the HP and GNU linkers are both supported for the
4003 @samp{hppa64-hp-hpux11*} target, it is strongly recommended that the
4004 HP linker be used for link editing on this target.
4005
4006 At this time, the GNU linker does not support the creation of long
4007 branch stubs. As a result, it cannot successfully link binaries
4008 containing branch offsets larger than 8 megabytes. In addition,
4009 there are problems linking shared libraries, linking executables
4010 with @option{-static}, and with dwarf2 unwind and exception support.
4011 It also doesn't provide stubs for internal calls to global functions
4012 in shared libraries, so these calls cannot be overloaded.
4013
4014 The HP dynamic loader does not support GNU symbol versioning, so symbol
4015 versioning is not supported. It may be necessary to disable symbol
4016 versioning with @option{--disable-symvers} when using GNU ld.
4017
4018 POSIX threads are the default. The optional DCE thread library is not
4019 supported, so @option{--enable-threads=dce} does not work.
4020
4021 @html
4022 <hr />
4023 @end html
4024 @anchor{x-x-linux-gnu}
4025 @heading *-*-linux-gnu
4026 Versions of libstdc++-v3 starting with 3.2.1 require bug fixes present
4027 in glibc 2.2.5 and later. More information is available in the
4028 libstdc++-v3 documentation.
4029
4030 @html
4031 <hr />
4032 @end html
4033 @anchor{ix86-x-linux}
4034 @heading i?86-*-linux*
4035 As of GCC 3.3, binutils 2.13.1 or later is required for this platform.
4036 See @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information.
4037
4038 If you receive Signal 11 errors when building on GNU/Linux, then it is
4039 possible you have a hardware problem. Further information on this can be
4040 found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
4041
4042 @html
4043 <hr />
4044 @end html
4045 @anchor{ix86-x-solaris2}
4046 @heading i?86-*-solaris2*
4047 Use this for Solaris 11.3 or later on x86 and x86-64 systems. Starting
4048 with GCC 4.7, there is also a 64-bit @samp{amd64-*-solaris2*} or
4049 @samp{x86_64-*-solaris2*} configuration that corresponds to
4050 @samp{sparcv9-sun-solaris2*}.
4051
4052 It is recommended that you configure GCC to use the GNU assembler. The
4053 versions included in Solaris 11.3, from GNU binutils 2.23.1 or
4054 newer (available as @file{/usr/bin/gas} and
4055 @file{/usr/gnu/bin/as}), work fine. The current version, from GNU
4056 binutils 2.34, is known to work. Recent versions of the Solaris assembler in
4057 @file{/usr/bin/as} work almost as well, though.
4058
4059 For linking, the Solaris linker is preferred. If you want to use the GNU
4060 linker instead, the version in Solaris 11.3, from GNU binutils 2.23.1 or
4061 newer (in @file{/usr/gnu/bin/ld} and @file{/usr/bin/gld}), works,
4062 as does the latest version, from GNU binutils 2.34.
4063
4064 To use GNU @command{as}, configure with the options
4065 @option{--with-gnu-as --with-as=@//usr/@/gnu/@/bin/@/as}. It may be necessary
4066 to configure with @option{--without-gnu-ld --with-ld=@//usr/@/ccs/@/bin/@/ld} to
4067 guarantee use of Solaris @command{ld}.
4068 @c FIXME: why --without-gnu-ld --with-ld?
4069
4070 @html
4071 <hr />
4072 @end html
4073 @anchor{ia64-x-linux}
4074 @heading ia64-*-linux
4075 IA-64 processor (also known as IPF, or Itanium Processor Family)
4076 running GNU/Linux.
4077
4078 If you are using the installed system libunwind library with
4079 @option{--with-system-libunwind}, then you must use libunwind 0.98 or
4080 later.
4081
4082 None of the following versions of GCC has an ABI that is compatible
4083 with any of the other versions in this list, with the exception that
4084 Red Hat 2.96 and Trillian 000171 are compatible with each other:
4085 3.1, 3.0.2, 3.0.1, 3.0, Red Hat 2.96, and Trillian 000717.
4086 This primarily affects C++ programs and programs that create shared libraries.
4087 GCC 3.1 or later is recommended for compiling linux, the kernel.
4088 As of version 3.1 GCC is believed to be fully ABI compliant, and hence no
4089 more major ABI changes are expected.
4090
4091 @html
4092 <hr />
4093 @end html
4094 @anchor{ia64-x-hpux}
4095 @heading ia64-*-hpux*
4096 Building GCC on this target requires the GNU Assembler. The bundled HP
4097 assembler will not work. To prevent GCC from using the wrong assembler,
4098 the option @option{--with-gnu-as} may be necessary.
4099
4100 The GCC libunwind library has not been ported to HPUX@. This means that for
4101 GCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions}
4102 is required to build GCC@. For GCC 3.3 and later, this is the default.
4103 For gcc 3.4.3 and later, @option{--enable-libunwind-exceptions} is
4104 removed and the system libunwind library will always be used.
4105
4106 @html
4107 <hr />
4108 <!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
4109 @end html
4110 @anchor{x-ibm-aix}
4111 @heading *-ibm-aix*
4112 Support for AIX version 3 and older was discontinued in GCC 3.4.
4113 Support for AIX version 4.2 and older was discontinued in GCC 4.5.
4114
4115 ``out of memory'' bootstrap failures may indicate a problem with
4116 process resource limits (ulimit). Hard limits are configured in the
4117 @file{/etc/security/limits} system configuration file.
4118
4119 GCC 4.9 and above require a C++ compiler for bootstrap. IBM VAC++ / xlC
4120 cannot bootstrap GCC. xlc can bootstrap an older version of GCC and
4121 G++ can bootstrap recent releases of GCC.
4122
4123 GCC can bootstrap with recent versions of IBM XLC, but bootstrapping
4124 with an earlier release of GCC is recommended. Bootstrapping with XLC
4125 requires a larger data segment, which can be enabled through the
4126 @var{LDR_CNTRL} environment variable, e.g.,
4127
4128 @smallexample
4129 % LDR_CNTRL=MAXDATA=0x50000000
4130 % export LDR_CNTRL
4131 @end smallexample
4132
4133 One can start with a pre-compiled version of GCC to build from
4134 sources. One may delete GCC's ``fixed'' header files when starting
4135 with a version of GCC built for an earlier release of AIX.
4136
4137 To speed up the configuration phases of bootstrapping and installing GCC,
4138 one may use GNU Bash instead of AIX @command{/bin/sh}, e.g.,
4139
4140 @smallexample
4141 % CONFIG_SHELL=/opt/freeware/bin/bash
4142 % export CONFIG_SHELL
4143 @end smallexample
4144
4145 and then proceed as described in @uref{build.html,,the build
4146 instructions}, where we strongly recommend specifying an absolute path
4147 to invoke @var{srcdir}/configure.
4148
4149 Because GCC on AIX is built as a 32-bit executable by default,
4150 (although it can generate 64-bit programs) the GMP and MPFR libraries
4151 required by gfortran must be 32-bit libraries. Building GMP and MPFR
4152 as static archive libraries works better than shared libraries.
4153
4154 Errors involving @code{alloca} when building GCC generally are due
4155 to an incorrect definition of @code{CC} in the Makefile or mixing files
4156 compiled with the native C compiler and GCC@. During the stage1 phase of
4157 the build, the native AIX compiler @strong{must} be invoked as @command{cc}
4158 (not @command{xlc}). Once @command{configure} has been informed of
4159 @command{xlc}, one needs to use @samp{make distclean} to remove the
4160 configure cache files and ensure that @env{CC} environment variable
4161 does not provide a definition that will confuse @command{configure}.
4162 If this error occurs during stage2 or later, then the problem most likely
4163 is the version of Make (see above).
4164
4165 The native @command{as} and @command{ld} are recommended for
4166 bootstrapping on AIX@. The GNU Assembler, GNU Linker, and GNU
4167 Binutils version 2.20 is the minimum level that supports bootstrap on
4168 AIX 5@. The GNU Assembler has not been updated to support AIX 6@ or
4169 AIX 7. The native AIX tools do interoperate with GCC@.
4170
4171 AIX 7.1 added partial support for DWARF debugging, but full support
4172 requires AIX 7.1 TL03 SP7 that supports additional DWARF sections and
4173 fixes a bug in the assembler. AIX 7.1 TL03 SP5 distributed a version
4174 of libm.a missing important symbols; a fix for IV77796 will be
4175 included in SP6.
4176
4177 AIX 5.3 TL10, AIX 6.1 TL05 and AIX 7.1 TL00 introduced an AIX
4178 assembler change that sometimes produces corrupt assembly files
4179 causing AIX linker errors. The bug breaks GCC bootstrap on AIX and
4180 can cause compilation failures with existing GCC installations. An
4181 AIX iFix for AIX 5.3 is available (APAR IZ98385 for AIX 5.3 TL10, APAR
4182 IZ98477 for AIX 5.3 TL11 and IZ98134 for AIX 5.3 TL12). AIX 5.3 TL11 SP8,
4183 AIX 5.3 TL12 SP5, AIX 6.1 TL04 SP11, AIX 6.1 TL05 SP7, AIX 6.1 TL06 SP6,
4184 AIX 6.1 TL07 and AIX 7.1 TL01 should include the fix.
4185
4186 Building @file{libstdc++.a} requires a fix for an AIX Assembler bug
4187 APAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1). It also requires a
4188 fix for another AIX Assembler bug and a co-dependent AIX Archiver fix
4189 referenced as APAR IY53606 (AIX 5.2) or as APAR IY54774 (AIX 5.1)
4190
4191 @anchor{TransferAixShobj}
4192 @samp{libstdc++} in GCC 3.4 increments the major version number of the
4193 shared object and GCC installation places the @file{libstdc++.a}
4194 shared library in a common location which will overwrite the and GCC
4195 3.3 version of the shared library. Applications either need to be
4196 re-linked against the new shared library or the GCC 3.1 and GCC 3.3
4197 versions of the @samp{libstdc++} shared object needs to be available
4198 to the AIX runtime loader. The GCC 3.1 @samp{libstdc++.so.4}, if
4199 present, and GCC 3.3 @samp{libstdc++.so.5} shared objects can be
4200 installed for runtime dynamic loading using the following steps to set
4201 the @samp{F_LOADONLY} flag in the shared object for @emph{each}
4202 multilib @file{libstdc++.a} installed:
4203
4204 Extract the shared objects from the currently installed
4205 @file{libstdc++.a} archive:
4206 @smallexample
4207 % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
4208 @end smallexample
4209
4210 Enable the @samp{F_LOADONLY} flag so that the shared object will be
4211 available for runtime dynamic loading, but not linking:
4212 @smallexample
4213 % strip -e libstdc++.so.4 libstdc++.so.5
4214 @end smallexample
4215
4216 Archive the runtime-only shared object in the GCC 3.4
4217 @file{libstdc++.a} archive:
4218 @smallexample
4219 % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
4220 @end smallexample
4221
4222 Eventually, the
4223 @uref{./configure.html#WithAixSoname,,@option{--with-aix-soname=svr4}}
4224 configure option may drop the need for this procedure for libraries that
4225 support it.
4226
4227 Linking executables and shared libraries may produce warnings of
4228 duplicate symbols. The assembly files generated by GCC for AIX always
4229 have included multiple symbol definitions for certain global variable
4230 and function declarations in the original program. The warnings should
4231 not prevent the linker from producing a correct library or runnable
4232 executable.
4233
4234 AIX 4.3 utilizes a ``large format'' archive to support both 32-bit and
4235 64-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
4236 to parse archive libraries did not handle the new format correctly.
4237 These routines are used by GCC and result in error messages during
4238 linking such as ``not a COFF file''. The version of the routines shipped
4239 with AIX 4.3.1 should work for a 32-bit environment. The @option{-g}
4240 option of the archive command may be used to create archives of 32-bit
4241 objects using the original ``small format''. A correct version of the
4242 routines is shipped with AIX 4.3.2 and above.
4243
4244 Some versions of the AIX binder (linker) can fail with a relocation
4245 overflow severe error when the @option{-bbigtoc} option is used to link
4246 GCC-produced object files into an executable that overflows the TOC@. A fix
4247 for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
4248 available from IBM Customer Support and from its
4249 @uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
4250 website as PTF U455193.
4251
4252 The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
4253 with a segmentation fault when invoked by any version of GCC@. A fix for
4254 APAR IX87327 is available from IBM Customer Support and from its
4255 @uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
4256 website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above.
4257
4258 The initial assembler shipped with AIX 4.3.0 generates incorrect object
4259 files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
4260 TO ASSEMBLE/BIND) is available from IBM Customer Support and from its
4261 @uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
4262 website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above.
4263
4264 AIX provides National Language Support (NLS)@. Compilers and assemblers
4265 use NLS to support locale-specific representations of various data
4266 formats including floating-point numbers (e.g., @samp{.} vs @samp{,} for
4267 separating decimal fractions). There have been problems reported where
4268 GCC does not produce the same floating-point formats that the assembler
4269 expects. If one encounters this problem, set the @env{LANG}
4270 environment variable to @samp{C} or @samp{En_US}.
4271
4272 A default can be specified with the @option{-mcpu=@var{cpu_type}}
4273 switch and using the configure option @option{--with-cpu-@var{cpu_type}}.
4274
4275 @html
4276 <hr />
4277 @end html
4278 @anchor{iq2000-x-elf}
4279 @heading iq2000-*-elf
4280 Vitesse IQ2000 processors. These are used in embedded
4281 applications. There are no standard Unix configurations.
4282
4283 @html
4284 <hr />
4285 @end html
4286 @anchor{lm32-x-elf}
4287 @heading lm32-*-elf
4288 Lattice Mico32 processor.
4289 This configuration is intended for embedded systems.
4290
4291 @html
4292 <hr />
4293 @end html
4294 @anchor{lm32-x-uclinux}
4295 @heading lm32-*-uclinux
4296 Lattice Mico32 processor.
4297 This configuration is intended for embedded systems running uClinux.
4298
4299 @html
4300 <hr />
4301 @end html
4302 @anchor{m32c-x-elf}
4303 @heading m32c-*-elf
4304 Renesas M32C processor.
4305 This configuration is intended for embedded systems.
4306
4307 @html
4308 <hr />
4309 @end html
4310 @anchor{m32r-x-elf}
4311 @heading m32r-*-elf
4312 Renesas M32R processor.
4313 This configuration is intended for embedded systems.
4314
4315 @html
4316 <hr />
4317 @end html
4318 @anchor{m68k-x-x}
4319 @heading m68k-*-*
4320 By default,
4321 @samp{m68k-*-elf*}, @samp{m68k-*-rtems}, @samp{m68k-*-uclinux} and
4322 @samp{m68k-*-linux}
4323 build libraries for both M680x0 and ColdFire processors. If you only
4324 need the M680x0 libraries, you can omit the ColdFire ones by passing
4325 @option{--with-arch=m68k} to @command{configure}. Alternatively, you
4326 can omit the M680x0 libraries by passing @option{--with-arch=cf} to
4327 @command{configure}. These targets default to 5206 or 5475 code as
4328 appropriate for the target system when
4329 configured with @option{--with-arch=cf} and 68020 code otherwise.
4330
4331 The @samp{m68k-*-netbsd} and
4332 @samp{m68k-*-openbsd} targets also support the @option{--with-arch}
4333 option. They will generate ColdFire CFV4e code when configured with
4334 @option{--with-arch=cf} and 68020 code otherwise.
4335
4336 You can override the default processors listed above by configuring
4337 with @option{--with-cpu=@var{target}}. This @var{target} can either
4338 be a @option{-mcpu} argument or one of the following values:
4339 @samp{m68000}, @samp{m68010}, @samp{m68020}, @samp{m68030},
4340 @samp{m68040}, @samp{m68060}, @samp{m68020-40} and @samp{m68020-60}.
4341
4342 GCC requires at least binutils version 2.17 on these targets.
4343
4344 @html
4345 <hr />
4346 @end html
4347 @anchor{m68k-x-uclinux}
4348 @heading m68k-*-uclinux
4349 GCC 4.3 changed the uClinux configuration so that it uses the
4350 @samp{m68k-linux-gnu} ABI rather than the @samp{m68k-elf} ABI.
4351 It also added improved support for C++ and flat shared libraries,
4352 both of which were ABI changes.
4353
4354 @html
4355 <hr />
4356 @end html
4357 @anchor{microblaze-x-elf}
4358 @heading microblaze-*-elf
4359 Xilinx MicroBlaze processor.
4360 This configuration is intended for embedded systems.
4361
4362 @html
4363 <hr />
4364 @end html
4365 @anchor{mips-x-x}
4366 @heading mips-*-*
4367 If on a MIPS system you get an error message saying ``does not have gp
4368 sections for all it's [sic] sectons [sic]'', don't worry about it. This
4369 happens whenever you use GAS with the MIPS linker, but there is not
4370 really anything wrong, and it is okay to use the output file. You can
4371 stop such warnings by installing the GNU linker.
4372
4373 It would be nice to extend GAS to produce the gp tables, but they are
4374 optional, and there should not be a warning about their absence.
4375
4376 The libstdc++ atomic locking routines for MIPS targets requires MIPS II
4377 and later. A patch went in just after the GCC 3.3 release to
4378 make @samp{mips*-*-*} use the generic implementation instead. You can also
4379 configure for @samp{mipsel-elf} as a workaround. The
4380 @samp{mips*-*-linux*} target continues to use the MIPS II routines. More
4381 work on this is expected in future releases.
4382
4383 @c If you make --with-llsc the default for another target, please also
4384 @c update the description of the --with-llsc option.
4385
4386 The built-in @code{__sync_*} functions are available on MIPS II and
4387 later systems and others that support the @samp{ll}, @samp{sc} and
4388 @samp{sync} instructions. This can be overridden by passing
4389 @option{--with-llsc} or @option{--without-llsc} when configuring GCC.
4390 Since the Linux kernel emulates these instructions if they are
4391 missing, the default for @samp{mips*-*-linux*} targets is
4392 @option{--with-llsc}. The @option{--with-llsc} and
4393 @option{--without-llsc} configure options may be overridden at compile
4394 time by passing the @option{-mllsc} or @option{-mno-llsc} options to
4395 the compiler.
4396
4397 MIPS systems check for division by zero (unless
4398 @option{-mno-check-zero-division} is passed to the compiler) by
4399 generating either a conditional trap or a break instruction. Using
4400 trap results in smaller code, but is only supported on MIPS II and
4401 later. Also, some versions of the Linux kernel have a bug that
4402 prevents trap from generating the proper signal (@code{SIGFPE}). To enable
4403 the use of break, use the @option{--with-divide=breaks}
4404 @command{configure} option when configuring GCC@. The default is to
4405 use traps on systems that support them.
4406
4407 @html
4408 <hr />
4409 @end html
4410 @anchor{moxie-x-elf}
4411 @heading moxie-*-elf
4412 The moxie processor.
4413
4414 @html
4415 <hr />
4416 @end html
4417 @anchor{msp430-x-elf}
4418 @heading msp430-*-elf*
4419 TI MSP430 processor.
4420 This configuration is intended for embedded systems.
4421
4422 @samp{msp430-*-elf} is the standard configuration with most GCC
4423 features enabled by default.
4424
4425 @samp{msp430-*-elfbare} is tuned for a bare-metal environment, and disables
4426 features related to shared libraries and other functionality not used for
4427 this device. This reduces code and data usage of the GCC libraries, resulting
4428 in a minimal run-time environment by default.
4429
4430 Features disabled by default include:
4431 @itemize
4432 @item transactional memory
4433 @item __cxa_atexit
4434 @end itemize
4435
4436 @html
4437 <hr />
4438 @end html
4439 @anchor{nds32le-x-elf}
4440 @heading nds32le-*-elf
4441 Andes NDS32 target in little endian mode.
4442
4443 @html
4444 <hr />
4445 @end html
4446 @anchor{nds32be-x-elf}
4447 @heading nds32be-*-elf
4448 Andes NDS32 target in big endian mode.
4449
4450 @html
4451 <hr />
4452 @end html
4453 @anchor{nvptx-x-none}
4454 @heading nvptx-*-none
4455 Nvidia PTX target.
4456
4457 Instead of GNU binutils, you will need to install
4458 @uref{https://github.com/MentorEmbedded/nvptx-tools/,,nvptx-tools}.
4459 Tell GCC where to find it:
4460 @option{--with-build-time-tools=[install-nvptx-tools]/nvptx-none/bin}.
4461
4462 You will need newlib 3.0 git revision
4463 cd31fbb2aea25f94d7ecedc9db16dfc87ab0c316 or later. It can be
4464 automatically built together with GCC@. For this, add a symbolic link
4465 to nvptx-newlib's @file{newlib} directory to the directory containing
4466 the GCC sources.
4467
4468 Use the @option{--disable-sjlj-exceptions} and
4469 @option{--enable-newlib-io-long-long} options when configuring.
4470
4471 @html
4472 <hr />
4473 @end html
4474 @anchor{or1k-x-elf}
4475 @heading or1k-*-elf
4476 The OpenRISC 1000 32-bit processor with delay slots.
4477 This configuration is intended for embedded systems.
4478
4479 @html
4480 <hr />
4481 @end html
4482 @anchor{or1k-x-linux}
4483 @heading or1k-*-linux
4484 The OpenRISC 1000 32-bit processor with delay slots.
4485
4486 @html
4487 <hr />
4488 @end html
4489 @anchor{powerpc-x-x}
4490 @heading powerpc-*-*
4491 You can specify a default version for the @option{-mcpu=@var{cpu_type}}
4492 switch by using the configure option @option{--with-cpu-@var{cpu_type}}.
4493
4494 You will need GNU binutils 2.20 or newer.
4495
4496 @html
4497 <hr />
4498 @end html
4499 @anchor{powerpc-x-darwin}
4500 @heading powerpc-*-darwin*
4501 PowerPC running Darwin (Mac OS X kernel).
4502
4503 Pre-installed versions of Mac OS X may not include any developer tools,
4504 meaning that you will not be able to build GCC from source. Tool
4505 binaries are available at
4506 @uref{https://opensource.apple.com}.
4507
4508 This version of GCC requires at least cctools-590.36. The
4509 cctools-590.36 package referenced from
4510 @uref{http://gcc.gnu.org/ml/gcc/2006-03/msg00507.html} will not work
4511 on systems older than 10.3.9 (aka darwin7.9.0).
4512
4513 @html
4514 <hr />
4515 @end html
4516 @anchor{powerpc-x-elf}
4517 @heading powerpc-*-elf
4518 PowerPC system in big endian mode, running System V.4.
4519
4520 @html
4521 <hr />
4522 @end html
4523 @anchor{powerpc-x-linux-gnu}
4524 @heading powerpc*-*-linux-gnu*
4525 PowerPC system in big endian mode running Linux.
4526
4527 @html
4528 <hr />
4529 @end html
4530 @anchor{powerpc-x-netbsd}
4531 @heading powerpc-*-netbsd*
4532 PowerPC system in big endian mode running NetBSD@.
4533
4534 @html
4535 <hr />
4536 @end html
4537 @anchor{powerpc-x-eabisim}
4538 @heading powerpc-*-eabisim
4539 Embedded PowerPC system in big endian mode for use in running under the
4540 PSIM simulator.
4541
4542 @html
4543 <hr />
4544 @end html
4545 @anchor{powerpc-x-eabi}
4546 @heading powerpc-*-eabi
4547 Embedded PowerPC system in big endian mode.
4548
4549 @html
4550 <hr />
4551 @end html
4552 @anchor{powerpcle-x-elf}
4553 @heading powerpcle-*-elf
4554 PowerPC system in little endian mode, running System V.4.
4555
4556 @html
4557 <hr />
4558 @end html
4559 @anchor{powerpcle-x-eabisim}
4560 @heading powerpcle-*-eabisim
4561 Embedded PowerPC system in little endian mode for use in running under
4562 the PSIM simulator.
4563
4564 @html
4565 <hr />
4566 @end html
4567 @anchor{powerpcle-x-eabi}
4568 @heading powerpcle-*-eabi
4569 Embedded PowerPC system in little endian mode.
4570
4571 @html
4572 <hr />
4573 @end html
4574 @anchor{rl78-x-elf}
4575 @heading rl78-*-elf
4576 The Renesas RL78 processor.
4577 This configuration is intended for embedded systems.
4578
4579 @html
4580 <hr />
4581 @end html
4582 @anchor{riscv32-x-elf}
4583 @heading riscv32-*-elf
4584 The RISC-V RV32 instruction set.
4585 This configuration is intended for embedded systems.
4586 This (and all other RISC-V) targets require the binutils 2.30 release.
4587
4588 @html
4589 <hr />
4590 @end html
4591 @anchor{riscv32-x-linux}
4592 @heading riscv32-*-linux
4593 The RISC-V RV32 instruction set running GNU/Linux.
4594 This (and all other RISC-V) targets require the binutils 2.30 release.
4595
4596 @html
4597 <hr />
4598 @end html
4599 @anchor{riscv64-x-elf}
4600 @heading riscv64-*-elf
4601 The RISC-V RV64 instruction set.
4602 This configuration is intended for embedded systems.
4603 This (and all other RISC-V) targets require the binutils 2.30 release.
4604
4605 @html
4606 <hr />
4607 @end html
4608 @anchor{riscv64-x-linux}
4609 @heading riscv64-*-linux
4610 The RISC-V RV64 instruction set running GNU/Linux.
4611 This (and all other RISC-V) targets require the binutils 2.30 release.
4612
4613 @html
4614 <hr />
4615 @end html
4616 @anchor{rx-x-elf}
4617 @heading rx-*-elf
4618 The Renesas RX processor.
4619
4620 @html
4621 <hr />
4622 @end html
4623 @anchor{s390-x-linux}
4624 @heading s390-*-linux*
4625 S/390 system running GNU/Linux for S/390@.
4626
4627 @html
4628 <hr />
4629 @end html
4630 @anchor{s390x-x-linux}
4631 @heading s390x-*-linux*
4632 zSeries system (64-bit) running GNU/Linux for zSeries@.
4633
4634 @html
4635 <hr />
4636 @end html
4637 @anchor{s390x-ibm-tpf}
4638 @heading s390x-ibm-tpf*
4639 zSeries system (64-bit) running TPF@. This platform is
4640 supported as cross-compilation target only.
4641
4642 @html
4643 <hr />
4644 @end html
4645 @c Please use Solaris 2 to refer to all release of Solaris, starting
4646 @c with 2.0 until 2.6, 7, 8, etc. Solaris 1 was a marketing name for
4647 @c SunOS 4 releases which we don't use to avoid confusion. Solaris
4648 @c alone is too unspecific and must be avoided.
4649 @anchor{x-x-solaris2}
4650 @heading *-*-solaris2*
4651 Support for Solaris 10 has been removed in GCC 10. Support for Solaris
4652 9 has been removed in GCC 5. Support for Solaris 8 has been removed in
4653 GCC 4.8. Support for Solaris 7 has been removed in GCC 4.6.
4654
4655 Solaris 11.3 provides GCC 4.5.2, 4.7.3, and 4.8.2 as
4656 @command{/usr/gcc/4.5/bin/gcc} or similar. Newer Solaris versions
4657 provide one or more of GCC 5, 7, and 9. Alternatively,
4658 you can install a pre-built GCC to bootstrap and install GCC. See the
4659 @uref{binaries.html,,binaries page} for details.
4660
4661 The Solaris 2 @command{/bin/sh} will often fail to configure
4662 @samp{libstdc++-v3}. We therefore recommend using the
4663 following initial sequence of commands
4664
4665 @smallexample
4666 % CONFIG_SHELL=/bin/ksh
4667 % export CONFIG_SHELL
4668 @end smallexample
4669
4670 @noindent
4671 and proceed as described in @uref{configure.html,,the configure instructions}.
4672 In addition we strongly recommend specifying an absolute path to invoke
4673 @command{@var{srcdir}/configure}.
4674
4675 In Solaris 11, you need to check for @code{system/header},
4676 @code{system/linker}, and @code{developer/assembler} packages.
4677
4678 Trying to use the linker and other tools in
4679 @file{/usr/ucb} to install GCC has been observed to cause trouble.
4680 For example, the linker may hang indefinitely. The fix is to remove
4681 @file{/usr/ucb} from your @env{PATH}.
4682
4683 The build process works more smoothly with the legacy Solaris tools so, if you
4684 have @file{/usr/xpg4/bin} in your @env{PATH}, we recommend that you place
4685 @file{/usr/bin} before @file{/usr/xpg4/bin} for the duration of the build.
4686
4687 We recommend the use of the Solaris assembler or the GNU assembler, in
4688 conjunction with the Solaris linker. The GNU @command{as}
4689 versions included in Solaris 11.3,
4690 from GNU binutils 2.23.1 or newer (in @file{/usr/bin/gas} and
4691 @file{/usr/gnu/bin/as}), are known to work.
4692 The current version, from GNU binutils 2.34,
4693 is known to work as well. Note that your mileage may vary
4694 if you use a combination of the GNU tools and the Solaris tools: while the
4695 combination GNU @command{as} + Solaris @command{ld} should reasonably work,
4696 the reverse combination Solaris @command{as} + GNU @command{ld} may fail to
4697 build or cause memory corruption at runtime in some cases for C++ programs.
4698 @c FIXME: still?
4699 GNU @command{ld} usually works as well. Again, the current
4700 version (2.34) is known to work, but generally lacks platform specific
4701 features, so better stay with Solaris @command{ld}. To use the LTO linker
4702 plugin (@option{-fuse-linker-plugin}) with GNU @command{ld}, GNU
4703 binutils @emph{must} be configured with @option{--enable-largefile}.
4704
4705 To enable symbol versioning in @samp{libstdc++} with the Solaris linker,
4706 you need to have any version of GNU @command{c++filt}, which is part of
4707 GNU binutils. @samp{libstdc++} symbol versioning will be disabled if no
4708 appropriate version is found. Solaris @command{c++filt} from the Solaris
4709 Studio compilers does @emph{not} work.
4710
4711 The versions of the GNU Multiple Precision Library (GMP), the MPFR
4712 library and the MPC library bundled with Solaris 11.3 and later are
4713 usually recent enough to match GCC's requirements. There are two
4714 caveats:
4715
4716 @itemize @bullet
4717 @item
4718 While the version of the GMP library in Solaris 11.3 works with GCC, you
4719 need to configure with @option{--with-gmp-include=/usr/include/gmp}.
4720
4721 @item
4722 The version of the MPFR libary included in Solaris 11.3 is too old; you
4723 need to provide a more recent one.
4724 @end itemize
4725
4726 @html
4727 <hr />
4728 @end html
4729 @anchor{sparc-x-x}
4730 @heading sparc*-*-*
4731 This section contains general configuration information for all
4732 SPARC-based platforms. In addition to reading this section, please
4733 read all other sections that match your target.
4734
4735 Newer versions of the GNU Multiple Precision Library (GMP), the MPFR
4736 library and the MPC library are known to be miscompiled by earlier
4737 versions of GCC on these platforms. We therefore recommend the use
4738 of the exact versions of these libraries listed as minimal versions
4739 in @uref{prerequisites.html,,the prerequisites}.
4740
4741 @html
4742 <hr />
4743 @end html
4744 @anchor{sparc-sun-solaris2}
4745 @heading sparc-sun-solaris2*
4746 When GCC is configured to use GNU binutils 2.14 or later, the binaries
4747 produced are smaller than the ones produced using Solaris native tools;
4748 this difference is quite significant for binaries containing debugging
4749 information.
4750
4751 Starting with Solaris 7, the operating system is capable of executing
4752 64-bit SPARC V9 binaries. GCC 3.1 and later properly supports
4753 this; the @option{-m64} option enables 64-bit code generation.
4754 However, if all you want is code tuned for the UltraSPARC CPU, you
4755 should try the @option{-mtune=ultrasparc} option instead, which produces
4756 code that, unlike full 64-bit code, can still run on non-UltraSPARC
4757 machines.
4758
4759 When configuring the GNU Multiple Precision Library (GMP), the MPFR
4760 library or the MPC library on a Solaris 7 or later system, the canonical
4761 target triplet must be specified as the @command{build} parameter on the
4762 configure line. This target triplet can be obtained by invoking @command{./config.guess} in the toplevel source directory of GCC (and
4763 not that of GMP or MPFR or MPC). For example on a Solaris 11 system:
4764
4765 @smallexample
4766 % ./configure --build=sparc-sun-solaris2.11 --prefix=xxx
4767 @end smallexample
4768
4769 @html
4770 <hr />
4771 @end html
4772 @anchor{sparc-x-linux}
4773 @heading sparc-*-linux*
4774
4775 @html
4776 <hr />
4777 @end html
4778 @anchor{sparc64-x-solaris2}
4779 @heading sparc64-*-solaris2*
4780 When configuring a 64-bit-default GCC on Solaris/SPARC, you must use a
4781 build compiler that generates 64-bit code, either by default or by
4782 specifying @samp{CC='gcc -m64' CXX='gcc-m64'} to @command{configure}.
4783 Additionally, you @emph{must} pass @option{--build=sparc64-sun-solaris2.11}
4784 or @option{--build=sparcv9-sun-solaris2.11} because @file{config.guess}
4785 misdetects this situation, which can cause build failures.
4786
4787 When configuring the GNU Multiple Precision Library (GMP), the MPFR
4788 library or the MPC library, the canonical target triplet must be specified
4789 as the @command{build} parameter on the configure line. For example
4790 on a Solaris 11 system:
4791
4792 @smallexample
4793 % ./configure --build=sparc64-sun-solaris2.11 --prefix=xxx
4794 @end smallexample
4795
4796 @html
4797 <hr />
4798 @end html
4799 @anchor{sparcv9-x-solaris2}
4800 @heading sparcv9-*-solaris2*
4801 This is a synonym for @samp{sparc64-*-solaris2*}.
4802
4803 @html
4804 <hr />
4805 @end html
4806 @anchor{c6x-x-x}
4807 @heading c6x-*-*
4808 The C6X family of processors. This port requires binutils-2.22 or newer.
4809
4810 @html
4811 <hr />
4812 @end html
4813 @anchor{tilegx-*-linux}
4814 @heading tilegx-*-linux*
4815 The TILE-Gx processor in little endian mode, running GNU/Linux. This
4816 port requires binutils-2.22 or newer.
4817
4818 @html
4819 <hr />
4820 @end html
4821 @anchor{tilegxbe-*-linux}
4822 @heading tilegxbe-*-linux*
4823 The TILE-Gx processor in big endian mode, running GNU/Linux. This
4824 port requires binutils-2.23 or newer.
4825
4826 @html
4827 <hr />
4828 @end html
4829 @anchor{tilepro-*-linux}
4830 @heading tilepro-*-linux*
4831 The TILEPro processor running GNU/Linux. This port requires
4832 binutils-2.22 or newer.
4833
4834 @html
4835 <hr />
4836 @end html
4837 @anchor{visium-x-elf}
4838 @heading visium-*-elf
4839 CDS VISIUMcore processor.
4840 This configuration is intended for embedded systems.
4841
4842 @html
4843 <hr />
4844 @end html
4845 @anchor{x-x-vxworks}
4846 @heading *-*-vxworks*
4847 Support for VxWorks is in flux. At present GCC supports @emph{only} the
4848 very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC@.
4849 We welcome patches for other architectures supported by VxWorks 5.5.
4850 Support for VxWorks AE would also be welcome; we believe this is merely
4851 a matter of writing an appropriate ``configlette'' (see below). We are
4852 not interested in supporting older, a.out or COFF-based, versions of
4853 VxWorks in GCC 3.
4854
4855 VxWorks comes with an older version of GCC installed in
4856 @file{@var{$WIND_BASE}/host}; we recommend you do not overwrite it.
4857 Choose an installation @var{prefix} entirely outside @var{$WIND_BASE}.
4858 Before running @command{configure}, create the directories @file{@var{prefix}}
4859 and @file{@var{prefix}/bin}. Link or copy the appropriate assembler,
4860 linker, etc.@: into @file{@var{prefix}/bin}, and set your @var{PATH} to
4861 include that directory while running both @command{configure} and
4862 @command{make}.
4863
4864 You must give @command{configure} the
4865 @option{--with-headers=@var{$WIND_BASE}/target/h} switch so that it can
4866 find the VxWorks system headers. Since VxWorks is a cross compilation
4867 target only, you must also specify @option{--target=@var{target}}.
4868 @command{configure} will attempt to create the directory
4869 @file{@var{prefix}/@var{target}/sys-include} and copy files into it;
4870 make sure the user running @command{configure} has sufficient privilege
4871 to do so.
4872
4873 GCC's exception handling runtime requires a special ``configlette''
4874 module, @file{contrib/gthr_supp_vxw_5x.c}. Follow the instructions in
4875 that file to add the module to your kernel build. (Future versions of
4876 VxWorks will incorporate this module.)
4877
4878 @html
4879 <hr />
4880 @end html
4881 @anchor{x86-64-x-x}
4882 @heading x86_64-*-*, amd64-*-*
4883 GCC supports the x86-64 architecture implemented by the AMD64 processor
4884 (amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD@.
4885 On GNU/Linux the default is a bi-arch compiler which is able to generate
4886 both 64-bit x86-64 and 32-bit x86 code (via the @option{-m32} switch).
4887
4888 @html
4889 <hr />
4890 @end html
4891 @anchor{x86-64-x-solaris2}
4892 @heading x86_64-*-solaris2*
4893 GCC also supports the x86-64 architecture implemented by the AMD64
4894 processor (@samp{amd64-*-*} is an alias for @samp{x86_64-*-*}) on
4895 Solaris 10 or later. Unlike other systems, without special options a
4896 bi-arch compiler is built which generates 32-bit code by default, but
4897 can generate 64-bit x86-64 code with the @option{-m64} switch. Since
4898 GCC 4.7, there is also a configuration that defaults to 64-bit code, but
4899 can generate 32-bit code with @option{-m32}. To configure and build
4900 this way, you have to provide all support libraries like @file{libgmp}
4901 as 64-bit code, configure with @option{--target=x86_64-pc-solaris2.11}
4902 and @samp{CC=gcc -m64}.
4903
4904 @html
4905 <hr />
4906 @end html
4907 @anchor{xtensa-x-elf}
4908 @heading xtensa*-*-elf
4909 This target is intended for embedded Xtensa systems using the
4910 @samp{newlib} C library. It uses ELF but does not support shared
4911 objects. Designed-defined instructions specified via the
4912 Tensilica Instruction Extension (TIE) language are only supported
4913 through inline assembly.
4914
4915 The Xtensa configuration information must be specified prior to
4916 building GCC@. The @file{include/xtensa-config.h} header
4917 file contains the configuration information. If you created your
4918 own Xtensa configuration with the Xtensa Processor Generator, the
4919 downloaded files include a customized copy of this header file,
4920 which you can use to replace the default header file.
4921
4922 @html
4923 <hr />
4924 @end html
4925 @anchor{xtensa-x-linux}
4926 @heading xtensa*-*-linux*
4927 This target is for Xtensa systems running GNU/Linux. It supports ELF
4928 shared objects and the GNU C library (glibc). It also generates
4929 position-independent code (PIC) regardless of whether the
4930 @option{-fpic} or @option{-fPIC} options are used. In other
4931 respects, this target is the same as the
4932 @uref{#xtensa*-*-elf,,@samp{xtensa*-*-elf}} target.
4933
4934 @html
4935 <hr />
4936 @end html
4937 @anchor{windows}
4938 @heading Microsoft Windows
4939
4940 @subheading Intel 16-bit versions
4941 The 16-bit versions of Microsoft Windows, such as Windows 3.1, are not
4942 supported.
4943
4944 However, the 32-bit port has limited support for Microsoft
4945 Windows 3.11 in the Win32s environment, as a target only. See below.
4946
4947 @subheading Intel 32-bit versions
4948 The 32-bit versions of Windows, including Windows 95, Windows NT, Windows
4949 XP, and Windows Vista, are supported by several different target
4950 platforms. These targets differ in which Windows subsystem they target
4951 and which C libraries are used.
4952
4953 @itemize
4954 @item Cygwin @uref{#x-x-cygwin,,*-*-cygwin}: Cygwin provides a user-space
4955 Linux API emulation layer in the Win32 subsystem.
4956 @item MinGW @uref{#x-x-mingw32,,*-*-mingw32}: MinGW is a native GCC port for
4957 the Win32 subsystem that provides a subset of POSIX.
4958 @item MKS i386-pc-mks: NuTCracker from MKS. See
4959 @uref{https://www.mkssoftware.com} for more information.
4960 @end itemize
4961
4962 @subheading Intel 64-bit versions
4963 GCC contains support for x86-64 using the mingw-w64
4964 runtime library, available from @uref{http://mingw-w64.org/doku.php}.
4965 This library should be used with the target triple x86_64-pc-mingw32.
4966
4967 Presently Windows for Itanium is not supported.
4968
4969 @subheading Windows CE
4970 Windows CE is supported as a target only on Hitachi
4971 SuperH (sh-wince-pe), and MIPS (mips-wince-pe).
4972
4973 @subheading Other Windows Platforms
4974 GCC no longer supports Windows NT on the Alpha or PowerPC.
4975
4976 GCC no longer supports the Windows POSIX subsystem. However, it does
4977 support the Interix subsystem. See above.
4978
4979 Old target names including *-*-winnt and *-*-windowsnt are no longer used.
4980
4981 PW32 (i386-pc-pw32) support was never completed, and the project seems to
4982 be inactive. See @uref{http://pw32.sourceforge.net/} for more information.
4983
4984 UWIN support has been removed due to a lack of maintenance.
4985
4986 @html
4987 <hr />
4988 @end html
4989 @anchor{x-x-cygwin}
4990 @heading *-*-cygwin
4991 Ports of GCC are included with the
4992 @uref{http://www.cygwin.com/,,Cygwin environment}.
4993
4994 GCC will build under Cygwin without modification; it does not build
4995 with Microsoft's C++ compiler and there are no plans to make it do so.
4996
4997 The Cygwin native compiler can be configured to target any 32-bit x86
4998 cpu architecture desired; the default is i686-pc-cygwin. It should be
4999 used with as up-to-date a version of binutils as possible; use either
5000 the latest official GNU binutils release in the Cygwin distribution,
5001 or version 2.20 or above if building your own.
5002
5003 @html
5004 <hr />
5005 @end html
5006 @anchor{x-x-mingw32}
5007 @heading *-*-mingw32
5008 GCC will build with and support only MinGW runtime 3.12 and later.
5009 Earlier versions of headers are incompatible with the new default semantics
5010 of @code{extern inline} in @code{-std=c99} and @code{-std=gnu99} modes.
5011
5012 @html
5013 <hr />
5014 @end html
5015 @anchor{older}
5016 @heading Older systems
5017 GCC contains support files for many older (1980s and early
5018 1990s) Unix variants. For the most part, support for these systems
5019 has not been deliberately removed, but it has not been maintained for
5020 several years and may suffer from bitrot.
5021
5022 Starting with GCC 3.1, each release has a list of ``obsoleted'' systems.
5023 Support for these systems is still present in that release, but
5024 @command{configure} will fail unless the @option{--enable-obsolete}
5025 option is given. Unless a maintainer steps forward, support for these
5026 systems will be removed from the next release of GCC@.
5027
5028 Support for old systems as hosts for GCC can cause problems if the
5029 workarounds for compiler, library and operating system bugs affect the
5030 cleanliness or maintainability of the rest of GCC@. In some cases, to
5031 bring GCC up on such a system, if still possible with current GCC, may
5032 require first installing an old version of GCC which did work on that
5033 system, and using it to compile a more recent GCC, to avoid bugs in the
5034 vendor compiler. Old releases of GCC 1 and GCC 2 are available in the
5035 @file{old-releases} directory on the @uref{../mirrors.html,,GCC mirror
5036 sites}. Header bugs may generally be avoided using
5037 @command{fixincludes}, but bugs or deficiencies in libraries and the
5038 operating system may still cause problems.
5039
5040 Support for older systems as targets for cross-compilation is less
5041 problematic than support for them as hosts for GCC; if an enthusiast
5042 wishes to make such a target work again (including resurrecting any of
5043 the targets that never worked with GCC 2, starting from the last
5044 version before they were removed), patches
5045 @uref{../contribute.html,,following the usual requirements} would be
5046 likely to be accepted, since they should not affect the support for more
5047 modern targets.
5048
5049 For some systems, old versions of GNU binutils may also be useful,
5050 and are available from @file{pub/binutils/old-releases} on
5051 @uref{https://sourceware.org/mirrors.html,,sourceware.org mirror sites}.
5052
5053 Some of the information on specific systems above relates to
5054 such older systems, but much of the information
5055 about GCC on such systems (which may no longer be applicable to
5056 current GCC) is to be found in the GCC texinfo manual.
5057
5058 @html
5059 <hr />
5060 @end html
5061 @anchor{elf}
5062 @heading all ELF targets (SVR4, Solaris 2, etc.)
5063 C++ support is significantly better on ELF targets if you use the
5064 @uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of
5065 inlines, vtables and template instantiations will be discarded
5066 automatically.
5067
5068
5069 @html
5070 <hr />
5071 <p>
5072 @end html
5073 @ifhtml
5074 @uref{./index.html,,Return to the GCC Installation page}
5075 @end ifhtml
5076 @end ifset
5077
5078 @c ***Old documentation******************************************************
5079 @ifset oldhtml
5080 @include install-old.texi
5081 @html
5082 <hr />
5083 <p>
5084 @end html
5085 @ifhtml
5086 @uref{./index.html,,Return to the GCC Installation page}
5087 @end ifhtml
5088 @end ifset
5089
5090 @c ***GFDL********************************************************************
5091 @ifset gfdlhtml
5092 @include fdl.texi
5093 @html
5094 <hr />
5095 <p>
5096 @end html
5097 @ifhtml
5098 @uref{./index.html,,Return to the GCC Installation page}
5099 @end ifhtml
5100 @end ifset
5101
5102 @c ***************************************************************************
5103 @c Part 6 The End of the Document
5104 @ifinfo
5105 @comment node-name, next, previous, up
5106 @node Concept Index, , GNU Free Documentation License, Top
5107 @end ifinfo
5108
5109 @ifinfo
5110 @unnumbered Concept Index
5111
5112 @printindex cp
5113
5114 @contents
5115 @end ifinfo
5116 @bye