OSDN Git Service

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