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