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