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