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