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