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