xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/doc/install.texi (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
11debfc3dSmrg\input texinfo.tex    @c -*-texinfo-*-
21debfc3dSmrg@c @ifnothtml
31debfc3dSmrg@c %**start of header
41debfc3dSmrg@setfilename gccinstall.info
51debfc3dSmrg@setchapternewpage odd
61debfc3dSmrg@c %**end of header
71debfc3dSmrg@c @end ifnothtml
81debfc3dSmrg
91debfc3dSmrg@include gcc-common.texi
101debfc3dSmrg
111debfc3dSmrg@c Specify title for specific html page
121debfc3dSmrg@ifset indexhtml
131debfc3dSmrg@settitle Installing GCC
141debfc3dSmrg@end ifset
151debfc3dSmrg@ifset specifichtml
161debfc3dSmrg@settitle Host/Target specific installation notes for GCC
171debfc3dSmrg@end ifset
181debfc3dSmrg@ifset prerequisiteshtml
191debfc3dSmrg@settitle Prerequisites for GCC
201debfc3dSmrg@end ifset
211debfc3dSmrg@ifset downloadhtml
221debfc3dSmrg@settitle Downloading GCC
231debfc3dSmrg@end ifset
241debfc3dSmrg@ifset configurehtml
251debfc3dSmrg@settitle Installing GCC: Configuration
261debfc3dSmrg@end ifset
271debfc3dSmrg@ifset buildhtml
281debfc3dSmrg@settitle Installing GCC: Building
291debfc3dSmrg@end ifset
301debfc3dSmrg@ifset testhtml
311debfc3dSmrg@settitle Installing GCC: Testing
321debfc3dSmrg@end ifset
331debfc3dSmrg@ifset finalinstallhtml
341debfc3dSmrg@settitle Installing GCC: Final installation
351debfc3dSmrg@end ifset
361debfc3dSmrg@ifset binarieshtml
371debfc3dSmrg@settitle Installing GCC: Binaries
381debfc3dSmrg@end ifset
391debfc3dSmrg@ifset oldhtml
401debfc3dSmrg@settitle Installing GCC: Old documentation
411debfc3dSmrg@end ifset
421debfc3dSmrg@ifset gfdlhtml
431debfc3dSmrg@settitle Installing GCC: GNU Free Documentation License
441debfc3dSmrg@end ifset
451debfc3dSmrg
46*8feb0f0bSmrg@c Copyright (C) 1988-2020 Free Software Foundation, Inc.
471debfc3dSmrg@c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
481debfc3dSmrg
491debfc3dSmrg@c IMPORTANT: whenever you modify this file, run `install.texi2html' to
501debfc3dSmrg@c test the generation of HTML documents for the gcc.gnu.org web pages.
511debfc3dSmrg@c
521debfc3dSmrg@c Do not use @footnote{} in this file as it breaks install.texi2html!
531debfc3dSmrg
541debfc3dSmrg@c Include everything if we're not making html
551debfc3dSmrg@ifnothtml
561debfc3dSmrg@set indexhtml
571debfc3dSmrg@set specifichtml
581debfc3dSmrg@set prerequisiteshtml
591debfc3dSmrg@set downloadhtml
601debfc3dSmrg@set configurehtml
611debfc3dSmrg@set buildhtml
621debfc3dSmrg@set testhtml
631debfc3dSmrg@set finalinstallhtml
641debfc3dSmrg@set binarieshtml
651debfc3dSmrg@set oldhtml
661debfc3dSmrg@set gfdlhtml
671debfc3dSmrg@end ifnothtml
681debfc3dSmrg
691debfc3dSmrg@c Part 2 Summary Description and Copyright
701debfc3dSmrg@copying
71*8feb0f0bSmrgCopyright @copyright{} 1988-2020 Free Software Foundation, Inc.
721debfc3dSmrg@sp 1
731debfc3dSmrgPermission is granted to copy, distribute and/or modify this document
741debfc3dSmrgunder the terms of the GNU Free Documentation License, Version 1.3 or
751debfc3dSmrgany later version published by the Free Software Foundation; with no
761debfc3dSmrgInvariant Sections, the Front-Cover texts being (a) (see below), and
771debfc3dSmrgwith the Back-Cover Texts being (b) (see below).  A copy of the
781debfc3dSmrglicense is included in the section entitled ``@uref{./gfdl.html,,GNU
791debfc3dSmrgFree Documentation License}''.
801debfc3dSmrg
811debfc3dSmrg(a) The FSF's Front-Cover Text is:
821debfc3dSmrg
831debfc3dSmrg     A GNU Manual
841debfc3dSmrg
851debfc3dSmrg(b) The FSF's Back-Cover Text is:
861debfc3dSmrg
871debfc3dSmrg     You have freedom to copy and modify this GNU Manual, like GNU
881debfc3dSmrg     software.  Copies published by the Free Software Foundation raise
891debfc3dSmrg     funds for GNU development.
901debfc3dSmrg@end copying
911debfc3dSmrg@ifinfo
921debfc3dSmrg@insertcopying
931debfc3dSmrg@end ifinfo
941debfc3dSmrg@dircategory Software development
951debfc3dSmrg@direntry
961debfc3dSmrg* gccinstall: (gccinstall).    Installing the GNU Compiler Collection.
971debfc3dSmrg@end direntry
981debfc3dSmrg
991debfc3dSmrg@c Part 3 Titlepage and Copyright
1001debfc3dSmrg@titlepage
1011debfc3dSmrg@title Installing GCC
1021debfc3dSmrg@versionsubtitle
1031debfc3dSmrg
1041debfc3dSmrg@c The following two commands start the copyright page.
1051debfc3dSmrg@page
1061debfc3dSmrg@vskip 0pt plus 1filll
1071debfc3dSmrg@insertcopying
1081debfc3dSmrg@end titlepage
1091debfc3dSmrg
1101debfc3dSmrg@c Part 4 Top node, Master Menu, and/or Table of Contents
1111debfc3dSmrg@ifinfo
1121debfc3dSmrg@node    Top, , , (dir)
1131debfc3dSmrg@comment node-name, next,          Previous, up
1141debfc3dSmrg
1151debfc3dSmrg@menu
1161debfc3dSmrg* Installing GCC::  This document describes the generic installation
1171debfc3dSmrg                    procedure for GCC as well as detailing some target
1181debfc3dSmrg                    specific installation instructions.
1191debfc3dSmrg
1201debfc3dSmrg* Specific::        Host/target specific installation notes for GCC.
1211debfc3dSmrg* Binaries::        Where to get pre-compiled binaries.
1221debfc3dSmrg
1231debfc3dSmrg* Old::             Old installation documentation.
1241debfc3dSmrg
1251debfc3dSmrg* GNU Free Documentation License:: How you can copy and share this manual.
1261debfc3dSmrg* Concept Index::   This index has two entries.
1271debfc3dSmrg@end menu
1281debfc3dSmrg@end ifinfo
1291debfc3dSmrg
1301debfc3dSmrg@iftex
1311debfc3dSmrg@contents
1321debfc3dSmrg@end iftex
1331debfc3dSmrg
1341debfc3dSmrg@c Part 5 The Body of the Document
1351debfc3dSmrg@c ***Installing GCC**********************************************************
1361debfc3dSmrg@ifnothtml
1371debfc3dSmrg@comment node-name,     next,          previous, up
1381debfc3dSmrg@node    Installing GCC, Binaries, , Top
1391debfc3dSmrg@end ifnothtml
1401debfc3dSmrg@ifset indexhtml
1411debfc3dSmrg@ifnothtml
1421debfc3dSmrg@chapter Installing GCC
1431debfc3dSmrg@end ifnothtml
1441debfc3dSmrg
1451debfc3dSmrgThe latest version of this document is always available at
1461debfc3dSmrg@uref{http://gcc.gnu.org/install/,,http://gcc.gnu.org/install/}.
1471debfc3dSmrgIt refers to the current development sources, instructions for
1481debfc3dSmrgspecific released versions are included with the sources.
1491debfc3dSmrg
1501debfc3dSmrgThis document describes the generic installation procedure for GCC as well
1511debfc3dSmrgas detailing some target specific installation instructions.
1521debfc3dSmrg
1531debfc3dSmrgGCC includes several components that previously were separate distributions
1541debfc3dSmrgwith their own installation instructions.  This document supersedes all
1551debfc3dSmrgpackage-specific installation instructions.
1561debfc3dSmrg
1571debfc3dSmrg@emph{Before} starting the build/install procedure please check the
1581debfc3dSmrg@ifnothtml
1591debfc3dSmrg@ref{Specific, host/target specific installation notes}.
1601debfc3dSmrg@end ifnothtml
1611debfc3dSmrg@ifhtml
1621debfc3dSmrg@uref{specific.html,,host/target specific installation notes}.
1631debfc3dSmrg@end ifhtml
1641debfc3dSmrgWe recommend you browse the entire generic installation instructions before
1651debfc3dSmrgyou proceed.
1661debfc3dSmrg
1671debfc3dSmrgLists of successful builds for released versions of GCC are
1681debfc3dSmrgavailable at @uref{http://gcc.gnu.org/buildstat.html}.
1691debfc3dSmrgThese lists are updated as new information becomes available.
1701debfc3dSmrg
1711debfc3dSmrgThe installation procedure itself is broken into five steps.
1721debfc3dSmrg
1731debfc3dSmrg@ifinfo
1741debfc3dSmrg@menu
1751debfc3dSmrg* Prerequisites::
1761debfc3dSmrg* Downloading the source::
1771debfc3dSmrg* Configuration::
1781debfc3dSmrg* Building::
1791debfc3dSmrg* Testing:: (optional)
1801debfc3dSmrg* Final install::
1811debfc3dSmrg@end menu
1821debfc3dSmrg@end ifinfo
1831debfc3dSmrg@ifhtml
1841debfc3dSmrg@enumerate
1851debfc3dSmrg@item
1861debfc3dSmrg@uref{prerequisites.html,,Prerequisites}
1871debfc3dSmrg@item
1881debfc3dSmrg@uref{download.html,,Downloading the source}
1891debfc3dSmrg@item
1901debfc3dSmrg@uref{configure.html,,Configuration}
1911debfc3dSmrg@item
1921debfc3dSmrg@uref{build.html,,Building}
1931debfc3dSmrg@item
1941debfc3dSmrg@uref{test.html,,Testing} (optional)
1951debfc3dSmrg@item
1961debfc3dSmrg@uref{finalinstall.html,,Final install}
1971debfc3dSmrg@end enumerate
1981debfc3dSmrg@end ifhtml
1991debfc3dSmrg
2001debfc3dSmrgPlease note that GCC does not support @samp{make uninstall} and probably
2011debfc3dSmrgwon't do so in the near future as this would open a can of worms.  Instead,
2021debfc3dSmrgwe suggest that you install GCC into a directory of its own and simply
2031debfc3dSmrgremove that directory when you do not need that specific version of GCC
2041debfc3dSmrgany longer, and, if shared libraries are installed there as well, no
2051debfc3dSmrgmore binaries exist that use them.
2061debfc3dSmrg
2071debfc3dSmrg@ifhtml
2081debfc3dSmrgThere are also some @uref{old.html,,old installation instructions},
2091debfc3dSmrgwhich are mostly obsolete but still contain some information which has
2101debfc3dSmrgnot yet been merged into the main part of this manual.
2111debfc3dSmrg@end ifhtml
2121debfc3dSmrg
2131debfc3dSmrg@html
2141debfc3dSmrg<hr />
2151debfc3dSmrg<p>
2161debfc3dSmrg@end html
2171debfc3dSmrg@ifhtml
2181debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
2191debfc3dSmrg
2201debfc3dSmrg@insertcopying
2211debfc3dSmrg@end ifhtml
2221debfc3dSmrg@end ifset
2231debfc3dSmrg
2241debfc3dSmrg@c ***Prerequisites**************************************************
2251debfc3dSmrg@ifnothtml
2261debfc3dSmrg@comment node-name,     next,          previous, up
2271debfc3dSmrg@node    Prerequisites, Downloading the source, , Installing GCC
2281debfc3dSmrg@end ifnothtml
2291debfc3dSmrg@ifset prerequisiteshtml
2301debfc3dSmrg@ifnothtml
2311debfc3dSmrg@chapter Prerequisites
2321debfc3dSmrg@end ifnothtml
2331debfc3dSmrg@cindex Prerequisites
2341debfc3dSmrg
2351debfc3dSmrgGCC requires that various tools and packages be available for use in the
2361debfc3dSmrgbuild procedure.  Modifying GCC sources requires additional tools
2371debfc3dSmrgdescribed below.
2381debfc3dSmrg
2391debfc3dSmrg@heading Tools/packages necessary for building GCC
2401debfc3dSmrg@table @asis
2411debfc3dSmrg@item ISO C++98 compiler
2421debfc3dSmrgNecessary to bootstrap GCC, although versions of GCC prior
2431debfc3dSmrgto 4.8 also allow bootstrapping with a ISO C89 compiler and versions
2441debfc3dSmrgof GCC prior to 3.4 also allow bootstrapping with a traditional
2451debfc3dSmrg(K&R) C compiler.
2461debfc3dSmrg
2471debfc3dSmrgTo build all languages in a cross-compiler or other configuration where
2481debfc3dSmrg3-stage bootstrap is not performed, you need to start with an existing
2491debfc3dSmrgGCC binary (version 3.4 or later) because source code for language
2501debfc3dSmrgfrontends other than C might use GCC extensions.
2511debfc3dSmrg
2521debfc3dSmrgNote that to bootstrap GCC with versions of GCC earlier than 3.4, you
2531debfc3dSmrgmay need to use @option{--disable-stage1-checking}, though
2541debfc3dSmrgbootstrapping the compiler with such earlier compilers is strongly
2551debfc3dSmrgdiscouraged.
2561debfc3dSmrg
2571debfc3dSmrg@item C standard library and headers
2581debfc3dSmrg
2591debfc3dSmrgIn order to build GCC, the C standard library and headers must be present
2601debfc3dSmrgfor all target variants for which target libraries will be built (and not
2611debfc3dSmrgonly the variant of the host C++ compiler).
2621debfc3dSmrg
263c0a68be4SmrgThis affects the popular @samp{x86_64-pc-linux-gnu} platform (among
2641debfc3dSmrgother multilib targets), for which 64-bit (@samp{x86_64}) and 32-bit
2651debfc3dSmrg(@samp{i386}) libc headers are usually packaged separately. If you do a
266c0a68be4Smrgbuild of a native compiler on @samp{x86_64-pc-linux-gnu}, make sure you
2671debfc3dSmrgeither have the 32-bit libc developer package properly installed (the exact
2681debfc3dSmrgname of the package depends on your distro) or you must build GCC as a
2691debfc3dSmrg64-bit only compiler by configuring with the option
2701debfc3dSmrg@option{--disable-multilib}.  Otherwise, you may encounter an error such as
2711debfc3dSmrg@samp{fatal error: gnu/stubs-32.h: No such file}
2721debfc3dSmrg
273*8feb0f0bSmrg@item @anchor{GNAT-prerequisite}GNAT
2741debfc3dSmrg
275*8feb0f0bSmrgIn order to build GNAT, the Ada compiler, you need a working GNAT
276*8feb0f0bSmrgcompiler (GCC version 4.7 or later).
277*8feb0f0bSmrg
278*8feb0f0bSmrgThis includes GNAT tools such as @command{gnatmake} and
279*8feb0f0bSmrg@command{gnatlink}, since the Ada front end is written in Ada and
280*8feb0f0bSmrguses some GNAT-specific extensions.
281*8feb0f0bSmrg
282*8feb0f0bSmrgIn order to build a cross compiler, it is strongly recommended to install
283*8feb0f0bSmrgthe new compiler as native first, and then use it to build the cross
284*8feb0f0bSmrgcompiler. Other native compiler versions may work but this is not guaranteed and
285*8feb0f0bSmrgwill typically fail with hard to understand compilation errors during the
286*8feb0f0bSmrgbuild.
287*8feb0f0bSmrg
288*8feb0f0bSmrgSimilarly, it is strongly recommended to use an older version of GNAT to build
289*8feb0f0bSmrgGNAT. More recent versions of GNAT than the version built are not guaranteed
290*8feb0f0bSmrgto work and will often fail during the build with compilation errors.
291*8feb0f0bSmrg
292*8feb0f0bSmrgNote that @command{configure} does not test whether the GNAT installation works
293*8feb0f0bSmrgand has a sufficiently recent version; if too old a GNAT version is
294*8feb0f0bSmrginstalled and @option{--enable-languages=ada} is used, the build will fail.
295*8feb0f0bSmrg
296*8feb0f0bSmrg@env{ADA_INCLUDE_PATH} and @env{ADA_OBJECT_PATH} environment variables
297*8feb0f0bSmrgmust not be set when building the Ada compiler, the Ada tools, or the
298*8feb0f0bSmrgAda runtime libraries. You can check that your build environment is clean
299*8feb0f0bSmrgby verifying that @samp{gnatls -v} lists only one explicit path in each
300*8feb0f0bSmrgsection.
3011debfc3dSmrg
3021debfc3dSmrg@item A ``working'' POSIX compatible shell, or GNU bash
3031debfc3dSmrg
3041debfc3dSmrgNecessary when running @command{configure} because some
3051debfc3dSmrg@command{/bin/sh} shells have bugs and may crash when configuring the
3061debfc3dSmrgtarget libraries.  In other cases, @command{/bin/sh} or @command{ksh}
3071debfc3dSmrghave disastrous corner-case performance problems.  This
3081debfc3dSmrgcan cause target @command{configure} runs to literally take days to
3091debfc3dSmrgcomplete in some cases.
3101debfc3dSmrg
3111debfc3dSmrgSo on some platforms @command{/bin/ksh} is sufficient, on others it
3121debfc3dSmrgisn't.  See the host/target specific instructions for your platform, or
3131debfc3dSmrguse @command{bash} to be sure.  Then set @env{CONFIG_SHELL} in your
3141debfc3dSmrgenvironment to your ``good'' shell prior to running
3151debfc3dSmrg@command{configure}/@command{make}.
3161debfc3dSmrg
3171debfc3dSmrg@command{zsh} is not a fully compliant POSIX shell and will not
3181debfc3dSmrgwork when configuring GCC@.
3191debfc3dSmrg
3201debfc3dSmrg@item A POSIX or SVR4 awk
3211debfc3dSmrg
3221debfc3dSmrgNecessary for creating some of the generated source files for GCC@.
3231debfc3dSmrgIf in doubt, use a recent GNU awk version, as some of the older ones
3241debfc3dSmrgare broken.  GNU awk version 3.1.5 is known to work.
3251debfc3dSmrg
3261debfc3dSmrg@item GNU binutils
3271debfc3dSmrg
3281debfc3dSmrgNecessary in some circumstances, optional in others.  See the
3291debfc3dSmrghost/target specific instructions for your platform for the exact
3301debfc3dSmrgrequirements.
3311debfc3dSmrg
3321debfc3dSmrg@item gzip version 1.2.4 (or later) or
3331debfc3dSmrg@itemx bzip2 version 1.0.2 (or later)
3341debfc3dSmrg
3351debfc3dSmrgNecessary to uncompress GCC @command{tar} files when source code is
336*8feb0f0bSmrgobtained via HTTPS mirror sites.
3371debfc3dSmrg
3381debfc3dSmrg@item GNU make version 3.80 (or later)
3391debfc3dSmrg
3401debfc3dSmrgYou must have GNU make installed to build GCC@.
3411debfc3dSmrg
3421debfc3dSmrg@item GNU tar version 1.14 (or later)
3431debfc3dSmrg
3441debfc3dSmrgNecessary (only on some platforms) to untar the source code.  Many
3451debfc3dSmrgsystems' @command{tar} programs will also work, only try GNU
3461debfc3dSmrg@command{tar} if you have problems.
3471debfc3dSmrg
348a2dc1f3fSmrg@item Perl version between 5.6.1 and 5.6.24
3491debfc3dSmrg
3501debfc3dSmrgNecessary when targeting Darwin, building @samp{libstdc++},
3511debfc3dSmrgand not using @option{--disable-symvers}.
352*8feb0f0bSmrgNecessary when targeting Solaris 2 with Solaris @command{ld} and not using
353*8feb0f0bSmrg@option{--disable-symvers}.
3541debfc3dSmrg
3551debfc3dSmrgNecessary when regenerating @file{Makefile} dependencies in libiberty.
3561debfc3dSmrgNecessary when regenerating @file{libiberty/functions.texi}.
3571debfc3dSmrgNecessary when generating manpages from Texinfo manuals.
358a2dc1f3fSmrgUsed by various scripts to generate some files included in the source
359a2dc1f3fSmrgrepository (mainly Unicode-related and rarely changing) from source
360a2dc1f3fSmrgtables.
361a2dc1f3fSmrg
362a2dc1f3fSmrgUsed by @command{automake}.
3631debfc3dSmrg
3641debfc3dSmrg@end table
3651debfc3dSmrg
3661debfc3dSmrgSeveral support libraries are necessary to build GCC, some are required,
3671debfc3dSmrgothers optional.  While any sufficiently new version of required tools
3681debfc3dSmrgusually work, library requirements are generally stricter.  Newer
3691debfc3dSmrgversions may work in some cases, but it's safer to use the exact
3701debfc3dSmrgversions documented.  We appreciate bug reports about problems with
3711debfc3dSmrgnewer versions, though.  If your OS vendor provides packages for the
3721debfc3dSmrgsupport libraries then using those packages may be the simplest way to
3731debfc3dSmrginstall the libraries.
3741debfc3dSmrg
3751debfc3dSmrg@table @asis
3761debfc3dSmrg@item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
3771debfc3dSmrg
3781debfc3dSmrgNecessary to build GCC@.  If a GMP source distribution is found in a
3791debfc3dSmrgsubdirectory of your GCC sources named @file{gmp}, it will be built
3801debfc3dSmrgtogether with GCC.  Alternatively, if GMP is already installed but it
3811debfc3dSmrgis not in your library search path, you will have to configure with the
3821debfc3dSmrg@option{--with-gmp} configure option.  See also @option{--with-gmp-lib}
3831debfc3dSmrgand @option{--with-gmp-include}.
3841debfc3dSmrgThe in-tree build is only supported with the GMP version that
3851debfc3dSmrgdownload_prerequisites installs.
3861debfc3dSmrg
387*8feb0f0bSmrg@item MPFR Library version 3.1.0 (or later)
3881debfc3dSmrg
3891debfc3dSmrgNecessary to build GCC@.  It can be downloaded from
390c0a68be4Smrg@uref{https://www.mpfr.org}.  If an MPFR source distribution is found
3911debfc3dSmrgin a subdirectory of your GCC sources named @file{mpfr}, it will be
3921debfc3dSmrgbuilt together with GCC.  Alternatively, if MPFR is already installed
3931debfc3dSmrgbut it is not in your default library search path, the
3941debfc3dSmrg@option{--with-mpfr} configure option should be used.  See also
3951debfc3dSmrg@option{--with-mpfr-lib} and @option{--with-mpfr-include}.
3961debfc3dSmrgThe in-tree build is only supported with the MPFR version that
3971debfc3dSmrgdownload_prerequisites installs.
3981debfc3dSmrg
399*8feb0f0bSmrg@item MPC Library version 1.0.1 (or later)
4001debfc3dSmrg
4011debfc3dSmrgNecessary to build GCC@.  It can be downloaded from
402c0a68be4Smrg@uref{http://www.multiprecision.org/mpc/}.  If an MPC source distribution
4031debfc3dSmrgis found in a subdirectory of your GCC sources named @file{mpc}, it
4041debfc3dSmrgwill be built together with GCC.  Alternatively, if MPC is already
4051debfc3dSmrginstalled but it is not in your default library search path, the
4061debfc3dSmrg@option{--with-mpc} configure option should be used.  See also
4071debfc3dSmrg@option{--with-mpc-lib} and @option{--with-mpc-include}.
4081debfc3dSmrgThe in-tree build is only supported with the MPC version that
4091debfc3dSmrgdownload_prerequisites installs.
4101debfc3dSmrg
4111debfc3dSmrg@item isl Library version 0.15 or later.
4121debfc3dSmrg
4131debfc3dSmrgNecessary to build GCC with the Graphite loop optimizations.
414*8feb0f0bSmrgIt can be downloaded from @uref{https://gcc.gnu.org/pub/gcc/infrastructure/}.
4151debfc3dSmrgIf an isl source distribution is found
4161debfc3dSmrgin a subdirectory of your GCC sources named @file{isl}, it will be
4171debfc3dSmrgbuilt together with GCC.  Alternatively, the @option{--with-isl} configure
4181debfc3dSmrgoption should be used if isl is not installed in your default library
4191debfc3dSmrgsearch path.
4201debfc3dSmrg
421*8feb0f0bSmrg@item zstd Library.
422*8feb0f0bSmrg
423*8feb0f0bSmrgNecessary to build GCC with zstd compression used for LTO bytecode.
424*8feb0f0bSmrgThe library is searched in your default library patch search.
425*8feb0f0bSmrgAlternatively, the @option{--with-zstd} configure option should be used.
426*8feb0f0bSmrg
4271debfc3dSmrg@end table
4281debfc3dSmrg
4291debfc3dSmrg@heading Tools/packages necessary for modifying GCC
4301debfc3dSmrg@table @asis
431c0a68be4Smrg@item autoconf version 2.69
4321debfc3dSmrg@itemx GNU m4 version 1.4.6 (or later)
4331debfc3dSmrg
4341debfc3dSmrgNecessary when modifying @file{configure.ac}, @file{aclocal.m4}, etc.@:
4351debfc3dSmrgto regenerate @file{configure} and @file{config.in} files.
4361debfc3dSmrg
437c0a68be4Smrg@item automake version 1.15.1
4381debfc3dSmrg
4391debfc3dSmrgNecessary when modifying a @file{Makefile.am} file to regenerate its
4401debfc3dSmrgassociated @file{Makefile.in}.
4411debfc3dSmrg
4421debfc3dSmrgMuch of GCC does not use automake, so directly edit the @file{Makefile.in}
4431debfc3dSmrgfile.  Specifically this applies to the @file{gcc}, @file{intl},
4441debfc3dSmrg@file{libcpp}, @file{libiberty}, @file{libobjc} directories as well
4451debfc3dSmrgas any of their subdirectories.
4461debfc3dSmrg
4471debfc3dSmrgFor directories that use automake, GCC requires the latest release in
448c0a68be4Smrgthe 1.15 series, which is currently 1.15.1.  When regenerating a directory
449c0a68be4Smrgto a newer version, please update all the directories using an older 1.15
4501debfc3dSmrgto the latest released version.
4511debfc3dSmrg
4521debfc3dSmrg@item gettext version 0.14.5 (or later)
4531debfc3dSmrg
4541debfc3dSmrgNeeded to regenerate @file{gcc.pot}.
4551debfc3dSmrg
4561debfc3dSmrg@item gperf version 2.7.2 (or later)
4571debfc3dSmrg
4581debfc3dSmrgNecessary when modifying @command{gperf} input files, e.g.@:
4591debfc3dSmrg@file{gcc/cp/cfns.gperf} to regenerate its associated header file, e.g.@:
4601debfc3dSmrg@file{gcc/cp/cfns.h}.
4611debfc3dSmrg
4621debfc3dSmrg@item DejaGnu 1.4.4
4631debfc3dSmrg@itemx Expect
4641debfc3dSmrg@itemx Tcl
4651debfc3dSmrg
4661debfc3dSmrgNecessary to run the GCC testsuite; see the section on testing for
467*8feb0f0bSmrgdetails.
4681debfc3dSmrg
4691debfc3dSmrg@item autogen version 5.5.4 (or later) and
4701debfc3dSmrg@itemx guile version 1.4.1 (or later)
4711debfc3dSmrg
4721debfc3dSmrgNecessary to regenerate @file{fixinc/fixincl.x} from
4731debfc3dSmrg@file{fixinc/inclhack.def} and @file{fixinc/*.tpl}.
4741debfc3dSmrg
4751debfc3dSmrgNecessary to run @samp{make check} for @file{fixinc}.
4761debfc3dSmrg
4771debfc3dSmrgNecessary to regenerate the top level @file{Makefile.in} file from
4781debfc3dSmrg@file{Makefile.tpl} and @file{Makefile.def}.
4791debfc3dSmrg
4801debfc3dSmrg@item Flex version 2.5.4 (or later)
4811debfc3dSmrg
4821debfc3dSmrgNecessary when modifying @file{*.l} files.
4831debfc3dSmrg
4841debfc3dSmrgNecessary to build GCC during development because the generated output
485a2dc1f3fSmrgfiles are not included in the version-controlled source repository.
486a2dc1f3fSmrgThey are included in releases.
4871debfc3dSmrg
4881debfc3dSmrg@item Texinfo version 4.7 (or later)
4891debfc3dSmrg
4901debfc3dSmrgNecessary for running @command{makeinfo} when modifying @file{*.texi}
4911debfc3dSmrgfiles to test your changes.
4921debfc3dSmrg
4931debfc3dSmrgNecessary for running @command{make dvi} or @command{make pdf} to
4941debfc3dSmrgcreate printable documentation in DVI or PDF format.  Texinfo version
4951debfc3dSmrg4.8 or later is required for @command{make pdf}.
4961debfc3dSmrg
4971debfc3dSmrgNecessary to build GCC documentation during development because the
498a2dc1f3fSmrggenerated output files are not included in the repository.  They are
4991debfc3dSmrgincluded in releases.
5001debfc3dSmrg
5011debfc3dSmrg@item @TeX{} (any working version)
5021debfc3dSmrg
5031debfc3dSmrgNecessary for running @command{texi2dvi} and @command{texi2pdf}, which
5041debfc3dSmrgare used when running @command{make dvi} or @command{make pdf} to create
5051debfc3dSmrgDVI or PDF files, respectively.
5061debfc3dSmrg
5071debfc3dSmrg@item Sphinx version 1.0 (or later)
5081debfc3dSmrg
5091debfc3dSmrgNecessary to regenerate @file{jit/docs/_build/texinfo} from the @file{.rst}
5101debfc3dSmrgfiles in the directories below @file{jit/docs}.
5111debfc3dSmrg
512a2dc1f3fSmrg@item git (any version)
5131debfc3dSmrg@itemx SSH (any version)
5141debfc3dSmrg
515a2dc1f3fSmrgNecessary to access the source repository.  Public releases and weekly
516a2dc1f3fSmrgsnapshots of the development sources are also available via HTTPS@.
5171debfc3dSmrg
5181debfc3dSmrg@item GNU diffutils version 2.7 (or later)
5191debfc3dSmrg
5201debfc3dSmrgUseful when submitting patches for the GCC source code.
5211debfc3dSmrg
5221debfc3dSmrg@item patch version 2.5.4 (or later)
5231debfc3dSmrg
5241debfc3dSmrgNecessary when applying patches, created with @command{diff}, to one's
5251debfc3dSmrgown sources.
5261debfc3dSmrg
5271debfc3dSmrg@end table
5281debfc3dSmrg
5291debfc3dSmrg@html
5301debfc3dSmrg<hr />
5311debfc3dSmrg<p>
5321debfc3dSmrg@end html
5331debfc3dSmrg@ifhtml
5341debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
5351debfc3dSmrg@end ifhtml
5361debfc3dSmrg@end ifset
5371debfc3dSmrg
5381debfc3dSmrg@c ***Downloading the source**************************************************
5391debfc3dSmrg@ifnothtml
5401debfc3dSmrg@comment node-name,     next,          previous, up
5411debfc3dSmrg@node    Downloading the source, Configuration, Prerequisites, Installing GCC
5421debfc3dSmrg@end ifnothtml
5431debfc3dSmrg@ifset downloadhtml
5441debfc3dSmrg@ifnothtml
5451debfc3dSmrg@chapter Downloading GCC
5461debfc3dSmrg@end ifnothtml
5471debfc3dSmrg@cindex Downloading GCC
5481debfc3dSmrg@cindex Downloading the Source
5491debfc3dSmrg
550a2dc1f3fSmrgGCC is distributed via @uref{http://gcc.gnu.org/git.html,,git} and via
551a2dc1f3fSmrgHTTPS as tarballs compressed with @command{gzip} or @command{bzip2}.
5521debfc3dSmrg
5531debfc3dSmrgPlease refer to the @uref{http://gcc.gnu.org/releases.html,,releases web page}
5541debfc3dSmrgfor information on how to obtain GCC@.
5551debfc3dSmrg
5561debfc3dSmrgThe source distribution includes the C, C++, Objective-C, Fortran,
5571debfc3dSmrgand Ada (in the case of GCC 3.1 and later) compilers, as well as
5581debfc3dSmrgruntime libraries for C++, Objective-C, and Fortran.
5591debfc3dSmrgFor previous versions these were downloadable as separate components such
5601debfc3dSmrgas the core GCC distribution, which included the C language front end and
5611debfc3dSmrgshared components, and language-specific distributions including the
5621debfc3dSmrglanguage front end and the language runtime (where appropriate).
5631debfc3dSmrg
5641debfc3dSmrgIf you also intend to build binutils (either to upgrade an existing
5651debfc3dSmrginstallation or for use in place of the corresponding tools of your
5661debfc3dSmrgOS), unpack the binutils distribution either in the same directory or
5671debfc3dSmrga separate one.  In the latter case, add symbolic links to any
5681debfc3dSmrgcomponents of the binutils you intend to build alongside the compiler
5691debfc3dSmrg(@file{bfd}, @file{binutils}, @file{gas}, @file{gprof}, @file{ld},
5701debfc3dSmrg@file{opcodes}, @dots{}) to the directory containing the GCC sources.
5711debfc3dSmrg
5721debfc3dSmrgLikewise the GMP, MPFR and MPC libraries can be automatically built
5731debfc3dSmrgtogether with GCC.  You may simply run the
5741debfc3dSmrg@command{contrib/download_prerequisites} script in the GCC source directory
5751debfc3dSmrgto set up everything.
5761debfc3dSmrgOtherwise unpack the GMP, MPFR and/or MPC source
5771debfc3dSmrgdistributions in the directory containing the GCC sources and rename
5781debfc3dSmrgtheir directories to @file{gmp}, @file{mpfr} and @file{mpc},
5791debfc3dSmrgrespectively (or use symbolic links with the same name).
5801debfc3dSmrg
5811debfc3dSmrg@html
5821debfc3dSmrg<hr />
5831debfc3dSmrg<p>
5841debfc3dSmrg@end html
5851debfc3dSmrg@ifhtml
5861debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
5871debfc3dSmrg@end ifhtml
5881debfc3dSmrg@end ifset
5891debfc3dSmrg
5901debfc3dSmrg@c ***Configuration***********************************************************
5911debfc3dSmrg@ifnothtml
5921debfc3dSmrg@comment node-name,     next,          previous, up
5931debfc3dSmrg@node    Configuration, Building, Downloading the source, Installing GCC
5941debfc3dSmrg@end ifnothtml
5951debfc3dSmrg@ifset configurehtml
5961debfc3dSmrg@ifnothtml
5971debfc3dSmrg@chapter Installing GCC: Configuration
5981debfc3dSmrg@end ifnothtml
5991debfc3dSmrg@cindex Configuration
6001debfc3dSmrg@cindex Installing GCC: Configuration
6011debfc3dSmrg
6021debfc3dSmrgLike most GNU software, GCC must be configured before it can be built.
6031debfc3dSmrgThis document describes the recommended configuration procedure
6041debfc3dSmrgfor both native and cross targets.
6051debfc3dSmrg
6061debfc3dSmrgWe use @var{srcdir} to refer to the toplevel source directory for
6071debfc3dSmrgGCC; we use @var{objdir} to refer to the toplevel build/object directory.
6081debfc3dSmrg
609a2dc1f3fSmrgIf you obtained the sources by cloning the repository, @var{srcdir}
610a2dc1f3fSmrgmust refer to the top @file{gcc} directory, the one where the
611a2dc1f3fSmrg@file{MAINTAINERS} file can be found, and not its @file{gcc}
612a2dc1f3fSmrgsubdirectory, otherwise the build will fail.
6131debfc3dSmrg
6141debfc3dSmrgIf either @var{srcdir} or @var{objdir} is located on an automounted NFS
6151debfc3dSmrgfile system, the shell's built-in @command{pwd} command will return
6161debfc3dSmrgtemporary pathnames.  Using these can lead to various sorts of build
6171debfc3dSmrgproblems.  To avoid this issue, set the @env{PWDCMD} environment
6181debfc3dSmrgvariable to an automounter-aware @command{pwd} command, e.g.,
6191debfc3dSmrg@command{pawd} or @samp{amq -w}, during the configuration and build
6201debfc3dSmrgphases.
6211debfc3dSmrg
6221debfc3dSmrgFirst, we @strong{highly} recommend that GCC be built into a
6231debfc3dSmrgseparate directory from the sources which does @strong{not} reside
6241debfc3dSmrgwithin the source tree.  This is how we generally build GCC; building
6251debfc3dSmrgwhere @var{srcdir} == @var{objdir} should still work, but doesn't
6261debfc3dSmrgget extensive testing; building where @var{objdir} is a subdirectory
6271debfc3dSmrgof @var{srcdir} is unsupported.
6281debfc3dSmrg
6291debfc3dSmrgIf you have previously built GCC in the same directory for a
6301debfc3dSmrgdifferent target machine, do @samp{make distclean} to delete all files
6311debfc3dSmrgthat might be invalid.  One of the files this deletes is @file{Makefile};
6321debfc3dSmrgif @samp{make distclean} complains that @file{Makefile} does not exist
6331debfc3dSmrgor issues a message like ``don't know how to make distclean'' it probably
6341debfc3dSmrgmeans that the directory is already suitably clean.  However, with the
6351debfc3dSmrgrecommended method of building in a separate @var{objdir}, you should
6361debfc3dSmrgsimply use a different @var{objdir} for each target.
6371debfc3dSmrg
6381debfc3dSmrgSecond, when configuring a native system, either @command{cc} or
6391debfc3dSmrg@command{gcc} must be in your path or you must set @env{CC} in
6401debfc3dSmrgyour environment before running configure.  Otherwise the configuration
6411debfc3dSmrgscripts may fail.
6421debfc3dSmrg
6431debfc3dSmrg@ignore
6441debfc3dSmrgNote that the bootstrap compiler and the resulting GCC must be link
6451debfc3dSmrgcompatible, else the bootstrap will fail with linker errors about
6461debfc3dSmrgincompatible object file formats.  Several multilibed targets are
6471debfc3dSmrgaffected by this requirement, see
6481debfc3dSmrg@ifnothtml
6491debfc3dSmrg@ref{Specific, host/target specific installation notes}.
6501debfc3dSmrg@end ifnothtml
6511debfc3dSmrg@ifhtml
6521debfc3dSmrg@uref{specific.html,,host/target specific installation notes}.
6531debfc3dSmrg@end ifhtml
6541debfc3dSmrg@end ignore
6551debfc3dSmrg
6561debfc3dSmrgTo configure GCC:
6571debfc3dSmrg
6581debfc3dSmrg@smallexample
6591debfc3dSmrg% mkdir @var{objdir}
6601debfc3dSmrg% cd @var{objdir}
6611debfc3dSmrg% @var{srcdir}/configure [@var{options}] [@var{target}]
6621debfc3dSmrg@end smallexample
6631debfc3dSmrg
6641debfc3dSmrg@heading Distributor options
6651debfc3dSmrg
6661debfc3dSmrgIf you will be distributing binary versions of GCC, with modifications
6671debfc3dSmrgto the source code, you should use the options described in this
6681debfc3dSmrgsection to make clear that your version contains modifications.
6691debfc3dSmrg
6701debfc3dSmrg@table @code
6711debfc3dSmrg@item --with-pkgversion=@var{version}
6721debfc3dSmrgSpecify a string that identifies your package.  You may wish
6731debfc3dSmrgto include a build number or build date.  This version string will be
6741debfc3dSmrgincluded in the output of @command{gcc --version}.  This suffix does
6751debfc3dSmrgnot replace the default version string, only the @samp{GCC} part.
6761debfc3dSmrg
6771debfc3dSmrgThe default value is @samp{GCC}.
6781debfc3dSmrg
6791debfc3dSmrg@item --with-bugurl=@var{url}
6801debfc3dSmrgSpecify the URL that users should visit if they wish to report a bug.
6811debfc3dSmrgYou are of course welcome to forward bugs reported to you to the FSF,
6821debfc3dSmrgif you determine that they are not bugs in your modifications.
6831debfc3dSmrg
6841debfc3dSmrgThe default value refers to the FSF's GCC bug tracker.
6851debfc3dSmrg
686*8feb0f0bSmrg@item --with-documentation-root-url=@var{url}
687*8feb0f0bSmrgSpecify the URL root that contains GCC option documentation.  The @var{url}
688*8feb0f0bSmrgshould end with a @code{/} character.
689*8feb0f0bSmrg
690*8feb0f0bSmrgThe default value is @uref{https://gcc.gnu.org/onlinedocs/,,https://gcc.gnu.org/onlinedocs/}.
691*8feb0f0bSmrg
692*8feb0f0bSmrg@item --with-changes-root-url=@var{url}
693*8feb0f0bSmrgSpecify the URL root that contains information about changes in GCC
694*8feb0f0bSmrgreleases like @code{gcc-@var{version}/changes.html}.
695*8feb0f0bSmrgThe @var{url} should end with a @code{/} character.
696*8feb0f0bSmrg
697*8feb0f0bSmrgThe default value is @uref{https://gcc.gnu.org/,,https://gcc.gnu.org/}.
698*8feb0f0bSmrg
6991debfc3dSmrg@end table
7001debfc3dSmrg
7011debfc3dSmrg@heading Target specification
7021debfc3dSmrg@itemize @bullet
7031debfc3dSmrg@item
7041debfc3dSmrgGCC has code to correctly determine the correct value for @var{target}
7051debfc3dSmrgfor nearly all native systems.  Therefore, we highly recommend you do
7061debfc3dSmrgnot provide a configure target when configuring a native compiler.
7071debfc3dSmrg
7081debfc3dSmrg@item
7091debfc3dSmrg@var{target} must be specified as @option{--target=@var{target}}
7101debfc3dSmrgwhen configuring a cross compiler; examples of valid targets would be
7111debfc3dSmrgm68k-elf, sh-elf, etc.
7121debfc3dSmrg
7131debfc3dSmrg@item
7141debfc3dSmrgSpecifying just @var{target} instead of @option{--target=@var{target}}
7151debfc3dSmrgimplies that the host defaults to @var{target}.
7161debfc3dSmrg@end itemize
7171debfc3dSmrg
7181debfc3dSmrg
7191debfc3dSmrg@heading Options specification
7201debfc3dSmrg
7211debfc3dSmrgUse @var{options} to override several configure time options for
7221debfc3dSmrgGCC@.  A list of supported @var{options} follows; @samp{configure
7231debfc3dSmrg--help} may list other options, but those not listed below may not
7241debfc3dSmrgwork and should not normally be used.
7251debfc3dSmrg
7261debfc3dSmrgNote that each @option{--enable} option has a corresponding
7271debfc3dSmrg@option{--disable} option and that each @option{--with} option has a
7281debfc3dSmrgcorresponding @option{--without} option.
7291debfc3dSmrg
7301debfc3dSmrg@table @code
7311debfc3dSmrg@item --prefix=@var{dirname}
7321debfc3dSmrgSpecify the toplevel installation
7331debfc3dSmrgdirectory.  This is the recommended way to install the tools into a directory
7341debfc3dSmrgother than the default.  The toplevel installation directory defaults to
7351debfc3dSmrg@file{/usr/local}.
7361debfc3dSmrg
7371debfc3dSmrgWe @strong{highly} recommend against @var{dirname} being the same or a
7381debfc3dSmrgsubdirectory of @var{objdir} or vice versa.  If specifying a directory
7391debfc3dSmrgbeneath a user's home directory tree, some shells will not expand
7401debfc3dSmrg@var{dirname} correctly if it contains the @samp{~} metacharacter; use
7411debfc3dSmrg@env{$HOME} instead.
7421debfc3dSmrg
7431debfc3dSmrgThe following standard @command{autoconf} options are supported.  Normally you
7441debfc3dSmrgshould not need to use these options.
7451debfc3dSmrg@table @code
7461debfc3dSmrg@item --exec-prefix=@var{dirname}
7471debfc3dSmrgSpecify the toplevel installation directory for architecture-dependent
7481debfc3dSmrgfiles.  The default is @file{@var{prefix}}.
7491debfc3dSmrg
7501debfc3dSmrg@item --bindir=@var{dirname}
7511debfc3dSmrgSpecify the installation directory for the executables called by users
7521debfc3dSmrg(such as @command{gcc} and @command{g++}).  The default is
7531debfc3dSmrg@file{@var{exec-prefix}/bin}.
7541debfc3dSmrg
7551debfc3dSmrg@item --libdir=@var{dirname}
7561debfc3dSmrgSpecify the installation directory for object code libraries and
7571debfc3dSmrginternal data files of GCC@.  The default is @file{@var{exec-prefix}/lib}.
7581debfc3dSmrg
7591debfc3dSmrg@item --libexecdir=@var{dirname}
7601debfc3dSmrgSpecify the installation directory for internal executables of GCC@.
7611debfc3dSmrgThe default is @file{@var{exec-prefix}/libexec}.
7621debfc3dSmrg
7631debfc3dSmrg@item --with-slibdir=@var{dirname}
7641debfc3dSmrgSpecify the installation directory for the shared libgcc library.  The
7651debfc3dSmrgdefault is @file{@var{libdir}}.
7661debfc3dSmrg
7671debfc3dSmrg@item --datarootdir=@var{dirname}
7681debfc3dSmrgSpecify the root of the directory tree for read-only architecture-independent
7691debfc3dSmrgdata files referenced by GCC@.  The default is @file{@var{prefix}/share}.
7701debfc3dSmrg
7711debfc3dSmrg@item --infodir=@var{dirname}
7721debfc3dSmrgSpecify the installation directory for documentation in info format.
7731debfc3dSmrgThe default is @file{@var{datarootdir}/info}.
7741debfc3dSmrg
7751debfc3dSmrg@item --datadir=@var{dirname}
7761debfc3dSmrgSpecify the installation directory for some architecture-independent
7771debfc3dSmrgdata files referenced by GCC@.  The default is @file{@var{datarootdir}}.
7781debfc3dSmrg
7791debfc3dSmrg@item --docdir=@var{dirname}
7801debfc3dSmrgSpecify the installation directory for documentation files (other
7811debfc3dSmrgthan Info) for GCC@.  The default is @file{@var{datarootdir}/doc}.
7821debfc3dSmrg
7831debfc3dSmrg@item --htmldir=@var{dirname}
7841debfc3dSmrgSpecify the installation directory for HTML documentation files.
7851debfc3dSmrgThe default is @file{@var{docdir}}.
7861debfc3dSmrg
7871debfc3dSmrg@item --pdfdir=@var{dirname}
7881debfc3dSmrgSpecify the installation directory for PDF documentation files.
7891debfc3dSmrgThe default is @file{@var{docdir}}.
7901debfc3dSmrg
7911debfc3dSmrg@item --mandir=@var{dirname}
7921debfc3dSmrgSpecify the installation directory for manual pages.  The default is
7931debfc3dSmrg@file{@var{datarootdir}/man}.  (Note that the manual pages are only extracts
7941debfc3dSmrgfrom the full GCC manuals, which are provided in Texinfo format.  The manpages
7951debfc3dSmrgare derived by an automatic conversion process from parts of the full
7961debfc3dSmrgmanual.)
7971debfc3dSmrg
7981debfc3dSmrg@item --with-gxx-include-dir=@var{dirname}
7991debfc3dSmrgSpecify
8001debfc3dSmrgthe installation directory for G++ header files.  The default depends
8011debfc3dSmrgon other configuration options, and differs between cross and native
8021debfc3dSmrgconfigurations.
8031debfc3dSmrg
8041debfc3dSmrg@item --with-specs=@var{specs}
8051debfc3dSmrgSpecify additional command line driver SPECS.
8061debfc3dSmrgThis can be useful if you need to turn on a non-standard feature by
8071debfc3dSmrgdefault without modifying the compiler's source code, for instance
8081debfc3dSmrg@option{--with-specs=%@{!fcommon:%@{!fno-common:-fno-common@}@}}.
8091debfc3dSmrg@ifnothtml
8101debfc3dSmrg@xref{Spec Files,, Specifying subprocesses and the switches to pass to them,
8111debfc3dSmrggcc, Using the GNU Compiler Collection (GCC)},
8121debfc3dSmrg@end ifnothtml
8131debfc3dSmrg@ifhtml
8141debfc3dSmrgSee ``Spec Files'' in the main manual
8151debfc3dSmrg@end ifhtml
8161debfc3dSmrg
8171debfc3dSmrg@end table
8181debfc3dSmrg
8191debfc3dSmrg@item --program-prefix=@var{prefix}
8201debfc3dSmrgGCC supports some transformations of the names of its programs when
8211debfc3dSmrginstalling them.  This option prepends @var{prefix} to the names of
8221debfc3dSmrgprograms to install in @var{bindir} (see above).  For example, specifying
8231debfc3dSmrg@option{--program-prefix=foo-} would result in @samp{gcc}
8241debfc3dSmrgbeing installed as @file{/usr/local/bin/foo-gcc}.
8251debfc3dSmrg
8261debfc3dSmrg@item --program-suffix=@var{suffix}
8271debfc3dSmrgAppends @var{suffix} to the names of programs to install in @var{bindir}
8281debfc3dSmrg(see above).  For example, specifying @option{--program-suffix=-3.1}
8291debfc3dSmrgwould result in @samp{gcc} being installed as
8301debfc3dSmrg@file{/usr/local/bin/gcc-3.1}.
8311debfc3dSmrg
8321debfc3dSmrg@item --program-transform-name=@var{pattern}
8331debfc3dSmrgApplies the @samp{sed} script @var{pattern} to be applied to the names
8341debfc3dSmrgof programs to install in @var{bindir} (see above).  @var{pattern} has to
8351debfc3dSmrgconsist of one or more basic @samp{sed} editing commands, separated by
8361debfc3dSmrgsemicolons.  For example, if you want the @samp{gcc} program name to be
8371debfc3dSmrgtransformed to the installed program @file{/usr/local/bin/myowngcc} and
8381debfc3dSmrgthe @samp{g++} program name to be transformed to
8391debfc3dSmrg@file{/usr/local/bin/gspecial++} without changing other program names,
8401debfc3dSmrgyou could use the pattern
8411debfc3dSmrg@option{--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/'}
8421debfc3dSmrgto achieve this effect.
8431debfc3dSmrg
8441debfc3dSmrgAll three options can be combined and used together, resulting in more
8451debfc3dSmrgcomplex conversion patterns.  As a basic rule, @var{prefix} (and
8461debfc3dSmrg@var{suffix}) are prepended (appended) before further transformations
8471debfc3dSmrgcan happen with a special transformation script @var{pattern}.
8481debfc3dSmrg
8491debfc3dSmrgAs currently implemented, this option only takes effect for native
8501debfc3dSmrgbuilds; cross compiler binaries' names are not transformed even when a
8511debfc3dSmrgtransformation is explicitly asked for by one of these options.
8521debfc3dSmrg
8531debfc3dSmrgFor native builds, some of the installed programs are also installed
8541debfc3dSmrgwith the target alias in front of their name, as in
8551debfc3dSmrg@samp{i686-pc-linux-gnu-gcc}.  All of the above transformations happen
8561debfc3dSmrgbefore the target alias is prepended to the name---so, specifying
8571debfc3dSmrg@option{--program-prefix=foo-} and @option{program-suffix=-3.1}, the
8581debfc3dSmrgresulting binary would be installed as
8591debfc3dSmrg@file{/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1}.
8601debfc3dSmrg
8611debfc3dSmrgAs a last shortcoming, none of the installed Ada programs are
8621debfc3dSmrgtransformed yet, which will be fixed in some time.
8631debfc3dSmrg
8641debfc3dSmrg@item --with-local-prefix=@var{dirname}
8651debfc3dSmrgSpecify the
8661debfc3dSmrginstallation directory for local include files.  The default is
8671debfc3dSmrg@file{/usr/local}.  Specify this option if you want the compiler to
8681debfc3dSmrgsearch directory @file{@var{dirname}/include} for locally installed
8691debfc3dSmrgheader files @emph{instead} of @file{/usr/local/include}.
8701debfc3dSmrg
8711debfc3dSmrgYou should specify @option{--with-local-prefix} @strong{only} if your
8721debfc3dSmrgsite has a different convention (not @file{/usr/local}) for where to put
8731debfc3dSmrgsite-specific files.
8741debfc3dSmrg
8751debfc3dSmrgThe default value for @option{--with-local-prefix} is @file{/usr/local}
8761debfc3dSmrgregardless of the value of @option{--prefix}.  Specifying
8771debfc3dSmrg@option{--prefix} has no effect on which directory GCC searches for
8781debfc3dSmrglocal header files.  This may seem counterintuitive, but actually it is
8791debfc3dSmrglogical.
8801debfc3dSmrg
8811debfc3dSmrgThe purpose of @option{--prefix} is to specify where to @emph{install
8821debfc3dSmrgGCC}.  The local header files in @file{/usr/local/include}---if you put
8831debfc3dSmrgany in that directory---are not part of GCC@.  They are part of other
8841debfc3dSmrgprograms---perhaps many others.  (GCC installs its own header files in
8851debfc3dSmrganother directory which is based on the @option{--prefix} value.)
8861debfc3dSmrg
8871debfc3dSmrgBoth the local-prefix include directory and the GCC-prefix include
8881debfc3dSmrgdirectory are part of GCC's ``system include'' directories.  Although these
8891debfc3dSmrgtwo directories are not fixed, they need to be searched in the proper
8901debfc3dSmrgorder for the correct processing of the include_next directive.  The
8911debfc3dSmrglocal-prefix include directory is searched before the GCC-prefix
8921debfc3dSmrginclude directory.  Another characteristic of system include directories
8931debfc3dSmrgis that pedantic warnings are turned off for headers in these directories.
8941debfc3dSmrg
8951debfc3dSmrgSome autoconf macros add @option{-I @var{directory}} options to the
8961debfc3dSmrgcompiler command line, to ensure that directories containing installed
8971debfc3dSmrgpackages' headers are searched.  When @var{directory} is one of GCC's
8981debfc3dSmrgsystem include directories, GCC will ignore the option so that system
8991debfc3dSmrgdirectories continue to be processed in the correct order.  This
9001debfc3dSmrgmay result in a search order different from what was specified but the
9011debfc3dSmrgdirectory will still be searched.
9021debfc3dSmrg
9031debfc3dSmrgGCC automatically searches for ordinary libraries using
9041debfc3dSmrg@env{GCC_EXEC_PREFIX}.  Thus, when the same installation prefix is
9051debfc3dSmrgused for both GCC and packages, GCC will automatically search for
9061debfc3dSmrgboth headers and libraries.  This provides a configuration that is
9071debfc3dSmrgeasy to use.  GCC behaves in a manner similar to that when it is
9081debfc3dSmrginstalled as a system compiler in @file{/usr}.
9091debfc3dSmrg
9101debfc3dSmrgSites that need to install multiple versions of GCC may not want to
9111debfc3dSmrguse the above simple configuration.  It is possible to use the
9121debfc3dSmrg@option{--program-prefix}, @option{--program-suffix} and
9131debfc3dSmrg@option{--program-transform-name} options to install multiple versions
9141debfc3dSmrginto a single directory, but it may be simpler to use different prefixes
9151debfc3dSmrgand the @option{--with-local-prefix} option to specify the location of the
9161debfc3dSmrgsite-specific files for each version.  It will then be necessary for
9171debfc3dSmrgusers to specify explicitly the location of local site libraries
9181debfc3dSmrg(e.g., with @env{LIBRARY_PATH}).
9191debfc3dSmrg
9201debfc3dSmrgThe same value can be used for both @option{--with-local-prefix} and
9211debfc3dSmrg@option{--prefix} provided it is not @file{/usr}.  This can be used
9221debfc3dSmrgto avoid the default search of @file{/usr/local/include}.
9231debfc3dSmrg
9241debfc3dSmrg@strong{Do not} specify @file{/usr} as the @option{--with-local-prefix}!
9251debfc3dSmrgThe directory you use for @option{--with-local-prefix} @strong{must not}
9261debfc3dSmrgcontain any of the system's standard header files.  If it did contain
9271debfc3dSmrgthem, certain programs would be miscompiled (including GNU Emacs, on
9281debfc3dSmrgcertain targets), because this would override and nullify the header
9291debfc3dSmrgfile corrections made by the @command{fixincludes} script.
9301debfc3dSmrg
9311debfc3dSmrgIndications are that people who use this option use it based on mistaken
9321debfc3dSmrgideas of what it is for.  People use it as if it specified where to
9331debfc3dSmrginstall part of GCC@.  Perhaps they make this assumption because
9341debfc3dSmrginstalling GCC creates the directory.
9351debfc3dSmrg
9361debfc3dSmrg@item --with-gcc-major-version-only
9371debfc3dSmrgSpecifies that GCC should use only the major number rather than
9381debfc3dSmrg@var{major}.@var{minor}.@var{patchlevel} in filesystem paths.
9391debfc3dSmrg
9401debfc3dSmrg@item --with-native-system-header-dir=@var{dirname}
9411debfc3dSmrgSpecifies that @var{dirname} is the directory that contains native system
9421debfc3dSmrgheader files, rather than @file{/usr/include}.  This option is most useful
9431debfc3dSmrgif you are creating a compiler that should be isolated from the system
9441debfc3dSmrgas much as possible.  It is most commonly used with the
9451debfc3dSmrg@option{--with-sysroot} option and will cause GCC to search
9461debfc3dSmrg@var{dirname} inside the system root specified by that option.
9471debfc3dSmrg
9481debfc3dSmrg@item --enable-shared[=@var{package}[,@dots{}]]
9491debfc3dSmrgBuild shared versions of libraries, if shared libraries are supported on
9501debfc3dSmrgthe target platform.  Unlike GCC 2.95.x and earlier, shared libraries
9511debfc3dSmrgare enabled by default on all platforms that support shared libraries.
9521debfc3dSmrg
9531debfc3dSmrgIf a list of packages is given as an argument, build shared libraries
9541debfc3dSmrgonly for the listed packages.  For other packages, only static libraries
9551debfc3dSmrgwill be built.  Package names currently recognized in the GCC tree are
9561debfc3dSmrg@samp{libgcc} (also known as @samp{gcc}), @samp{libstdc++} (not
9571debfc3dSmrg@samp{libstdc++-v3}), @samp{libffi}, @samp{zlib}, @samp{boehm-gc},
958c0a68be4Smrg@samp{ada}, @samp{libada}, @samp{libgo}, @samp{libobjc}, and @samp{libphobos}.
9591debfc3dSmrgNote @samp{libiberty} does not support shared libraries at all.
9601debfc3dSmrg
9611debfc3dSmrgUse @option{--disable-shared} to build only static libraries.  Note that
9621debfc3dSmrg@option{--disable-shared} does not accept a list of package names as
9631debfc3dSmrgargument, only @option{--enable-shared} does.
9641debfc3dSmrg
9651debfc3dSmrgContrast with @option{--enable-host-shared}, which affects @emph{host}
9661debfc3dSmrgcode.
9671debfc3dSmrg
9681debfc3dSmrg@item --enable-host-shared
9691debfc3dSmrgSpecify that the @emph{host} code should be built into position-independent
9701debfc3dSmrgmachine code (with -fPIC), allowing it to be used within shared libraries,
9711debfc3dSmrgbut yielding a slightly slower compiler.
9721debfc3dSmrg
9731debfc3dSmrgThis option is required when building the libgccjit.so library.
9741debfc3dSmrg
9751debfc3dSmrgContrast with @option{--enable-shared}, which affects @emph{target}
9761debfc3dSmrglibraries.
9771debfc3dSmrg
9781debfc3dSmrg@item @anchor{with-gnu-as}--with-gnu-as
9791debfc3dSmrgSpecify that the compiler should assume that the
9801debfc3dSmrgassembler it finds is the GNU assembler.  However, this does not modify
9811debfc3dSmrgthe rules to find an assembler and will result in confusion if the
9821debfc3dSmrgassembler found is not actually the GNU assembler.  (Confusion may also
9831debfc3dSmrgresult if the compiler finds the GNU assembler but has not been
9841debfc3dSmrgconfigured with @option{--with-gnu-as}.)  If you have more than one
9851debfc3dSmrgassembler installed on your system, you may want to use this option in
9861debfc3dSmrgconnection with @option{--with-as=@var{pathname}} or
9871debfc3dSmrg@option{--with-build-time-tools=@var{pathname}}.
9881debfc3dSmrg
9891debfc3dSmrgThe following systems are the only ones where it makes a difference
9901debfc3dSmrgwhether you use the GNU assembler.  On any other system,
9911debfc3dSmrg@option{--with-gnu-as} has no effect.
9921debfc3dSmrg
9931debfc3dSmrg@itemize @bullet
9941debfc3dSmrg@item @samp{hppa1.0-@var{any}-@var{any}}
9951debfc3dSmrg@item @samp{hppa1.1-@var{any}-@var{any}}
9961debfc3dSmrg@item @samp{sparc-sun-solaris2.@var{any}}
9971debfc3dSmrg@item @samp{sparc64-@var{any}-solaris2.@var{any}}
9981debfc3dSmrg@end itemize
9991debfc3dSmrg
10001debfc3dSmrg@item @anchor{with-as}--with-as=@var{pathname}
10011debfc3dSmrgSpecify that the compiler should use the assembler pointed to by
10021debfc3dSmrg@var{pathname}, rather than the one found by the standard rules to find
10031debfc3dSmrgan assembler, which are:
10041debfc3dSmrg@itemize @bullet
10051debfc3dSmrg@item
10061debfc3dSmrgUnless GCC is being built with a cross compiler, check the
10071debfc3dSmrg@file{@var{libexec}/gcc/@var{target}/@var{version}} directory.
10081debfc3dSmrg@var{libexec} defaults to @file{@var{exec-prefix}/libexec};
10091debfc3dSmrg@var{exec-prefix} defaults to @var{prefix}, which
10101debfc3dSmrgdefaults to @file{/usr/local} unless overridden by the
10111debfc3dSmrg@option{--prefix=@var{pathname}} switch described above.  @var{target}
10121debfc3dSmrgis the target system triple, such as @samp{sparc-sun-solaris2.7}, and
10131debfc3dSmrg@var{version} denotes the GCC version, such as 3.0.
10141debfc3dSmrg
10151debfc3dSmrg@item
10161debfc3dSmrgIf the target system is the same that you are building on, check
10171debfc3dSmrgoperating system specific directories (e.g.@: @file{/usr/ccs/bin} on
1018*8feb0f0bSmrgSolaris 2).
10191debfc3dSmrg
10201debfc3dSmrg@item
10211debfc3dSmrgCheck in the @env{PATH} for a tool whose name is prefixed by the
10221debfc3dSmrgtarget system triple.
10231debfc3dSmrg
10241debfc3dSmrg@item
10251debfc3dSmrgCheck in the @env{PATH} for a tool whose name is not prefixed by the
10261debfc3dSmrgtarget system triple, if the host and target system triple are
10271debfc3dSmrgthe same (in other words, we use a host tool if it can be used for
10281debfc3dSmrgthe target as well).
10291debfc3dSmrg@end itemize
10301debfc3dSmrg
10311debfc3dSmrgYou may want to use @option{--with-as} if no assembler
10321debfc3dSmrgis installed in the directories listed above, or if you have multiple
10331debfc3dSmrgassemblers installed and want to choose one that is not found by the
10341debfc3dSmrgabove rules.
10351debfc3dSmrg
10361debfc3dSmrg@item @anchor{with-gnu-ld}--with-gnu-ld
10371debfc3dSmrgSame as @uref{#with-gnu-as,,@option{--with-gnu-as}}
10381debfc3dSmrgbut for the linker.
10391debfc3dSmrg
10401debfc3dSmrg@item --with-ld=@var{pathname}
10411debfc3dSmrgSame as @uref{#with-as,,@option{--with-as}}
10421debfc3dSmrgbut for the linker.
10431debfc3dSmrg
1044*8feb0f0bSmrg@item --with-dsymutil=@var{pathname}
1045*8feb0f0bSmrgSame as @uref{#with-as,,@option{--with-as}}
1046*8feb0f0bSmrgbut for the debug linker (only used on Darwin platforms so far).
1047*8feb0f0bSmrg
10481debfc3dSmrg@item --with-stabs
10491debfc3dSmrgSpecify that stabs debugging
10501debfc3dSmrginformation should be used instead of whatever format the host normally
10511debfc3dSmrguses.  Normally GCC uses the same debug format as the host system.
10521debfc3dSmrg
10531debfc3dSmrg@item --with-tls=@var{dialect}
10541debfc3dSmrgSpecify the default TLS dialect, for systems were there is a choice.
10551debfc3dSmrgFor ARM targets, possible values for @var{dialect} are @code{gnu} or
10561debfc3dSmrg@code{gnu2}, which select between the original GNU dialect and the GNU TLS
10571debfc3dSmrgdescriptor-based dialect.
10581debfc3dSmrg
10591debfc3dSmrg@item --enable-multiarch
10601debfc3dSmrgSpecify whether to enable or disable multiarch support.  The default is
10611debfc3dSmrgto check for glibc start files in a multiarch location, and enable it
10621debfc3dSmrgif the files are found.  The auto detection is enabled for native builds,
10631debfc3dSmrgand for cross builds configured with @option{--with-sysroot}, and without
10641debfc3dSmrg@option{--with-native-system-header-dir}.
10651debfc3dSmrgMore documentation about multiarch can be found at
10661debfc3dSmrg@uref{https://wiki.debian.org/Multiarch}.
10671debfc3dSmrg
10681debfc3dSmrg@item --enable-sjlj-exceptions
10691debfc3dSmrgForce use of the @code{setjmp}/@code{longjmp}-based scheme for exceptions.
10701debfc3dSmrg@samp{configure} ordinarily picks the correct value based on the platform.
10711debfc3dSmrgOnly use this option if you are sure you need a different setting.
10721debfc3dSmrg
10731debfc3dSmrg@item --enable-vtable-verify
10741debfc3dSmrgSpecify whether to enable or disable the vtable verification feature.
10751debfc3dSmrgEnabling this feature causes libstdc++ to be built with its virtual calls
10761debfc3dSmrgin verifiable mode.  This means that, when linked with libvtv, every
10771debfc3dSmrgvirtual call in libstdc++ will verify the vtable pointer through which the
10781debfc3dSmrgcall will be made before actually making the call.  If not linked with libvtv,
10791debfc3dSmrgthe verifier will call stub functions (in libstdc++ itself) and do nothing.
10801debfc3dSmrgIf vtable verification is disabled, then libstdc++ is not built with its
10811debfc3dSmrgvirtual calls in verifiable mode at all.  However the libvtv library will
10821debfc3dSmrgstill be built (see @option{--disable-libvtv} to turn off building libvtv).
10831debfc3dSmrg@option{--disable-vtable-verify} is the default.
10841debfc3dSmrg
1085c0a68be4Smrg@item --disable-gcov
1086c0a68be4SmrgSpecify that the run-time library used for coverage analysis
1087c0a68be4Smrgand associated host tools should not be built.
1088c0a68be4Smrg
10891debfc3dSmrg@item --disable-multilib
10901debfc3dSmrgSpecify that multiple target
10911debfc3dSmrglibraries to support different target variants, calling
10921debfc3dSmrgconventions, etc.@: should not be built.  The default is to build a
10931debfc3dSmrgpredefined set of them.
10941debfc3dSmrg
10951debfc3dSmrgSome targets provide finer-grained control over which multilibs are built
10961debfc3dSmrg(e.g., @option{--disable-softfloat}):
10971debfc3dSmrg@table @code
10981debfc3dSmrg@item arm-*-*
10991debfc3dSmrgfpu, 26bit, underscore, interwork, biendian, nofmult.
11001debfc3dSmrg
11011debfc3dSmrg@item m68*-*-*
11021debfc3dSmrgsoftfloat, m68881, m68000, m68020.
11031debfc3dSmrg
11041debfc3dSmrg@item mips*-*-*
11051debfc3dSmrgsingle-float, biendian, softfloat.
11061debfc3dSmrg
1107*8feb0f0bSmrg@item msp430-*-*
1108*8feb0f0bSmrgno-exceptions
1109*8feb0f0bSmrg
11101debfc3dSmrg@item powerpc*-*-*, rs6000*-*-*
11111debfc3dSmrgaix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian,
11121debfc3dSmrgsysv, aix.
11131debfc3dSmrg
11141debfc3dSmrg@end table
11151debfc3dSmrg
11161debfc3dSmrg@item --with-multilib-list=@var{list}
11171debfc3dSmrg@itemx --without-multilib-list
11181debfc3dSmrgSpecify what multilibs to build.  @var{list} is a comma separated list of
11191debfc3dSmrgvalues, possibly consisting of a single value.  Currently only implemented
1120c0a68be4Smrgfor aarch64*-*-*, arm*-*-*, riscv*-*-*, sh*-*-* and x86-64-*-linux*.  The
1121c0a68be4Smrgaccepted values and meaning for each target is given below.
11221debfc3dSmrg
11231debfc3dSmrg@table @code
1124a2dc1f3fSmrg@item aarch64*-*-*
1125a2dc1f3fSmrg@var{list} is a comma separated list of @code{ilp32}, and @code{lp64}
1126a2dc1f3fSmrgto enable ILP32 and LP64 run-time libraries, respectively.  If
1127a2dc1f3fSmrg@var{list} is empty, then there will be no multilibs and only the
1128a2dc1f3fSmrgdefault run-time library will be built.  If @var{list} is
1129a2dc1f3fSmrg@code{default} or --with-multilib-list= is not specified, then the
1130a2dc1f3fSmrgdefault set of libraries is selected based on the value of
1131a2dc1f3fSmrg@option{--target}.
1132a2dc1f3fSmrg
11331debfc3dSmrg@item arm*-*-*
1134c0a68be4Smrg@var{list} is a comma separated list of @code{aprofile} and
1135c0a68be4Smrg@code{rmprofile} to build multilibs for A or R and M architecture
1136c0a68be4Smrgprofiles respectively.  Note that, due to some limitation of the current
1137c0a68be4Smrgmultilib framework, using the combined @code{aprofile,rmprofile}
1138c0a68be4Smrgmultilibs selects in some cases a less optimal multilib than when using
1139c0a68be4Smrgthe multilib profile for the architecture targetted.  The special value
1140c0a68be4Smrg@code{default} is also accepted and is equivalent to omitting the
1141c0a68be4Smrgoption, i.e., only the default run-time library will be enabled.
1142c0a68be4Smrg
1143c0a68be4Smrg@var{list} may instead contain @code{@@name}, to use the multilib
1144c0a68be4Smrgconfiguration Makefile fragment @file{name} in @file{gcc/config/arm} in
1145c0a68be4Smrgthe source tree (it is part of the corresponding sources, after all).
1146c0a68be4SmrgIt is recommended, but not required, that files used for this purpose to
1147c0a68be4Smrgbe named starting with @file{t-ml-}, to make their intended purpose
1148c0a68be4Smrgself-evident, in line with GCC conventions.  Such files enable custom,
1149c0a68be4Smrguser-chosen multilib lists to be configured.  Whether multiple such
1150c0a68be4Smrgfiles can be used together depends on the contents of the supplied
1151c0a68be4Smrgfiles.  See @file{gcc/config/arm/t-multilib} and its supplementary
1152c0a68be4Smrg@file{gcc/config/arm/t-*profile} files for an example of what such
1153c0a68be4SmrgMakefile fragments might look like for this version of GCC.  The macros
1154c0a68be4Smrgexpected to be defined in these fragments are not stable across GCC
1155c0a68be4Smrgreleases, so make sure they define the @code{MULTILIB}-related macros
1156c0a68be4Smrgexpected by the version of GCC you are building.
1157c0a68be4Smrg@ifnothtml
1158c0a68be4Smrg@xref{Target Fragment,, Target Makefile Fragments, gccint, GNU Compiler
1159c0a68be4SmrgCollection (GCC) Internals}.
1160c0a68be4Smrg@end ifnothtml
1161c0a68be4Smrg@ifhtml
1162c0a68be4SmrgSee ``Target Makefile Fragments'' in the internals manual.
1163c0a68be4Smrg@end ifhtml
11641debfc3dSmrg
11651debfc3dSmrgThe table below gives the combination of ISAs, architectures, FPUs and
1166c0a68be4Smrgfloating-point ABIs for which multilibs are built for each predefined
1167c0a68be4Smrgprofile.  The union of these options is considered when specifying both
1168c0a68be4Smrg@code{aprofile} and @code{rmprofile}.
11691debfc3dSmrg
11701debfc3dSmrg@multitable @columnfractions .15 .28 .30
11711debfc3dSmrg@item Option @tab aprofile @tab rmprofile
11721debfc3dSmrg@item ISAs
11731debfc3dSmrg@tab @code{-marm} and @code{-mthumb}
11741debfc3dSmrg@tab @code{-mthumb}
11751debfc3dSmrg@item Architectures@*@*@*@*@*@*
11761debfc3dSmrg@tab default architecture@*
11771debfc3dSmrg@code{-march=armv7-a}@*
11781debfc3dSmrg@code{-march=armv7ve}@*
11791debfc3dSmrg@code{-march=armv8-a}@*@*@*
11801debfc3dSmrg@tab default architecture@*
11811debfc3dSmrg@code{-march=armv6s-m}@*
11821debfc3dSmrg@code{-march=armv7-m}@*
11831debfc3dSmrg@code{-march=armv7e-m}@*
11841debfc3dSmrg@code{-march=armv8-m.base}@*
11851debfc3dSmrg@code{-march=armv8-m.main}@*
11861debfc3dSmrg@code{-march=armv7}
11871debfc3dSmrg@item FPUs@*@*@*@*@*
11881debfc3dSmrg@tab none@*
11891debfc3dSmrg@code{-mfpu=vfpv3-d16}@*
11901debfc3dSmrg@code{-mfpu=neon}@*
11911debfc3dSmrg@code{-mfpu=vfpv4-d16}@*
11921debfc3dSmrg@code{-mfpu=neon-vfpv4}@*
11931debfc3dSmrg@code{-mfpu=neon-fp-armv8}
11941debfc3dSmrg@tab none@*
11951debfc3dSmrg@code{-mfpu=vfpv3-d16}@*
11961debfc3dSmrg@code{-mfpu=fpv4-sp-d16}@*
11971debfc3dSmrg@code{-mfpu=fpv5-sp-d16}@*
11981debfc3dSmrg@code{-mfpu=fpv5-d16}@*
11991debfc3dSmrg@item floating-point@/ ABIs@*@*
12001debfc3dSmrg@tab @code{-mfloat-abi=soft}@*
12011debfc3dSmrg@code{-mfloat-abi=softfp}@*
12021debfc3dSmrg@code{-mfloat-abi=hard}
12031debfc3dSmrg@tab @code{-mfloat-abi=soft}@*
12041debfc3dSmrg@code{-mfloat-abi=softfp}@*
12051debfc3dSmrg@code{-mfloat-abi=hard}
12061debfc3dSmrg@end multitable
12071debfc3dSmrg
1208c0a68be4Smrg@item riscv*-*-*
1209c0a68be4Smrg@var{list} is a single ABI name.  The target architecture must be either
1210c0a68be4Smrg@code{rv32gc} or @code{rv64gc}.  This will build a single multilib for the
1211c0a68be4Smrgspecified architecture and ABI pair.  If @code{--with-multilib-list} is not
1212c0a68be4Smrggiven, then a default set of multilibs is selected based on the value of
1213c0a68be4Smrg@option{--target}.  This is usually a large set of multilibs.
1214c0a68be4Smrg
12151debfc3dSmrg@item sh*-*-*
12161debfc3dSmrg@var{list} is a comma separated list of CPU names.  These must be of the
12171debfc3dSmrgform @code{sh*} or @code{m*} (in which case they match the compiler option
12181debfc3dSmrgfor that processor).  The list should not contain any endian options -
12191debfc3dSmrgthese are handled by @option{--with-endian}.
12201debfc3dSmrg
12211debfc3dSmrgIf @var{list} is empty, then there will be no multilibs for extra
12221debfc3dSmrgprocessors.  The multilib for the secondary endian remains enabled.
12231debfc3dSmrg
12241debfc3dSmrgAs a special case, if an entry in the list starts with a @code{!}
12251debfc3dSmrg(exclamation point), then it is added to the list of excluded multilibs.
12261debfc3dSmrgEntries of this sort should be compatible with @samp{MULTILIB_EXCLUDES}
12271debfc3dSmrg(once the leading @code{!} has been stripped).
12281debfc3dSmrg
12291debfc3dSmrgIf @option{--with-multilib-list} is not given, then a default set of
12301debfc3dSmrgmultilibs is selected based on the value of @option{--target}.  This is
12311debfc3dSmrgusually the complete set of libraries, but some targets imply a more
12321debfc3dSmrgspecialized subset.
12331debfc3dSmrg
12341debfc3dSmrgExample 1: to configure a compiler for SH4A only, but supporting both
12351debfc3dSmrgendians, with little endian being the default:
12361debfc3dSmrg@smallexample
12371debfc3dSmrg--with-cpu=sh4a --with-endian=little,big --with-multilib-list=
12381debfc3dSmrg@end smallexample
12391debfc3dSmrg
12401debfc3dSmrgExample 2: to configure a compiler for both SH4A and SH4AL-DSP, but with
12411debfc3dSmrgonly little endian SH4AL:
12421debfc3dSmrg@smallexample
12431debfc3dSmrg--with-cpu=sh4a --with-endian=little,big \
12441debfc3dSmrg--with-multilib-list=sh4al,!mb/m4al
12451debfc3dSmrg@end smallexample
12461debfc3dSmrg
12471debfc3dSmrg@item x86-64-*-linux*
12481debfc3dSmrg@var{list} is a comma separated list of @code{m32}, @code{m64} and
12491debfc3dSmrg@code{mx32} to enable 32-bit, 64-bit and x32 run-time libraries,
12501debfc3dSmrgrespectively.  If @var{list} is empty, then there will be no multilibs
12511debfc3dSmrgand only the default run-time library will be enabled.
12521debfc3dSmrg
12531debfc3dSmrgIf @option{--with-multilib-list} is not given, then only 32-bit and
12541debfc3dSmrg64-bit run-time libraries will be enabled.
12551debfc3dSmrg@end table
12561debfc3dSmrg
12571debfc3dSmrg@item --with-endian=@var{endians}
12581debfc3dSmrgSpecify what endians to use.
12591debfc3dSmrgCurrently only implemented for sh*-*-*.
12601debfc3dSmrg
12611debfc3dSmrg@var{endians} may be one of the following:
12621debfc3dSmrg@table @code
12631debfc3dSmrg@item big
12641debfc3dSmrgUse big endian exclusively.
12651debfc3dSmrg@item little
12661debfc3dSmrgUse little endian exclusively.
12671debfc3dSmrg@item big,little
12681debfc3dSmrgUse big endian by default.  Provide a multilib for little endian.
12691debfc3dSmrg@item little,big
12701debfc3dSmrgUse little endian by default.  Provide a multilib for big endian.
12711debfc3dSmrg@end table
12721debfc3dSmrg
12731debfc3dSmrg@item --enable-threads
12741debfc3dSmrgSpecify that the target
12751debfc3dSmrgsupports threads.  This affects the Objective-C compiler and runtime
12761debfc3dSmrglibrary, and exception handling for other languages like C++.
12771debfc3dSmrgOn some systems, this is the default.
12781debfc3dSmrg
12791debfc3dSmrgIn general, the best (and, in many cases, the only known) threading
12801debfc3dSmrgmodel available will be configured for use.  Beware that on some
12811debfc3dSmrgsystems, GCC has not been taught what threading models are generally
12821debfc3dSmrgavailable for the system.  In this case, @option{--enable-threads} is an
12831debfc3dSmrgalias for @option{--enable-threads=single}.
12841debfc3dSmrg
12851debfc3dSmrg@item --disable-threads
12861debfc3dSmrgSpecify that threading support should be disabled for the system.
12871debfc3dSmrgThis is an alias for @option{--enable-threads=single}.
12881debfc3dSmrg
12891debfc3dSmrg@item --enable-threads=@var{lib}
12901debfc3dSmrgSpecify that
12911debfc3dSmrg@var{lib} is the thread support library.  This affects the Objective-C
12921debfc3dSmrgcompiler and runtime library, and exception handling for other languages
12931debfc3dSmrglike C++.  The possibilities for @var{lib} are:
12941debfc3dSmrg
12951debfc3dSmrg@table @code
12961debfc3dSmrg@item aix
12971debfc3dSmrgAIX thread support.
12981debfc3dSmrg@item dce
12991debfc3dSmrgDCE thread support.
13001debfc3dSmrg@item lynx
13011debfc3dSmrgLynxOS thread support.
13021debfc3dSmrg@item mipssde
13031debfc3dSmrgMIPS SDE thread support.
13041debfc3dSmrg@item no
13051debfc3dSmrgThis is an alias for @samp{single}.
13061debfc3dSmrg@item posix
13071debfc3dSmrgGeneric POSIX/Unix98 thread support.
13081debfc3dSmrg@item rtems
13091debfc3dSmrgRTEMS thread support.
13101debfc3dSmrg@item single
13111debfc3dSmrgDisable thread support, should work for all platforms.
13121debfc3dSmrg@item tpf
13131debfc3dSmrgTPF thread support.
13141debfc3dSmrg@item vxworks
13151debfc3dSmrgVxWorks thread support.
13161debfc3dSmrg@item win32
13171debfc3dSmrgMicrosoft Win32 API thread support.
13181debfc3dSmrg@end table
13191debfc3dSmrg
13201debfc3dSmrg@item --enable-tls
13211debfc3dSmrgSpecify that the target supports TLS (Thread Local Storage).  Usually
13221debfc3dSmrgconfigure can correctly determine if TLS is supported.  In cases where
13231debfc3dSmrgit guesses incorrectly, TLS can be explicitly enabled or disabled with
13241debfc3dSmrg@option{--enable-tls} or @option{--disable-tls}.  This can happen if
13251debfc3dSmrgthe assembler supports TLS but the C library does not, or if the
13261debfc3dSmrgassumptions made by the configure test are incorrect.
13271debfc3dSmrg
13281debfc3dSmrg@item --disable-tls
13291debfc3dSmrgSpecify that the target does not support TLS.
13301debfc3dSmrgThis is an alias for @option{--enable-tls=no}.
13311debfc3dSmrg
1332*8feb0f0bSmrg@item --disable-tm-clone-registry
1333*8feb0f0bSmrgDisable TM clone registry in libgcc. It is enabled in libgcc by default.
1334*8feb0f0bSmrgThis option helps to reduce code size for embedded targets which do
1335*8feb0f0bSmrgnot use transactional memory.
1336*8feb0f0bSmrg
13371debfc3dSmrg@item --with-cpu=@var{cpu}
13381debfc3dSmrg@itemx --with-cpu-32=@var{cpu}
13391debfc3dSmrg@itemx --with-cpu-64=@var{cpu}
13401debfc3dSmrgSpecify which cpu variant the compiler should generate code for by default.
13411debfc3dSmrg@var{cpu} will be used as the default value of the @option{-mcpu=} switch.
13421debfc3dSmrgThis option is only supported on some targets, including ARC, ARM, i386, M68k,
13431debfc3dSmrgPowerPC, and SPARC@.  It is mandatory for ARC@.  The @option{--with-cpu-32} and
13441debfc3dSmrg@option{--with-cpu-64} options specify separate default CPUs for
1345*8feb0f0bSmrg32-bit and 64-bit modes; these options are only supported for aarch64, i386,
13461debfc3dSmrgx86-64, PowerPC, and SPARC@.
13471debfc3dSmrg
13481debfc3dSmrg@item --with-schedule=@var{cpu}
13491debfc3dSmrg@itemx --with-arch=@var{cpu}
13501debfc3dSmrg@itemx --with-arch-32=@var{cpu}
13511debfc3dSmrg@itemx --with-arch-64=@var{cpu}
13521debfc3dSmrg@itemx --with-tune=@var{cpu}
13531debfc3dSmrg@itemx --with-tune-32=@var{cpu}
13541debfc3dSmrg@itemx --with-tune-64=@var{cpu}
13551debfc3dSmrg@itemx --with-abi=@var{abi}
13561debfc3dSmrg@itemx --with-fpu=@var{type}
13571debfc3dSmrg@itemx --with-float=@var{type}
13581debfc3dSmrgThese configure options provide default values for the @option{-mschedule=},
13591debfc3dSmrg@option{-march=}, @option{-mtune=}, @option{-mabi=}, and @option{-mfpu=}
13601debfc3dSmrgoptions and for @option{-mhard-float} or @option{-msoft-float}.  As with
13611debfc3dSmrg@option{--with-cpu}, which switches will be accepted and acceptable values
13621debfc3dSmrgof the arguments depend on the target.
13631debfc3dSmrg
13641debfc3dSmrg@item --with-mode=@var{mode}
13651debfc3dSmrgSpecify if the compiler should default to @option{-marm} or @option{-mthumb}.
13661debfc3dSmrgThis option is only supported on ARM targets.
13671debfc3dSmrg
13681debfc3dSmrg@item --with-stack-offset=@var{num}
13691debfc3dSmrgThis option sets the default for the -mstack-offset=@var{num} option,
13701debfc3dSmrgand will thus generally also control the setting of this option for
13711debfc3dSmrglibraries.  This option is only supported on Epiphany targets.
13721debfc3dSmrg
13731debfc3dSmrg@item --with-fpmath=@var{isa}
13741debfc3dSmrgThis options sets @option{-mfpmath=sse} by default and specifies the default
13751debfc3dSmrgISA for floating-point arithmetics.  You can select either @samp{sse} which
13761debfc3dSmrgenables @option{-msse2} or @samp{avx} which enables @option{-mavx} by default.
13771debfc3dSmrgThis option is only supported on i386 and x86-64 targets.
13781debfc3dSmrg
13791debfc3dSmrg@item --with-fp-32=@var{mode}
13801debfc3dSmrgOn MIPS targets, set the default value for the @option{-mfp} option when using
13811debfc3dSmrgthe o32 ABI.  The possibilities for @var{mode} are:
13821debfc3dSmrg@table @code
13831debfc3dSmrg@item 32
13841debfc3dSmrgUse the o32 FP32 ABI extension, as with the @option{-mfp32} command-line
13851debfc3dSmrgoption.
13861debfc3dSmrg@item xx
13871debfc3dSmrgUse the o32 FPXX ABI extension, as with the @option{-mfpxx} command-line
13881debfc3dSmrgoption.
13891debfc3dSmrg@item 64
13901debfc3dSmrgUse the o32 FP64 ABI extension, as with the @option{-mfp64} command-line
13911debfc3dSmrgoption.
13921debfc3dSmrg@end table
13931debfc3dSmrgIn the absence of this configuration option the default is to use the o32
13941debfc3dSmrgFP32 ABI extension.
13951debfc3dSmrg
13961debfc3dSmrg@item --with-odd-spreg-32
13971debfc3dSmrgOn MIPS targets, set the @option{-modd-spreg} option by default when using
13981debfc3dSmrgthe o32 ABI.
13991debfc3dSmrg
14001debfc3dSmrg@item --without-odd-spreg-32
14011debfc3dSmrgOn MIPS targets, set the @option{-mno-odd-spreg} option by default when using
14021debfc3dSmrgthe o32 ABI.  This is normally used in conjunction with
14031debfc3dSmrg@option{--with-fp-32=64} in order to target the o32 FP64A ABI extension.
14041debfc3dSmrg
14051debfc3dSmrg@item --with-nan=@var{encoding}
14061debfc3dSmrgOn MIPS targets, set the default encoding convention to use for the
14071debfc3dSmrgspecial not-a-number (NaN) IEEE 754 floating-point data.  The
14081debfc3dSmrgpossibilities for @var{encoding} are:
14091debfc3dSmrg@table @code
14101debfc3dSmrg@item legacy
14111debfc3dSmrgUse the legacy encoding, as with the @option{-mnan=legacy} command-line
14121debfc3dSmrgoption.
14131debfc3dSmrg@item 2008
14141debfc3dSmrgUse the 754-2008 encoding, as with the @option{-mnan=2008} command-line
14151debfc3dSmrgoption.
14161debfc3dSmrg@end table
14171debfc3dSmrgTo use this configuration option you must have an assembler version
14181debfc3dSmrginstalled that supports the @option{-mnan=} command-line option too.
14191debfc3dSmrgIn the absence of this configuration option the default convention is
14201debfc3dSmrgthe legacy encoding, as when neither of the @option{-mnan=2008} and
14211debfc3dSmrg@option{-mnan=legacy} command-line options has been used.
14221debfc3dSmrg
14231debfc3dSmrg@item --with-divide=@var{type}
14241debfc3dSmrgSpecify how the compiler should generate code for checking for
14251debfc3dSmrgdivision by zero.  This option is only supported on the MIPS target.
14261debfc3dSmrgThe possibilities for @var{type} are:
14271debfc3dSmrg@table @code
14281debfc3dSmrg@item traps
14291debfc3dSmrgDivision by zero checks use conditional traps (this is the default on
14301debfc3dSmrgsystems that support conditional traps).
14311debfc3dSmrg@item breaks
14321debfc3dSmrgDivision by zero checks use the break instruction.
14331debfc3dSmrg@end table
14341debfc3dSmrg
14351debfc3dSmrg@c If you make --with-llsc the default for additional targets,
14361debfc3dSmrg@c update the --with-llsc description in the MIPS section below.
14371debfc3dSmrg
14381debfc3dSmrg@item --with-llsc
14391debfc3dSmrgOn MIPS targets, make @option{-mllsc} the default when no
14401debfc3dSmrg@option{-mno-llsc} option is passed.  This is the default for
14411debfc3dSmrgLinux-based targets, as the kernel will emulate them if the ISA does
14421debfc3dSmrgnot provide them.
14431debfc3dSmrg
14441debfc3dSmrg@item --without-llsc
14451debfc3dSmrgOn MIPS targets, make @option{-mno-llsc} the default when no
14461debfc3dSmrg@option{-mllsc} option is passed.
14471debfc3dSmrg
14481debfc3dSmrg@item --with-synci
14491debfc3dSmrgOn MIPS targets, make @option{-msynci} the default when no
14501debfc3dSmrg@option{-mno-synci} option is passed.
14511debfc3dSmrg
14521debfc3dSmrg@item --without-synci
14531debfc3dSmrgOn MIPS targets, make @option{-mno-synci} the default when no
14541debfc3dSmrg@option{-msynci} option is passed.  This is the default.
14551debfc3dSmrg
14561debfc3dSmrg@item --with-lxc1-sxc1
14571debfc3dSmrgOn MIPS targets, make @option{-mlxc1-sxc1} the default when no
14581debfc3dSmrg@option{-mno-lxc1-sxc1} option is passed.  This is the default.
14591debfc3dSmrg
14601debfc3dSmrg@item --without-lxc1-sxc1
14611debfc3dSmrgOn MIPS targets, make @option{-mno-lxc1-sxc1} the default when no
14621debfc3dSmrg@option{-mlxc1-sxc1} option is passed.  The indexed load/store
14631debfc3dSmrginstructions are not directly a problem but can lead to unexpected
14641debfc3dSmrgbehaviour when deployed in an application intended for a 32-bit address
14651debfc3dSmrgspace but run on a 64-bit processor.  The issue is seen because all
14661debfc3dSmrgknown MIPS 64-bit Linux kernels execute o32 and n32 applications
14671debfc3dSmrgwith 64-bit addressing enabled which affects the overflow behaviour
14681debfc3dSmrgof the indexed addressing mode.  GCC will assume that ordinary
14691debfc3dSmrg32-bit arithmetic overflow behaviour is the same whether performed
14701debfc3dSmrgas an @code{addu} instruction or as part of the address calculation
14711debfc3dSmrgin @code{lwxc1} type instructions.  This assumption holds true in a
14721debfc3dSmrgpure 32-bit environment and can hold true in a 64-bit environment if
14731debfc3dSmrgthe address space is accurately set to be 32-bit for o32 and n32.
14741debfc3dSmrg
14751debfc3dSmrg@item --with-madd4
14761debfc3dSmrgOn MIPS targets, make @option{-mmadd4} the default when no
14771debfc3dSmrg@option{-mno-madd4} option is passed.  This is the default.
14781debfc3dSmrg
14791debfc3dSmrg@item --without-madd4
14801debfc3dSmrgOn MIPS targets, make @option{-mno-madd4} the default when no
14811debfc3dSmrg@option{-mmadd4} option is passed.  The @code{madd4} instruction
14821debfc3dSmrgfamily can be problematic when targeting a combination of cores that
14831debfc3dSmrgimplement these instructions differently.  There are two known cores
14841debfc3dSmrgthat implement these as fused operations instead of unfused (where
14851debfc3dSmrgunfused is normally expected).  Disabling these instructions is the
14861debfc3dSmrgonly way to ensure compatible code is generated; this will incur
14871debfc3dSmrga performance penalty.
14881debfc3dSmrg
14891debfc3dSmrg@item --with-mips-plt
14901debfc3dSmrgOn MIPS targets, make use of copy relocations and PLTs.
14911debfc3dSmrgThese features are extensions to the traditional
14921debfc3dSmrgSVR4-based MIPS ABIs and require support from GNU binutils
14931debfc3dSmrgand the runtime C library.
14941debfc3dSmrg
1495c0a68be4Smrg@item --with-stack-clash-protection-guard-size=@var{size}
1496c0a68be4SmrgOn certain targets this option sets the default stack clash protection guard
1497c0a68be4Smrgsize as a power of two in bytes.  On AArch64 @var{size} is required to be either
1498c0a68be4Smrg12 (4KB) or 16 (64KB).
1499c0a68be4Smrg
15001debfc3dSmrg@item --enable-__cxa_atexit
15011debfc3dSmrgDefine if you want to use __cxa_atexit, rather than atexit, to
15021debfc3dSmrgregister C++ destructors for local statics and global objects.
15031debfc3dSmrgThis is essential for fully standards-compliant handling of
15041debfc3dSmrgdestructors, but requires __cxa_atexit in libc.  This option is currently
15051debfc3dSmrgonly available on systems with GNU libc.  When enabled, this will cause
15061debfc3dSmrg@option{-fuse-cxa-atexit} to be passed by default.
15071debfc3dSmrg
15081debfc3dSmrg@item --enable-gnu-indirect-function
15091debfc3dSmrgDefine if you want to enable the @code{ifunc} attribute.  This option is
15101debfc3dSmrgcurrently only available on systems with GNU libc on certain targets.
15111debfc3dSmrg
15121debfc3dSmrg@item --enable-target-optspace
15131debfc3dSmrgSpecify that target
15141debfc3dSmrglibraries should be optimized for code space instead of code speed.
15151debfc3dSmrgThis is the default for the m32r platform.
15161debfc3dSmrg
15171debfc3dSmrg@item --with-cpp-install-dir=@var{dirname}
15181debfc3dSmrgSpecify that the user visible @command{cpp} program should be installed
15191debfc3dSmrgin @file{@var{prefix}/@var{dirname}/cpp}, in addition to @var{bindir}.
15201debfc3dSmrg
15211debfc3dSmrg@item --enable-comdat
15221debfc3dSmrgEnable COMDAT group support.  This is primarily used to override the
15231debfc3dSmrgautomatically detected value.
15241debfc3dSmrg
15251debfc3dSmrg@item --enable-initfini-array
15261debfc3dSmrgForce the use of sections @code{.init_array} and @code{.fini_array}
15271debfc3dSmrg(instead of @code{.init} and @code{.fini}) for constructors and
15281debfc3dSmrgdestructors.  Option @option{--disable-initfini-array} has the
15291debfc3dSmrgopposite effect.  If neither option is specified, the configure script
15301debfc3dSmrgwill try to guess whether the @code{.init_array} and
15311debfc3dSmrg@code{.fini_array} sections are supported and, if they are, use them.
15321debfc3dSmrg
15331debfc3dSmrg@item --enable-link-mutex
15341debfc3dSmrgWhen building GCC, use a mutex to avoid linking the compilers for
15351debfc3dSmrgmultiple languages at the same time, to avoid thrashing on build
15361debfc3dSmrgsystems with limited free memory.  The default is not to use such a mutex.
15371debfc3dSmrg
15381debfc3dSmrg@item --enable-maintainer-mode
15391debfc3dSmrgThe build rules that regenerate the Autoconf and Automake output files as
15401debfc3dSmrgwell as the GCC master message catalog @file{gcc.pot} are normally
15411debfc3dSmrgdisabled.  This is because it can only be rebuilt if the complete source
15421debfc3dSmrgtree is present.  If you have changed the sources and want to rebuild the
15431debfc3dSmrgcatalog, configuring with @option{--enable-maintainer-mode} will enable
15441debfc3dSmrgthis.  Note that you need a recent version of the @code{gettext} tools
15451debfc3dSmrgto do so.
15461debfc3dSmrg
15471debfc3dSmrg@item --disable-bootstrap
15481debfc3dSmrgFor a native build, the default configuration is to perform
15491debfc3dSmrga 3-stage bootstrap of the compiler when @samp{make} is invoked,
15501debfc3dSmrgtesting that GCC can compile itself correctly.  If you want to disable
15511debfc3dSmrgthis process, you can configure with @option{--disable-bootstrap}.
15521debfc3dSmrg
15531debfc3dSmrg@item --enable-bootstrap
15541debfc3dSmrgIn special cases, you may want to perform a 3-stage build
15551debfc3dSmrgeven if the target and host triplets are different.
15561debfc3dSmrgThis is possible when the host can run code compiled for
15571debfc3dSmrgthe target (e.g.@: host is i686-linux, target is i486-linux).
15581debfc3dSmrgStarting from GCC 4.2, to do this you have to configure explicitly
15591debfc3dSmrgwith @option{--enable-bootstrap}.
15601debfc3dSmrg
15611debfc3dSmrg@item --enable-generated-files-in-srcdir
15621debfc3dSmrgNeither the .c and .h files that are generated from Bison and flex nor the
15631debfc3dSmrginfo manuals and man pages that are built from the .texi files are present
1564a2dc1f3fSmrgin the repository development tree.  When building GCC from that development tree,
15651debfc3dSmrgor from one of our snapshots, those generated files are placed in your
15661debfc3dSmrgbuild directory, which allows for the source to be in a readonly
15671debfc3dSmrgdirectory.
15681debfc3dSmrg
15691debfc3dSmrgIf you configure with @option{--enable-generated-files-in-srcdir} then those
15701debfc3dSmrggenerated files will go into the source directory.  This is mainly intended
15711debfc3dSmrgfor generating release or prerelease tarballs of the GCC sources, since it
15721debfc3dSmrgis not a requirement that the users of source releases to have flex, Bison,
15731debfc3dSmrgor makeinfo.
15741debfc3dSmrg
15751debfc3dSmrg@item --enable-version-specific-runtime-libs
15761debfc3dSmrgSpecify
15771debfc3dSmrgthat runtime libraries should be installed in the compiler specific
15781debfc3dSmrgsubdirectory (@file{@var{libdir}/gcc}) rather than the usual places.  In
15791debfc3dSmrgaddition, @samp{libstdc++}'s include files will be installed into
15801debfc3dSmrg@file{@var{libdir}} unless you overruled it by using
15811debfc3dSmrg@option{--with-gxx-include-dir=@var{dirname}}.  Using this option is
15821debfc3dSmrgparticularly useful if you intend to use several versions of GCC in
1583*8feb0f0bSmrgparallel.  The default is @samp{yes} for @samp{libada}, and @samp{no} for
1584*8feb0f0bSmrgthe remaining libraries.
15851debfc3dSmrg
15861debfc3dSmrg@item @anchor{WithAixSoname}--with-aix-soname=@samp{aix}, @samp{svr4} or @samp{both}
15871debfc3dSmrgTraditional AIX shared library versioning (versioned @code{Shared Object}
15881debfc3dSmrgfiles as members of unversioned @code{Archive Library} files named
15891debfc3dSmrg@samp{lib.a}) causes numerous headaches for package managers. However,
15901debfc3dSmrg@code{Import Files} as members of @code{Archive Library} files allow for
15911debfc3dSmrg@strong{filename-based versioning} of shared libraries as seen on Linux/SVR4,
15921debfc3dSmrgwhere this is called the "SONAME". But as they prevent static linking,
15931debfc3dSmrg@code{Import Files} may be used with @code{Runtime Linking} only, where the
15941debfc3dSmrglinker does search for @samp{libNAME.so} before @samp{libNAME.a} library
15951debfc3dSmrgfilenames with the @samp{-lNAME} linker flag.
15961debfc3dSmrg
15971debfc3dSmrg@anchor{AixLdCommand}For detailed information please refer to the AIX
15981debfc3dSmrg@uref{https://www.ibm.com/support/knowledgecenter/search/%22the%20ld%20command%2C%20also%20called%20the%20linkage%20editor%20or%20binder%22,,ld
15991debfc3dSmrgCommand} reference.
16001debfc3dSmrg
16011debfc3dSmrgAs long as shared library creation is enabled, upon:
16021debfc3dSmrg@table @code
16031debfc3dSmrg@item --with-aix-soname=aix
16041debfc3dSmrg@item --with-aix-soname=both
16051debfc3dSmrg A (traditional AIX) @code{Shared Archive Library} file is created:
16061debfc3dSmrg @itemize @bullet
16071debfc3dSmrg  @item using the @samp{libNAME.a} filename scheme
16081debfc3dSmrg  @item with the @code{Shared Object} file as archive member named
16091debfc3dSmrg  @samp{libNAME.so.V} (except for @samp{libgcc_s}, where the @code{Shared
16101debfc3dSmrg  Object} file is named @samp{shr.o} for backwards compatibility), which
16111debfc3dSmrg  @itemize @minus
16121debfc3dSmrg   @item is used for runtime loading from inside the @samp{libNAME.a} file
16131debfc3dSmrg   @item is used for dynamic loading via
16141debfc3dSmrg   @code{dlopen("libNAME.a(libNAME.so.V)", RTLD_MEMBER)}
16151debfc3dSmrg   @item is used for shared linking
16161debfc3dSmrg   @item is used for static linking, so no separate @code{Static Archive
16171debfc3dSmrg   Library} file is needed
16181debfc3dSmrg  @end itemize
16191debfc3dSmrg @end itemize
16201debfc3dSmrg@item --with-aix-soname=both
16211debfc3dSmrg@item --with-aix-soname=svr4
16221debfc3dSmrg A (second) @code{Shared Archive Library} file is created:
16231debfc3dSmrg @itemize @bullet
16241debfc3dSmrg @item using the @samp{libNAME.so.V} filename scheme
16251debfc3dSmrg @item with the @code{Shared Object} file as archive member named
16261debfc3dSmrg @samp{shr.o}, which
16271debfc3dSmrg  @itemize @minus
16281debfc3dSmrg   @item is created with the @code{-G linker flag}
16291debfc3dSmrg   @item has the @code{F_LOADONLY} flag set
16301debfc3dSmrg   @item is used for runtime loading from inside the @samp{libNAME.so.V} file
16311debfc3dSmrg   @item is used for dynamic loading via @code{dlopen("libNAME.so.V(shr.o)",
16321debfc3dSmrg   RTLD_MEMBER)}
16331debfc3dSmrg  @end itemize
16341debfc3dSmrg @item with the @code{Import File} as archive member named @samp{shr.imp},
16351debfc3dSmrg which
16361debfc3dSmrg  @itemize @minus
16371debfc3dSmrg   @item refers to @samp{libNAME.so.V(shr.o)} as the "SONAME", to be recorded
16381debfc3dSmrg   in the @code{Loader Section} of subsequent binaries
16391debfc3dSmrg   @item indicates whether @samp{libNAME.so.V(shr.o)} is 32 or 64 bit
16401debfc3dSmrg   @item lists all the public symbols exported by @samp{lib.so.V(shr.o)},
16411debfc3dSmrg   eventually decorated with the @code{@samp{weak} Keyword}
16421debfc3dSmrg   @item is necessary for shared linking against @samp{lib.so.V(shr.o)}
16431debfc3dSmrg   @end itemize
16441debfc3dSmrg  @end itemize
16451debfc3dSmrg  A symbolic link using the @samp{libNAME.so} filename scheme is created:
16461debfc3dSmrg  @itemize @bullet
16471debfc3dSmrg  @item pointing to the @samp{libNAME.so.V} @code{Shared Archive Library} file
16481debfc3dSmrg  @item to permit the @code{ld Command} to find @samp{lib.so.V(shr.imp)} via
16491debfc3dSmrg  the @samp{-lNAME} argument (requires @code{Runtime Linking} to be enabled)
16501debfc3dSmrg  @item to permit dynamic loading of @samp{lib.so.V(shr.o)} without the need
16511debfc3dSmrg  to specify the version number via @code{dlopen("libNAME.so(shr.o)",
16521debfc3dSmrg  RTLD_MEMBER)}
16531debfc3dSmrg  @end itemize
16541debfc3dSmrg@end table
16551debfc3dSmrg
16561debfc3dSmrgAs long as static library creation is enabled, upon:
16571debfc3dSmrg@table @code
16581debfc3dSmrg@item --with-aix-soname=svr4
16591debfc3dSmrg A @code{Static Archive Library} is created:
16601debfc3dSmrg @itemize @bullet
16611debfc3dSmrg @item using the @samp{libNAME.a} filename scheme
16621debfc3dSmrg @item with all the @code{Static Object} files as archive members, which
16631debfc3dSmrg  @itemize @minus
16641debfc3dSmrg   @item are used for static linking
16651debfc3dSmrg  @end itemize
16661debfc3dSmrg @end itemize
16671debfc3dSmrg@end table
16681debfc3dSmrg
16691debfc3dSmrgWhile the aix-soname=@samp{svr4} option does not create @code{Shared Object}
16701debfc3dSmrgfiles as members of unversioned @code{Archive Library} files any more, package
16711debfc3dSmrgmanagers still are responsible to
16721debfc3dSmrg@uref{./specific.html#TransferAixShobj,,transfer} @code{Shared Object} files
16731debfc3dSmrgfound as member of a previously installed unversioned @code{Archive Library}
16741debfc3dSmrgfile into the newly installed @code{Archive Library} file with the same
16751debfc3dSmrgfilename.
16761debfc3dSmrg
16771debfc3dSmrg@emph{WARNING:} Creating @code{Shared Object} files with @code{Runtime Linking}
16781debfc3dSmrgenabled may bloat the TOC, eventually leading to @code{TOC overflow} errors,
16791debfc3dSmrgrequiring the use of either the @option{-Wl,-bbigtoc} linker flag (seen to
16801debfc3dSmrgbreak with the @code{GDB} debugger) or some of the TOC-related compiler flags,
16811debfc3dSmrg@ifnothtml
16821debfc3dSmrg@xref{RS/6000 and PowerPC Options,, RS/6000 and PowerPC Options, gcc,
16831debfc3dSmrgUsing the GNU Compiler Collection (GCC)}.
16841debfc3dSmrg@end ifnothtml
16851debfc3dSmrg@ifhtml
16861debfc3dSmrgsee ``RS/6000 and PowerPC Options'' in the main manual.
16871debfc3dSmrg@end ifhtml
16881debfc3dSmrg
16891debfc3dSmrg@option{--with-aix-soname} is currently supported by @samp{libgcc_s} only, so
16901debfc3dSmrgthis option is still experimental and not for normal use yet.
16911debfc3dSmrg
16921debfc3dSmrgDefault is the traditional behavior @option{--with-aix-soname=@samp{aix}}.
16931debfc3dSmrg
16941debfc3dSmrg@item --enable-languages=@var{lang1},@var{lang2},@dots{}
16951debfc3dSmrgSpecify that only a particular subset of compilers and
16961debfc3dSmrgtheir runtime libraries should be built.  For a list of valid values for
16971debfc3dSmrg@var{langN} you can issue the following command in the
16981debfc3dSmrg@file{gcc} directory of your GCC source tree:@*
16991debfc3dSmrg@smallexample
17001debfc3dSmrggrep ^language= */config-lang.in
17011debfc3dSmrg@end smallexample
17021debfc3dSmrgCurrently, you can use any of the following:
1703c0a68be4Smrg@code{all}, @code{default}, @code{ada}, @code{c}, @code{c++}, @code{d},
1704c0a68be4Smrg@code{fortran}, @code{go}, @code{jit}, @code{lto}, @code{objc}, @code{obj-c++}.
17051debfc3dSmrgBuilding the Ada compiler has special requirements, see below.
1706a2dc1f3fSmrgIf you do not pass this flag, or specify the option @code{default}, then the
17071debfc3dSmrgdefault languages available in the @file{gcc} sub-tree will be configured.
1708c0a68be4SmrgAda, D, Go, Jit, and Objective-C++ are not default languages.  LTO is not a
17091debfc3dSmrgdefault language, but is built by default because @option{--enable-lto} is
1710a2dc1f3fSmrgenabled by default.  The other languages are default languages.  If
1711a2dc1f3fSmrg@code{all} is specified, then all available languages are built.  An
1712a2dc1f3fSmrgexception is @code{jit} language, which requires
1713a2dc1f3fSmrg@option{--enable-host-shared} to be included with @code{all}.
17141debfc3dSmrg
17151debfc3dSmrg@item --enable-stage1-languages=@var{lang1},@var{lang2},@dots{}
17161debfc3dSmrgSpecify that a particular subset of compilers and their runtime
17171debfc3dSmrglibraries should be built with the system C compiler during stage 1 of
17181debfc3dSmrgthe bootstrap process, rather than only in later stages with the
17191debfc3dSmrgbootstrapped C compiler.  The list of valid values is the same as for
17201debfc3dSmrg@option{--enable-languages}, and the option @code{all} will select all
17211debfc3dSmrgof the languages enabled by @option{--enable-languages}.  This option is
17221debfc3dSmrgprimarily useful for GCC development; for instance, when a development
17231debfc3dSmrgversion of the compiler cannot bootstrap due to compiler bugs, or when
17241debfc3dSmrgone is debugging front ends other than the C front end.  When this
17251debfc3dSmrgoption is used, one can then build the target libraries for the
17261debfc3dSmrgspecified languages with the stage-1 compiler by using @command{make
17271debfc3dSmrgstage1-bubble all-target}, or run the testsuite on the stage-1 compiler
17281debfc3dSmrgfor the specified languages using @command{make stage1-start check-gcc}.
17291debfc3dSmrg
17301debfc3dSmrg@item --disable-libada
17311debfc3dSmrgSpecify that the run-time libraries and tools used by GNAT should not
17321debfc3dSmrgbe built.  This can be useful for debugging, or for compatibility with
17331debfc3dSmrgprevious Ada build procedures, when it was required to explicitly
17341debfc3dSmrgdo a @samp{make -C gcc gnatlib_and_tools}.
17351debfc3dSmrg
17361debfc3dSmrg@item --disable-libsanitizer
17371debfc3dSmrgSpecify that the run-time libraries for the various sanitizers should
17381debfc3dSmrgnot be built.
17391debfc3dSmrg
17401debfc3dSmrg@item --disable-libssp
17411debfc3dSmrgSpecify that the run-time libraries for stack smashing protection
1742a2dc1f3fSmrgshould not be built or linked against.  On many targets library support
1743a2dc1f3fSmrgis provided by the C library instead.
17441debfc3dSmrg
17451debfc3dSmrg@item --disable-libquadmath
17461debfc3dSmrgSpecify that the GCC quad-precision math library should not be built.
17471debfc3dSmrgOn some systems, the library is required to be linkable when building
17481debfc3dSmrgthe Fortran front end, unless @option{--disable-libquadmath-support}
17491debfc3dSmrgis used.
17501debfc3dSmrg
17511debfc3dSmrg@item --disable-libquadmath-support
17521debfc3dSmrgSpecify that the Fortran front end and @code{libgfortran} do not add
17531debfc3dSmrgsupport for @code{libquadmath} on systems supporting it.
17541debfc3dSmrg
17551debfc3dSmrg@item --disable-libgomp
17561debfc3dSmrgSpecify that the GNU Offloading and Multi Processing Runtime Library
17571debfc3dSmrgshould not be built.
17581debfc3dSmrg
17591debfc3dSmrg@item --disable-libvtv
17601debfc3dSmrgSpecify that the run-time libraries used by vtable verification
17611debfc3dSmrgshould not be built.
17621debfc3dSmrg
17631debfc3dSmrg@item --with-dwarf2
17641debfc3dSmrgSpecify that the compiler should
17651debfc3dSmrguse DWARF 2 debugging information as the default.
17661debfc3dSmrg
17671debfc3dSmrg@item --with-advance-toolchain=@var{at}
17681debfc3dSmrgOn 64-bit PowerPC Linux systems, configure the compiler to use the
17691debfc3dSmrgheader files, library files, and the dynamic linker from the Advance
17701debfc3dSmrgToolchain release @var{at} instead of the default versions that are
17711debfc3dSmrgprovided by the Linux distribution.  In general, this option is
17721debfc3dSmrgintended for the developers of GCC, and it is not intended for general
17731debfc3dSmrguse.
17741debfc3dSmrg
17751debfc3dSmrg@item --enable-targets=all
17761debfc3dSmrg@itemx --enable-targets=@var{target_list}
17771debfc3dSmrgSome GCC targets, e.g.@: powerpc64-linux, build bi-arch compilers.
17781debfc3dSmrgThese are compilers that are able to generate either 64-bit or 32-bit
17791debfc3dSmrgcode.  Typically, the corresponding 32-bit target, e.g.@:
17801debfc3dSmrgpowerpc-linux for powerpc64-linux, only generates 32-bit code.  This
17811debfc3dSmrgoption enables the 32-bit target to be a bi-arch compiler, which is
17821debfc3dSmrguseful when you want a bi-arch compiler that defaults to 32-bit, and
17831debfc3dSmrgyou are building a bi-arch or multi-arch binutils in a combined tree.
17841debfc3dSmrgOn mips-linux, this will build a tri-arch compiler (ABI o32/n32/64),
17851debfc3dSmrgdefaulted to o32.
17861debfc3dSmrgCurrently, this option only affects sparc-linux, powerpc-linux, x86-linux,
17871debfc3dSmrgmips-linux and s390-linux.
17881debfc3dSmrg
17891debfc3dSmrg@item --enable-default-pie
17901debfc3dSmrgTurn on @option{-fPIE} and @option{-pie} by default.
17911debfc3dSmrg
17921debfc3dSmrg@item --enable-secureplt
17931debfc3dSmrgThis option enables @option{-msecure-plt} by default for powerpc-linux.
17941debfc3dSmrg@ifnothtml
17951debfc3dSmrg@xref{RS/6000 and PowerPC Options,, RS/6000 and PowerPC Options, gcc,
17961debfc3dSmrgUsing the GNU Compiler Collection (GCC)},
17971debfc3dSmrg@end ifnothtml
17981debfc3dSmrg@ifhtml
17991debfc3dSmrgSee ``RS/6000 and PowerPC Options'' in the main manual
18001debfc3dSmrg@end ifhtml
18011debfc3dSmrg
18021debfc3dSmrg@item --enable-default-ssp
18031debfc3dSmrgTurn on @option{-fstack-protector-strong} by default.
18041debfc3dSmrg
18051debfc3dSmrg@item --enable-cld
18061debfc3dSmrgThis option enables @option{-mcld} by default for 32-bit x86 targets.
18071debfc3dSmrg@ifnothtml
18081debfc3dSmrg@xref{i386 and x86-64 Options,, i386 and x86-64 Options, gcc,
18091debfc3dSmrgUsing the GNU Compiler Collection (GCC)},
18101debfc3dSmrg@end ifnothtml
18111debfc3dSmrg@ifhtml
18121debfc3dSmrgSee ``i386 and x86-64 Options'' in the main manual
18131debfc3dSmrg@end ifhtml
18141debfc3dSmrg
1815c0a68be4Smrg@item --enable-large-address-aware
1816c0a68be4SmrgThe @option{--enable-large-address-aware} option arranges for MinGW
1817c0a68be4Smrgexecutables to be linked using the @option{--large-address-aware}
1818c0a68be4Smrgoption, that enables the use of more than 2GB of memory.  If GCC is
1819c0a68be4Smrgconfigured with this option, its effects can be reversed by passing the
1820c0a68be4Smrg@option{-Wl,--disable-large-address-aware} option to the so-configured
1821c0a68be4Smrgcompiler driver.
1822c0a68be4Smrg
18231debfc3dSmrg@item --enable-win32-registry
18241debfc3dSmrg@itemx --enable-win32-registry=@var{key}
18251debfc3dSmrg@itemx --disable-win32-registry
18261debfc3dSmrgThe @option{--enable-win32-registry} option enables Microsoft Windows-hosted GCC
18271debfc3dSmrgto look up installations paths in the registry using the following key:
18281debfc3dSmrg
18291debfc3dSmrg@smallexample
18301debfc3dSmrg@code{HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\@var{key}}
18311debfc3dSmrg@end smallexample
18321debfc3dSmrg
18331debfc3dSmrg@var{key} defaults to GCC version number, and can be overridden by the
18341debfc3dSmrg@option{--enable-win32-registry=@var{key}} option.  Vendors and distributors
18351debfc3dSmrgwho use custom installers are encouraged to provide a different key,
18361debfc3dSmrgperhaps one comprised of vendor name and GCC version number, to
18371debfc3dSmrgavoid conflict with existing installations.  This feature is enabled
18381debfc3dSmrgby default, and can be disabled by @option{--disable-win32-registry}
18391debfc3dSmrgoption.  This option has no effect on the other hosts.
18401debfc3dSmrg
18411debfc3dSmrg@item --nfp
18421debfc3dSmrgSpecify that the machine does not have a floating point unit.  This
18431debfc3dSmrgoption only applies to @samp{m68k-sun-sunos@var{n}}.  On any other
18441debfc3dSmrgsystem, @option{--nfp} has no effect.
18451debfc3dSmrg
18461debfc3dSmrg@item --enable-werror
18471debfc3dSmrg@itemx --disable-werror
18481debfc3dSmrg@itemx --enable-werror=yes
18491debfc3dSmrg@itemx --enable-werror=no
18501debfc3dSmrgWhen you specify this option, it controls whether certain files in the
18511debfc3dSmrgcompiler are built with @option{-Werror} in bootstrap stage2 and later.
18521debfc3dSmrgIf you don't specify it, @option{-Werror} is turned on for the main
18531debfc3dSmrgdevelopment trunk.  However it defaults to off for release branches and
18541debfc3dSmrgfinal releases.  The specific files which get @option{-Werror} are
18551debfc3dSmrgcontrolled by the Makefiles.
18561debfc3dSmrg
18571debfc3dSmrg@item --enable-checking
1858a2dc1f3fSmrg@itemx --disable-checking
18591debfc3dSmrg@itemx --enable-checking=@var{list}
1860a2dc1f3fSmrgThis option controls performing internal consistency checks in the compiler.
1861a2dc1f3fSmrgIt does not change the generated code, but adds error checking of the
1862a2dc1f3fSmrgrequested complexity.  This slows down the compiler and may only work
1863a2dc1f3fSmrgproperly if you are building the compiler with GCC@.
18641debfc3dSmrg
1865a2dc1f3fSmrgWhen the option is not specified, the active set of checks depends on context.
1866a2dc1f3fSmrgNamely, bootstrap stage 1 defaults to @samp{--enable-checking=yes}, builds
1867a2dc1f3fSmrgfrom release branches or release archives default to
1868a2dc1f3fSmrg@samp{--enable-checking=release}, and otherwise
1869a2dc1f3fSmrg@samp{--enable-checking=yes,extra} is used.  When the option is
1870a2dc1f3fSmrgspecified without a @var{list}, the result is the same as
1871a2dc1f3fSmrg@samp{--enable-checking=yes}.  Likewise, @samp{--disable-checking} is
1872a2dc1f3fSmrgequivalent to @samp{--enable-checking=no}.
1873a2dc1f3fSmrg
1874a2dc1f3fSmrgThe categories of checks available in @var{list} are @samp{yes} (most common
1875a2dc1f3fSmrgchecks @samp{assert,misc,gc,gimple,rtlflag,runtime,tree,types}), @samp{no}
1876a2dc1f3fSmrg(no checks at all), @samp{all} (all but @samp{valgrind}), @samp{release}
1877a2dc1f3fSmrg(cheapest checks @samp{assert,runtime}) or @samp{none} (same as @samp{no}).
1878a2dc1f3fSmrg@samp{release} checks are always on and to disable them
1879a2dc1f3fSmrg@samp{--disable-checking} or @samp{--enable-checking=no[,<other checks>]}
1880a2dc1f3fSmrgmust be explicitly requested.  Disabling assertions makes the compiler and
1881a2dc1f3fSmrgruntime slightly faster but increases the risk of undetected internal errors
1882a2dc1f3fSmrgcausing wrong code to be generated.
1883a2dc1f3fSmrg
1884a2dc1f3fSmrgIndividual checks can be enabled with these flags: @samp{assert}, @samp{df},
1885a2dc1f3fSmrg@samp{extra}, @samp{fold}, @samp{gc}, @samp{gcac}, @samp{gimple},
1886a2dc1f3fSmrg@samp{misc}, @samp{rtl}, @samp{rtlflag}, @samp{runtime}, @samp{tree},
1887a2dc1f3fSmrg@samp{types} and @samp{valgrind}.  @samp{extra} extends @samp{misc}
1888a2dc1f3fSmrgchecking with extra checks that might affect code generation and should
1889a2dc1f3fSmrgtherefore not differ between stage1 and later stages in bootstrap.
1890a2dc1f3fSmrg
1891a2dc1f3fSmrgThe @samp{valgrind} check requires the external @command{valgrind} simulator,
1892a2dc1f3fSmrgavailable from @uref{http://valgrind.org/}.  The @samp{rtl} checks are
1893a2dc1f3fSmrgexpensive and the @samp{df}, @samp{gcac} and @samp{valgrind} checks are very
1894a2dc1f3fSmrgexpensive.
18951debfc3dSmrg
18961debfc3dSmrg@item --disable-stage1-checking
18971debfc3dSmrg@itemx --enable-stage1-checking
18981debfc3dSmrg@itemx --enable-stage1-checking=@var{list}
1899a2dc1f3fSmrgThis option affects only bootstrap build.  If no @option{--enable-checking}
1900a2dc1f3fSmrgoption is specified the stage1 compiler is built with @samp{yes} checking
1901a2dc1f3fSmrgenabled, otherwise the stage1 checking flags are the same as specified by
19021debfc3dSmrg@option{--enable-checking}.  To build the stage1 compiler with
19031debfc3dSmrgdifferent checking options use @option{--enable-stage1-checking}.
19041debfc3dSmrgThe list of checking options is the same as for @option{--enable-checking}.
19051debfc3dSmrgIf your system is too slow or too small to bootstrap a released compiler
19061debfc3dSmrgwith checking for stage1 enabled, you can use @samp{--disable-stage1-checking}
19071debfc3dSmrgto disable checking for the stage1 compiler.
19081debfc3dSmrg
19091debfc3dSmrg@item --enable-coverage
19101debfc3dSmrg@itemx --enable-coverage=@var{level}
19111debfc3dSmrgWith this option, the compiler is built to collect self coverage
19121debfc3dSmrginformation, every time it is run.  This is for internal development
19131debfc3dSmrgpurposes, and only works when the compiler is being built with gcc.  The
19141debfc3dSmrg@var{level} argument controls whether the compiler is built optimized or
19151debfc3dSmrgnot, values are @samp{opt} and @samp{noopt}.  For coverage analysis you
19161debfc3dSmrgwant to disable optimization, for performance analysis you want to
19171debfc3dSmrgenable optimization.  When coverage is enabled, the default level is
19181debfc3dSmrgwithout optimization.
19191debfc3dSmrg
19201debfc3dSmrg@item --enable-gather-detailed-mem-stats
19211debfc3dSmrgWhen this option is specified more detailed information on memory
19221debfc3dSmrgallocation is gathered.  This information is printed when using
19231debfc3dSmrg@option{-fmem-report}.
19241debfc3dSmrg
19251debfc3dSmrg@item --enable-valgrind-annotations
19261debfc3dSmrgMark selected memory related operations in the compiler when run under
19271debfc3dSmrgvalgrind to suppress false positives.
19281debfc3dSmrg
19291debfc3dSmrg@item --enable-nls
19301debfc3dSmrg@itemx --disable-nls
19311debfc3dSmrgThe @option{--enable-nls} option enables Native Language Support (NLS),
19321debfc3dSmrgwhich lets GCC output diagnostics in languages other than American
19331debfc3dSmrgEnglish.  Native Language Support is enabled by default if not doing a
19341debfc3dSmrgcanadian cross build.  The @option{--disable-nls} option disables NLS@.
19351debfc3dSmrg
19361debfc3dSmrg@item --with-included-gettext
19371debfc3dSmrgIf NLS is enabled, the @option{--with-included-gettext} option causes the build
19381debfc3dSmrgprocedure to prefer its copy of GNU @command{gettext}.
19391debfc3dSmrg
19401debfc3dSmrg@item --with-catgets
19411debfc3dSmrgIf NLS is enabled, and if the host lacks @code{gettext} but has the
19421debfc3dSmrginferior @code{catgets} interface, the GCC build procedure normally
19431debfc3dSmrgignores @code{catgets} and instead uses GCC's copy of the GNU
19441debfc3dSmrg@code{gettext} library.  The @option{--with-catgets} option causes the
19451debfc3dSmrgbuild procedure to use the host's @code{catgets} in this situation.
19461debfc3dSmrg
19471debfc3dSmrg@item --with-libiconv-prefix=@var{dir}
19481debfc3dSmrgSearch for libiconv header files in @file{@var{dir}/include} and
19491debfc3dSmrglibiconv library files in @file{@var{dir}/lib}.
19501debfc3dSmrg
19511debfc3dSmrg@item --enable-obsolete
19521debfc3dSmrgEnable configuration for an obsoleted system.  If you attempt to
19531debfc3dSmrgconfigure GCC for a system (build, host, or target) which has been
19541debfc3dSmrgobsoleted, and you do not specify this flag, configure will halt with an
19551debfc3dSmrgerror message.
19561debfc3dSmrg
19571debfc3dSmrgAll support for systems which have been obsoleted in one release of GCC
19581debfc3dSmrgis removed entirely in the next major release, unless someone steps
19591debfc3dSmrgforward to maintain the port.
19601debfc3dSmrg
19611debfc3dSmrg@item --enable-decimal-float
19621debfc3dSmrg@itemx --enable-decimal-float=yes
19631debfc3dSmrg@itemx --enable-decimal-float=no
19641debfc3dSmrg@itemx --enable-decimal-float=bid
19651debfc3dSmrg@itemx --enable-decimal-float=dpd
19661debfc3dSmrg@itemx --disable-decimal-float
19671debfc3dSmrgEnable (or disable) support for the C decimal floating point extension
19681debfc3dSmrgthat is in the IEEE 754-2008 standard.  This is enabled by default only
19691debfc3dSmrgon PowerPC, i386, and x86_64 GNU/Linux systems.  Other systems may also
19701debfc3dSmrgsupport it, but require the user to specifically enable it.  You can
19711debfc3dSmrgoptionally control which decimal floating point format is used (either
19721debfc3dSmrg@samp{bid} or @samp{dpd}).  The @samp{bid} (binary integer decimal)
19731debfc3dSmrgformat is default on i386 and x86_64 systems, and the @samp{dpd}
19741debfc3dSmrg(densely packed decimal) format is default on PowerPC systems.
19751debfc3dSmrg
19761debfc3dSmrg@item --enable-fixed-point
19771debfc3dSmrg@itemx --disable-fixed-point
19781debfc3dSmrgEnable (or disable) support for C fixed-point arithmetic.
19791debfc3dSmrgThis option is enabled by default for some targets (such as MIPS) which
19801debfc3dSmrghave hardware-support for fixed-point operations.  On other targets, you
19811debfc3dSmrgmay enable this option manually.
19821debfc3dSmrg
19831debfc3dSmrg@item --with-long-double-128
19841debfc3dSmrgSpecify if @code{long double} type should be 128-bit by default on selected
19851debfc3dSmrgGNU/Linux architectures.  If using @code{--without-long-double-128},
19861debfc3dSmrg@code{long double} will be by default 64-bit, the same as @code{double} type.
19871debfc3dSmrgWhen neither of these configure options are used, the default will be
19881debfc3dSmrg128-bit @code{long double} when built against GNU C Library 2.4 and later,
19891debfc3dSmrg64-bit @code{long double} otherwise.
19901debfc3dSmrg
1991a2dc1f3fSmrg@item --with-long-double-format=ibm
1992a2dc1f3fSmrg@itemx --with-long-double-format=ieee
1993a2dc1f3fSmrgSpecify whether @code{long double} uses the IBM extended double format
1994a2dc1f3fSmrgor the IEEE 128-bit floating point format on PowerPC Linux systems.
1995a2dc1f3fSmrgThis configuration switch will only work on little endian PowerPC
1996a2dc1f3fSmrgLinux systems and on big endian 64-bit systems where the default cpu
1997c0a68be4Smrgis at least power7 (i.e.@: @option{--with-cpu=power7},
1998a2dc1f3fSmrg@option{--with-cpu=power8}, or @option{--with-cpu=power9} is used).
1999a2dc1f3fSmrg
2000a2dc1f3fSmrgIf you use the @option{--with-long-double-64} configuration option,
2001a2dc1f3fSmrgthe @option{--with-long-double-format=ibm} and
2002a2dc1f3fSmrg@option{--with-long-double-format=ieee} options are ignored.
2003a2dc1f3fSmrg
2004a2dc1f3fSmrgThe default @code{long double} format is to use IBM extended double.
2005a2dc1f3fSmrgUntil all of the libraries are converted to use IEEE 128-bit floating
2006a2dc1f3fSmrgpoint, it is not recommended to use
2007a2dc1f3fSmrg@option{--with-long-double-format=ieee}.
2008a2dc1f3fSmrg
2009a2dc1f3fSmrgOn little endian PowerPC Linux systems, if you explicitly set the
2010a2dc1f3fSmrg@code{long double} type, it will build multilibs to allow you to
2011a2dc1f3fSmrgselect either @code{long double} format, unless you disable multilibs
2012a2dc1f3fSmrgwith the @code{--disable-multilib} option.  At present,
2013a2dc1f3fSmrg@code{long double} multilibs are not built on big endian PowerPC Linux
2014a2dc1f3fSmrgsystems.  If you are building multilibs, you will need to configure
2015a2dc1f3fSmrgthe compiler using the @option{--with-system-zlib} option.
2016a2dc1f3fSmrg
2017a2dc1f3fSmrgIf you do not set the @code{long double} type explicitly, no multilibs
2018a2dc1f3fSmrgwill be generated.
2019a2dc1f3fSmrg
20201debfc3dSmrg@item --enable-fdpic
20211debfc3dSmrgOn SH Linux systems, generate ELF FDPIC code.
20221debfc3dSmrg
20231debfc3dSmrg@item --with-gmp=@var{pathname}
20241debfc3dSmrg@itemx --with-gmp-include=@var{pathname}
20251debfc3dSmrg@itemx --with-gmp-lib=@var{pathname}
20261debfc3dSmrg@itemx --with-mpfr=@var{pathname}
20271debfc3dSmrg@itemx --with-mpfr-include=@var{pathname}
20281debfc3dSmrg@itemx --with-mpfr-lib=@var{pathname}
20291debfc3dSmrg@itemx --with-mpc=@var{pathname}
20301debfc3dSmrg@itemx --with-mpc-include=@var{pathname}
20311debfc3dSmrg@itemx --with-mpc-lib=@var{pathname}
20321debfc3dSmrgIf you want to build GCC but do not have the GMP library, the MPFR
20331debfc3dSmrglibrary and/or the MPC library installed in a standard location and
20341debfc3dSmrgdo not have their sources present in the GCC source tree then you
20351debfc3dSmrgcan explicitly specify the directory where they are installed
20361debfc3dSmrg(@samp{--with-gmp=@var{gmpinstalldir}},
20371debfc3dSmrg@samp{--with-mpfr=@/@var{mpfrinstalldir}},
20381debfc3dSmrg@samp{--with-mpc=@/@var{mpcinstalldir}}).  The
20391debfc3dSmrg@option{--with-gmp=@/@var{gmpinstalldir}} option is shorthand for
20401debfc3dSmrg@option{--with-gmp-lib=@/@var{gmpinstalldir}/lib} and
20411debfc3dSmrg@option{--with-gmp-include=@/@var{gmpinstalldir}/include}.  Likewise the
20421debfc3dSmrg@option{--with-mpfr=@/@var{mpfrinstalldir}} option is shorthand for
20431debfc3dSmrg@option{--with-mpfr-lib=@/@var{mpfrinstalldir}/lib} and
20441debfc3dSmrg@option{--with-mpfr-include=@/@var{mpfrinstalldir}/include}, also the
20451debfc3dSmrg@option{--with-mpc=@/@var{mpcinstalldir}} option is shorthand for
20461debfc3dSmrg@option{--with-mpc-lib=@/@var{mpcinstalldir}/lib} and
20471debfc3dSmrg@option{--with-mpc-include=@/@var{mpcinstalldir}/include}.  If these
20481debfc3dSmrgshorthand assumptions are not correct, you can use the explicit
20491debfc3dSmrginclude and lib options directly.  You might also need to ensure the
20501debfc3dSmrgshared libraries can be found by the dynamic linker when building and
20511debfc3dSmrgusing GCC, for example by setting the runtime shared library path
20521debfc3dSmrgvariable (@env{LD_LIBRARY_PATH} on GNU/Linux and Solaris systems).
20531debfc3dSmrg
20541debfc3dSmrgThese flags are applicable to the host platform only.  When building
20551debfc3dSmrga cross compiler, they will not be used to configure target libraries.
20561debfc3dSmrg
20571debfc3dSmrg@item --with-isl=@var{pathname}
20581debfc3dSmrg@itemx --with-isl-include=@var{pathname}
20591debfc3dSmrg@itemx --with-isl-lib=@var{pathname}
20601debfc3dSmrgIf you do not have the isl library installed in a standard location and you
20611debfc3dSmrgwant to build GCC, you can explicitly specify the directory where it is
20621debfc3dSmrginstalled (@samp{--with-isl=@/@var{islinstalldir}}). The
20631debfc3dSmrg@option{--with-isl=@/@var{islinstalldir}} option is shorthand for
20641debfc3dSmrg@option{--with-isl-lib=@/@var{islinstalldir}/lib} and
20651debfc3dSmrg@option{--with-isl-include=@/@var{islinstalldir}/include}. If this
20661debfc3dSmrgshorthand assumption is not correct, you can use the explicit
20671debfc3dSmrginclude and lib options directly.
20681debfc3dSmrg
20691debfc3dSmrgThese flags are applicable to the host platform only.  When building
20701debfc3dSmrga cross compiler, they will not be used to configure target libraries.
20711debfc3dSmrg
20721debfc3dSmrg@item --with-stage1-ldflags=@var{flags}
20731debfc3dSmrgThis option may be used to set linker flags to be used when linking
20741debfc3dSmrgstage 1 of GCC.  These are also used when linking GCC if configured with
20751debfc3dSmrg@option{--disable-bootstrap}.  If @option{--with-stage1-libs} is not set to a
20761debfc3dSmrgvalue, then the default is @samp{-static-libstdc++ -static-libgcc}, if
20771debfc3dSmrgsupported.
20781debfc3dSmrg
20791debfc3dSmrg@item --with-stage1-libs=@var{libs}
20801debfc3dSmrgThis option may be used to set libraries to be used when linking stage 1
20811debfc3dSmrgof GCC.  These are also used when linking GCC if configured with
20821debfc3dSmrg@option{--disable-bootstrap}.
20831debfc3dSmrg
20841debfc3dSmrg@item --with-boot-ldflags=@var{flags}
20851debfc3dSmrgThis option may be used to set linker flags to be used when linking
20861debfc3dSmrgstage 2 and later when bootstrapping GCC.  If --with-boot-libs
20871debfc3dSmrgis not is set to a value, then the default is
20881debfc3dSmrg@samp{-static-libstdc++ -static-libgcc}.
20891debfc3dSmrg
20901debfc3dSmrg@item --with-boot-libs=@var{libs}
20911debfc3dSmrgThis option may be used to set libraries to be used when linking stage 2
20921debfc3dSmrgand later when bootstrapping GCC.
20931debfc3dSmrg
20941debfc3dSmrg@item --with-debug-prefix-map=@var{map}
20951debfc3dSmrgConvert source directory names using @option{-fdebug-prefix-map} when
20961debfc3dSmrgbuilding runtime libraries.  @samp{@var{map}} is a space-separated
20971debfc3dSmrglist of maps of the form @samp{@var{old}=@var{new}}.
20981debfc3dSmrg
20991debfc3dSmrg@item --enable-linker-build-id
21001debfc3dSmrgTells GCC to pass @option{--build-id} option to the linker for all final
21011debfc3dSmrglinks (links performed without the @option{-r} or @option{--relocatable}
21021debfc3dSmrgoption), if the linker supports it.  If you specify
21031debfc3dSmrg@option{--enable-linker-build-id}, but your linker does not
21041debfc3dSmrgsupport @option{--build-id} option, a warning is issued and the
21051debfc3dSmrg@option{--enable-linker-build-id} option is ignored.  The default is off.
21061debfc3dSmrg
21071debfc3dSmrg@item --with-linker-hash-style=@var{choice}
21081debfc3dSmrgTells GCC to pass @option{--hash-style=@var{choice}} option to the
21091debfc3dSmrglinker for all final links. @var{choice} can be one of
21101debfc3dSmrg@samp{sysv}, @samp{gnu}, and @samp{both} where @samp{sysv} is the default.
21111debfc3dSmrg
21121debfc3dSmrg@item --enable-gnu-unique-object
21131debfc3dSmrg@itemx --disable-gnu-unique-object
21141debfc3dSmrgTells GCC to use the gnu_unique_object relocation for C++ template
21151debfc3dSmrgstatic data members and inline function local statics.  Enabled by
21161debfc3dSmrgdefault for a toolchain with an assembler that accepts it and
21171debfc3dSmrgGLIBC 2.11 or above, otherwise disabled.
21181debfc3dSmrg
21191debfc3dSmrg@item --with-diagnostics-color=@var{choice}
21201debfc3dSmrgTells GCC to use @var{choice} as the default for @option{-fdiagnostics-color=}
21211debfc3dSmrgoption (if not used explicitly on the command line).  @var{choice}
21221debfc3dSmrgcan be one of @samp{never}, @samp{auto}, @samp{always}, and @samp{auto-if-env}
2123*8feb0f0bSmrgwhere @samp{auto} is the default.  @samp{auto-if-env} makes
2124*8feb0f0bSmrg@option{-fdiagnostics-color=auto} the default if @env{GCC_COLORS}
2125*8feb0f0bSmrgis present and non-empty in the environment of the compiler, and
21261debfc3dSmrg@option{-fdiagnostics-color=never} otherwise.
21271debfc3dSmrg
2128*8feb0f0bSmrg@item --with-diagnostics-urls=@var{choice}
2129*8feb0f0bSmrgTells GCC to use @var{choice} as the default for @option{-fdiagnostics-urls=}
2130*8feb0f0bSmrgoption (if not used explicitly on the command line).  @var{choice}
2131*8feb0f0bSmrgcan be one of @samp{never}, @samp{auto}, @samp{always}, and @samp{auto-if-env}
2132*8feb0f0bSmrgwhere @samp{auto} is the default.  @samp{auto-if-env} makes
2133*8feb0f0bSmrg@option{-fdiagnostics-urls=auto} the default if @env{GCC_URLS}
2134*8feb0f0bSmrgor @env{TERM_URLS} is present and non-empty in the environment of the
2135*8feb0f0bSmrgcompiler, and @option{-fdiagnostics-urls=never} otherwise.
2136*8feb0f0bSmrg
21371debfc3dSmrg@item --enable-lto
21381debfc3dSmrg@itemx --disable-lto
21391debfc3dSmrgEnable support for link-time optimization (LTO).  This is enabled by
21401debfc3dSmrgdefault, and may be disabled using @option{--disable-lto}.
21411debfc3dSmrg
21421debfc3dSmrg@item --enable-linker-plugin-configure-flags=FLAGS
21431debfc3dSmrg@itemx --enable-linker-plugin-flags=FLAGS
21441debfc3dSmrgBy default, linker plugins (such as the LTO plugin) are built for the
21451debfc3dSmrghost system architecture.  For the case that the linker has a
21461debfc3dSmrgdifferent (but run-time compatible) architecture, these flags can be
21471debfc3dSmrgspecified to build plugins that are compatible to the linker.  For
21481debfc3dSmrgexample, if you are building GCC for a 64-bit x86_64
2149c0a68be4Smrg(@samp{x86_64-pc-linux-gnu}) host system, but have a 32-bit x86
21501debfc3dSmrgGNU/Linux (@samp{i686-pc-linux-gnu}) linker executable (which is
21511debfc3dSmrgexecutable on the former system), you can configure GCC as follows for
21521debfc3dSmrggetting compatible linker plugins:
21531debfc3dSmrg
21541debfc3dSmrg@smallexample
21551debfc3dSmrg% @var{srcdir}/configure \
2156c0a68be4Smrg    --host=x86_64-pc-linux-gnu \
21571debfc3dSmrg    --enable-linker-plugin-configure-flags=--host=i686-pc-linux-gnu \
21581debfc3dSmrg    --enable-linker-plugin-flags='CC=gcc\ -m32\ -Wl,-rpath,[...]/i686-pc-linux-gnu/lib'
21591debfc3dSmrg@end smallexample
21601debfc3dSmrg
21611debfc3dSmrg@item --with-plugin-ld=@var{pathname}
21621debfc3dSmrgEnable an alternate linker to be used at link-time optimization (LTO)
21631debfc3dSmrglink time when @option{-fuse-linker-plugin} is enabled.
21641debfc3dSmrgThis linker should have plugin support such as gold starting with
21651debfc3dSmrgversion 2.20 or GNU ld starting with version 2.21.
21661debfc3dSmrgSee @option{-fuse-linker-plugin} for details.
21671debfc3dSmrg
21681debfc3dSmrg@item --enable-canonical-system-headers
21691debfc3dSmrg@itemx --disable-canonical-system-headers
21701debfc3dSmrgEnable system header path canonicalization for @file{libcpp}.  This can
21711debfc3dSmrgproduce shorter header file paths in diagnostics and dependency output
21721debfc3dSmrgfiles, but these changed header paths may conflict with some compilation
21731debfc3dSmrgenvironments.  Enabled by default, and may be disabled using
21741debfc3dSmrg@option{--disable-canonical-system-headers}.
21751debfc3dSmrg
21761debfc3dSmrg@item --with-glibc-version=@var{major}.@var{minor}
21771debfc3dSmrgTell GCC that when the GNU C Library (glibc) is used on the target it
21781debfc3dSmrgwill be version @var{major}.@var{minor} or later.  Normally this can
21791debfc3dSmrgbe detected from the C library's header files, but this option may be
21801debfc3dSmrgneeded when bootstrapping a cross toolchain without the header files
21811debfc3dSmrgavailable for building the initial bootstrap compiler.
21821debfc3dSmrg
21831debfc3dSmrgIf GCC is configured with some multilibs that use glibc and some that
21841debfc3dSmrgdo not, this option applies only to the multilibs that use glibc.
21851debfc3dSmrgHowever, such configurations may not work well as not all the relevant
21861debfc3dSmrgconfiguration in GCC is on a per-multilib basis.
21871debfc3dSmrg
21881debfc3dSmrg@item --enable-as-accelerator-for=@var{target}
21891debfc3dSmrgBuild as offload target compiler. Specify offload host triple by @var{target}.
21901debfc3dSmrg
21911debfc3dSmrg@item --enable-offload-targets=@var{target1}[=@var{path1}],@dots{},@var{targetN}[=@var{pathN}]
21921debfc3dSmrgEnable offloading to targets @var{target1}, @dots{}, @var{targetN}.
21931debfc3dSmrgOffload compilers are expected to be already installed.  Default search
21941debfc3dSmrgpath for them is @file{@var{exec-prefix}}, but it can be changed by
21951debfc3dSmrgspecifying paths @var{path1}, @dots{}, @var{pathN}.
21961debfc3dSmrg
21971debfc3dSmrg@smallexample
21981debfc3dSmrg% @var{srcdir}/configure \
2199c0a68be4Smrg    --enable-offload-targets=x86_64-intelmicemul-linux-gnu=/path/to/x86_64/compiler,nvptx-none,hsa
22001debfc3dSmrg@end smallexample
22011debfc3dSmrg
22021debfc3dSmrgIf @samp{hsa} is specified as one of the targets, the compiler will be
22031debfc3dSmrgbuilt with support for HSA GPU accelerators.  Because the same
22041debfc3dSmrgcompiler will emit the accelerator code, no path should be specified.
22051debfc3dSmrg
22061debfc3dSmrg@item --with-hsa-runtime=@var{pathname}
22071debfc3dSmrg@itemx --with-hsa-runtime-include=@var{pathname}
22081debfc3dSmrg@itemx --with-hsa-runtime-lib=@var{pathname}
22091debfc3dSmrg
22101debfc3dSmrgIf you configure GCC with HSA offloading but do not have the HSA
22111debfc3dSmrgrun-time library installed in a standard location then you can
22121debfc3dSmrgexplicitly specify the directory where they are installed.  The
22131debfc3dSmrg@option{--with-hsa-runtime=@/@var{hsainstalldir}} option is a
22141debfc3dSmrgshorthand for
22151debfc3dSmrg@option{--with-hsa-runtime-lib=@/@var{hsainstalldir}/lib} and
22161debfc3dSmrg@option{--with-hsa-runtime-include=@/@var{hsainstalldir}/include}.
2217a2dc1f3fSmrg
2218a2dc1f3fSmrg@item --enable-cet
2219a2dc1f3fSmrg@itemx --disable-cet
2220a2dc1f3fSmrgEnable building target run-time libraries with control-flow
2221a2dc1f3fSmrginstrumentation, see @option{-fcf-protection} option.  When
2222a2dc1f3fSmrg@code{--enable-cet} is specified target libraries are configured
2223a2dc1f3fSmrgto add @option{-fcf-protection} and, if needed, other target
2224a2dc1f3fSmrgspecific options to a set of building options.
2225a2dc1f3fSmrg
2226a2dc1f3fSmrgThe option is disabled by default.  When @code{--enable-cet=auto}
2227a2dc1f3fSmrgis used, it is enabled on Linux/x86 if target binutils
2228a2dc1f3fSmrgsupports @code{Intel CET} instructions and disabled otherwise.
2229a2dc1f3fSmrgIn this case the target libraries are configured to get additional
2230a2dc1f3fSmrg@option{-fcf-protection} option.
2231c0a68be4Smrg
2232c0a68be4Smrg@item --with-riscv-attribute=@samp{yes}, @samp{no} or @samp{default}
2233c0a68be4SmrgGenerate RISC-V attribute by default, in order to record extra build
2234c0a68be4Smrginformation in object.
2235c0a68be4Smrg
2236c0a68be4SmrgThe option is disabled by default. It is enabled on RISC-V/ELF (bare-metal)
2237c0a68be4Smrgtarget if target binutils supported.
22381debfc3dSmrg@end table
22391debfc3dSmrg
22401debfc3dSmrg@subheading Cross-Compiler-Specific Options
22411debfc3dSmrgThe following options only apply to building cross compilers.
22421debfc3dSmrg
22431debfc3dSmrg@table @code
2244*8feb0f0bSmrg@item --with-toolexeclibdir=@var{dir}
2245*8feb0f0bSmrgSpecify the installation directory for libraries built with a cross compiler.
2246*8feb0f0bSmrgThe default is @option{$@{gcc_tooldir@}/lib}.
2247*8feb0f0bSmrg
22481debfc3dSmrg@item --with-sysroot
22491debfc3dSmrg@itemx --with-sysroot=@var{dir}
22501debfc3dSmrgTells GCC to consider @var{dir} as the root of a tree that contains
22511debfc3dSmrg(a subset of) the root filesystem of the target operating system.
22521debfc3dSmrgTarget system headers, libraries and run-time object files will be
22531debfc3dSmrgsearched for in there.  More specifically, this acts as if
22541debfc3dSmrg@option{--sysroot=@var{dir}} was added to the default options of the built
22551debfc3dSmrgcompiler.  The specified directory is not copied into the
22561debfc3dSmrginstall tree, unlike the options @option{--with-headers} and
22571debfc3dSmrg@option{--with-libs} that this option obsoletes.  The default value,
22581debfc3dSmrgin case @option{--with-sysroot} is not given an argument, is
22591debfc3dSmrg@option{$@{gcc_tooldir@}/sys-root}.  If the specified directory is a
22601debfc3dSmrgsubdirectory of @option{$@{exec_prefix@}}, then it will be found relative to
22611debfc3dSmrgthe GCC binaries if the installation tree is moved.
22621debfc3dSmrg
22631debfc3dSmrgThis option affects the system root for the compiler used to build
22641debfc3dSmrgtarget libraries (which runs on the build system) and the compiler newly
22651debfc3dSmrginstalled with @code{make install}; it does not affect the compiler which is
22661debfc3dSmrgused to build GCC itself.
22671debfc3dSmrg
22681debfc3dSmrgIf you specify the @option{--with-native-system-header-dir=@var{dirname}}
22691debfc3dSmrgoption then the compiler will search that directory within @var{dirname} for
22701debfc3dSmrgnative system headers rather than the default @file{/usr/include}.
22711debfc3dSmrg
22721debfc3dSmrg@item --with-build-sysroot
22731debfc3dSmrg@itemx --with-build-sysroot=@var{dir}
22741debfc3dSmrgTells GCC to consider @var{dir} as the system root (see
22751debfc3dSmrg@option{--with-sysroot}) while building target libraries, instead of
22761debfc3dSmrgthe directory specified with @option{--with-sysroot}.  This option is
22771debfc3dSmrgonly useful when you are already using @option{--with-sysroot}.  You
22781debfc3dSmrgcan use @option{--with-build-sysroot} when you are configuring with
22791debfc3dSmrg@option{--prefix} set to a directory that is different from the one in
22801debfc3dSmrgwhich you are installing GCC and your target libraries.
22811debfc3dSmrg
22821debfc3dSmrgThis option affects the system root for the compiler used to build
22831debfc3dSmrgtarget libraries (which runs on the build system); it does not affect
22841debfc3dSmrgthe compiler which is used to build GCC itself.
22851debfc3dSmrg
22861debfc3dSmrgIf you specify the @option{--with-native-system-header-dir=@var{dirname}}
22871debfc3dSmrgoption then the compiler will search that directory within @var{dirname} for
22881debfc3dSmrgnative system headers rather than the default @file{/usr/include}.
22891debfc3dSmrg
22901debfc3dSmrg@item --with-headers
22911debfc3dSmrg@itemx --with-headers=@var{dir}
22921debfc3dSmrgDeprecated in favor of @option{--with-sysroot}.
22931debfc3dSmrgSpecifies that target headers are available when building a cross compiler.
22941debfc3dSmrgThe @var{dir} argument specifies a directory which has the target include
22951debfc3dSmrgfiles.  These include files will be copied into the @file{gcc} install
22961debfc3dSmrgdirectory.  @emph{This option with the @var{dir} argument is required} when
22971debfc3dSmrgbuilding a cross compiler, if @file{@var{prefix}/@var{target}/sys-include}
22981debfc3dSmrgdoesn't pre-exist.  If @file{@var{prefix}/@var{target}/sys-include} does
22991debfc3dSmrgpre-exist, the @var{dir} argument may be omitted.  @command{fixincludes}
23001debfc3dSmrgwill be run on these files to make them compatible with GCC@.
23011debfc3dSmrg
23021debfc3dSmrg@item --without-headers
23031debfc3dSmrgTells GCC not use any target headers from a libc when building a cross
23041debfc3dSmrgcompiler.  When crossing to GNU/Linux, you need the headers so GCC
23051debfc3dSmrgcan build the exception handling for libgcc.
23061debfc3dSmrg
23071debfc3dSmrg@item --with-libs
23081debfc3dSmrg@itemx --with-libs="@var{dir1} @var{dir2} @dots{} @var{dirN}"
23091debfc3dSmrgDeprecated in favor of @option{--with-sysroot}.
23101debfc3dSmrgSpecifies a list of directories which contain the target runtime
23111debfc3dSmrglibraries.  These libraries will be copied into the @file{gcc} install
23121debfc3dSmrgdirectory.  If the directory list is omitted, this option has no
23131debfc3dSmrgeffect.
23141debfc3dSmrg
23151debfc3dSmrg@item --with-newlib
23161debfc3dSmrgSpecifies that @samp{newlib} is
23171debfc3dSmrgbeing used as the target C library.  This causes @code{__eprintf} to be
23181debfc3dSmrgomitted from @file{libgcc.a} on the assumption that it will be provided by
23191debfc3dSmrg@samp{newlib}.
23201debfc3dSmrg
2321*8feb0f0bSmrg@html
2322*8feb0f0bSmrg<a name="avr"></a>
2323*8feb0f0bSmrg@end html
23241debfc3dSmrg@item --with-avrlibc
2325*8feb0f0bSmrgOnly supported for the AVR target. Specifies that @samp{AVR-Libc} is
2326*8feb0f0bSmrgbeing used as the target C@tie{} library.  This causes float support
23271debfc3dSmrgfunctions like @code{__addsf3} to be omitted from @file{libgcc.a} on
23281debfc3dSmrgthe assumption that it will be provided by @file{libm.a}.  For more
23291debfc3dSmrgtechnical details, cf. @uref{http://gcc.gnu.org/PR54461,,PR54461}.
2330*8feb0f0bSmrgIt is not supported for
23311debfc3dSmrgRTEMS configurations, which currently use newlib.  The option is
23321debfc3dSmrgsupported since version 4.7.2 and is the default in 4.8.0 and newer.
23331debfc3dSmrg
2334*8feb0f0bSmrg@item --with-double=@{32|64|32,64|64,32@}
2335*8feb0f0bSmrg@itemx --with-long-double=@{32|64|32,64|64,32|double@}
2336*8feb0f0bSmrgOnly supported for the AVR target since version@tie{}10.
2337*8feb0f0bSmrgSpecify the default layout available for the C/C++ @samp{double}
2338*8feb0f0bSmrgand @samp{long double} type, respectively. The following rules apply:
2339*8feb0f0bSmrg@itemize
2340*8feb0f0bSmrg@item
2341*8feb0f0bSmrgThe first value after the @samp{=} specifies the default layout (in bits)
2342*8feb0f0bSmrgof the type and also the default for the @option{-mdouble=} resp.
2343*8feb0f0bSmrg@option{-mlong-double=} compiler option.
2344*8feb0f0bSmrg@item
2345*8feb0f0bSmrgIf more than one value is specified, respective multilib variants are
2346*8feb0f0bSmrgavailable, and  @option{-mdouble=} resp. @option{-mlong-double=} acts
2347*8feb0f0bSmrgas a multilib option.
2348*8feb0f0bSmrg@item
2349*8feb0f0bSmrgIf @option{--with-long-double=double} is specified, @samp{double} and
2350*8feb0f0bSmrg@samp{long double} will have the same layout.
2351*8feb0f0bSmrg@item
2352*8feb0f0bSmrgThe defaults are @option{--with-long-double=64,32} and
2353*8feb0f0bSmrg@option{--with-double=32,64}.  The default @samp{double} layout imposed by
2354*8feb0f0bSmrgthe latter is compatible with older versions of the compiler that implement
2355*8feb0f0bSmrg@samp{double} as a 32-bit type, which does not comply to the language standard.
2356*8feb0f0bSmrg@end itemize
2357*8feb0f0bSmrgNot all combinations of @option{--with-double=} and
2358*8feb0f0bSmrg@option{--with-long-double=} are valid.  For example, the combination
2359*8feb0f0bSmrg@option{--with-double=32,64} @option{--with-long-double=32} will be
2360*8feb0f0bSmrgrejected because the first option specifies the availability of
2361*8feb0f0bSmrgmultilibs for @samp{double}, whereas the second option implies
2362*8feb0f0bSmrgthat @samp{long double} --- and hence also @samp{double} --- is always
2363*8feb0f0bSmrg32@tie{}bits wide.
2364*8feb0f0bSmrg
2365*8feb0f0bSmrg@item --with-double-comparison=@{tristate|bool|libf7@}
2366*8feb0f0bSmrgOnly supported for the AVR target since version@tie{}10.
2367*8feb0f0bSmrgSpecify what result format is returned by library functions that
2368*8feb0f0bSmrgcompare 64-bit floating point values (@code{DFmode}).
2369*8feb0f0bSmrgThe GCC default is @samp{tristate}.  If the floating point
2370*8feb0f0bSmrgimplementation returns a boolean instead, set it to @samp{bool}.
2371*8feb0f0bSmrg
2372*8feb0f0bSmrg@item --with-libf7=@{libgcc|math|math-symbols|no@}
2373*8feb0f0bSmrgOnly supported for the AVR target since version@tie{}10.
2374*8feb0f0bSmrgSpecify to which degree code from LibF7 is included in libgcc.
2375*8feb0f0bSmrgLibF7 is an ad-hoc, AVR-specific, 64-bit floating point emulation
2376*8feb0f0bSmrgwritten in C and (inline) assembly. @samp{libgcc} adds support
2377*8feb0f0bSmrgfor functions that one would usually expect in libgcc like double addition,
2378*8feb0f0bSmrgdouble comparisons and double conversions. @samp{math} also adds routines
2379*8feb0f0bSmrgthat one would expect in @file{libm.a}, but with @code{__} (two underscores)
2380*8feb0f0bSmrgprepended to the symbol names as specified by @file{math.h}.
2381*8feb0f0bSmrg@samp{math-symbols} also defines weak aliases for the functions
2382*8feb0f0bSmrgdeclared in @file{math.h}.  However, @code{--with-libf7} won't
2383*8feb0f0bSmrginstall no @file{math.h} header file whatsoever, this file must come
2384*8feb0f0bSmrgfrom elsewhere.  This option sets @option{--with-double-comparison}
2385*8feb0f0bSmrgto @samp{bool}.
2386*8feb0f0bSmrg
23871debfc3dSmrg@item --with-nds32-lib=@var{library}
23881debfc3dSmrgSpecifies that @var{library} setting is used for building @file{libgcc.a}.
23891debfc3dSmrgCurrently, the valid @var{library} is @samp{newlib} or @samp{mculib}.
23901debfc3dSmrgThis option is only supported for the NDS32 target.
23911debfc3dSmrg
23921debfc3dSmrg@item --with-build-time-tools=@var{dir}
23931debfc3dSmrgSpecifies where to find the set of target tools (assembler, linker, etc.)
23941debfc3dSmrgthat will be used while building GCC itself.  This option can be useful
23951debfc3dSmrgif the directory layouts are different between the system you are building
23961debfc3dSmrgGCC on, and the system where you will deploy it.
23971debfc3dSmrg
23981debfc3dSmrgFor example, on an @samp{ia64-hp-hpux} system, you may have the GNU
23991debfc3dSmrgassembler and linker in @file{/usr/bin}, and the native tools in a
24001debfc3dSmrgdifferent path, and build a toolchain that expects to find the
24011debfc3dSmrgnative tools in @file{/usr/bin}.
24021debfc3dSmrg
24031debfc3dSmrgWhen you use this option, you should ensure that @var{dir} includes
24041debfc3dSmrg@command{ar}, @command{as}, @command{ld}, @command{nm},
24051debfc3dSmrg@command{ranlib} and @command{strip} if necessary, and possibly
24061debfc3dSmrg@command{objdump}.  Otherwise, GCC may use an inconsistent set of
24071debfc3dSmrgtools.
24081debfc3dSmrg@end table
24091debfc3dSmrg
24101debfc3dSmrg@subsubheading Overriding @command{configure} test results
24111debfc3dSmrg
24121debfc3dSmrgSometimes, it might be necessary to override the result of some
24131debfc3dSmrg@command{configure} test, for example in order to ease porting to a new
24141debfc3dSmrgsystem or work around a bug in a test.  The toplevel @command{configure}
24151debfc3dSmrgscript provides three variables for this:
24161debfc3dSmrg
24171debfc3dSmrg@table @code
24181debfc3dSmrg
24191debfc3dSmrg@item build_configargs
24201debfc3dSmrg@cindex @code{build_configargs}
24211debfc3dSmrgThe contents of this variable is passed to all build @command{configure}
24221debfc3dSmrgscripts.
24231debfc3dSmrg
24241debfc3dSmrg@item host_configargs
24251debfc3dSmrg@cindex @code{host_configargs}
24261debfc3dSmrgThe contents of this variable is passed to all host @command{configure}
24271debfc3dSmrgscripts.
24281debfc3dSmrg
24291debfc3dSmrg@item target_configargs
24301debfc3dSmrg@cindex @code{target_configargs}
24311debfc3dSmrgThe contents of this variable is passed to all target @command{configure}
24321debfc3dSmrgscripts.
24331debfc3dSmrg
24341debfc3dSmrg@end table
24351debfc3dSmrg
24361debfc3dSmrgIn order to avoid shell and @command{make} quoting issues for complex
24371debfc3dSmrgoverrides, you can pass a setting for @env{CONFIG_SITE} and set
24381debfc3dSmrgvariables in the site file.
24391debfc3dSmrg
24401debfc3dSmrg@subheading Objective-C-Specific Options
24411debfc3dSmrg
24421debfc3dSmrgThe following options apply to the build of the Objective-C runtime library.
24431debfc3dSmrg
24441debfc3dSmrg@table @code
24451debfc3dSmrg@item --enable-objc-gc
24461debfc3dSmrgSpecify that an additional variant of the GNU Objective-C runtime library
24471debfc3dSmrgis built, using an external build of the Boehm-Demers-Weiser garbage
2448*8feb0f0bSmrgcollector (@uref{https://www.hboehm.info/gc/}).  This library needs to be
24491debfc3dSmrgavailable for each multilib variant, unless configured with
24501debfc3dSmrg@option{--enable-objc-gc=@samp{auto}} in which case the build of the
24511debfc3dSmrgadditional runtime library is skipped when not available and the build
24521debfc3dSmrgcontinues.
24531debfc3dSmrg
24541debfc3dSmrg@item --with-target-bdw-gc=@var{list}
24551debfc3dSmrg@itemx --with-target-bdw-gc-include=@var{list}
24561debfc3dSmrg@itemx --with-target-bdw-gc-lib=@var{list}
24571debfc3dSmrgSpecify search directories for the garbage collector header files and
24581debfc3dSmrglibraries. @var{list} is a comma separated list of key value pairs of the
24591debfc3dSmrgform @samp{@var{multilibdir}=@var{path}}, where the default multilib key
2460c0a68be4Smrgis named as @samp{.} (dot), or is omitted (e.g.@:
24611debfc3dSmrg@samp{--with-target-bdw-gc=/opt/bdw-gc,32=/opt-bdw-gc32}).
24621debfc3dSmrg
24631debfc3dSmrgThe options @option{--with-target-bdw-gc-include} and
24641debfc3dSmrg@option{--with-target-bdw-gc-lib} must always be specified together
24651debfc3dSmrgfor each multilib variant and they take precedence over
24661debfc3dSmrg@option{--with-target-bdw-gc}.  If @option{--with-target-bdw-gc-include}
24671debfc3dSmrgis missing values for a multilib, then the value for the default
2468c0a68be4Smrgmultilib is used (e.g.@: @samp{--with-target-bdw-gc-include=/opt/bdw-gc/include}
24691debfc3dSmrg@samp{--with-target-bdw-gc-lib=/opt/bdw-gc/lib64,32=/opt-bdw-gc/lib32}).
24701debfc3dSmrgIf none of these options are specified, the library is assumed in
24711debfc3dSmrgdefault locations.
24721debfc3dSmrg@end table
24731debfc3dSmrg
2474c0a68be4Smrg@subheading D-Specific Options
2475c0a68be4Smrg
2476c0a68be4SmrgThe following options apply to the build of the D runtime library.
2477c0a68be4Smrg
2478c0a68be4Smrg@table @code
2479*8feb0f0bSmrg@item --enable-libphobos-checking
2480*8feb0f0bSmrg@itemx --disable-libphobos-checking
2481*8feb0f0bSmrg@itemx --enable-libphobos-checking=@var{list}
2482*8feb0f0bSmrgThis option controls whether run-time checks and contracts are compiled into
2483*8feb0f0bSmrgthe D runtime library.  When the option is not specified, the library is built
2484*8feb0f0bSmrgwith @samp{release} checking.  When the option is specified without a
2485*8feb0f0bSmrg@var{list}, the result is the same as @samp{--enable-libphobos-checking=yes}.
2486*8feb0f0bSmrgLikewise, @samp{--disable-libphobos-checking} is equivalent to
2487*8feb0f0bSmrg@samp{--enable-libphobos-checking=no}.
2488*8feb0f0bSmrg
2489*8feb0f0bSmrgThe categories of checks available in @var{list} are @samp{yes} (compiles
2490*8feb0f0bSmrglibphobos with @option{-fno-release}), @samp{no} (compiles libphobos with
2491*8feb0f0bSmrg@option{-frelease}), @samp{all} (same as @samp{yes}), @samp{none} or
2492*8feb0f0bSmrg@samp{release} (same as @samp{no}).
2493*8feb0f0bSmrg
2494*8feb0f0bSmrgIndividual checks available in @var{list} are @samp{assert} (compiles libphobos
2495*8feb0f0bSmrgwith an extra option @option{-fassert}).
2496*8feb0f0bSmrg
2497*8feb0f0bSmrg@item --with-libphobos-druntime-only
2498*8feb0f0bSmrg@itemx --with-libphobos-druntime-only=@var{choice}
2499*8feb0f0bSmrgSpecify whether to build only the core D runtime library (druntime), or both
2500*8feb0f0bSmrgthe core and standard library (phobos) into libphobos.  This is useful for
2501*8feb0f0bSmrgtargets that have full support in druntime, but no or incomplete support
2502*8feb0f0bSmrgin phobos.  @var{choice} can be one of @samp{auto}, @samp{yes}, and @samp{no}
2503*8feb0f0bSmrgwhere @samp{auto} is the default.
2504*8feb0f0bSmrg
2505*8feb0f0bSmrgWhen the option is not specified, the default choice @samp{auto} means that it
2506*8feb0f0bSmrgis inferred whether the target has support for the phobos standard library.
2507*8feb0f0bSmrgWhen the option is specified without a @var{choice},  the result is the same as
2508*8feb0f0bSmrg@samp{--with-libphobos-druntime-only=yes}.
2509*8feb0f0bSmrg
2510c0a68be4Smrg@item --with-target-system-zlib
2511c0a68be4SmrgUse installed @samp{zlib} rather than that included with GCC@.  This needs
2512c0a68be4Smrgto be available for each multilib variant, unless configured with
2513c0a68be4Smrg@option{--with-target-system-zlib=@samp{auto}} in which case the GCC@ included
2514c0a68be4Smrg@samp{zlib} is only used when the system installed library is not available.
2515c0a68be4Smrg@end table
2516c0a68be4Smrg
25171debfc3dSmrg@html
25181debfc3dSmrg<hr />
25191debfc3dSmrg<p>
25201debfc3dSmrg@end html
25211debfc3dSmrg@ifhtml
25221debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
25231debfc3dSmrg@end ifhtml
25241debfc3dSmrg@end ifset
25251debfc3dSmrg
25261debfc3dSmrg@c ***Building****************************************************************
25271debfc3dSmrg@ifnothtml
25281debfc3dSmrg@comment node-name,     next,          previous, up
25291debfc3dSmrg@node    Building, Testing, Configuration, Installing GCC
25301debfc3dSmrg@end ifnothtml
25311debfc3dSmrg@ifset buildhtml
25321debfc3dSmrg@ifnothtml
25331debfc3dSmrg@chapter Building
25341debfc3dSmrg@end ifnothtml
25351debfc3dSmrg@cindex Installing GCC: Building
25361debfc3dSmrg
25371debfc3dSmrgNow that GCC is configured, you are ready to build the compiler and
25381debfc3dSmrgruntime libraries.
25391debfc3dSmrg
25401debfc3dSmrgSome commands executed when making the compiler may fail (return a
25411debfc3dSmrgnonzero status) and be ignored by @command{make}.  These failures, which
25421debfc3dSmrgare often due to files that were not found, are expected, and can safely
25431debfc3dSmrgbe ignored.
25441debfc3dSmrg
25451debfc3dSmrgIt is normal to have compiler warnings when compiling certain files.
25461debfc3dSmrgUnless you are a GCC developer, you can generally ignore these warnings
25471debfc3dSmrgunless they cause compilation to fail.  Developers should attempt to fix
25481debfc3dSmrgany warnings encountered, however they can temporarily continue past
25491debfc3dSmrgwarnings-as-errors by specifying the configure flag
25501debfc3dSmrg@option{--disable-werror}.
25511debfc3dSmrg
25521debfc3dSmrgOn certain old systems, defining certain environment variables such as
25531debfc3dSmrg@env{CC} can interfere with the functioning of @command{make}.
25541debfc3dSmrg
25551debfc3dSmrgIf you encounter seemingly strange errors when trying to build the
25561debfc3dSmrgcompiler in a directory other than the source directory, it could be
25571debfc3dSmrgbecause you have previously configured the compiler in the source
25581debfc3dSmrgdirectory.  Make sure you have done all the necessary preparations.
25591debfc3dSmrg
25601debfc3dSmrgIf you build GCC on a BSD system using a directory stored in an old System
25611debfc3dSmrgV file system, problems may occur in running @command{fixincludes} if the
25621debfc3dSmrgSystem V file system doesn't support symbolic links.  These problems
25631debfc3dSmrgresult in a failure to fix the declaration of @code{size_t} in
25641debfc3dSmrg@file{sys/types.h}.  If you find that @code{size_t} is a signed type and
25651debfc3dSmrgthat type mismatches occur, this could be the cause.
25661debfc3dSmrg
25671debfc3dSmrgThe solution is not to use such a directory for building GCC@.
25681debfc3dSmrg
2569a2dc1f3fSmrgSimilarly, when building from the source repository or snapshots, or if you modify
25701debfc3dSmrg@file{*.l} files, you need the Flex lexical analyzer generator
25711debfc3dSmrginstalled.  If you do not modify @file{*.l} files, releases contain
25721debfc3dSmrgthe Flex-generated files and you do not need Flex installed to build
25731debfc3dSmrgthem.  There is still one Flex-based lexical analyzer (part of the
25741debfc3dSmrgbuild machinery, not of GCC itself) that is used even if you only
25751debfc3dSmrgbuild the C front end.
25761debfc3dSmrg
2577a2dc1f3fSmrgWhen building from the source repository or snapshots, or if you modify Texinfo
25781debfc3dSmrgdocumentation, you need version 4.7 or later of Texinfo installed if you
25791debfc3dSmrgwant Info documentation to be regenerated.  Releases contain Info
25801debfc3dSmrgdocumentation pre-built for the unmodified documentation in the release.
25811debfc3dSmrg
25821debfc3dSmrg@section Building a native compiler
25831debfc3dSmrg
25841debfc3dSmrgFor a native build, the default configuration is to perform
25851debfc3dSmrga 3-stage bootstrap of the compiler when @samp{make} is invoked.
25861debfc3dSmrgThis will build the entire GCC system and ensure that it compiles
25871debfc3dSmrgitself correctly.  It can be disabled with the @option{--disable-bootstrap}
25881debfc3dSmrgparameter to @samp{configure}, but bootstrapping is suggested because
25891debfc3dSmrgthe compiler will be tested more completely and could also have
25901debfc3dSmrgbetter performance.
25911debfc3dSmrg
25921debfc3dSmrgThe bootstrapping process will complete the following steps:
25931debfc3dSmrg
25941debfc3dSmrg@itemize @bullet
25951debfc3dSmrg@item
25961debfc3dSmrgBuild tools necessary to build the compiler.
25971debfc3dSmrg
25981debfc3dSmrg@item
25991debfc3dSmrgPerform a 3-stage bootstrap of the compiler.  This includes building
26001debfc3dSmrgthree times the target tools for use by the compiler such as binutils
26011debfc3dSmrg(bfd, binutils, gas, gprof, ld, and opcodes) if they have been
26021debfc3dSmrgindividually linked or moved into the top level GCC source tree before
26031debfc3dSmrgconfiguring.
26041debfc3dSmrg
26051debfc3dSmrg@item
26061debfc3dSmrgPerform a comparison test of the stage2 and stage3 compilers.
26071debfc3dSmrg
26081debfc3dSmrg@item
26091debfc3dSmrgBuild runtime libraries using the stage3 compiler from the previous step.
26101debfc3dSmrg
26111debfc3dSmrg@end itemize
26121debfc3dSmrg
26131debfc3dSmrgIf you are short on disk space you might consider @samp{make
26141debfc3dSmrgbootstrap-lean} instead.  The sequence of compilation is the
26151debfc3dSmrgsame described above, but object files from the stage1 and
26161debfc3dSmrgstage2 of the 3-stage bootstrap of the compiler are deleted as
26171debfc3dSmrgsoon as they are no longer needed.
26181debfc3dSmrg
26191debfc3dSmrgIf you wish to use non-default GCC flags when compiling the stage2
26201debfc3dSmrgand stage3 compilers, set @code{BOOT_CFLAGS} on the command line when
26211debfc3dSmrgdoing @samp{make}.  For example, if you want to save additional space
26221debfc3dSmrgduring the bootstrap and in the final installation as well, you can
26231debfc3dSmrgbuild the compiler binaries without debugging information as in the
26241debfc3dSmrgfollowing example.  This will save roughly 40% of disk space both for
26251debfc3dSmrgthe bootstrap and the final installation.  (Libraries will still contain
26261debfc3dSmrgdebugging information.)
26271debfc3dSmrg
26281debfc3dSmrg@smallexample
26291debfc3dSmrgmake BOOT_CFLAGS='-O' bootstrap
26301debfc3dSmrg@end smallexample
26311debfc3dSmrg
26321debfc3dSmrgYou can place non-default optimization flags into @code{BOOT_CFLAGS}; they
26331debfc3dSmrgare less well tested here than the default of @samp{-g -O2}, but should
26341debfc3dSmrgstill work.  In a few cases, you may find that you need to specify special
26351debfc3dSmrgflags such as @option{-msoft-float} here to complete the bootstrap; or,
26361debfc3dSmrgif the native compiler miscompiles the stage1 compiler, you may need
26371debfc3dSmrgto work around this, by choosing @code{BOOT_CFLAGS} to avoid the parts
26381debfc3dSmrgof the stage1 compiler that were miscompiled, or by using @samp{make
26391debfc3dSmrgbootstrap4} to increase the number of stages of bootstrap.
26401debfc3dSmrg
26411debfc3dSmrg@code{BOOT_CFLAGS} does not apply to bootstrapped target libraries.
26421debfc3dSmrgSince these are always compiled with the compiler currently being
26431debfc3dSmrgbootstrapped, you can use @code{CFLAGS_FOR_TARGET} to modify their
26441debfc3dSmrgcompilation flags, as for non-bootstrapped target libraries.
26451debfc3dSmrgAgain, if the native compiler miscompiles the stage1 compiler, you may
26461debfc3dSmrgneed to work around this by avoiding non-working parts of the stage1
26471debfc3dSmrgcompiler.  Use @code{STAGE1_TFLAGS} to this end.
26481debfc3dSmrg
26491debfc3dSmrgIf you used the flag @option{--enable-languages=@dots{}} to restrict
26501debfc3dSmrgthe compilers to be built, only those you've actually enabled will be
26511debfc3dSmrgbuilt.  This will of course only build those runtime libraries, for
26521debfc3dSmrgwhich the particular compiler has been built.  Please note,
26531debfc3dSmrgthat re-defining @env{LANGUAGES} when calling @samp{make}
26541debfc3dSmrg@strong{does not} work anymore!
26551debfc3dSmrg
26561debfc3dSmrgIf the comparison of stage2 and stage3 fails, this normally indicates
26571debfc3dSmrgthat the stage2 compiler has compiled GCC incorrectly, and is therefore
26581debfc3dSmrga potentially serious bug which you should investigate and report.  (On
26591debfc3dSmrga few systems, meaningful comparison of object files is impossible; they
26601debfc3dSmrgalways appear ``different''.  If you encounter this problem, you will
26611debfc3dSmrgneed to disable comparison in the @file{Makefile}.)
26621debfc3dSmrg
26631debfc3dSmrgIf you do not want to bootstrap your compiler, you can configure with
26641debfc3dSmrg@option{--disable-bootstrap}.  In particular cases, you may want to
26651debfc3dSmrgbootstrap your compiler even if the target system is not the same as
26661debfc3dSmrgthe one you are building on: for example, you could build a
26671debfc3dSmrg@code{powerpc-unknown-linux-gnu} toolchain on a
26681debfc3dSmrg@code{powerpc64-unknown-linux-gnu} host.  In this case, pass
26691debfc3dSmrg@option{--enable-bootstrap} to the configure script.
26701debfc3dSmrg
26711debfc3dSmrg@code{BUILD_CONFIG} can be used to bring in additional customization
26721debfc3dSmrgto the build.  It can be set to a whitespace-separated list of names.
26731debfc3dSmrgFor each such @code{NAME}, top-level @file{config/@code{NAME}.mk} will
26741debfc3dSmrgbe included by the top-level @file{Makefile}, bringing in any settings
26751debfc3dSmrgit contains.  The default @code{BUILD_CONFIG} can be set using the
26761debfc3dSmrgconfigure option @option{--with-build-config=@code{NAME}...}.  Some
26771debfc3dSmrgexamples of supported build configurations are:
26781debfc3dSmrg
26791debfc3dSmrg@table @asis
26801debfc3dSmrg@item @samp{bootstrap-O1}
26811debfc3dSmrgRemoves any @option{-O}-started option from @code{BOOT_CFLAGS}, and adds
26821debfc3dSmrg@option{-O1} to it.  @samp{BUILD_CONFIG=bootstrap-O1} is equivalent to
26831debfc3dSmrg@samp{BOOT_CFLAGS='-g -O1'}.
26841debfc3dSmrg
26851debfc3dSmrg@item @samp{bootstrap-O3}
2686*8feb0f0bSmrg@itemx @samp{bootstrap-Og}
26871debfc3dSmrgAnalogous to @code{bootstrap-O1}.
26881debfc3dSmrg
26891debfc3dSmrg@item @samp{bootstrap-lto}
26901debfc3dSmrgEnables Link-Time Optimization for host tools during bootstrapping.
26911debfc3dSmrg@samp{BUILD_CONFIG=bootstrap-lto} is equivalent to adding
26921debfc3dSmrg@option{-flto} to @samp{BOOT_CFLAGS}.  This option assumes that the host
2693c0a68be4Smrgsupports the linker plugin (e.g.@: GNU ld version 2.21 or later or GNU gold
26941debfc3dSmrgversion 2.21 or later).
26951debfc3dSmrg
26961debfc3dSmrg@item @samp{bootstrap-lto-noplugin}
26971debfc3dSmrgThis option is similar to @code{bootstrap-lto}, but is intended for
26981debfc3dSmrghosts that do not support the linker plugin.  Without the linker plugin
26991debfc3dSmrgstatic libraries are not compiled with link-time optimizations.  Since
27001debfc3dSmrgthe GCC middle end and back end are in @file{libbackend.a} this means
27011debfc3dSmrgthat only the front end is actually LTO optimized.
27021debfc3dSmrg
2703c0a68be4Smrg@item @samp{bootstrap-lto-lean}
2704c0a68be4SmrgThis option is similar to @code{bootstrap-lto}, but is intended for
2705c0a68be4Smrgfaster build by only using LTO in the final bootstrap stage.
2706c0a68be4SmrgWith @samp{make profiledbootstrap} the LTO frontend
2707c0a68be4Smrgis trained only on generator files.
2708c0a68be4Smrg
27091debfc3dSmrg@item @samp{bootstrap-debug}
27101debfc3dSmrgVerifies that the compiler generates the same executable code, whether
27111debfc3dSmrgor not it is asked to emit debug information.  To this end, this
27121debfc3dSmrgoption builds stage2 host programs without debug information, and uses
27131debfc3dSmrg@file{contrib/compare-debug} to compare them with the stripped stage3
27141debfc3dSmrgobject files.  If @code{BOOT_CFLAGS} is overridden so as to not enable
27151debfc3dSmrgdebug information, stage2 will have it, and stage3 won't.  This option
27161debfc3dSmrgis enabled by default when GCC bootstrapping is enabled, if
27171debfc3dSmrg@code{strip} can turn object files compiled with and without debug
27181debfc3dSmrginfo into identical object files.  In addition to better test
27191debfc3dSmrgcoverage, this option makes default bootstraps faster and leaner.
27201debfc3dSmrg
27211debfc3dSmrg@item @samp{bootstrap-debug-big}
27221debfc3dSmrgRather than comparing stripped object files, as in
27231debfc3dSmrg@code{bootstrap-debug}, this option saves internal compiler dumps
27241debfc3dSmrgduring stage2 and stage3 and compares them as well, which helps catch
27251debfc3dSmrgadditional potential problems, but at a great cost in terms of disk
27261debfc3dSmrgspace.  It can be specified in addition to @samp{bootstrap-debug}.
27271debfc3dSmrg
27281debfc3dSmrg@item @samp{bootstrap-debug-lean}
27291debfc3dSmrgThis option saves disk space compared with @code{bootstrap-debug-big},
27301debfc3dSmrgbut at the expense of some recompilation.  Instead of saving the dumps
27311debfc3dSmrgof stage2 and stage3 until the final compare, it uses
27321debfc3dSmrg@option{-fcompare-debug} to generate, compare and remove the dumps
27331debfc3dSmrgduring stage3, repeating the compilation that already took place in
27341debfc3dSmrgstage2, whose dumps were not saved.
27351debfc3dSmrg
27361debfc3dSmrg@item @samp{bootstrap-debug-lib}
27371debfc3dSmrgThis option tests executable code invariance over debug information
27381debfc3dSmrggeneration on target libraries, just like @code{bootstrap-debug-lean}
27391debfc3dSmrgtests it on host programs.  It builds stage3 libraries with
27401debfc3dSmrg@option{-fcompare-debug}, and it can be used along with any of the
27411debfc3dSmrg@code{bootstrap-debug} options above.
27421debfc3dSmrg
27431debfc3dSmrgThere aren't @code{-lean} or @code{-big} counterparts to this option
27441debfc3dSmrgbecause most libraries are only build in stage3, so bootstrap compares
27451debfc3dSmrgwould not get significant coverage.  Moreover, the few libraries built
27461debfc3dSmrgin stage2 are used in stage3 host programs, so we wouldn't want to
27471debfc3dSmrgcompile stage2 libraries with different options for comparison purposes.
27481debfc3dSmrg
27491debfc3dSmrg@item @samp{bootstrap-debug-ckovw}
27501debfc3dSmrgArranges for error messages to be issued if the compiler built on any
27511debfc3dSmrgstage is run without the option @option{-fcompare-debug}.  This is
27521debfc3dSmrguseful to verify the full @option{-fcompare-debug} testing coverage.  It
27531debfc3dSmrgmust be used along with @code{bootstrap-debug-lean} and
27541debfc3dSmrg@code{bootstrap-debug-lib}.
27551debfc3dSmrg
2756a2dc1f3fSmrg@item @samp{bootstrap-cet}
2757a2dc1f3fSmrgThis option enables Intel CET for host tools during bootstrapping.
2758a2dc1f3fSmrg@samp{BUILD_CONFIG=bootstrap-cet} is equivalent to adding
2759a2dc1f3fSmrg@option{-fcf-protection} to @samp{BOOT_CFLAGS}.  This option
2760c0a68be4Smrgassumes that the host supports Intel CET (e.g.@: GNU assembler version
2761a2dc1f3fSmrg2.30 or later).
2762a2dc1f3fSmrg
27631debfc3dSmrg@item @samp{bootstrap-time}
27641debfc3dSmrgArranges for the run time of each program started by the GCC driver,
27651debfc3dSmrgbuilt in any stage, to be logged to @file{time.log}, in the top level of
27661debfc3dSmrgthe build tree.
27671debfc3dSmrg
2768*8feb0f0bSmrg@item @samp{bootstrap-asan}
2769*8feb0f0bSmrgCompiles GCC itself using Address Sanitization in order to catch invalid memory
2770*8feb0f0bSmrgaccesses within the GCC code.
2771*8feb0f0bSmrg
27721debfc3dSmrg@end table
27731debfc3dSmrg
27741debfc3dSmrg@section Building a cross compiler
27751debfc3dSmrg
27761debfc3dSmrgWhen building a cross compiler, it is not generally possible to do a
27771debfc3dSmrg3-stage bootstrap of the compiler.  This makes for an interesting problem
27781debfc3dSmrgas parts of GCC can only be built with GCC@.
27791debfc3dSmrg
27801debfc3dSmrgTo build a cross compiler, we recommend first building and installing a
27811debfc3dSmrgnative compiler.  You can then use the native GCC compiler to build the
27821debfc3dSmrgcross compiler.  The installed native compiler needs to be GCC version
27831debfc3dSmrg2.95 or later.
27841debfc3dSmrg
27851debfc3dSmrgAssuming you have already installed a native copy of GCC and configured
27861debfc3dSmrgyour cross compiler, issue the command @command{make}, which performs the
27871debfc3dSmrgfollowing steps:
27881debfc3dSmrg
27891debfc3dSmrg@itemize @bullet
27901debfc3dSmrg@item
27911debfc3dSmrgBuild host tools necessary to build the compiler.
27921debfc3dSmrg
27931debfc3dSmrg@item
27941debfc3dSmrgBuild target tools for use by the compiler such as binutils (bfd,
27951debfc3dSmrgbinutils, gas, gprof, ld, and opcodes)
27961debfc3dSmrgif they have been individually linked or moved into the top level GCC source
27971debfc3dSmrgtree before configuring.
27981debfc3dSmrg
27991debfc3dSmrg@item
28001debfc3dSmrgBuild the compiler (single stage only).
28011debfc3dSmrg
28021debfc3dSmrg@item
28031debfc3dSmrgBuild runtime libraries using the compiler from the previous step.
28041debfc3dSmrg@end itemize
28051debfc3dSmrg
28061debfc3dSmrgNote that if an error occurs in any step the make process will exit.
28071debfc3dSmrg
28081debfc3dSmrgIf you are not building GNU binutils in the same source tree as GCC,
28091debfc3dSmrgyou will need a cross-assembler and cross-linker installed before
28101debfc3dSmrgconfiguring GCC@.  Put them in the directory
28111debfc3dSmrg@file{@var{prefix}/@var{target}/bin}.  Here is a table of the tools
28121debfc3dSmrgyou should put in this directory:
28131debfc3dSmrg
28141debfc3dSmrg@table @file
28151debfc3dSmrg@item as
28161debfc3dSmrgThis should be the cross-assembler.
28171debfc3dSmrg
28181debfc3dSmrg@item ld
28191debfc3dSmrgThis should be the cross-linker.
28201debfc3dSmrg
28211debfc3dSmrg@item ar
28221debfc3dSmrgThis should be the cross-archiver: a program which can manipulate
28231debfc3dSmrgarchive files (linker libraries) in the target machine's format.
28241debfc3dSmrg
28251debfc3dSmrg@item ranlib
28261debfc3dSmrgThis should be a program to construct a symbol table in an archive file.
28271debfc3dSmrg@end table
28281debfc3dSmrg
28291debfc3dSmrgThe installation of GCC will find these programs in that directory,
28301debfc3dSmrgand copy or link them to the proper place to for the cross-compiler to
28311debfc3dSmrgfind them when run later.
28321debfc3dSmrg
28331debfc3dSmrgThe easiest way to provide these files is to build the Binutils package.
28341debfc3dSmrgConfigure it with the same @option{--host} and @option{--target}
28351debfc3dSmrgoptions that you use for configuring GCC, then build and install
28361debfc3dSmrgthem.  They install their executables automatically into the proper
28371debfc3dSmrgdirectory.  Alas, they do not support all the targets that GCC
28381debfc3dSmrgsupports.
28391debfc3dSmrg
28401debfc3dSmrgIf you are not building a C library in the same source tree as GCC,
28411debfc3dSmrgyou should also provide the target libraries and headers before
28421debfc3dSmrgconfiguring GCC, specifying the directories with
28431debfc3dSmrg@option{--with-sysroot} or @option{--with-headers} and
28441debfc3dSmrg@option{--with-libs}.  Many targets also require ``start files'' such
28451debfc3dSmrgas @file{crt0.o} and
28461debfc3dSmrg@file{crtn.o} which are linked into each executable.  There may be several
28471debfc3dSmrgalternatives for @file{crt0.o}, for use with profiling or other
28481debfc3dSmrgcompilation options.  Check your target's definition of
28491debfc3dSmrg@code{STARTFILE_SPEC} to find out what start files it uses.
28501debfc3dSmrg
28511debfc3dSmrg@section Building in parallel
28521debfc3dSmrg
28531debfc3dSmrgGNU Make 3.80 and above, which is necessary to build GCC, support
28541debfc3dSmrgbuilding in parallel.  To activate this, you can use @samp{make -j 2}
28551debfc3dSmrginstead of @samp{make}.  You can also specify a bigger number, and
28561debfc3dSmrgin most cases using a value greater than the number of processors in
28571debfc3dSmrgyour machine will result in fewer and shorter I/O latency hits, thus
28581debfc3dSmrgimproving overall throughput; this is especially true for slow drives
28591debfc3dSmrgand network filesystems.
28601debfc3dSmrg
28611debfc3dSmrg@section Building the Ada compiler
28621debfc3dSmrg
2863*8feb0f0bSmrg@ifnothtml
2864*8feb0f0bSmrg@ref{GNAT-prerequisite}.
2865*8feb0f0bSmrg@end ifnothtml
2866*8feb0f0bSmrg@ifhtml
2867*8feb0f0bSmrg@uref{prerequisites.html#GNAT-prerequisite,,GNAT prerequisites}.
2868*8feb0f0bSmrg@end ifhtml
28691debfc3dSmrg
28701debfc3dSmrg@section Building with profile feedback
28711debfc3dSmrg
28721debfc3dSmrgIt is possible to use profile feedback to optimize the compiler itself.  This
28731debfc3dSmrgshould result in a faster compiler binary.  Experiments done on x86 using gcc
28741debfc3dSmrg3.3 showed approximately 7 percent speedup on compiling C programs.  To
28751debfc3dSmrgbootstrap the compiler with profile feedback, use @code{make profiledbootstrap}.
28761debfc3dSmrg
28771debfc3dSmrgWhen @samp{make profiledbootstrap} is run, it will first build a @code{stage1}
28781debfc3dSmrgcompiler.  This compiler is used to build a @code{stageprofile} compiler
28791debfc3dSmrginstrumented to collect execution counts of instruction and branch
2880a2dc1f3fSmrgprobabilities.  Training run is done by building @code{stagetrain}
2881a2dc1f3fSmrgcompiler.  Finally a @code{stagefeedback} compiler is built
2882a2dc1f3fSmrgusing the information collected.
28831debfc3dSmrg
28841debfc3dSmrgUnlike standard bootstrap, several additional restrictions apply.  The
28851debfc3dSmrgcompiler used to build @code{stage1} needs to support a 64-bit integral type.
28861debfc3dSmrgIt is recommended to only use GCC for this.
28871debfc3dSmrg
28881debfc3dSmrgOn Linux/x86_64 hosts with some restrictions (no virtualization) it is
28891debfc3dSmrgalso possible to do autofdo build with @samp{make
28901debfc3dSmrgautoprofiledback}. This uses Linux perf to sample branches in the
28911debfc3dSmrgbinary and then rebuild it with feedback derived from the profile.
28921debfc3dSmrgLinux perf and the @code{autofdo} toolkit needs to be installed for
28931debfc3dSmrgthis.
28941debfc3dSmrg
28951debfc3dSmrgOnly the profile from the current build is used, so when an error
28961debfc3dSmrgoccurs it is recommended to clean before restarting. Otherwise
28971debfc3dSmrgthe code quality may be much worse.
28981debfc3dSmrg
28991debfc3dSmrg@html
29001debfc3dSmrg<hr />
29011debfc3dSmrg<p>
29021debfc3dSmrg@end html
29031debfc3dSmrg@ifhtml
29041debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
29051debfc3dSmrg@end ifhtml
29061debfc3dSmrg@end ifset
29071debfc3dSmrg
29081debfc3dSmrg@c ***Testing*****************************************************************
29091debfc3dSmrg@ifnothtml
29101debfc3dSmrg@comment node-name,     next,          previous, up
29111debfc3dSmrg@node    Testing, Final install, Building, Installing GCC
29121debfc3dSmrg@end ifnothtml
29131debfc3dSmrg@ifset testhtml
29141debfc3dSmrg@ifnothtml
29151debfc3dSmrg@chapter Installing GCC: Testing
29161debfc3dSmrg@end ifnothtml
29171debfc3dSmrg@cindex Testing
29181debfc3dSmrg@cindex Installing GCC: Testing
29191debfc3dSmrg@cindex Testsuite
29201debfc3dSmrg
29211debfc3dSmrgBefore you install GCC, we encourage you to run the testsuites and to
29221debfc3dSmrgcompare your results with results from a similar configuration that have
29231debfc3dSmrgbeen submitted to the
29241debfc3dSmrg@uref{http://gcc.gnu.org/ml/gcc-testresults/,,gcc-testresults mailing list}.
29251debfc3dSmrgSome of these archived results are linked from the build status lists
29261debfc3dSmrgat @uref{http://gcc.gnu.org/buildstat.html}, although not everyone who
29271debfc3dSmrgreports a successful build runs the testsuites and submits the results.
29281debfc3dSmrgThis step is optional and may require you to download additional software,
29291debfc3dSmrgbut it can give you confidence in your new GCC installation or point out
29301debfc3dSmrgproblems before you install and start using your new GCC@.
29311debfc3dSmrg
29321debfc3dSmrgFirst, you must have @uref{download.html,,downloaded the testsuites}.
29331debfc3dSmrgThese are part of the full distribution, but if you downloaded the
29341debfc3dSmrg``core'' compiler plus any front ends, you must download the testsuites
29351debfc3dSmrgseparately.
29361debfc3dSmrg
29371debfc3dSmrgSecond, you must have the testing tools installed.  This includes
29381debfc3dSmrg@uref{http://www.gnu.org/software/dejagnu/,,DejaGnu}, Tcl, and Expect;
29391debfc3dSmrgthe DejaGnu site has links to these. For running the BRIG frontend
29401debfc3dSmrgtests, a tool to assemble the binary BRIGs from HSAIL text,
29411debfc3dSmrg@uref{https://github.com/HSAFoundation/HSAIL-Tools/,,HSAILasm} must
29421debfc3dSmrgbe installed.
29431debfc3dSmrg
29441debfc3dSmrgIf the directories where @command{runtest} and @command{expect} were
29451debfc3dSmrginstalled are not in the @env{PATH}, you may need to set the following
29461debfc3dSmrgenvironment variables appropriately, as in the following example (which
29471debfc3dSmrgassumes that DejaGnu has been installed under @file{/usr/local}):
29481debfc3dSmrg
29491debfc3dSmrg@smallexample
29501debfc3dSmrgTCL_LIBRARY = /usr/local/share/tcl8.0
29511debfc3dSmrgDEJAGNULIBS = /usr/local/share/dejagnu
29521debfc3dSmrg@end smallexample
29531debfc3dSmrg
29541debfc3dSmrg(On systems such as Cygwin, these paths are required to be actual
29551debfc3dSmrgpaths, not mounts or links; presumably this is due to some lack of
29561debfc3dSmrgportability in the DejaGnu code.)
29571debfc3dSmrg
29581debfc3dSmrg
29591debfc3dSmrgFinally, you can run the testsuite (which may take a long time):
29601debfc3dSmrg@smallexample
29611debfc3dSmrgcd @var{objdir}; make -k check
29621debfc3dSmrg@end smallexample
29631debfc3dSmrg
29641debfc3dSmrgThis will test various components of GCC, such as compiler
29651debfc3dSmrgfront ends and runtime libraries.  While running the testsuite, DejaGnu
29661debfc3dSmrgmight emit some harmless messages resembling
29671debfc3dSmrg@samp{WARNING: Couldn't find the global config file.} or
29681debfc3dSmrg@samp{WARNING: Couldn't find tool init file} that can be ignored.
29691debfc3dSmrg
29701debfc3dSmrgIf you are testing a cross-compiler, you may want to run the testsuite
29711debfc3dSmrgon a simulator as described at @uref{http://gcc.gnu.org/simtest-howto.html}.
29721debfc3dSmrg
29731debfc3dSmrg@section How can you run the testsuite on selected tests?
29741debfc3dSmrg
29751debfc3dSmrgIn order to run sets of tests selectively, there are targets
29761debfc3dSmrg@samp{make check-gcc} and language specific @samp{make check-c},
2977c0a68be4Smrg@samp{make check-c++}, @samp{make check-d} @samp{make check-fortran},
29781debfc3dSmrg@samp{make check-ada}, @samp{make check-objc}, @samp{make check-obj-c++},
29791debfc3dSmrg@samp{make check-lto}
29801debfc3dSmrgin the @file{gcc} subdirectory of the object directory.  You can also
29811debfc3dSmrgjust run @samp{make check} in a subdirectory of the object directory.
29821debfc3dSmrg
29831debfc3dSmrg
29841debfc3dSmrgA more selective way to just run all @command{gcc} execute tests in the
29851debfc3dSmrgtestsuite is to use
29861debfc3dSmrg
29871debfc3dSmrg@smallexample
29881debfc3dSmrgmake check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
29891debfc3dSmrg@end smallexample
29901debfc3dSmrg
29911debfc3dSmrgLikewise, in order to run only the @command{g++} ``old-deja'' tests in
29921debfc3dSmrgthe testsuite with filenames matching @samp{9805*}, you would use
29931debfc3dSmrg
29941debfc3dSmrg@smallexample
29951debfc3dSmrgmake check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
29961debfc3dSmrg@end smallexample
29971debfc3dSmrg
2998a2dc1f3fSmrgThe file-matching expression following @var{filename}@command{.exp=} is treated
2999a2dc1f3fSmrgas a series of whitespace-delimited glob expressions so that multiple patterns
3000a2dc1f3fSmrgmay be passed, although any whitespace must either be escaped or surrounded by
3001a2dc1f3fSmrgsingle quotes if multiple expressions are desired. For example,
3002a2dc1f3fSmrg
3003a2dc1f3fSmrg@smallexample
3004a2dc1f3fSmrgmake check-g++ RUNTESTFLAGS="old-deja.exp=9805*\ virtual2.c @var{other-options}"
3005a2dc1f3fSmrgmake check-g++ RUNTESTFLAGS="'old-deja.exp=9805* virtual2.c' @var{other-options}"
3006a2dc1f3fSmrg@end smallexample
3007a2dc1f3fSmrg
30081debfc3dSmrgThe @file{*.exp} files are located in the testsuite directories of the GCC
30091debfc3dSmrgsource, the most important ones being @file{compile.exp},
30101debfc3dSmrg@file{execute.exp}, @file{dg.exp} and @file{old-deja.exp}.
30111debfc3dSmrgTo get a list of the possible @file{*.exp} files, pipe the
30121debfc3dSmrgoutput of @samp{make check} into a file and look at the
30131debfc3dSmrg@samp{Running @dots{}  .exp} lines.
30141debfc3dSmrg
30151debfc3dSmrg@section Passing options and running multiple testsuites
30161debfc3dSmrg
30171debfc3dSmrgYou can pass multiple options to the testsuite using the
30181debfc3dSmrg@samp{--target_board} option of DejaGNU, either passed as part of
30191debfc3dSmrg@samp{RUNTESTFLAGS}, or directly to @command{runtest} if you prefer to
30201debfc3dSmrgwork outside the makefiles.  For example,
30211debfc3dSmrg
30221debfc3dSmrg@smallexample
30231debfc3dSmrgmake check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
30241debfc3dSmrg@end smallexample
30251debfc3dSmrg
30261debfc3dSmrgwill run the standard @command{g++} testsuites (``unix'' is the target name
30271debfc3dSmrgfor a standard native testsuite situation), passing
30281debfc3dSmrg@samp{-O3 -fmerge-constants} to the compiler on every test, i.e.,
30291debfc3dSmrgslashes separate options.
30301debfc3dSmrg
30311debfc3dSmrgYou can run the testsuites multiple times using combinations of options
30321debfc3dSmrgwith a syntax similar to the brace expansion of popular shells:
30331debfc3dSmrg
30341debfc3dSmrg@smallexample
30351debfc3dSmrg@dots{}"--target_board=arm-sim\@{-mhard-float,-msoft-float\@}\@{-O1,-O2,-O3,\@}"
30361debfc3dSmrg@end smallexample
30371debfc3dSmrg
30381debfc3dSmrg(Note the empty option caused by the trailing comma in the final group.)
30391debfc3dSmrgThe following will run each testsuite eight times using the @samp{arm-sim}
30401debfc3dSmrgtarget, as if you had specified all possible combinations yourself:
30411debfc3dSmrg
30421debfc3dSmrg@smallexample
30431debfc3dSmrg--target_board='arm-sim/-mhard-float/-O1 \
30441debfc3dSmrg                arm-sim/-mhard-float/-O2 \
30451debfc3dSmrg                arm-sim/-mhard-float/-O3 \
30461debfc3dSmrg                arm-sim/-mhard-float \
30471debfc3dSmrg                arm-sim/-msoft-float/-O1 \
30481debfc3dSmrg                arm-sim/-msoft-float/-O2 \
30491debfc3dSmrg                arm-sim/-msoft-float/-O3 \
30501debfc3dSmrg                arm-sim/-msoft-float'
30511debfc3dSmrg@end smallexample
30521debfc3dSmrg
30531debfc3dSmrgThey can be combined as many times as you wish, in arbitrary ways.  This
30541debfc3dSmrglist:
30551debfc3dSmrg
30561debfc3dSmrg@smallexample
30571debfc3dSmrg@dots{}"--target_board=unix/-Wextra\@{-O3,-fno-strength\@}\@{-fomit-frame,\@}"
30581debfc3dSmrg@end smallexample
30591debfc3dSmrg
30601debfc3dSmrgwill generate four combinations, all involving @samp{-Wextra}.
30611debfc3dSmrg
30621debfc3dSmrgThe disadvantage to this method is that the testsuites are run in serial,
30631debfc3dSmrgwhich is a waste on multiprocessor systems.  For users with GNU Make and
30641debfc3dSmrga shell which performs brace expansion, you can run the testsuites in
30651debfc3dSmrgparallel by having the shell perform the combinations and @command{make}
30661debfc3dSmrgdo the parallel runs.  Instead of using @samp{--target_board}, use a
30671debfc3dSmrgspecial makefile target:
30681debfc3dSmrg
30691debfc3dSmrg@smallexample
30701debfc3dSmrgmake -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{option2}/@dots{}
30711debfc3dSmrg@end smallexample
30721debfc3dSmrg
30731debfc3dSmrgFor example,
30741debfc3dSmrg
30751debfc3dSmrg@smallexample
30761debfc3dSmrgmake -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
30771debfc3dSmrg@end smallexample
30781debfc3dSmrg
30791debfc3dSmrgwill run three concurrent ``make-gcc'' testsuites, eventually testing all
30801debfc3dSmrgten combinations as described above.  Note that this is currently only
30811debfc3dSmrgsupported in the @file{gcc} subdirectory.  (To see how this works, try
30821debfc3dSmrgtyping @command{echo} before the example given here.)
30831debfc3dSmrg
30841debfc3dSmrg
30851debfc3dSmrg@section How to interpret test results
30861debfc3dSmrg
30871debfc3dSmrgThe result of running the testsuite are various @file{*.sum} and @file{*.log}
30881debfc3dSmrgfiles in the testsuite subdirectories.  The @file{*.log} files contain a
30891debfc3dSmrgdetailed log of the compiler invocations and the corresponding
30901debfc3dSmrgresults, the @file{*.sum} files summarize the results.  These summaries
30911debfc3dSmrgcontain status codes for all tests:
30921debfc3dSmrg
30931debfc3dSmrg@itemize @bullet
30941debfc3dSmrg@item
30951debfc3dSmrgPASS: the test passed as expected
30961debfc3dSmrg@item
30971debfc3dSmrgXPASS: the test unexpectedly passed
30981debfc3dSmrg@item
30991debfc3dSmrgFAIL: the test unexpectedly failed
31001debfc3dSmrg@item
31011debfc3dSmrgXFAIL: the test failed as expected
31021debfc3dSmrg@item
31031debfc3dSmrgUNSUPPORTED: the test is not supported on this platform
31041debfc3dSmrg@item
31051debfc3dSmrgERROR: the testsuite detected an error
31061debfc3dSmrg@item
31071debfc3dSmrgWARNING: the testsuite detected a possible problem
31081debfc3dSmrg@end itemize
31091debfc3dSmrg
31101debfc3dSmrgIt is normal for some tests to report unexpected failures.  At the
31111debfc3dSmrgcurrent time the testing harness does not allow fine grained control
31121debfc3dSmrgover whether or not a test is expected to fail.  This problem should
31131debfc3dSmrgbe fixed in future releases.
31141debfc3dSmrg
31151debfc3dSmrg
31161debfc3dSmrg@section Submitting test results
31171debfc3dSmrg
31181debfc3dSmrgIf you want to report the results to the GCC project, use the
31191debfc3dSmrg@file{contrib/test_summary} shell script.  Start it in the @var{objdir} with
31201debfc3dSmrg
31211debfc3dSmrg@smallexample
31221debfc3dSmrg@var{srcdir}/contrib/test_summary -p your_commentary.txt \
31231debfc3dSmrg    -m gcc-testresults@@gcc.gnu.org |sh
31241debfc3dSmrg@end smallexample
31251debfc3dSmrg
31261debfc3dSmrgThis script uses the @command{Mail} program to send the results, so
31271debfc3dSmrgmake sure it is in your @env{PATH}.  The file @file{your_commentary.txt} is
31281debfc3dSmrgprepended to the testsuite summary and should contain any special
31291debfc3dSmrgremarks you have on your results or your build environment.  Please
31301debfc3dSmrgdo not edit the testsuite result block or the subject line, as these
31311debfc3dSmrgmessages may be automatically processed.
31321debfc3dSmrg
31331debfc3dSmrg@html
31341debfc3dSmrg<hr />
31351debfc3dSmrg<p>
31361debfc3dSmrg@end html
31371debfc3dSmrg@ifhtml
31381debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
31391debfc3dSmrg@end ifhtml
31401debfc3dSmrg@end ifset
31411debfc3dSmrg
31421debfc3dSmrg@c ***Final install***********************************************************
31431debfc3dSmrg@ifnothtml
31441debfc3dSmrg@comment node-name,     next,          previous, up
31451debfc3dSmrg@node    Final install, , Testing, Installing GCC
31461debfc3dSmrg@end ifnothtml
31471debfc3dSmrg@ifset finalinstallhtml
31481debfc3dSmrg@ifnothtml
31491debfc3dSmrg@chapter Installing GCC: Final installation
31501debfc3dSmrg@end ifnothtml
31511debfc3dSmrg
31521debfc3dSmrgNow that GCC has been built (and optionally tested), you can install it with
31531debfc3dSmrg@smallexample
31541debfc3dSmrgcd @var{objdir} && make install
31551debfc3dSmrg@end smallexample
31561debfc3dSmrg
31571debfc3dSmrgWe strongly recommend to install into a target directory where there is
31581debfc3dSmrgno previous version of GCC present.  Also, the GNAT runtime should not
31591debfc3dSmrgbe stripped, as this would break certain features of the debugger that
31601debfc3dSmrgdepend on this debugging information (catching Ada exceptions for
31611debfc3dSmrginstance).
31621debfc3dSmrg
31631debfc3dSmrgThat step completes the installation of GCC; user level binaries can
31641debfc3dSmrgbe found in @file{@var{prefix}/bin} where @var{prefix} is the value
31651debfc3dSmrgyou specified with the @option{--prefix} to configure (or
31661debfc3dSmrg@file{/usr/local} by default).  (If you specified @option{--bindir},
31671debfc3dSmrgthat directory will be used instead; otherwise, if you specified
31681debfc3dSmrg@option{--exec-prefix}, @file{@var{exec-prefix}/bin} will be used.)
31691debfc3dSmrgHeaders for the C++ library are installed in
31701debfc3dSmrg@file{@var{prefix}/include}; libraries in @file{@var{libdir}}
31711debfc3dSmrg(normally @file{@var{prefix}/lib}); internal parts of the compiler in
31721debfc3dSmrg@file{@var{libdir}/gcc} and @file{@var{libexecdir}/gcc}; documentation
31731debfc3dSmrgin info format in @file{@var{infodir}} (normally
31741debfc3dSmrg@file{@var{prefix}/info}).
31751debfc3dSmrg
31761debfc3dSmrgWhen installing cross-compilers, GCC's executables
31771debfc3dSmrgare not only installed into @file{@var{bindir}}, that
31781debfc3dSmrgis, @file{@var{exec-prefix}/bin}, but additionally into
31791debfc3dSmrg@file{@var{exec-prefix}/@var{target-alias}/bin}, if that directory
31801debfc3dSmrgexists.  Typically, such @dfn{tooldirs} hold target-specific
31811debfc3dSmrgbinutils, including assembler and linker.
31821debfc3dSmrg
31831debfc3dSmrgInstallation into a temporary staging area or into a @command{chroot}
31841debfc3dSmrgjail can be achieved with the command
31851debfc3dSmrg
31861debfc3dSmrg@smallexample
31871debfc3dSmrgmake DESTDIR=@var{path-to-rootdir} install
31881debfc3dSmrg@end smallexample
31891debfc3dSmrg
31901debfc3dSmrg@noindent
31911debfc3dSmrgwhere @var{path-to-rootdir} is the absolute path of
31921debfc3dSmrga directory relative to which all installation paths will be
31931debfc3dSmrginterpreted.  Note that the directory specified by @code{DESTDIR}
31941debfc3dSmrgneed not exist yet; it will be created if necessary.
31951debfc3dSmrg
31961debfc3dSmrgThere is a subtle point with tooldirs and @code{DESTDIR}:
31971debfc3dSmrgIf you relocate a cross-compiler installation with
31981debfc3dSmrge.g.@: @samp{DESTDIR=@var{rootdir}}, then the directory
31991debfc3dSmrg@file{@var{rootdir}/@var{exec-prefix}/@var{target-alias}/bin} will
32001debfc3dSmrgbe filled with duplicated GCC executables only if it already exists,
32011debfc3dSmrgit will not be created otherwise.  This is regarded as a feature,
32021debfc3dSmrgnot as a bug, because it gives slightly more control to the packagers
32031debfc3dSmrgusing the @code{DESTDIR} feature.
32041debfc3dSmrg
32051debfc3dSmrgYou can install stripped programs and libraries with
32061debfc3dSmrg
32071debfc3dSmrg@smallexample
32081debfc3dSmrgmake install-strip
32091debfc3dSmrg@end smallexample
32101debfc3dSmrg
32111debfc3dSmrgIf you are bootstrapping a released version of GCC then please
32121debfc3dSmrgquickly review the build status page for your release, available from
32131debfc3dSmrg@uref{http://gcc.gnu.org/buildstat.html}.
32141debfc3dSmrgIf your system is not listed for the version of GCC that you built,
32151debfc3dSmrgsend a note to
32161debfc3dSmrg@email{gcc@@gcc.gnu.org} indicating
32171debfc3dSmrgthat you successfully built and installed GCC@.
32181debfc3dSmrgInclude the following information:
32191debfc3dSmrg
32201debfc3dSmrg@itemize @bullet
32211debfc3dSmrg@item
32221debfc3dSmrgOutput from running @file{@var{srcdir}/config.guess}.  Do not send
32231debfc3dSmrgthat file itself, just the one-line output from running it.
32241debfc3dSmrg
32251debfc3dSmrg@item
32261debfc3dSmrgThe output of @samp{gcc -v} for your newly installed @command{gcc}.
32271debfc3dSmrgThis tells us which version of GCC you built and the options you passed to
32281debfc3dSmrgconfigure.
32291debfc3dSmrg
32301debfc3dSmrg@item
32311debfc3dSmrgWhether you enabled all languages or a subset of them.  If you used a
32321debfc3dSmrgfull distribution then this information is part of the configure
32331debfc3dSmrgoptions in the output of @samp{gcc -v}, but if you downloaded the
32341debfc3dSmrg``core'' compiler plus additional front ends then it isn't apparent
32351debfc3dSmrgwhich ones you built unless you tell us about it.
32361debfc3dSmrg
32371debfc3dSmrg@item
32381debfc3dSmrgIf the build was for GNU/Linux, also include:
32391debfc3dSmrg@itemize @bullet
32401debfc3dSmrg@item
32411debfc3dSmrgThe distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
32421debfc3dSmrgthis information should be available from @file{/etc/issue}.
32431debfc3dSmrg
32441debfc3dSmrg@item
32451debfc3dSmrgThe version of the Linux kernel, available from @samp{uname --version}
32461debfc3dSmrgor @samp{uname -a}.
32471debfc3dSmrg
32481debfc3dSmrg@item
32491debfc3dSmrgThe version of glibc you used; for RPM-based systems like Red Hat,
32501debfc3dSmrgMandrake, and SuSE type @samp{rpm -q glibc} to get the glibc version,
32511debfc3dSmrgand on systems like Debian and Progeny use @samp{dpkg -l libc6}.
32521debfc3dSmrg@end itemize
32531debfc3dSmrgFor other systems, you can include similar information if you think it is
32541debfc3dSmrgrelevant.
32551debfc3dSmrg
32561debfc3dSmrg@item
32571debfc3dSmrgAny other information that you think would be useful to people building
32581debfc3dSmrgGCC on the same configuration.  The new entry in the build status list
32591debfc3dSmrgwill include a link to the archived copy of your message.
32601debfc3dSmrg@end itemize
32611debfc3dSmrg
32621debfc3dSmrgWe'd also like to know if the
32631debfc3dSmrg@ifnothtml
32641debfc3dSmrg@ref{Specific, host/target specific installation notes}
32651debfc3dSmrg@end ifnothtml
32661debfc3dSmrg@ifhtml
32671debfc3dSmrg@uref{specific.html,,host/target specific installation notes}
32681debfc3dSmrg@end ifhtml
32691debfc3dSmrgdidn't include your host/target information or if that information is
32701debfc3dSmrgincomplete or out of date.  Send a note to
32711debfc3dSmrg@email{gcc@@gcc.gnu.org} detailing how the information should be changed.
32721debfc3dSmrg
32731debfc3dSmrgIf you find a bug, please report it following the
32741debfc3dSmrg@uref{../bugs/,,bug reporting guidelines}.
32751debfc3dSmrg
32761debfc3dSmrgIf you want to print the GCC manuals, do @samp{cd @var{objdir}; make
32771debfc3dSmrgdvi}.  You will need to have @command{texi2dvi} (version at least 4.7)
32781debfc3dSmrgand @TeX{} installed.  This creates a number of @file{.dvi} files in
32791debfc3dSmrgsubdirectories of @file{@var{objdir}}; these may be converted for
32801debfc3dSmrgprinting with programs such as @command{dvips}.  Alternately, by using
32811debfc3dSmrg@samp{make pdf} in place of @samp{make dvi}, you can create documentation
32821debfc3dSmrgin the form of @file{.pdf} files; this requires @command{texi2pdf}, which
32831debfc3dSmrgis included with Texinfo version 4.8 and later.  You can also
32841debfc3dSmrg@uref{https://shop.fsf.org/,,buy printed manuals from the
32851debfc3dSmrgFree Software Foundation}, though such manuals may not be for the most
32861debfc3dSmrgrecent version of GCC@.
32871debfc3dSmrg
32881debfc3dSmrgIf you would like to generate online HTML documentation, do @samp{cd
32891debfc3dSmrg@var{objdir}; make html} and HTML will be generated for the gcc manuals in
32901debfc3dSmrg@file{@var{objdir}/gcc/HTML}.
32911debfc3dSmrg
32921debfc3dSmrg@html
32931debfc3dSmrg<hr />
32941debfc3dSmrg<p>
32951debfc3dSmrg@end html
32961debfc3dSmrg@ifhtml
32971debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
32981debfc3dSmrg@end ifhtml
32991debfc3dSmrg@end ifset
33001debfc3dSmrg
33011debfc3dSmrg@c ***Binaries****************************************************************
33021debfc3dSmrg@ifnothtml
33031debfc3dSmrg@comment node-name,     next,          previous, up
33041debfc3dSmrg@node    Binaries, Specific, Installing GCC, Top
33051debfc3dSmrg@end ifnothtml
33061debfc3dSmrg@ifset binarieshtml
33071debfc3dSmrg@ifnothtml
33081debfc3dSmrg@chapter Installing GCC: Binaries
33091debfc3dSmrg@end ifnothtml
33101debfc3dSmrg@cindex Binaries
33111debfc3dSmrg@cindex Installing GCC: Binaries
33121debfc3dSmrg
33131debfc3dSmrgWe are often asked about pre-compiled versions of GCC@.  While we cannot
33141debfc3dSmrgprovide these for all platforms, below you'll find links to binaries for
33151debfc3dSmrgvarious platforms where creating them by yourself is not easy due to various
33161debfc3dSmrgreasons.
33171debfc3dSmrg
33181debfc3dSmrgPlease note that we did not create these binaries, nor do we
33191debfc3dSmrgsupport them.  If you have any problems installing them, please
33201debfc3dSmrgcontact their makers.
33211debfc3dSmrg
33221debfc3dSmrg@itemize
33231debfc3dSmrg@item
33241debfc3dSmrgAIX:
33251debfc3dSmrg@itemize
33261debfc3dSmrg@item
33271debfc3dSmrg@uref{http://www.bullfreeware.com,,Bull's Open Source Software Archive for
3328*8feb0f0bSmrgfor AIX 6 and AIX 7};
33291debfc3dSmrg
33301debfc3dSmrg@item
33311debfc3dSmrg@uref{http://www.perzl.org/aix/,,AIX Open Source Packages (AIX5L AIX 6.1
33321debfc3dSmrgAIX 7.1)}.
33331debfc3dSmrg@end itemize
33341debfc3dSmrg
33351debfc3dSmrg@item
33361debfc3dSmrgDOS---@uref{http://www.delorie.com/djgpp/,,DJGPP}.
33371debfc3dSmrg
33381debfc3dSmrg@item
33391debfc3dSmrgHP-UX:
33401debfc3dSmrg@itemize
33411debfc3dSmrg@item
33421debfc3dSmrg@uref{http://hpux.connect.org.uk/,,HP-UX Porting Center};
33431debfc3dSmrg@end itemize
33441debfc3dSmrg
33451debfc3dSmrg@item
33461debfc3dSmrgSolaris 2 (SPARC, Intel):
33471debfc3dSmrg@itemize
33481debfc3dSmrg@item
33491debfc3dSmrg@uref{https://www.opencsw.org/,,OpenCSW}
33501debfc3dSmrg@end itemize
33511debfc3dSmrg
33521debfc3dSmrg@item
3353a2dc1f3fSmrgmacOS:
3354a2dc1f3fSmrg@itemize
3355a2dc1f3fSmrg@item
3356a2dc1f3fSmrgThe @uref{https://brew.sh,,Homebrew} package manager;
3357a2dc1f3fSmrg@item
3358a2dc1f3fSmrg@uref{https://www.macports.org,,MacPorts}.
3359a2dc1f3fSmrg@end itemize
3360a2dc1f3fSmrg
3361a2dc1f3fSmrg@item
33621debfc3dSmrgMicrosoft Windows:
33631debfc3dSmrg@itemize
33641debfc3dSmrg@item
33651debfc3dSmrgThe @uref{https://sourceware.org/cygwin/,,Cygwin} project;
33661debfc3dSmrg@item
33671debfc3dSmrgThe @uref{http://www.mingw.org/,,MinGW} and
33681debfc3dSmrg@uref{http://mingw-w64.org/doku.php,,mingw-w64} projects.
33691debfc3dSmrg@end itemize
33701debfc3dSmrg
33711debfc3dSmrg@item
33721debfc3dSmrg@uref{http://www.openpkg.org/,,OpenPKG} offers binaries for quite a
33731debfc3dSmrgnumber of platforms.
33741debfc3dSmrg
33751debfc3dSmrg@item
33761debfc3dSmrgThe @uref{http://gcc.gnu.org/wiki/GFortranBinaries,,GFortran Wiki} has
33771debfc3dSmrglinks to GNU Fortran binaries for several platforms.
33781debfc3dSmrg@end itemize
33791debfc3dSmrg
33801debfc3dSmrg@html
33811debfc3dSmrg<hr />
33821debfc3dSmrg<p>
33831debfc3dSmrg@end html
33841debfc3dSmrg@ifhtml
33851debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
33861debfc3dSmrg@end ifhtml
33871debfc3dSmrg@end ifset
33881debfc3dSmrg
33891debfc3dSmrg@c ***Specific****************************************************************
33901debfc3dSmrg@ifnothtml
33911debfc3dSmrg@comment node-name,     next,          previous, up
33921debfc3dSmrg@node    Specific, Old, Binaries, Top
33931debfc3dSmrg@end ifnothtml
33941debfc3dSmrg@ifset specifichtml
33951debfc3dSmrg@ifnothtml
33961debfc3dSmrg@chapter Host/target specific installation notes for GCC
33971debfc3dSmrg@end ifnothtml
33981debfc3dSmrg@cindex Specific
33991debfc3dSmrg@cindex Specific installation notes
34001debfc3dSmrg@cindex Target specific installation
34011debfc3dSmrg@cindex Host specific installation
34021debfc3dSmrg@cindex Target specific installation notes
34031debfc3dSmrg
34041debfc3dSmrgPlease read this document carefully @emph{before} installing the
34051debfc3dSmrgGNU Compiler Collection on your machine.
34061debfc3dSmrg
34071debfc3dSmrgNote that this list of install notes is @emph{not} a list of supported
34081debfc3dSmrghosts or targets.  Not all supported hosts and targets are listed
34091debfc3dSmrghere, only the ones that require host-specific or target-specific
34101debfc3dSmrginformation have to.
34111debfc3dSmrg
34121debfc3dSmrg@ifhtml
34131debfc3dSmrg@itemize
34141debfc3dSmrg@item
34151debfc3dSmrg@uref{#aarch64-x-x,,aarch64*-*-*}
34161debfc3dSmrg@item
34171debfc3dSmrg@uref{#alpha-x-x,,alpha*-*-*}
34181debfc3dSmrg@item
3419*8feb0f0bSmrg@uref{#amd64-x-solaris2,,amd64-*-solaris2*}
34201debfc3dSmrg@item
34211debfc3dSmrg@uref{#arm-x-eabi,,arm-*-eabi}
34221debfc3dSmrg@item
34231debfc3dSmrg@uref{#avr,,avr}
34241debfc3dSmrg@item
34251debfc3dSmrg@uref{#bfin,,Blackfin}
34261debfc3dSmrg@item
34271debfc3dSmrg@uref{#dos,,DOS}
34281debfc3dSmrg@item
34291debfc3dSmrg@uref{#x-x-freebsd,,*-*-freebsd*}
34301debfc3dSmrg@item
34311debfc3dSmrg@uref{#h8300-hms,,h8300-hms}
34321debfc3dSmrg@item
34331debfc3dSmrg@uref{#hppa-hp-hpux,,hppa*-hp-hpux*}
34341debfc3dSmrg@item
34351debfc3dSmrg@uref{#hppa-hp-hpux10,,hppa*-hp-hpux10}
34361debfc3dSmrg@item
34371debfc3dSmrg@uref{#hppa-hp-hpux11,,hppa*-hp-hpux11}
34381debfc3dSmrg@item
34391debfc3dSmrg@uref{#x-x-linux-gnu,,*-*-linux-gnu}
34401debfc3dSmrg@item
34411debfc3dSmrg@uref{#ix86-x-linux,,i?86-*-linux*}
34421debfc3dSmrg@item
3443*8feb0f0bSmrg@uref{#ix86-x-solaris2,,i?86-*-solaris2*}
34441debfc3dSmrg@item
34451debfc3dSmrg@uref{#ia64-x-linux,,ia64-*-linux}
34461debfc3dSmrg@item
34471debfc3dSmrg@uref{#ia64-x-hpux,,ia64-*-hpux*}
34481debfc3dSmrg@item
34491debfc3dSmrg@uref{#x-ibm-aix,,*-ibm-aix*}
34501debfc3dSmrg@item
34511debfc3dSmrg@uref{#iq2000-x-elf,,iq2000-*-elf}
34521debfc3dSmrg@item
34531debfc3dSmrg@uref{#lm32-x-elf,,lm32-*-elf}
34541debfc3dSmrg@item
34551debfc3dSmrg@uref{#lm32-x-uclinux,,lm32-*-uclinux}
34561debfc3dSmrg@item
34571debfc3dSmrg@uref{#m32c-x-elf,,m32c-*-elf}
34581debfc3dSmrg@item
34591debfc3dSmrg@uref{#m32r-x-elf,,m32r-*-elf}
34601debfc3dSmrg@item
34611debfc3dSmrg@uref{#m68k-x-x,,m68k-*-*}
34621debfc3dSmrg@item
34631debfc3dSmrg@uref{#m68k-uclinux,,m68k-uclinux}
34641debfc3dSmrg@item
34651debfc3dSmrg@uref{#microblaze-x-elf,,microblaze-*-elf}
34661debfc3dSmrg@item
34671debfc3dSmrg@uref{#mips-x-x,,mips-*-*}
34681debfc3dSmrg@item
34691debfc3dSmrg@uref{#nds32le-x-elf,,nds32le-*-elf}
34701debfc3dSmrg@item
34711debfc3dSmrg@uref{#nds32be-x-elf,,nds32be-*-elf}
34721debfc3dSmrg@item
34731debfc3dSmrg@uref{#nvptx-x-none,,nvptx-*-none}
34741debfc3dSmrg@item
3475c0a68be4Smrg@uref{#or1k-x-elf,,or1k-*-elf}
3476c0a68be4Smrg@item
3477c0a68be4Smrg@uref{#or1k-x-linux,,or1k-*-linux}
3478c0a68be4Smrg@item
34791debfc3dSmrg@uref{#powerpc-x-x,,powerpc*-*-*}
34801debfc3dSmrg@item
34811debfc3dSmrg@uref{#powerpc-x-darwin,,powerpc-*-darwin*}
34821debfc3dSmrg@item
34831debfc3dSmrg@uref{#powerpc-x-elf,,powerpc-*-elf}
34841debfc3dSmrg@item
34851debfc3dSmrg@uref{#powerpc-x-linux-gnu,,powerpc*-*-linux-gnu*}
34861debfc3dSmrg@item
34871debfc3dSmrg@uref{#powerpc-x-netbsd,,powerpc-*-netbsd*}
34881debfc3dSmrg@item
34891debfc3dSmrg@uref{#powerpc-x-eabisim,,powerpc-*-eabisim}
34901debfc3dSmrg@item
34911debfc3dSmrg@uref{#powerpc-x-eabi,,powerpc-*-eabi}
34921debfc3dSmrg@item
34931debfc3dSmrg@uref{#powerpcle-x-elf,,powerpcle-*-elf}
34941debfc3dSmrg@item
34951debfc3dSmrg@uref{#powerpcle-x-eabisim,,powerpcle-*-eabisim}
34961debfc3dSmrg@item
34971debfc3dSmrg@uref{#powerpcle-x-eabi,,powerpcle-*-eabi}
34981debfc3dSmrg@item
34991debfc3dSmrg@uref{#riscv32-x-elf,,riscv32-*-elf}
35001debfc3dSmrg@item
35011debfc3dSmrg@uref{#riscv32-x-linux,,riscv32-*-linux}
35021debfc3dSmrg@item
35031debfc3dSmrg@uref{#riscv64-x-elf,,riscv64-*-elf}
35041debfc3dSmrg@item
35051debfc3dSmrg@uref{#riscv64-x-linux,,riscv64-*-linux}
35061debfc3dSmrg@item
35071debfc3dSmrg@uref{#s390-x-linux,,s390-*-linux*}
35081debfc3dSmrg@item
35091debfc3dSmrg@uref{#s390x-x-linux,,s390x-*-linux*}
35101debfc3dSmrg@item
35111debfc3dSmrg@uref{#s390x-ibm-tpf,,s390x-ibm-tpf*}
35121debfc3dSmrg@item
35131debfc3dSmrg@uref{#x-x-solaris2,,*-*-solaris2*}
35141debfc3dSmrg@item
35151debfc3dSmrg@uref{#sparc-x-x,,sparc*-*-*}
35161debfc3dSmrg@item
35171debfc3dSmrg@uref{#sparc-sun-solaris2,,sparc-sun-solaris2*}
35181debfc3dSmrg@item
35191debfc3dSmrg@uref{#sparc-x-linux,,sparc-*-linux*}
35201debfc3dSmrg@item
35211debfc3dSmrg@uref{#sparc64-x-solaris2,,sparc64-*-solaris2*}
35221debfc3dSmrg@item
35231debfc3dSmrg@uref{#sparcv9-x-solaris2,,sparcv9-*-solaris2*}
35241debfc3dSmrg@item
35251debfc3dSmrg@uref{#c6x-x-x,,c6x-*-*}
35261debfc3dSmrg@item
35271debfc3dSmrg@uref{#tilegx-x-linux,,tilegx-*-linux*}
35281debfc3dSmrg@item
35291debfc3dSmrg@uref{#tilegxbe-x-linux,,tilegxbe-*-linux*}
35301debfc3dSmrg@item
35311debfc3dSmrg@uref{#tilepro-x-linux,,tilepro-*-linux*}
35321debfc3dSmrg@item
35331debfc3dSmrg@uref{#visium-x-elf, visium-*-elf}
35341debfc3dSmrg@item
35351debfc3dSmrg@uref{#x-x-vxworks,,*-*-vxworks*}
35361debfc3dSmrg@item
35371debfc3dSmrg@uref{#x86-64-x-x,,x86_64-*-*, amd64-*-*}
35381debfc3dSmrg@item
3539*8feb0f0bSmrg@uref{#x86-64-x-solaris2,,x86_64-*-solaris2*}
35401debfc3dSmrg@item
35411debfc3dSmrg@uref{#xtensa-x-elf,,xtensa*-*-elf}
35421debfc3dSmrg@item
35431debfc3dSmrg@uref{#xtensa-x-linux,,xtensa*-*-linux*}
35441debfc3dSmrg@item
35451debfc3dSmrg@uref{#windows,,Microsoft Windows}
35461debfc3dSmrg@item
35471debfc3dSmrg@uref{#x-x-cygwin,,*-*-cygwin}
35481debfc3dSmrg@item
35491debfc3dSmrg@uref{#x-x-mingw32,,*-*-mingw32}
35501debfc3dSmrg@item
35511debfc3dSmrg@uref{#os2,,OS/2}
35521debfc3dSmrg@item
35531debfc3dSmrg@uref{#older,,Older systems}
35541debfc3dSmrg@end itemize
35551debfc3dSmrg
35561debfc3dSmrg@itemize
35571debfc3dSmrg@item
35581debfc3dSmrg@uref{#elf,,all ELF targets} (SVR4, Solaris 2, etc.)
35591debfc3dSmrg@end itemize
35601debfc3dSmrg@end ifhtml
35611debfc3dSmrg
35621debfc3dSmrg
35631debfc3dSmrg@html
35641debfc3dSmrg<!-- -------- host/target specific issues start here ---------------- -->
35651debfc3dSmrg<hr />
35661debfc3dSmrg@end html
35671debfc3dSmrg@anchor{aarch64-x-x}
35681debfc3dSmrg@heading aarch64*-*-*
35691debfc3dSmrgBinutils pre 2.24 does not have support for selecting @option{-mabi} and
35701debfc3dSmrgdoes not support ILP32.  If it is used to build GCC 4.9 or later, GCC will
35711debfc3dSmrgnot support option @option{-mabi=ilp32}.
35721debfc3dSmrg
35731debfc3dSmrgTo enable a workaround for the Cortex-A53 erratum number 835769 by default
35741debfc3dSmrg(for all CPUs regardless of -mcpu option given) at configure time use the
35751debfc3dSmrg@option{--enable-fix-cortex-a53-835769} option.  This will enable the fix by
35761debfc3dSmrgdefault and can be explicitly disabled during compilation by passing the
35771debfc3dSmrg@option{-mno-fix-cortex-a53-835769} option.  Conversely,
35781debfc3dSmrg@option{--disable-fix-cortex-a53-835769} will disable the workaround by
35791debfc3dSmrgdefault.  The workaround is disabled by default if neither of
35801debfc3dSmrg@option{--enable-fix-cortex-a53-835769} or
35811debfc3dSmrg@option{--disable-fix-cortex-a53-835769} is given at configure time.
35821debfc3dSmrg
35831debfc3dSmrgTo enable a workaround for the Cortex-A53 erratum number 843419 by default
35841debfc3dSmrg(for all CPUs regardless of -mcpu option given) at configure time use the
35851debfc3dSmrg@option{--enable-fix-cortex-a53-843419} option.  This workaround is applied at
35861debfc3dSmrglink time.  Enabling the workaround will cause GCC to pass the relevant option
35871debfc3dSmrgto the linker.  It can be explicitly disabled during compilation by passing the
35881debfc3dSmrg@option{-mno-fix-cortex-a53-843419} option.  Conversely,
35891debfc3dSmrg@option{--disable-fix-cortex-a53-843419} will disable the workaround by default.
35901debfc3dSmrgThe workaround is disabled by default if neither of
35911debfc3dSmrg@option{--enable-fix-cortex-a53-843419} or
35921debfc3dSmrg@option{--disable-fix-cortex-a53-843419} is given at configure time.
35931debfc3dSmrg
3594c0a68be4SmrgTo enable Branch Target Identification Mechanism and Return Address Signing by
3595c0a68be4Smrgdefault at configure time use the @option{--enable-standard-branch-protection}
3596c0a68be4Smrgoption.  This is equivalent to having @option{-mbranch-protection=standard}
3597c0a68be4Smrgduring compilation.  This can be explicitly disabled during compilation by
3598c0a68be4Smrgpassing the @option{-mbranch-protection=none} option which turns off all
3599c0a68be4Smrgtypes of branch protections.  Conversely,
3600c0a68be4Smrg@option{--disable-standard-branch-protection} will disable both the
3601c0a68be4Smrgprotections by default.  This mechanism is turned off by default if neither
3602c0a68be4Smrgof the options are given at configure time.
3603c0a68be4Smrg
36041debfc3dSmrg@html
36051debfc3dSmrg<hr />
36061debfc3dSmrg@end html
36071debfc3dSmrg@anchor{alpha-x-x}
36081debfc3dSmrg@heading alpha*-*-*
36091debfc3dSmrgThis section contains general configuration information for all
3610a2dc1f3fSmrgAlpha-based platforms using ELF@.  In addition to reading this
36111debfc3dSmrgsection, please read all other sections that match your target.
36121debfc3dSmrg
3613*8feb0f0bSmrg@html
3614*8feb0f0bSmrg<hr />
3615*8feb0f0bSmrg@end html
3616*8feb0f0bSmrg@anchor{amd64-x-solaris2}
3617*8feb0f0bSmrg@heading amd64-*-solaris2*
3618*8feb0f0bSmrgThis is a synonym for @samp{x86_64-*-solaris2*}.
36191debfc3dSmrg
36201debfc3dSmrg@html
36211debfc3dSmrg<hr />
36221debfc3dSmrg@end html
3623*8feb0f0bSmrg@anchor{amdgcn-x-amdhsa}
3624*8feb0f0bSmrg@heading amdgcn-*-amdhsa
3625c0a68be4SmrgAMD GCN GPU target.
3626c0a68be4Smrg
3627c0a68be4SmrgInstead of GNU Binutils, you will need to install LLVM 6, or later, and copy
3628*8feb0f0bSmrg@file{bin/llvm-mc} to @file{amdgcn-amdhsa/bin/as},
3629*8feb0f0bSmrg@file{bin/lld} to @file{amdgcn-amdhsa/bin/ld},
3630*8feb0f0bSmrg@file{bin/llvm-nm} to @file{amdgcn-amdhsa/bin/nm}, and
3631*8feb0f0bSmrg@file{bin/llvm-ar} to both @file{bin/amdgcn-amdhsa-ar} and
3632*8feb0f0bSmrg@file{bin/amdgcn-amdhsa-ranlib}.
3633c0a68be4Smrg
3634c0a68be4SmrgUse Newlib (2019-01-16, or newer).
3635c0a68be4Smrg
3636c0a68be4SmrgTo run the binaries, install the HSA Runtime from the
3637c0a68be4Smrg@uref{https://rocm.github.io,,ROCm Platform}, and use
3638*8feb0f0bSmrg@file{libexec/gcc/amdhsa-amdhsa/@var{version}/gcn-run} to launch them
3639c0a68be4Smrgon the GPU.
3640c0a68be4Smrg
3641c0a68be4Smrg@html
3642c0a68be4Smrg<hr />
3643c0a68be4Smrg@end html
36441debfc3dSmrg@anchor{arc-x-elf32}
36451debfc3dSmrg@heading arc-*-elf32
36461debfc3dSmrg
36471debfc3dSmrgUse @samp{configure --target=arc-elf32 --with-cpu=@var{cpu} --enable-languages="c,c++"}
36481debfc3dSmrgto configure GCC, with @var{cpu} being one of @samp{arc600}, @samp{arc601},
36491debfc3dSmrgor @samp{arc700}@.
36501debfc3dSmrg
36511debfc3dSmrg@html
36521debfc3dSmrg<hr />
36531debfc3dSmrg@end html
36541debfc3dSmrg@anchor{arc-linux-uclibc}
36551debfc3dSmrg@heading arc-linux-uclibc
36561debfc3dSmrg
36571debfc3dSmrgUse @samp{configure --target=arc-linux-uclibc --with-cpu=arc700 --enable-languages="c,c++"} to configure GCC@.
36581debfc3dSmrg
36591debfc3dSmrg@html
36601debfc3dSmrg<hr />
36611debfc3dSmrg@end html
36621debfc3dSmrg@anchor{arm-x-eabi}
36631debfc3dSmrg@heading arm-*-eabi
36641debfc3dSmrgARM-family processors.
36651debfc3dSmrg
36661debfc3dSmrgBuilding the Ada frontend commonly fails (an infinite loop executing
36671debfc3dSmrg@code{xsinfo}) if the host compiler is GNAT 4.8.  Host compilers built from the
36681debfc3dSmrgGNAT 4.6, 4.9 or 5 release branches are known to succeed.
36691debfc3dSmrg
36701debfc3dSmrg@html
36711debfc3dSmrg<hr />
36721debfc3dSmrg@end html
36731debfc3dSmrg@anchor{avr}
36741debfc3dSmrg@heading avr
36751debfc3dSmrgATMEL AVR-family micro controllers.  These are used in embedded
36761debfc3dSmrgapplications.  There are no standard Unix configurations.
36771debfc3dSmrg@ifnothtml
36781debfc3dSmrg@xref{AVR Options,, AVR Options, gcc, Using the GNU Compiler
36791debfc3dSmrgCollection (GCC)},
36801debfc3dSmrg@end ifnothtml
36811debfc3dSmrg@ifhtml
36821debfc3dSmrgSee ``AVR Options'' in the main manual
36831debfc3dSmrg@end ifhtml
36841debfc3dSmrgfor the list of supported MCU types.
36851debfc3dSmrg
36861debfc3dSmrgUse @samp{configure --target=avr --enable-languages="c"} to configure GCC@.
36871debfc3dSmrg
36881debfc3dSmrgFurther installation notes and other useful information about AVR tools
36891debfc3dSmrgcan also be obtained from:
36901debfc3dSmrg
36911debfc3dSmrg@itemize @bullet
36921debfc3dSmrg@item
36931debfc3dSmrg@uref{http://www.nongnu.org/avr/,,http://www.nongnu.org/avr/}
36941debfc3dSmrg@item
36951debfc3dSmrg@uref{http://www.amelek.gda.pl/avr/,,http://www.amelek.gda.pl/avr/}
36961debfc3dSmrg@end itemize
36971debfc3dSmrg
36981debfc3dSmrgThe following error:
36991debfc3dSmrg@smallexample
37001debfc3dSmrgError: register required
37011debfc3dSmrg@end smallexample
37021debfc3dSmrg
37031debfc3dSmrgindicates that you should upgrade to a newer version of the binutils.
37041debfc3dSmrg
37051debfc3dSmrg@html
37061debfc3dSmrg<hr />
37071debfc3dSmrg@end html
37081debfc3dSmrg@anchor{bfin}
37091debfc3dSmrg@heading Blackfin
37101debfc3dSmrgThe Blackfin processor, an Analog Devices DSP.
37111debfc3dSmrg@ifnothtml
37121debfc3dSmrg@xref{Blackfin Options,, Blackfin Options, gcc, Using the GNU Compiler
37131debfc3dSmrgCollection (GCC)},
37141debfc3dSmrg@end ifnothtml
37151debfc3dSmrg@ifhtml
37161debfc3dSmrgSee ``Blackfin Options'' in the main manual
37171debfc3dSmrg@end ifhtml
37181debfc3dSmrg
37191debfc3dSmrgMore information, and a version of binutils with support for this processor,
3720*8feb0f0bSmrgare available at @uref{https://sourceforge.net/projects/adi-toolchain/}.
37211debfc3dSmrg
37221debfc3dSmrg@html
37231debfc3dSmrg<hr />
37241debfc3dSmrg@end html
37251debfc3dSmrg@anchor{cr16}
37261debfc3dSmrg@heading CR16
37271debfc3dSmrgThe CR16 CompactRISC architecture is a 16-bit architecture. This
37281debfc3dSmrgarchitecture is used in embedded applications.
37291debfc3dSmrg
37301debfc3dSmrg@ifnothtml
37311debfc3dSmrg@xref{CR16 Options,, CR16 Options, gcc, Using and Porting the GNU Compiler
37321debfc3dSmrgCollection (GCC)},
37331debfc3dSmrg@end ifnothtml
37341debfc3dSmrg
37351debfc3dSmrg@ifhtml
37361debfc3dSmrgSee ``CR16 Options'' in the main manual for a list of CR16-specific options.
37371debfc3dSmrg@end ifhtml
37381debfc3dSmrg
37391debfc3dSmrgUse @samp{configure --target=cr16-elf --enable-languages=c,c++} to configure
37401debfc3dSmrgGCC@ for building a CR16 elf cross-compiler.
37411debfc3dSmrg
37421debfc3dSmrgUse @samp{configure --target=cr16-uclinux --enable-languages=c,c++} to
37431debfc3dSmrgconfigure GCC@ for building a CR16 uclinux cross-compiler.
37441debfc3dSmrg
37451debfc3dSmrg@html
37461debfc3dSmrg<hr />
37471debfc3dSmrg@end html
37481debfc3dSmrg@anchor{cris}
37491debfc3dSmrg@heading CRIS
37501debfc3dSmrgCRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
37511debfc3dSmrgseries.  These are used in embedded applications.
37521debfc3dSmrg
37531debfc3dSmrg@ifnothtml
37541debfc3dSmrg@xref{CRIS Options,, CRIS Options, gcc, Using the GNU Compiler
37551debfc3dSmrgCollection (GCC)},
37561debfc3dSmrg@end ifnothtml
37571debfc3dSmrg@ifhtml
37581debfc3dSmrgSee ``CRIS Options'' in the main manual
37591debfc3dSmrg@end ifhtml
37601debfc3dSmrgfor a list of CRIS-specific options.
37611debfc3dSmrg
37621debfc3dSmrgThere are a few different CRIS targets:
37631debfc3dSmrg@table @code
37641debfc3dSmrg@item cris-axis-elf
37651debfc3dSmrgMainly for monolithic embedded systems.  Includes a multilib for the
37661debfc3dSmrg@samp{v10} core used in @samp{ETRAX 100 LX}.
37671debfc3dSmrg@item cris-axis-linux-gnu
37681debfc3dSmrgA GNU/Linux port for the CRIS architecture, currently targeting
37691debfc3dSmrg@samp{ETRAX 100 LX} by default.
37701debfc3dSmrg@end table
37711debfc3dSmrg
37721debfc3dSmrgPre-packaged tools can be obtained from
37731debfc3dSmrg@uref{ftp://ftp.axis.com/@/pub/@/axis/@/tools/@/cris/@/compiler-kit/}.  More
37741debfc3dSmrginformation about this platform is available at
37751debfc3dSmrg@uref{http://developer.axis.com/}.
37761debfc3dSmrg
37771debfc3dSmrg@html
37781debfc3dSmrg<hr />
37791debfc3dSmrg@end html
37801debfc3dSmrg@anchor{dos}
37811debfc3dSmrg@heading DOS
37821debfc3dSmrgPlease have a look at the @uref{binaries.html,,binaries page}.
37831debfc3dSmrg
37841debfc3dSmrgYou cannot install GCC by itself on MSDOS; it will not compile under
37851debfc3dSmrgany MSDOS compiler except itself.  You need to get the complete
37861debfc3dSmrgcompilation package DJGPP, which includes binaries as well as sources,
37871debfc3dSmrgand includes all the necessary compilation tools and libraries.
37881debfc3dSmrg
37891debfc3dSmrg@html
37901debfc3dSmrg<hr />
37911debfc3dSmrg@end html
37921debfc3dSmrg@anchor{epiphany-x-elf}
37931debfc3dSmrg@heading epiphany-*-elf
37941debfc3dSmrgAdapteva Epiphany.
37951debfc3dSmrgThis configuration is intended for embedded systems.
37961debfc3dSmrg
37971debfc3dSmrg@html
37981debfc3dSmrg<hr />
37991debfc3dSmrg@end html
38001debfc3dSmrg@anchor{x-x-freebsd}
38011debfc3dSmrg@heading *-*-freebsd*
38021debfc3dSmrgSupport for FreeBSD 1 was discontinued in GCC 3.2.  Support for
38031debfc3dSmrgFreeBSD 2 (and any mutant a.out variants of FreeBSD 3) was
38041debfc3dSmrgdiscontinued in GCC 4.0.
38051debfc3dSmrg
38061debfc3dSmrgIn order to better utilize FreeBSD base system functionality and match
38071debfc3dSmrgthe configuration of the system compiler, GCC 4.5 and above as well as
38081debfc3dSmrgGCC 4.4 past 2010-06-20 leverage SSP support in libc (which is present
38091debfc3dSmrgon FreeBSD 7 or later) and the use of @code{__cxa_atexit} by default
38101debfc3dSmrg(on FreeBSD 6 or later).  The use of @code{dl_iterate_phdr} inside
38111debfc3dSmrg@file{libgcc_s.so.1} and boehm-gc (on FreeBSD 7 or later) is enabled
38121debfc3dSmrgby GCC 4.5 and above.
38131debfc3dSmrg
38141debfc3dSmrgWe support FreeBSD using the ELF file format with DWARF 2 debugging
38151debfc3dSmrgfor all CPU architectures.  You may use @option{-gstabs} instead of
38161debfc3dSmrg@option{-g}, if you really want the old debugging format.  There are
38171debfc3dSmrgno known issues with mixing object files and libraries with different
38181debfc3dSmrgdebugging formats.  Otherwise, this release of GCC should now match
38191debfc3dSmrgmore of the configuration used in the stock FreeBSD configuration of
38201debfc3dSmrgGCC@.  In particular, @option{--enable-threads} is now configured by
38211debfc3dSmrgdefault.  However, as a general user, do not attempt to replace the
38221debfc3dSmrgsystem compiler with this release.  Known to bootstrap and check with
38231debfc3dSmrggood results on FreeBSD 7.2-STABLE@.  In the past, known to bootstrap
38241debfc3dSmrgand check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3, 4.4,
38251debfc3dSmrg4.5, 4.8, 4.9 and 5-CURRENT@.
38261debfc3dSmrg
38271debfc3dSmrgThe version of binutils installed in @file{/usr/bin} probably works
38281debfc3dSmrgwith this release of GCC@.  Bootstrapping against the latest GNU
38291debfc3dSmrgbinutils and/or the version found in @file{/usr/ports/devel/binutils} has
38301debfc3dSmrgbeen known to enable additional features and improve overall testsuite
38311debfc3dSmrgresults.  However, it is currently known that boehm-gc may not configure
38321debfc3dSmrgproperly on FreeBSD prior to the FreeBSD 7.0 release with GNU binutils
38331debfc3dSmrgafter 2.16.1.
38341debfc3dSmrg
38351debfc3dSmrg@html
38361debfc3dSmrg<hr />
38371debfc3dSmrg@end html
38381debfc3dSmrg@anchor{ft32-x-elf}
38391debfc3dSmrg@heading ft32-*-elf
38401debfc3dSmrgThe FT32 processor.
38411debfc3dSmrgThis configuration is intended for embedded systems.
38421debfc3dSmrg
38431debfc3dSmrg@html
38441debfc3dSmrg<hr />
38451debfc3dSmrg@end html
38461debfc3dSmrg@anchor{h8300-hms}
38471debfc3dSmrg@heading h8300-hms
38481debfc3dSmrgRenesas H8/300 series of processors.
38491debfc3dSmrg
38501debfc3dSmrgPlease have a look at the @uref{binaries.html,,binaries page}.
38511debfc3dSmrg
38521debfc3dSmrgThe calling convention and structure layout has changed in release 2.6.
38531debfc3dSmrgAll code must be recompiled.  The calling convention now passes the
38541debfc3dSmrgfirst three arguments in function calls in registers.  Structures are no
38551debfc3dSmrglonger a multiple of 2 bytes.
38561debfc3dSmrg
38571debfc3dSmrg@html
38581debfc3dSmrg<hr />
38591debfc3dSmrg@end html
38601debfc3dSmrg@anchor{hppa-hp-hpux}
38611debfc3dSmrg@heading hppa*-hp-hpux*
38621debfc3dSmrgSupport for HP-UX version 9 and older was discontinued in GCC 3.4.
38631debfc3dSmrg
38641debfc3dSmrgWe require using gas/binutils on all hppa platforms.  Version 2.19 or
38651debfc3dSmrglater is recommended.
38661debfc3dSmrg
38671debfc3dSmrgIt may be helpful to configure GCC with the
38681debfc3dSmrg@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
38691debfc3dSmrg@option{--with-as=@dots{}} options to ensure that GCC can find GAS@.
38701debfc3dSmrg
38711debfc3dSmrgThe HP assembler should not be used with GCC.  It is rarely tested and may
38721debfc3dSmrgnot work.  It shouldn't be used with any languages other than C due to its
38731debfc3dSmrgmany limitations.
38741debfc3dSmrg
38751debfc3dSmrgSpecifically, @option{-g} does not work (HP-UX uses a peculiar debugging
38761debfc3dSmrgformat which GCC does not know about).  It also inserts timestamps
38771debfc3dSmrginto each object file it creates, causing the 3-stage comparison test to
38781debfc3dSmrgfail during a bootstrap.  You should be able to continue by saying
38791debfc3dSmrg@samp{make all-host all-target} after getting the failure from @samp{make}.
38801debfc3dSmrg
38811debfc3dSmrgVarious GCC features are not supported.  For example, it does not support weak
38821debfc3dSmrgsymbols or alias definitions.  As a result, explicit template instantiations
38831debfc3dSmrgare required when using C++.  This makes it difficult if not impossible to
38841debfc3dSmrgbuild many C++ applications.
38851debfc3dSmrg
38861debfc3dSmrgThere are two default scheduling models for instructions.  These are
38871debfc3dSmrgPROCESSOR_7100LC and PROCESSOR_8000.  They are selected from the pa-risc
38881debfc3dSmrgarchitecture specified for the target machine when configuring.
38891debfc3dSmrgPROCESSOR_8000 is the default.  PROCESSOR_7100LC is selected when
38901debfc3dSmrgthe target is a @samp{hppa1*} machine.
38911debfc3dSmrg
38921debfc3dSmrgThe PROCESSOR_8000 model is not well suited to older processors.  Thus,
38931debfc3dSmrgit is important to completely specify the machine architecture when
38941debfc3dSmrgconfiguring if you want a model other than PROCESSOR_8000.  The macro
38951debfc3dSmrgTARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different
38961debfc3dSmrgdefault scheduling model is desired.
38971debfc3dSmrg
38981debfc3dSmrgAs of GCC 4.0, GCC uses the UNIX 95 namespace for HP-UX 10.10
38991debfc3dSmrgthrough 11.00, and the UNIX 98 namespace for HP-UX 11.11 and later.
39001debfc3dSmrgThis namespace change might cause problems when bootstrapping with
39011debfc3dSmrgan earlier version of GCC or the HP compiler as essentially the same
39021debfc3dSmrgnamespace is required for an entire build.  This problem can be avoided
39031debfc3dSmrgin a number of ways.  With HP cc, @env{UNIX_STD} can be set to @samp{95}
39041debfc3dSmrgor @samp{98}.  Another way is to add an appropriate set of predefines
39051debfc3dSmrgto @env{CC}.  The description for the @option{munix=} option contains
39061debfc3dSmrga list of the predefines used with each standard.
39071debfc3dSmrg
39081debfc3dSmrgMore specific information to @samp{hppa*-hp-hpux*} targets follows.
39091debfc3dSmrg
39101debfc3dSmrg@html
39111debfc3dSmrg<hr />
39121debfc3dSmrg@end html
39131debfc3dSmrg@anchor{hppa-hp-hpux10}
39141debfc3dSmrg@heading hppa*-hp-hpux10
39151debfc3dSmrgFor hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
39161debfc3dSmrg@code{PHCO_19798} from HP@.
39171debfc3dSmrg
39181debfc3dSmrgThe C++ ABI has changed incompatibly in GCC 4.0.  COMDAT subspaces are
39191debfc3dSmrgused for one-only code and data.  This resolves many of the previous
39201debfc3dSmrgproblems in using C++ on this target.  However, the ABI is not compatible
39211debfc3dSmrgwith the one implemented under HP-UX 11 using secondary definitions.
39221debfc3dSmrg
39231debfc3dSmrg@html
39241debfc3dSmrg<hr />
39251debfc3dSmrg@end html
39261debfc3dSmrg@anchor{hppa-hp-hpux11}
39271debfc3dSmrg@heading hppa*-hp-hpux11
39281debfc3dSmrgGCC 3.0 and up support HP-UX 11.  GCC 2.95.x is not supported and cannot
39291debfc3dSmrgbe used to compile GCC 3.0 and up.
39301debfc3dSmrg
39311debfc3dSmrgThe libffi library haven't been ported to 64-bit HP-UX@ and doesn't build.
39321debfc3dSmrg
39331debfc3dSmrgRefer to @uref{binaries.html,,binaries} for information about obtaining
39341debfc3dSmrgprecompiled GCC binaries for HP-UX@.  Precompiled binaries must be obtained
39351debfc3dSmrgto build the Ada language as it cannot be bootstrapped using C@.  Ada is
39361debfc3dSmrgonly available for the 32-bit PA-RISC runtime.
39371debfc3dSmrg
39381debfc3dSmrgStarting with GCC 3.4 an ISO C compiler is required to bootstrap.  The
39391debfc3dSmrgbundled compiler supports only traditional C; you will need either HP's
39401debfc3dSmrgunbundled compiler, or a binary distribution of GCC@.
39411debfc3dSmrg
39421debfc3dSmrgIt is possible to build GCC 3.3 starting with the bundled HP compiler,
39431debfc3dSmrgbut the process requires several steps.  GCC 3.3 can then be used to
39441debfc3dSmrgbuild later versions.
39451debfc3dSmrg
39461debfc3dSmrgThere are several possible approaches to building the distribution.
39471debfc3dSmrgBinutils can be built first using the HP tools.  Then, the GCC
39481debfc3dSmrgdistribution can be built.  The second approach is to build GCC
39491debfc3dSmrgfirst using the HP tools, then build binutils, then rebuild GCC@.
39501debfc3dSmrgThere have been problems with various binary distributions, so it
39511debfc3dSmrgis best not to start from a binary distribution.
39521debfc3dSmrg
39531debfc3dSmrgOn 64-bit capable systems, there are two distinct targets.  Different
39541debfc3dSmrginstallation prefixes must be used if both are to be installed on
39551debfc3dSmrgthe same system.  The @samp{hppa[1-2]*-hp-hpux11*} target generates code
39561debfc3dSmrgfor the 32-bit PA-RISC runtime architecture and uses the HP linker.
39571debfc3dSmrgThe @samp{hppa64-hp-hpux11*} target generates 64-bit code for the
39581debfc3dSmrgPA-RISC 2.0 architecture.
39591debfc3dSmrg
39601debfc3dSmrgThe script config.guess now selects the target type based on the compiler
39611debfc3dSmrgdetected during configuration.  You must define @env{PATH} or @env{CC} so
39621debfc3dSmrgthat configure finds an appropriate compiler for the initial bootstrap.
39631debfc3dSmrgWhen @env{CC} is used, the definition should contain the options that are
39641debfc3dSmrgneeded whenever @env{CC} is used.
39651debfc3dSmrg
39661debfc3dSmrgSpecifically, options that determine the runtime architecture must be
39671debfc3dSmrgin @env{CC} to correctly select the target for the build.  It is also
39681debfc3dSmrgconvenient to place many other compiler options in @env{CC}.  For example,
39691debfc3dSmrg@env{CC="cc -Ac +DA2.0W -Wp,-H16376 -D_CLASSIC_TYPES -D_HPUX_SOURCE"}
39701debfc3dSmrgcan be used to bootstrap the GCC 3.3 branch with the HP compiler in
39711debfc3dSmrg64-bit K&R/bundled mode.  The @option{+DA2.0W} option will result in
39721debfc3dSmrgthe automatic selection of the @samp{hppa64-hp-hpux11*} target.  The
39731debfc3dSmrgmacro definition table of cpp needs to be increased for a successful
39741debfc3dSmrgbuild with the HP compiler.  _CLASSIC_TYPES and _HPUX_SOURCE need to
39751debfc3dSmrgbe defined when building with the bundled compiler, or when using the
39761debfc3dSmrg@option{-Ac} option.  These defines aren't necessary with @option{-Ae}.
39771debfc3dSmrg
39781debfc3dSmrgIt is best to explicitly configure the @samp{hppa64-hp-hpux11*} target
39791debfc3dSmrgwith the @option{--with-ld=@dots{}} option.  This overrides the standard
39801debfc3dSmrgsearch for ld.  The two linkers supported on this target require different
39811debfc3dSmrgcommands.  The default linker is determined during configuration.  As a
39821debfc3dSmrgresult, it's not possible to switch linkers in the middle of a GCC build.
39831debfc3dSmrgThis has been reported to sometimes occur in unified builds of binutils
39841debfc3dSmrgand GCC@.
39851debfc3dSmrg
39861debfc3dSmrgA recent linker patch must be installed for the correct operation of
39871debfc3dSmrgGCC 3.3 and later.  @code{PHSS_26559} and @code{PHSS_24304} are the
39881debfc3dSmrgoldest linker patches that are known to work.  They are for HP-UX
39891debfc3dSmrg11.00 and 11.11, respectively.  @code{PHSS_24303}, the companion to
39901debfc3dSmrg@code{PHSS_24304}, might be usable but it hasn't been tested.  These
39911debfc3dSmrgpatches have been superseded.  Consult the HP patch database to obtain
39921debfc3dSmrgthe currently recommended linker patch for your system.
39931debfc3dSmrg
39941debfc3dSmrgThe patches are necessary for the support of weak symbols on the
39951debfc3dSmrg32-bit port, and for the running of initializers and finalizers.  Weak
39961debfc3dSmrgsymbols are implemented using SOM secondary definition symbols.  Prior
39971debfc3dSmrgto HP-UX 11, there are bugs in the linker support for secondary symbols.
39981debfc3dSmrgThe patches correct a problem of linker core dumps creating shared
39991debfc3dSmrglibraries containing secondary symbols, as well as various other
40001debfc3dSmrglinking issues involving secondary symbols.
40011debfc3dSmrg
40021debfc3dSmrgGCC 3.3 uses the ELF DT_INIT_ARRAY and DT_FINI_ARRAY capabilities to
40031debfc3dSmrgrun initializers and finalizers on the 64-bit port.  The 32-bit port
40041debfc3dSmrguses the linker @option{+init} and @option{+fini} options for the same
40051debfc3dSmrgpurpose.  The patches correct various problems with the +init/+fini
40061debfc3dSmrgoptions, including program core dumps.  Binutils 2.14 corrects a
40071debfc3dSmrgproblem on the 64-bit port resulting from HP's non-standard use of
40081debfc3dSmrgthe .init and .fini sections for array initializers and finalizers.
40091debfc3dSmrg
40101debfc3dSmrgAlthough the HP and GNU linkers are both supported for the
40111debfc3dSmrg@samp{hppa64-hp-hpux11*} target, it is strongly recommended that the
40121debfc3dSmrgHP linker be used for link editing on this target.
40131debfc3dSmrg
40141debfc3dSmrgAt this time, the GNU linker does not support the creation of long
40151debfc3dSmrgbranch stubs.  As a result, it cannot successfully link binaries
40161debfc3dSmrgcontaining branch offsets larger than 8 megabytes.  In addition,
40171debfc3dSmrgthere are problems linking shared libraries, linking executables
40181debfc3dSmrgwith @option{-static}, and with dwarf2 unwind and exception support.
40191debfc3dSmrgIt also doesn't provide stubs for internal calls to global functions
40201debfc3dSmrgin shared libraries, so these calls cannot be overloaded.
40211debfc3dSmrg
40221debfc3dSmrgThe HP dynamic loader does not support GNU symbol versioning, so symbol
40231debfc3dSmrgversioning is not supported.  It may be necessary to disable symbol
40241debfc3dSmrgversioning with @option{--disable-symvers} when using GNU ld.
40251debfc3dSmrg
40261debfc3dSmrgPOSIX threads are the default.  The optional DCE thread library is not
40271debfc3dSmrgsupported, so @option{--enable-threads=dce} does not work.
40281debfc3dSmrg
40291debfc3dSmrg@html
40301debfc3dSmrg<hr />
40311debfc3dSmrg@end html
40321debfc3dSmrg@anchor{x-x-linux-gnu}
40331debfc3dSmrg@heading *-*-linux-gnu
40341debfc3dSmrgVersions of libstdc++-v3 starting with 3.2.1 require bug fixes present
40351debfc3dSmrgin glibc 2.2.5 and later.  More information is available in the
40361debfc3dSmrglibstdc++-v3 documentation.
40371debfc3dSmrg
40381debfc3dSmrg@html
40391debfc3dSmrg<hr />
40401debfc3dSmrg@end html
40411debfc3dSmrg@anchor{ix86-x-linux}
40421debfc3dSmrg@heading i?86-*-linux*
40431debfc3dSmrgAs of GCC 3.3, binutils 2.13.1 or later is required for this platform.
40441debfc3dSmrgSee @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information.
40451debfc3dSmrg
40461debfc3dSmrgIf you receive Signal 11 errors when building on GNU/Linux, then it is
40471debfc3dSmrgpossible you have a hardware problem.  Further information on this can be
40481debfc3dSmrgfound on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
40491debfc3dSmrg
40501debfc3dSmrg@html
40511debfc3dSmrg<hr />
40521debfc3dSmrg@end html
4053*8feb0f0bSmrg@anchor{ix86-x-solaris2}
4054*8feb0f0bSmrg@heading i?86-*-solaris2*
4055*8feb0f0bSmrgUse this for Solaris 11.3 or later on x86 and x86-64 systems.  Starting
4056*8feb0f0bSmrgwith GCC 4.7, there is also a 64-bit @samp{amd64-*-solaris2*} or
4057*8feb0f0bSmrg@samp{x86_64-*-solaris2*} configuration that corresponds to
40581debfc3dSmrg@samp{sparcv9-sun-solaris2*}.
40591debfc3dSmrg
40601debfc3dSmrgIt is recommended that you configure GCC to use the GNU assembler.  The
4061*8feb0f0bSmrgversions included in Solaris 11.3, from GNU binutils 2.23.1 or
4062*8feb0f0bSmrgnewer (available as @file{/usr/bin/gas} and
4063a2dc1f3fSmrg@file{/usr/gnu/bin/as}), work fine.  The current version, from GNU
4064*8feb0f0bSmrgbinutils 2.34, is known to work.  Recent versions of the Solaris assembler in
4065*8feb0f0bSmrg@file{/usr/bin/as} work almost as well, though.
40661debfc3dSmrg
4067*8feb0f0bSmrgFor linking, the Solaris linker is preferred.  If you want to use the GNU
4068*8feb0f0bSmrglinker instead, the version in Solaris 11.3, from GNU binutils 2.23.1 or
4069*8feb0f0bSmrgnewer (in @file{/usr/gnu/bin/ld} and @file{/usr/bin/gld}), works,
4070*8feb0f0bSmrgas does the latest version, from GNU binutils 2.34.
40711debfc3dSmrg
40721debfc3dSmrgTo use GNU @command{as}, configure with the options
4073*8feb0f0bSmrg@option{--with-gnu-as --with-as=@//usr/@/gnu/@/bin/@/as}.  It may be necessary
40741debfc3dSmrgto configure with @option{--without-gnu-ld --with-ld=@//usr/@/ccs/@/bin/@/ld} to
4075*8feb0f0bSmrgguarantee use of Solaris @command{ld}.
40761debfc3dSmrg@c FIXME: why --without-gnu-ld --with-ld?
40771debfc3dSmrg
40781debfc3dSmrg@html
40791debfc3dSmrg<hr />
40801debfc3dSmrg@end html
40811debfc3dSmrg@anchor{ia64-x-linux}
40821debfc3dSmrg@heading ia64-*-linux
40831debfc3dSmrgIA-64 processor (also known as IPF, or Itanium Processor Family)
40841debfc3dSmrgrunning GNU/Linux.
40851debfc3dSmrg
40861debfc3dSmrgIf you are using the installed system libunwind library with
40871debfc3dSmrg@option{--with-system-libunwind}, then you must use libunwind 0.98 or
40881debfc3dSmrglater.
40891debfc3dSmrg
40901debfc3dSmrgNone of the following versions of GCC has an ABI that is compatible
40911debfc3dSmrgwith any of the other versions in this list, with the exception that
40921debfc3dSmrgRed Hat 2.96 and Trillian 000171 are compatible with each other:
40931debfc3dSmrg3.1, 3.0.2, 3.0.1, 3.0, Red Hat 2.96, and Trillian 000717.
40941debfc3dSmrgThis primarily affects C++ programs and programs that create shared libraries.
40951debfc3dSmrgGCC 3.1 or later is recommended for compiling linux, the kernel.
40961debfc3dSmrgAs of version 3.1 GCC is believed to be fully ABI compliant, and hence no
40971debfc3dSmrgmore major ABI changes are expected.
40981debfc3dSmrg
40991debfc3dSmrg@html
41001debfc3dSmrg<hr />
41011debfc3dSmrg@end html
41021debfc3dSmrg@anchor{ia64-x-hpux}
41031debfc3dSmrg@heading ia64-*-hpux*
41041debfc3dSmrgBuilding GCC on this target requires the GNU Assembler.  The bundled HP
41051debfc3dSmrgassembler will not work.  To prevent GCC from using the wrong assembler,
41061debfc3dSmrgthe option @option{--with-gnu-as} may be necessary.
41071debfc3dSmrg
41081debfc3dSmrgThe GCC libunwind library has not been ported to HPUX@.  This means that for
41091debfc3dSmrgGCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions}
41101debfc3dSmrgis required to build GCC@.  For GCC 3.3 and later, this is the default.
41111debfc3dSmrgFor gcc 3.4.3 and later, @option{--enable-libunwind-exceptions} is
41121debfc3dSmrgremoved and the system libunwind library will always be used.
41131debfc3dSmrg
41141debfc3dSmrg@html
41151debfc3dSmrg<hr />
41161debfc3dSmrg<!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
41171debfc3dSmrg@end html
41181debfc3dSmrg@anchor{x-ibm-aix}
41191debfc3dSmrg@heading *-ibm-aix*
41201debfc3dSmrgSupport for AIX version 3 and older was discontinued in GCC 3.4.
41211debfc3dSmrgSupport for AIX version 4.2 and older was discontinued in GCC 4.5.
41221debfc3dSmrg
41231debfc3dSmrg``out of memory'' bootstrap failures may indicate a problem with
41241debfc3dSmrgprocess resource limits (ulimit).  Hard limits are configured in the
41251debfc3dSmrg@file{/etc/security/limits} system configuration file.
41261debfc3dSmrg
41271debfc3dSmrgGCC 4.9 and above require a C++ compiler for bootstrap.  IBM VAC++ / xlC
41281debfc3dSmrgcannot bootstrap GCC.  xlc can bootstrap an older version of GCC and
41291debfc3dSmrgG++ can bootstrap recent releases of GCC.
41301debfc3dSmrg
41311debfc3dSmrgGCC can bootstrap with recent versions of IBM XLC, but bootstrapping
41321debfc3dSmrgwith an earlier release of GCC is recommended.  Bootstrapping with XLC
41331debfc3dSmrgrequires a larger data segment, which can be enabled through the
41341debfc3dSmrg@var{LDR_CNTRL} environment variable, e.g.,
41351debfc3dSmrg
41361debfc3dSmrg@smallexample
41371debfc3dSmrg% LDR_CNTRL=MAXDATA=0x50000000
41381debfc3dSmrg% export LDR_CNTRL
41391debfc3dSmrg@end smallexample
41401debfc3dSmrg
41411debfc3dSmrgOne can start with a pre-compiled version of GCC to build from
41421debfc3dSmrgsources.  One may delete GCC's ``fixed'' header files when starting
41431debfc3dSmrgwith a version of GCC built for an earlier release of AIX.
41441debfc3dSmrg
41451debfc3dSmrgTo speed up the configuration phases of bootstrapping and installing GCC,
41461debfc3dSmrgone may use GNU Bash instead of AIX @command{/bin/sh}, e.g.,
41471debfc3dSmrg
41481debfc3dSmrg@smallexample
41491debfc3dSmrg% CONFIG_SHELL=/opt/freeware/bin/bash
41501debfc3dSmrg% export CONFIG_SHELL
41511debfc3dSmrg@end smallexample
41521debfc3dSmrg
41531debfc3dSmrgand then proceed as described in @uref{build.html,,the build
41541debfc3dSmrginstructions}, where we strongly recommend specifying an absolute path
41551debfc3dSmrgto invoke @var{srcdir}/configure.
41561debfc3dSmrg
41571debfc3dSmrgBecause GCC on AIX is built as a 32-bit executable by default,
41581debfc3dSmrg(although it can generate 64-bit programs) the GMP and MPFR libraries
41591debfc3dSmrgrequired by gfortran must be 32-bit libraries.  Building GMP and MPFR
41601debfc3dSmrgas static archive libraries works better than shared libraries.
41611debfc3dSmrg
41621debfc3dSmrgErrors involving @code{alloca} when building GCC generally are due
41631debfc3dSmrgto an incorrect definition of @code{CC} in the Makefile or mixing files
41641debfc3dSmrgcompiled with the native C compiler and GCC@.  During the stage1 phase of
41651debfc3dSmrgthe build, the native AIX compiler @strong{must} be invoked as @command{cc}
41661debfc3dSmrg(not @command{xlc}).  Once @command{configure} has been informed of
41671debfc3dSmrg@command{xlc}, one needs to use @samp{make distclean} to remove the
41681debfc3dSmrgconfigure cache files and ensure that @env{CC} environment variable
41691debfc3dSmrgdoes not provide a definition that will confuse @command{configure}.
41701debfc3dSmrgIf this error occurs during stage2 or later, then the problem most likely
41711debfc3dSmrgis the version of Make (see above).
41721debfc3dSmrg
41731debfc3dSmrgThe native @command{as} and @command{ld} are recommended for
41741debfc3dSmrgbootstrapping on AIX@.  The GNU Assembler, GNU Linker, and GNU
41751debfc3dSmrgBinutils version 2.20 is the minimum level that supports bootstrap on
41761debfc3dSmrgAIX 5@.  The GNU Assembler has not been updated to support AIX 6@ or
41771debfc3dSmrgAIX 7.  The native AIX tools do interoperate with GCC@.
41781debfc3dSmrg
41791debfc3dSmrgAIX 7.1 added partial support for DWARF debugging, but full support
41801debfc3dSmrgrequires AIX 7.1 TL03 SP7 that supports additional DWARF sections and
41811debfc3dSmrgfixes a bug in the assembler.  AIX 7.1 TL03 SP5 distributed a version
41821debfc3dSmrgof libm.a missing important symbols; a fix for IV77796 will be
41831debfc3dSmrgincluded in SP6.
41841debfc3dSmrg
41851debfc3dSmrgAIX 5.3 TL10, AIX 6.1 TL05 and AIX 7.1 TL00 introduced an AIX
41861debfc3dSmrgassembler change that sometimes produces corrupt assembly files
41871debfc3dSmrgcausing AIX linker errors.  The bug breaks GCC bootstrap on AIX and
41881debfc3dSmrgcan cause compilation failures with existing GCC installations.  An
41891debfc3dSmrgAIX iFix for AIX 5.3 is available (APAR IZ98385 for AIX 5.3 TL10, APAR
41901debfc3dSmrgIZ98477 for AIX 5.3 TL11 and IZ98134 for AIX 5.3 TL12). AIX 5.3 TL11 SP8,
41911debfc3dSmrgAIX 5.3 TL12 SP5, AIX 6.1 TL04 SP11, AIX 6.1 TL05 SP7, AIX 6.1 TL06 SP6,
41921debfc3dSmrgAIX 6.1 TL07 and AIX 7.1 TL01 should include the fix.
41931debfc3dSmrg
41941debfc3dSmrgBuilding @file{libstdc++.a} requires a fix for an AIX Assembler bug
41951debfc3dSmrgAPAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1).  It also requires a
41961debfc3dSmrgfix for another AIX Assembler bug and a co-dependent AIX Archiver fix
41971debfc3dSmrgreferenced as APAR IY53606 (AIX 5.2) or as APAR IY54774 (AIX 5.1)
41981debfc3dSmrg
41991debfc3dSmrg@anchor{TransferAixShobj}
42001debfc3dSmrg@samp{libstdc++} in GCC 3.4 increments the major version number of the
42011debfc3dSmrgshared object and GCC installation places the @file{libstdc++.a}
42021debfc3dSmrgshared library in a common location which will overwrite the and GCC
42031debfc3dSmrg3.3 version of the shared library.  Applications either need to be
42041debfc3dSmrgre-linked against the new shared library or the GCC 3.1 and GCC 3.3
42051debfc3dSmrgversions of the @samp{libstdc++} shared object needs to be available
42061debfc3dSmrgto the AIX runtime loader.  The GCC 3.1 @samp{libstdc++.so.4}, if
42071debfc3dSmrgpresent, and GCC 3.3 @samp{libstdc++.so.5} shared objects can be
42081debfc3dSmrginstalled for runtime dynamic loading using the following steps to set
42091debfc3dSmrgthe @samp{F_LOADONLY} flag in the shared object for @emph{each}
42101debfc3dSmrgmultilib @file{libstdc++.a} installed:
42111debfc3dSmrg
42121debfc3dSmrgExtract the shared objects from the currently installed
42131debfc3dSmrg@file{libstdc++.a} archive:
42141debfc3dSmrg@smallexample
42151debfc3dSmrg% ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
42161debfc3dSmrg@end smallexample
42171debfc3dSmrg
42181debfc3dSmrgEnable the @samp{F_LOADONLY} flag so that the shared object will be
42191debfc3dSmrgavailable for runtime dynamic loading, but not linking:
42201debfc3dSmrg@smallexample
42211debfc3dSmrg% strip -e libstdc++.so.4 libstdc++.so.5
42221debfc3dSmrg@end smallexample
42231debfc3dSmrg
42241debfc3dSmrgArchive the runtime-only shared object in the GCC 3.4
42251debfc3dSmrg@file{libstdc++.a} archive:
42261debfc3dSmrg@smallexample
42271debfc3dSmrg% ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
42281debfc3dSmrg@end smallexample
42291debfc3dSmrg
42301debfc3dSmrgEventually, the
42311debfc3dSmrg@uref{./configure.html#WithAixSoname,,@option{--with-aix-soname=svr4}}
42321debfc3dSmrgconfigure option may drop the need for this procedure for libraries that
42331debfc3dSmrgsupport it.
42341debfc3dSmrg
42351debfc3dSmrgLinking executables and shared libraries may produce warnings of
42361debfc3dSmrgduplicate symbols.  The assembly files generated by GCC for AIX always
42371debfc3dSmrghave included multiple symbol definitions for certain global variable
42381debfc3dSmrgand function declarations in the original program.  The warnings should
42391debfc3dSmrgnot prevent the linker from producing a correct library or runnable
42401debfc3dSmrgexecutable.
42411debfc3dSmrg
42421debfc3dSmrgAIX 4.3 utilizes a ``large format'' archive to support both 32-bit and
42431debfc3dSmrg64-bit object modules.  The routines provided in AIX 4.3.0 and AIX 4.3.1
42441debfc3dSmrgto parse archive libraries did not handle the new format correctly.
42451debfc3dSmrgThese routines are used by GCC and result in error messages during
42461debfc3dSmrglinking such as ``not a COFF file''.  The version of the routines shipped
42471debfc3dSmrgwith AIX 4.3.1 should work for a 32-bit environment.  The @option{-g}
42481debfc3dSmrgoption of the archive command may be used to create archives of 32-bit
42491debfc3dSmrgobjects using the original ``small format''.  A correct version of the
42501debfc3dSmrgroutines is shipped with AIX 4.3.2 and above.
42511debfc3dSmrg
42521debfc3dSmrgSome versions of the AIX binder (linker) can fail with a relocation
42531debfc3dSmrgoverflow severe error when the @option{-bbigtoc} option is used to link
42541debfc3dSmrgGCC-produced object files into an executable that overflows the TOC@.  A fix
42551debfc3dSmrgfor APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
42561debfc3dSmrgavailable from IBM Customer Support and from its
42571debfc3dSmrg@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
42581debfc3dSmrgwebsite as PTF U455193.
42591debfc3dSmrg
42601debfc3dSmrgThe AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
42611debfc3dSmrgwith a segmentation fault when invoked by any version of GCC@.  A fix for
42621debfc3dSmrgAPAR IX87327 is available from IBM Customer Support and from its
42631debfc3dSmrg@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
42641debfc3dSmrgwebsite as PTF U461879.  This fix is incorporated in AIX 4.3.3 and above.
42651debfc3dSmrg
42661debfc3dSmrgThe initial assembler shipped with AIX 4.3.0 generates incorrect object
42671debfc3dSmrgfiles.  A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
42681debfc3dSmrgTO ASSEMBLE/BIND) is available from IBM Customer Support and from its
42691debfc3dSmrg@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
42701debfc3dSmrgwebsite as PTF U453956.  This fix is incorporated in AIX 4.3.1 and above.
42711debfc3dSmrg
42721debfc3dSmrgAIX provides National Language Support (NLS)@.  Compilers and assemblers
42731debfc3dSmrguse NLS to support locale-specific representations of various data
42741debfc3dSmrgformats including floating-point numbers (e.g., @samp{.}  vs @samp{,} for
42751debfc3dSmrgseparating decimal fractions).  There have been problems reported where
42761debfc3dSmrgGCC does not produce the same floating-point formats that the assembler
42771debfc3dSmrgexpects.  If one encounters this problem, set the @env{LANG}
42781debfc3dSmrgenvironment variable to @samp{C} or @samp{En_US}.
42791debfc3dSmrg
42801debfc3dSmrgA default can be specified with the @option{-mcpu=@var{cpu_type}}
42811debfc3dSmrgswitch and using the configure option @option{--with-cpu-@var{cpu_type}}.
42821debfc3dSmrg
42831debfc3dSmrg@html
42841debfc3dSmrg<hr />
42851debfc3dSmrg@end html
42861debfc3dSmrg@anchor{iq2000-x-elf}
42871debfc3dSmrg@heading iq2000-*-elf
42881debfc3dSmrgVitesse IQ2000 processors.  These are used in embedded
42891debfc3dSmrgapplications.  There are no standard Unix configurations.
42901debfc3dSmrg
42911debfc3dSmrg@html
42921debfc3dSmrg<hr />
42931debfc3dSmrg@end html
42941debfc3dSmrg@anchor{lm32-x-elf}
42951debfc3dSmrg@heading lm32-*-elf
42961debfc3dSmrgLattice Mico32 processor.
42971debfc3dSmrgThis configuration is intended for embedded systems.
42981debfc3dSmrg
42991debfc3dSmrg@html
43001debfc3dSmrg<hr />
43011debfc3dSmrg@end html
43021debfc3dSmrg@anchor{lm32-x-uclinux}
43031debfc3dSmrg@heading lm32-*-uclinux
43041debfc3dSmrgLattice Mico32 processor.
43051debfc3dSmrgThis configuration is intended for embedded systems running uClinux.
43061debfc3dSmrg
43071debfc3dSmrg@html
43081debfc3dSmrg<hr />
43091debfc3dSmrg@end html
43101debfc3dSmrg@anchor{m32c-x-elf}
43111debfc3dSmrg@heading m32c-*-elf
43121debfc3dSmrgRenesas M32C processor.
43131debfc3dSmrgThis configuration is intended for embedded systems.
43141debfc3dSmrg
43151debfc3dSmrg@html
43161debfc3dSmrg<hr />
43171debfc3dSmrg@end html
43181debfc3dSmrg@anchor{m32r-x-elf}
43191debfc3dSmrg@heading m32r-*-elf
43201debfc3dSmrgRenesas M32R processor.
43211debfc3dSmrgThis configuration is intended for embedded systems.
43221debfc3dSmrg
43231debfc3dSmrg@html
43241debfc3dSmrg<hr />
43251debfc3dSmrg@end html
43261debfc3dSmrg@anchor{m68k-x-x}
43271debfc3dSmrg@heading m68k-*-*
43281debfc3dSmrgBy default,
43291debfc3dSmrg@samp{m68k-*-elf*}, @samp{m68k-*-rtems},  @samp{m68k-*-uclinux} and
43301debfc3dSmrg@samp{m68k-*-linux}
43311debfc3dSmrgbuild libraries for both M680x0 and ColdFire processors.  If you only
43321debfc3dSmrgneed the M680x0 libraries, you can omit the ColdFire ones by passing
43331debfc3dSmrg@option{--with-arch=m68k} to @command{configure}.  Alternatively, you
43341debfc3dSmrgcan omit the M680x0 libraries by passing @option{--with-arch=cf} to
43351debfc3dSmrg@command{configure}.  These targets default to 5206 or 5475 code as
43361debfc3dSmrgappropriate for the target system when
43371debfc3dSmrgconfigured with @option{--with-arch=cf} and 68020 code otherwise.
43381debfc3dSmrg
43391debfc3dSmrgThe @samp{m68k-*-netbsd} and
43401debfc3dSmrg@samp{m68k-*-openbsd} targets also support the @option{--with-arch}
43411debfc3dSmrgoption.  They will generate ColdFire CFV4e code when configured with
43421debfc3dSmrg@option{--with-arch=cf} and 68020 code otherwise.
43431debfc3dSmrg
43441debfc3dSmrgYou can override the default processors listed above by configuring
43451debfc3dSmrgwith @option{--with-cpu=@var{target}}.  This @var{target} can either
43461debfc3dSmrgbe a @option{-mcpu} argument or one of the following values:
43471debfc3dSmrg@samp{m68000}, @samp{m68010}, @samp{m68020}, @samp{m68030},
43481debfc3dSmrg@samp{m68040}, @samp{m68060}, @samp{m68020-40} and @samp{m68020-60}.
43491debfc3dSmrg
43501debfc3dSmrgGCC requires at least binutils version 2.17 on these targets.
43511debfc3dSmrg
43521debfc3dSmrg@html
43531debfc3dSmrg<hr />
43541debfc3dSmrg@end html
43551debfc3dSmrg@anchor{m68k-x-uclinux}
43561debfc3dSmrg@heading m68k-*-uclinux
43571debfc3dSmrgGCC 4.3 changed the uClinux configuration so that it uses the
43581debfc3dSmrg@samp{m68k-linux-gnu} ABI rather than the @samp{m68k-elf} ABI.
43591debfc3dSmrgIt also added improved support for C++ and flat shared libraries,
43601debfc3dSmrgboth of which were ABI changes.
43611debfc3dSmrg
43621debfc3dSmrg@html
43631debfc3dSmrg<hr />
43641debfc3dSmrg@end html
43651debfc3dSmrg@anchor{microblaze-x-elf}
43661debfc3dSmrg@heading microblaze-*-elf
43671debfc3dSmrgXilinx MicroBlaze processor.
43681debfc3dSmrgThis configuration is intended for embedded systems.
43691debfc3dSmrg
43701debfc3dSmrg@html
43711debfc3dSmrg<hr />
43721debfc3dSmrg@end html
43731debfc3dSmrg@anchor{mips-x-x}
43741debfc3dSmrg@heading mips-*-*
43751debfc3dSmrgIf on a MIPS system you get an error message saying ``does not have gp
43761debfc3dSmrgsections for all it's [sic] sectons [sic]'', don't worry about it.  This
43771debfc3dSmrghappens whenever you use GAS with the MIPS linker, but there is not
43781debfc3dSmrgreally anything wrong, and it is okay to use the output file.  You can
43791debfc3dSmrgstop such warnings by installing the GNU linker.
43801debfc3dSmrg
43811debfc3dSmrgIt would be nice to extend GAS to produce the gp tables, but they are
43821debfc3dSmrgoptional, and there should not be a warning about their absence.
43831debfc3dSmrg
43841debfc3dSmrgThe libstdc++ atomic locking routines for MIPS targets requires MIPS II
43851debfc3dSmrgand later.  A patch went in just after the GCC 3.3 release to
43861debfc3dSmrgmake @samp{mips*-*-*} use the generic implementation instead.  You can also
43871debfc3dSmrgconfigure for @samp{mipsel-elf} as a workaround.  The
43881debfc3dSmrg@samp{mips*-*-linux*} target continues to use the MIPS II routines.  More
43891debfc3dSmrgwork on this is expected in future releases.
43901debfc3dSmrg
43911debfc3dSmrg@c If you make --with-llsc the default for another target, please also
43921debfc3dSmrg@c update the description of the --with-llsc option.
43931debfc3dSmrg
43941debfc3dSmrgThe built-in @code{__sync_*} functions are available on MIPS II and
43951debfc3dSmrglater systems and others that support the @samp{ll}, @samp{sc} and
43961debfc3dSmrg@samp{sync} instructions.  This can be overridden by passing
43971debfc3dSmrg@option{--with-llsc} or @option{--without-llsc} when configuring GCC.
43981debfc3dSmrgSince the Linux kernel emulates these instructions if they are
43991debfc3dSmrgmissing, the default for @samp{mips*-*-linux*} targets is
44001debfc3dSmrg@option{--with-llsc}.  The @option{--with-llsc} and
44011debfc3dSmrg@option{--without-llsc} configure options may be overridden at compile
44021debfc3dSmrgtime by passing the @option{-mllsc} or @option{-mno-llsc} options to
44031debfc3dSmrgthe compiler.
44041debfc3dSmrg
44051debfc3dSmrgMIPS systems check for division by zero (unless
44061debfc3dSmrg@option{-mno-check-zero-division} is passed to the compiler) by
44071debfc3dSmrggenerating either a conditional trap or a break instruction.  Using
44081debfc3dSmrgtrap results in smaller code, but is only supported on MIPS II and
44091debfc3dSmrglater.  Also, some versions of the Linux kernel have a bug that
44101debfc3dSmrgprevents trap from generating the proper signal (@code{SIGFPE}).  To enable
44111debfc3dSmrgthe use of break, use the @option{--with-divide=breaks}
44121debfc3dSmrg@command{configure} option when configuring GCC@.  The default is to
44131debfc3dSmrguse traps on systems that support them.
44141debfc3dSmrg
44151debfc3dSmrg@html
44161debfc3dSmrg<hr />
44171debfc3dSmrg@end html
44181debfc3dSmrg@anchor{moxie-x-elf}
44191debfc3dSmrg@heading moxie-*-elf
44201debfc3dSmrgThe moxie processor.
44211debfc3dSmrg
44221debfc3dSmrg@html
44231debfc3dSmrg<hr />
44241debfc3dSmrg@end html
44251debfc3dSmrg@anchor{msp430-x-elf}
4426*8feb0f0bSmrg@heading msp430-*-elf*
44271debfc3dSmrgTI MSP430 processor.
44281debfc3dSmrgThis configuration is intended for embedded systems.
44291debfc3dSmrg
4430*8feb0f0bSmrg@samp{msp430-*-elf} is the standard configuration with most GCC
4431*8feb0f0bSmrgfeatures enabled by default.
4432*8feb0f0bSmrg
4433*8feb0f0bSmrg@samp{msp430-*-elfbare} is tuned for a bare-metal environment, and disables
4434*8feb0f0bSmrgfeatures related to shared libraries and other functionality not used for
4435*8feb0f0bSmrgthis device.  This reduces code and data usage of the GCC libraries, resulting
4436*8feb0f0bSmrgin a minimal run-time environment by default.
4437*8feb0f0bSmrg
4438*8feb0f0bSmrgFeatures disabled by default include:
4439*8feb0f0bSmrg@itemize
4440*8feb0f0bSmrg@item transactional memory
4441*8feb0f0bSmrg@item __cxa_atexit
4442*8feb0f0bSmrg@end itemize
4443*8feb0f0bSmrg
44441debfc3dSmrg@html
44451debfc3dSmrg<hr />
44461debfc3dSmrg@end html
44471debfc3dSmrg@anchor{nds32le-x-elf}
44481debfc3dSmrg@heading nds32le-*-elf
44491debfc3dSmrgAndes NDS32 target in little endian mode.
44501debfc3dSmrg
44511debfc3dSmrg@html
44521debfc3dSmrg<hr />
44531debfc3dSmrg@end html
44541debfc3dSmrg@anchor{nds32be-x-elf}
44551debfc3dSmrg@heading nds32be-*-elf
44561debfc3dSmrgAndes NDS32 target in big endian mode.
44571debfc3dSmrg
44581debfc3dSmrg@html
44591debfc3dSmrg<hr />
44601debfc3dSmrg@end html
44611debfc3dSmrg@anchor{nvptx-x-none}
44621debfc3dSmrg@heading nvptx-*-none
44631debfc3dSmrgNvidia PTX target.
44641debfc3dSmrg
44651debfc3dSmrgInstead of GNU binutils, you will need to install
44661debfc3dSmrg@uref{https://github.com/MentorEmbedded/nvptx-tools/,,nvptx-tools}.
44671debfc3dSmrgTell GCC where to find it:
44681debfc3dSmrg@option{--with-build-time-tools=[install-nvptx-tools]/nvptx-none/bin}.
44691debfc3dSmrg
4470a2dc1f3fSmrgYou will need newlib 3.0 git revision
4471a2dc1f3fSmrgcd31fbb2aea25f94d7ecedc9db16dfc87ab0c316 or later.  It can be
4472a2dc1f3fSmrgautomatically built together with GCC@.  For this, add a symbolic link
4473a2dc1f3fSmrgto nvptx-newlib's @file{newlib} directory to the directory containing
4474a2dc1f3fSmrgthe GCC sources.
44751debfc3dSmrg
44761debfc3dSmrgUse the @option{--disable-sjlj-exceptions} and
44771debfc3dSmrg@option{--enable-newlib-io-long-long} options when configuring.
44781debfc3dSmrg
44791debfc3dSmrg@html
44801debfc3dSmrg<hr />
44811debfc3dSmrg@end html
4482c0a68be4Smrg@anchor{or1k-x-elf}
4483c0a68be4Smrg@heading or1k-*-elf
4484c0a68be4SmrgThe OpenRISC 1000 32-bit processor with delay slots.
4485c0a68be4SmrgThis configuration is intended for embedded systems.
4486c0a68be4Smrg
4487c0a68be4Smrg@html
4488c0a68be4Smrg<hr />
4489c0a68be4Smrg@end html
4490c0a68be4Smrg@anchor{or1k-x-linux}
4491c0a68be4Smrg@heading or1k-*-linux
4492c0a68be4SmrgThe OpenRISC 1000 32-bit processor with delay slots.
4493c0a68be4Smrg
4494c0a68be4Smrg@html
4495c0a68be4Smrg<hr />
4496c0a68be4Smrg@end html
44971debfc3dSmrg@anchor{powerpc-x-x}
44981debfc3dSmrg@heading powerpc-*-*
44991debfc3dSmrgYou can specify a default version for the @option{-mcpu=@var{cpu_type}}
45001debfc3dSmrgswitch by using the configure option @option{--with-cpu-@var{cpu_type}}.
45011debfc3dSmrg
4502*8feb0f0bSmrgYou will need GNU binutils 2.20 or newer.
45031debfc3dSmrg
45041debfc3dSmrg@html
45051debfc3dSmrg<hr />
45061debfc3dSmrg@end html
45071debfc3dSmrg@anchor{powerpc-x-darwin}
45081debfc3dSmrg@heading powerpc-*-darwin*
45091debfc3dSmrgPowerPC running Darwin (Mac OS X kernel).
45101debfc3dSmrg
45111debfc3dSmrgPre-installed versions of Mac OS X may not include any developer tools,
45121debfc3dSmrgmeaning that you will not be able to build GCC from source.  Tool
45131debfc3dSmrgbinaries are available at
45141debfc3dSmrg@uref{https://opensource.apple.com}.
45151debfc3dSmrg
45161debfc3dSmrgThis version of GCC requires at least cctools-590.36.  The
45171debfc3dSmrgcctools-590.36 package referenced from
45181debfc3dSmrg@uref{http://gcc.gnu.org/ml/gcc/2006-03/msg00507.html} will not work
45191debfc3dSmrgon systems older than 10.3.9 (aka darwin7.9.0).
45201debfc3dSmrg
45211debfc3dSmrg@html
45221debfc3dSmrg<hr />
45231debfc3dSmrg@end html
45241debfc3dSmrg@anchor{powerpc-x-elf}
45251debfc3dSmrg@heading powerpc-*-elf
45261debfc3dSmrgPowerPC system in big endian mode, running System V.4.
45271debfc3dSmrg
45281debfc3dSmrg@html
45291debfc3dSmrg<hr />
45301debfc3dSmrg@end html
45311debfc3dSmrg@anchor{powerpc-x-linux-gnu}
45321debfc3dSmrg@heading powerpc*-*-linux-gnu*
45331debfc3dSmrgPowerPC system in big endian mode running Linux.
45341debfc3dSmrg
45351debfc3dSmrg@html
45361debfc3dSmrg<hr />
45371debfc3dSmrg@end html
45381debfc3dSmrg@anchor{powerpc-x-netbsd}
45391debfc3dSmrg@heading powerpc-*-netbsd*
45401debfc3dSmrgPowerPC system in big endian mode running NetBSD@.
45411debfc3dSmrg
45421debfc3dSmrg@html
45431debfc3dSmrg<hr />
45441debfc3dSmrg@end html
45451debfc3dSmrg@anchor{powerpc-x-eabisim}
45461debfc3dSmrg@heading powerpc-*-eabisim
45471debfc3dSmrgEmbedded PowerPC system in big endian mode for use in running under the
45481debfc3dSmrgPSIM simulator.
45491debfc3dSmrg
45501debfc3dSmrg@html
45511debfc3dSmrg<hr />
45521debfc3dSmrg@end html
45531debfc3dSmrg@anchor{powerpc-x-eabi}
45541debfc3dSmrg@heading powerpc-*-eabi
45551debfc3dSmrgEmbedded PowerPC system in big endian mode.
45561debfc3dSmrg
45571debfc3dSmrg@html
45581debfc3dSmrg<hr />
45591debfc3dSmrg@end html
45601debfc3dSmrg@anchor{powerpcle-x-elf}
45611debfc3dSmrg@heading powerpcle-*-elf
45621debfc3dSmrgPowerPC system in little endian mode, running System V.4.
45631debfc3dSmrg
45641debfc3dSmrg@html
45651debfc3dSmrg<hr />
45661debfc3dSmrg@end html
45671debfc3dSmrg@anchor{powerpcle-x-eabisim}
45681debfc3dSmrg@heading powerpcle-*-eabisim
45691debfc3dSmrgEmbedded PowerPC system in little endian mode for use in running under
45701debfc3dSmrgthe PSIM simulator.
45711debfc3dSmrg
45721debfc3dSmrg@html
45731debfc3dSmrg<hr />
45741debfc3dSmrg@end html
45751debfc3dSmrg@anchor{powerpcle-x-eabi}
45761debfc3dSmrg@heading powerpcle-*-eabi
45771debfc3dSmrgEmbedded PowerPC system in little endian mode.
45781debfc3dSmrg
45791debfc3dSmrg@html
45801debfc3dSmrg<hr />
45811debfc3dSmrg@end html
45821debfc3dSmrg@anchor{rl78-x-elf}
45831debfc3dSmrg@heading rl78-*-elf
45841debfc3dSmrgThe Renesas RL78 processor.
45851debfc3dSmrgThis configuration is intended for embedded systems.
45861debfc3dSmrg
45871debfc3dSmrg@html
45881debfc3dSmrg<hr />
45891debfc3dSmrg@end html
45901debfc3dSmrg@anchor{riscv32-x-elf}
45911debfc3dSmrg@heading riscv32-*-elf
45921debfc3dSmrgThe RISC-V RV32 instruction set.
45931debfc3dSmrgThis configuration is intended for embedded systems.
4594*8feb0f0bSmrgThis (and all other RISC-V) targets require the binutils 2.30 release.
45951debfc3dSmrg
45961debfc3dSmrg@html
45971debfc3dSmrg<hr />
45981debfc3dSmrg@end html
45991debfc3dSmrg@anchor{riscv32-x-linux}
46001debfc3dSmrg@heading riscv32-*-linux
46011debfc3dSmrgThe RISC-V RV32 instruction set running GNU/Linux.
4602*8feb0f0bSmrgThis (and all other RISC-V) targets require the binutils 2.30 release.
46031debfc3dSmrg
46041debfc3dSmrg@html
46051debfc3dSmrg<hr />
46061debfc3dSmrg@end html
46071debfc3dSmrg@anchor{riscv64-x-elf}
46081debfc3dSmrg@heading riscv64-*-elf
46091debfc3dSmrgThe RISC-V RV64 instruction set.
46101debfc3dSmrgThis configuration is intended for embedded systems.
4611*8feb0f0bSmrgThis (and all other RISC-V) targets require the binutils 2.30 release.
46121debfc3dSmrg
46131debfc3dSmrg@html
46141debfc3dSmrg<hr />
46151debfc3dSmrg@end html
46161debfc3dSmrg@anchor{riscv64-x-linux}
46171debfc3dSmrg@heading riscv64-*-linux
46181debfc3dSmrgThe RISC-V RV64 instruction set running GNU/Linux.
4619*8feb0f0bSmrgThis (and all other RISC-V) targets require the binutils 2.30 release.
46201debfc3dSmrg
46211debfc3dSmrg@html
46221debfc3dSmrg<hr />
46231debfc3dSmrg@end html
46241debfc3dSmrg@anchor{rx-x-elf}
46251debfc3dSmrg@heading rx-*-elf
46261debfc3dSmrgThe Renesas RX processor.
46271debfc3dSmrg
46281debfc3dSmrg@html
46291debfc3dSmrg<hr />
46301debfc3dSmrg@end html
46311debfc3dSmrg@anchor{s390-x-linux}
46321debfc3dSmrg@heading s390-*-linux*
46331debfc3dSmrgS/390 system running GNU/Linux for S/390@.
46341debfc3dSmrg
46351debfc3dSmrg@html
46361debfc3dSmrg<hr />
46371debfc3dSmrg@end html
46381debfc3dSmrg@anchor{s390x-x-linux}
46391debfc3dSmrg@heading s390x-*-linux*
46401debfc3dSmrgzSeries system (64-bit) running GNU/Linux for zSeries@.
46411debfc3dSmrg
46421debfc3dSmrg@html
46431debfc3dSmrg<hr />
46441debfc3dSmrg@end html
46451debfc3dSmrg@anchor{s390x-ibm-tpf}
46461debfc3dSmrg@heading s390x-ibm-tpf*
46471debfc3dSmrgzSeries system (64-bit) running TPF@.  This platform is
46481debfc3dSmrgsupported as cross-compilation target only.
46491debfc3dSmrg
46501debfc3dSmrg@html
46511debfc3dSmrg<hr />
46521debfc3dSmrg@end html
46531debfc3dSmrg@c Please use Solaris 2 to refer to all release of Solaris, starting
46541debfc3dSmrg@c with 2.0 until 2.6, 7, 8, etc.  Solaris 1 was a marketing name for
46551debfc3dSmrg@c SunOS 4 releases which we don't use to avoid confusion.  Solaris
46561debfc3dSmrg@c alone is too unspecific and must be avoided.
46571debfc3dSmrg@anchor{x-x-solaris2}
46581debfc3dSmrg@heading *-*-solaris2*
4659*8feb0f0bSmrgSupport for Solaris 10 has been removed in GCC 10.  Support for Solaris
4660*8feb0f0bSmrg9 has been removed in GCC 5.  Support for Solaris 8 has been removed in
4661*8feb0f0bSmrgGCC 4.8.  Support for Solaris 7 has been removed in GCC 4.6.
46621debfc3dSmrg
4663*8feb0f0bSmrgSolaris 11.3 provides GCC 4.5.2, 4.7.3, and 4.8.2 as
4664*8feb0f0bSmrg@command{/usr/gcc/4.5/bin/gcc} or similar.  Newer Solaris versions
4665*8feb0f0bSmrgprovide one or more of GCC 5, 7, and 9.  Alternatively,
46661debfc3dSmrgyou can install a pre-built GCC to bootstrap and install GCC.  See the
46671debfc3dSmrg@uref{binaries.html,,binaries page} for details.
46681debfc3dSmrg
46691debfc3dSmrgThe Solaris 2 @command{/bin/sh} will often fail to configure
4670*8feb0f0bSmrg@samp{libstdc++-v3}.  We therefore recommend using the
46711debfc3dSmrgfollowing initial sequence of commands
46721debfc3dSmrg
46731debfc3dSmrg@smallexample
46741debfc3dSmrg% CONFIG_SHELL=/bin/ksh
46751debfc3dSmrg% export CONFIG_SHELL
46761debfc3dSmrg@end smallexample
46771debfc3dSmrg
46781debfc3dSmrg@noindent
46791debfc3dSmrgand proceed as described in @uref{configure.html,,the configure instructions}.
46801debfc3dSmrgIn addition we strongly recommend specifying an absolute path to invoke
46811debfc3dSmrg@command{@var{srcdir}/configure}.
46821debfc3dSmrg
4683*8feb0f0bSmrgIn Solaris 11, you need to check for @code{system/header},
4684*8feb0f0bSmrg@code{system/linker}, and @code{developer/assembler} packages.
46851debfc3dSmrg
46861debfc3dSmrgTrying to use the linker and other tools in
46871debfc3dSmrg@file{/usr/ucb} to install GCC has been observed to cause trouble.
46881debfc3dSmrgFor example, the linker may hang indefinitely.  The fix is to remove
46891debfc3dSmrg@file{/usr/ucb} from your @env{PATH}.
46901debfc3dSmrg
4691*8feb0f0bSmrgThe build process works more smoothly with the legacy Solaris tools so, if you
46921debfc3dSmrghave @file{/usr/xpg4/bin} in your @env{PATH}, we recommend that you place
46931debfc3dSmrg@file{/usr/bin} before @file{/usr/xpg4/bin} for the duration of the build.
46941debfc3dSmrg
46951debfc3dSmrgWe recommend the use of the Solaris assembler or the GNU assembler, in
46961debfc3dSmrgconjunction with the Solaris linker.  The GNU @command{as}
4697*8feb0f0bSmrgversions included in Solaris 11.3,
4698*8feb0f0bSmrgfrom GNU binutils 2.23.1 or newer (in @file{/usr/bin/gas} and
46991debfc3dSmrg@file{/usr/gnu/bin/as}), are known to work.
4700*8feb0f0bSmrgThe current version, from GNU binutils 2.34,
4701a2dc1f3fSmrgis known to work as well.  Note that your mileage may vary
47021debfc3dSmrgif you use a combination of the GNU tools and the Solaris tools: while the
4703*8feb0f0bSmrgcombination GNU @command{as} + Solaris @command{ld} should reasonably work,
4704*8feb0f0bSmrgthe reverse combination Solaris @command{as} + GNU @command{ld} may fail to
47051debfc3dSmrgbuild or cause memory corruption at runtime in some cases for C++ programs.
47061debfc3dSmrg@c FIXME: still?
4707*8feb0f0bSmrgGNU @command{ld} usually works as well.  Again, the current
4708*8feb0f0bSmrgversion (2.34) is known to work, but generally lacks platform specific
47091debfc3dSmrgfeatures, so better stay with Solaris @command{ld}.  To use the LTO linker
47101debfc3dSmrgplugin (@option{-fuse-linker-plugin}) with GNU @command{ld}, GNU
47111debfc3dSmrgbinutils @emph{must} be configured with @option{--enable-largefile}.
47121debfc3dSmrg
47131debfc3dSmrgTo enable symbol versioning in @samp{libstdc++} with the Solaris linker,
47141debfc3dSmrgyou need to have any version of GNU @command{c++filt}, which is part of
47151debfc3dSmrgGNU binutils.  @samp{libstdc++} symbol versioning will be disabled if no
47161debfc3dSmrgappropriate version is found.  Solaris @command{c++filt} from the Solaris
47171debfc3dSmrgStudio compilers does @emph{not} work.
47181debfc3dSmrg
4719*8feb0f0bSmrgThe versions of the GNU Multiple Precision Library (GMP), the MPFR
4720*8feb0f0bSmrglibrary and the MPC library bundled with Solaris 11.3 and later are
4721*8feb0f0bSmrgusually recent enough to match GCC's requirements.  There are two
4722*8feb0f0bSmrgcaveats:
4723*8feb0f0bSmrg
4724*8feb0f0bSmrg@itemize @bullet
4725*8feb0f0bSmrg@item
4726*8feb0f0bSmrgWhile the version of the GMP library in Solaris 11.3 works with GCC, you
4727*8feb0f0bSmrgneed to configure with @option{--with-gmp-include=/usr/include/gmp}.
4728*8feb0f0bSmrg
4729*8feb0f0bSmrg@item
4730*8feb0f0bSmrgThe version of the MPFR libary included in Solaris 11.3 is too old; you
4731*8feb0f0bSmrgneed to provide a more recent one.
4732*8feb0f0bSmrg@end itemize
47331debfc3dSmrg
47341debfc3dSmrg@html
47351debfc3dSmrg<hr />
47361debfc3dSmrg@end html
47371debfc3dSmrg@anchor{sparc-x-x}
47381debfc3dSmrg@heading sparc*-*-*
47391debfc3dSmrgThis section contains general configuration information for all
47401debfc3dSmrgSPARC-based platforms.  In addition to reading this section, please
47411debfc3dSmrgread all other sections that match your target.
47421debfc3dSmrg
47431debfc3dSmrgNewer versions of the GNU Multiple Precision Library (GMP), the MPFR
47441debfc3dSmrglibrary and the MPC library are known to be miscompiled by earlier
47451debfc3dSmrgversions of GCC on these platforms.  We therefore recommend the use
47461debfc3dSmrgof the exact versions of these libraries listed as minimal versions
47471debfc3dSmrgin @uref{prerequisites.html,,the prerequisites}.
47481debfc3dSmrg
47491debfc3dSmrg@html
47501debfc3dSmrg<hr />
47511debfc3dSmrg@end html
47521debfc3dSmrg@anchor{sparc-sun-solaris2}
47531debfc3dSmrg@heading sparc-sun-solaris2*
47541debfc3dSmrgWhen GCC is configured to use GNU binutils 2.14 or later, the binaries
4755*8feb0f0bSmrgproduced are smaller than the ones produced using Solaris native tools;
47561debfc3dSmrgthis difference is quite significant for binaries containing debugging
47571debfc3dSmrginformation.
47581debfc3dSmrg
47591debfc3dSmrgStarting with Solaris 7, the operating system is capable of executing
47601debfc3dSmrg64-bit SPARC V9 binaries.  GCC 3.1 and later properly supports
47611debfc3dSmrgthis; the @option{-m64} option enables 64-bit code generation.
47621debfc3dSmrgHowever, if all you want is code tuned for the UltraSPARC CPU, you
47631debfc3dSmrgshould try the @option{-mtune=ultrasparc} option instead, which produces
47641debfc3dSmrgcode that, unlike full 64-bit code, can still run on non-UltraSPARC
47651debfc3dSmrgmachines.
47661debfc3dSmrg
47671debfc3dSmrgWhen configuring the GNU Multiple Precision Library (GMP), the MPFR
47681debfc3dSmrglibrary or the MPC library on a Solaris 7 or later system, the canonical
47691debfc3dSmrgtarget triplet must be specified as the @command{build} parameter on the
47701debfc3dSmrgconfigure line.  This target triplet can be obtained by invoking @command{./config.guess} in the toplevel source directory of GCC (and
4771*8feb0f0bSmrgnot that of GMP or MPFR or MPC).  For example on a Solaris 11 system:
47721debfc3dSmrg
47731debfc3dSmrg@smallexample
4774*8feb0f0bSmrg% ./configure --build=sparc-sun-solaris2.11 --prefix=xxx
47751debfc3dSmrg@end smallexample
47761debfc3dSmrg
47771debfc3dSmrg@html
47781debfc3dSmrg<hr />
47791debfc3dSmrg@end html
47801debfc3dSmrg@anchor{sparc-x-linux}
47811debfc3dSmrg@heading sparc-*-linux*
47821debfc3dSmrg
47831debfc3dSmrg@html
47841debfc3dSmrg<hr />
47851debfc3dSmrg@end html
47861debfc3dSmrg@anchor{sparc64-x-solaris2}
47871debfc3dSmrg@heading sparc64-*-solaris2*
4788*8feb0f0bSmrgWhen configuring a 64-bit-default GCC on Solaris/SPARC, you must use a
4789*8feb0f0bSmrgbuild compiler that generates 64-bit code, either by default or by
4790*8feb0f0bSmrgspecifying @samp{CC='gcc -m64' CXX='gcc-m64'} to @command{configure}.
4791*8feb0f0bSmrgAdditionally, you @emph{must} pass @option{--build=sparc64-sun-solaris2.11}
4792*8feb0f0bSmrgor @option{--build=sparcv9-sun-solaris2.11} because @file{config.guess}
4793*8feb0f0bSmrgmisdetects this situation, which can cause build failures.
4794*8feb0f0bSmrg
47951debfc3dSmrgWhen configuring the GNU Multiple Precision Library (GMP), the MPFR
47961debfc3dSmrglibrary or the MPC library, the canonical target triplet must be specified
47971debfc3dSmrgas the @command{build} parameter on the configure line.  For example
4798*8feb0f0bSmrgon a Solaris 11 system:
47991debfc3dSmrg
48001debfc3dSmrg@smallexample
4801*8feb0f0bSmrg% ./configure --build=sparc64-sun-solaris2.11 --prefix=xxx
48021debfc3dSmrg@end smallexample
48031debfc3dSmrg
48041debfc3dSmrg@html
48051debfc3dSmrg<hr />
48061debfc3dSmrg@end html
48071debfc3dSmrg@anchor{sparcv9-x-solaris2}
48081debfc3dSmrg@heading sparcv9-*-solaris2*
48091debfc3dSmrgThis is a synonym for @samp{sparc64-*-solaris2*}.
48101debfc3dSmrg
48111debfc3dSmrg@html
48121debfc3dSmrg<hr />
48131debfc3dSmrg@end html
48141debfc3dSmrg@anchor{c6x-x-x}
48151debfc3dSmrg@heading c6x-*-*
48161debfc3dSmrgThe C6X family of processors. This port requires binutils-2.22 or newer.
48171debfc3dSmrg
48181debfc3dSmrg@html
48191debfc3dSmrg<hr />
48201debfc3dSmrg@end html
48211debfc3dSmrg@anchor{tilegx-*-linux}
48221debfc3dSmrg@heading tilegx-*-linux*
48231debfc3dSmrgThe TILE-Gx processor in little endian mode, running GNU/Linux.  This
48241debfc3dSmrgport requires binutils-2.22 or newer.
48251debfc3dSmrg
48261debfc3dSmrg@html
48271debfc3dSmrg<hr />
48281debfc3dSmrg@end html
48291debfc3dSmrg@anchor{tilegxbe-*-linux}
48301debfc3dSmrg@heading tilegxbe-*-linux*
48311debfc3dSmrgThe TILE-Gx processor in big endian mode, running GNU/Linux.  This
48321debfc3dSmrgport requires binutils-2.23 or newer.
48331debfc3dSmrg
48341debfc3dSmrg@html
48351debfc3dSmrg<hr />
48361debfc3dSmrg@end html
48371debfc3dSmrg@anchor{tilepro-*-linux}
48381debfc3dSmrg@heading tilepro-*-linux*
48391debfc3dSmrgThe TILEPro processor running GNU/Linux.  This port requires
48401debfc3dSmrgbinutils-2.22 or newer.
48411debfc3dSmrg
48421debfc3dSmrg@html
48431debfc3dSmrg<hr />
48441debfc3dSmrg@end html
48451debfc3dSmrg@anchor{visium-x-elf}
48461debfc3dSmrg@heading visium-*-elf
48471debfc3dSmrgCDS VISIUMcore processor.
48481debfc3dSmrgThis configuration is intended for embedded systems.
48491debfc3dSmrg
48501debfc3dSmrg@html
48511debfc3dSmrg<hr />
48521debfc3dSmrg@end html
48531debfc3dSmrg@anchor{x-x-vxworks}
48541debfc3dSmrg@heading *-*-vxworks*
48551debfc3dSmrgSupport for VxWorks is in flux.  At present GCC supports @emph{only} the
48561debfc3dSmrgvery recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC@.
48571debfc3dSmrgWe welcome patches for other architectures supported by VxWorks 5.5.
48581debfc3dSmrgSupport for VxWorks AE would also be welcome; we believe this is merely
48591debfc3dSmrga matter of writing an appropriate ``configlette'' (see below).  We are
48601debfc3dSmrgnot interested in supporting older, a.out or COFF-based, versions of
48611debfc3dSmrgVxWorks in GCC 3.
48621debfc3dSmrg
48631debfc3dSmrgVxWorks comes with an older version of GCC installed in
48641debfc3dSmrg@file{@var{$WIND_BASE}/host}; we recommend you do not overwrite it.
48651debfc3dSmrgChoose an installation @var{prefix} entirely outside @var{$WIND_BASE}.
48661debfc3dSmrgBefore running @command{configure}, create the directories @file{@var{prefix}}
48671debfc3dSmrgand @file{@var{prefix}/bin}.  Link or copy the appropriate assembler,
48681debfc3dSmrglinker, etc.@: into @file{@var{prefix}/bin}, and set your @var{PATH} to
48691debfc3dSmrginclude that directory while running both @command{configure} and
48701debfc3dSmrg@command{make}.
48711debfc3dSmrg
48721debfc3dSmrgYou must give @command{configure} the
48731debfc3dSmrg@option{--with-headers=@var{$WIND_BASE}/target/h} switch so that it can
48741debfc3dSmrgfind the VxWorks system headers.  Since VxWorks is a cross compilation
48751debfc3dSmrgtarget only, you must also specify @option{--target=@var{target}}.
48761debfc3dSmrg@command{configure} will attempt to create the directory
48771debfc3dSmrg@file{@var{prefix}/@var{target}/sys-include} and copy files into it;
48781debfc3dSmrgmake sure the user running @command{configure} has sufficient privilege
48791debfc3dSmrgto do so.
48801debfc3dSmrg
48811debfc3dSmrgGCC's exception handling runtime requires a special ``configlette''
48821debfc3dSmrgmodule, @file{contrib/gthr_supp_vxw_5x.c}.  Follow the instructions in
48831debfc3dSmrgthat file to add the module to your kernel build.  (Future versions of
48841debfc3dSmrgVxWorks will incorporate this module.)
48851debfc3dSmrg
48861debfc3dSmrg@html
48871debfc3dSmrg<hr />
48881debfc3dSmrg@end html
48891debfc3dSmrg@anchor{x86-64-x-x}
48901debfc3dSmrg@heading x86_64-*-*, amd64-*-*
48911debfc3dSmrgGCC supports the x86-64 architecture implemented by the AMD64 processor
48921debfc3dSmrg(amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD@.
48931debfc3dSmrgOn GNU/Linux the default is a bi-arch compiler which is able to generate
48941debfc3dSmrgboth 64-bit x86-64 and 32-bit x86 code (via the @option{-m32} switch).
48951debfc3dSmrg
48961debfc3dSmrg@html
48971debfc3dSmrg<hr />
48981debfc3dSmrg@end html
4899*8feb0f0bSmrg@anchor{x86-64-x-solaris2}
4900*8feb0f0bSmrg@heading x86_64-*-solaris2*
49011debfc3dSmrgGCC also supports the x86-64 architecture implemented by the AMD64
49021debfc3dSmrgprocessor (@samp{amd64-*-*} is an alias for @samp{x86_64-*-*}) on
49031debfc3dSmrgSolaris 10 or later.  Unlike other systems, without special options a
49041debfc3dSmrgbi-arch compiler is built which generates 32-bit code by default, but
49051debfc3dSmrgcan generate 64-bit x86-64 code with the @option{-m64} switch.  Since
49061debfc3dSmrgGCC 4.7, there is also a configuration that defaults to 64-bit code, but
49071debfc3dSmrgcan generate 32-bit code with @option{-m32}.  To configure and build
49081debfc3dSmrgthis way, you have to provide all support libraries like @file{libgmp}
4909*8feb0f0bSmrgas 64-bit code, configure with @option{--target=x86_64-pc-solaris2.11}
49101debfc3dSmrgand @samp{CC=gcc -m64}.
49111debfc3dSmrg
49121debfc3dSmrg@html
49131debfc3dSmrg<hr />
49141debfc3dSmrg@end html
49151debfc3dSmrg@anchor{xtensa-x-elf}
49161debfc3dSmrg@heading xtensa*-*-elf
49171debfc3dSmrgThis target is intended for embedded Xtensa systems using the
49181debfc3dSmrg@samp{newlib} C library.  It uses ELF but does not support shared
49191debfc3dSmrgobjects.  Designed-defined instructions specified via the
49201debfc3dSmrgTensilica Instruction Extension (TIE) language are only supported
49211debfc3dSmrgthrough inline assembly.
49221debfc3dSmrg
49231debfc3dSmrgThe Xtensa configuration information must be specified prior to
49241debfc3dSmrgbuilding GCC@.  The @file{include/xtensa-config.h} header
49251debfc3dSmrgfile contains the configuration information.  If you created your
49261debfc3dSmrgown Xtensa configuration with the Xtensa Processor Generator, the
49271debfc3dSmrgdownloaded files include a customized copy of this header file,
49281debfc3dSmrgwhich you can use to replace the default header file.
49291debfc3dSmrg
49301debfc3dSmrg@html
49311debfc3dSmrg<hr />
49321debfc3dSmrg@end html
49331debfc3dSmrg@anchor{xtensa-x-linux}
49341debfc3dSmrg@heading xtensa*-*-linux*
49351debfc3dSmrgThis target is for Xtensa systems running GNU/Linux.  It supports ELF
49361debfc3dSmrgshared objects and the GNU C library (glibc).  It also generates
49371debfc3dSmrgposition-independent code (PIC) regardless of whether the
49381debfc3dSmrg@option{-fpic} or @option{-fPIC} options are used.  In other
49391debfc3dSmrgrespects, this target is the same as the
49401debfc3dSmrg@uref{#xtensa*-*-elf,,@samp{xtensa*-*-elf}} target.
49411debfc3dSmrg
49421debfc3dSmrg@html
49431debfc3dSmrg<hr />
49441debfc3dSmrg@end html
49451debfc3dSmrg@anchor{windows}
49461debfc3dSmrg@heading Microsoft Windows
49471debfc3dSmrg
49481debfc3dSmrg@subheading Intel 16-bit versions
49491debfc3dSmrgThe 16-bit versions of Microsoft Windows, such as Windows 3.1, are not
49501debfc3dSmrgsupported.
49511debfc3dSmrg
49521debfc3dSmrgHowever, the 32-bit port has limited support for Microsoft
49531debfc3dSmrgWindows 3.11 in the Win32s environment, as a target only.  See below.
49541debfc3dSmrg
49551debfc3dSmrg@subheading Intel 32-bit versions
49561debfc3dSmrgThe 32-bit versions of Windows, including Windows 95, Windows NT, Windows
49571debfc3dSmrgXP, and Windows Vista, are supported by several different target
49581debfc3dSmrgplatforms.  These targets differ in which Windows subsystem they target
49591debfc3dSmrgand which C libraries are used.
49601debfc3dSmrg
49611debfc3dSmrg@itemize
49621debfc3dSmrg@item Cygwin @uref{#x-x-cygwin,,*-*-cygwin}: Cygwin provides a user-space
49631debfc3dSmrgLinux API emulation layer in the Win32 subsystem.
49641debfc3dSmrg@item MinGW @uref{#x-x-mingw32,,*-*-mingw32}: MinGW is a native GCC port for
49651debfc3dSmrgthe Win32 subsystem that provides a subset of POSIX.
49661debfc3dSmrg@item MKS i386-pc-mks: NuTCracker from MKS.  See
4967a2dc1f3fSmrg@uref{https://www.mkssoftware.com} for more information.
49681debfc3dSmrg@end itemize
49691debfc3dSmrg
49701debfc3dSmrg@subheading Intel 64-bit versions
49711debfc3dSmrgGCC contains support for x86-64 using the mingw-w64
49721debfc3dSmrgruntime library, available from @uref{http://mingw-w64.org/doku.php}.
49731debfc3dSmrgThis library should be used with the target triple x86_64-pc-mingw32.
49741debfc3dSmrg
49751debfc3dSmrgPresently Windows for Itanium is not supported.
49761debfc3dSmrg
49771debfc3dSmrg@subheading Windows CE
49781debfc3dSmrgWindows CE is supported as a target only on Hitachi
49791debfc3dSmrgSuperH (sh-wince-pe), and MIPS (mips-wince-pe).
49801debfc3dSmrg
49811debfc3dSmrg@subheading Other Windows Platforms
49821debfc3dSmrgGCC no longer supports Windows NT on the Alpha or PowerPC.
49831debfc3dSmrg
49841debfc3dSmrgGCC no longer supports the Windows POSIX subsystem.  However, it does
49851debfc3dSmrgsupport the Interix subsystem.  See above.
49861debfc3dSmrg
49871debfc3dSmrgOld target names including *-*-winnt and *-*-windowsnt are no longer used.
49881debfc3dSmrg
49891debfc3dSmrgPW32 (i386-pc-pw32) support was never completed, and the project seems to
49901debfc3dSmrgbe inactive.  See @uref{http://pw32.sourceforge.net/} for more information.
49911debfc3dSmrg
49921debfc3dSmrgUWIN support has been removed due to a lack of maintenance.
49931debfc3dSmrg
49941debfc3dSmrg@html
49951debfc3dSmrg<hr />
49961debfc3dSmrg@end html
49971debfc3dSmrg@anchor{x-x-cygwin}
49981debfc3dSmrg@heading *-*-cygwin
49991debfc3dSmrgPorts of GCC are included with the
50001debfc3dSmrg@uref{http://www.cygwin.com/,,Cygwin environment}.
50011debfc3dSmrg
50021debfc3dSmrgGCC will build under Cygwin without modification; it does not build
50031debfc3dSmrgwith Microsoft's C++ compiler and there are no plans to make it do so.
50041debfc3dSmrg
50051debfc3dSmrgThe Cygwin native compiler can be configured to target any 32-bit x86
50061debfc3dSmrgcpu architecture desired; the default is i686-pc-cygwin.  It should be
50071debfc3dSmrgused with as up-to-date a version of binutils as possible; use either
50081debfc3dSmrgthe latest official GNU binutils release in the Cygwin distribution,
50091debfc3dSmrgor version 2.20 or above if building your own.
50101debfc3dSmrg
50111debfc3dSmrg@html
50121debfc3dSmrg<hr />
50131debfc3dSmrg@end html
50141debfc3dSmrg@anchor{x-x-mingw32}
50151debfc3dSmrg@heading *-*-mingw32
50161debfc3dSmrgGCC will build with and support only MinGW runtime 3.12 and later.
50171debfc3dSmrgEarlier versions of headers are incompatible with the new default semantics
50181debfc3dSmrgof @code{extern inline} in @code{-std=c99} and @code{-std=gnu99} modes.
50191debfc3dSmrg
50201debfc3dSmrg@html
50211debfc3dSmrg<hr />
50221debfc3dSmrg@end html
50231debfc3dSmrg@anchor{older}
50241debfc3dSmrg@heading Older systems
50251debfc3dSmrgGCC contains support files for many older (1980s and early
50261debfc3dSmrg1990s) Unix variants.  For the most part, support for these systems
50271debfc3dSmrghas not been deliberately removed, but it has not been maintained for
50281debfc3dSmrgseveral years and may suffer from bitrot.
50291debfc3dSmrg
50301debfc3dSmrgStarting with GCC 3.1, each release has a list of ``obsoleted'' systems.
50311debfc3dSmrgSupport for these systems is still present in that release, but
50321debfc3dSmrg@command{configure} will fail unless the @option{--enable-obsolete}
50331debfc3dSmrgoption is given.  Unless a maintainer steps forward, support for these
50341debfc3dSmrgsystems will be removed from the next release of GCC@.
50351debfc3dSmrg
50361debfc3dSmrgSupport for old systems as hosts for GCC can cause problems if the
50371debfc3dSmrgworkarounds for compiler, library and operating system bugs affect the
50381debfc3dSmrgcleanliness or maintainability of the rest of GCC@.  In some cases, to
50391debfc3dSmrgbring GCC up on such a system, if still possible with current GCC, may
50401debfc3dSmrgrequire first installing an old version of GCC which did work on that
50411debfc3dSmrgsystem, and using it to compile a more recent GCC, to avoid bugs in the
50421debfc3dSmrgvendor compiler.  Old releases of GCC 1 and GCC 2 are available in the
50431debfc3dSmrg@file{old-releases} directory on the @uref{../mirrors.html,,GCC mirror
50441debfc3dSmrgsites}.  Header bugs may generally be avoided using
50451debfc3dSmrg@command{fixincludes}, but bugs or deficiencies in libraries and the
50461debfc3dSmrgoperating system may still cause problems.
50471debfc3dSmrg
50481debfc3dSmrgSupport for older systems as targets for cross-compilation is less
50491debfc3dSmrgproblematic than support for them as hosts for GCC; if an enthusiast
50501debfc3dSmrgwishes to make such a target work again (including resurrecting any of
50511debfc3dSmrgthe targets that never worked with GCC 2, starting from the last
50521debfc3dSmrgversion before they were removed), patches
50531debfc3dSmrg@uref{../contribute.html,,following the usual requirements} would be
50541debfc3dSmrglikely to be accepted, since they should not affect the support for more
50551debfc3dSmrgmodern targets.
50561debfc3dSmrg
50571debfc3dSmrgFor some systems, old versions of GNU binutils may also be useful,
50581debfc3dSmrgand are available from @file{pub/binutils/old-releases} on
50591debfc3dSmrg@uref{https://sourceware.org/mirrors.html,,sourceware.org mirror sites}.
50601debfc3dSmrg
50611debfc3dSmrgSome of the information on specific systems above relates to
50621debfc3dSmrgsuch older systems, but much of the information
50631debfc3dSmrgabout GCC on such systems (which may no longer be applicable to
50641debfc3dSmrgcurrent GCC) is to be found in the GCC texinfo manual.
50651debfc3dSmrg
50661debfc3dSmrg@html
50671debfc3dSmrg<hr />
50681debfc3dSmrg@end html
50691debfc3dSmrg@anchor{elf}
50701debfc3dSmrg@heading all ELF targets (SVR4, Solaris 2, etc.)
50711debfc3dSmrgC++ support is significantly better on ELF targets if you use the
50721debfc3dSmrg@uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of
50731debfc3dSmrginlines, vtables and template instantiations will be discarded
50741debfc3dSmrgautomatically.
50751debfc3dSmrg
50761debfc3dSmrg
50771debfc3dSmrg@html
50781debfc3dSmrg<hr />
50791debfc3dSmrg<p>
50801debfc3dSmrg@end html
50811debfc3dSmrg@ifhtml
50821debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
50831debfc3dSmrg@end ifhtml
50841debfc3dSmrg@end ifset
50851debfc3dSmrg
50861debfc3dSmrg@c ***Old documentation******************************************************
50871debfc3dSmrg@ifset oldhtml
50881debfc3dSmrg@include install-old.texi
50891debfc3dSmrg@html
50901debfc3dSmrg<hr />
50911debfc3dSmrg<p>
50921debfc3dSmrg@end html
50931debfc3dSmrg@ifhtml
50941debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
50951debfc3dSmrg@end ifhtml
50961debfc3dSmrg@end ifset
50971debfc3dSmrg
50981debfc3dSmrg@c ***GFDL********************************************************************
50991debfc3dSmrg@ifset gfdlhtml
51001debfc3dSmrg@include fdl.texi
51011debfc3dSmrg@html
51021debfc3dSmrg<hr />
51031debfc3dSmrg<p>
51041debfc3dSmrg@end html
51051debfc3dSmrg@ifhtml
51061debfc3dSmrg@uref{./index.html,,Return to the GCC Installation page}
51071debfc3dSmrg@end ifhtml
51081debfc3dSmrg@end ifset
51091debfc3dSmrg
51101debfc3dSmrg@c ***************************************************************************
51111debfc3dSmrg@c Part 6 The End of the Document
51121debfc3dSmrg@ifinfo
51131debfc3dSmrg@comment node-name,     next,          previous, up
51141debfc3dSmrg@node    Concept Index, , GNU Free Documentation License, Top
51151debfc3dSmrg@end ifinfo
51161debfc3dSmrg
51171debfc3dSmrg@ifinfo
51181debfc3dSmrg@unnumbered Concept Index
51191debfc3dSmrg
51201debfc3dSmrg@printindex cp
51211debfc3dSmrg
51221debfc3dSmrg@contents
51231debfc3dSmrg@end ifinfo
51241debfc3dSmrg@bye
5125