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