]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/install.texi
* gcc_update: boehm-gc/configure.in -> configure.ac.
[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
eea81d3e
RO
1020parallel. This is currently supported by @samp{libf2c} and
1021@samp{libstdc++}, and is the default for @samp{libobjc} which cannot be
1022changed in this case.
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
6cfb3f16 1480If you used the flag @option{--enable-languages=@dots{}} to restrict
f42974dc 1481the compilers to be built, only those you've actually enabled will be
767094dd 1482built. This will of course only build those runtime libraries, for
f42974dc 1483which the particular compiler has been built. Please note,
eea81d3e 1484that re-defining @env{LANGUAGES} when calling @samp{make bootstrap}
ef88b07d 1485@strong{does not} work anymore!
f42974dc 1486
f85b8d1a 1487If the comparison of stage2 and stage3 fails, this normally indicates
eea81d3e 1488that the stage2 compiler has compiled GCC incorrectly, and is therefore
f85b8d1a
JM
1489a potentially serious bug which you should investigate and report. (On
1490a few systems, meaningful comparison of object files is impossible; they
1491always appear ``different''. If you encounter this problem, you will
1492need to disable comparison in the @file{Makefile}.)
f42974dc
DW
1493
1494@section Building a cross compiler
1495
1496We recommend reading the
1497@uref{http://www.objsw.com/CrossGCC/,,crossgcc FAQ}
1498for information about building cross compilers.
1499
1500When building a cross compiler, it is not generally possible to do a
15013-stage bootstrap of the compiler. This makes for an interesting problem
161d7b59 1502as parts of GCC can only be built with GCC@.
f42974dc
DW
1503
1504To build a cross compiler, we first recommend building and installing a
1505native compiler. You can then use the native GCC compiler to build the
635771af
JM
1506cross compiler. The installed native compiler needs to be GCC version
15072.95 or later.
f42974dc
DW
1508
1509Assuming you have already installed a native copy of GCC and configured
6cfb3f16 1510your cross compiler, issue the command @command{make}, which performs the
f42974dc
DW
1511following steps:
1512
1513@itemize @bullet
1514@item
1515Build host tools necessary to build the compiler such as texinfo, bison,
1516gperf.
1517
1518@item
1519Build target tools for use by the compiler such as binutils (bfd,
1520binutils, gas, gprof, ld, and opcodes)
1521if they have been individually linked or moved into the top level GCC source
1522tree before configuring.
1523
1524@item
1525Build the compiler (single stage only).
1526
1527@item
1528Build runtime libraries using the compiler from the previous step.
1529@end itemize
1530
1531Note that if an error occurs in any step the make process will exit.
1532
01e97976
JM
1533If you are not building GNU binutils in the same source tree as GCC,
1534you will need a cross-assembler and cross-linker installed before
1535configuring GCC@. Put them in the directory
1536@file{@var{prefix}/@var{target}/bin}. Here is a table of the tools
1537you should put in this directory:
1538
1539@table @file
1540@item as
1541This should be the cross-assembler.
1542
1543@item ld
1544This should be the cross-linker.
1545
1546@item ar
1547This should be the cross-archiver: a program which can manipulate
1548archive files (linker libraries) in the target machine's format.
1549
1550@item ranlib
1551This should be a program to construct a symbol table in an archive file.
1552@end table
1553
1554The installation of GCC will find these programs in that directory,
1555and copy or link them to the proper place to for the cross-compiler to
1556find them when run later.
1557
1558The easiest way to provide these files is to build the Binutils package.
1559Configure it with the same @option{--host} and @option{--target}
1560options that you use for configuring GCC, then build and install
1561them. They install their executables automatically into the proper
1562directory. Alas, they do not support all the targets that GCC
1563supports.
1564
1565If you are not building a C library in the same source tree as GCC,
1566you should also provide the target libraries and headers before
1567configuring GCC, specifying the directories with
1568@option{--with-sysroot} or @option{--with-headers} and
1569@option{--with-libs}. Many targets also require ``start files'' such
1570as @file{crt0.o} and
1571@file{crtn.o} which are linked into each executable. There may be several
1572alternatives for @file{crt0.o}, for use with profiling or other
1573compilation options. Check your target's definition of
1574@code{STARTFILE_SPEC} to find out what start files it uses.
1575
f42974dc
DW
1576@section Building in parallel
1577
27a3e494
DE
1578You can use @samp{make bootstrap MAKE="make -j 2" -j 2}, or just
1579@samp{make -j 2 bootstrap} for GNU Make 3.79 and above, instead of
1580@samp{make bootstrap} to build GCC in parallel.
1581You can also specify a bigger number, and in most cases using a value
1582greater than the number of processors in your machine will result in
1583fewer and shorter I/O latency hits, thus improving overall throughput;
1584this is especially true for slow drives and network filesystems.
f42974dc 1585
e23381df
GB
1586@section Building the Ada compiler
1587
1588In order to build GNAT, the Ada compiler, you need a working GNAT
3e98a119 1589compiler (GNAT version 3.14 or later, or GCC version 3.1 or later),
af5734de 1590including GNAT tools such as @command{gnatmake} and @command{gnatlink},
38e23049 1591since the Ada front end is written in Ada (with some
e23381df
GB
1592GNAT-specific extensions), and GNU make.
1593
38e23049
JM
1594@command{configure} does not test whether the GNAT installation works
1595and has a sufficiently recent version; if too old a GNAT version is
1596installed, the build will fail unless @option{--enable-languages} is
1597used to disable building the Ada front end.
e23381df 1598
8f231b5d
JH
1599@section Building with profile feedback
1600
1601It is possible to use profile feedback to optimize the compiler itself. This
1602should result in a faster compiler binary. Experiments done on x86 using gcc
16033.3 showed approximately 7 percent speedup on compiling C programs. To
1604bootstrap compiler with profile feedback, use @code{make profiledbootstrap}.
1605
1606When @samp{make profiledbootstrap} is run, it will first build a @code{stage1}
1607compiler. This compiler is used to build a @code{stageprofile} compiler
1608instrumented to collect execution counts of instruction and branch
1609probabilities. Then runtime libraries are compiled with profile collected.
1610Finally a @code{stagefeedback} compiler is built using the information collected.
1611
1612Unlike @samp{make bootstrap} several additional restrictions apply. The
1613compiler used to build @code{stage1} needs to support a 64-bit integral type.
1614It is recommended to only use GCC for this. Also parallel make is currently
1615not supported since collisions in profile collecting may occur.
1616
f42974dc 1617@html
b8db17af 1618<hr />
f42974dc
DW
1619<p>
1620@end html
1621@ifhtml
1622@uref{./index.html,,Return to the GCC Installation page}
1623@end ifhtml
1624@end ifset
1625
1626@c ***Testing*****************************************************************
6cfb3f16 1627@ifnothtml
f42974dc
DW
1628@comment node-name, next, previous, up
1629@node Testing, Final install, Building, Installing GCC
6cfb3f16 1630@end ifnothtml
f42974dc 1631@ifset testhtml
f42974dc
DW
1632@ifnothtml
1633@chapter Installing GCC: Testing
1634@end ifnothtml
1635@cindex Testing
1636@cindex Installing GCC: Testing
1637@cindex Testsuite
1638
f97903cc
JJ
1639Before you install GCC, we encourage you to run the testsuites and to
1640compare your results with results from a similar configuration that have
1641been submitted to the
1642@uref{http://gcc.gnu.org/ml/gcc-testresults/,,gcc-testresults mailing list}.
05253aed
JJ
1643Some of these archived results are linked from the build status lists
1644at @uref{http://gcc.gnu.org/buildstat.html}, although not everyone who
1645reports a successful build runs the testsuites and submits the results.
f97903cc
JJ
1646This step is optional and may require you to download additional software,
1647but it can give you confidence in your new GCC installation or point out
1648problems before you install and start using your new GCC.
f42974dc 1649
f9047ed3 1650First, you must have @uref{download.html,,downloaded the testsuites}.
f97903cc
JJ
1651These are part of the full distribution, but if you downloaded the
1652``core'' compiler plus any front ends, you must download the testsuites
1653separately.
f42974dc 1654
f97903cc 1655Second, you must have the testing tools installed. This includes
cfc984b5
MS
1656@uref{http://www.gnu.org/software/dejagnu/,,DejaGnu} 1.4.4 and later,
1657Tcl, and Expect; the DejaGnu site has links to these.
f42974dc 1658
8cacda7c
GP
1659If the directories where @command{runtest} and @command{expect} were
1660installed are not in the @env{PATH}, you may need to set the following
1661environment variables appropriately, as in the following example (which
1662assumes that DejaGnu has been installed under @file{/usr/local}):
f42974dc 1663
3ab51846 1664@smallexample
f42974dc
DW
1665 TCL_LIBRARY = /usr/local/share/tcl8.0
1666 DEJAGNULIBS = /usr/local/share/dejagnu
3ab51846 1667@end smallexample
f42974dc 1668
8cacda7c 1669(On systems such as Cygwin, these paths are required to be actual
f42974dc 1670paths, not mounts or links; presumably this is due to some lack of
8cacda7c 1671portability in the DejaGnu code.)
ecb7d6b3 1672
f42974dc
DW
1673
1674Finally, you can run the testsuite (which may take a long time):
3ab51846 1675@smallexample
ef88b07d 1676 cd @var{objdir}; make -k check
3ab51846 1677@end smallexample
f42974dc 1678
794aca5d
WB
1679This will test various components of GCC, such as compiler
1680front ends and runtime libraries. While running the testsuite, DejaGnu
1681might emit some harmless messages resembling
daf2f129 1682@samp{WARNING: Couldn't find the global config file.} or
794aca5d 1683@samp{WARNING: Couldn't find tool init file} that can be ignored.
06809951 1684
f42974dc
DW
1685@section How can I run the test suite on selected tests?
1686
794aca5d
WB
1687In order to run sets of tests selectively, there are targets
1688@samp{make check-gcc} and @samp{make check-g++}
1689in the @file{gcc} subdirectory of the object directory. You can also
1690just run @samp{make check} in a subdirectory of the object directory.
1691
1692
1693A more selective way to just run all @command{gcc} execute tests in the
1694testsuite is to use
f42974dc 1695
3ab51846 1696@smallexample
6cfb3f16 1697 make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
3ab51846 1698@end smallexample
f42974dc 1699
794aca5d
WB
1700Likewise, in order to run only the @command{g++} ``old-deja'' tests in
1701the testsuite with filenames matching @samp{9805*}, you would use
f42974dc 1702
3ab51846 1703@smallexample
6cfb3f16 1704 make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
3ab51846 1705@end smallexample
f42974dc 1706
6cfb3f16
JM
1707The @file{*.exp} files are located in the testsuite directories of the GCC
1708source, the most important ones being @file{compile.exp},
1709@file{execute.exp}, @file{dg.exp} and @file{old-deja.exp}.
1710To get a list of the possible @file{*.exp} files, pipe the
38209993 1711output of @samp{make check} into a file and look at the
6cfb3f16 1712@samp{Running @dots{} .exp} lines.
f42974dc 1713
e08737dc
PE
1714@section Passing options and running multiple testsuites
1715
1716You can pass multiple options to the testsuite using the
1717@samp{--target_board} option of DejaGNU, either passed as part of
1718@samp{RUNTESTFLAGS}, or directly to @command{runtest} if you prefer to
1719work outside the makefiles. For example,
1720
3ab51846 1721@smallexample
e08737dc 1722 make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fno-strength-reduce"
3ab51846 1723@end smallexample
e08737dc
PE
1724
1725will run the standard @command{g++} testsuites (``unix'' is the target name
1726for a standard native testsuite situation), passing
1727@samp{-O3 -fno-strength-reduce} to the compiler on every test, i.e.,
1728slashes separate options.
1729
1730You can run the testsuites multiple times using combinations of options
1731with a syntax similar to the brace expansion of popular shells:
1732
3ab51846 1733@smallexample
e08737dc 1734 @dots{}"--target_board=arm-sim@{-mhard-float,-msoft-float@}@{-O1,-O2,-O3,@}"
3ab51846 1735@end smallexample
e08737dc
PE
1736
1737(Note the empty option caused by the trailing comma in the final group.)
1738The following will run each testsuite eight times using the @samp{arm-sim}
1739target, as if you had specified all possible combinations yourself:
1740
3ab51846 1741@smallexample
e08737dc
PE
1742 --target_board=arm-sim/-mhard-float/-O1
1743 --target_board=arm-sim/-mhard-float/-O2
1744 --target_board=arm-sim/-mhard-float/-O3
1745 --target_board=arm-sim/-mhard-float
1746 --target_board=arm-sim/-msoft-float/-O1
1747 --target_board=arm-sim/-msoft-float/-O2
1748 --target_board=arm-sim/-msoft-float/-O3
1749 --target_board=arm-sim/-msoft-float
3ab51846 1750@end smallexample
e08737dc
PE
1751
1752They can be combined as many times as you wish, in arbitrary ways. This
1753list:
1754
3ab51846 1755@smallexample
e08737dc 1756 @dots{}"--target_board=unix/-Wextra@{-O3,-fno-strength-reduce@}@{-fomit-frame-pointer,@}"
3ab51846 1757@end smallexample
e08737dc
PE
1758
1759will generate four combinations, all involving @samp{-Wextra}.
1760
1761The disadvantage to this method is that the testsuites are run in serial,
1762which is a waste on multiprocessor systems. For users with GNU Make and
1763a shell which performs brace expansion, you can run the testsuites in
1764parallel by having the shell perform the combinations and @command{make}
1765do the parallel runs. Instead of using @samp{--target_board}, use a
1766special makefile target:
1767
3ab51846 1768@smallexample
e08737dc 1769 make -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{option2}/@dots{}
3ab51846 1770@end smallexample
e08737dc
PE
1771
1772For example,
1773
3ab51846 1774@smallexample
e08737dc 1775 make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
3ab51846 1776@end smallexample
e08737dc
PE
1777
1778will run three concurrent ``make-gcc'' testsuites, eventually testing all
1779ten combinations as described above. Note that this is currently only
1780supported in the @file{gcc} subdirectory. (To see how this works, try
1781typing @command{echo} before the example given here.)
1782
1783
1784@section Additional testing for Java Class Libraries
1785
688d8b84
RM
1786The Java runtime tests can be executed via @samp{make check}
1787in the @file{@var{target}/libjava/testsuite} directory in
1788the build tree.
f702e700 1789
f702e700
JJ
1790The @uref{http://sources.redhat.com/mauve/,,Mauve Project} provides
1791a suite of tests for the Java Class Libraries. This suite can be run
1792as part of libgcj testing by placing the Mauve tree within the libjava
1793testsuite at @file{libjava/testsuite/libjava.mauve/mauve}, or by
1794specifying the location of that tree when invoking @samp{make}, as in
1795@samp{make MAUVEDIR=~/mauve check}.
1796
582f6e6d
TT
1797@uref{http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html,,Jacks}
1798is a free test suite that tests Java compiler front ends. This suite
3b41afd9 1799can be run as part of libgcj testing by placing the Jacks tree within
582f6e6d
TT
1800the libjava testsuite at @file{libjava/testsuite/libjava.jacks/jacks}.
1801
f42974dc
DW
1802@section How to interpret test results
1803
794aca5d 1804The result of running the testsuite are various @file{*.sum} and @file{*.log}
767094dd 1805files in the testsuite subdirectories. The @file{*.log} files contain a
f42974dc 1806detailed log of the compiler invocations and the corresponding
daf2f129
JM
1807results, the @file{*.sum} files summarize the results. These summaries
1808contain status codes for all tests:
f42974dc
DW
1809
1810@itemize @bullet
1811@item
1812PASS: the test passed as expected
1813@item
1814XPASS: the test unexpectedly passed
1815@item
1816FAIL: the test unexpectedly failed
1817@item
1818XFAIL: the test failed as expected
1819@item
1820UNSUPPORTED: the test is not supported on this platform
1821@item
1822ERROR: the testsuite detected an error
1823@item
1824WARNING: the testsuite detected a possible problem
1825@end itemize
1826
38209993
LG
1827It is normal for some tests to report unexpected failures. At the
1828current time our testing harness does not allow fine grained control
1829over whether or not a test is expected to fail. We expect to fix this
1830problem in future releases.
f42974dc
DW
1831
1832
1833@section Submitting test results
1834
1835If you want to report the results to the GCC project, use the
767094dd 1836@file{contrib/test_summary} shell script. Start it in the @var{objdir} with
f42974dc 1837
3ab51846 1838@smallexample
6cfb3f16
JM
1839 @var{srcdir}/contrib/test_summary -p your_commentary.txt \
1840 -m gcc-testresults@@gcc.gnu.org |sh
3ab51846 1841@end smallexample
f42974dc 1842
6cfb3f16 1843This script uses the @command{Mail} program to send the results, so
767094dd 1844make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is
f42974dc 1845prepended to the testsuite summary and should contain any special
767094dd 1846remarks you have on your results or your build environment. Please
f42974dc 1847do not edit the testsuite result block or the subject line, as these
05c425a9 1848messages may be automatically processed.
f42974dc 1849
aed5964b 1850@html
b8db17af 1851<hr />
aed5964b
JM
1852<p>
1853@end html
1854@ifhtml
1855@uref{./index.html,,Return to the GCC Installation page}
1856@end ifhtml
f42974dc
DW
1857@end ifset
1858
1859@c ***Final install***********************************************************
6cfb3f16 1860@ifnothtml
f42974dc
DW
1861@comment node-name, next, previous, up
1862@node Final install, , Testing, Installing GCC
6cfb3f16 1863@end ifnothtml
f42974dc 1864@ifset finalinstallhtml
f42974dc
DW
1865@ifnothtml
1866@chapter Installing GCC: Final installation
1867@end ifnothtml
1868
eea81d3e 1869Now that GCC has been built (and optionally tested), you can install it with
3ab51846 1870@smallexample
eea81d3e 1871cd @var{objdir}; make install
3ab51846 1872@end smallexample
f42974dc 1873
06809951
GP
1874We strongly recommend to install into a target directory where there is
1875no previous version of GCC present.
1876
f42974dc 1877That step completes the installation of GCC; user level binaries can
8e5f33ff
GK
1878be found in @file{@var{prefix}/bin} where @var{prefix} is the value
1879you specified with the @option{--prefix} to configure (or
1880@file{/usr/local} by default). (If you specified @option{--bindir},
1881that directory will be used instead; otherwise, if you specified
1882@option{--exec-prefix}, @file{@var{exec-prefix}/bin} will be used.)
1883Headers for the C++ and Java libraries are installed in
1884@file{@var{prefix}/include}; libraries in @file{@var{libdir}}
1885(normally @file{@var{prefix}/lib}); internal parts of the compiler in
1886@file{@var{libdir}/gcc} and @file{@var{libexecdir}/gcc}; documentation
1887in info format in @file{@var{infodir}} (normally
1888@file{@var{prefix}/info}).
f42974dc 1889
53b50ac1
CC
1890When installing cross-compilers, GCC's executables
1891are not only installed into @file{@var{bindir}}, that
1892is, @file{@var{exec-prefix}/bin}, but additionally into
1893@file{@var{exec-prefix}/@var{target-alias}/bin}, if that directory
1894exists. Typically, such @dfn{tooldirs} hold target-specific
1895binutils, including assembler and linker.
1896
1897Installation into a temporary staging area or into a @command{chroot}
1898jail can be achieved with the command
1899
3ab51846 1900@smallexample
53b50ac1 1901make DESTDIR=@var{path-to-rootdir} install
3ab51846 1902@end smallexample
53b50ac1
CC
1903
1904@noindent where @var{path-to-rootdir} is the absolute path of
1905a directory relative to which all installation paths will be
1906interpreted. Note that the directory specified by @code{DESTDIR}
1907need not exist yet; it will be created if necessary.
1908
1909There is a subtle point with tooldirs and @code{DESTDIR}:
1910If you relocate a cross-compiler installation with
1911e.g.@: @samp{DESTDIR=@var{rootdir}}, then the directory
1912@file{@var{rootdir}/@var{exec-prefix}/@var{target-alias}/bin} will
1913be filled with duplicated GCC executables only if it already exists,
1914it will not be created otherwise. This is regarded as a feature,
1915not as a bug, because it gives slightly more control to the packagers
1916using the @code{DESTDIR} feature.
1917
2b46bc67 1918If you built a released version of GCC using @samp{make bootstrap} then please
f97a5bda
JJ
1919quickly review the build status page for your release, available from
1920@uref{http://gcc.gnu.org/buildstat.html}.
c5997381
JJ
1921If your system is not listed for the version of GCC that you built,
1922send a note to
eea81d3e
RO
1923@email{gcc@@gcc.gnu.org} indicating
1924that you successfully built and installed GCC.
c5997381 1925Include the following information:
f42974dc 1926
c5997381
JJ
1927@itemize @bullet
1928@item
1929Output from running @file{@var{srcdir}/config.guess}. Do not send us
1930that file itself, just the one-line output from running it.
1931
1932@item
2dd76960 1933The output of @samp{gcc -v} for your newly installed @command{gcc}.
c5997381
JJ
1934This tells us which version of GCC you built and the options you passed to
1935configure.
1936
2b46bc67
JJ
1937@item
1938Whether you enabled all languages or a subset of them. If you used a
1939full distribution then this information is part of the configure
1940options in the output of @samp{gcc -v}, but if you downloaded the
1941``core'' compiler plus additional front ends then it isn't apparent
1942which ones you built unless you tell us about it.
1943
c5997381
JJ
1944@item
1945If the build was for GNU/Linux, also include:
1946@itemize @bullet
1947@item
1948The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
1949this information should be available from @file{/etc/issue}.
1950
1951@item
1952The version of the Linux kernel, available from @samp{uname --version}
1953or @samp{uname -a}.
1954
1955@item
1956The version of glibc you used; for RPM-based systems like Red Hat,
b9da07da
JJ
1957Mandrake, and SuSE type @samp{rpm -q glibc} to get the glibc version,
1958and on systems like Debian and Progeny use @samp{dpkg -l libc6}.
c5997381
JJ
1959@end itemize
1960For other systems, you can include similar information if you think it is
1961relevant.
1962
1963@item
1964Any other information that you think would be useful to people building
1965GCC on the same configuration. The new entry in the build status list
1966will include a link to the archived copy of your message.
1967@end itemize
c009f01f
JJ
1968
1969We'd also like to know if the
1970@ifnothtml
1971@ref{Specific, host/target specific installation notes}
1972@end ifnothtml
1973@ifhtml
1974@uref{specific.html,,host/target specific installation notes}
1975@end ifhtml
1976didn't include your host/target information or if that information is
1977incomplete or out of date. Send a note to
1978@email{gcc@@gcc.gnu.org} telling us how the information should be changed.
f42974dc
DW
1979
1980If you find a bug, please report it following our
1981@uref{../bugs.html,,bug reporting guidelines}.
1982
ab130aa5 1983If you want to print the GCC manuals, do @samp{cd @var{objdir}; make
a38f87a9 1984dvi}. You will need to have @command{texi2dvi} (version at least 4.2)
ab130aa5
JM
1985and @TeX{} installed. This creates a number of @file{.dvi} files in
1986subdirectories of @file{@var{objdir}}; these may be converted for
1987printing with programs such as @command{dvips}. You can also
1988@uref{http://www.gnu.org/order/order.html,,buy printed manuals from the
1989Free Software Foundation}, though such manuals may not be for the most
161d7b59 1990recent version of GCC@.
ab130aa5 1991
f42974dc 1992@html
b8db17af 1993<hr />
f42974dc
DW
1994<p>
1995@end html
1996@ifhtml
1997@uref{./index.html,,Return to the GCC Installation page}
1998@end ifhtml
1999@end ifset
2000
2001@c ***Binaries****************************************************************
6cfb3f16 2002@ifnothtml
f42974dc
DW
2003@comment node-name, next, previous, up
2004@node Binaries, Specific, Installing GCC, Top
6cfb3f16 2005@end ifnothtml
f42974dc 2006@ifset binarieshtml
f42974dc
DW
2007@ifnothtml
2008@chapter Installing GCC: Binaries
2009@end ifnothtml
2010@cindex Binaries
2011@cindex Installing GCC: Binaries
2012
161d7b59 2013We are often asked about pre-compiled versions of GCC@. While we cannot
f42974dc
DW
2014provide these for all platforms, below you'll find links to binaries for
2015various platforms where creating them by yourself is not easy due to various
2016reasons.
2017
2018Please note that we did not create these binaries, nor do we
2019support them. If you have any problems installing them, please
2020contact their makers.
2021
2022@itemize
2023@item
df002c7d
DE
2024AIX:
2025@itemize
2026@item
ff4c5e7b 2027@uref{http://www.bullfreeware.com,,Bull's Freeware and Shareware Archive for AIX};
df002c7d
DE
2028
2029@item
8d5362b7 2030@uref{http://aixpdslib.seas.ucla.edu,,UCLA Software Library for AIX}.
df002c7d 2031@end itemize
f42974dc
DW
2032
2033@item
8d5362b7
GP
2034DOS---@uref{http://www.delorie.com/djgpp/,,DJGPP}.
2035
2036@item
71c6b994
KH
2037Renesas H8/300[HS]---@uref{http://h8300-hms.sourceforge.net/,,GNU
2038Development Tools for the Renesas H8/300[HS] Series}.
f42974dc 2039
f404402c
MW
2040@item
2041HP-UX:
2042@itemize
f42974dc
DW
2043@item
2044@uref{http://hpux.cae.wisc.edu/,,HP-UX Porting Center};
2045
f404402c
MW
2046@item
2047@uref{ftp://sunsite.informatik.rwth-aachen.de/pub/packages/gcc_hpux/,,Binaries for HP-UX 11.00 at Aachen University of Technology}.
2048@end itemize
2049
3e35d143
SC
2050@item
2051Motorola 68HC11/68HC12---@uref{http://www.gnu-m68hc11.org,,GNU
2052Development Tools for the Motorola 68HC11/68HC12}.
2053
f42974dc 2054@item
38209993 2055@uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
8d5362b7 2056OpenServer/Unixware}.
f42974dc
DW
2057
2058@item
35113fde 2059Sinix/Reliant Unix---@uref{ftp://ftp.fujitsu-siemens.com/pub/pd/gnu/gcc/,,Siemens}.
daf2f129 2060
8d5362b7
GP
2061@item
2062Solaris 2 (SPARC, Intel)---@uref{http://www.sunfreeware.com/,,Sunfreeware}.
f42974dc
DW
2063
2064@item
8d5362b7 2065SGI---@uref{http://freeware.sgi.com/,,SGI Freeware}.
f42974dc
DW
2066
2067@item
05c425a9 2068Microsoft Windows:
f42974dc
DW
2069@itemize
2070@item
2071The @uref{http://sources.redhat.com/cygwin/,,Cygwin} project;
2072@item
cc92b8ab 2073The @uref{http://www.mingw.org/,,MinGW} project.
f42974dc
DW
2074@end itemize
2075
2076@item
616de62f
GP
2077@uref{ftp://ftp.thewrittenword.com/packages/by-name/,,The
2078Written Word} offers binaries for
2079AIX 4.3.2.
2080IRIX 6.5,
2081Digital UNIX 4.0D and 5.1,
2082GNU/Linux (i386),
2083HP-UX 10.20, 11.00, and 11.11, and
2084Solaris/SPARC 2.5.1, 2.6, 2.7, 8, and 9,
f42974dc
DW
2085@end itemize
2086
2087In addition to those specific offerings, you can get a binary
2088distribution CD-ROM from the
f9047ed3 2089@uref{http://www.fsf.org/order/order.html,,Free Software Foundation}.
f42974dc 2090It contains binaries for a number of platforms, and
767094dd 2091includes not only GCC, but other stuff as well. The current CD does
f42974dc 2092not contain the latest version of GCC, but it should allow
767094dd 2093bootstrapping the compiler. An updated version of that disk is in the
f42974dc
DW
2094works.
2095
2096@html
b8db17af 2097<hr />
f42974dc
DW
2098<p>
2099@end html
2100@ifhtml
2101@uref{./index.html,,Return to the GCC Installation page}
2102@end ifhtml
2103@end ifset
2104
2105@c ***Specific****************************************************************
6cfb3f16 2106@ifnothtml
f42974dc 2107@comment node-name, next, previous, up
73e2155a 2108@node Specific, Old, Binaries, Top
6cfb3f16 2109@end ifnothtml
f42974dc 2110@ifset specifichtml
f42974dc
DW
2111@ifnothtml
2112@chapter Host/target specific installation notes for GCC
2113@end ifnothtml
2114@cindex Specific
2115@cindex Specific installation notes
2116@cindex Target specific installation
2117@cindex Host specific installation
2118@cindex Target specific installation notes
2119
2120Please read this document carefully @emph{before} installing the
2121GNU Compiler Collection on your machine.
2122
ef88b07d 2123@ifhtml
f42974dc
DW
2124@itemize
2125@item
333e14b0 2126@uref{#alpha*-*-*,,alpha*-*-*}
f42974dc
DW
2127@item
2128@uref{#alpha*-dec-osf*,,alpha*-dec-osf*}
2129@item
71b96724
RL
2130@uref{#alphaev5-cray-unicosmk*,,alphaev5-cray-unicosmk*}
2131@item
b8df899a
JM
2132@uref{#arc-*-elf,,arc-*-elf}
2133@item
34e8290f
NC
2134@uref{#arm-*-elf,,arm-*-elf}
2135@uref{#arm-*-coff,,arm-*-coff}
34e8290f 2136@uref{#arm-*-aout,,arm-*-aout}
b8df899a 2137@item
2aea0b53 2138@uref{#xscale-*-*,,xscale-*-*}
476c334e 2139@item
f42974dc
DW
2140@uref{#avr,,avr}
2141@item
0132e321
MH
2142@uref{#c4x,,c4x}
2143@item
f42974dc
DW
2144@uref{#dos,,DOS}
2145@item
021c4bfd
RO
2146@uref{#*-*-freebsd*,,*-*-freebsd*}
2147@item
f42974dc
DW
2148@uref{#h8300-hms,,h8300-hms}
2149@item
2150@uref{#hppa*-hp-hpux*,,hppa*-hp-hpux*}
2151@item
f42974dc
DW
2152@uref{#hppa*-hp-hpux10,,hppa*-hp-hpux10}
2153@item
2154@uref{#hppa*-hp-hpux11,,hppa*-hp-hpux11}
2155@item
2156@uref{#*-*-linux-gnu,,*-*-linux-gnu}
2157@item
b8df899a
JM
2158@uref{#ix86-*-linux*aout,,i?86-*-linux*aout}
2159@item
f42974dc
DW
2160@uref{#ix86-*-linux*,,i?86-*-linux*}
2161@item
2162@uref{#ix86-*-sco3.2v5*,,i?86-*-sco3.2v5*}
2163@item
f42974dc
DW
2164@uref{#ix86-*-udk,,i?86-*-udk}
2165@item
b8df899a
JM
2166@uref{#ix86-*-esix,,i?86-*-esix}
2167@item
b499d9ab
JJ
2168@uref{#ia64-*-linux,,ia64-*-linux}
2169@item
959a73a4
DH
2170@uref{#ia64-*-hpux*,,ia64-*-hpux*}
2171@item
f42974dc
DW
2172@uref{#*-ibm-aix*,,*-ibm-aix*}
2173@item
e3223ea2
DC
2174@uref{#ip2k-*-elf,,ip2k-*-elf}
2175@item
6b3d1e47
SC
2176@uref{#iq2000-*-elf,,iq2000-*-elf}
2177@item
b8df899a
JM
2178@uref{#m32r-*-elf,,m32r-*-elf}
2179@item
b8df899a
JM
2180@uref{#m6811-elf,,m6811-elf}
2181@item
2182@uref{#m6812-elf,,m6812-elf}
2183@item
b8df899a
JM
2184@uref{#m68k-hp-hpux,,m68k-hp-hpux}
2185@item
b8df899a
JM
2186@uref{#mips-*-*,,mips-*-*}
2187@item
b953cc4b 2188@uref{#mips-sgi-irix5,,mips-sgi-irix5}
f42974dc 2189@item
b953cc4b 2190@uref{#mips-sgi-irix6,,mips-sgi-irix6}
f42974dc 2191@item
021c4bfd
RO
2192@uref{#powerpc*-*-*,,powerpc*-*-*, powerpc-*-sysv4}
2193@item
4f2b1139
SS
2194@uref{#powerpc-*-darwin*,,powerpc-*-darwin*}
2195@item
b8df899a
JM
2196@uref{#powerpc-*-elf,,powerpc-*-elf, powerpc-*-sysv4}
2197@item
f42974dc
DW
2198@uref{#powerpc-*-linux-gnu*,,powerpc-*-linux-gnu*}
2199@item
edf1b3f3
AC
2200@uref{#powerpc-*-netbsd*,,powerpc-*-netbsd*}
2201@item
b8df899a
JM
2202@uref{#powerpc-*-eabiaix,,powerpc-*-eabiaix}
2203@item
2204@uref{#powerpc-*-eabisim,,powerpc-*-eabisim}
2205@item
2206@uref{#powerpc-*-eabi,,powerpc-*-eabi}
2207@item
2208@uref{#powerpcle-*-elf,,powerpcle-*-elf, powerpcle-*-sysv4}
2209@item
2210@uref{#powerpcle-*-eabisim,,powerpcle-*-eabisim}
2211@item
2212@uref{#powerpcle-*-eabi,,powerpcle-*-eabi}
2213@item
225cee28 2214@uref{#s390-*-linux*,,s390-*-linux*}
91abf72d 2215@item
225cee28 2216@uref{#s390x-*-linux*,,s390x-*-linux*}
91abf72d 2217@item
8bf06993
UW
2218@uref{#s390x-ibm-tpf*,,s390x-ibm-tpf*}
2219@item
250d5688 2220@uref{#*-*-solaris2*,,*-*-solaris2*}
f42974dc 2221@item
250d5688 2222@uref{#sparc-sun-solaris2*,,sparc-sun-solaris2*}
f42974dc
DW
2223@item
2224@uref{#sparc-sun-solaris2.7,,sparc-sun-solaris2.7}
2225@item
c6fa9728
JS
2226@uref{#sparc-*-linux*,,sparc-*-linux*}
2227@item
0dc7ee3c 2228@uref{#sparc64-*-solaris2*,,sparc64-*-solaris2*}
f42974dc 2229@item
e403b4bc
CR
2230@uref{#sparcv9-*-solaris2*,,sparcv9-*-solaris2*}
2231@item
b8df899a
JM
2232@uref{#*-*-sysv*,,*-*-sysv*}
2233@item
2234@uref{#vax-dec-ultrix,,vax-dec-ultrix}
2235@item
4977bab6
ZW
2236@uref{#*-*-vxworks*,,*-*-vxworks*}
2237@item
7e081a0c
AJ
2238@uref{#x86_64-*-*,,x86_64-*-*, amd64-*-*}
2239@item
fd29f6ea
BW
2240@uref{#xtensa-*-elf,,xtensa-*-elf}
2241@item
2242@uref{#xtensa-*-linux*,,xtensa-*-linux*}
2243@item
f42974dc
DW
2244@uref{#windows,,Microsoft Windows}
2245@item
2246@uref{#os2,,OS/2}
2247@item
2248@uref{#older,,Older systems}
2249@end itemize
2250
2251@itemize
2252@item
250d5688 2253@uref{#elf_targets,,all ELF targets} (SVR4, Solaris 2, etc.)
f42974dc 2254@end itemize
ef88b07d 2255@end ifhtml
f42974dc
DW
2256
2257
2258@html
2259<!-- -------- host/target specific issues start here ---------------- -->
b8db17af 2260<hr />
f42974dc 2261@end html
333e14b0
LR
2262@heading @anchor{alpha*-*-*}alpha*-*-*
2263
2264This section contains general configuration information for all
2265alpha-based platforms using ELF (in particular, ignore this section for
161d7b59 2266DEC OSF/1, Digital UNIX and Tru64 UNIX)@. In addition to reading this
f2541106 2267section, please read all other sections that match your target.
333e14b0 2268
021c4bfd
RO
2269We require binutils 2.11.2 or newer.
2270Previous binutils releases had a number of problems with DWARF 2
333e14b0
LR
2271debugging information, not the least of which is incorrect linking of
2272shared libraries.
2273
b8df899a 2274@html
b8db17af 2275<hr />
b8df899a 2276@end html
f2541106 2277@heading @anchor{alpha*-dec-osf*}alpha*-dec-osf*
b8df899a 2278Systems using processors that implement the DEC Alpha architecture and
f2541106
RO
2279are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq
2280Tru64 UNIX) operating system, for example the DEC Alpha AXP systems.
2281
c7bdf0a6
ZW
2282As of GCC 3.2, versions before @code{alpha*-dec-osf4} are no longer
2283supported. (These are the versions which identify themselves as DEC
2284OSF/1.)
9340544b 2285
6e92b3a1
RB
2286In Digital Unix V4.0, virtual memory exhausted bootstrap failures
2287may be fixed by configuring with @option{--with-gc=simple},
2288reconfiguring Kernel Virtual Memory and Swap parameters
2289per the @command{/usr/sbin/sys_check} Tuning Suggestions,
2290or applying the patch in
2291@uref{http://gcc.gnu.org/ml/gcc/2002-08/msg00822.html}.
2292
f2541106
RO
2293In Tru64 UNIX V5.1, Compaq introduced a new assembler that does not
2294currently (2001-06-13) work with @command{mips-tfile}. As a workaround,
2295we need to use the old assembler, invoked via the barely documented
2296@option{-oldas} option. To bootstrap GCC, you either need to use the
2297Compaq C Compiler:
2298
3ab51846 2299@smallexample
eea81d3e 2300 % CC=cc @var{srcdir}/configure [@var{options}] [@var{target}]
3ab51846 2301@end smallexample
f2541106
RO
2302
2303or you can use a copy of GCC 2.95.3 or higher built on Tru64 UNIX V4.0:
2304
3ab51846 2305@smallexample
eea81d3e 2306 % CC=gcc -Wa,-oldas @var{srcdir}/configure [@var{options}] [@var{target}]
3ab51846 2307@end smallexample
b8df899a 2308
b953cc4b
RO
2309As of GNU binutils 2.11.2, neither GNU @command{as} nor GNU @command{ld}
2310are supported on Tru64 UNIX, so you must not configure GCC with
2311@option{--with-gnu-as} or @option{--with-gnu-ld}.
2312
f0523f02 2313GCC writes a @samp{.verstamp} directive to the assembler output file
b8df899a
JM
2314unless it is built as a cross-compiler. It gets the version to use from
2315the system header file @file{/usr/include/stamp.h}. If you install a
2316new version of DEC Unix, you should rebuild GCC to pick up the new version
2317stamp.
2318
2319Note that since the Alpha is a 64-bit architecture, cross-compilers from
232032-bit machines will not generate code as efficient as that generated
2321when the compiler is running on a 64-bit machine because many
2322optimizations that depend on being able to represent a word on the
2323target in an integral value on the host cannot be performed. Building
2324cross-compilers on the Alpha for 32-bit machines has only been tested in
2325a few cases and may not work properly.
2326
7ba4ca63 2327@samp{make compare} may fail on old versions of DEC Unix unless you add
6cfb3f16 2328@option{-save-temps} to @code{CFLAGS}. On these systems, the name of the
b8df899a
JM
2329assembler input file is stored in the object file, and that makes
2330comparison fail if it differs between the @code{stage1} and
6cfb3f16 2331@code{stage2} compilations. The option @option{-save-temps} forces a
b8df899a 2332fixed name to be used for the assembler input file, instead of a
6cfb3f16 2333randomly chosen name in @file{/tmp}. Do not add @option{-save-temps}
b8df899a 2334unless the comparisons fail without that option. If you add
6cfb3f16 2335@option{-save-temps}, you will have to manually delete the @samp{.i} and
b8df899a
JM
2336@samp{.s} files after each series of compilations.
2337
f0523f02 2338GCC now supports both the native (ECOFF) debugging format used by DBX
161d7b59 2339and GDB and an encapsulated STABS format for use only with GDB@. See the
6cfb3f16 2340discussion of the @option{--with-stabs} option of @file{configure} above
b8df899a
JM
2341for more information on these formats and how to select them.
2342
2343There is a bug in DEC's assembler that produces incorrect line numbers
2344for ECOFF format when the @samp{.align} directive is used. To work
f0523f02 2345around this problem, GCC will not emit such alignment directives
b8df899a
JM
2346while writing ECOFF format debugging information even if optimization is
2347being performed. Unfortunately, this has the very undesirable
6cfb3f16
JM
2348side-effect that code addresses when @option{-O} is specified are
2349different depending on whether or not @option{-g} is also specified.
b8df899a 2350
6cfb3f16 2351To avoid this behavior, specify @option{-gstabs+} and use GDB instead of
161d7b59 2352DBX@. DEC is now aware of this problem with the assembler and hopes to
b8df899a
JM
2353provide a fix shortly.
2354
71b96724 2355@html
b8db17af 2356<hr />
71b96724
RL
2357@end html
2358@heading @anchor{alphaev5-cray-unicosmk*}alphaev5-cray-unicosmk*
2359Cray T3E systems running Unicos/Mk.
2360
2361This port is incomplete and has many known bugs. We hope to improve the
2362support for this target soon. Currently, only the C front end is supported,
2363and it is not possible to build parallel applications. Cray modules are not
2364supported; in particular, Craylibs are assumed to be in
2365@file{/opt/ctl/craylibs/craylibs}.
2366
2367You absolutely @strong{must} use GNU make on this platform. Also, you
2368need to tell GCC where to find the assembler and the linker. The
2369simplest way to do so is by providing @option{--with-as} and
2370@option{--with-ld} to @file{configure}, e.g.@:
2371
3ab51846 2372@smallexample
8c085f6f
JJ
2373 configure --with-as=/opt/ctl/bin/cam --with-ld=/opt/ctl/bin/cld \
2374 --enable-languages=c
3ab51846 2375@end smallexample
71b96724
RL
2376
2377The comparison test during @samp{make bootstrap} fails on Unicos/Mk
2378because the assembler inserts timestamps into object files. You should
2379be able to work around this by doing @samp{make all} after getting this
2380failure.
2381
b8df899a 2382@html
b8db17af 2383<hr />
b8df899a
JM
2384@end html
2385@heading @anchor{arc-*-elf}arc-*-elf
2386Argonaut ARC processor.
2387This configuration is intended for embedded systems.
2388
2389@html
b8db17af 2390<hr />
b8df899a 2391@end html
34e8290f 2392@heading @anchor{arm-*-elf}arm-*-elf
2aea0b53 2393@heading @anchor{xscale-*-*}xscale-*-*
34e8290f
NC
2394ARM-family processors. Subtargets that use the ELF object format
2395require GNU binutils 2.13 or newer. Such subtargets include:
2396@code{arm-*-freebsd}, @code{arm-*-netbsdelf}, @code{arm-*-*linux},
2397@code{arm-*-rtems} and @code{arm-*-kaos}.
2398
2399@html
2400<hr />
2401@end html
2402@heading @anchor{arm-*-coff}arm-*-coff
61aeb06f 2403ARM-family processors. Note that there are two different varieties
34e8290f
NC
2404of PE format subtarget supported: @code{arm-wince-pe} and
2405@code{arm-pe} as well as a standard COFF target @code{arm-*-coff}.
2406
34e8290f
NC
2407@html
2408<hr />
2409@end html
2410@heading @anchor{arm-*-aout}arm-*-aout
2411ARM-family processors. These targets support the AOUT file format:
2412@code{arm-*-aout}, @code{arm-*-netbsd}.
476c334e 2413
f42974dc 2414@html
b8db17af 2415<hr />
f42974dc 2416@end html
ef88b07d 2417@heading @anchor{avr}avr
f42974dc 2418
b8df899a 2419ATMEL AVR-family micro controllers. These are used in embedded
ca52d046
GP
2420applications. There are no standard Unix configurations.
2421@ifnothtml
2422@xref{AVR Options,, AVR Options, gcc, Using and Porting the GNU Compiler
2423Collection (GCC)},
2424@end ifnothtml
98999d8b 2425@ifhtml
ca52d046 2426See ``AVR Options'' in the main manual
98999d8b 2427@end ifhtml
ca52d046 2428for the list of supported MCU types.
b8df899a 2429
161d7b59 2430Use @samp{configure --target=avr --enable-languages="c"} to configure GCC@.
f42974dc
DW
2431
2432Further installation notes and other useful information about AVR tools
2433can also be obtained from:
2434
2435@itemize @bullet
2436@item
de7999ba
MM
2437@uref{http://www.openavr.org,,http://www.openavr.org}
2438@item
d1a86812 2439@uref{http://home.overta.ru/users/denisc/,,http://home.overta.ru/users/denisc/}
f42974dc 2440@item
d1a86812 2441@uref{http://www.amelek.gda.pl/avr/,,http://www.amelek.gda.pl/avr/}
f42974dc
DW
2442@end itemize
2443
de7999ba 2444We @emph{strongly} recommend using binutils 2.13 or newer.
f42974dc
DW
2445
2446The following error:
3ab51846 2447@smallexample
f42974dc 2448 Error: register required
3ab51846 2449@end smallexample
f42974dc
DW
2450
2451indicates that you should upgrade to a newer version of the binutils.
2452
0132e321 2453@html
b8db17af 2454<hr />
0132e321
MH
2455@end html
2456@heading @anchor{c4x}c4x
2457
2458Texas Instruments TMS320C3x and TMS320C4x Floating Point Digital Signal
2459Processors. These are used in embedded applications. There are no
d8393f64
GP
2460standard Unix configurations.
2461@ifnothtml
2462@xref{TMS320C3x/C4x Options,, TMS320C3x/C4x Options, gcc, Using and
2463Porting the GNU Compiler Collection (GCC)},
2464@end ifnothtml
98999d8b 2465@ifhtml
d8393f64 2466See ``TMS320C3x/C4x Options'' in the main manual
98999d8b 2467@end ifhtml
d8393f64 2468for the list of supported MCU types.
0132e321
MH
2469
2470GCC can be configured as a cross compiler for both the C3x and C4x
2471architectures on the same system. Use @samp{configure --target=c4x
2472--enable-languages="c,c++"} to configure.
2473
2474
2475Further installation notes and other useful information about C4x tools
2476can also be obtained from:
2477
2478@itemize @bullet
2479@item
d8393f64 2480@uref{http://www.elec.canterbury.ac.nz/c4x/,,http://www.elec.canterbury.ac.nz/c4x/}
0132e321
MH
2481@end itemize
2482
0b85d816 2483@html
b8db17af 2484<hr />
0b85d816
HPN
2485@end html
2486@heading @anchor{cris}CRIS
2487
2488CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
2489series. These are used in embedded applications.
2490
2491@ifnothtml
2492@xref{CRIS Options,, CRIS Options, gcc, Using and Porting the GNU Compiler
2493Collection (GCC)},
2494@end ifnothtml
2495@ifhtml
2496See ``CRIS Options'' in the main manual
2497@end ifhtml
2498for a list of CRIS-specific options.
2499
2500There are a few different CRIS targets:
2501@table @code
2502@item cris-axis-aout
2503Old target. Includes a multilib for the @samp{elinux} a.out-based
2504target. No multilibs for newer architecture variants.
2505@item cris-axis-elf
2506Mainly for monolithic embedded systems. Includes a multilib for the
2507@samp{v10} core used in @samp{ETRAX 100 LX}.
2508@item cris-axis-linux-gnu
2509A GNU/Linux port for the CRIS architecture, currently targeting
2510@samp{ETRAX 100 LX} by default.
2511@end table
2512
2513For @code{cris-axis-aout} and @code{cris-axis-elf} you need binutils 2.11
2514or newer. For @code{cris-axis-linux-gnu} you need binutils 2.12 or newer.
2515
2516Pre-packaged tools can be obtained from
2517@uref{ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/}. More
2518information about this platform is available at
2519@uref{http://developer.axis.com/}.
2520
f42974dc 2521@html
b8db17af 2522<hr />
f42974dc 2523@end html
ef88b07d 2524@heading @anchor{dos}DOS
f42974dc
DW
2525
2526Please have a look at our @uref{binaries.html,,binaries page}.
2527
f0523f02 2528You cannot install GCC by itself on MSDOS; it will not compile under
f85b8d1a
JM
2529any MSDOS compiler except itself. You need to get the complete
2530compilation package DJGPP, which includes binaries as well as sources,
2531and includes all the necessary compilation tools and libraries.
2532
021c4bfd 2533@html
b8db17af 2534<hr />
021c4bfd
RO
2535@end html
2536@heading @anchor{*-*-freebsd*}*-*-freebsd*
2537
f08dc6c1
LR
2538The version of binutils installed in @file{/usr/bin} probably works with
2539this release of GCC. However, on FreeBSD 4, bootstrapping against the
2540latest FSF binutils is known to improve overall testsuite results; and,
2541on FreeBSD/alpha, using binutils 2.14 or later is required to build libjava.
021c4bfd 2542
6a1dbbaf 2543Support for FreeBSD 1 was discontinued in GCC 3.2.
c7bdf0a6 2544
f08dc6c1
LR
2545Support for FreeBSD 2 will be discontinued after GCC 3.4. The
2546following was true for GCC 3.1 but the current status is unknown.
c7bdf0a6 2547For FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All
021c4bfd
RO
2548configuration support and files as shipped with GCC 2.95 are still in
2549place. FreeBSD 2.2.7 has been known to bootstrap completely; however,
2550it is unknown which version of binutils was used (it is assumed that it
2551was the system copy in @file{/usr/bin}) and C++ EH failures were noted.
2552
2553For FreeBSD using the ELF file format: DWARF 2 debugging is now the
2554default for all CPU architectures. It had been the default on
2555FreeBSD/alpha since its inception. You may use @option{-gstabs} instead
2556of @option{-g}, if you really want the old debugging format. There are
2557no known issues with mixing object files and libraries with different
2558debugging formats. Otherwise, this release of GCC should now match more
2559of the configuration used in the stock FreeBSD configuration of GCC. In
2560particular, @option{--enable-threads} is now configured by default.
2561However, as a general user, do not attempt to replace the system
2562compiler with this release. Known to bootstrap and check with good
f08dc6c1 2563results on FreeBSD 4.9-STABLE and 5-CURRENT@. In the past, known to
e4e7d312 2564bootstrap and check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2,
f08dc6c1 25654.3, 4.4, 4.5, 4.8-STABLE@.
46fc709d
LR
2566
2567In principle, @option{--enable-threads} is now compatible with
2568@option{--enable-libgcj} on FreeBSD@. However, it has only been built
e4e7d312 2569and tested on @samp{i386-*-freebsd[45]} and @samp{alpha-*-freebsd[45]}.
8c085f6f 2570The static
6b976d99
LR
2571library may be incorrectly built (symbols are missing at link time).
2572There is a rare timing-based startup hang (probably involves an
c0478a66 2573assumption about the thread library). Multi-threaded boehm-gc (required for
46fc709d 2574libjava) exposes severe threaded signal-handling bugs on FreeBSD before
e4e7d312 25754.5-RELEASE@. Other CPU architectures
46fc709d
LR
2576supported by FreeBSD will require additional configuration tuning in, at
2577the very least, both boehm-gc and libffi.
021c4bfd 2578
bc3a44db
LR
2579Shared @file{libgcc_s.so} is now built and installed by default.
2580
f42974dc 2581@html
b8db17af 2582<hr />
f42974dc 2583@end html
ef88b07d 2584@heading @anchor{h8300-hms}h8300-hms
71c6b994 2585Renesas H8/300 series of processors.
f42974dc
DW
2586
2587Please have a look at our @uref{binaries.html,,binaries page}.
2588
b8df899a
JM
2589The calling convention and structure layout has changed in release 2.6.
2590All code must be recompiled. The calling convention now passes the
2591first three arguments in function calls in registers. Structures are no
2592longer a multiple of 2 bytes.
2593
f42974dc 2594@html
b8db17af 2595<hr />
f42974dc 2596@end html
ef88b07d 2597@heading @anchor{hppa*-hp-hpux*}hppa*-hp-hpux*
6a1dbbaf 2598Support for HP-UX version 9 and older was discontinued in GCC 3.4.
f42974dc 2599
021c4bfd 2600We @emph{highly} recommend using gas/binutils 2.8 or newer on all hppa
f9047ed3 2601platforms; you may encounter a variety of problems when using the HP
581d9404 2602assembler.
f42974dc
DW
2603
2604Specifically, @option{-g} does not work on HP-UX (since that system
2605uses a peculiar debugging format which GCC does not know about), unless you
38209993
LG
2606use GAS and GDB and configure GCC with the
2607@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
6cfb3f16 2608@option{--with-as=@dots{}} options.
f42974dc 2609
08b3d104 2610If you wish to use the pa-risc 2.0 architecture support with a 32-bit
c5124497
JDA
2611runtime, you must use either the HP assembler, or gas/binutils 2.11
2612or newer.
f42974dc 2613
d5355cb2
JDA
2614There are two default scheduling models for instructions. These are
2615PROCESSOR_7100LC and PROCESSOR_8000. They are selected from the pa-risc
2616architecture specified for the target machine when configuring.
2617PROCESSOR_8000 is the default. PROCESSOR_7100LC is selected when
2618the target is a @samp{hppa1*} machine.
806bf413
JDA
2619
2620The PROCESSOR_8000 model is not well suited to older processors. Thus,
2621it is important to completely specify the machine architecture when
2622configuring if you want a model other than PROCESSOR_8000. The macro
2623TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different
2624default scheduling model is desired.
2625
021c4bfd 2626More specific information to @samp{hppa*-hp-hpux*} targets follows.
f42974dc 2627
f42974dc 2628@html
b8db17af 2629<hr />
f42974dc 2630@end html
ef88b07d 2631@heading @anchor{hppa*-hp-hpux10}hppa*-hp-hpux10
f42974dc 2632
f9047ed3 2633For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
161d7b59 2634@code{PHCO_19798} from HP@. HP has two sites which provide patches free of
f42974dc
DW
2635charge:
2636
2637@itemize @bullet
2638@item
2639@html
f401d0f5 2640<a href="http://us.itrc.hp.com/service/home/home.do">US, Canada, Asia-Pacific, and
f42974dc
DW
2641Latin-America</a>
2642@end html
2643@ifnothtml
f401d0f5
JDA
2644@uref{http://us.itrc.hp.com/service/home/home.do,,} US, Canada, Asia-Pacific,
2645and Latin-America.
f42974dc
DW
2646@end ifnothtml
2647@item
f401d0f5 2648@uref{http://europe.itrc.hp.com/service/home/home.do,,} Europe.
f42974dc
DW
2649@end itemize
2650
2aea0b53
ZW
2651The HP assembler on these systems has some problems. Most notably the
2652assembler inserts timestamps into each object file it creates, causing
2653the 3-stage comparison test to fail during a @samp{make bootstrap}.
2654You should be able to continue by saying @samp{make all} after getting
2655the failure from @samp{make bootstrap}.
f42974dc
DW
2656
2657
2658@html
b8db17af 2659<hr />
f42974dc 2660@end html
ef88b07d 2661@heading @anchor{hppa*-hp-hpux11}hppa*-hp-hpux11
f42974dc 2662
c5124497
JDA
2663GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot
2664be used to compile GCC 3.0 and up.
f269f54f 2665
c5124497
JDA
2666Refer to @uref{binaries.html,,binaries} for information about obtaining
2667precompiled GCC binaries for HP-UX. Precompiled binaries must be obtained
2668to build the Ada language as it can't be bootstrapped using C. Ada is
2669only available for the 32-bit PA-RISC runtime. The libffi and libjava
2670haven't been ported to HP-UX and don't build.
f401d0f5 2671
c5124497
JDA
2672It is possible to build GCC 3.3 starting with the bundled HP compiler,
2673but the process requires several steps. GCC 3.3 can then be used to
2674build later versions. The fastjar program contains ISO C code and
2675can't be built with the HP bundled compiler. This problem can be
2676avoided by not building the Java language. For example, use the
2677@option{--enable-languages="c,c++,f77,objc"} option in your configure
2678command.
08b3d104 2679
c5124497
JDA
2680Starting with GCC 3.4 an ISO C compiler is required to bootstrap. The
2681bundled compiler supports only traditional C; you will need either HP's
2682unbundled compiler, or a binary distribution of GCC@.
8c085f6f 2683
c5124497
JDA
2684There are several possible approaches to building the distribution.
2685Binutils can be built first using the HP tools. Then, the GCC
2686distribution can be built. The second approach is to build GCC
2687first using the HP tools, then build binutils, then rebuild GCC.
2688There have been problems with various binary distributions, so it
2689is best not to start from a binary distribution.
2690
2691On 64-bit capable systems, there are two distinct targets. Different
2692installation prefixes must be used if both are to be installed on
2693the same system. The @samp{hppa[1-2]*-hp-hpux11*} target generates code
2694for the 32-bit PA-RISC runtime architecture and uses the HP linker.
2695The @samp{hppa64-hp-hpux11*} target generates 64-bit code for the
2696PA-RISC 2.0 architecture. The HP and GNU linkers are both supported
2697for this target.
2698
2699The script config.guess now selects the target type based on the compiler
2700detected during configuration. You must define @env{PATH} or @env{CC} so
2701that configure finds an appropriate compiler for the initial bootstrap.
2702When @env{CC} is used, the definition should contain the options that are
2703needed whenever @env{CC} is used.
2704
2705Specifically, options that determine the runtime architecture must be
2706in @env{CC} to correctly select the target for the build. It is also
2707convenient to place many other compiler options in @env{CC}. For example,
2708@env{CC="cc -Ac +DA2.0W -Wp,-H16376 -D_CLASSIC_TYPES -D_HPUX_SOURCE"}
2709can be used to bootstrap the GCC 3.3 branch with the HP compiler in
271064-bit K&R/bundled mode. The @option{+DA2.0W} option will result in
2711the automatic selection of the @samp{hppa64-hp-hpux11*} target. The
2712macro definition table of cpp needs to be increased for a successful
2713build with the HP compiler. _CLASSIC_TYPES and _HPUX_SOURCE need to
2714be defined when building with the bundled compiler, or when using the
2715@option{-Ac} option. These defines aren't necessary with @option{-Ae}.
8c085f6f 2716
c5124497
JDA
2717It is best to explicitly configure the @samp{hppa64-hp-hpux11*} target
2718with the @option{--with-ld=@dots{}} option. This overrides the standard
2719search for ld. The two linkers supported on this target require different
2720commands. The default linker is determined during configuration. As a
2721result, it's not possible to switch linkers in the middle of a GCC build.
2722This has been been reported to sometimes occur in unified builds of
2723binutils and GCC.
2724
2725With GCC 3.0 through 3.2, you must use binutils 2.11 or above. As of
2726GCC 3.3, binutils 2.14 or later is required.
2727
2728Although the HP assembler can be used for an initial build, it shouldn't
2729be used with any languages other than C and perhaps Fortran due to its
2730many limitations. For example, it does not support weak symbols or alias
2731definitions. As a result, explicit template instantiations are required
2732when using C++. This makes it difficult if not impossible to build many
2733C++ applications. You can't generate debugging information when using
2734the HP assembler. Finally, @samp{make bootstrap} fails in the final
2735comparison of object modules due to the time stamps that it inserts into
2736the modules. The bootstrap can be continued from this point with
2737@samp{make all}.
2738
2739A recent linker patch must be installed for the correct operation of
2740GCC 3.3 and later. @code{PHSS_26559} and @code{PHSS_24304} are the
2741oldest linker patches that are known to work. They are for HP-UX
274211.00 and 11.11, respectively. @code{PHSS_24303}, the companion to
2743@code{PHSS_24304}, might be usable but it hasn't been tested. These
2744patches have been superseded. Consult the HP patch database to obtain
2745the currently recommended linker patch for your system.
2746
2747The patches are necessary for the support of weak symbols on the
274832-bit port, and for the running of initializers and finalizers. Weak
2749symbols are implemented using SOM secondary definition symbols. Prior
2750to HP-UX 11, there are bugs in the linker support for secondary symbols.
2751The patches correct a problem of linker core dumps creating shared
2752libraries containing secondary symbols, as well as various other
2753linking issues involving secondary symbols.
2754
2755GCC 3.3 uses the ELF DT_INIT_ARRAY and DT_FINI_ARRAY capabilities to
2756run initializers and finalizers on the 64-bit port. The 32-bit port
2757uses the linker @option{+init} and @option{+fini} options for the same
2758purpose. The patches correct various problems with the +init/+fini
2759options, including program core dumps. Binutils 2.14 corrects a
2760problem on the 64-bit port resulting from HP's non-standard use of
2761the .init and .fini sections for array initializers and finalizers.
f401d0f5
JDA
2762
2763There are a number of issues to consider in selecting which linker to
c5124497 2764use with the 64-bit port. The GNU 64-bit linker can only create dynamic
f401d0f5
JDA
2765binaries. The @option{-static} option causes linking with archive
2766libraries but doesn't produce a truly static binary. Dynamic binaries
2767still require final binding by the dynamic loader to resolve a set of
2768dynamic-loader-defined symbols. The default behavior of the HP linker
2769is the same as the GNU linker. However, it can generate true 64-bit
2770static binaries using the @option{+compat} option.
2771
2772The HP 64-bit linker doesn't support linkonce semantics. As a
2773result, C++ programs have many more sections than they should.
2774
2775The GNU 64-bit linker has some issues with shared library support
2776and exceptions. As a result, we only support libgcc in archive
2777format. For similar reasons, dwarf2 unwind and exception support
2778are disabled. The GNU linker also has problems creating binaries
2779with @option{-static}. It doesn't provide stubs for internal
2780calls to global functions in shared libraries, so these calls
2781can't be overloaded.
581d9404 2782
c5124497
JDA
2783Thread support is not implemented in GCC 3.0 through 3.2, so the
2784@option{--enable-threads} configure option does not work. In 3.3
2785and later, POSIX threads are supported. The optional DCE thread
2786library is not supported.
581d9404
JDA
2787
2788This port still is undergoing significant development.
08b3d104 2789
f42974dc 2790@html
b8db17af 2791<hr />
f42974dc 2792@end html
ef88b07d 2793@heading @anchor{*-*-linux-gnu}*-*-linux-gnu
f42974dc 2794
9e80ada7
PE
2795Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present
2796in glibc 2.2.5 and later. More information is available in the
2797libstdc++-v3 documentation.
2798
b8df899a 2799@html
b8db17af 2800<hr />
b8df899a
JM
2801@end html
2802@heading @anchor{ix86-*-linux*aout}i?86-*-linux*aout
2803Use this configuration to generate @file{a.out} binaries on Linux-based
41ca24de 2804GNU systems. This configuration is being superseded.
b8df899a 2805
f42974dc 2806@html
b8db17af 2807<hr />
f42974dc 2808@end html
ef88b07d 2809@heading @anchor{ix86-*-linux*}i?86-*-linux*
f42974dc 2810
1ea6f4c8
DH
2811As of GCC 3.3, binutils 2.13.1 or later is required for this platform.
2812See @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information.
f42974dc
DW
2813
2814If you receive Signal 11 errors when building on GNU/Linux, then it is
2815possible you have a hardware problem. Further information on this can be
2816found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
2817
2818@html
b8db17af 2819<hr />
f42974dc 2820@end html
ef88b07d 2821@heading @anchor{ix86-*-sco3.2v5*}i?86-*-sco3.2v5*
b8df899a 2822Use this for the SCO OpenServer Release 5 family of operating systems.
f42974dc
DW
2823
2824Unlike earlier versions of GCC, the ability to generate COFF with this
2825target is no longer provided.
2826
021c4bfd 2827Earlier versions of GCC emitted DWARF 1 when generating ELF to allow
f42974dc 2828the system debugger to be used. That support was too burdensome to
021c4bfd 2829maintain. GCC now emits only DWARF 2 for this target. This means you
f42974dc 2830may use either the UDK debugger or GDB to debug programs built by this
161d7b59 2831version of GCC@.
f42974dc 2832
ac24fc99
KJ
2833GCC is now only supported on releases 5.0.4 and later, and requires that
2834you install Support Level Supplement OSS646B or later, and Support Level
2835Supplement OSS631C or later. If you are using release 5.0.7 of
2836OpenServer, you must have at least the first maintenance pack installed
2837(this includes the relevant portions of OSS646). OSS646, also known as
2838the "Execution Environment Update", provides updated link editors and
2839assemblers, as well as updated standard C and math libraries. The C
2840startup modules are also updated to support the System V gABI draft, and
0b4be7de 2841GCC relies on that behavior. OSS631 provides a collection of commonly
ac24fc99
KJ
2842used open source libraries, some of which GCC depends on (such as GNU
2843gettext and zlib). SCO OpenServer Release 5.0.7 has all of this built
2844in by default, but OSS631C and later also apply to that release. Please
2845visit
2846@uref{ftp://ftp.sco.com/pub/openserver5,,ftp://ftp.sco.com/pub/openserver5}
2847for the latest versions of these (and other potentially useful)
2848supplements.
2849
2850Although there is support for using the native assembler, it is
2851recommended that you configure GCC to use the GNU assembler. You do
2852this by using the flags
2853@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}}. You should
2854use a modern version of GNU binutils. Version 2.13.2.1 was used for all
2855testing. In general, only the @option{--with-gnu-as} option is tested.
2856A modern bintuils (as well as a plethora of other development related
2857GNU utilities) can be found in Support Level Supplement OSS658A, the
2858"GNU Development Tools" package. See the SCO web and ftp sites for details.
2859That package also contains the currently "officially supported" version of
daf2f129 2860GCC, version 2.95.3. It is useful for bootstrapping this version.
f42974dc 2861
f42974dc 2862@html
b8db17af 2863<hr />
f42974dc 2864@end html
ef88b07d 2865@heading @anchor{ix86-*-udk}i?86-*-udk
f42974dc
DW
2866
2867This target emulates the SCO Universal Development Kit and requires that
f9047ed3
JM
2868package be installed. (If it is installed, you will have a
2869@file{/udk/usr/ccs/bin/cc} file present.) It's very much like the
b953cc4b 2870@samp{i?86-*-unixware7*} target
f42974dc
DW
2871but is meant to be used when hosting on a system where UDK isn't the
2872default compiler such as OpenServer 5 or Unixware 2. This target will
f9047ed3 2873generate binaries that will run on OpenServer, Unixware 2, or Unixware 7,
161d7b59 2874with the same warnings and caveats as the SCO UDK@.
f42974dc 2875
f42974dc
DW
2876This target is a little tricky to build because we have to distinguish
2877it from the native tools (so it gets headers, startups, and libraries
f9047ed3 2878from the right place) while making the tools not think we're actually
f42974dc
DW
2879building a cross compiler. The easiest way to do this is with a configure
2880command like this:
2881
3ab51846 2882@smallexample
8c085f6f
JJ
2883 CC=/udk/usr/ccs/bin/cc @var{/your/path/to}/gcc/configure \
2884 --host=i686-pc-udk --target=i686-pc-udk --program-prefix=udk-
3ab51846 2885@end smallexample
f42974dc 2886
6cfb3f16 2887@emph{You should substitute @samp{i686} in the above command with the appropriate
f42974dc
DW
2888processor for your host.}
2889
021c4bfd
RO
2890After the usual @samp{make bootstrap} and
2891@samp{make install}, you can then access the UDK-targeted GCC
38209993
LG
2892tools by adding @command{udk-} before the commonly known name. For
2893example, to invoke the C compiler, you would use @command{udk-gcc}.
2894They will coexist peacefully with any native-target GCC tools you may
2895have installed.
f42974dc
DW
2896
2897
b499d9ab 2898@html
b8db17af 2899<hr />
b499d9ab
JJ
2900@end html
2901@heading @anchor{ia64-*-linux}ia64-*-linux
2902IA-64 processor (also known as IPF, or Itanium Processor Family)
2903running GNU/Linux.
2904
bcd11e5e
JW
2905If you are using the optional libunwind library, then you must use
2906libunwind 0.96 or later.
2907
b499d9ab
JJ
2908None of the following versions of GCC has an ABI that is compatible
2909with any of the other versions in this list, with the exception that
2910Red Hat 2.96 and Trillian 000171 are compatible with each other:
41ca24de 29113.1, 3.0.2, 3.0.1, 3.0, Red Hat 2.96, and Trillian 000717.
b499d9ab 2912This primarily affects C++ programs and programs that create shared libraries.
41ca24de
DH
2913GCC 3.1 or later is recommended for compiling linux, the kernel.
2914As of version 3.1 GCC is believed to be fully ABI compliant, and hence no
2915more major ABI changes are expected.
b499d9ab 2916
959a73a4
DH
2917@html
2918<hr />
2919@end html
2920@heading @anchor{ia64-*-hpux*}ia64-*-hpux*
2921Building GCC on this target requires the GNU Assembler. The bundled HP
2922assembler will not work. To prevent GCC from using the wrong assembler,
2923the option @option{--with-gnu-as} may be necessary.
2924
2925The GCC libunwind library has not been ported to HPUX. This means that for
2926GCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions}
2927is required to build GCC. For GCC 3.3 and later, this is the default.
2928
f42974dc 2929@html
b8db17af 2930<hr />
f42974dc
DW
2931<!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
2932@end html
ef88b07d 2933@heading @anchor{*-ibm-aix*}*-ibm-aix*
6a1dbbaf 2934Support for AIX version 3 and older was discontinued in GCC 3.4.
f42974dc 2935
41ca24de 2936AIX Make frequently has problems with GCC makefiles. GNU Make 3.79.1 or
f42974dc
DW
2937newer is recommended to build on this platform.
2938
e8d8a034
DE
2939To speed up the configuration phases of bootstrapping and installing GCC,
2940one may use GNU Bash instead of AIX @command{/bin/sh}, e.g.,
2941
2942@smallexample
2943 % CONFIG_SHELL=/opt/freeware/bin/bash
2944 % export CONFIG_SHELL
2945@end smallexample
2946
2947and then proceed as described in @uref{build.html,,the build instructions},
2948where we strongly recommend using GNU make and specifying an absolute path
2949to invoke @var{srcdir}/configure.
2950
6cfb3f16 2951Errors involving @code{alloca} when building GCC generally are due
021c4bfd 2952to an incorrect definition of @code{CC} in the Makefile or mixing files
161d7b59 2953compiled with the native C compiler and GCC@. During the stage1 phase of
6cfb3f16
JM
2954the build, the native AIX compiler @strong{must} be invoked as @command{cc}
2955(not @command{xlc}). Once @command{configure} has been informed of
2956@command{xlc}, one needs to use @samp{make distclean} to remove the
38209993 2957configure cache files and ensure that @env{CC} environment variable
f42974dc
DW
2958does not provide a definition that will confuse @command{configure}.
2959If this error occurs during stage2 or later, then the problem most likely
2960is the version of Make (see above).
2961
f0483418
DE
2962The native @command{as} and @command{ld} are recommended for bootstrapping
2963on AIX 4 and required for bootstrapping on AIX 5L. The GNU Assembler
2964reports that it supports WEAK symbols on AIX 4, which causes GCC to try to
2965utilize weak symbol functionality although it is not supported. The GNU
2966Assembler and Linker do not support AIX 5L sufficiently to bootstrap GCC.
2967The native AIX tools do interoperate with GCC@.
df002c7d 2968
04d2be8e 2969Building @file{libstdc++.a} requires a fix for an AIX Assembler bug
bb674cef
DE
2970APAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1). It also requires a
2971fix for another AIX Assembler bug and a co-dependent AIX Archiver fix
06e7f299 2972referenced as APAR IY53606 (AIX 5.2) or a APAR IY54774 (AIX 5.1)
2705baf5 2973
bb674cef 2974@samp{libstdc++} in GCC 3.4 increments the major version number of the
fdf68669 2975shared object and GCC installation places the @file{libstdc++.a}
bb674cef
DE
2976shared library in a common location which will overwrite the and GCC
29773.3 version of the shared library. Applications either need to be
2978re-linked against the new shared library or the GCC 3.1 and GCC 3.3
2979versions of the @samp{libstdc++} shared object needs to be available
2980to the AIX runtime loader. The GCC 3.1 @samp{libstdc++.so.4}, if
2981present, and GCC 3.3 @samp{libstdc++.so.5} shared objects can be
2982installed for runtime dynamic loading using the following steps to set
2983the @samp{F_LOADONLY} flag in the shared object for @emph{each}
fdf68669
DE
2984multilib @file{libstdc++.a} installed:
2985
bb674cef
DE
2986Extract the shared objects from the currently installed
2987@file{libstdc++.a} archive:
3ab51846 2988@smallexample
bb674cef 2989 % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
3ab51846 2990@end smallexample
fdf68669
DE
2991
2992Enable the @samp{F_LOADONLY} flag so that the shared object will be
2993available for runtime dynamic loading, but not linking:
3ab51846 2994@smallexample
bb674cef 2995 % strip -e libstdc++.so.4 libstdc++.so.5
3ab51846 2996@end smallexample
fdf68669 2997
bb674cef 2998Archive the runtime-only shared object in the GCC 3.4
fdf68669 2999@file{libstdc++.a} archive:
3ab51846 3000@smallexample
bb674cef 3001 % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
3ab51846 3002@end smallexample
fdf68669 3003
df002c7d
DE
3004Linking executables and shared libraries may produce warnings of
3005duplicate symbols. The assembly files generated by GCC for AIX always
3006have included multiple symbol definitions for certain global variable
3007and function declarations in the original program. The warnings should
3008not prevent the linker from producing a correct library or runnable
3009executable.
3010
6cfb3f16 3011AIX 4.3 utilizes a ``large format'' archive to support both 32-bit and
df002c7d
DE
301264-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
3013to parse archive libraries did not handle the new format correctly.
3014These routines are used by GCC and result in error messages during
6cfb3f16 3015linking such as ``not a COFF file''. The version of the routines shipped
df002c7d
DE
3016with AIX 4.3.1 should work for a 32-bit environment. The @option{-g}
3017option of the archive command may be used to create archives of 32-bit
6cfb3f16 3018objects using the original ``small format''. A correct version of the
d5d8d540 3019routines is shipped with AIX 4.3.2 and above.
df002c7d 3020
f42974dc
DW
3021Some versions of the AIX binder (linker) can fail with a relocation
3022overflow severe error when the @option{-bbigtoc} option is used to link
161d7b59 3023GCC-produced object files into an executable that overflows the TOC@. A fix
f42974dc
DW
3024for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
3025available from IBM Customer Support and from its
d5d8d540 3026@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
f42974dc
DW
3027website as PTF U455193.
3028
df002c7d 3029The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
161d7b59 3030with a segmentation fault when invoked by any version of GCC@. A fix for
df002c7d 3031APAR IX87327 is available from IBM Customer Support and from its
d5d8d540 3032@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
df002c7d 3033website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above.
f42974dc
DW
3034
3035The initial assembler shipped with AIX 4.3.0 generates incorrect object
3036files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
3037TO ASSEMBLE/BIND) is available from IBM Customer Support and from its
d5d8d540 3038@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
f42974dc
DW
3039website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above.
3040
161d7b59 3041AIX provides National Language Support (NLS)@. Compilers and assemblers
df002c7d 3042use NLS to support locale-specific representations of various data
6cfb3f16 3043formats including floating-point numbers (e.g., @samp{.} vs @samp{,} for
df002c7d
DE
3044separating decimal fractions). There have been problems reported where
3045GCC does not produce the same floating-point formats that the assembler
c771326b 3046expects. If one encounters this problem, set the @env{LANG}
6cfb3f16 3047environment variable to @samp{C} or @samp{En_US}.
f42974dc 3048
5791e6da
DE
3049By default, GCC for AIX 4.1 and above produces code that can be used on
3050both Power or PowerPC processors.
3051
d5d8d540
DE
3052A default can be specified with the @option{-mcpu=@var{cpu_type}}
3053switch and using the configure option @option{--with-cpu-@var{cpu_type}}.
f42974dc 3054
e3223ea2 3055@html
b8db17af 3056<hr />
e3223ea2
DC
3057@end html
3058@heading @anchor{ip2k-*-elf}ip2k-*-elf
3059Ubicom IP2022 micro controller.
3060This configuration is intended for embedded systems.
3061There are no standard Unix configurations.
3062
3063Use @samp{configure --target=ip2k-elf --enable-languages=c} to configure GCC@.
3064
6b3d1e47
SC
3065@html
3066<hr />
3067@end html
3068@heading @anchor{iq2000-*-elf}iq2000-*-elf
3069Vitesse IQ2000 processors. These are used in embedded
3070applications. There are no standard Unix configurations.
3071
b8df899a 3072@html
b8db17af 3073<hr />
b8df899a
JM
3074@end html
3075@heading @anchor{m32r-*-elf}m32r-*-elf
25f47a4c 3076Renesas M32R processor.
b8df899a
JM
3077This configuration is intended for embedded systems.
3078
b8df899a 3079@html
b8db17af 3080<hr />
b8df899a
JM
3081@end html
3082@heading @anchor{m6811-elf}m6811-elf
3083Motorola 68HC11 family micro controllers. These are used in embedded
3084applications. There are no standard Unix configurations.
3085
3086@html
b8db17af 3087<hr />
b8df899a
JM
3088@end html
3089@heading @anchor{m6812-elf}m6812-elf
3090Motorola 68HC12 family micro controllers. These are used in embedded
3091applications. There are no standard Unix configurations.
3092
b8df899a 3093@html
b8db17af 3094<hr />
b8df899a
JM
3095@end html
3096@heading @anchor{m68k-hp-hpux}m68k-hp-hpux
161d7b59
JM
3097HP 9000 series 300 or 400 running HP-UX@. HP-UX version 8.0 has a bug in
3098the assembler that prevents compilation of GCC@. This
b8df899a
JM
3099bug manifests itself during the first stage of compilation, while
3100building @file{libgcc2.a}:
3101
3102@smallexample
3103_floatdisf
3104cc1: warning: `-g' option not supported on this version of GCC
3105cc1: warning: `-g1' option not supported on this version of GCC
3106./xgcc: Internal compiler error: program as got fatal signal 11
3107@end smallexample
3108
3109A patched version of the assembler is available as the file
3110@uref{ftp://altdorf.ai.mit.edu/archive/cph/hpux-8.0-assembler}. If you
3111have HP software support, the patch can also be obtained directly from
3112HP, as described in the following note:
3113
3114@quotation
3115This is the patched assembler, to patch SR#1653-010439, where the
3116assembler aborts on floating point constants.
3117
3118The bug is not really in the assembler, but in the shared library
3119version of the function ``cvtnum(3c)''. The bug on ``cvtnum(3c)'' is
3120SR#4701-078451. Anyway, the attached assembler uses the archive
3121library version of ``cvtnum(3c)'' and thus does not exhibit the bug.
3122@end quotation
3123
3124This patch is also known as PHCO_4484.
3125
41ca24de 3126In addition gdb does not understand that native HP-UX format, so
b8df899a
JM
3127you must use gas if you wish to use gdb.
3128
3129On HP-UX version 8.05, but not on 8.07 or more recent versions, the
7ba4ca63 3130@command{fixproto} shell script triggers a bug in the system shell. If you
b8df899a 3131encounter this problem, upgrade your operating system or use BASH (the
7ba4ca63 3132GNU shell) to run @command{fixproto}. This bug will cause the fixproto
b8df899a
JM
3133program to report an error of the form:
3134
3ab51846 3135@smallexample
b8df899a 3136./fixproto: sh internal 1K buffer overflow
3ab51846 3137@end smallexample
b8df899a
JM
3138
3139To fix this, you can also change the first line of the fixproto script
3140to look like:
3141
3ab51846 3142@smallexample
b8df899a 3143#!/bin/ksh
3ab51846 3144@end smallexample
b8df899a 3145
b8df899a 3146@html
b8db17af 3147<hr />
b8df899a
JM
3148@end html
3149@heading @anchor{mips-*-*}mips-*-*
b8df899a
JM
3150If on a MIPS system you get an error message saying ``does not have gp
3151sections for all it's [sic] sectons [sic]'', don't worry about it. This
3152happens whenever you use GAS with the MIPS linker, but there is not
3153really anything wrong, and it is okay to use the output file. You can
3154stop such warnings by installing the GNU linker.
3155
3156It would be nice to extend GAS to produce the gp tables, but they are
3157optional, and there should not be a warning about their absence.
3158
26979a17
PE
3159The libstdc++ atomic locking routines for MIPS targets requires MIPS II
3160and later. A patch went in just after the GCC 3.3 release to
3161make @samp{mips*-*-*} use the generic implementation instead. You can also
3162configure for @samp{mipsel-elf} as a workaround. The
3163@samp{mips*-*-linux*} target continues to use the MIPS II routines. More
3164work on this is expected in future releases.
3165
01e97976
JM
3166Cross-compilers for the Mips as target using the Mips assembler
3167currently do not work, because the auxiliary programs
3168@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on
3169anything but a Mips. It does work to cross compile for a Mips
3170if you use the GNU assembler and linker.
3171
5fb57097
EB
3172@html
3173<hr />
3174@end html
b953cc4b
RO
3175@heading @anchor{mips-sgi-irix5}mips-sgi-irix5
3176
7e270317
RO
3177In order to compile GCC on an SGI running IRIX 5, the @samp{compiler_dev.hdr}
3178subsystem must be installed from the IDO CD-ROM supplied by SGI@.
3179It is also available for download from
8df5a2b4 3180@uref{ftp://ftp.sgi.com/sgi/IRIX5.3/iris-development-option-5.3.tardist}.
f42974dc 3181
213ba345
RO
3182If you use the MIPS C compiler to bootstrap, it may be necessary
3183to increase its table size for switch statements with the
3184@option{-Wf,-XNg1500} option. If you use the @option{-O2}
3185optimization option, you also need to use @option{-Olimit 3000}.
f42974dc 3186
7e270317
RO
3187To enable debugging under IRIX 5, you must use GNU binutils 2.15 or
3188later, and use the @option{--with-gnu-as} and @option{--with-gnu-ld}
3189@command{configure} options when configuring GCC@. You need to use GNU
3190@command{ar} and @command{nm}, also distributed with GNU binutils.
f42974dc
DW
3191
3192@html
b8db17af 3193<hr />
f42974dc 3194@end html
b953cc4b 3195@heading @anchor{mips-sgi-irix6}mips-sgi-irix6
f42974dc 3196
7e270317 3197If you are using SGI's MIPSpro @command{cc} as your bootstrap compiler, you must
f42974dc
DW
3198ensure that the N32 ABI is in use. To test this, compile a simple C
3199file with @command{cc} and then run @command{file} on the
3200resulting object file. The output should look like:
3201
3ab51846 3202@smallexample
213ba345 3203test.o: ELF N32 MSB @dots{}
3ab51846 3204@end smallexample
f42974dc
DW
3205
3206If you see:
213ba345 3207
3ab51846 3208@smallexample
213ba345 3209test.o: ELF 32-bit MSB @dots{}
3ab51846 3210@end smallexample
213ba345
RO
3211
3212or
3213
3ab51846 3214@smallexample
213ba345 3215test.o: ELF 64-bit MSB @dots{}
3ab51846 3216@end smallexample
f42974dc 3217
213ba345 3218then your version of @command{cc} uses the O32 or N64 ABI by default. You
38209993 3219should set the environment variable @env{CC} to @samp{cc -n32}
7e270317
RO
3220before configuring GCC@. SGI's MIPSpro 7.2 assembler may misassemble
3221parts of the compiler, causing bootstrap failures. MIPSpro 7.3 is
3222known to work. MIPSpro C 7.4 may cause bootstrap failures, too, due
3223to a bug when inlining @code{memcmp}. Either add @code{-U__INLINE_INTRINSICS}
3224to the @env{CC} environment variable as a workaround or upgrade to
3225MIPSpro C 7.4.1m.
f42974dc 3226
0fca60ab 3227If you want the resulting @command{gcc} to run on old 32-bit systems
7e270317 3228with the MIPS R4400 CPU, you need to ensure that only code for the @samp{mips3}
0fca60ab
RO
3229instruction set architecture (ISA) is generated. While GCC 3.x does
3230this correctly, both GCC 2.95 and SGI's MIPSpro @command{cc} may change
3231the ISA depending on the machine where GCC is built. Using one of them
7e270317
RO
3232as the bootstrap compiler may result in @samp{mips4} code, which won't run at
3233all on @samp{mips3}-only systems. For the test program above, you should see:
0fca60ab 3234
3ab51846 3235@smallexample
0fca60ab 3236test.o: ELF N32 MSB mips-3 @dots{}
3ab51846 3237@end smallexample
0fca60ab
RO
3238
3239If you get:
3240
3ab51846 3241@smallexample
0fca60ab 3242test.o: ELF N32 MSB mips-4 @dots{}
3ab51846 3243@end smallexample
0fca60ab
RO
3244
3245instead, you should set the environment variable @env{CC} to @samp{cc
3246-n32 -mips3} or @samp{gcc -mips3} respectively before configuring GCC@.
3247
7e270317
RO
3248GCC on IRIX 6 is usually built to support the N32, O32 and N64 ABIs. If
3249you build GCC on a system that doesn't have the N64 libraries installed
3250or cannot run 64-bit binaries,
213ba345 3251you need to configure with @option{--disable-multilib} so GCC doesn't
7e270317
RO
3252try to use them. This will disable building the O32 libraries, too.
3253Look for @file{/usr/lib64/libc.so.1} to see if you
213ba345
RO
3254have the 64-bit libraries installed.
3255
7e270317
RO
3256To enable debugging for the O32 ABI, you must use GNU @command{as} from
3257GNU binutils 2.15 or later. You may also use GNU @command{ld}, but
3258this is not required and currently causes some problems with Ada.
f42974dc 3259
b953cc4b
RO
3260The @option{--enable-threads} option doesn't currently work, a patch is
3261in preparation for a future release. The @option{--enable-libgcj}
3262option is disabled by default: IRIX 6 uses a very low default limit
7e270317 3263(20480) for the command line length. Although @command{libtool} contains a
b953cc4b
RO
3264workaround for this problem, at least the N64 @samp{libgcj} is known not
3265to build despite this, running into an internal error of the native
3266@command{ld}. A sure fix is to increase this limit (@samp{ncargs}) to
3267its maximum of 262144 bytes. If you have root access, you can use the
3268@command{systune} command to do this.
3269
7e270317 3270See @uref{http://freeware.sgi.com/} for more
3aa8219e 3271information about using GCC on IRIX platforms.
f42974dc 3272
b8df899a 3273@html
b8db17af 3274<hr />
b8df899a 3275@end html
021c4bfd 3276@heading @anchor{powerpc*-*-*}powerpc-*-*
b8df899a 3277
6cfb3f16
JM
3278You can specify a default version for the @option{-mcpu=@var{cpu_type}}
3279switch by using the configure option @option{--with-cpu-@var{cpu_type}}.
b8df899a 3280
4f2b1139 3281@html
b8db17af 3282<hr />
4f2b1139
SS
3283@end html
3284@heading @anchor{powerpc-*-darwin*}powerpc-*-darwin*
3285PowerPC running Darwin (Mac OS X kernel).
3286
4f2b1139
SS
3287Pre-installed versions of Mac OS X may not include any developer tools,
3288meaning that you will not be able to build GCC from source. Tool
3289binaries are available at
11292480 3290@uref{http://developer.apple.com/tools/compilers.html} (free
4f2b1139
SS
3291registration required).
3292
b89a3806
GK
3293The default stack limit of 512K is too small, which may cause compiles
3294to fail with 'Bus error'. Set the stack larger, for instance
3295by doing @samp{limit stack 800}. It's a good idea to use the GNU
3296preprocessor instead of Apple's @file{cpp-precomp} during the first stage of
3297bootstrapping; this is automatic when doing @samp{make bootstrap}, but
3298to do it from the toplevel objdir you will need to say @samp{make
3299CC='cc -no-cpp-precomp' bootstrap}.
3300
3301The version of GCC shipped by Apple typically includes a number of
3302extensions not available in a standard GCC release. These extensions
3303are generally specific to Mac programming.
4f2b1139 3304
021c4bfd 3305@html
b8db17af 3306<hr />
021c4bfd
RO
3307@end html
3308@heading @anchor{powerpc-*-elf}powerpc-*-elf, powerpc-*-sysv4
3309PowerPC system in big endian mode, running System V.4.
3310
f42974dc 3311@html
b8db17af 3312<hr />
f42974dc 3313@end html
ef88b07d 3314@heading @anchor{powerpc-*-linux-gnu*}powerpc-*-linux-gnu*
f42974dc 3315
f9047ed3 3316You will need
e8a7b0c2 3317@uref{ftp://ftp.kernel.org/pub/linux/devel/binutils,,binutils 2.13.90.0.10}
791a949f 3318or newer for a working GCC@.
f42974dc 3319
edf1b3f3 3320@html
b8db17af 3321<hr />
edf1b3f3
AC
3322@end html
3323@heading @anchor{powerpc-*-netbsd*}powerpc-*-netbsd*
3324PowerPC system in big endian mode running NetBSD@. To build the
a38f87a9 3325documentation you will need Texinfo version 4.2 (NetBSD 1.5.1 included
edf1b3f3
AC
3326Texinfo version 3.12).
3327
b8df899a 3328@html
b8db17af 3329<hr />
b8df899a
JM
3330@end html
3331@heading @anchor{powerpc-*-eabisim}powerpc-*-eabisim
3332Embedded PowerPC system in big endian mode for use in running under the
3333PSIM simulator.
3334
b8df899a 3335@html
b8db17af 3336<hr />
b8df899a
JM
3337@end html
3338@heading @anchor{powerpc-*-eabi}powerpc-*-eabi
3339Embedded PowerPC system in big endian mode.
3340
b8df899a 3341@html
b8db17af 3342<hr />
b8df899a
JM
3343@end html
3344@heading @anchor{powerpcle-*-elf}powerpcle-*-elf, powerpcle-*-sysv4
3345PowerPC system in little endian mode, running System V.4.
3346
b8df899a 3347@html
b8db17af 3348<hr />
b8df899a
JM
3349@end html
3350@heading @anchor{powerpcle-*-eabisim}powerpcle-*-eabisim
3351Embedded PowerPC system in little endian mode for use in running under
3352the PSIM simulator.
3353
3354@html
b8db17af 3355<hr />
b8df899a
JM
3356@end html
3357@heading @anchor{powerpcle-*-eabi}powerpcle-*-eabi
3358Embedded PowerPC system in little endian mode.
3359
91abf72d 3360@html
b8db17af 3361<hr />
91abf72d
HP
3362@end html
3363@heading @anchor{s390-*-linux*}s390-*-linux*
95fef11f 3364S/390 system running GNU/Linux for S/390@.
91abf72d
HP
3365
3366@html
b8db17af 3367<hr />
91abf72d
HP
3368@end html
3369@heading @anchor{s390x-*-linux*}s390x-*-linux*
95fef11f 3370zSeries system (64-bit) running GNU/Linux for zSeries@.
91abf72d 3371
8bf06993
UW
3372@html
3373<hr />
3374@end html
3375@heading @anchor{s390x-ibm-tpf*}s390x-ibm-tpf*
daf2f129 3376zSeries system (64-bit) running TPF. This platform is
8bf06993
UW
3377supported as cross-compilation target only.
3378
f42974dc 3379@html
b8db17af 3380<hr />
f42974dc 3381@end html
250d5688 3382@c Please use Solaris 2 to refer to all release of Solaris, starting
1460af95 3383@c with 2.0 until 2.6, 7, 8, etc. Solaris 1 was a marketing name for
250d5688
RO
3384@c SunOS 4 releases which we don't use to avoid confusion. Solaris
3385@c alone is too unspecific and must be avoided.
3386@heading @anchor{*-*-solaris2*}*-*-solaris2*
f42974dc 3387
250d5688 3388Sun does not ship a C compiler with Solaris 2. To bootstrap and install
dbd210ef
KC
3389GCC you first have to install a pre-built compiler, see our
3390@uref{binaries.html,,binaries page} for details.
f42974dc 3391
250d5688 3392The Solaris 2 @command{/bin/sh} will often fail to configure
92441f83 3393@file{libstdc++-v3}, @file{boehm-gc} or @file{libjava}. We therefore
bc890961
EB
3394recommend to use the following sequence of commands to bootstrap and
3395install GCC:
3396
3397@smallexample
3398 % CONFIG_SHELL=/bin/ksh
3399 % export CONFIG_SHELL
bc890961
EB
3400@end smallexample
3401
1cba0a4e
PE
3402and then proceed as described in @uref{build.html,,the build instructions},
3403where we strongly recommend using GNU make and specifying an absolute path
3404to invoke @var{srcdir}/configure.
e6855a2d 3405
b8df899a 3406Solaris 2 comes with a number of optional OS packages. Some of these
92441f83 3407are needed to use GCC fully, namely @code{SUNWarc},
dbd210ef
KC
3408@code{SUNWbtool}, @code{SUNWesu}, @code{SUNWhea}, @code{SUNWlibm},
3409@code{SUNWsprot}, and @code{SUNWtoo}. If you did not install all
250d5688 3410optional packages when installing Solaris 2, you will need to verify that
b8df899a
JM
3411the packages that GCC needs are installed.
3412
3413To check whether an optional package is installed, use
dbd210ef 3414the @command{pkginfo} command. To add an optional package, use the
250d5688 3415@command{pkgadd} command. For further details, see the Solaris 2
b8df899a
JM
3416documentation.
3417
250d5688 3418Trying to use the linker and other tools in
b8df899a
JM
3419@file{/usr/ucb} to install GCC has been observed to cause trouble.
3420For example, the linker may hang indefinitely. The fix is to remove
250d5688 3421@file{/usr/ucb} from your @env{PATH}.
f42974dc 3422
bc890961
EB
3423The build process works more smoothly with the legacy Sun tools so, if you
3424have @file{/usr/xpg4/bin} in your @env{PATH}, we recommend that you place
3425@file{/usr/bin} before @file{/usr/xpg4/bin} for the duration of the build.
3426
021c4bfd
RO
3427All releases of GNU binutils prior to 2.11.2 have known bugs on this
3428platform. We recommend the use of GNU binutils 2.11.2 or the vendor
3429tools (Sun @command{as}, Sun @command{ld}).
f42974dc 3430
250d5688
RO
3431Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
3432newer: @command{g++} will complain that types are missing. These headers assume
3433that omitting the type means @code{int}; this assumption worked for C89 but
3434is wrong for C++, and is now wrong for C99 also.
3435
13ba36b4 3436@command{g++} accepts such (invalid) constructs with the option
250d5688
RO
3437@option{-fpermissive}; it
3438will assume that any missing type is @code{int} (as defined by C89).
3439
3440There are patches for Solaris 2.6 (105633-56 or newer for SPARC,
3441106248-42 or newer for Intel), Solaris 7 (108376-21 or newer for SPARC,
3442108377-20 for Intel), and Solaris 8 (108652-24 or newer for SPARC,
3443108653-22 for Intel) that fix this bug.
f42974dc 3444
dbd210ef 3445@html
b8db17af 3446<hr />
dbd210ef 3447@end html
250d5688 3448@heading @anchor{sparc-sun-solaris2*}sparc-sun-solaris2*
dbd210ef 3449
1405141b
DN
3450When GCC is configured to use binutils 2.11.2 or later the binaries
3451produced are smaller than the ones produced using Sun's native tools;
3452this difference is quite significant for binaries containing debugging
3453information.
3454
250d5688 3455Sun @command{as} 4.x is broken in that it cannot cope with long symbol names.
dbd210ef
KC
3456A typical error message might look similar to the following:
3457
8c085f6f
JJ
3458@smallexample
3459/usr/ccs/bin/as: "/var/tmp/ccMsw135.s", line 11041: error:
3460 can't compute value of an expression involving an external symbol.
3461@end smallexample
dbd210ef 3462
250d5688
RO
3463This is Sun bug 4237974. This is fixed with patch 108908-02 for Solaris
34642.6 and has been fixed in later (5.x) versions of the assembler,
3465starting with Solaris 7.
dbd210ef 3466
03b272d2 3467Starting with Solaris 7, the operating system is capable of executing
975c6e4e
RO
346864-bit SPARC V9 binaries. GCC 3.1 and later properly supports
3469this; the @option{-m64} option enables 64-bit code generation.
3470However, if all you want is code tuned for the UltraSPARC CPU, you
3471should try the @option{-mtune=ultrasparc} option instead, which produces
3472code that, unlike full 64-bit code, can still run on non-UltraSPARC
edf1c8df 3473machines.
03b272d2 3474
975c6e4e 3475When configuring on a Solaris 7 or later system that is running a kernel
8947df0c
RH
3476that supports only 32-bit binaries, one must configure with
3477@option{--disable-multilib}, since we will not be able to build the
347864-bit target libraries.
3fc602a0 3479
ae81c844
EB
3480GCC 3.3 and GCC 3.4 trigger code generation bugs in earlier versions of
3481the GNU compiler (especially GCC 3.0.x versions), which lead to the
3482miscompilation of the stage1 compiler and the subsequent failure of the
3483bootstrap process. A workaround is to use GCC 3.2.3 as an intermediary
3484stage, i.e. to bootstrap that compiler with the base compiler and then
3485use it to bootstrap the final compiler.
3486
94b18ec1
EB
3487GCC 3.4 triggers a code generation bug in versions 5.4 (Sun ONE Studio 7)
3488and 5.5 (Sun ONE Studio 8) of the Sun compiler, which causes a bootstrap
3489failure in form of a miscompilation of the stage1 compiler by the Sun
3490compiler. This is Sun bug 4974440. This is fixed with patch 112760-07.
3491
1460af95
PE
3492GCC 3.4 changed the default debugging format from STABS to DWARF-2 for
349332-bit code on Solaris 7 and later. If you are using the Sun
3494assembler, this change apparently runs afoul of Sun bug 4910101, for
3495which (as of 2004-05-23) there is no fix. A symptom of the problem is
3496that you cannot compile C++ programs like @command{groff} 1.19.1
3497without getting messages like @samp{ld: warning: relocation error:
3498R_SPARC_UA32 @dots{} external symbolic relocation against
3499non-allocatable section .debug_info; cannot be processed at runtime:
3500relocation ignored}. To work around this problem, compile with
3501@option{-gstabs+} instead of plain @option{-g}.
3502
f42974dc 3503@html
b8db17af 3504<hr />
f42974dc 3505@end html
ef88b07d 3506@heading @anchor{sparc-sun-solaris2.7}sparc-sun-solaris2.7
f42974dc 3507
250d5688 3508Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in
f42974dc
DW
3509the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8
3510and later, including all EGCS releases. Sun formerly recommended
3511107058-01 for all Solaris 7 users, but around 1999-09-01 it started to
3512recommend it only for people who use Sun's compilers.
f9047ed3 3513
f42974dc
DW
3514Here are some workarounds to this problem:
3515@itemize @bullet
3516@item
3517Do not install Sun patch 107058-01 until after Sun releases a
3518complete patch for bug 4210064. This is the simplest course to take,
3519unless you must also use Sun's C compiler. Unfortunately 107058-01
250d5688 3520is preinstalled on some new Solaris 7-based hosts, so you may have to
f42974dc 3521back it out.
f9047ed3 3522
f42974dc
DW
3523@item
3524Copy the original, unpatched Solaris 7
3525@command{/usr/ccs/bin/as} into
8e5f33ff 3526@command{/usr/local/libexec/gcc/sparc-sun-solaris2.7/3.4/as},
f42974dc
DW
3527adjusting the latter name to fit your local conventions and software
3528version numbers.
3529
3530@item
3531Install Sun patch 106950-03 (1999-05-25) or later. Nobody with
3532both 107058-01 and 106950-03 installed has reported the bug with GCC
3533and Sun's dynamic linker. This last course of action is riskiest,
3534for two reasons. First, you must install 106950 on all hosts that
3535run code generated by GCC; it doesn't suffice to install it only on
3536the hosts that run GCC itself. Second, Sun says that 106950-03 is
3537only a partial fix for bug 4210064, but Sun doesn't know whether the
161d7b59 3538partial fix is adequate for GCC@. Revision -08 or later should fix
1460af95 3539the bug. The current (as of 2004-05-23) revision is -24, and is included in
f282ffb3 3540the Solaris 7 Recommended Patch Cluster.
f9047ed3 3541@end itemize
f42974dc 3542
fdbf04c8
EB
3543GCC 3.3 triggers a bug in version 5.0 Alpha 03/27/98 of the Sun assembler,
3544which causes a bootstrap failure when linking the 64-bit shared version of
3545libgcc. A typical error message is:
3546
3547@smallexample
3548ld: fatal: relocation error: R_SPARC_32: file libgcc/sparcv9/_muldi3.o:
3549 symbol <unknown>: offset 0xffffffff7ec133e7 is non-aligned.
3550@end smallexample
3551
3552This bug has been fixed in the final 5.0 version of the assembler.
f42974dc 3553
c6fa9728 3554@html
b8db17af 3555<hr />
c6fa9728
JS
3556@end html
3557@heading @anchor{sparc-*-linux*}sparc-*-linux*
3558
3559GCC versions 3.0 and higher require binutils 2.11.2 and glibc 2.2.4
3560or newer on this platform. All earlier binutils and glibc
3561releases mishandled unaligned relocations on @code{sparc-*-*} targets.
3562
3563
f42974dc 3564@html
b8db17af 3565<hr />
f42974dc 3566@end html
0dc7ee3c 3567@heading @anchor{sparc64-*-solaris2*}sparc64-*-solaris2*
e403b4bc
CR
3568
3569The following compiler flags must be specified in the configure
3570step in order to bootstrap this target with the Sun compiler:
3571
3ab51846 3572@smallexample
e403b4bc 3573 % CC="cc -xildoff -xarch=v9" @var{srcdir}/configure [@var{options}] [@var{target}]
3ab51846 3574@end smallexample
e403b4bc
CR
3575
3576@option{-xildoff} turns off the incremental linker, and @option{-xarch=v9}
0dc7ee3c
EB
3577specifies the SPARC-V9 architecture to the Sun linker and assembler.
3578
3579@html
3580<hr />
3581@end html
3582@heading @anchor{sparcv9-*-solaris2*}sparcv9-*-solaris2*
3583
3584This is a synonym for sparc64-*-solaris2*.
f42974dc 3585
b8df899a 3586@html
b8db17af 3587<hr />
b8df899a
JM
3588@end html
3589@heading @anchor{#*-*-sysv*}*-*-sysv*
3590On System V release 3, you may get this error message
3591while linking:
3592
3593@smallexample
3594ld fatal: failed to write symbol name @var{something}
3595 in strings table for file @var{whatever}
3596@end smallexample
3597
021c4bfd 3598This probably indicates that the disk is full or your ulimit won't allow
b8df899a
JM
3599the file to be as large as it needs to be.
3600
3601This problem can also result because the kernel parameter @code{MAXUMEM}
3602is too small. If so, you must regenerate the kernel and make the value
3603much larger. The default value is reported to be 1024; a value of 32768
3604is said to work. Smaller values may also work.
3605
3606On System V, if you get an error like this,
3607
3ab51846 3608@smallexample
b8df899a
JM
3609/usr/local/lib/bison.simple: In function `yyparse':
3610/usr/local/lib/bison.simple:625: virtual memory exhausted
3ab51846 3611@end smallexample
b8df899a
JM
3612
3613@noindent
021c4bfd 3614that too indicates a problem with disk space, ulimit, or @code{MAXUMEM}.
b8df899a 3615
f85b8d1a 3616On a System V release 4 system, make sure @file{/usr/bin} precedes
7ba4ca63 3617@file{/usr/ucb} in @code{PATH}. The @command{cc} command in
f85b8d1a 3618@file{/usr/ucb} uses libraries which have bugs.
b8df899a
JM
3619
3620@html
b8db17af 3621<hr />
b8df899a
JM
3622@end html
3623@heading @anchor{vax-dec-ultrix}vax-dec-ultrix
7ba4ca63 3624Don't try compiling with VAX C (@command{vcc}). It produces incorrect code
b8df899a
JM
3625in some cases (for example, when @code{alloca} is used).
3626
4977bab6
ZW
3627@html
3628<hr />
3629@end html
3630@heading @anchor{*-*-vxworks*}*-*-vxworks*
3631Support for VxWorks is in flux. At present GCC supports @emph{only} the
3632very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC.
3633We welcome patches for other architectures supported by VxWorks 5.5.
3634Support for VxWorks AE would also be welcome; we believe this is merely
3635a matter of writing an appropriate ``configlette'' (see below). We are
3636not interested in supporting older, a.out or COFF-based, versions of
3637VxWorks in GCC 3.
3638
3639VxWorks comes with an older version of GCC installed in
3640@file{@var{$WIND_BASE}/host}; we recommend you do not overwrite it.
3641Choose an installation @var{prefix} entirely outside @var{$WIND_BASE}.
3642Before running @command{configure}, create the directories @file{@var{prefix}}
3643and @file{@var{prefix}/bin}. Link or copy the appropriate assembler,
3644linker, etc. into @file{@var{prefix}/bin}, and set your @var{PATH} to
3645include that directory while running both @command{configure} and
3646@command{make}.
3647
3648You must give @command{configure} the
3649@option{--with-headers=@var{$WIND_BASE}/target/h} switch so that it can
3650find the VxWorks system headers. Since VxWorks is a cross compilation
3651target only, you must also specify @option{--target=@var{target}}.
3652@command{configure} will attempt to create the directory
3653@file{@var{prefix}/@var{target}/sys-include} and copy files into it;
3654make sure the user running @command{configure} has sufficient privilege
3655to do so.
3656
3657GCC's exception handling runtime requires a special ``configlette''
3658module, @file{contrib/gthr_supp_vxw_5x.c}. Follow the instructions in
3659that file to add the module to your kernel build. (Future versions of
daf2f129 3660VxWorks will incorporate this module.)
4977bab6 3661
7e081a0c
AJ
3662@html
3663<hr />
3664@end html
3665@heading @anchor{x86_64-*-*}x86_64-*-*, amd64-*-*
3666
3667GCC supports the x86-64 architecture implemented by the AMD64 processor
3668(amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD.
3669On GNU/Linux the default is a bi-arch compiler which is able to generate
3670both 64-bit x86-64 and 32-bit x86 code (via the @option{-m32} switch).
3671
fd29f6ea 3672@html
b8db17af 3673<hr />
fd29f6ea
BW
3674@end html
3675@heading @anchor{xtensa-*-elf}xtensa-*-elf
3676
3677This target is intended for embedded Xtensa systems using the
3678@samp{newlib} C library. It uses ELF but does not support shared
3679objects. Designed-defined instructions specified via the
3680Tensilica Instruction Extension (TIE) language are only supported
3681through inline assembly.
3682
3683The Xtensa configuration information must be specified prior to
e677f70c 3684building GCC@. The @file{include/xtensa-config.h} header
fd29f6ea
BW
3685file contains the configuration information. If you created your
3686own Xtensa configuration with the Xtensa Processor Generator, the
3687downloaded files include a customized copy of this header file,
3688which you can use to replace the default header file.
3689
3690@html
b8db17af 3691<hr />
fd29f6ea
BW
3692@end html
3693@heading @anchor{xtensa-*-linux*}xtensa-*-linux*
3694
3695This target is for Xtensa systems running GNU/Linux. It supports ELF
3696shared objects and the GNU C library (glibc). It also generates
3697position-independent code (PIC) regardless of whether the
3698@option{-fpic} or @option{-fPIC} options are used. In other
f282ffb3 3699respects, this target is the same as the
fd29f6ea
BW
3700@uref{#xtensa-*-elf,,@samp{xtensa-*-elf}} target.
3701
f42974dc 3702@html
b8db17af 3703<hr />
f42974dc 3704@end html
57694e40 3705@heading @anchor{windows}Microsoft Windows (32-bit)
f42974dc 3706
ccc1ce6e 3707A port of GCC 2.95.2 and 3.x is included with the
f42974dc
DW
3708@uref{http://www.cygwin.com/,,Cygwin environment}.
3709
3710Current (as of early 2001) snapshots of GCC will build under Cygwin
3711without modification.
3712
ccc1ce6e
CF
3713GCC does not currently build with Microsoft's C++ compiler and there
3714are no plans to make it do so.
3715
f42974dc 3716@html
b8db17af 3717<hr />
f42974dc 3718@end html
ef88b07d 3719@heading @anchor{os2}OS/2
f42974dc
DW
3720
3721GCC does not currently support OS/2. However, Andrew Zabolotny has been
14976c58 3722working on a generic OS/2 port with pgcc. The current code can be found
f42974dc
DW
3723at @uref{http://www.goof.com/pcg/os2/,,http://www.goof.com/pcg/os2/}.
3724
f9047ed3 3725An older copy of GCC 2.8.1 is included with the EMX tools available at
f42974dc
DW
3726@uref{ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/,,
3727ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/}.
3728
3729@html
b8db17af 3730<hr />
f42974dc 3731@end html
ef88b07d 3732@heading @anchor{older}Older systems
f9047ed3
JM
3733
3734GCC contains support files for many older (1980s and early
37351990s) Unix variants. For the most part, support for these systems
3736has not been deliberately removed, but it has not been maintained for
c7bdf0a6 3737several years and may suffer from bitrot.
f9047ed3 3738
c7bdf0a6 3739Starting with GCC 3.1, each release has a list of ``obsoleted'' systems.
9340544b
ZW
3740Support for these systems is still present in that release, but
3741@command{configure} will fail unless the @option{--enable-obsolete}
c7bdf0a6
ZW
3742option is given. Unless a maintainer steps forward, support for these
3743systems will be removed from the next release of GCC@.
f9047ed3
JM
3744
3745Support for old systems as hosts for GCC can cause problems if the
3746workarounds for compiler, library and operating system bugs affect the
161d7b59 3747cleanliness or maintainability of the rest of GCC@. In some cases, to
f9047ed3
JM
3748bring GCC up on such a system, if still possible with current GCC, may
3749require first installing an old version of GCC which did work on that
c7bdf0a6
ZW
3750system, and using it to compile a more recent GCC, to avoid bugs in the
3751vendor compiler. Old releases of GCC 1 and GCC 2 are available in the
3752@file{old-releases} directory on the @uref{../mirrors.html,,GCC mirror
3753sites}. Header bugs may generally be avoided using
3754@command{fixincludes}, but bugs or deficiencies in libraries and the
3755operating system may still cause problems.
3756
3757Support for older systems as targets for cross-compilation is less
3758problematic than support for them as hosts for GCC; if an enthusiast
3759wishes to make such a target work again (including resurrecting any of
3760the targets that never worked with GCC 2, starting from the last CVS
3761version before they were removed), patches
3762@uref{../contribute.html,,following the usual requirements} would be
3763likely to be accepted, since they should not affect the support for more
3764modern targets.
f9047ed3
JM
3765
3766For some systems, old versions of GNU binutils may also be useful,
021c4bfd 3767and are available from @file{pub/binutils/old-releases} on
f42974dc 3768@uref{http://sources.redhat.com/mirrors.html,,sources.redhat.com mirror sites}.
f9047ed3
JM
3769
3770Some of the information on specific systems above relates to
3771such older systems, but much of the information
3772about GCC on such systems (which may no longer be applicable to
f42974dc 3773current GCC) is to be found in the GCC texinfo manual.
f9047ed3 3774
f42974dc 3775@html
b8db17af 3776<hr />
f42974dc 3777@end html
250d5688 3778@heading @anchor{elf_targets}all ELF targets (SVR4, Solaris 2, etc.)
f42974dc 3779
38209993
LG
3780C++ support is significantly better on ELF targets if you use the
3781@uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of
3782inlines, vtables and template instantiations will be discarded
3783automatically.
f42974dc
DW
3784
3785
3786@html
b8db17af 3787<hr />
f42974dc
DW
3788<p>
3789@end html
3790@ifhtml
3791@uref{./index.html,,Return to the GCC Installation page}
3792@end ifhtml
3793@end ifset
3794
73e2155a
JM
3795@c ***Old documentation******************************************************
3796@ifset oldhtml
3797@include install-old.texi
3798@html
b8db17af 3799<hr />
73e2155a
JM
3800<p>
3801@end html
3802@ifhtml
3803@uref{./index.html,,Return to the GCC Installation page}
3804@end ifhtml
3805@end ifset
3806
aed5964b
JM
3807@c ***GFDL********************************************************************
3808@ifset gfdlhtml
3809@include fdl.texi
3810@html
b8db17af 3811<hr />
aed5964b
JM
3812<p>
3813@end html
3814@ifhtml
3815@uref{./index.html,,Return to the GCC Installation page}
3816@end ifhtml
3817@end ifset
3818
f42974dc
DW
3819@c ***************************************************************************
3820@c Part 6 The End of the Document
3821@ifinfo
3822@comment node-name, next, previous, up
aed5964b 3823@node Concept Index, , GNU Free Documentation License, Top
f42974dc
DW
3824@end ifinfo
3825
3826@ifinfo
3827@unnumbered Concept Index
3828
3829@printindex cp
3830
3831@contents
3832@end ifinfo
3833@bye