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