OSDN Git Service

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