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