]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/install.texi
dwarf2out.c (reg_save): Use INVALID_REGNUM.
[thirdparty/gcc.git] / gcc / doc / install.texi
CommitLineData
f42974dc
DW
1\input texinfo.tex @c -*-texinfo-*-
2@c @ifnothtml
3@c %**start of header
d7f8491b 4@setfilename gccinstall.info
f42974dc
DW
5@settitle Installing GCC
6@setchapternewpage odd
7@c %**end of header
8@c @end ifnothtml
9
10@c Specify title for specific html page
11@ifset indexhtml
12@settitle Installing GCC
13@end ifset
14@ifset specifichtml
15@settitle Host/Target specific installation notes for GCC
16@end ifset
67b1fbb9
KG
17@ifset prerequisiteshtml
18@settitle Prerequisites for GCC
19@end ifset
f42974dc
DW
20@ifset downloadhtml
21@settitle Downloading GCC
22@end ifset
23@ifset configurehtml
24@settitle Installing GCC: Configuration
25@end ifset
26@ifset buildhtml
27@settitle Installing GCC: Building
28@end ifset
29@ifset testhtml
30@settitle Installing GCC: Testing
31@end ifset
32@ifset finalinstallhtml
33@settitle Installing GCC: Final installation
34@end ifset
35@ifset binarieshtml
36@settitle Installing GCC: Binaries
37@end ifset
73e2155a
JM
38@ifset oldhtml
39@settitle Installing GCC: Old documentation
40@end ifset
aed5964b
JM
41@ifset gfdlhtml
42@settitle Installing GCC: GNU Free Documentation License
43@end ifset
f42974dc 44
aed5964b 45@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
daef8bbd 46@c 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
f42974dc
DW
47@c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
48
49@c Include everything if we're not making html
50@ifnothtml
51@set indexhtml
52@set specifichtml
67b1fbb9 53@set prerequisiteshtml
f42974dc
DW
54@set downloadhtml
55@set configurehtml
56@set buildhtml
57@set testhtml
58@set finalinstallhtml
59@set binarieshtml
73e2155a 60@set oldhtml
aed5964b 61@set gfdlhtml
f42974dc
DW
62@end ifnothtml
63
64@c Part 2 Summary Description and Copyright
bdefb2ab 65@copying
aed5964b 66Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
daef8bbd 671999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
aed5964b
JM
68@sp 1
69Permission is granted to copy, distribute and/or modify this document
b3a8389d 70under the terms of the GNU Free Documentation License, Version 1.2 or
aed5964b
JM
71any later version published by the Free Software Foundation; with no
72Invariant Sections, the Front-Cover texts being (a) (see below), and
73with the Back-Cover Texts being (b) (see below). A copy of the
74license is included in the section entitled ``@uref{./gfdl.html,,GNU
75Free Documentation License}''.
76
77(a) The FSF's Front-Cover Text is:
78
79 A GNU Manual
80
81(b) The FSF's Back-Cover Text is:
82
83 You have freedom to copy and modify this GNU Manual, like GNU
84 software. Copies published by the Free Software Foundation raise
85 funds for GNU development.
bdefb2ab 86@end copying
f42974dc 87@ifinfo
bdefb2ab 88@insertcopying
f42974dc 89@end ifinfo
802f6d4b
JM
90@dircategory Programming
91@direntry
92* gccinstall: (gccinstall). Installing the GNU Compiler Collection.
93@end direntry
f42974dc
DW
94
95@c Part 3 Titlepage and Copyright
96@titlepage
97@sp 10
98@comment The title is printed in a large font.
ef88b07d 99@center @titlefont{Installing GCC}
f42974dc
DW
100
101@c The following two commands start the copyright page.
102@page
ef88b07d 103@vskip 0pt plus 1filll
bdefb2ab 104@insertcopying
f42974dc
DW
105@end titlepage
106
107@c Part 4 Top node and Master Menu
108@ifinfo
109@node Top, , , (dir)
110@comment node-name, next, Previous, up
111
112@menu
113* Installing GCC:: This document describes the generic installation
114 procedure for GCC as well as detailing some target
f9047ed3 115 specific installation instructions.
f42974dc
DW
116
117* Specific:: Host/target specific installation notes for GCC.
118* Binaries:: Where to get pre-compiled binaries.
119
73e2155a
JM
120* Old:: Old installation documentation.
121
aed5964b 122* GNU Free Documentation License:: How you can copy and share this manual.
f42974dc
DW
123* Concept Index:: This index has two entries.
124@end menu
125@end ifinfo
126
127@c Part 5 The Body of the Document
128@c ***Installing GCC**********************************************************
6cfb3f16 129@ifnothtml
f42974dc
DW
130@comment node-name, next, previous, up
131@node Installing GCC, Binaries, , Top
6cfb3f16 132@end ifnothtml
f42974dc 133@ifset indexhtml
f42974dc
DW
134@ifnothtml
135@chapter Installing GCC
136@end ifnothtml
137
138The latest version of this document is always available at
f9047ed3 139@uref{http://gcc.gnu.org/install/,,http://gcc.gnu.org/install/}.
f42974dc
DW
140
141This document describes the generic installation procedure for GCC as well
f9047ed3 142as detailing some target specific installation instructions.
f42974dc 143
f9047ed3
JM
144GCC includes several components that previously were separate distributions
145with their own installation instructions. This document supersedes all
eea81d3e 146package specific installation instructions.
f42974dc 147
f9047ed3 148@emph{Before} starting the build/install procedure please check the
f42974dc 149@ifnothtml
eea81d3e 150@ref{Specific, host/target specific installation notes}.
f42974dc 151@end ifnothtml
c009f01f 152@ifhtml
f9047ed3 153@uref{specific.html,,host/target specific installation notes}.
c009f01f 154@end ifhtml
f9047ed3 155We recommend you browse the entire generic installation instructions before
f42974dc
DW
156you proceed.
157
c009f01f 158Lists of successful builds for released versions of GCC are
daf2f129 159available at @uref{http://gcc.gnu.org/buildstat.html}.
c009f01f
JJ
160These lists are updated as new information becomes available.
161
f9047ed3 162The installation procedure itself is broken into five steps.
f42974dc
DW
163
164@ifinfo
165@menu
67b1fbb9 166* Prerequisites::
f42974dc
DW
167* Downloading the source::
168* Configuration::
169* Building::
170* Testing:: (optional)
171* Final install::
172@end menu
173@end ifinfo
c009f01f 174@ifhtml
f42974dc 175@enumerate
f9047ed3 176@item
67b1fbb9
KG
177@uref{prerequisites.html,,Prerequisites}
178@item
f42974dc 179@uref{download.html,,Downloading the source}
f42974dc 180@item
f9047ed3
JM
181@uref{configure.html,,Configuration}
182@item
183@uref{build.html,,Building}
184@item
185@uref{test.html,,Testing} (optional)
f42974dc
DW
186@item
187@uref{finalinstall.html,,Final install}
188@end enumerate
c009f01f 189@end ifhtml
f42974dc 190
38209993 191Please note that GCC does not support @samp{make uninstall} and probably
f9047ed3 192won't do so in the near future as this would open a can of worms. Instead,
f42974dc 193we suggest that you install GCC into a directory of its own and simply
38209993 194remove that directory when you do not need that specific version of GCC
eea81d3e
RO
195any longer, and, if shared libraries are installed there as well, no
196more binaries exist that use them.
f42974dc 197
73e2155a
JM
198@ifhtml
199There are also some @uref{old.html,,old installation instructions},
200which are mostly obsolete but still contain some information which has
201not yet been merged into the main part of this manual.
202@end ifhtml
203
f42974dc 204@html
b8db17af 205<hr />
f42974dc
DW
206<p>
207@end html
208@ifhtml
209@uref{./index.html,,Return to the GCC Installation page}
aed5964b 210
bdefb2ab 211@insertcopying
f42974dc
DW
212@end ifhtml
213@end ifset
214
67b1fbb9
KG
215@c ***Prerequisites**************************************************
216@ifnothtml
217@comment node-name, next, previous, up
218@node Prerequisites, Downloading the source, , Installing GCC
219@end ifnothtml
220@ifset prerequisiteshtml
221@ifnothtml
222@chapter Prerequisites
223@end ifnothtml
224@cindex Prerequisites
225
226GCC requires that various tools and packages be available for use in the
227build procedure. Modifying GCC sources requires additional tools
228described below.
229
230@heading Tools/packages necessary for building GCC
231@table @asis
232@item ISO C90 compiler
233Necessary to bootstrap the GCC package, although versions of GCC prior
234to 3.4 also allow bootstrapping with a traditional (K&R) C compiler.
235
236To make all languages in a cross-compiler or other configuration where
2373-stage bootstrap is not performed, you need to start with an existing
238GCC binary (version 2.95 or later) because source code for language
239frontends other than C might use GCC extensions.
240
241@item GNAT
242
243In order to build the Ada compiler (GNAT) you must already have GNAT
244installed because portions of the Ada frontend are written in Ada (with
245GNAT extensions.) Refer to the Ada installation instructions for more
246specific information.
247
248@item A ``working'' POSIX compatible shell, or GNU bash
249
250Necessary when running @command{configure} because some
251@command{/bin/sh} shells have bugs and may crash when configuring the
252target libraries. In other cases, @command{/bin/sh} or even some
253@command{ksh} have disastrous corner-case performance problems. This
254can cause target @command{configure} runs to literally take days to
255complete in some cases.
256
257So on some platforms @command{/bin/ksh} is sufficient, on others it
258isn't. See the host/target specific instructions for your platform, or
259use @command{bash} to be sure. Then set @env{CONFIG_SHELL} in your
260environment to your ``good'' shell prior to running
261@command{configure}/@command{make}.
262
daf2f129 263@command{zsh} is not a fully compliant POSIX shell and will not
a755e3c5 264work when configuring GCC.
1b49d06f 265
67b1fbb9
KG
266@item GNU binutils
267
268Necessary in some circumstances, optional in others. See the
269host/target specific instructions for your platform for the exact
270requirements.
271
272@item gzip version 1.2.4 (or later) or
273@itemx bzip2 version 1.0.2 (or later)
274
275Necessary to uncompress GCC @command{tar} files when source code is
276obtained via FTP mirror sites.
277
e158a5fb
MM
278@item GNU make version 3.79.1 (or later)
279
280You must have GNU make installed to build GCC.
281
67b1fbb9
KG
282@item GNU tar version 1.12 (or later)
283
284Necessary (only on some platforms) to untar the source code. Many
285systems' @command{tar} programs will also work, only try GNU
286@command{tar} if you have problems.
287
bda4d063
TS
288@item GNU Multiple Precision Library (GMP) version 4.0 (or later)
289
290Necessary to build the Fortran frontend. If you don't have it
291installed in your library search path, you will have to configure with
292the @option{--with-gmp} or @option{--with-gmp-dir} configure option.
293
67b1fbb9
KG
294@end table
295
296
297@heading Tools/packages necessary for modifying GCC
298@table @asis
0dce8934 299@item autoconf versions 2.13 and 2.59
67b1fbb9
KG
300@itemx GNU m4 version 1.4 (or later)
301
89acbae0 302Necessary when modifying @file{configure.ac}, @file{aclocal.m4}, etc.@:
4f3ce03f 303to regenerate @file{configure} and @file{config.in} files. Most
ccfca4ae
JM
304directories require autoconf 2.59 (exactly), but the toplevel and
305@file{libjava} (but not @file{libjava/libltdl}) still require autoconf
0dce8934 3062.13 (exactly).
67b1fbb9 307
0dce8934 308@item automake versions 1.4-gcj and 1.8.5
67b1fbb9
KG
309
310Necessary when modifying a @file{Makefile.am} file to regenerate its
ce5c1cf3
KC
311associated @file{Makefile.in}.
312
313Much of GCC does not use automake, so directly edit the @file{Makefile.in}
314file. Specifically this applies to the @file{gcc}, @file{intl},
ccfca4ae 315@file{libiberty}, @file{libobjc} directories as well as any
ce5c1cf3
KC
316of their subdirectories.
317
bf9a420e
PB
318The Java directory @file{libjava} requires a modified version of
319automake 1.4 downloadable from
ce5c1cf3 320@uref{ftp://gcc.gnu.org/pub/java/automake-gcj-1.4.tar.gz}.
4f3ce03f 321
0dce8934 322Every other directory requires automake 1.8.5.
ccfca4ae 323
4f3ce03f
JM
324@item gettext version 0.12 (or later)
325
326Needed to regenerate @file{gcc.pot}.
67b1fbb9
KG
327
328@item gperf version 2.7.2 (or later)
329
330Necessary when modifying @command{gperf} input files, e.g.@:
331@file{gcc/cp/cfns.gperf} to regenerate its associated header file, e.g.@:
332@file{gcc/cp/cfns.h}.
333
334@item expect version ???
335@itemx tcl version ???
cfc984b5 336@itemx dejagnu version 1.4.4 (or later)
67b1fbb9
KG
337
338Necessary to run the GCC testsuite.
339
340@item autogen version 5.5.4 (or later) and
341@itemx guile version 1.4.1 (or later)
342
343Necessary to regenerate @file{fixinc/fixincl.x} from
344@file{fixinc/inclhack.def} and @file{fixinc/*.tpl}.
345
346Necessary to run the @file{fixinc} @command{make check}.
347
ce5c1cf3 348Necessary to regenerate the top level @file{Makefile.in} file from
67b1fbb9
KG
349@file{Makefile.tpl} and @file{Makefile.def}.
350
351@item GNU Bison version 1.28 (or later)
352Berkeley @command{yacc} (@command{byacc}) is also reported to work other
353than for java.
354
355Necessary when modifying @file{*.y} files.
356
357Necessary to build GCC during development because the generated output
358files are not included in the CVS repository. They are included in
359releases.
360
361@item Flex version 2.5.4 (or later)
362
363Necessary when modifying @file{*.l} files.
364
365Necessary to build GCC during development because the generated output
366files are not included in the CVS repository. They are included in
367releases.
368
369@item Texinfo version 4.2 (or later)
370
371Necessary for running @command{makeinfo} when modifying @file{*.texi}
372files to test your changes.
373
374Necessary to build GCC documentation during development because the
375generated output files are not included in the CVS repository. They are
376included in releases.
377
378@item @TeX{} (any working version)
379
380Necessary for running @command{texi2dvi}, used when running
381@command{make dvi} to create DVI files.
382
383@item cvs version 1.10 (or later)
384@itemx ssh (any version)
385
386Necessary to access the CVS repository. Public releases and weekly
387snapshots of the development sources are also available via FTP.
388
389@item perl version 5.6.1 (or later)
390
391Necessary when regenerating @file{Makefile} dependencies in libiberty.
4f3ce03f
JM
392Necessary when regenerating @file{libiberty/functions.texi}.
393Necessary when generating manpages from Texinfo manuals.
394Used by various scripts to generate some files included in CVS (mainly
395Unicode-related and rarely changing) from source tables.
67b1fbb9
KG
396
397@item GNU diffutils version 2.7 (or later)
398
399Necessary when creating changes to GCC source code to submit for review.
400
401@item patch version 2.5.4 (or later)
402
403Necessary when applying patches, created with @command{diff}, to one's
404own sources.
405
406@end table
407
408@html
409<hr />
410<p>
411@end html
412@ifhtml
413@uref{./index.html,,Return to the GCC Installation page}
414@end ifhtml
415@end ifset
416
f42974dc 417@c ***Downloading the source**************************************************
6cfb3f16 418@ifnothtml
f42974dc 419@comment node-name, next, previous, up
67b1fbb9 420@node Downloading the source, Configuration, Prerequisites, Installing GCC
6cfb3f16 421@end ifnothtml
f42974dc 422@ifset downloadhtml
f42974dc
DW
423@ifnothtml
424@chapter Downloading GCC
425@end ifnothtml
426@cindex Downloading GCC
427@cindex Downloading the Source
428
eea81d3e
RO
429GCC is distributed via @uref{http://gcc.gnu.org/cvs.html,,CVS} and FTP
430tarballs compressed with @command{gzip} or
6cfb3f16 431@command{bzip2}. It is possible to download a full distribution or specific
f42974dc
DW
432components.
433
434Please refer to our @uref{http://gcc.gnu.org/releases.html,,releases web page}
161d7b59 435for information on how to obtain GCC@.
f42974dc 436
6de9cd9a
DN
437The full distribution includes the C, C++, Objective-C, Fortran 77, Fortran
438(in case of GCC 3.5 and later), Java, and Ada (in case of GCC 3.1 and later)
439compilers. The full distribution also includes runtime libraries for C++,
440Objective-C, Fortran 77, Fortran, and Java. In GCC 3.0 and later versions,
441GNU compiler testsuites are also included in the full distribution.
f42974dc
DW
442
443If you choose to download specific components, you must download the core
eea81d3e 444GCC distribution plus any language specific distributions you wish to
6c0a4eab 445use. The core distribution includes the C language front end as well as the
767094dd 446shared components. Each language has a tarball which includes the language
6c0a4eab 447front end as well as the language runtime (when appropriate).
f42974dc
DW
448
449Unpack the core distribution as well as any language specific
450distributions in the same directory.
451
452If you also intend to build binutils (either to upgrade an existing
453installation or for use in place of the corresponding tools of your
454OS), unpack the binutils distribution either in the same directory or
455a separate one. In the latter case, add symbolic links to any
456components of the binutils you intend to build alongside the compiler
6cfb3f16
JM
457(@file{bfd}, @file{binutils}, @file{gas}, @file{gprof}, @file{ld},
458@file{opcodes}, @dots{}) to the directory containing the GCC sources.
f42974dc
DW
459
460@html
b8db17af 461<hr />
f42974dc
DW
462<p>
463@end html
464@ifhtml
465@uref{./index.html,,Return to the GCC Installation page}
466@end ifhtml
467@end ifset
468
469@c ***Configuration***********************************************************
6cfb3f16 470@ifnothtml
f42974dc
DW
471@comment node-name, next, previous, up
472@node Configuration, Building, Downloading the source, Installing GCC
6cfb3f16 473@end ifnothtml
f42974dc 474@ifset configurehtml
f42974dc
DW
475@ifnothtml
476@chapter Installing GCC: Configuration
477@end ifnothtml
478@cindex Configuration
479@cindex Installing GCC: Configuration
480
481Like most GNU software, GCC must be configured before it can be built.
482This document describes the recommended configuration procedure
483for both native and cross targets.
484
38209993
LG
485We use @var{srcdir} to refer to the toplevel source directory for
486GCC; we use @var{objdir} to refer to the toplevel build/object directory.
487
488If you obtained the sources via CVS, @var{srcdir} must refer to the top
489@file{gcc} directory, the one where the @file{MAINTAINERS} can be found,
490and not its @file{gcc} subdirectory, otherwise the build will fail.
f42974dc 491
b4b0fb02
RO
492If either @var{srcdir} or @var{objdir} is located on an automounted NFS
493file system, the shell's built-in @command{pwd} command will return
494temporary pathnames. Using these can lead to various sorts of build
495problems. To avoid this issue, set the @env{PWDCMD} environment
496variable to an automounter-aware @command{pwd} command, e.g.,
7ba4ca63 497@command{pawd} or @samp{amq -w}, during the configuration and build
b4b0fb02
RO
498phases.
499
102b60d1
GP
500First, we @strong{highly} recommend that GCC be built into a
501separate directory than the sources which does @strong{not} reside
502within the source tree. This is how we generally build GCC; building
503where @var{srcdir} == @var{objdir} should still work, but doesn't
504get extensive testing; building where @var{objdir} is a subdirectory
505of @var{srcdir} is unsupported.
f42974dc 506
eea81d3e 507If you have previously built GCC in the same directory for a
f85b8d1a 508different target machine, do @samp{make distclean} to delete all files
377dfc82
GP
509that might be invalid. One of the files this deletes is @file{Makefile};
510if @samp{make distclean} complains that @file{Makefile} does not exist
511or issues a message like ``don't know how to make distclean'' it probably
512means that the directory is already suitably clean. However, with the
513recommended method of building in a separate @var{objdir}, you should
514simply use a different @var{objdir} for each target.
f85b8d1a 515
38209993
LG
516Second, when configuring a native system, either @command{cc} or
517@command{gcc} must be in your path or you must set @env{CC} in
df002c7d
DE
518your environment before running configure. Otherwise the configuration
519scripts may fail.
f42974dc 520
eea81d3e
RO
521Note that the bootstrap compiler and the resulting GCC must be link
522compatible, else the bootstrap will fail with linker errors about
523incompatible object file formats. Several multilibed targets are
e69aa433
GP
524affected by this requirement, see
525@ifnothtml
526@ref{Specific, host/target specific installation notes}.
527@end ifnothtml
c009f01f 528@ifhtml
e69aa433 529@uref{specific.html,,host/target specific installation notes}.
c009f01f 530@end ifhtml
eea81d3e 531
f42974dc
DW
532To configure GCC:
533
3ab51846 534@smallexample
38209993
LG
535 % mkdir @var{objdir}
536 % cd @var{objdir}
eea81d3e 537 % @var{srcdir}/configure [@var{options}] [@var{target}]
3ab51846 538@end smallexample
f42974dc
DW
539
540
ef88b07d 541@heading Target specification
f42974dc
DW
542@itemize @bullet
543@item
38209993 544GCC has code to correctly determine the correct value for @var{target}
f9047ed3 545for nearly all native systems. Therefore, we highly recommend you not
f42974dc
DW
546provide a configure target when configuring a native compiler.
547
548@item
6cfb3f16 549@var{target} must be specified as @option{--target=@var{target}}
f9047ed3 550when configuring a cross compiler; examples of valid targets would be
a4a4b1d3 551m68k-coff, sh-elf, etc.
f42974dc
DW
552
553@item
6cfb3f16 554Specifying just @var{target} instead of @option{--target=@var{target}}
38209993 555implies that the host defaults to @var{target}.
f42974dc
DW
556@end itemize
557
558
ef88b07d 559@heading Options specification
f42974dc 560
ef88b07d 561Use @var{options} to override several configure time options for
7ba4ca63 562GCC@. A list of supported @var{options} follows; @samp{configure
80f9249a
JM
563--help} may list other options, but those not listed below may not
564work and should not normally be used.
f42974dc 565
c1c3bb0c
ME
566Note that each @option{--enable} option has a corresponding
567@option{--disable} option and that each @option{--with} option has a
568corresponding @option{--without} option.
569
ef88b07d
JM
570@table @code
571@item --prefix=@var{dirname}
572Specify the toplevel installation
f42974dc
DW
573directory. This is the recommended way to install the tools into a directory
574other than the default. The toplevel installation directory defaults to
6cfb3f16 575@file{/usr/local}.
f42974dc 576
38209993 577We @strong{highly} recommend against @var{dirname} being the same or a
a7582c8c
BE
578subdirectory of @var{objdir} or vice versa. If specifying a directory
579beneath a user's home directory tree, some shells will not expand
580@var{dirname} correctly if it contains the @samp{~} metacharacter; use
581@env{$HOME} instead.
f42974dc 582
8e5f33ff
GK
583The following standard @command{autoconf} options are supported. Normally you
584should not need to use these options.
ef88b07d 585@table @code
ab130aa5
JM
586@item --exec-prefix=@var{dirname}
587Specify the toplevel installation directory for architecture-dependent
588files. The default is @file{@var{prefix}}.
589
590@item --bindir=@var{dirname}
591Specify the installation directory for the executables called by users
592(such as @command{gcc} and @command{g++}). The default is
593@file{@var{exec-prefix}/bin}.
594
595@item --libdir=@var{dirname}
596Specify the installation directory for object code libraries and
8e5f33ff
GK
597internal data files of GCC@. The default is @file{@var{exec-prefix}/lib}.
598
599@item --libexecdir=@var{dirname}
600Specify the installation directory for internal executables of GCC@.
601 The default is @file{@var{exec-prefix}/libexec}.
ab130aa5
JM
602
603@item --with-slibdir=@var{dirname}
604Specify the installation directory for the shared libgcc library. The
605default is @file{@var{libdir}}.
606
607@item --infodir=@var{dirname}
608Specify the installation directory for documentation in info format.
609The default is @file{@var{prefix}/info}.
610
8567c70f
TT
611@item --datadir=@var{dirname}
612Specify the installation directory for some architecture-independent
613data files referenced by GCC@. The default is @file{@var{prefix}/share}.
614
ab130aa5
JM
615@item --mandir=@var{dirname}
616Specify the installation directory for manual pages. The default is
617@file{@var{prefix}/man}. (Note that the manual pages are only extracts from
8e9a4a45 618the full GCC manuals, which are provided in Texinfo format. The manpages
ab130aa5
JM
619are derived by an automatic conversion process from parts of the full
620manual.)
621
ef88b07d
JM
622@item --with-gxx-include-dir=@var{dirname}
623Specify
eea81d3e 624the installation directory for G++ header files. The default is
e0b24bce 625@file{@var{prefix}/include/c++/@var{version}}.
ecb7d6b3 626
ef88b07d 627@end table
f42974dc 628
b21d216c
AF
629@item --program-prefix=@var{prefix}
630GCC supports some transformations of the names of its programs when
631installing them. This option prepends @var{prefix} to the names of
632programs to install in @var{bindir} (see above). For example, specifying
633@option{--program-prefix=foo-} would result in @samp{gcc}
634being installed as @file{/usr/local/bin/foo-gcc}.
635
636@item --program-suffix=@var{suffix}
637Appends @var{suffix} to the names of programs to install in @var{bindir}
638(see above). For example, specifying @option{--program-suffix=-3.1}
639would result in @samp{gcc} being installed as
640@file{/usr/local/bin/gcc-3.1}.
641
642@item --program-transform-name=@var{pattern}
643Applies the @samp{sed} script @var{pattern} to be applied to the names
644of programs to install in @var{bindir} (see above). @var{pattern} has to
645consist of one or more basic @samp{sed} editing commands, separated by
646semicolons. For example, if you want the @samp{gcc} program name to be
647transformed to the installed program @file{/usr/local/bin/myowngcc} and
648the @samp{g++} program name to be transformed to
649@file{/usr/local/bin/gspecial++} without changing other program names,
650you could use the pattern
651@option{--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/'}
652to achieve this effect.
653
654All three options can be combined and used together, resulting in more
655complex conversion patterns. As a basic rule, @var{prefix} (and
656@var{suffix}) are prepended (appended) before further transformations
657can happen with a special transformation script @var{pattern}.
658
8c085f6f 659As currently implemented, this option only takes effect for native
b21d216c 660builds; cross compiler binaries' names are not transformed even when a
8c085f6f 661transformation is explicitly asked for by one of these options.
b21d216c
AF
662
663For native builds, some of the installed programs are also installed
664with the target alias in front of their name, as in
665@samp{i686-pc-linux-gnu-gcc}. All of the above transformations happen
666before the target alias is prepended to the name - so, specifying
667@option{--program-prefix=foo-} and @option{program-suffix=-3.1}, the
668resulting binary would be installed as
669@file{/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1}.
670
8ecab453 671As a last shortcoming, none of the installed Ada programs are
b21d216c
AF
672transformed yet, which will be fixed in some time.
673
ef88b07d
JM
674@item --with-local-prefix=@var{dirname}
675Specify the
6ac48571
JM
676installation directory for local include files. The default is
677@file{/usr/local}. Specify this option if you want the compiler to
678search directory @file{@var{dirname}/include} for locally installed
679header files @emph{instead} of @file{/usr/local/include}.
680
681You should specify @option{--with-local-prefix} @strong{only} if your
682site has a different convention (not @file{/usr/local}) for where to put
683site-specific files.
684
685The default value for @option{--with-local-prefix} is @file{/usr/local}
686regardless of the value of @option{--prefix}. Specifying
687@option{--prefix} has no effect on which directory GCC searches for
688local header files. This may seem counterintuitive, but actually it is
689logical.
690
691The purpose of @option{--prefix} is to specify where to @emph{install
692GCC}. The local header files in @file{/usr/local/include}---if you put
161d7b59 693any in that directory---are not part of GCC@. They are part of other
6ac48571
JM
694programs---perhaps many others. (GCC installs its own header files in
695another directory which is based on the @option{--prefix} value.)
696
48209ce5
JDA
697Both the local-prefix include directory and the GCC-prefix include
698directory are part of GCC's "system include" directories. Although these
699two directories are not fixed, they need to be searched in the proper
700order for the correct processing of the include_next directive. The
701local-prefix include directory is searched before the GCC-prefix
702include directory. Another characteristic of system include directories
703is that pedantic warnings are turned off for headers in these directories.
704
705Some autoconf macros add @option{-I @var{directory}} options to the
706compiler command line, to ensure that directories containing installed
707packages' headers are searched. When @var{directory} is one of GCC's
708system include directories, GCC will ignore the option so that system
709directories continue to be processed in the correct order. This
710may result in a search order different from what was specified but the
711directory will still be searched.
712
713GCC automatically searches for ordinary libraries using
714@env{GCC_EXEC_PREFIX}. Thus, when the same installation prefix is
715used for both GCC and packages, GCC will automatically search for
716both headers and libraries. This provides a configuration that is
717easy to use. GCC behaves in a manner similar to that when it is
718installed as a system compiler in @file{/usr}.
719
720Sites that need to install multiple versions of GCC may not want to
721use the above simple configuration. It is possible to use the
722@option{--program-prefix}, @option{--program-suffix} and
723@option{--program-transform-name} options to install multiple versions
724into a single directory, but it may be simpler to use different prefixes
725and the @option{--with-local-prefix} option to specify the location of the
726site-specific files for each version. It will then be necessary for
727users to specify explicitly the location of local site libraries
728(e.g., with @env{LIBRARY_PATH}).
729
730The same value can be used for both @option{--with-local-prefix} and
731@option{--prefix} provided it is not @file{/usr}. This can be used
732to avoid the default search of @file{/usr/local/include}.
733
6ac48571
JM
734@strong{Do not} specify @file{/usr} as the @option{--with-local-prefix}!
735The directory you use for @option{--with-local-prefix} @strong{must not}
736contain any of the system's standard header files. If it did contain
737them, certain programs would be miscompiled (including GNU Emacs, on
738certain targets), because this would override and nullify the header
4c64396e 739file corrections made by the @command{fixincludes} script.
6ac48571
JM
740
741Indications are that people who use this option use it based on mistaken
742ideas of what it is for. People use it as if it specified where to
161d7b59 743install part of GCC@. Perhaps they make this assumption because
6ac48571
JM
744installing GCC creates the directory.
745
6cfb3f16 746@item --enable-shared[=@var{package}[,@dots{}]]
0cb98517
AO
747Build shared versions of libraries, if shared libraries are supported on
748the target platform. Unlike GCC 2.95.x and earlier, shared libraries
07659e97 749are enabled by default on all platforms that support shared libraries.
0cb98517
AO
750
751If a list of packages is given as an argument, build shared libraries
752only for the listed packages. For other packages, only static libraries
753will be built. Package names currently recognized in the GCC tree are
754@samp{libgcc} (also known as @samp{gcc}), @samp{libstdc++} (not
e22df315 755@samp{libstdc++-v3}), @samp{libffi}, @samp{zlib}, @samp{boehm-gc},
07659e97 756@samp{ada}, @samp{libada}, @samp{libjava} and @samp{libobjc}.
55c45226 757Note @samp{libiberty} does not support shared libraries at all.
0cb98517
AO
758
759Use @option{--disable-shared} to build only static libraries. Note that
760@option{--disable-shared} does not accept a list of package names as
761argument, only @option{--enable-shared} does.
f42974dc 762
ef88b07d
JM
763@item @anchor{with-gnu-as}--with-gnu-as
764Specify that the compiler should assume that the
767094dd 765assembler it finds is the GNU assembler. However, this does not modify
377dfc82
GP
766the rules to find an assembler and will result in confusion if the
767assembler found is not actually the GNU assembler. (Confusion may also
8c26c999
JM
768result if the compiler finds the GNU assembler but has not been
769configured with @option{--with-gnu-as}.) If you have more than one
38209993 770assembler installed on your system, you may want to use this option in
eea81d3e 771connection with @option{--with-as=@var{pathname}}.
38209993 772
8c085f6f
JJ
773The following systems are the only ones where it makes a difference
774whether you use the GNU assembler. On any other system,
775@option{--with-gnu-as} has no effect.
776
2ff16718 777@itemize @bullet
8c085f6f
JJ
778@item @samp{hppa1.0-@var{any}-@var{any}}
779@item @samp{hppa1.1-@var{any}-@var{any}}
780@item @samp{i386-@var{any}-sysv}
8c085f6f
JJ
781@item @samp{m68k-bull-sysv}
782@item @samp{m68k-hp-hpux}
8c085f6f
JJ
783@item @samp{m68000-hp-hpux}
784@item @samp{m68000-att-sysv}
785@item @samp{@var{any}-lynx-lynxos}
786@item @samp{mips-@var{any}}
8f2afc21
EB
787@item @samp{sparc-sun-solaris2.@var{any}}
788@item @samp{sparc64-@var{any}-solaris2.@var{any}}
8c085f6f 789@end itemize
8c26c999 790
8f2afc21
EB
791On the systems listed above (except for the HP-PA, the SPARC, for ISC on
792the 386, and for @samp{mips-sgi-irix5.*}), if you use the GNU assembler,
8c26c999
JM
793you should also use the GNU linker (and specify @option{--with-gnu-ld}).
794
8f2afc21 795@item @anchor{with-as}--with-as=@var{pathname}
ef88b07d 796Specify that the
38209993
LG
797compiler should use the assembler pointed to by @var{pathname}, rather
798than the one found by the standard rules to find an assembler, which
799are:
f42974dc
DW
800@itemize @bullet
801@item
8e5f33ff
GK
802Check the @file{@var{libexec}/gcc/@var{target}/@var{version}}
803directory, where @var{libexec} defaults to
804@file{@var{exec-prefix}/libexec} and @var{exec-prefix} defaults to
805@var{prefix} which defaults to @file{/usr/local} unless overridden by
806the @option{--prefix=@var{pathname}} switch described
807above. @var{target} is the target system triple, such as
808@samp{sparc-sun-solaris2.7}, and @var{version} denotes the GCC
809version, such as 3.0.
f42974dc 810@item
e979f9e8 811Check operating system specific directories (e.g.@: @file{/usr/ccs/bin} on
250d5688 812Sun Solaris 2).
f42974dc 813@end itemize
767094dd 814Note that these rules do not check for the value of @env{PATH}. You may
38209993
LG
815want to use @option{--with-as} if no assembler is installed in the
816directories listed above, or if you have multiple assemblers installed
817and want to choose one that is not found by the above rules.
f42974dc 818
ef88b07d
JM
819@item @anchor{with-gnu-ld}--with-gnu-ld
820Same as @uref{#with-gnu-as,,@option{--with-gnu-as}}
8f2afc21 821but for the linker.
f42974dc 822
eea81d3e 823@item --with-ld=@var{pathname}
8f2afc21
EB
824Same as @uref{#with-as,,@option{--with-as}}
825but for the linker.
f42974dc 826
ef88b07d
JM
827@item --with-stabs
828Specify that stabs debugging
38209993
LG
829information should be used instead of whatever format the host normally
830uses. Normally GCC uses the same debug format as the host system.
f42974dc 831
8c26c999
JM
832On MIPS based systems and on Alphas, you must specify whether you want
833GCC to create the normal ECOFF debugging format, or to use BSD-style
834stabs passed through the ECOFF symbol table. The normal ECOFF debug
161d7b59
JM
835format cannot fully handle languages other than C@. BSD stabs format can
836handle other languages, but it only works with the GNU debugger GDB@.
8c26c999
JM
837
838Normally, GCC uses the ECOFF debugging format by default; if you
161d7b59 839prefer BSD stabs, specify @option{--with-stabs} when you configure GCC@.
8c26c999
JM
840
841No matter which default you choose when you configure GCC, the user
842can use the @option{-gcoff} and @option{-gstabs+} options to specify explicitly
843the debug format for a particular compilation.
844
845@option{--with-stabs} is meaningful on the ISC system on the 386, also, if
846@option{--with-gas} is used. It selects use of stabs debugging
847information embedded in COFF output. This kind of debugging information
848supports C++ well; ordinary COFF debugging information does not.
849
850@option{--with-stabs} is also meaningful on 386 systems running SVR4. It
851selects use of stabs debugging information embedded in ELF output. The
852C++ compiler currently (2.6.0) does not support the DWARF debugging
853information normally used on 386 SVR4 platforms; stabs provide a
854workable alternative. This requires gas and gdb, as the normal SVR4
855tools can not generate or interpret stabs.
856
eea81d3e 857@item --disable-multilib
ef88b07d 858Specify that multiple target
eea81d3e
RO
859libraries to support different target variants, calling
860conventions, etc should not be built. The default is to build a
861predefined set of them.
f42974dc 862
e8515283
DE
863Some targets provide finer-grained control over which multilibs are built
864(e.g., @option{--disable-softfloat}):
865@table @code
e8515283
DE
866@item arc-*-elf*
867biendian.
868
869@item arm-*-*
870fpu, 26bit, underscore, interwork, biendian, nofmult.
871
872@item m68*-*-*
873softfloat, m68881, m68000, m68020.
874
875@item mips*-*-*
876single-float, biendian, softfloat.
877
878@item powerpc*-*-*, rs6000*-*-*
879aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian,
f282ffb3 880sysv, aix.
e8515283
DE
881
882@end table
883
ef88b07d
JM
884@item --enable-threads
885Specify that the target
38209993
LG
886supports threads. This affects the Objective-C compiler and runtime
887library, and exception handling for other languages like C++ and Java.
6ac48571 888On some systems, this is the default.
f42974dc 889
f6160ed5
LR
890In general, the best (and, in many cases, the only known) threading
891model available will be configured for use. Beware that on some
2dd76960 892systems, GCC has not been taught what threading models are generally
3c6bb1db
LR
893available for the system. In this case, @option{--enable-threads} is an
894alias for @option{--enable-threads=single}.
f6160ed5
LR
895
896@item --disable-threads
897Specify that threading support should be disabled for the system.
3c6bb1db 898This is an alias for @option{--enable-threads=single}.
f6160ed5 899
ef88b07d
JM
900@item --enable-threads=@var{lib}
901Specify that
38209993
LG
902@var{lib} is the thread support library. This affects the Objective-C
903compiler and runtime library, and exception handling for other languages
f85b8d1a
JM
904like C++ and Java. The possibilities for @var{lib} are:
905
906@table @code
907@item aix
908AIX thread support.
909@item dce
910DCE thread support.
4c80872c
RK
911@item gnat
912Ada tasking support. For non-Ada programs, this setting is equivalent
913to @samp{single}. When used in conjunction with the Ada run time, it
914causes GCC to use the same thread primitives as Ada uses. This option
915is necessary when using both Ada and the back end exception handling,
916which is the default for most Ada targets.
f85b8d1a 917@item mach
eea81d3e 918Generic MACH thread support, known to work on NeXTSTEP@. (Please note
3c6bb1db 919that the file needed to support this configuration, @file{gthr-mach.h}, is
f6160ed5
LR
920missing and thus this setting will cause a known bootstrap failure.)
921@item no
922This is an alias for @samp{single}.
f85b8d1a 923@item posix
c771326b 924Generic POSIX thread support.
f6160ed5
LR
925@item rtems
926RTEMS thread support.
f85b8d1a
JM
927@item single
928Disable thread support, should work for all platforms.
929@item solaris
eea81d3e 930Sun Solaris 2 thread support.
f85b8d1a
JM
931@item vxworks
932VxWorks thread support.
933@item win32
934Microsoft Win32 API thread support.
935@end table
f42974dc 936
ef88b07d 937@item --with-cpu=@var{cpu}
7816bea0
DJ
938Specify which cpu variant the compiler should generate code for by default.
939@var{cpu} will be used as the default value of the @option{-mcpu=} switch.
940This option is only supported on some targets, including ARM, i386, PowerPC,
941and SPARC@.
942
943@item --with-schedule=@var{cpu}
944@itemx --with-arch=@var{cpu}
945@itemx --with-tune=@var{cpu}
946@itemx --with-abi=@var{abi}
9b66ebb1 947@itemx --with-fpu=@var{type}
7816bea0
DJ
948@itemx --with-float=@var{type}
949These configure options provide default values for the @option{-mschedule=},
9b66ebb1
PB
950@option{-march=}, @option{-mtune=}, @option{-mabi=}, and @option{-mfpu=}
951options and for @option{-mhard-float} or @option{-msoft-float}. As with
952@option{--with-cpu}, which switches will be accepted and acceptable values
953of the arguments depend on the target.
f42974dc 954
a004eb82
AH
955@item --enable-altivec
956Specify that the target supports AltiVec vector enhancements. This
957option will adjust the ABI for AltiVec enhancements, as well as generate
958AltiVec code when appropriate. This option is only available for
959PowerPC systems.
960
354b7da5
DH
961@item --enable-__cxa_atexit
962Define if you want to use __cxa_atexit, rather than atexit, to
963register C++ destructors for local statics and global objects.
964This is essential for fully standards-compliant handling of
965destructors, but requires __cxa_atexit in libc. This option is currently
e53e0c56 966only available on systems with GNU libc. When enabled, this will cause
354b7da5
DH
967@option{-fuse-cxa-exit} to be passed by default.
968
ef88b07d
JM
969@item --enable-target-optspace
970Specify that target
38209993
LG
971libraries should be optimized for code space instead of code speed.
972This is the default for the m32r platform.
f42974dc 973
ab130aa5
JM
974@item --disable-cpp
975Specify that a user visible @command{cpp} program should not be installed.
976
977@item --with-cpp-install-dir=@var{dirname}
978Specify that the user visible @command{cpp} program should be installed
979in @file{@var{prefix}/@var{dirname}/cpp}, in addition to @var{bindir}.
f42974dc 980
07cf4226
DM
981@item --enable-initfini-array
982Force the use of sections @code{.init_array} and @code{.fini_array}
983(instead of @code{.init} and @code{.fini}) for constructors and
984destructors. Option @option{--disable-initfini-array} has the
985opposite effect. If neither option is specified, the configure script
986will try to guess whether the @code{.init_array} and
987@code{.fini_array} sections are supported and, if they are, use them.
988
ef88b07d
JM
989@item --enable-maintainer-mode
990The build rules that
6cfb3f16 991regenerate the GCC master message catalog @file{gcc.pot} are normally
767094dd
JM
992disabled. This is because it can only be rebuilt if the complete source
993tree is present. If you have changed the sources and want to rebuild the
6ac48571 994catalog, configuring with @option{--enable-maintainer-mode} will enable
767094dd 995this. Note that you need a recent version of the @code{gettext} tools
6ac48571
JM
996to do so.
997
51b9ff45
KC
998@item --enable-generated-files-in-srcdir
999Neither the .c and .h files that are generated from bison and flex nor the
1000info manuals and man pages that are built from the .texi files are present
1001in the CVS development tree. When building GCC from that development tree,
1002or from a snapshot which are created from CVS, then those generated files
1003are placed in your build directory, which allows for the source to be in a
1004readonly directory.
1005
1006If you configure with @option{--enable-generated-files-in-srcdir} then those
1007generated files will go into the source directory. This is mainly intended
1008for generating release or prerelease tarballs of the GCC sources, since it
1009is not a requirement that the users of source releases to have flex, bison, or
daf2f129 1010makeinfo.
51b9ff45 1011
ef88b07d
JM
1012@item --enable-version-specific-runtime-libs
1013Specify
38209993 1014that runtime libraries should be installed in the compiler specific
8e5f33ff
GK
1015subdirectory (@file{@var{libdir}/gcc}) rather than the usual places. In
1016addition, @samp{libstdc++}'s include files will be installed into
1017@file{@var{libdir}} unless you overruled it by using
6cfb3f16 1018@option{--with-gxx-include-dir=@var{dirname}}. Using this option is
38209993 1019particularly useful if you intend to use several versions of GCC in
b9034bbd
AJ
1020parallel. This is currently supported by @samp{libgfortran},
1021@samp{libjava}, @samp{libmudflap}, @samp{libstdc++}, and @samp{libobjc}.
1022
38209993 1023
ef88b07d
JM
1024@item --enable-languages=@var{lang1},@var{lang2},@dots{}
1025Specify that only a particular subset of compilers and
767094dd 1026their runtime libraries should be built. For a list of valid values for
6cfb3f16 1027@var{langN} you can issue the following command in the
eea81d3e 1028@file{gcc} directory of your GCC source tree:@*
3ab51846 1029@smallexample
eea81d3e 1030grep language= */config-lang.in
3ab51846 1031@end smallexample
eea81d3e 1032Currently, you can use any of the following:
6de9cd9a
DN
1033@code{ada}, @code{c}, @code{c++}, @code{f77}, @code{f95}, @code{java},
1034@code{objc}.
8ecab453 1035Building the Ada compiler has special requirements, see below.@*
38209993 1036If you do not pass this flag, all languages available in the @file{gcc}
6cfb3f16 1037sub-tree will be configured. Re-defining @code{LANGUAGES} when calling
ef88b07d 1038@samp{make bootstrap} @strong{does not} work anymore, as those
38209993 1039language sub-directories might not have been configured!
f42974dc 1040
cd271054
AC
1041@item --disable-libada
1042Specify that the run-time libraries and tools used by GNAT should not
1043be built. This can be useful for debugging, or for compatibility with
c2910edf 1044previous Ada build procedures, when it was required to explicitly
cd271054
AC
1045do a @samp{make -C gcc gnatlib_and_tools}.
1046
ef88b07d
JM
1047@item --with-dwarf2
1048Specify that the compiler should
eea81d3e 1049use DWARF 2 debugging information as the default.
f85b8d1a
JM
1050
1051@item --enable-win32-registry
eea81d3e 1052@itemx --enable-win32-registry=@var{key}
f85b8d1a 1053@itemx --disable-win32-registry
95fef11f 1054The @option{--enable-win32-registry} option enables Microsoft Windows-hosted GCC
f85b8d1a
JM
1055to look up installations paths in the registry using the following key:
1056
1057@smallexample
eea81d3e 1058@code{HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\@var{key}}
f85b8d1a
JM
1059@end smallexample
1060
eea81d3e
RO
1061@var{key} defaults to GCC version number, and can be overridden by the
1062@option{--enable-win32-registry=@var{key}} option. Vendors and distributors
f85b8d1a
JM
1063who use custom installers are encouraged to provide a different key,
1064perhaps one comprised of vendor name and GCC version number, to
767094dd 1065avoid conflict with existing installations. This feature is enabled
6cfb3f16 1066by default, and can be disabled by @option{--disable-win32-registry}
f85b8d1a
JM
1067option. This option has no effect on the other hosts.
1068
1069@item --nfp
1070Specify that the machine does not have a floating point unit. This
c9693e96
LH
1071option only applies to @samp{m68k-sun-sunos@var{n}}. On any other
1072system, @option{--nfp} has no effect.
f85b8d1a 1073
dd859b8a
KG
1074@item --enable-werror
1075@itemx --disable-werror
1076@itemx --enable-werror=yes
1077@itemx --enable-werror=no
1078When you specify this option, it controls whether certain files in the
1079compiler are built with @option{-Werror} in bootstrap stage2 and later.
1080If you don't specify it, @option{-Werror} is turned on for the main
1081development trunk. However it defaults to off for release branches and
1082final releases. The specific files which get @option{-Werror} are
1083controlled by the Makefiles.
1084
f85b8d1a
JM
1085@item --enable-checking
1086@itemx --enable-checking=@var{list}
1087When you specify this option, the compiler is built to perform checking
1088of tree node types when referencing fields of that node, and some other
1089internal consistency checks. This does not change the generated code,
1090but adds error checking within the compiler. This will slow down the
1091compiler and may only work properly if you are building the compiler
161d7b59 1092with GCC@. This is on by default when building from CVS or snapshots,
f85b8d1a
JM
1093but off for releases. More control over the checks may be had by
1094specifying @var{list}; the categories of checks available are
c2f82a84 1095@samp{misc}, @samp{tree}, @samp{gc}, @samp{rtl}, @samp{rtlflag},
5dfa45d0
JJ
1096@samp{fold}, @samp{gcac} and @samp{valgrind}. The check @samp{valgrind}
1097requires the external @command{valgrind} simulator, available from
e0c99e15 1098@uref{http://valgrind.kde.org/}. The default when @var{list} is
c2f82a84
HPN
1099not specified is @samp{misc,tree,gc,rtlflag}; the checks @samp{rtl},
1100@samp{gcac} and @samp{valgrind} are very expensive.
f85b8d1a 1101
22aa533e 1102@item --enable-coverage
31775d31 1103@itemx --enable-coverage=@var{level}
22aa533e
NS
1104With this option, the compiler is built to collect self coverage
1105information, every time it is run. This is for internal development
1106purposes, and only works when the compiler is being built with gcc. The
1107@var{level} argument controls whether the compiler is built optimized or
1108not, values are @samp{opt} and @samp{noopt}. For coverage analysis you
1109want to disable optimization, for performance analysis you want to
1110enable optimization. When coverage is enabled, the default level is
1111without optimization.
1112
439a7e54 1113@item --enable-gather-detailed-mem-stats
95ea367d 1114When this option is specified more detailed information on memory
439a7e54 1115allocation is gathered. This information is printed when using
daf2f129 1116@option{-fmem-report}.
439a7e54 1117
f85b8d1a
JM
1118@item --enable-nls
1119@itemx --disable-nls
6cfb3f16 1120The @option{--enable-nls} option enables Native Language Support (NLS),
f85b8d1a 1121which lets GCC output diagnostics in languages other than American
767094dd 1122English. Native Language Support is enabled by default if not doing a
161d7b59 1123canadian cross build. The @option{--disable-nls} option disables NLS@.
f85b8d1a
JM
1124
1125@item --with-included-gettext
c771326b 1126If NLS is enabled, the @option{--with-included-gettext} option causes the build
021c4bfd 1127procedure to prefer its copy of GNU @command{gettext}.
f85b8d1a
JM
1128
1129@item --with-catgets
1130If NLS is enabled, and if the host lacks @code{gettext} but has the
1131inferior @code{catgets} interface, the GCC build procedure normally
1132ignores @code{catgets} and instead uses GCC's copy of the GNU
6cfb3f16 1133@code{gettext} library. The @option{--with-catgets} option causes the
f85b8d1a 1134build procedure to use the host's @code{catgets} in this situation.
80f9249a 1135
5304400d
CR
1136@item --with-libiconv-prefix=@var{dir}
1137Search for libiconv header files in @file{@var{dir}/include} and
1138libiconv library files in @file{@var{dir}/lib}.
1139
9340544b
ZW
1140@item --enable-obsolete
1141Enable configuration for an obsoleted system. If you attempt to
1142configure GCC for a system (build, host, or target) which has been
1143obsoleted, and you do not specify this flag, configure will halt with an
1144error message.
1145
1146All support for systems which have been obsoleted in one release of GCC
1147is removed entirely in the next major release, unless someone steps
1148forward to maintain the port.
ef88b07d 1149@end table
f42974dc 1150
c1c3bb0c
ME
1151@subheading Cross-Compiler-Specific Options
1152The following options only apply to building cross compilers.
ef88b07d 1153@table @code
4977bab6
ZW
1154@item --with-sysroot
1155@itemx --with-sysroot=@var{dir}
1156Tells GCC to consider @var{dir} as the root of a tree that contains a
1157(subset of) the root filesystem of the target operating system.
1158Target system headers, libraries and run-time object files will be
1159searched in there. The specified directory is not copied into the
1160install tree, unlike the options @option{--with-headers} and
1161@option{--with-libs} that this option obsoletes. The default value,
1162in case @option{--with-sysroot} is not given an argument, is
047d636f
DJ
1163@option{$@{gcc_tooldir@}/sys-root}. If the specified directory is a
1164subdirectory of @option{$@{exec_prefix@}}, then it will be found relative to
1165the GCC binaries if the installation tree is moved.
4977bab6 1166
65a824f6
JT
1167@item --with-headers
1168@itemx --with-headers=@var{dir}
4977bab6 1169Deprecated in favor of @option{--with-sysroot}.
65a824f6
JT
1170Specifies that target headers are available when building a cross compiler.
1171The @var{dir} argument specifies a directory which has the target include
1172files. These include files will be copied into the @file{gcc} install
1173directory. @emph{This option with the @var{dir} argument is required} when
1174building a cross compiler, if @file{@var{prefix}/@var{target}/sys-include}
1175doesn't pre-exist. If @file{@var{prefix}/@var{target}/sys-include} does
1176pre-exist, the @var{dir} argument may be omitted. @command{fixincludes}
1177will be run on these files to make them compatible with GCC.
264d65c1
AP
1178
1179@item --without-headers
1180Tells GCC not use any target headers from a libc when building a cross
2dd76960 1181compiler. When crossing to GNU/Linux, you need the headers so GCC
264d65c1
AP
1182can build the exception handling for libgcc.
1183See @uref{http://www.objsw.com/CrossGCC/,,CrossGCC} for more information
1184on this option.
1185
65a824f6
JT
1186@item --with-libs
1187@itemx --with-libs=``@var{dir1} @var{dir2} @dots{} @var{dirN}''
4977bab6 1188Deprecated in favor of @option{--with-sysroot}.
38209993
LG
1189Specifies a list of directories which contain the target runtime
1190libraries. These libraries will be copied into the @file{gcc} install
65a824f6
JT
1191directory. If the directory list is omitted, this option has no
1192effect.
ef88b07d 1193@item --with-newlib
eea81d3e 1194Specifies that @samp{newlib} is
38209993 1195being used as the target C library. This causes @code{__eprintf} to be
eea81d3e
RO
1196omitted from @file{libgcc.a} on the assumption that it will be provided by
1197@samp{newlib}.
ef88b07d 1198@end table
f9047ed3 1199
bda4d063
TS
1200@subheading Fortran-specific Option
1201
1202The following options apply to the build of the Fortran front end.
1203
1204@table @code
1205
1206@item --with-gmp=@var{pathname}
1207@itemx --with-gmp-dir=@var{pathname}
1208If you don't have GMP (the GNU Multiple Precision library) installed
1209in a standard location and you want to build the Fortran front-end,
1210you can explicitly specify the directory where GMP is installed
1211(@samp{--with-gmp=gmpinstalldir}) or where you built the GMP library without
1212installing (@samp{--with-gmp-dir=gmpbuilddir}).
1213
1214@end table
1215
c1c3bb0c
ME
1216@subheading Java-Specific Options
1217
1218The following option applies to the build of the Java front end.
1219
1220@table @code
1221@item --disable-libgcj
1222Specify that the run-time libraries
1223used by GCJ should not be built. This is useful in case you intend
1224to use GCJ with some other run-time, or you're going to install it
1225separately, or it just happens not to build on your particular
1226machine. In general, if the Java front end is enabled, the GCJ
1227libraries will be enabled too, unless they're known to not work on
1228the target platform. If GCJ is enabled but @samp{libgcj} isn't built, you
1229may need to port it; in this case, before modifying the top-level
1230@file{configure.in} so that @samp{libgcj} is enabled by default on this platform,
1231you may use @option{--enable-libgcj} to override the default.
1232
1233@end table
1234
1235The following options apply to building @samp{libgcj}.
1236
1237@subsubheading General Options
1238
1239@table @code
1240@item --disable-getenv-properties
1241Don't set system properties from @env{GCJ_PROPERTIES}.
1242
1243@item --enable-hash-synchronization
1244Use a global hash table for monitor locks. Ordinarily,
1245@samp{libgcj}'s @samp{configure} script automatically makes
1246the correct choice for this option for your platform. Only use
1247this if you know you need the library to be configured differently.
1248
1249@item --enable-interpreter
1250Enable the Java interpreter. The interpreter is automatically
1251enabled by default on all platforms that support it. This option
1252is really only useful if you want to disable the interpreter
1253(using @option{--disable-interpreter}).
1254
1255@item --disable-java-net
1256Disable java.net. This disables the native part of java.net only,
1257using non-functional stubs for native method implementations.
1258
1259@item --disable-jvmpi
1260Disable JVMPI support.
1261
1262@item --with-ecos
1263Enable runtime eCos target support.
1264
1265@item --without-libffi
1266Don't use @samp{libffi}. This will disable the interpreter and JNI
1267support as well, as these require @samp{libffi} to work.
1268
1269@item --enable-libgcj-debug
1270Enable runtime debugging code.
1271
1272@item --enable-libgcj-multifile
1273If specified, causes all @file{.java} source files to be
1274compiled into @file{.class} files in one invocation of
1275@samp{gcj}. This can speed up build time, but is more
1276resource-intensive. If this option is unspecified or
1277disabled, @samp{gcj} is invoked once for each @file{.java}
1278file to compile into a @file{.class} file.
1279
1280@item --with-libiconv-prefix=DIR
1281Search for libiconv in @file{DIR/include} and @file{DIR/lib}.
1282
1283@item --enable-sjlj-exceptions
1284Force use of @code{builtin_setjmp} for exceptions. @samp{configure}
1285ordinarily picks the correct value based on the platform. Only use
1286this option if you are sure you need a different setting.
1287
1288@item --with-system-zlib
1289Use installed @samp{zlib} rather than that included with GCC@.
1290
1291@item --with-win32-nlsapi=ansi, unicows or unicode
1292Indicates how MinGW @samp{libgcj} translates between UNICODE
1293characters and the Win32 API.
1294@table @code
1295@item ansi
1296Use the single-byte @code{char} and the Win32 A functions natively,
1297translating to and from UNICODE when using these functions. If
1298unspecified, this is the default.
1299
1300@item unicows
1301Use the @code{WCHAR} and Win32 W functions natively. Adds
1302@code{-lunicows} to @file{libgcj.spec} to link with @samp{libunicows}.
1303@file{unicows.dll} needs to be deployed on Microsoft Windows 9X machines
1304running built executables. @file{libunicows.a}, an open-source
1305import library around Microsoft's @code{unicows.dll}, is obtained from
1306@uref{http://libunicows.sourceforge.net/}, which also gives details
1307on getting @file{unicows.dll} from Microsoft.
1308
1309@item unicode
1310Use the @code{WCHAR} and Win32 W functions natively. Does @emph{not}
1311add @code{-lunicows} to @file{libgcj.spec}. The built executables will
1312only run on Microsoft Windows NT and above.
1313@end table
1314@end table
1315
1316@subsubheading AWT-Specific Options
1317
1318@table @code
1319@item --with-x
1320Use the X Window System.
1321
1322@item --enable-java-awt=PEER(S)
1323Specifies the AWT peer library or libraries to build alongside
1324@samp{libgcj}. If this option is unspecified or disabled, AWT
1325will be non-functional. Current valid values are @option{gtk} and
1326@option{xlib}. Multiple libraries should be separated by a
1327comma (i.e. @option{--enable-java-awt=gtk,xlib}).
1328
1329@item --enable-gtk-cairo
1330Build the cairo Graphics2D implementation on GTK.
1331
1332@item --enable-java-gc=TYPE
1333Choose garbage collector. Defaults to @option{boehm} if unspecified.
1334
1335@item --disable-gtktest
1336Do not try to compile and run a test GTK+ program.
1337
1338@item --disable-glibtest
1339Do not try to compile and run a test GLIB program.
1340
1341@item --with-libart-prefix=PFX
1342Prefix where libart is installed (optional).
1343
1344@item --with-libart-exec-prefix=PFX
1345Exec prefix where libart is installed (optional).
1346
1347@item --disable-libarttest
1348Do not try to compile and run a test libart program.
1349
1350@end table
f42974dc
DW
1351
1352@html
b8db17af 1353<hr />
f42974dc
DW
1354<p>
1355@end html
1356@ifhtml
1357@uref{./index.html,,Return to the GCC Installation page}
1358@end ifhtml
1359@end ifset
1360
1361@c ***Building****************************************************************
6cfb3f16 1362@ifnothtml
f42974dc
DW
1363@comment node-name, next, previous, up
1364@node Building, Testing, Configuration, Installing GCC
6cfb3f16 1365@end ifnothtml
f42974dc 1366@ifset buildhtml
f42974dc
DW
1367@ifnothtml
1368@chapter Building
1369@end ifnothtml
1370@cindex Installing GCC: Building
1371
1372Now that GCC is configured, you are ready to build the compiler and
1373runtime libraries.
1374
daf2f129 1375We @strong{highly} recommend that GCC be built using GNU make;
f282ffb3 1376other versions may work, then again they might not.
58db9d1a
AH
1377GNU make is required for compiling GNAT (the Ada compiler) and the Java
1378runtime library.
f42974dc
DW
1379
1380(For example, many broken versions of make will fail if you use the
b8df899a
JM
1381recommended setup where @var{objdir} is different from @var{srcdir}.
1382Other broken versions may recompile parts of the compiler when
1383installing the compiler.)
f42974dc 1384
b8df899a 1385Some commands executed when making the compiler may fail (return a
7ba4ca63 1386nonzero status) and be ignored by @command{make}. These failures, which
b8df899a
JM
1387are often due to files that were not found, are expected, and can safely
1388be ignored.
1389
1390It is normal to have compiler warnings when compiling certain files.
1391Unless you are a GCC developer, you can generally ignore these warnings
dd859b8a
KG
1392unless they cause compilation to fail. Developers should attempt to fix
1393any warnings encountered, however they can temporarily continue past
1394warnings-as-errors by specifying the configure flag
1395@option{--disable-werror}.
b8df899a
JM
1396
1397On certain old systems, defining certain environment variables such as
6cfb3f16 1398@env{CC} can interfere with the functioning of @command{make}.
b8df899a
JM
1399
1400If you encounter seemingly strange errors when trying to build the
1401compiler in a directory other than the source directory, it could be
1402because you have previously configured the compiler in the source
1403directory. Make sure you have done all the necessary preparations.
1404
1405If you build GCC on a BSD system using a directory stored in an old System
4c64396e 1406V file system, problems may occur in running @command{fixincludes} if the
b8df899a
JM
1407System V file system doesn't support symbolic links. These problems
1408result in a failure to fix the declaration of @code{size_t} in
1409@file{sys/types.h}. If you find that @code{size_t} is a signed type and
1410that type mismatches occur, this could be the cause.
1411
161d7b59 1412The solution is not to use such a directory for building GCC@.
f42974dc 1413
f85b8d1a
JM
1414When building from CVS or snapshots, or if you modify parser sources,
1415you need the Bison parser generator installed. Any version 1.25 or
1416later should work; older versions may also work. If you do not modify
1417parser sources, releases contain the Bison-generated files and you do
1418not need Bison installed to build them.
1419
1420When building from CVS or snapshots, or if you modify Texinfo
a38f87a9 1421documentation, you need version 4.2 or later of Texinfo installed if you
f85b8d1a
JM
1422want Info documentation to be regenerated. Releases contain Info
1423documentation pre-built for the unmodified documentation in the release.
1424
f42974dc
DW
1425@section Building a native compiler
1426
f9047ed3 1427For a native build issue the command @samp{make bootstrap}. This
f42974dc
DW
1428will build the entire GCC system, which includes the following steps:
1429
1430@itemize @bullet
1431@item
1432Build host tools necessary to build the compiler such as texinfo, bison,
1433gperf.
1434
1435@item
1436Build target tools for use by the compiler such as binutils (bfd,
eea81d3e 1437binutils, gas, gprof, ld, and opcodes)
f282ffb3 1438if they have been individually linked
f42974dc
DW
1439or moved into the top level GCC source tree before configuring.
1440
1441@item
1442Perform a 3-stage bootstrap of the compiler.
1443
1444@item
1445Perform a comparison test of the stage2 and stage3 compilers.
1446
1447@item
1448Build runtime libraries using the stage3 compiler from the previous step.
f9047ed3 1449
f42974dc
DW
1450@end itemize
1451
38209993
LG
1452If you are short on disk space you might consider @samp{make
1453bootstrap-lean} instead. This is identical to @samp{make
1454bootstrap} except that object files from the stage1 and
f42974dc
DW
1455stage2 of the 3-stage bootstrap of the compiler are deleted as
1456soon as they are no longer needed.
1457
f42974dc
DW
1458If you want to save additional space during the bootstrap and in
1459the final installation as well, you can build the compiler binaries
8c085f6f 1460without debugging information as in the following example. This will save
f42974dc
DW
1461roughly 40% of disk space both for the bootstrap and the final installation.
1462(Libraries will still contain debugging information.)
1463
3ab51846 1464@smallexample
8c085f6f
JJ
1465 make CFLAGS='-O' LIBCFLAGS='-g -O2' \
1466 LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap
3ab51846 1467@end smallexample
8c085f6f 1468
eea81d3e
RO
1469If you wish to use non-default GCC flags when compiling the stage2 and
1470stage3 compilers, set @code{BOOT_CFLAGS} on the command line when doing
f85b8d1a
JM
1471@samp{make bootstrap}. Non-default optimization flags are less well
1472tested here than the default of @samp{-g -O2}, but should still work.
1473In a few cases, you may find that you need to specify special flags such
1474as @option{-msoft-float} here to complete the bootstrap; or, if the
1475native compiler miscompiles the stage1 compiler, you may need to work
1476around this, by choosing @code{BOOT_CFLAGS} to avoid the parts of the
1477stage1 compiler that were miscompiled, or by using @samp{make
1478bootstrap4} to increase the number of stages of bootstrap.
1479
c872077c
AP
1480Note that using non-standard @code{CFLAGS} can cause bootstrap to fail in
1481@file{libiberty}, if these trigger a warning with the new compiler. For
1482example using @samp{-O2 -g -mcpu=i686} on @code{i686-pc-linux-gnu} will
1483cause bootstrap failure as @code{-mcpu=} is deprecated in 3.4.0 and above.
1484
1485
6cfb3f16 1486If you used the flag @option{--enable-languages=@dots{}} to restrict
f42974dc 1487the compilers to be built, only those you've actually enabled will be
767094dd 1488built. This will of course only build those runtime libraries, for
f42974dc 1489which the particular compiler has been built. Please note,
eea81d3e 1490that re-defining @env{LANGUAGES} when calling @samp{make bootstrap}
ef88b07d 1491@strong{does not} work anymore!
f42974dc 1492
f85b8d1a 1493If the comparison of stage2 and stage3 fails, this normally indicates
eea81d3e 1494that the stage2 compiler has compiled GCC incorrectly, and is therefore
f85b8d1a
JM
1495a potentially serious bug which you should investigate and report. (On
1496a few systems, meaningful comparison of object files is impossible; they
1497always appear ``different''. If you encounter this problem, you will
1498need to disable comparison in the @file{Makefile}.)
f42974dc
DW
1499
1500@section Building a cross compiler
1501
1502We recommend reading the
1503@uref{http://www.objsw.com/CrossGCC/,,crossgcc FAQ}
1504for information about building cross compilers.
1505
1506When building a cross compiler, it is not generally possible to do a
15073-stage bootstrap of the compiler. This makes for an interesting problem
161d7b59 1508as parts of GCC can only be built with GCC@.
f42974dc
DW
1509
1510To build a cross compiler, we first recommend building and installing a
1511native compiler. You can then use the native GCC compiler to build the
635771af
JM
1512cross compiler. The installed native compiler needs to be GCC version
15132.95 or later.
f42974dc
DW
1514
1515Assuming you have already installed a native copy of GCC and configured
6cfb3f16 1516your cross compiler, issue the command @command{make}, which performs the
f42974dc
DW
1517following steps:
1518
1519@itemize @bullet
1520@item
1521Build host tools necessary to build the compiler such as texinfo, bison,
1522gperf.
1523
1524@item
1525Build target tools for use by the compiler such as binutils (bfd,
1526binutils, gas, gprof, ld, and opcodes)
1527if they have been individually linked or moved into the top level GCC source
1528tree before configuring.
1529
1530@item
1531Build the compiler (single stage only).
1532
1533@item
1534Build runtime libraries using the compiler from the previous step.
1535@end itemize
1536
1537Note that if an error occurs in any step the make process will exit.
1538
01e97976
JM
1539If you are not building GNU binutils in the same source tree as GCC,
1540you will need a cross-assembler and cross-linker installed before
1541configuring GCC@. Put them in the directory
1542@file{@var{prefix}/@var{target}/bin}. Here is a table of the tools
1543you should put in this directory:
1544
1545@table @file
1546@item as
1547This should be the cross-assembler.
1548
1549@item ld
1550This should be the cross-linker.
1551
1552@item ar
1553This should be the cross-archiver: a program which can manipulate
1554archive files (linker libraries) in the target machine's format.
1555
1556@item ranlib
1557This should be a program to construct a symbol table in an archive file.
1558@end table
1559
1560The installation of GCC will find these programs in that directory,
1561and copy or link them to the proper place to for the cross-compiler to
1562find them when run later.
1563
1564The easiest way to provide these files is to build the Binutils package.
1565Configure it with the same @option{--host} and @option{--target}
1566options that you use for configuring GCC, then build and install
1567them. They install their executables automatically into the proper
1568directory. Alas, they do not support all the targets that GCC
1569supports.
1570
1571If you are not building a C library in the same source tree as GCC,
1572you should also provide the target libraries and headers before
1573configuring GCC, specifying the directories with
1574@option{--with-sysroot} or @option{--with-headers} and
1575@option{--with-libs}. Many targets also require ``start files'' such
1576as @file{crt0.o} and
1577@file{crtn.o} which are linked into each executable. There may be several
1578alternatives for @file{crt0.o}, for use with profiling or other
1579compilation options. Check your target's definition of
1580@code{STARTFILE_SPEC} to find out what start files it uses.
1581
f42974dc
DW
1582@section Building in parallel
1583
27a3e494
DE
1584You can use @samp{make bootstrap MAKE="make -j 2" -j 2}, or just
1585@samp{make -j 2 bootstrap} for GNU Make 3.79 and above, instead of
1586@samp{make bootstrap} to build GCC in parallel.
1587You can also specify a bigger number, and in most cases using a value
1588greater than the number of processors in your machine will result in
1589fewer and shorter I/O latency hits, thus improving overall throughput;
1590this is especially true for slow drives and network filesystems.
f42974dc 1591
e23381df
GB
1592@section Building the Ada compiler
1593
1594In order to build GNAT, the Ada compiler, you need a working GNAT
3e98a119 1595compiler (GNAT version 3.14 or later, or GCC version 3.1 or later),
af5734de 1596including GNAT tools such as @command{gnatmake} and @command{gnatlink},
38e23049 1597since the Ada front end is written in Ada (with some
e23381df
GB
1598GNAT-specific extensions), and GNU make.
1599
38e23049
JM
1600@command{configure} does not test whether the GNAT installation works
1601and has a sufficiently recent version; if too old a GNAT version is
1602installed, the build will fail unless @option{--enable-languages} is
1603used to disable building the Ada front end.
e23381df 1604
8f231b5d
JH
1605@section Building with profile feedback
1606
1607It is possible to use profile feedback to optimize the compiler itself. This
1608should result in a faster compiler binary. Experiments done on x86 using gcc
16093.3 showed approximately 7 percent speedup on compiling C programs. To
1610bootstrap compiler with profile feedback, use @code{make profiledbootstrap}.
1611
1612When @samp{make profiledbootstrap} is run, it will first build a @code{stage1}
1613compiler. This compiler is used to build a @code{stageprofile} compiler
1614instrumented to collect execution counts of instruction and branch
1615probabilities. Then runtime libraries are compiled with profile collected.
1616Finally a @code{stagefeedback} compiler is built using the information collected.
1617
1618Unlike @samp{make bootstrap} several additional restrictions apply. The
1619compiler used to build @code{stage1} needs to support a 64-bit integral type.
1620It is recommended to only use GCC for this. Also parallel make is currently
1621not supported since collisions in profile collecting may occur.
1622
f42974dc 1623@html
b8db17af 1624<hr />
f42974dc
DW
1625<p>
1626@end html
1627@ifhtml
1628@uref{./index.html,,Return to the GCC Installation page}
1629@end ifhtml
1630@end ifset
1631
1632@c ***Testing*****************************************************************
6cfb3f16 1633@ifnothtml
f42974dc
DW
1634@comment node-name, next, previous, up
1635@node Testing, Final install, Building, Installing GCC
6cfb3f16 1636@end ifnothtml
f42974dc 1637@ifset testhtml
f42974dc
DW
1638@ifnothtml
1639@chapter Installing GCC: Testing
1640@end ifnothtml
1641@cindex Testing
1642@cindex Installing GCC: Testing
1643@cindex Testsuite
1644
f97903cc
JJ
1645Before you install GCC, we encourage you to run the testsuites and to
1646compare your results with results from a similar configuration that have
1647been submitted to the
1648@uref{http://gcc.gnu.org/ml/gcc-testresults/,,gcc-testresults mailing list}.
05253aed
JJ
1649Some of these archived results are linked from the build status lists
1650at @uref{http://gcc.gnu.org/buildstat.html}, although not everyone who
1651reports a successful build runs the testsuites and submits the results.
f97903cc
JJ
1652This step is optional and may require you to download additional software,
1653but it can give you confidence in your new GCC installation or point out
1654problems before you install and start using your new GCC.
f42974dc 1655
f9047ed3 1656First, you must have @uref{download.html,,downloaded the testsuites}.
f97903cc
JJ
1657These are part of the full distribution, but if you downloaded the
1658``core'' compiler plus any front ends, you must download the testsuites
1659separately.
f42974dc 1660
f97903cc 1661Second, you must have the testing tools installed. This includes
cfc984b5
MS
1662@uref{http://www.gnu.org/software/dejagnu/,,DejaGnu} 1.4.4 and later,
1663Tcl, and Expect; the DejaGnu site has links to these.
f42974dc 1664
8cacda7c
GP
1665If the directories where @command{runtest} and @command{expect} were
1666installed are not in the @env{PATH}, you may need to set the following
1667environment variables appropriately, as in the following example (which
1668assumes that DejaGnu has been installed under @file{/usr/local}):
f42974dc 1669
3ab51846 1670@smallexample
f42974dc
DW
1671 TCL_LIBRARY = /usr/local/share/tcl8.0
1672 DEJAGNULIBS = /usr/local/share/dejagnu
3ab51846 1673@end smallexample
f42974dc 1674
8cacda7c 1675(On systems such as Cygwin, these paths are required to be actual
f42974dc 1676paths, not mounts or links; presumably this is due to some lack of
8cacda7c 1677portability in the DejaGnu code.)
ecb7d6b3 1678
f42974dc
DW
1679
1680Finally, you can run the testsuite (which may take a long time):
3ab51846 1681@smallexample
ef88b07d 1682 cd @var{objdir}; make -k check
3ab51846 1683@end smallexample
f42974dc 1684
794aca5d
WB
1685This will test various components of GCC, such as compiler
1686front ends and runtime libraries. While running the testsuite, DejaGnu
1687might emit some harmless messages resembling
daf2f129 1688@samp{WARNING: Couldn't find the global config file.} or
794aca5d 1689@samp{WARNING: Couldn't find tool init file} that can be ignored.
06809951 1690
f42974dc
DW
1691@section How can I run the test suite on selected tests?
1692
794aca5d
WB
1693In order to run sets of tests selectively, there are targets
1694@samp{make check-gcc} and @samp{make check-g++}
1695in the @file{gcc} subdirectory of the object directory. You can also
1696just run @samp{make check} in a subdirectory of the object directory.
1697
1698
1699A more selective way to just run all @command{gcc} execute tests in the
1700testsuite is to use
f42974dc 1701
3ab51846 1702@smallexample
6cfb3f16 1703 make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
3ab51846 1704@end smallexample
f42974dc 1705
794aca5d
WB
1706Likewise, in order to run only the @command{g++} ``old-deja'' tests in
1707the testsuite with filenames matching @samp{9805*}, you would use
f42974dc 1708
3ab51846 1709@smallexample
6cfb3f16 1710 make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
3ab51846 1711@end smallexample
f42974dc 1712
6cfb3f16
JM
1713The @file{*.exp} files are located in the testsuite directories of the GCC
1714source, the most important ones being @file{compile.exp},
1715@file{execute.exp}, @file{dg.exp} and @file{old-deja.exp}.
1716To get a list of the possible @file{*.exp} files, pipe the
38209993 1717output of @samp{make check} into a file and look at the
6cfb3f16 1718@samp{Running @dots{} .exp} lines.
f42974dc 1719
e08737dc
PE
1720@section Passing options and running multiple testsuites
1721
1722You can pass multiple options to the testsuite using the
1723@samp{--target_board} option of DejaGNU, either passed as part of
1724@samp{RUNTESTFLAGS}, or directly to @command{runtest} if you prefer to
1725work outside the makefiles. For example,
1726
3ab51846 1727@smallexample
e08737dc 1728 make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fno-strength-reduce"
3ab51846 1729@end smallexample
e08737dc
PE
1730
1731will run the standard @command{g++} testsuites (``unix'' is the target name
1732for a standard native testsuite situation), passing
1733@samp{-O3 -fno-strength-reduce} to the compiler on every test, i.e.,
1734slashes separate options.
1735
1736You can run the testsuites multiple times using combinations of options
1737with a syntax similar to the brace expansion of popular shells:
1738
3ab51846 1739@smallexample
e08737dc 1740 @dots{}"--target_board=arm-sim@{-mhard-float,-msoft-float@}@{-O1,-O2,-O3,@}"
3ab51846 1741@end smallexample
e08737dc
PE
1742
1743(Note the empty option caused by the trailing comma in the final group.)
1744The following will run each testsuite eight times using the @samp{arm-sim}
1745target, as if you had specified all possible combinations yourself:
1746
3ab51846 1747@smallexample
e08737dc
PE
1748 --target_board=arm-sim/-mhard-float/-O1
1749 --target_board=arm-sim/-mhard-float/-O2
1750 --target_board=arm-sim/-mhard-float/-O3
1751 --target_board=arm-sim/-mhard-float
1752 --target_board=arm-sim/-msoft-float/-O1
1753 --target_board=arm-sim/-msoft-float/-O2
1754 --target_board=arm-sim/-msoft-float/-O3
1755 --target_board=arm-sim/-msoft-float
3ab51846 1756@end smallexample
e08737dc
PE
1757
1758They can be combined as many times as you wish, in arbitrary ways. This
1759list:
1760
3ab51846 1761@smallexample
e08737dc 1762 @dots{}"--target_board=unix/-Wextra@{-O3,-fno-strength-reduce@}@{-fomit-frame-pointer,@}"
3ab51846 1763@end smallexample
e08737dc
PE
1764
1765will generate four combinations, all involving @samp{-Wextra}.
1766
1767The disadvantage to this method is that the testsuites are run in serial,
1768which is a waste on multiprocessor systems. For users with GNU Make and
1769a shell which performs brace expansion, you can run the testsuites in
1770parallel by having the shell perform the combinations and @command{make}
1771do the parallel runs. Instead of using @samp{--target_board}, use a
1772special makefile target:
1773
3ab51846 1774@smallexample
e08737dc 1775 make -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{option2}/@dots{}
3ab51846 1776@end smallexample
e08737dc
PE
1777
1778For example,
1779
3ab51846 1780@smallexample
e08737dc 1781 make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
3ab51846 1782@end smallexample
e08737dc
PE
1783
1784will run three concurrent ``make-gcc'' testsuites, eventually testing all
1785ten combinations as described above. Note that this is currently only
1786supported in the @file{gcc} subdirectory. (To see how this works, try
1787typing @command{echo} before the example given here.)
1788
1789
1790@section Additional testing for Java Class Libraries
1791
688d8b84
RM
1792The Java runtime tests can be executed via @samp{make check}
1793in the @file{@var{target}/libjava/testsuite} directory in
1794the build tree.
f702e700 1795
f702e700
JJ
1796The @uref{http://sources.redhat.com/mauve/,,Mauve Project} provides
1797a suite of tests for the Java Class Libraries. This suite can be run
1798as part of libgcj testing by placing the Mauve tree within the libjava
1799testsuite at @file{libjava/testsuite/libjava.mauve/mauve}, or by
1800specifying the location of that tree when invoking @samp{make}, as in
1801@samp{make MAUVEDIR=~/mauve check}.
1802
582f6e6d
TT
1803@uref{http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html,,Jacks}
1804is a free test suite that tests Java compiler front ends. This suite
3b41afd9 1805can be run as part of libgcj testing by placing the Jacks tree within
582f6e6d
TT
1806the libjava testsuite at @file{libjava/testsuite/libjava.jacks/jacks}.
1807
f42974dc
DW
1808@section How to interpret test results
1809
794aca5d 1810The result of running the testsuite are various @file{*.sum} and @file{*.log}
767094dd 1811files in the testsuite subdirectories. The @file{*.log} files contain a
f42974dc 1812detailed log of the compiler invocations and the corresponding
daf2f129
JM
1813results, the @file{*.sum} files summarize the results. These summaries
1814contain status codes for all tests:
f42974dc
DW
1815
1816@itemize @bullet
1817@item
1818PASS: the test passed as expected
1819@item
1820XPASS: the test unexpectedly passed
1821@item
1822FAIL: the test unexpectedly failed
1823@item
1824XFAIL: the test failed as expected
1825@item
1826UNSUPPORTED: the test is not supported on this platform
1827@item
1828ERROR: the testsuite detected an error
1829@item
1830WARNING: the testsuite detected a possible problem
1831@end itemize
1832
38209993
LG
1833It is normal for some tests to report unexpected failures. At the
1834current time our testing harness does not allow fine grained control
1835over whether or not a test is expected to fail. We expect to fix this
1836problem in future releases.
f42974dc
DW
1837
1838
1839@section Submitting test results
1840
1841If you want to report the results to the GCC project, use the
767094dd 1842@file{contrib/test_summary} shell script. Start it in the @var{objdir} with
f42974dc 1843
3ab51846 1844@smallexample
6cfb3f16
JM
1845 @var{srcdir}/contrib/test_summary -p your_commentary.txt \
1846 -m gcc-testresults@@gcc.gnu.org |sh
3ab51846 1847@end smallexample
f42974dc 1848
6cfb3f16 1849This script uses the @command{Mail} program to send the results, so
767094dd 1850make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is
f42974dc 1851prepended to the testsuite summary and should contain any special
767094dd 1852remarks you have on your results or your build environment. Please
f42974dc 1853do not edit the testsuite result block or the subject line, as these
05c425a9 1854messages may be automatically processed.
f42974dc 1855
aed5964b 1856@html
b8db17af 1857<hr />
aed5964b
JM
1858<p>
1859@end html
1860@ifhtml
1861@uref{./index.html,,Return to the GCC Installation page}
1862@end ifhtml
f42974dc
DW
1863@end ifset
1864
1865@c ***Final install***********************************************************
6cfb3f16 1866@ifnothtml
f42974dc
DW
1867@comment node-name, next, previous, up
1868@node Final install, , Testing, Installing GCC
6cfb3f16 1869@end ifnothtml
f42974dc 1870@ifset finalinstallhtml
f42974dc
DW
1871@ifnothtml
1872@chapter Installing GCC: Final installation
1873@end ifnothtml
1874
eea81d3e 1875Now that GCC has been built (and optionally tested), you can install it with
3ab51846 1876@smallexample
eea81d3e 1877cd @var{objdir}; make install
3ab51846 1878@end smallexample
f42974dc 1879
06809951
GP
1880We strongly recommend to install into a target directory where there is
1881no previous version of GCC present.
1882
f42974dc 1883That step completes the installation of GCC; user level binaries can
8e5f33ff
GK
1884be found in @file{@var{prefix}/bin} where @var{prefix} is the value
1885you specified with the @option{--prefix} to configure (or
1886@file{/usr/local} by default). (If you specified @option{--bindir},
1887that directory will be used instead; otherwise, if you specified
1888@option{--exec-prefix}, @file{@var{exec-prefix}/bin} will be used.)
1889Headers for the C++ and Java libraries are installed in
1890@file{@var{prefix}/include}; libraries in @file{@var{libdir}}
1891(normally @file{@var{prefix}/lib}); internal parts of the compiler in
1892@file{@var{libdir}/gcc} and @file{@var{libexecdir}/gcc}; documentation
1893in info format in @file{@var{infodir}} (normally
1894@file{@var{prefix}/info}).
f42974dc 1895
53b50ac1
CC
1896When installing cross-compilers, GCC's executables
1897are not only installed into @file{@var{bindir}}, that
1898is, @file{@var{exec-prefix}/bin}, but additionally into
1899@file{@var{exec-prefix}/@var{target-alias}/bin}, if that directory
1900exists. Typically, such @dfn{tooldirs} hold target-specific
1901binutils, including assembler and linker.
1902
1903Installation into a temporary staging area or into a @command{chroot}
1904jail can be achieved with the command
1905
3ab51846 1906@smallexample
53b50ac1 1907make DESTDIR=@var{path-to-rootdir} install
3ab51846 1908@end smallexample
53b50ac1
CC
1909
1910@noindent where @var{path-to-rootdir} is the absolute path of
1911a directory relative to which all installation paths will be
1912interpreted. Note that the directory specified by @code{DESTDIR}
1913need not exist yet; it will be created if necessary.
1914
1915There is a subtle point with tooldirs and @code{DESTDIR}:
1916If you relocate a cross-compiler installation with
1917e.g.@: @samp{DESTDIR=@var{rootdir}}, then the directory
1918@file{@var{rootdir}/@var{exec-prefix}/@var{target-alias}/bin} will
1919be filled with duplicated GCC executables only if it already exists,
1920it will not be created otherwise. This is regarded as a feature,
1921not as a bug, because it gives slightly more control to the packagers
1922using the @code{DESTDIR} feature.
1923
2b46bc67 1924If you built a released version of GCC using @samp{make bootstrap} then please
f97a5bda
JJ
1925quickly review the build status page for your release, available from
1926@uref{http://gcc.gnu.org/buildstat.html}.
c5997381
JJ
1927If your system is not listed for the version of GCC that you built,
1928send a note to
eea81d3e
RO
1929@email{gcc@@gcc.gnu.org} indicating
1930that you successfully built and installed GCC.
c5997381 1931Include the following information:
f42974dc 1932
c5997381
JJ
1933@itemize @bullet
1934@item
1935Output from running @file{@var{srcdir}/config.guess}. Do not send us
1936that file itself, just the one-line output from running it.
1937
1938@item
2dd76960 1939The output of @samp{gcc -v} for your newly installed @command{gcc}.
c5997381
JJ
1940This tells us which version of GCC you built and the options you passed to
1941configure.
1942
2b46bc67
JJ
1943@item
1944Whether you enabled all languages or a subset of them. If you used a
1945full distribution then this information is part of the configure
1946options in the output of @samp{gcc -v}, but if you downloaded the
1947``core'' compiler plus additional front ends then it isn't apparent
1948which ones you built unless you tell us about it.
1949
c5997381
JJ
1950@item
1951If the build was for GNU/Linux, also include:
1952@itemize @bullet
1953@item
1954The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
1955this information should be available from @file{/etc/issue}.
1956
1957@item
1958The version of the Linux kernel, available from @samp{uname --version}
1959or @samp{uname -a}.
1960
1961@item
1962The version of glibc you used; for RPM-based systems like Red Hat,
b9da07da
JJ
1963Mandrake, and SuSE type @samp{rpm -q glibc} to get the glibc version,
1964and on systems like Debian and Progeny use @samp{dpkg -l libc6}.
c5997381
JJ
1965@end itemize
1966For other systems, you can include similar information if you think it is
1967relevant.
1968
1969@item
1970Any other information that you think would be useful to people building
1971GCC on the same configuration. The new entry in the build status list
1972will include a link to the archived copy of your message.
1973@end itemize
c009f01f
JJ
1974
1975We'd also like to know if the
1976@ifnothtml
1977@ref{Specific, host/target specific installation notes}
1978@end ifnothtml
1979@ifhtml
1980@uref{specific.html,,host/target specific installation notes}
1981@end ifhtml
1982didn't include your host/target information or if that information is
1983incomplete or out of date. Send a note to
1984@email{gcc@@gcc.gnu.org} telling us how the information should be changed.
f42974dc
DW
1985
1986If you find a bug, please report it following our
1987@uref{../bugs.html,,bug reporting guidelines}.
1988
ab130aa5 1989If you want to print the GCC manuals, do @samp{cd @var{objdir}; make
a38f87a9 1990dvi}. You will need to have @command{texi2dvi} (version at least 4.2)
ab130aa5
JM
1991and @TeX{} installed. This creates a number of @file{.dvi} files in
1992subdirectories of @file{@var{objdir}}; these may be converted for
1993printing with programs such as @command{dvips}. You can also
1994@uref{http://www.gnu.org/order/order.html,,buy printed manuals from the
1995Free Software Foundation}, though such manuals may not be for the most
161d7b59 1996recent version of GCC@.
ab130aa5 1997
f42974dc 1998@html
b8db17af 1999<hr />
f42974dc
DW
2000<p>
2001@end html
2002@ifhtml
2003@uref{./index.html,,Return to the GCC Installation page}
2004@end ifhtml
2005@end ifset
2006
2007@c ***Binaries****************************************************************
6cfb3f16 2008@ifnothtml
f42974dc
DW
2009@comment node-name, next, previous, up
2010@node Binaries, Specific, Installing GCC, Top
6cfb3f16 2011@end ifnothtml
f42974dc 2012@ifset binarieshtml
f42974dc
DW
2013@ifnothtml
2014@chapter Installing GCC: Binaries
2015@end ifnothtml
2016@cindex Binaries
2017@cindex Installing GCC: Binaries
2018
161d7b59 2019We are often asked about pre-compiled versions of GCC@. While we cannot
f42974dc
DW
2020provide these for all platforms, below you'll find links to binaries for
2021various platforms where creating them by yourself is not easy due to various
2022reasons.
2023
2024Please note that we did not create these binaries, nor do we
2025support them. If you have any problems installing them, please
2026contact their makers.
2027
2028@itemize
2029@item
df002c7d
DE
2030AIX:
2031@itemize
2032@item
ff4c5e7b 2033@uref{http://www.bullfreeware.com,,Bull's Freeware and Shareware Archive for AIX};
df002c7d
DE
2034
2035@item
8d5362b7 2036@uref{http://aixpdslib.seas.ucla.edu,,UCLA Software Library for AIX}.
df002c7d 2037@end itemize
f42974dc
DW
2038
2039@item
8d5362b7
GP
2040DOS---@uref{http://www.delorie.com/djgpp/,,DJGPP}.
2041
2042@item
71c6b994
KH
2043Renesas H8/300[HS]---@uref{http://h8300-hms.sourceforge.net/,,GNU
2044Development Tools for the Renesas H8/300[HS] Series}.
f42974dc 2045
f404402c
MW
2046@item
2047HP-UX:
2048@itemize
f42974dc
DW
2049@item
2050@uref{http://hpux.cae.wisc.edu/,,HP-UX Porting Center};
2051
f404402c
MW
2052@item
2053@uref{ftp://sunsite.informatik.rwth-aachen.de/pub/packages/gcc_hpux/,,Binaries for HP-UX 11.00 at Aachen University of Technology}.
2054@end itemize
2055
3e35d143
SC
2056@item
2057Motorola 68HC11/68HC12---@uref{http://www.gnu-m68hc11.org,,GNU
2058Development Tools for the Motorola 68HC11/68HC12}.
2059
f42974dc 2060@item
38209993 2061@uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
8d5362b7 2062OpenServer/Unixware}.
f42974dc
DW
2063
2064@item
35113fde 2065Sinix/Reliant Unix---@uref{ftp://ftp.fujitsu-siemens.com/pub/pd/gnu/gcc/,,Siemens}.
daf2f129 2066
8d5362b7
GP
2067@item
2068Solaris 2 (SPARC, Intel)---@uref{http://www.sunfreeware.com/,,Sunfreeware}.
f42974dc
DW
2069
2070@item
8d5362b7 2071SGI---@uref{http://freeware.sgi.com/,,SGI Freeware}.
f42974dc
DW
2072
2073@item
05c425a9 2074Microsoft Windows:
f42974dc
DW
2075@itemize
2076@item
2077The @uref{http://sources.redhat.com/cygwin/,,Cygwin} project;
2078@item
cc92b8ab 2079The @uref{http://www.mingw.org/,,MinGW} project.
f42974dc
DW
2080@end itemize
2081
2082@item
616de62f
GP
2083@uref{ftp://ftp.thewrittenword.com/packages/by-name/,,The
2084Written Word} offers binaries for
2085AIX 4.3.2.
2086IRIX 6.5,
2087Digital UNIX 4.0D and 5.1,
2088GNU/Linux (i386),
2089HP-UX 10.20, 11.00, and 11.11, and
2090Solaris/SPARC 2.5.1, 2.6, 2.7, 8, and 9,
f42974dc
DW
2091@end itemize
2092
2093In addition to those specific offerings, you can get a binary
2094distribution CD-ROM from the
f9047ed3 2095@uref{http://www.fsf.org/order/order.html,,Free Software Foundation}.
f42974dc 2096It contains binaries for a number of platforms, and
767094dd 2097includes not only GCC, but other stuff as well. The current CD does
f42974dc 2098not contain the latest version of GCC, but it should allow
767094dd 2099bootstrapping the compiler. An updated version of that disk is in the
f42974dc
DW
2100works.
2101
2102@html
b8db17af 2103<hr />
f42974dc
DW
2104<p>
2105@end html
2106@ifhtml
2107@uref{./index.html,,Return to the GCC Installation page}
2108@end ifhtml
2109@end ifset
2110
2111@c ***Specific****************************************************************
6cfb3f16 2112@ifnothtml
f42974dc 2113@comment node-name, next, previous, up
73e2155a 2114@node Specific, Old, Binaries, Top
6cfb3f16 2115@end ifnothtml
f42974dc 2116@ifset specifichtml
f42974dc
DW
2117@ifnothtml
2118@chapter Host/target specific installation notes for GCC
2119@end ifnothtml
2120@cindex Specific
2121@cindex Specific installation notes
2122@cindex Target specific installation
2123@cindex Host specific installation
2124@cindex Target specific installation notes
2125
2126Please read this document carefully @emph{before} installing the
2127GNU Compiler Collection on your machine.
2128
ef88b07d 2129@ifhtml
f42974dc
DW
2130@itemize
2131@item
333e14b0 2132@uref{#alpha*-*-*,,alpha*-*-*}
f42974dc
DW
2133@item
2134@uref{#alpha*-dec-osf*,,alpha*-dec-osf*}
2135@item
71b96724
RL
2136@uref{#alphaev5-cray-unicosmk*,,alphaev5-cray-unicosmk*}
2137@item
b8df899a
JM
2138@uref{#arc-*-elf,,arc-*-elf}
2139@item
34e8290f
NC
2140@uref{#arm-*-elf,,arm-*-elf}
2141@uref{#arm-*-coff,,arm-*-coff}
34e8290f 2142@uref{#arm-*-aout,,arm-*-aout}
b8df899a 2143@item
2aea0b53 2144@uref{#xscale-*-*,,xscale-*-*}
476c334e 2145@item
f42974dc
DW
2146@uref{#avr,,avr}
2147@item
0132e321
MH
2148@uref{#c4x,,c4x}
2149@item
f42974dc
DW
2150@uref{#dos,,DOS}
2151@item
021c4bfd
RO
2152@uref{#*-*-freebsd*,,*-*-freebsd*}
2153@item
f42974dc
DW
2154@uref{#h8300-hms,,h8300-hms}
2155@item
2156@uref{#hppa*-hp-hpux*,,hppa*-hp-hpux*}
2157@item
f42974dc
DW
2158@uref{#hppa*-hp-hpux10,,hppa*-hp-hpux10}
2159@item
2160@uref{#hppa*-hp-hpux11,,hppa*-hp-hpux11}
2161@item
2162@uref{#*-*-linux-gnu,,*-*-linux-gnu}
2163@item
b8df899a
JM
2164@uref{#ix86-*-linux*aout,,i?86-*-linux*aout}
2165@item
f42974dc
DW
2166@uref{#ix86-*-linux*,,i?86-*-linux*}
2167@item
2168@uref{#ix86-*-sco3.2v5*,,i?86-*-sco3.2v5*}
2169@item
f42974dc
DW
2170@uref{#ix86-*-udk,,i?86-*-udk}
2171@item
b8df899a
JM
2172@uref{#ix86-*-esix,,i?86-*-esix}
2173@item
b499d9ab
JJ
2174@uref{#ia64-*-linux,,ia64-*-linux}
2175@item
959a73a4
DH
2176@uref{#ia64-*-hpux*,,ia64-*-hpux*}
2177@item
f42974dc
DW
2178@uref{#*-ibm-aix*,,*-ibm-aix*}
2179@item
e3223ea2
DC
2180@uref{#ip2k-*-elf,,ip2k-*-elf}
2181@item
6b3d1e47
SC
2182@uref{#iq2000-*-elf,,iq2000-*-elf}
2183@item
b8df899a
JM
2184@uref{#m32r-*-elf,,m32r-*-elf}
2185@item
b8df899a
JM
2186@uref{#m6811-elf,,m6811-elf}
2187@item
2188@uref{#m6812-elf,,m6812-elf}
2189@item
b8df899a
JM
2190@uref{#m68k-hp-hpux,,m68k-hp-hpux}
2191@item
b8df899a
JM
2192@uref{#mips-*-*,,mips-*-*}
2193@item
b953cc4b 2194@uref{#mips-sgi-irix5,,mips-sgi-irix5}
f42974dc 2195@item
b953cc4b 2196@uref{#mips-sgi-irix6,,mips-sgi-irix6}
f42974dc 2197@item
021c4bfd
RO
2198@uref{#powerpc*-*-*,,powerpc*-*-*, powerpc-*-sysv4}
2199@item
4f2b1139
SS
2200@uref{#powerpc-*-darwin*,,powerpc-*-darwin*}
2201@item
b8df899a
JM
2202@uref{#powerpc-*-elf,,powerpc-*-elf, powerpc-*-sysv4}
2203@item
f42974dc
DW
2204@uref{#powerpc-*-linux-gnu*,,powerpc-*-linux-gnu*}
2205@item
edf1b3f3
AC
2206@uref{#powerpc-*-netbsd*,,powerpc-*-netbsd*}
2207@item
b8df899a
JM
2208@uref{#powerpc-*-eabiaix,,powerpc-*-eabiaix}
2209@item
2210@uref{#powerpc-*-eabisim,,powerpc-*-eabisim}
2211@item
2212@uref{#powerpc-*-eabi,,powerpc-*-eabi}
2213@item
2214@uref{#powerpcle-*-elf,,powerpcle-*-elf, powerpcle-*-sysv4}
2215@item
2216@uref{#powerpcle-*-eabisim,,powerpcle-*-eabisim}
2217@item
2218@uref{#powerpcle-*-eabi,,powerpcle-*-eabi}
2219@item
225cee28 2220@uref{#s390-*-linux*,,s390-*-linux*}
91abf72d 2221@item
225cee28 2222@uref{#s390x-*-linux*,,s390x-*-linux*}
91abf72d 2223@item
8bf06993
UW
2224@uref{#s390x-ibm-tpf*,,s390x-ibm-tpf*}
2225@item
250d5688 2226@uref{#*-*-solaris2*,,*-*-solaris2*}
f42974dc 2227@item
250d5688 2228@uref{#sparc-sun-solaris2*,,sparc-sun-solaris2*}
f42974dc
DW
2229@item
2230@uref{#sparc-sun-solaris2.7,,sparc-sun-solaris2.7}
2231@item
c6fa9728
JS
2232@uref{#sparc-*-linux*,,sparc-*-linux*}
2233@item
0dc7ee3c 2234@uref{#sparc64-*-solaris2*,,sparc64-*-solaris2*}
f42974dc 2235@item
e403b4bc
CR
2236@uref{#sparcv9-*-solaris2*,,sparcv9-*-solaris2*}
2237@item
b8df899a
JM
2238@uref{#*-*-sysv*,,*-*-sysv*}
2239@item
2240@uref{#vax-dec-ultrix,,vax-dec-ultrix}
2241@item
4977bab6
ZW
2242@uref{#*-*-vxworks*,,*-*-vxworks*}
2243@item
7e081a0c
AJ
2244@uref{#x86_64-*-*,,x86_64-*-*, amd64-*-*}
2245@item
fd29f6ea
BW
2246@uref{#xtensa-*-elf,,xtensa-*-elf}
2247@item
2248@uref{#xtensa-*-linux*,,xtensa-*-linux*}
2249@item
f42974dc
DW
2250@uref{#windows,,Microsoft Windows}
2251@item
2252@uref{#os2,,OS/2}
2253@item
2254@uref{#older,,Older systems}
2255@end itemize
2256
2257@itemize
2258@item
250d5688 2259@uref{#elf_targets,,all ELF targets} (SVR4, Solaris 2, etc.)
f42974dc 2260@end itemize
ef88b07d 2261@end ifhtml
f42974dc
DW
2262
2263
2264@html
2265<!-- -------- host/target specific issues start here ---------------- -->
b8db17af 2266<hr />
f42974dc 2267@end html
333e14b0
LR
2268@heading @anchor{alpha*-*-*}alpha*-*-*
2269
2270This section contains general configuration information for all
2271alpha-based platforms using ELF (in particular, ignore this section for
161d7b59 2272DEC OSF/1, Digital UNIX and Tru64 UNIX)@. In addition to reading this
f2541106 2273section, please read all other sections that match your target.
333e14b0 2274
021c4bfd
RO
2275We require binutils 2.11.2 or newer.
2276Previous binutils releases had a number of problems with DWARF 2
333e14b0
LR
2277debugging information, not the least of which is incorrect linking of
2278shared libraries.
2279
b8df899a 2280@html
b8db17af 2281<hr />
b8df899a 2282@end html
f2541106 2283@heading @anchor{alpha*-dec-osf*}alpha*-dec-osf*
b8df899a 2284Systems using processors that implement the DEC Alpha architecture and
f2541106
RO
2285are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq
2286Tru64 UNIX) operating system, for example the DEC Alpha AXP systems.
2287
c7bdf0a6
ZW
2288As of GCC 3.2, versions before @code{alpha*-dec-osf4} are no longer
2289supported. (These are the versions which identify themselves as DEC
2290OSF/1.)
9340544b 2291
6e92b3a1
RB
2292In Digital Unix V4.0, virtual memory exhausted bootstrap failures
2293may be fixed by configuring with @option{--with-gc=simple},
2294reconfiguring Kernel Virtual Memory and Swap parameters
2295per the @command{/usr/sbin/sys_check} Tuning Suggestions,
2296or applying the patch in
2297@uref{http://gcc.gnu.org/ml/gcc/2002-08/msg00822.html}.
2298
f2541106
RO
2299In Tru64 UNIX V5.1, Compaq introduced a new assembler that does not
2300currently (2001-06-13) work with @command{mips-tfile}. As a workaround,
2301we need to use the old assembler, invoked via the barely documented
2302@option{-oldas} option. To bootstrap GCC, you either need to use the
2303Compaq C Compiler:
2304
3ab51846 2305@smallexample
eea81d3e 2306 % CC=cc @var{srcdir}/configure [@var{options}] [@var{target}]
3ab51846 2307@end smallexample
f2541106
RO
2308
2309or you can use a copy of GCC 2.95.3 or higher built on Tru64 UNIX V4.0:
2310
3ab51846 2311@smallexample
eea81d3e 2312 % CC=gcc -Wa,-oldas @var{srcdir}/configure [@var{options}] [@var{target}]
3ab51846 2313@end smallexample
b8df899a 2314
b953cc4b
RO
2315As of GNU binutils 2.11.2, neither GNU @command{as} nor GNU @command{ld}
2316are supported on Tru64 UNIX, so you must not configure GCC with
2317@option{--with-gnu-as} or @option{--with-gnu-ld}.
2318
f0523f02 2319GCC writes a @samp{.verstamp} directive to the assembler output file
b8df899a
JM
2320unless it is built as a cross-compiler. It gets the version to use from
2321the system header file @file{/usr/include/stamp.h}. If you install a
2322new version of DEC Unix, you should rebuild GCC to pick up the new version
2323stamp.
2324
2325Note that since the Alpha is a 64-bit architecture, cross-compilers from
232632-bit machines will not generate code as efficient as that generated
2327when the compiler is running on a 64-bit machine because many
2328optimizations that depend on being able to represent a word on the
2329target in an integral value on the host cannot be performed. Building
2330cross-compilers on the Alpha for 32-bit machines has only been tested in
2331a few cases and may not work properly.
2332
7ba4ca63 2333@samp{make compare} may fail on old versions of DEC Unix unless you add
6cfb3f16 2334@option{-save-temps} to @code{CFLAGS}. On these systems, the name of the
b8df899a
JM
2335assembler input file is stored in the object file, and that makes
2336comparison fail if it differs between the @code{stage1} and
6cfb3f16 2337@code{stage2} compilations. The option @option{-save-temps} forces a
b8df899a 2338fixed name to be used for the assembler input file, instead of a
6cfb3f16 2339randomly chosen name in @file{/tmp}. Do not add @option{-save-temps}
b8df899a 2340unless the comparisons fail without that option. If you add
6cfb3f16 2341@option{-save-temps}, you will have to manually delete the @samp{.i} and
b8df899a
JM
2342@samp{.s} files after each series of compilations.
2343
f0523f02 2344GCC now supports both the native (ECOFF) debugging format used by DBX
161d7b59 2345and GDB and an encapsulated STABS format for use only with GDB@. See the
6cfb3f16 2346discussion of the @option{--with-stabs} option of @file{configure} above
b8df899a
JM
2347for more information on these formats and how to select them.
2348
2349There is a bug in DEC's assembler that produces incorrect line numbers
2350for ECOFF format when the @samp{.align} directive is used. To work
f0523f02 2351around this problem, GCC will not emit such alignment directives
b8df899a
JM
2352while writing ECOFF format debugging information even if optimization is
2353being performed. Unfortunately, this has the very undesirable
6cfb3f16
JM
2354side-effect that code addresses when @option{-O} is specified are
2355different depending on whether or not @option{-g} is also specified.
b8df899a 2356
6cfb3f16 2357To avoid this behavior, specify @option{-gstabs+} and use GDB instead of
161d7b59 2358DBX@. DEC is now aware of this problem with the assembler and hopes to
b8df899a
JM
2359provide a fix shortly.
2360
71b96724 2361@html
b8db17af 2362<hr />
71b96724
RL
2363@end html
2364@heading @anchor{alphaev5-cray-unicosmk*}alphaev5-cray-unicosmk*
2365Cray T3E systems running Unicos/Mk.
2366
2367This port is incomplete and has many known bugs. We hope to improve the
2368support for this target soon. Currently, only the C front end is supported,
2369and it is not possible to build parallel applications. Cray modules are not
2370supported; in particular, Craylibs are assumed to be in
2371@file{/opt/ctl/craylibs/craylibs}.
2372
2373You absolutely @strong{must} use GNU make on this platform. Also, you
2374need to tell GCC where to find the assembler and the linker. The
2375simplest way to do so is by providing @option{--with-as} and
2376@option{--with-ld} to @file{configure}, e.g.@:
2377
3ab51846 2378@smallexample
8c085f6f
JJ
2379 configure --with-as=/opt/ctl/bin/cam --with-ld=/opt/ctl/bin/cld \
2380 --enable-languages=c
3ab51846 2381@end smallexample
71b96724
RL
2382
2383The comparison test during @samp{make bootstrap} fails on Unicos/Mk
2384because the assembler inserts timestamps into object files. You should
2385be able to work around this by doing @samp{make all} after getting this
2386failure.
2387
b8df899a 2388@html
b8db17af 2389<hr />
b8df899a
JM
2390@end html
2391@heading @anchor{arc-*-elf}arc-*-elf
2392Argonaut ARC processor.
2393This configuration is intended for embedded systems.
2394
2395@html
b8db17af 2396<hr />
b8df899a 2397@end html
34e8290f 2398@heading @anchor{arm-*-elf}arm-*-elf
2aea0b53 2399@heading @anchor{xscale-*-*}xscale-*-*
34e8290f
NC
2400ARM-family processors. Subtargets that use the ELF object format
2401require GNU binutils 2.13 or newer. Such subtargets include:
2402@code{arm-*-freebsd}, @code{arm-*-netbsdelf}, @code{arm-*-*linux},
2403@code{arm-*-rtems} and @code{arm-*-kaos}.
2404
2405@html
2406<hr />
2407@end html
2408@heading @anchor{arm-*-coff}arm-*-coff
61aeb06f 2409ARM-family processors. Note that there are two different varieties
34e8290f
NC
2410of PE format subtarget supported: @code{arm-wince-pe} and
2411@code{arm-pe} as well as a standard COFF target @code{arm-*-coff}.
2412
34e8290f
NC
2413@html
2414<hr />
2415@end html
2416@heading @anchor{arm-*-aout}arm-*-aout
2417ARM-family processors. These targets support the AOUT file format:
2418@code{arm-*-aout}, @code{arm-*-netbsd}.
476c334e 2419
f42974dc 2420@html
b8db17af 2421<hr />
f42974dc 2422@end html
ef88b07d 2423@heading @anchor{avr}avr
f42974dc 2424
b8df899a 2425ATMEL AVR-family micro controllers. These are used in embedded
ca52d046
GP
2426applications. There are no standard Unix configurations.
2427@ifnothtml
2428@xref{AVR Options,, AVR Options, gcc, Using and Porting the GNU Compiler
2429Collection (GCC)},
2430@end ifnothtml
98999d8b 2431@ifhtml
ca52d046 2432See ``AVR Options'' in the main manual
98999d8b 2433@end ifhtml
ca52d046 2434for the list of supported MCU types.
b8df899a 2435
161d7b59 2436Use @samp{configure --target=avr --enable-languages="c"} to configure GCC@.
f42974dc
DW
2437
2438Further installation notes and other useful information about AVR tools
2439can also be obtained from:
2440
2441@itemize @bullet
2442@item
de7999ba
MM
2443@uref{http://www.openavr.org,,http://www.openavr.org}
2444@item
d1a86812 2445@uref{http://home.overta.ru/users/denisc/,,http://home.overta.ru/users/denisc/}
f42974dc 2446@item
d1a86812 2447@uref{http://www.amelek.gda.pl/avr/,,http://www.amelek.gda.pl/avr/}
f42974dc
DW
2448@end itemize
2449
de7999ba 2450We @emph{strongly} recommend using binutils 2.13 or newer.
f42974dc
DW
2451
2452The following error:
3ab51846 2453@smallexample
f42974dc 2454 Error: register required
3ab51846 2455@end smallexample
f42974dc
DW
2456
2457indicates that you should upgrade to a newer version of the binutils.
2458
0132e321 2459@html
b8db17af 2460<hr />
0132e321
MH
2461@end html
2462@heading @anchor{c4x}c4x
2463
2464Texas Instruments TMS320C3x and TMS320C4x Floating Point Digital Signal
2465Processors. These are used in embedded applications. There are no
d8393f64
GP
2466standard Unix configurations.
2467@ifnothtml
2468@xref{TMS320C3x/C4x Options,, TMS320C3x/C4x Options, gcc, Using and
2469Porting the GNU Compiler Collection (GCC)},
2470@end ifnothtml
98999d8b 2471@ifhtml
d8393f64 2472See ``TMS320C3x/C4x Options'' in the main manual
98999d8b 2473@end ifhtml
d8393f64 2474for the list of supported MCU types.
0132e321
MH
2475
2476GCC can be configured as a cross compiler for both the C3x and C4x
2477architectures on the same system. Use @samp{configure --target=c4x
2478--enable-languages="c,c++"} to configure.
2479
2480
2481Further installation notes and other useful information about C4x tools
2482can also be obtained from:
2483
2484@itemize @bullet
2485@item
d8393f64 2486@uref{http://www.elec.canterbury.ac.nz/c4x/,,http://www.elec.canterbury.ac.nz/c4x/}
0132e321
MH
2487@end itemize
2488
0b85d816 2489@html
b8db17af 2490<hr />
0b85d816
HPN
2491@end html
2492@heading @anchor{cris}CRIS
2493
2494CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
2495series. These are used in embedded applications.
2496
2497@ifnothtml
2498@xref{CRIS Options,, CRIS Options, gcc, Using and Porting the GNU Compiler
2499Collection (GCC)},
2500@end ifnothtml
2501@ifhtml
2502See ``CRIS Options'' in the main manual
2503@end ifhtml
2504for a list of CRIS-specific options.
2505
2506There are a few different CRIS targets:
2507@table @code
2508@item cris-axis-aout
2509Old target. Includes a multilib for the @samp{elinux} a.out-based
2510target. No multilibs for newer architecture variants.
2511@item cris-axis-elf
2512Mainly for monolithic embedded systems. Includes a multilib for the
2513@samp{v10} core used in @samp{ETRAX 100 LX}.
2514@item cris-axis-linux-gnu
2515A GNU/Linux port for the CRIS architecture, currently targeting
2516@samp{ETRAX 100 LX} by default.
2517@end table
2518
2519For @code{cris-axis-aout} and @code{cris-axis-elf} you need binutils 2.11
2520or newer. For @code{cris-axis-linux-gnu} you need binutils 2.12 or newer.
2521
2522Pre-packaged tools can be obtained from
2523@uref{ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/}. More
2524information about this platform is available at
2525@uref{http://developer.axis.com/}.
2526
f42974dc 2527@html
b8db17af 2528<hr />
f42974dc 2529@end html
ef88b07d 2530@heading @anchor{dos}DOS
f42974dc
DW
2531
2532Please have a look at our @uref{binaries.html,,binaries page}.
2533
f0523f02 2534You cannot install GCC by itself on MSDOS; it will not compile under
f85b8d1a
JM
2535any MSDOS compiler except itself. You need to get the complete
2536compilation package DJGPP, which includes binaries as well as sources,
2537and includes all the necessary compilation tools and libraries.
2538
021c4bfd 2539@html
b8db17af 2540<hr />
021c4bfd
RO
2541@end html
2542@heading @anchor{*-*-freebsd*}*-*-freebsd*
2543
f08dc6c1
LR
2544The version of binutils installed in @file{/usr/bin} probably works with
2545this release of GCC. However, on FreeBSD 4, bootstrapping against the
2546latest FSF binutils is known to improve overall testsuite results; and,
2547on FreeBSD/alpha, using binutils 2.14 or later is required to build libjava.
021c4bfd 2548
6a1dbbaf 2549Support for FreeBSD 1 was discontinued in GCC 3.2.
c7bdf0a6 2550
f08dc6c1
LR
2551Support for FreeBSD 2 will be discontinued after GCC 3.4. The
2552following was true for GCC 3.1 but the current status is unknown.
c7bdf0a6 2553For FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All
021c4bfd
RO
2554configuration support and files as shipped with GCC 2.95 are still in
2555place. FreeBSD 2.2.7 has been known to bootstrap completely; however,
2556it is unknown which version of binutils was used (it is assumed that it
2557was the system copy in @file{/usr/bin}) and C++ EH failures were noted.
2558
2559For FreeBSD using the ELF file format: DWARF 2 debugging is now the
2560default for all CPU architectures. It had been the default on
2561FreeBSD/alpha since its inception. You may use @option{-gstabs} instead
2562of @option{-g}, if you really want the old debugging format. There are
2563no known issues with mixing object files and libraries with different
2564debugging formats. Otherwise, this release of GCC should now match more
2565of the configuration used in the stock FreeBSD configuration of GCC. In
2566particular, @option{--enable-threads} is now configured by default.
2567However, as a general user, do not attempt to replace the system
2568compiler with this release. Known to bootstrap and check with good
f08dc6c1 2569results on FreeBSD 4.9-STABLE and 5-CURRENT@. In the past, known to
e4e7d312 2570bootstrap and check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2,
f08dc6c1 25714.3, 4.4, 4.5, 4.8-STABLE@.
46fc709d
LR
2572
2573In principle, @option{--enable-threads} is now compatible with
2574@option{--enable-libgcj} on FreeBSD@. However, it has only been built
e4e7d312 2575and tested on @samp{i386-*-freebsd[45]} and @samp{alpha-*-freebsd[45]}.
8c085f6f 2576The static
6b976d99
LR
2577library may be incorrectly built (symbols are missing at link time).
2578There is a rare timing-based startup hang (probably involves an
c0478a66 2579assumption about the thread library). Multi-threaded boehm-gc (required for
46fc709d 2580libjava) exposes severe threaded signal-handling bugs on FreeBSD before
e4e7d312 25814.5-RELEASE@. Other CPU architectures
46fc709d
LR
2582supported by FreeBSD will require additional configuration tuning in, at
2583the very least, both boehm-gc and libffi.
021c4bfd 2584
bc3a44db
LR
2585Shared @file{libgcc_s.so} is now built and installed by default.
2586
f42974dc 2587@html
b8db17af 2588<hr />
f42974dc 2589@end html
ef88b07d 2590@heading @anchor{h8300-hms}h8300-hms
71c6b994 2591Renesas H8/300 series of processors.
f42974dc
DW
2592
2593Please have a look at our @uref{binaries.html,,binaries page}.
2594
b8df899a
JM
2595The calling convention and structure layout has changed in release 2.6.
2596All code must be recompiled. The calling convention now passes the
2597first three arguments in function calls in registers. Structures are no
2598longer a multiple of 2 bytes.
2599
f42974dc 2600@html
b8db17af 2601<hr />
f42974dc 2602@end html
ef88b07d 2603@heading @anchor{hppa*-hp-hpux*}hppa*-hp-hpux*
6a1dbbaf 2604Support for HP-UX version 9 and older was discontinued in GCC 3.4.
f42974dc 2605
021c4bfd 2606We @emph{highly} recommend using gas/binutils 2.8 or newer on all hppa
f9047ed3 2607platforms; you may encounter a variety of problems when using the HP
581d9404 2608assembler.
f42974dc
DW
2609
2610Specifically, @option{-g} does not work on HP-UX (since that system
2611uses a peculiar debugging format which GCC does not know about), unless you
38209993
LG
2612use GAS and GDB and configure GCC with the
2613@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
6cfb3f16 2614@option{--with-as=@dots{}} options.
f42974dc 2615
08b3d104 2616If you wish to use the pa-risc 2.0 architecture support with a 32-bit
c5124497
JDA
2617runtime, you must use either the HP assembler, or gas/binutils 2.11
2618or newer.
f42974dc 2619
d5355cb2
JDA
2620There are two default scheduling models for instructions. These are
2621PROCESSOR_7100LC and PROCESSOR_8000. They are selected from the pa-risc
2622architecture specified for the target machine when configuring.
2623PROCESSOR_8000 is the default. PROCESSOR_7100LC is selected when
2624the target is a @samp{hppa1*} machine.
806bf413
JDA
2625
2626The PROCESSOR_8000 model is not well suited to older processors. Thus,
2627it is important to completely specify the machine architecture when
2628configuring if you want a model other than PROCESSOR_8000. The macro
2629TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different
2630default scheduling model is desired.
2631
021c4bfd 2632More specific information to @samp{hppa*-hp-hpux*} targets follows.
f42974dc 2633
f42974dc 2634@html
b8db17af 2635<hr />
f42974dc 2636@end html
ef88b07d 2637@heading @anchor{hppa*-hp-hpux10}hppa*-hp-hpux10
f42974dc 2638
f9047ed3 2639For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
161d7b59 2640@code{PHCO_19798} from HP@. HP has two sites which provide patches free of
f42974dc
DW
2641charge:
2642
2643@itemize @bullet
2644@item
2645@html
f401d0f5 2646<a href="http://us.itrc.hp.com/service/home/home.do">US, Canada, Asia-Pacific, and
f42974dc
DW
2647Latin-America</a>
2648@end html
2649@ifnothtml
f401d0f5
JDA
2650@uref{http://us.itrc.hp.com/service/home/home.do,,} US, Canada, Asia-Pacific,
2651and Latin-America.
f42974dc
DW
2652@end ifnothtml
2653@item
f401d0f5 2654@uref{http://europe.itrc.hp.com/service/home/home.do,,} Europe.
f42974dc
DW
2655@end itemize
2656
2aea0b53
ZW
2657The HP assembler on these systems has some problems. Most notably the
2658assembler inserts timestamps into each object file it creates, causing
2659the 3-stage comparison test to fail during a @samp{make bootstrap}.
2660You should be able to continue by saying @samp{make all} after getting
2661the failure from @samp{make bootstrap}.
f42974dc
DW
2662
2663
2664@html
b8db17af 2665<hr />
f42974dc 2666@end html
ef88b07d 2667@heading @anchor{hppa*-hp-hpux11}hppa*-hp-hpux11
f42974dc 2668
c5124497
JDA
2669GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot
2670be used to compile GCC 3.0 and up.
f269f54f 2671
c5124497
JDA
2672Refer to @uref{binaries.html,,binaries} for information about obtaining
2673precompiled GCC binaries for HP-UX. Precompiled binaries must be obtained
2674to build the Ada language as it can't be bootstrapped using C. Ada is
2675only available for the 32-bit PA-RISC runtime. The libffi and libjava
2676haven't been ported to HP-UX and don't build.
f401d0f5 2677
c5124497
JDA
2678It is possible to build GCC 3.3 starting with the bundled HP compiler,
2679but the process requires several steps. GCC 3.3 can then be used to
2680build later versions. The fastjar program contains ISO C code and
2681can't be built with the HP bundled compiler. This problem can be
2682avoided by not building the Java language. For example, use the
2683@option{--enable-languages="c,c++,f77,objc"} option in your configure
2684command.
08b3d104 2685
c5124497
JDA
2686Starting with GCC 3.4 an ISO C compiler is required to bootstrap. The
2687bundled compiler supports only traditional C; you will need either HP's
2688unbundled compiler, or a binary distribution of GCC@.
8c085f6f 2689
c5124497
JDA
2690There are several possible approaches to building the distribution.
2691Binutils can be built first using the HP tools. Then, the GCC
2692distribution can be built. The second approach is to build GCC
2693first using the HP tools, then build binutils, then rebuild GCC.
2694There have been problems with various binary distributions, so it
2695is best not to start from a binary distribution.
2696
2697On 64-bit capable systems, there are two distinct targets. Different
2698installation prefixes must be used if both are to be installed on
2699the same system. The @samp{hppa[1-2]*-hp-hpux11*} target generates code
2700for the 32-bit PA-RISC runtime architecture and uses the HP linker.
2701The @samp{hppa64-hp-hpux11*} target generates 64-bit code for the
2702PA-RISC 2.0 architecture. The HP and GNU linkers are both supported
2703for this target.
2704
2705The script config.guess now selects the target type based on the compiler
2706detected during configuration. You must define @env{PATH} or @env{CC} so
2707that configure finds an appropriate compiler for the initial bootstrap.
2708When @env{CC} is used, the definition should contain the options that are
2709needed whenever @env{CC} is used.
2710
2711Specifically, options that determine the runtime architecture must be
2712in @env{CC} to correctly select the target for the build. It is also
2713convenient to place many other compiler options in @env{CC}. For example,
2714@env{CC="cc -Ac +DA2.0W -Wp,-H16376 -D_CLASSIC_TYPES -D_HPUX_SOURCE"}
2715can be used to bootstrap the GCC 3.3 branch with the HP compiler in
271664-bit K&R/bundled mode. The @option{+DA2.0W} option will result in
2717the automatic selection of the @samp{hppa64-hp-hpux11*} target. The
2718macro definition table of cpp needs to be increased for a successful
2719build with the HP compiler. _CLASSIC_TYPES and _HPUX_SOURCE need to
2720be defined when building with the bundled compiler, or when using the
2721@option{-Ac} option. These defines aren't necessary with @option{-Ae}.
8c085f6f 2722
c5124497
JDA
2723It is best to explicitly configure the @samp{hppa64-hp-hpux11*} target
2724with the @option{--with-ld=@dots{}} option. This overrides the standard
2725search for ld. The two linkers supported on this target require different
2726commands. The default linker is determined during configuration. As a
2727result, it's not possible to switch linkers in the middle of a GCC build.
2728This has been been reported to sometimes occur in unified builds of
2729binutils and GCC.
2730
2731With GCC 3.0 through 3.2, you must use binutils 2.11 or above. As of
2732GCC 3.3, binutils 2.14 or later is required.
2733
2734Although the HP assembler can be used for an initial build, it shouldn't
2735be used with any languages other than C and perhaps Fortran due to its
2736many limitations. For example, it does not support weak symbols or alias
2737definitions. As a result, explicit template instantiations are required
2738when using C++. This makes it difficult if not impossible to build many
2739C++ applications. You can't generate debugging information when using
2740the HP assembler. Finally, @samp{make bootstrap} fails in the final
2741comparison of object modules due to the time stamps that it inserts into
2742the modules. The bootstrap can be continued from this point with
2743@samp{make all}.
2744
2745A recent linker patch must be installed for the correct operation of
2746GCC 3.3 and later. @code{PHSS_26559} and @code{PHSS_24304} are the
2747oldest linker patches that are known to work. They are for HP-UX
274811.00 and 11.11, respectively. @code{PHSS_24303}, the companion to
2749@code{PHSS_24304}, might be usable but it hasn't been tested. These
2750patches have been superseded. Consult the HP patch database to obtain
2751the currently recommended linker patch for your system.
2752
2753The patches are necessary for the support of weak symbols on the
275432-bit port, and for the running of initializers and finalizers. Weak
2755symbols are implemented using SOM secondary definition symbols. Prior
2756to HP-UX 11, there are bugs in the linker support for secondary symbols.
2757The patches correct a problem of linker core dumps creating shared
2758libraries containing secondary symbols, as well as various other
2759linking issues involving secondary symbols.
2760
2761GCC 3.3 uses the ELF DT_INIT_ARRAY and DT_FINI_ARRAY capabilities to
2762run initializers and finalizers on the 64-bit port. The 32-bit port
2763uses the linker @option{+init} and @option{+fini} options for the same
2764purpose. The patches correct various problems with the +init/+fini
2765options, including program core dumps. Binutils 2.14 corrects a
2766problem on the 64-bit port resulting from HP's non-standard use of
2767the .init and .fini sections for array initializers and finalizers.
f401d0f5
JDA
2768
2769There are a number of issues to consider in selecting which linker to
c5124497 2770use with the 64-bit port. The GNU 64-bit linker can only create dynamic
f401d0f5
JDA
2771binaries. The @option{-static} option causes linking with archive
2772libraries but doesn't produce a truly static binary. Dynamic binaries
2773still require final binding by the dynamic loader to resolve a set of
2774dynamic-loader-defined symbols. The default behavior of the HP linker
2775is the same as the GNU linker. However, it can generate true 64-bit
2776static binaries using the @option{+compat} option.
2777
2778The HP 64-bit linker doesn't support linkonce semantics. As a
2779result, C++ programs have many more sections than they should.
2780
2781The GNU 64-bit linker has some issues with shared library support
2782and exceptions. As a result, we only support libgcc in archive
2783format. For similar reasons, dwarf2 unwind and exception support
2784are disabled. The GNU linker also has problems creating binaries
2785with @option{-static}. It doesn't provide stubs for internal
2786calls to global functions in shared libraries, so these calls
2787can't be overloaded.
581d9404 2788
c5124497
JDA
2789Thread support is not implemented in GCC 3.0 through 3.2, so the
2790@option{--enable-threads} configure option does not work. In 3.3
2791and later, POSIX threads are supported. The optional DCE thread
2792library is not supported.
581d9404
JDA
2793
2794This port still is undergoing significant development.
08b3d104 2795
f42974dc 2796@html
b8db17af 2797<hr />
f42974dc 2798@end html
ef88b07d 2799@heading @anchor{*-*-linux-gnu}*-*-linux-gnu
f42974dc 2800
9e80ada7
PE
2801Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present
2802in glibc 2.2.5 and later. More information is available in the
2803libstdc++-v3 documentation.
2804
b8df899a 2805@html
b8db17af 2806<hr />
b8df899a
JM
2807@end html
2808@heading @anchor{ix86-*-linux*aout}i?86-*-linux*aout
2809Use this configuration to generate @file{a.out} binaries on Linux-based
41ca24de 2810GNU systems. This configuration is being superseded.
b8df899a 2811
f42974dc 2812@html
b8db17af 2813<hr />
f42974dc 2814@end html
ef88b07d 2815@heading @anchor{ix86-*-linux*}i?86-*-linux*
f42974dc 2816
1ea6f4c8
DH
2817As of GCC 3.3, binutils 2.13.1 or later is required for this platform.
2818See @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information.
f42974dc
DW
2819
2820If you receive Signal 11 errors when building on GNU/Linux, then it is
2821possible you have a hardware problem. Further information on this can be
2822found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
2823
2824@html
b8db17af 2825<hr />
f42974dc 2826@end html
ef88b07d 2827@heading @anchor{ix86-*-sco3.2v5*}i?86-*-sco3.2v5*
b8df899a 2828Use this for the SCO OpenServer Release 5 family of operating systems.
f42974dc
DW
2829
2830Unlike earlier versions of GCC, the ability to generate COFF with this
2831target is no longer provided.
2832
021c4bfd 2833Earlier versions of GCC emitted DWARF 1 when generating ELF to allow
f42974dc 2834the system debugger to be used. That support was too burdensome to
021c4bfd 2835maintain. GCC now emits only DWARF 2 for this target. This means you
f42974dc 2836may use either the UDK debugger or GDB to debug programs built by this
161d7b59 2837version of GCC@.
f42974dc 2838
ac24fc99
KJ
2839GCC is now only supported on releases 5.0.4 and later, and requires that
2840you install Support Level Supplement OSS646B or later, and Support Level
2841Supplement OSS631C or later. If you are using release 5.0.7 of
2842OpenServer, you must have at least the first maintenance pack installed
2843(this includes the relevant portions of OSS646). OSS646, also known as
2844the "Execution Environment Update", provides updated link editors and
2845assemblers, as well as updated standard C and math libraries. The C
2846startup modules are also updated to support the System V gABI draft, and
0b4be7de 2847GCC relies on that behavior. OSS631 provides a collection of commonly
ac24fc99
KJ
2848used open source libraries, some of which GCC depends on (such as GNU
2849gettext and zlib). SCO OpenServer Release 5.0.7 has all of this built
2850in by default, but OSS631C and later also apply to that release. Please
2851visit
2852@uref{ftp://ftp.sco.com/pub/openserver5,,ftp://ftp.sco.com/pub/openserver5}
2853for the latest versions of these (and other potentially useful)
2854supplements.
2855
2856Although there is support for using the native assembler, it is
2857recommended that you configure GCC to use the GNU assembler. You do
2858this by using the flags
2859@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}}. You should
2860use a modern version of GNU binutils. Version 2.13.2.1 was used for all
2861testing. In general, only the @option{--with-gnu-as} option is tested.
2862A modern bintuils (as well as a plethora of other development related
2863GNU utilities) can be found in Support Level Supplement OSS658A, the
2864"GNU Development Tools" package. See the SCO web and ftp sites for details.
2865That package also contains the currently "officially supported" version of
daf2f129 2866GCC, version 2.95.3. It is useful for bootstrapping this version.
f42974dc 2867
f42974dc 2868@html
b8db17af 2869<hr />
f42974dc 2870@end html
ef88b07d 2871@heading @anchor{ix86-*-udk}i?86-*-udk
f42974dc
DW
2872
2873This target emulates the SCO Universal Development Kit and requires that
f9047ed3
JM
2874package be installed. (If it is installed, you will have a
2875@file{/udk/usr/ccs/bin/cc} file present.) It's very much like the
b953cc4b 2876@samp{i?86-*-unixware7*} target
f42974dc
DW
2877but is meant to be used when hosting on a system where UDK isn't the
2878default compiler such as OpenServer 5 or Unixware 2. This target will
f9047ed3 2879generate binaries that will run on OpenServer, Unixware 2, or Unixware 7,
161d7b59 2880with the same warnings and caveats as the SCO UDK@.
f42974dc 2881
f42974dc
DW
2882This target is a little tricky to build because we have to distinguish
2883it from the native tools (so it gets headers, startups, and libraries
f9047ed3 2884from the right place) while making the tools not think we're actually
f42974dc
DW
2885building a cross compiler. The easiest way to do this is with a configure
2886command like this:
2887
3ab51846 2888@smallexample
8c085f6f
JJ
2889 CC=/udk/usr/ccs/bin/cc @var{/your/path/to}/gcc/configure \
2890 --host=i686-pc-udk --target=i686-pc-udk --program-prefix=udk-
3ab51846 2891@end smallexample
f42974dc 2892
6cfb3f16 2893@emph{You should substitute @samp{i686} in the above command with the appropriate
f42974dc
DW
2894processor for your host.}
2895
021c4bfd
RO
2896After the usual @samp{make bootstrap} and
2897@samp{make install}, you can then access the UDK-targeted GCC
38209993
LG
2898tools by adding @command{udk-} before the commonly known name. For
2899example, to invoke the C compiler, you would use @command{udk-gcc}.
2900They will coexist peacefully with any native-target GCC tools you may
2901have installed.
f42974dc
DW
2902
2903
b499d9ab 2904@html
b8db17af 2905<hr />
b499d9ab
JJ
2906@end html
2907@heading @anchor{ia64-*-linux}ia64-*-linux
2908IA-64 processor (also known as IPF, or Itanium Processor Family)
2909running GNU/Linux.
2910
bcd11e5e
JW
2911If you are using the optional libunwind library, then you must use
2912libunwind 0.96 or later.
2913
b499d9ab
JJ
2914None of the following versions of GCC has an ABI that is compatible
2915with any of the other versions in this list, with the exception that
2916Red Hat 2.96 and Trillian 000171 are compatible with each other:
41ca24de 29173.1, 3.0.2, 3.0.1, 3.0, Red Hat 2.96, and Trillian 000717.
b499d9ab 2918This primarily affects C++ programs and programs that create shared libraries.
41ca24de
DH
2919GCC 3.1 or later is recommended for compiling linux, the kernel.
2920As of version 3.1 GCC is believed to be fully ABI compliant, and hence no
2921more major ABI changes are expected.
b499d9ab 2922
959a73a4
DH
2923@html
2924<hr />
2925@end html
2926@heading @anchor{ia64-*-hpux*}ia64-*-hpux*
2927Building GCC on this target requires the GNU Assembler. The bundled HP
2928assembler will not work. To prevent GCC from using the wrong assembler,
2929the option @option{--with-gnu-as} may be necessary.
2930
2931The GCC libunwind library has not been ported to HPUX. This means that for
2932GCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions}
2933is required to build GCC. For GCC 3.3 and later, this is the default.
2934
f42974dc 2935@html
b8db17af 2936<hr />
f42974dc
DW
2937<!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
2938@end html
ef88b07d 2939@heading @anchor{*-ibm-aix*}*-ibm-aix*
6a1dbbaf 2940Support for AIX version 3 and older was discontinued in GCC 3.4.
f42974dc 2941
41ca24de 2942AIX Make frequently has problems with GCC makefiles. GNU Make 3.79.1 or
f42974dc
DW
2943newer is recommended to build on this platform.
2944
e8d8a034
DE
2945To speed up the configuration phases of bootstrapping and installing GCC,
2946one may use GNU Bash instead of AIX @command{/bin/sh}, e.g.,
2947
2948@smallexample
2949 % CONFIG_SHELL=/opt/freeware/bin/bash
2950 % export CONFIG_SHELL
2951@end smallexample
2952
2953and then proceed as described in @uref{build.html,,the build instructions},
2954where we strongly recommend using GNU make and specifying an absolute path
2955to invoke @var{srcdir}/configure.
2956
6cfb3f16 2957Errors involving @code{alloca} when building GCC generally are due
021c4bfd 2958to an incorrect definition of @code{CC} in the Makefile or mixing files
161d7b59 2959compiled with the native C compiler and GCC@. During the stage1 phase of
6cfb3f16
JM
2960the build, the native AIX compiler @strong{must} be invoked as @command{cc}
2961(not @command{xlc}). Once @command{configure} has been informed of
2962@command{xlc}, one needs to use @samp{make distclean} to remove the
38209993 2963configure cache files and ensure that @env{CC} environment variable
f42974dc
DW
2964does not provide a definition that will confuse @command{configure}.
2965If this error occurs during stage2 or later, then the problem most likely
2966is the version of Make (see above).
2967
f0483418
DE
2968The native @command{as} and @command{ld} are recommended for bootstrapping
2969on AIX 4 and required for bootstrapping on AIX 5L. The GNU Assembler
2970reports that it supports WEAK symbols on AIX 4, which causes GCC to try to
2971utilize weak symbol functionality although it is not supported. The GNU
2972Assembler and Linker do not support AIX 5L sufficiently to bootstrap GCC.
2973The native AIX tools do interoperate with GCC@.
df002c7d 2974
04d2be8e 2975Building @file{libstdc++.a} requires a fix for an AIX Assembler bug
bb674cef
DE
2976APAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1). It also requires a
2977fix for another AIX Assembler bug and a co-dependent AIX Archiver fix
06e7f299 2978referenced as APAR IY53606 (AIX 5.2) or a APAR IY54774 (AIX 5.1)
2705baf5 2979
bb674cef 2980@samp{libstdc++} in GCC 3.4 increments the major version number of the
fdf68669 2981shared object and GCC installation places the @file{libstdc++.a}
bb674cef
DE
2982shared library in a common location which will overwrite the and GCC
29833.3 version of the shared library. Applications either need to be
2984re-linked against the new shared library or the GCC 3.1 and GCC 3.3
2985versions of the @samp{libstdc++} shared object needs to be available
2986to the AIX runtime loader. The GCC 3.1 @samp{libstdc++.so.4}, if
2987present, and GCC 3.3 @samp{libstdc++.so.5} shared objects can be
2988installed for runtime dynamic loading using the following steps to set
2989the @samp{F_LOADONLY} flag in the shared object for @emph{each}
fdf68669
DE
2990multilib @file{libstdc++.a} installed:
2991
bb674cef
DE
2992Extract the shared objects from the currently installed
2993@file{libstdc++.a} archive:
3ab51846 2994@smallexample
bb674cef 2995 % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
3ab51846 2996@end smallexample
fdf68669
DE
2997
2998Enable the @samp{F_LOADONLY} flag so that the shared object will be
2999available for runtime dynamic loading, but not linking:
3ab51846 3000@smallexample
bb674cef 3001 % strip -e libstdc++.so.4 libstdc++.so.5
3ab51846 3002@end smallexample
fdf68669 3003
bb674cef 3004Archive the runtime-only shared object in the GCC 3.4
fdf68669 3005@file{libstdc++.a} archive:
3ab51846 3006@smallexample
bb674cef 3007 % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
3ab51846 3008@end smallexample
fdf68669 3009
df002c7d
DE
3010Linking executables and shared libraries may produce warnings of
3011duplicate symbols. The assembly files generated by GCC for AIX always
3012have included multiple symbol definitions for certain global variable
3013and function declarations in the original program. The warnings should
3014not prevent the linker from producing a correct library or runnable
3015executable.
3016
6cfb3f16 3017AIX 4.3 utilizes a ``large format'' archive to support both 32-bit and
df002c7d
DE
301864-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
3019to parse archive libraries did not handle the new format correctly.
3020These routines are used by GCC and result in error messages during
6cfb3f16 3021linking such as ``not a COFF file''. The version of the routines shipped
df002c7d
DE
3022with AIX 4.3.1 should work for a 32-bit environment. The @option{-g}
3023option of the archive command may be used to create archives of 32-bit
6cfb3f16 3024objects using the original ``small format''. A correct version of the
d5d8d540 3025routines is shipped with AIX 4.3.2 and above.
df002c7d 3026
f42974dc
DW
3027Some versions of the AIX binder (linker) can fail with a relocation
3028overflow severe error when the @option{-bbigtoc} option is used to link
161d7b59 3029GCC-produced object files into an executable that overflows the TOC@. A fix
f42974dc
DW
3030for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
3031available from IBM Customer Support and from its
d5d8d540 3032@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
f42974dc
DW
3033website as PTF U455193.
3034
df002c7d 3035The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
161d7b59 3036with a segmentation fault when invoked by any version of GCC@. A fix for
df002c7d 3037APAR IX87327 is available from IBM Customer Support and from its
d5d8d540 3038@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
df002c7d 3039website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above.
f42974dc
DW
3040
3041The initial assembler shipped with AIX 4.3.0 generates incorrect object
3042files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
3043TO ASSEMBLE/BIND) is available from IBM Customer Support and from its
d5d8d540 3044@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
f42974dc
DW
3045website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above.
3046
161d7b59 3047AIX provides National Language Support (NLS)@. Compilers and assemblers
df002c7d 3048use NLS to support locale-specific representations of various data
6cfb3f16 3049formats including floating-point numbers (e.g., @samp{.} vs @samp{,} for
df002c7d
DE
3050separating decimal fractions). There have been problems reported where
3051GCC does not produce the same floating-point formats that the assembler
c771326b 3052expects. If one encounters this problem, set the @env{LANG}
6cfb3f16 3053environment variable to @samp{C} or @samp{En_US}.
f42974dc 3054
5791e6da
DE
3055By default, GCC for AIX 4.1 and above produces code that can be used on
3056both Power or PowerPC processors.
3057
d5d8d540
DE
3058A default can be specified with the @option{-mcpu=@var{cpu_type}}
3059switch and using the configure option @option{--with-cpu-@var{cpu_type}}.
f42974dc 3060
e3223ea2 3061@html
b8db17af 3062<hr />
e3223ea2
DC
3063@end html
3064@heading @anchor{ip2k-*-elf}ip2k-*-elf
3065Ubicom IP2022 micro controller.
3066This configuration is intended for embedded systems.
3067There are no standard Unix configurations.
3068
3069Use @samp{configure --target=ip2k-elf --enable-languages=c} to configure GCC@.
3070
6b3d1e47
SC
3071@html
3072<hr />
3073@end html
3074@heading @anchor{iq2000-*-elf}iq2000-*-elf
3075Vitesse IQ2000 processors. These are used in embedded
3076applications. There are no standard Unix configurations.
3077
b8df899a 3078@html
b8db17af 3079<hr />
b8df899a
JM
3080@end html
3081@heading @anchor{m32r-*-elf}m32r-*-elf
25f47a4c 3082Renesas M32R processor.
b8df899a
JM
3083This configuration is intended for embedded systems.
3084
b8df899a 3085@html
b8db17af 3086<hr />
b8df899a
JM
3087@end html
3088@heading @anchor{m6811-elf}m6811-elf
3089Motorola 68HC11 family micro controllers. These are used in embedded
3090applications. There are no standard Unix configurations.
3091
3092@html
b8db17af 3093<hr />
b8df899a
JM
3094@end html
3095@heading @anchor{m6812-elf}m6812-elf
3096Motorola 68HC12 family micro controllers. These are used in embedded
3097applications. There are no standard Unix configurations.
3098
b8df899a 3099@html
b8db17af 3100<hr />
b8df899a
JM
3101@end html
3102@heading @anchor{m68k-hp-hpux}m68k-hp-hpux
161d7b59
JM
3103HP 9000 series 300 or 400 running HP-UX@. HP-UX version 8.0 has a bug in
3104the assembler that prevents compilation of GCC@. This
b8df899a
JM
3105bug manifests itself during the first stage of compilation, while
3106building @file{libgcc2.a}:
3107
3108@smallexample
3109_floatdisf
3110cc1: warning: `-g' option not supported on this version of GCC
3111cc1: warning: `-g1' option not supported on this version of GCC
3112./xgcc: Internal compiler error: program as got fatal signal 11
3113@end smallexample
3114
3115A patched version of the assembler is available as the file
3116@uref{ftp://altdorf.ai.mit.edu/archive/cph/hpux-8.0-assembler}. If you
3117have HP software support, the patch can also be obtained directly from
3118HP, as described in the following note:
3119
3120@quotation
3121This is the patched assembler, to patch SR#1653-010439, where the
3122assembler aborts on floating point constants.
3123
3124The bug is not really in the assembler, but in the shared library
3125version of the function ``cvtnum(3c)''. The bug on ``cvtnum(3c)'' is
3126SR#4701-078451. Anyway, the attached assembler uses the archive
3127library version of ``cvtnum(3c)'' and thus does not exhibit the bug.
3128@end quotation
3129
3130This patch is also known as PHCO_4484.
3131
41ca24de 3132In addition gdb does not understand that native HP-UX format, so
b8df899a
JM
3133you must use gas if you wish to use gdb.
3134
3135On HP-UX version 8.05, but not on 8.07 or more recent versions, the
7ba4ca63 3136@command{fixproto} shell script triggers a bug in the system shell. If you
b8df899a 3137encounter this problem, upgrade your operating system or use BASH (the
7ba4ca63 3138GNU shell) to run @command{fixproto}. This bug will cause the fixproto
b8df899a
JM
3139program to report an error of the form:
3140
3ab51846 3141@smallexample
b8df899a 3142./fixproto: sh internal 1K buffer overflow
3ab51846 3143@end smallexample
b8df899a
JM
3144
3145To fix this, you can also change the first line of the fixproto script
3146to look like:
3147
3ab51846 3148@smallexample
b8df899a 3149#!/bin/ksh
3ab51846 3150@end smallexample
b8df899a 3151
b8df899a 3152@html
b8db17af 3153<hr />
b8df899a
JM
3154@end html
3155@heading @anchor{mips-*-*}mips-*-*
b8df899a
JM
3156If on a MIPS system you get an error message saying ``does not have gp
3157sections for all it's [sic] sectons [sic]'', don't worry about it. This
3158happens whenever you use GAS with the MIPS linker, but there is not
3159really anything wrong, and it is okay to use the output file. You can
3160stop such warnings by installing the GNU linker.
3161
3162It would be nice to extend GAS to produce the gp tables, but they are
3163optional, and there should not be a warning about their absence.
3164
26979a17
PE
3165The libstdc++ atomic locking routines for MIPS targets requires MIPS II
3166and later. A patch went in just after the GCC 3.3 release to
3167make @samp{mips*-*-*} use the generic implementation instead. You can also
3168configure for @samp{mipsel-elf} as a workaround. The
3169@samp{mips*-*-linux*} target continues to use the MIPS II routines. More
3170work on this is expected in future releases.
3171
01e97976
JM
3172Cross-compilers for the Mips as target using the Mips assembler
3173currently do not work, because the auxiliary programs
3174@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on
3175anything but a Mips. It does work to cross compile for a Mips
3176if you use the GNU assembler and linker.
3177
5fb57097
EB
3178@html
3179<hr />
3180@end html
b953cc4b
RO
3181@heading @anchor{mips-sgi-irix5}mips-sgi-irix5
3182
7e270317
RO
3183In order to compile GCC on an SGI running IRIX 5, the @samp{compiler_dev.hdr}
3184subsystem must be installed from the IDO CD-ROM supplied by SGI@.
3185It is also available for download from
8df5a2b4 3186@uref{ftp://ftp.sgi.com/sgi/IRIX5.3/iris-development-option-5.3.tardist}.
f42974dc 3187
213ba345
RO
3188If you use the MIPS C compiler to bootstrap, it may be necessary
3189to increase its table size for switch statements with the
3190@option{-Wf,-XNg1500} option. If you use the @option{-O2}
3191optimization option, you also need to use @option{-Olimit 3000}.
f42974dc 3192
7e270317
RO
3193To enable debugging under IRIX 5, you must use GNU binutils 2.15 or
3194later, and use the @option{--with-gnu-as} and @option{--with-gnu-ld}
3195@command{configure} options when configuring GCC@. You need to use GNU
3196@command{ar} and @command{nm}, also distributed with GNU binutils.
f42974dc
DW
3197
3198@html
b8db17af 3199<hr />
f42974dc 3200@end html
b953cc4b 3201@heading @anchor{mips-sgi-irix6}mips-sgi-irix6
f42974dc 3202
7e270317 3203If you are using SGI's MIPSpro @command{cc} as your bootstrap compiler, you must
f42974dc
DW
3204ensure that the N32 ABI is in use. To test this, compile a simple C
3205file with @command{cc} and then run @command{file} on the
3206resulting object file. The output should look like:
3207
3ab51846 3208@smallexample
213ba345 3209test.o: ELF N32 MSB @dots{}
3ab51846 3210@end smallexample
f42974dc
DW
3211
3212If you see:
213ba345 3213
3ab51846 3214@smallexample
213ba345 3215test.o: ELF 32-bit MSB @dots{}
3ab51846 3216@end smallexample
213ba345
RO
3217
3218or
3219
3ab51846 3220@smallexample
213ba345 3221test.o: ELF 64-bit MSB @dots{}
3ab51846 3222@end smallexample
f42974dc 3223
213ba345 3224then your version of @command{cc} uses the O32 or N64 ABI by default. You
38209993 3225should set the environment variable @env{CC} to @samp{cc -n32}
7e270317
RO
3226before configuring GCC@. SGI's MIPSpro 7.2 assembler may misassemble
3227parts of the compiler, causing bootstrap failures. MIPSpro 7.3 is
3228known to work. MIPSpro C 7.4 may cause bootstrap failures, too, due
3229to a bug when inlining @code{memcmp}. Either add @code{-U__INLINE_INTRINSICS}
3230to the @env{CC} environment variable as a workaround or upgrade to
3231MIPSpro C 7.4.1m.
f42974dc 3232
0fca60ab 3233If you want the resulting @command{gcc} to run on old 32-bit systems
7e270317 3234with the MIPS R4400 CPU, you need to ensure that only code for the @samp{mips3}
0fca60ab
RO
3235instruction set architecture (ISA) is generated. While GCC 3.x does
3236this correctly, both GCC 2.95 and SGI's MIPSpro @command{cc} may change
3237the ISA depending on the machine where GCC is built. Using one of them
7e270317
RO
3238as the bootstrap compiler may result in @samp{mips4} code, which won't run at
3239all on @samp{mips3}-only systems. For the test program above, you should see:
0fca60ab 3240
3ab51846 3241@smallexample
0fca60ab 3242test.o: ELF N32 MSB mips-3 @dots{}
3ab51846 3243@end smallexample
0fca60ab
RO
3244
3245If you get:
3246
3ab51846 3247@smallexample
0fca60ab 3248test.o: ELF N32 MSB mips-4 @dots{}
3ab51846 3249@end smallexample
0fca60ab
RO
3250
3251instead, you should set the environment variable @env{CC} to @samp{cc
3252-n32 -mips3} or @samp{gcc -mips3} respectively before configuring GCC@.
3253
7e270317
RO
3254GCC on IRIX 6 is usually built to support the N32, O32 and N64 ABIs. If
3255you build GCC on a system that doesn't have the N64 libraries installed
3256or cannot run 64-bit binaries,
213ba345 3257you need to configure with @option{--disable-multilib} so GCC doesn't
7e270317
RO
3258try to use them. This will disable building the O32 libraries, too.
3259Look for @file{/usr/lib64/libc.so.1} to see if you
213ba345
RO
3260have the 64-bit libraries installed.
3261
7e270317
RO
3262To enable debugging for the O32 ABI, you must use GNU @command{as} from
3263GNU binutils 2.15 or later. You may also use GNU @command{ld}, but
3264this is not required and currently causes some problems with Ada.
f42974dc 3265
b953cc4b
RO
3266The @option{--enable-threads} option doesn't currently work, a patch is
3267in preparation for a future release. The @option{--enable-libgcj}
3268option is disabled by default: IRIX 6 uses a very low default limit
7e270317 3269(20480) for the command line length. Although @command{libtool} contains a
b953cc4b
RO
3270workaround for this problem, at least the N64 @samp{libgcj} is known not
3271to build despite this, running into an internal error of the native
3272@command{ld}. A sure fix is to increase this limit (@samp{ncargs}) to
3273its maximum of 262144 bytes. If you have root access, you can use the
3274@command{systune} command to do this.
3275
7e270317 3276See @uref{http://freeware.sgi.com/} for more
3aa8219e 3277information about using GCC on IRIX platforms.
f42974dc 3278
b8df899a 3279@html
b8db17af 3280<hr />
b8df899a 3281@end html
021c4bfd 3282@heading @anchor{powerpc*-*-*}powerpc-*-*
b8df899a 3283
6cfb3f16
JM
3284You can specify a default version for the @option{-mcpu=@var{cpu_type}}
3285switch by using the configure option @option{--with-cpu-@var{cpu_type}}.
b8df899a 3286
4f2b1139 3287@html
b8db17af 3288<hr />
4f2b1139
SS
3289@end html
3290@heading @anchor{powerpc-*-darwin*}powerpc-*-darwin*
3291PowerPC running Darwin (Mac OS X kernel).
3292
4f2b1139
SS
3293Pre-installed versions of Mac OS X may not include any developer tools,
3294meaning that you will not be able to build GCC from source. Tool
3295binaries are available at
11292480 3296@uref{http://developer.apple.com/tools/compilers.html} (free
4f2b1139
SS
3297registration required).
3298
b89a3806
GK
3299The default stack limit of 512K is too small, which may cause compiles
3300to fail with 'Bus error'. Set the stack larger, for instance
3301by doing @samp{limit stack 800}. It's a good idea to use the GNU
3302preprocessor instead of Apple's @file{cpp-precomp} during the first stage of
3303bootstrapping; this is automatic when doing @samp{make bootstrap}, but
3304to do it from the toplevel objdir you will need to say @samp{make
3305CC='cc -no-cpp-precomp' bootstrap}.
3306
3307The version of GCC shipped by Apple typically includes a number of
3308extensions not available in a standard GCC release. These extensions
3309are generally specific to Mac programming.
4f2b1139 3310
021c4bfd 3311@html
b8db17af 3312<hr />
021c4bfd
RO
3313@end html
3314@heading @anchor{powerpc-*-elf}powerpc-*-elf, powerpc-*-sysv4
3315PowerPC system in big endian mode, running System V.4.
3316
f42974dc 3317@html
b8db17af 3318<hr />
f42974dc 3319@end html
ef88b07d 3320@heading @anchor{powerpc-*-linux-gnu*}powerpc-*-linux-gnu*
f42974dc 3321
f9047ed3 3322You will need
e8a7b0c2 3323@uref{ftp://ftp.kernel.org/pub/linux/devel/binutils,,binutils 2.13.90.0.10}
791a949f 3324or newer for a working GCC@.
f42974dc 3325
edf1b3f3 3326@html
b8db17af 3327<hr />
edf1b3f3
AC
3328@end html
3329@heading @anchor{powerpc-*-netbsd*}powerpc-*-netbsd*
3330PowerPC system in big endian mode running NetBSD@. To build the
a38f87a9 3331documentation you will need Texinfo version 4.2 (NetBSD 1.5.1 included
edf1b3f3
AC
3332Texinfo version 3.12).
3333
b8df899a 3334@html
b8db17af 3335<hr />
b8df899a
JM
3336@end html
3337@heading @anchor{powerpc-*-eabisim}powerpc-*-eabisim
3338Embedded PowerPC system in big endian mode for use in running under the
3339PSIM simulator.
3340
b8df899a 3341@html
b8db17af 3342<hr />
b8df899a
JM
3343@end html
3344@heading @anchor{powerpc-*-eabi}powerpc-*-eabi
3345Embedded PowerPC system in big endian mode.
3346
b8df899a 3347@html
b8db17af 3348<hr />
b8df899a
JM
3349@end html
3350@heading @anchor{powerpcle-*-elf}powerpcle-*-elf, powerpcle-*-sysv4
3351PowerPC system in little endian mode, running System V.4.
3352
b8df899a 3353@html
b8db17af 3354<hr />
b8df899a
JM
3355@end html
3356@heading @anchor{powerpcle-*-eabisim}powerpcle-*-eabisim
3357Embedded PowerPC system in little endian mode for use in running under
3358the PSIM simulator.
3359
3360@html
b8db17af 3361<hr />
b8df899a
JM
3362@end html
3363@heading @anchor{powerpcle-*-eabi}powerpcle-*-eabi
3364Embedded PowerPC system in little endian mode.
3365
91abf72d 3366@html
b8db17af 3367<hr />
91abf72d
HP
3368@end html
3369@heading @anchor{s390-*-linux*}s390-*-linux*
95fef11f 3370S/390 system running GNU/Linux for S/390@.
91abf72d
HP
3371
3372@html
b8db17af 3373<hr />
91abf72d
HP
3374@end html
3375@heading @anchor{s390x-*-linux*}s390x-*-linux*
95fef11f 3376zSeries system (64-bit) running GNU/Linux for zSeries@.
91abf72d 3377
8bf06993
UW
3378@html
3379<hr />
3380@end html
3381@heading @anchor{s390x-ibm-tpf*}s390x-ibm-tpf*
daf2f129 3382zSeries system (64-bit) running TPF. This platform is
8bf06993
UW
3383supported as cross-compilation target only.
3384
f42974dc 3385@html
b8db17af 3386<hr />
f42974dc 3387@end html
250d5688 3388@c Please use Solaris 2 to refer to all release of Solaris, starting
1460af95 3389@c with 2.0 until 2.6, 7, 8, etc. Solaris 1 was a marketing name for
250d5688
RO
3390@c SunOS 4 releases which we don't use to avoid confusion. Solaris
3391@c alone is too unspecific and must be avoided.
3392@heading @anchor{*-*-solaris2*}*-*-solaris2*
f42974dc 3393
250d5688 3394Sun does not ship a C compiler with Solaris 2. To bootstrap and install
dbd210ef
KC
3395GCC you first have to install a pre-built compiler, see our
3396@uref{binaries.html,,binaries page} for details.
f42974dc 3397
250d5688 3398The Solaris 2 @command{/bin/sh} will often fail to configure
92441f83 3399@file{libstdc++-v3}, @file{boehm-gc} or @file{libjava}. We therefore
bc890961
EB
3400recommend to use the following sequence of commands to bootstrap and
3401install GCC:
3402
3403@smallexample
3404 % CONFIG_SHELL=/bin/ksh
3405 % export CONFIG_SHELL
bc890961
EB
3406@end smallexample
3407
1cba0a4e
PE
3408and then proceed as described in @uref{build.html,,the build instructions},
3409where we strongly recommend using GNU make and specifying an absolute path
3410to invoke @var{srcdir}/configure.
e6855a2d 3411
b8df899a 3412Solaris 2 comes with a number of optional OS packages. Some of these
92441f83 3413are needed to use GCC fully, namely @code{SUNWarc},
dbd210ef
KC
3414@code{SUNWbtool}, @code{SUNWesu}, @code{SUNWhea}, @code{SUNWlibm},
3415@code{SUNWsprot}, and @code{SUNWtoo}. If you did not install all
250d5688 3416optional packages when installing Solaris 2, you will need to verify that
b8df899a
JM
3417the packages that GCC needs are installed.
3418
3419To check whether an optional package is installed, use
dbd210ef 3420the @command{pkginfo} command. To add an optional package, use the
250d5688 3421@command{pkgadd} command. For further details, see the Solaris 2
b8df899a
JM
3422documentation.
3423
250d5688 3424Trying to use the linker and other tools in
b8df899a
JM
3425@file{/usr/ucb} to install GCC has been observed to cause trouble.
3426For example, the linker may hang indefinitely. The fix is to remove
250d5688 3427@file{/usr/ucb} from your @env{PATH}.
f42974dc 3428
bc890961
EB
3429The build process works more smoothly with the legacy Sun tools so, if you
3430have @file{/usr/xpg4/bin} in your @env{PATH}, we recommend that you place
3431@file{/usr/bin} before @file{/usr/xpg4/bin} for the duration of the build.
3432
021c4bfd
RO
3433All releases of GNU binutils prior to 2.11.2 have known bugs on this
3434platform. We recommend the use of GNU binutils 2.11.2 or the vendor
3435tools (Sun @command{as}, Sun @command{ld}).
f42974dc 3436
250d5688
RO
3437Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
3438newer: @command{g++} will complain that types are missing. These headers assume
3439that omitting the type means @code{int}; this assumption worked for C89 but
3440is wrong for C++, and is now wrong for C99 also.
3441
13ba36b4 3442@command{g++} accepts such (invalid) constructs with the option
250d5688
RO
3443@option{-fpermissive}; it
3444will assume that any missing type is @code{int} (as defined by C89).
3445
3446There are patches for Solaris 2.6 (105633-56 or newer for SPARC,
3447106248-42 or newer for Intel), Solaris 7 (108376-21 or newer for SPARC,
3448108377-20 for Intel), and Solaris 8 (108652-24 or newer for SPARC,
3449108653-22 for Intel) that fix this bug.
f42974dc 3450
dbd210ef 3451@html
b8db17af 3452<hr />
dbd210ef 3453@end html
250d5688 3454@heading @anchor{sparc-sun-solaris2*}sparc-sun-solaris2*
dbd210ef 3455
1405141b
DN
3456When GCC is configured to use binutils 2.11.2 or later the binaries
3457produced are smaller than the ones produced using Sun's native tools;
3458this difference is quite significant for binaries containing debugging
3459information.
3460
250d5688 3461Sun @command{as} 4.x is broken in that it cannot cope with long symbol names.
dbd210ef
KC
3462A typical error message might look similar to the following:
3463
8c085f6f
JJ
3464@smallexample
3465/usr/ccs/bin/as: "/var/tmp/ccMsw135.s", line 11041: error:
3466 can't compute value of an expression involving an external symbol.
3467@end smallexample
dbd210ef 3468
250d5688
RO
3469This is Sun bug 4237974. This is fixed with patch 108908-02 for Solaris
34702.6 and has been fixed in later (5.x) versions of the assembler,
3471starting with Solaris 7.
dbd210ef 3472
03b272d2 3473Starting with Solaris 7, the operating system is capable of executing
975c6e4e
RO
347464-bit SPARC V9 binaries. GCC 3.1 and later properly supports
3475this; the @option{-m64} option enables 64-bit code generation.
3476However, if all you want is code tuned for the UltraSPARC CPU, you
3477should try the @option{-mtune=ultrasparc} option instead, which produces
3478code that, unlike full 64-bit code, can still run on non-UltraSPARC
edf1c8df 3479machines.
03b272d2 3480
975c6e4e 3481When configuring on a Solaris 7 or later system that is running a kernel
8947df0c
RH
3482that supports only 32-bit binaries, one must configure with
3483@option{--disable-multilib}, since we will not be able to build the
348464-bit target libraries.
3fc602a0 3485
ae81c844
EB
3486GCC 3.3 and GCC 3.4 trigger code generation bugs in earlier versions of
3487the GNU compiler (especially GCC 3.0.x versions), which lead to the
3488miscompilation of the stage1 compiler and the subsequent failure of the
3489bootstrap process. A workaround is to use GCC 3.2.3 as an intermediary
3490stage, i.e. to bootstrap that compiler with the base compiler and then
3491use it to bootstrap the final compiler.
3492
94b18ec1
EB
3493GCC 3.4 triggers a code generation bug in versions 5.4 (Sun ONE Studio 7)
3494and 5.5 (Sun ONE Studio 8) of the Sun compiler, which causes a bootstrap
3495failure in form of a miscompilation of the stage1 compiler by the Sun
3496compiler. This is Sun bug 4974440. This is fixed with patch 112760-07.
3497
1460af95
PE
3498GCC 3.4 changed the default debugging format from STABS to DWARF-2 for
349932-bit code on Solaris 7 and later. If you are using the Sun
3500assembler, this change apparently runs afoul of Sun bug 4910101, for
3501which (as of 2004-05-23) there is no fix. A symptom of the problem is
3502that you cannot compile C++ programs like @command{groff} 1.19.1
3503without getting messages like @samp{ld: warning: relocation error:
3504R_SPARC_UA32 @dots{} external symbolic relocation against
3505non-allocatable section .debug_info; cannot be processed at runtime:
3506relocation ignored}. To work around this problem, compile with
3507@option{-gstabs+} instead of plain @option{-g}.
3508
f42974dc 3509@html
b8db17af 3510<hr />
f42974dc 3511@end html
ef88b07d 3512@heading @anchor{sparc-sun-solaris2.7}sparc-sun-solaris2.7
f42974dc 3513
250d5688 3514Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in
f42974dc
DW
3515the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8
3516and later, including all EGCS releases. Sun formerly recommended
3517107058-01 for all Solaris 7 users, but around 1999-09-01 it started to
3518recommend it only for people who use Sun's compilers.
f9047ed3 3519
f42974dc
DW
3520Here are some workarounds to this problem:
3521@itemize @bullet
3522@item
3523Do not install Sun patch 107058-01 until after Sun releases a
3524complete patch for bug 4210064. This is the simplest course to take,
3525unless you must also use Sun's C compiler. Unfortunately 107058-01
250d5688 3526is preinstalled on some new Solaris 7-based hosts, so you may have to
f42974dc 3527back it out.
f9047ed3 3528
f42974dc
DW
3529@item
3530Copy the original, unpatched Solaris 7
3531@command{/usr/ccs/bin/as} into
8e5f33ff 3532@command{/usr/local/libexec/gcc/sparc-sun-solaris2.7/3.4/as},
f42974dc
DW
3533adjusting the latter name to fit your local conventions and software
3534version numbers.
3535
3536@item
3537Install Sun patch 106950-03 (1999-05-25) or later. Nobody with
3538both 107058-01 and 106950-03 installed has reported the bug with GCC
3539and Sun's dynamic linker. This last course of action is riskiest,
3540for two reasons. First, you must install 106950 on all hosts that
3541run code generated by GCC; it doesn't suffice to install it only on
3542the hosts that run GCC itself. Second, Sun says that 106950-03 is
3543only a partial fix for bug 4210064, but Sun doesn't know whether the
161d7b59 3544partial fix is adequate for GCC@. Revision -08 or later should fix
1460af95 3545the bug. The current (as of 2004-05-23) revision is -24, and is included in
f282ffb3 3546the Solaris 7 Recommended Patch Cluster.
f9047ed3 3547@end itemize
f42974dc 3548
fdbf04c8
EB
3549GCC 3.3 triggers a bug in version 5.0 Alpha 03/27/98 of the Sun assembler,
3550which causes a bootstrap failure when linking the 64-bit shared version of
3551libgcc. A typical error message is:
3552
3553@smallexample
3554ld: fatal: relocation error: R_SPARC_32: file libgcc/sparcv9/_muldi3.o:
3555 symbol <unknown>: offset 0xffffffff7ec133e7 is non-aligned.
3556@end smallexample
3557
3558This bug has been fixed in the final 5.0 version of the assembler.
f42974dc 3559
c6fa9728 3560@html
b8db17af 3561<hr />
c6fa9728
JS
3562@end html
3563@heading @anchor{sparc-*-linux*}sparc-*-linux*
3564
3565GCC versions 3.0 and higher require binutils 2.11.2 and glibc 2.2.4
3566or newer on this platform. All earlier binutils and glibc
3567releases mishandled unaligned relocations on @code{sparc-*-*} targets.
3568
3569
f42974dc 3570@html
b8db17af 3571<hr />
f42974dc 3572@end html
0dc7ee3c 3573@heading @anchor{sparc64-*-solaris2*}sparc64-*-solaris2*
e403b4bc
CR
3574
3575The following compiler flags must be specified in the configure
3576step in order to bootstrap this target with the Sun compiler:
3577
3ab51846 3578@smallexample
e403b4bc 3579 % CC="cc -xildoff -xarch=v9" @var{srcdir}/configure [@var{options}] [@var{target}]
3ab51846 3580@end smallexample
e403b4bc
CR
3581
3582@option{-xildoff} turns off the incremental linker, and @option{-xarch=v9}
0dc7ee3c
EB
3583specifies the SPARC-V9 architecture to the Sun linker and assembler.
3584
3585@html
3586<hr />
3587@end html
3588@heading @anchor{sparcv9-*-solaris2*}sparcv9-*-solaris2*
3589
3590This is a synonym for sparc64-*-solaris2*.
f42974dc 3591
b8df899a 3592@html
b8db17af 3593<hr />
b8df899a
JM
3594@end html
3595@heading @anchor{#*-*-sysv*}*-*-sysv*
3596On System V release 3, you may get this error message
3597while linking:
3598
3599@smallexample
3600ld fatal: failed to write symbol name @var{something}
3601 in strings table for file @var{whatever}
3602@end smallexample
3603
021c4bfd 3604This probably indicates that the disk is full or your ulimit won't allow
b8df899a
JM
3605the file to be as large as it needs to be.
3606
3607This problem can also result because the kernel parameter @code{MAXUMEM}
3608is too small. If so, you must regenerate the kernel and make the value
3609much larger. The default value is reported to be 1024; a value of 32768
3610is said to work. Smaller values may also work.
3611
3612On System V, if you get an error like this,
3613
3ab51846 3614@smallexample
b8df899a
JM
3615/usr/local/lib/bison.simple: In function `yyparse':
3616/usr/local/lib/bison.simple:625: virtual memory exhausted
3ab51846 3617@end smallexample
b8df899a
JM
3618
3619@noindent
021c4bfd 3620that too indicates a problem with disk space, ulimit, or @code{MAXUMEM}.
b8df899a 3621
f85b8d1a 3622On a System V release 4 system, make sure @file{/usr/bin} precedes
7ba4ca63 3623@file{/usr/ucb} in @code{PATH}. The @command{cc} command in
f85b8d1a 3624@file{/usr/ucb} uses libraries which have bugs.
b8df899a
JM
3625
3626@html
b8db17af 3627<hr />
b8df899a
JM
3628@end html
3629@heading @anchor{vax-dec-ultrix}vax-dec-ultrix
7ba4ca63 3630Don't try compiling with VAX C (@command{vcc}). It produces incorrect code
b8df899a
JM
3631in some cases (for example, when @code{alloca} is used).
3632
4977bab6
ZW
3633@html
3634<hr />
3635@end html
3636@heading @anchor{*-*-vxworks*}*-*-vxworks*
3637Support for VxWorks is in flux. At present GCC supports @emph{only} the
3638very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC.
3639We welcome patches for other architectures supported by VxWorks 5.5.
3640Support for VxWorks AE would also be welcome; we believe this is merely
3641a matter of writing an appropriate ``configlette'' (see below). We are
3642not interested in supporting older, a.out or COFF-based, versions of
3643VxWorks in GCC 3.
3644
3645VxWorks comes with an older version of GCC installed in
3646@file{@var{$WIND_BASE}/host}; we recommend you do not overwrite it.
3647Choose an installation @var{prefix} entirely outside @var{$WIND_BASE}.
3648Before running @command{configure}, create the directories @file{@var{prefix}}
3649and @file{@var{prefix}/bin}. Link or copy the appropriate assembler,
3650linker, etc. into @file{@var{prefix}/bin}, and set your @var{PATH} to
3651include that directory while running both @command{configure} and
3652@command{make}.
3653
3654You must give @command{configure} the
3655@option{--with-headers=@var{$WIND_BASE}/target/h} switch so that it can
3656find the VxWorks system headers. Since VxWorks is a cross compilation
3657target only, you must also specify @option{--target=@var{target}}.
3658@command{configure} will attempt to create the directory
3659@file{@var{prefix}/@var{target}/sys-include} and copy files into it;
3660make sure the user running @command{configure} has sufficient privilege
3661to do so.
3662
3663GCC's exception handling runtime requires a special ``configlette''
3664module, @file{contrib/gthr_supp_vxw_5x.c}. Follow the instructions in
3665that file to add the module to your kernel build. (Future versions of
daf2f129 3666VxWorks will incorporate this module.)
4977bab6 3667
7e081a0c
AJ
3668@html
3669<hr />
3670@end html
3671@heading @anchor{x86_64-*-*}x86_64-*-*, amd64-*-*
3672
3673GCC supports the x86-64 architecture implemented by the AMD64 processor
3674(amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD.
3675On GNU/Linux the default is a bi-arch compiler which is able to generate
3676both 64-bit x86-64 and 32-bit x86 code (via the @option{-m32} switch).
3677
fd29f6ea 3678@html
b8db17af 3679<hr />
fd29f6ea
BW
3680@end html
3681@heading @anchor{xtensa-*-elf}xtensa-*-elf
3682
3683This target is intended for embedded Xtensa systems using the
3684@samp{newlib} C library. It uses ELF but does not support shared
3685objects. Designed-defined instructions specified via the
3686Tensilica Instruction Extension (TIE) language are only supported
3687through inline assembly.
3688
3689The Xtensa configuration information must be specified prior to
e677f70c 3690building GCC@. The @file{include/xtensa-config.h} header
fd29f6ea
BW
3691file contains the configuration information. If you created your
3692own Xtensa configuration with the Xtensa Processor Generator, the
3693downloaded files include a customized copy of this header file,
3694which you can use to replace the default header file.
3695
3696@html
b8db17af 3697<hr />
fd29f6ea
BW
3698@end html
3699@heading @anchor{xtensa-*-linux*}xtensa-*-linux*
3700
3701This target is for Xtensa systems running GNU/Linux. It supports ELF
3702shared objects and the GNU C library (glibc). It also generates
3703position-independent code (PIC) regardless of whether the
3704@option{-fpic} or @option{-fPIC} options are used. In other
f282ffb3 3705respects, this target is the same as the
fd29f6ea
BW
3706@uref{#xtensa-*-elf,,@samp{xtensa-*-elf}} target.
3707
f42974dc 3708@html
b8db17af 3709<hr />
f42974dc 3710@end html
57694e40 3711@heading @anchor{windows}Microsoft Windows (32-bit)
f42974dc 3712
ccc1ce6e 3713A port of GCC 2.95.2 and 3.x is included with the
f42974dc
DW
3714@uref{http://www.cygwin.com/,,Cygwin environment}.
3715
3716Current (as of early 2001) snapshots of GCC will build under Cygwin
3717without modification.
3718
ccc1ce6e
CF
3719GCC does not currently build with Microsoft's C++ compiler and there
3720are no plans to make it do so.
3721
f42974dc 3722@html
b8db17af 3723<hr />
f42974dc 3724@end html
ef88b07d 3725@heading @anchor{os2}OS/2
f42974dc
DW
3726
3727GCC does not currently support OS/2. However, Andrew Zabolotny has been
14976c58 3728working on a generic OS/2 port with pgcc. The current code can be found
f42974dc
DW
3729at @uref{http://www.goof.com/pcg/os2/,,http://www.goof.com/pcg/os2/}.
3730
f9047ed3 3731An older copy of GCC 2.8.1 is included with the EMX tools available at
f42974dc
DW
3732@uref{ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/,,
3733ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/}.
3734
3735@html
b8db17af 3736<hr />
f42974dc 3737@end html
ef88b07d 3738@heading @anchor{older}Older systems
f9047ed3
JM
3739
3740GCC contains support files for many older (1980s and early
37411990s) Unix variants. For the most part, support for these systems
3742has not been deliberately removed, but it has not been maintained for
c7bdf0a6 3743several years and may suffer from bitrot.
f9047ed3 3744
c7bdf0a6 3745Starting with GCC 3.1, each release has a list of ``obsoleted'' systems.
9340544b
ZW
3746Support for these systems is still present in that release, but
3747@command{configure} will fail unless the @option{--enable-obsolete}
c7bdf0a6
ZW
3748option is given. Unless a maintainer steps forward, support for these
3749systems will be removed from the next release of GCC@.
f9047ed3
JM
3750
3751Support for old systems as hosts for GCC can cause problems if the
3752workarounds for compiler, library and operating system bugs affect the
161d7b59 3753cleanliness or maintainability of the rest of GCC@. In some cases, to
f9047ed3
JM
3754bring GCC up on such a system, if still possible with current GCC, may
3755require first installing an old version of GCC which did work on that
c7bdf0a6
ZW
3756system, and using it to compile a more recent GCC, to avoid bugs in the
3757vendor compiler. Old releases of GCC 1 and GCC 2 are available in the
3758@file{old-releases} directory on the @uref{../mirrors.html,,GCC mirror
3759sites}. Header bugs may generally be avoided using
3760@command{fixincludes}, but bugs or deficiencies in libraries and the
3761operating system may still cause problems.
3762
3763Support for older systems as targets for cross-compilation is less
3764problematic than support for them as hosts for GCC; if an enthusiast
3765wishes to make such a target work again (including resurrecting any of
3766the targets that never worked with GCC 2, starting from the last CVS
3767version before they were removed), patches
3768@uref{../contribute.html,,following the usual requirements} would be
3769likely to be accepted, since they should not affect the support for more
3770modern targets.
f9047ed3
JM
3771
3772For some systems, old versions of GNU binutils may also be useful,
021c4bfd 3773and are available from @file{pub/binutils/old-releases} on
f42974dc 3774@uref{http://sources.redhat.com/mirrors.html,,sources.redhat.com mirror sites}.
f9047ed3
JM
3775
3776Some of the information on specific systems above relates to
3777such older systems, but much of the information
3778about GCC on such systems (which may no longer be applicable to
f42974dc 3779current GCC) is to be found in the GCC texinfo manual.
f9047ed3 3780
f42974dc 3781@html
b8db17af 3782<hr />
f42974dc 3783@end html
250d5688 3784@heading @anchor{elf_targets}all ELF targets (SVR4, Solaris 2, etc.)
f42974dc 3785
38209993
LG
3786C++ support is significantly better on ELF targets if you use the
3787@uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of
3788inlines, vtables and template instantiations will be discarded
3789automatically.
f42974dc
DW
3790
3791
3792@html
b8db17af 3793<hr />
f42974dc
DW
3794<p>
3795@end html
3796@ifhtml
3797@uref{./index.html,,Return to the GCC Installation page}
3798@end ifhtml
3799@end ifset
3800
73e2155a
JM
3801@c ***Old documentation******************************************************
3802@ifset oldhtml
3803@include install-old.texi
3804@html
b8db17af 3805<hr />
73e2155a
JM
3806<p>
3807@end html
3808@ifhtml
3809@uref{./index.html,,Return to the GCC Installation page}
3810@end ifhtml
3811@end ifset
3812
aed5964b
JM
3813@c ***GFDL********************************************************************
3814@ifset gfdlhtml
3815@include fdl.texi
3816@html
b8db17af 3817<hr />
aed5964b
JM
3818<p>
3819@end html
3820@ifhtml
3821@uref{./index.html,,Return to the GCC Installation page}
3822@end ifhtml
3823@end ifset
3824
f42974dc
DW
3825@c ***************************************************************************
3826@c Part 6 The End of the Document
3827@ifinfo
3828@comment node-name, next, previous, up
aed5964b 3829@node Concept Index, , GNU Free Documentation License, Top
f42974dc
DW
3830@end ifinfo
3831
3832@ifinfo
3833@unnumbered Concept Index
3834
3835@printindex cp
3836
3837@contents
3838@end ifinfo
3839@bye