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