@c %**end of header
@c @end ifnothtml
+@include gcc-common.texi
+
@c Specify title for specific html page
@ifset indexhtml
@settitle Installing GCC
@end ifset
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-@c 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+@c 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
@c IMPORTANT: whenever you modify this file, run `install.texi2html' to
@c Part 2 Summary Description and Copyright
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@sp 1
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
@c Part 3 Titlepage and Copyright
@titlepage
-@sp 10
-@comment The title is printed in a large font.
-@center @titlefont{Installing GCC}
+@title Installing GCC
+@versionsubtitle
@c The following two commands start the copyright page.
@page
@insertcopying
@end titlepage
-@c Part 4 Top node and Master Menu
+@c Part 4 Top node, Master Menu, and/or Table of Contents
@ifinfo
@node Top, , , (dir)
@comment node-name, next, Previous, up
@end menu
@end ifinfo
+@iftex
+@contents
+@end iftex
+
@c Part 5 The Body of the Document
@c ***Installing GCC**********************************************************
@ifnothtml
@option{--with-gmp} configure option. See also
@option{--with-gmp-lib} and @option{--with-gmp-include}.
-@item MPFR Library version 2.2.1 (or later)
+@item MPFR Library version 2.3.0 (or later)
Necessary to build GCC. It can be downloaded from
@uref{http://www.mpfr.org/}. The version of MPFR that is bundled with
@heading Tools/packages necessary for modifying GCC
@table @asis
-@item autoconf versions 2.13 and 2.59
+@item autoconf version 2.59
@itemx GNU m4 version 1.4 (or later)
Necessary when modifying @file{configure.ac}, @file{aclocal.m4}, etc.@:
-to regenerate @file{configure} and @file{config.in} files. Most
-directories require autoconf 2.59 (exactly), but the toplevel
-still requires autoconf 2.13 (exactly).
+to regenerate @file{configure} and @file{config.in} files.
@item automake version 1.9.6
@file{Makefile.tpl} and @file{Makefile.def}.
@item GNU Bison version 1.28 (or later)
-Berkeley @command{yacc} (@command{byacc}) is also reported to work other
-than for GCJ.
-Necessary when modifying @file{*.y} files.
+Necessary when modifying @file{*.y} files. Necessary to build the
+@code{treelang} front end (which is not enabled by default) from a
+checkout of the SVN repository; the generated files are not in the
+repository. They are included in releases.
-Necessary to build GCC during development because the generated output
-files are not included in the SVN repository. They are included in
-releases.
+Berkeley @command{yacc} (@command{byacc}) has been reported to work
+as well.
@item Flex version 2.5.4 (or later)
% @var{srcdir}/configure [@var{options}] [@var{target}]
@end smallexample
+@heading Distributor options
+
+If you will be distributing binary versions of GCC, with modifications
+to the source code, you should use the options described in this
+section to make clear that your version contains modifications.
+
+@table @code
+@item --with-pkgversion=@var{version}
+Specify a string that identifies your package. You may wish
+to include a build number or build date. This version string will be
+included in the output of @command{gcc --version}. This suffix does
+not replace the default version string, only the @samp{GCC} part.
+
+The default value is @samp{GCC}.
+
+@item --with-bugurl=@var{url}
+Specify the URL that users should visit if they wish to report a bug.
+You are of course welcome to forward bugs reported to you to the FSF,
+if you determine that they are not bugs in your modifications.
+
+The default value refers to the FSF's GCC bug tracker.
+
+@end table
@heading Target specification
@itemize @bullet
@item --disable-multilib
Specify that multiple target
libraries to support different target variants, calling
-conventions, etc should not be built. The default is to build a
+conventions, etc.@: should not be built. The default is to build a
predefined set of them.
Some targets provide finer-grained control over which multilibs are built
Division by zero checks use the break instruction.
@end table
+@c If you make --with-llsc the default for additional targets,
+@c update the --with-llsc description in the MIPS section below.
+
+@item --with-llsc
+On MIPS targets, make @option{-mllsc} the default when no
+@option{-mno-lsc} option is passed. This is the default for
+Linux-based targets, as the kernel will emulate them if the ISA does
+not provide them.
+
+@item --without-llsc
+On MIPS targets, make @option{-mno-llsc} the default when no
+@option{-mllsc} option is passed.
+
@item --enable-__cxa_atexit
Define if you want to use __cxa_atexit, rather than atexit, to
register C++ destructors for local statics and global objects.
This is essential for fully standards-compliant handling of
destructors, but requires __cxa_atexit in libc. This option is currently
only available on systems with GNU libc. When enabled, this will cause
-@option{-fuse-cxa-exit} to be passed by default.
+@option{-fuse-cxa-atexit} to be passed by default.
@item --enable-target-optspace
Specify that target
work anymore, as those language sub-directories might not have been
configured!
+@item --enable-stage1-languages=@var{lang1},@var{lang2},@dots{}
+Specify that a particular subset of compilers and their runtime
+libraries should be built with the system C compiler during stage 1 of
+the bootstrap process, rather than only in later stages with the
+bootstrapped C compiler. The list of valid values is the same as for
+@option{--enable-languages}, and the option @code{all} will select all
+of the languages enabled by @option{--enable-languages}. This option is
+primarily useful for GCC development; for instance, when a development
+version of the compiler cannot bootstrap due to compiler bugs, or when
+one is debugging front ends other than the C front end. When this
+option is used, one can then build the target libraries for the
+specified languages with the stage-1 compiler by using @command{make
+stage1-bubble all-target}, or run the testsuite on the stage-1 compiler
+for the specified languages using @command{make stage1-start check-gcc}.
+
@item --disable-libada
Specify that the run-time libraries and tools used by GNAT should not
be built. This can be useful for debugging, or for compatibility with
all), @samp{all} (all but @samp{valgrind}), @samp{release} (cheapest
checks @samp{assert,runtime}) or @samp{none} (same as @samp{no}).
Individual checks can be enabled with these flags @samp{assert},
-@samp{fold}, @samp{gc}, @samp{gcac} @samp{misc}, @samp{rtl},
+@samp{df}, @samp{fold}, @samp{gc}, @samp{gcac} @samp{misc}, @samp{rtl},
@samp{rtlflag}, @samp{runtime}, @samp{tree}, and @samp{valgrind}.
The @samp{valgrind} check requires the external @command{valgrind}
simulator, available from @uref{http://valgrind.org/}. The
-@samp{rtl}, @samp{gcac} and @samp{valgrind} checks are very expensive.
+@samp{df}, @samp{rtl}, @samp{gcac} and @samp{valgrind} checks are very expensive.
To disable all checking, @samp{--disable-checking} or
@samp{--enable-checking=none} must be explicitly requested. Disabling
assertions will make the compiler and runtime slightly faster but
forward to maintain the port.
@item --enable-decimal-float
+@itemx --enable-decimal-float=yes
+@itemx --enable-decimal-float=no
+@itemx --enable-decimal-float=bid
+@itemx --enable-decimal-float=dpd
@itemx --disable-decimal-float
-Enable (or disable) support for the C decimal floating point
-extension. This is enabled by default only on PowerPC GNU/Linux
-systems. Other systems may also support it, but require the user to
-specifically enable it.
+Enable (or disable) support for the C decimal floating point extension
+that is in the IEEE 754R extension to the IEEE754 floating point
+standard. This is enabled by default only on PowerPC, i386, and
+x86_64 GNU/Linux systems. Other systems may also support it, but
+require the user to specifically enable it. You can optionally
+control which decimal floating point format is used (either @samp{bid}
+or @samp{dpd}). The @samp{bid} (binary integer decimal) format is
+default on i386 and x86_64 systems, and the @samp{dpd} (densely packed
+decimal) format is default on PowerPC systems.
+
+@item --enable-fixed-point
+@itemx --disable-fixed-point
+Enable (or disable) support for C fixed-point arithmetic.
+This option is enabled by default for some targets (such as MIPS) which
+have hardware-support for fixed-point operations. On other targets, you
+may enable this option manually.
@item --with-long-double-128
Specify if @code{long double} type should be 128-bit by default on selected
shorthand assumptions are not correct, you can use the explicit
include and lib options directly.
+@item --with-debug-prefix-map=@var{map}
+Convert source directory names using @option{-fdebug-prefix-map} when
+building runtime libraries. @samp{@var{map}} is a space-separated
+list of maps of the form @samp{@var{old}=@var{new}}.
+
@end table
@subheading Cross-Compiler-Specific Options
@item --disable-jvmpi
Disable JVMPI support.
+@item --disable-libgcj-bc
+Disable BC ABI compilation of certain parts of libgcj. By default,
+some portions of libgcj are compiled with @option{-findirect-dispatch}
+@option{-fno-indirect-classes}. This allows them to be overridden at
+runtime.
+
+If @option{--disable-libgcj-bc} is specified, libgcj is built without
+these options. This makes it impossible to override portions of
+libgcj at runtime, but can make it easier to statically link to libgcj.
+
@item --with-ecos
Enable runtime eCos target support.
The solution is not to use such a directory for building GCC@.
-When building from SVN or snapshots, or if you modify parser sources,
-you need the Bison parser generator installed. If you do not modify
-parser sources, releases contain the Bison-generated files and you do
-not need Bison installed to build them.
+When building from SVN or snapshots and enabling the @code{treelang}
+front end, or if you modify @file{*.y} files, you need the Bison parser
+generator installed. If you do not modify @file{*.y} files, releases
+contain the Bison-generated files and you do not need Bison installed
+to build them. Note that most front ends now use hand-written parsers,
+which can be modified with no need for Bison.
+
+Similarly, when building from SVN or snapshots, or if you modify
+@file{*.l} files, you need the Flex lexical analyzer generator installed.
+There is still one Flex-based lexical analyzer (part of the build
+machinery, not of GCC itself) that is used even if you only build the
+C front end.
When building from SVN or snapshots, or if you modify Texinfo
documentation, you need version 4.4 or later of Texinfo installed if you
cross compiler. The installed native compiler needs to be GCC version
2.95 or later.
+If the cross compiler is to be built with support for the Java
+programming language and the ability to compile .java source files is
+desired, the installed native compiler used to build the cross
+compiler needs to be the same GCC version as the cross compiler. In
+addition the cross compiler needs to be configured with
+@option{--with-ecj-jar=@dots{}}.
+
Assuming you have already installed a native copy of GCC and configured
your cross compiler, issue the command @command{make}, which performs the
following steps:
installed, the build will fail unless @option{--enable-languages} is
used to disable building the Ada front end.
+@env{ADA_INCLUDE_PATH} and @env{ADA_OBJECT_PATH} environment variables
+must not be set when building the Ada compiler, the Ada tools, or the
+Ada runtime libraries. You can check that your build environment is clean
+by verifying that @samp{gnatls -v} lists only one explicit path in each
+section.
+
@section Building with profile feedback
It is possible to use profile feedback to optimize the compiler itself. This
@samp{WARNING: Couldn't find the global config file.} or
@samp{WARNING: Couldn't find tool init file} that can be ignored.
+If you are testing a cross-compiler, you may want to run the testsuite
+on a simulator as described at @uref{http://gcc.gnu.org/simtest-howto.html}.
+
@section How can you run the testsuite on selected tests?
In order to run sets of tests selectively, there are targets
in the @file{@var{target}/libjava/testsuite} directory in
the build tree.
-The @uref{http://sources.redhat.com/mauve/,,Mauve Project} provides
+The @uref{http://sourceware.org/mauve/,,Mauve Project} provides
a suite of tests for the Java Class Libraries. This suite can be run
as part of libgcj testing by placing the Mauve tree within the libjava
testsuite at @file{libjava/testsuite/libjava.mauve/mauve}, or by
Microsoft Windows:
@itemize
@item
-The @uref{http://sources.redhat.com/cygwin/,,Cygwin} project;
+The @uref{http://sourceware.org/cygwin/,,Cygwin} project;
@item
The @uref{http://www.mingw.org/,,MinGW} project.
@end itemize
@item
@uref{#bfin,,Blackfin}
@item
-@uref{#c4x,,c4x}
-@item
@uref{#dos,,DOS}
@item
@uref{#x-x-freebsd,,*-*-freebsd*}
@item
@uref{#m68k-hp-hpux,,m68k-hp-hpux}
@item
+@uref{#m68k-uclinux,,m68k-uclinux}
+@item
@uref{#mips-x-x,,mips-*-*}
@item
@uref{#mips-sgi-irix5,,mips-sgi-irix5}
@html
<hr />
@end html
-@heading @anchor{c4x}c4x
-
-Texas Instruments TMS320C3x and TMS320C4x Floating Point Digital Signal
-Processors. These are used in embedded applications. There are no
-standard Unix configurations.
-@ifnothtml
-@xref{TMS320C3x/C4x Options,, TMS320C3x/C4x Options, gcc, Using the
-GNU Compiler Collection (GCC)},
-@end ifnothtml
-@ifhtml
-See ``TMS320C3x/C4x Options'' in the main manual
-@end ifhtml
-for the list of supported MCU types.
-
-GCC can be configured as a cross compiler for both the C3x and C4x
-architectures on the same system. Use @samp{configure --target=c4x
---enable-languages="c,c++"} to configure.
-
-
-Further installation notes and other useful information about C4x tools
-can also be obtained from:
-
-@itemize @bullet
-@item
-@uref{http://www.elec.canterbury.ac.nz/c4x/,,http://www.elec.canterbury.ac.nz/c4x/}
-@end itemize
-
-@html
-<hr />
-@end html
@heading @anchor{cris}CRIS
CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
@end html
@heading @anchor{x-x-linux-gnu}*-*-linux-gnu
-Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present
+Versions of libstdc++-v3 starting with 3.2.1 require bug fixes present
in glibc 2.2.5 and later. More information is available in the
libstdc++-v3 documentation.
<hr />
@end html
@heading @anchor{m68k-x-x}m68k-*-*
-You can specify a default target using @option{--with-cpu=@var{target}}.
-This @var{target} can either be a @option{-mcpu} argument or one of the
-following values: @samp{m68000}, @samp{m68010}, @samp{m68020}, @samp{m68030},
+By default, @samp{m68k-*-aout}, @samp{m68k-*-coff*},
+@samp{m68k-*-elf*}, @samp{m68k-*-rtems} and @samp{m68k-*-uclinux}
+build libraries for both M680x0 and ColdFire processors. If you only
+need the M680x0 libraries, you can omit the ColdFire ones by passing
+@option{--with-arch=m68k} to @command{configure}. Alternatively, you
+can omit the M680x0 libraries by passing @option{--with-arch=cf} to
+@command{configure}. These targets default to 5206 code when
+configured with @option{--with-arch=cf} and 68020 code otherwise.
+
+The @samp{m68k-*-linux-gnu}, @samp{m68k-*-netbsd} and
+@samp{m68k-*-openbsd} targets also support the @option{--with-arch}
+option. They will generate ColdFire CFV4e code when configured with
+@option{--with-arch=cf} and 68020 code otherwise.
+
+You can override the default processors listed above by configuring
+with @option{--with-cpu=@var{target}}. This @var{target} can either
+be a @option{-mcpu} argument or one of the following values:
+@samp{m68000}, @samp{m68010}, @samp{m68020}, @samp{m68030},
@samp{m68040}, @samp{m68060}, @samp{m68020-40} and @samp{m68020-60}.
+@html
+<hr />
+@end html
@heading @anchor{m68k-hp-hpux}m68k-hp-hpux
HP 9000 series 300 or 400 running HP-UX@. HP-UX version 8.0 has a bug in
the assembler that prevents compilation of GCC@. This
@html
<hr />
@end html
+@heading @anchor{m68k-x-uclinux}m68k-*-uclinux
+GCC 4.3 changed the uClinux configuration so that it uses the
+@samp{m68k-linux-gnu} ABI rather than the @samp{m68k-elf} ABI.
+It also added improved support for C++ and flat shared libraries,
+both of which were ABI changes. However, you can still use the
+original ABI by configuring for @samp{m68k-uclinuxoldabi} or
+@samp{m68k-@var{vendor}-uclinuxoldabi}.
+
+@html
+<hr />
+@end html
@heading @anchor{mips-x-x}mips-*-*
If on a MIPS system you get an error message saying ``does not have gp
sections for all it's [sic] sectons [sic]'', don't worry about it. This
@samp{mips*-*-linux*} target continues to use the MIPS II routines. More
work on this is expected in future releases.
+@c If you make --with-llsc the default for another target, please also
+@c update the description of the --with-llsc option.
+
+The built-in @code{__sync_*} functions are available on MIPS II and
+later systems and others that support the @samp{ll}, @samp{sc} and
+@samp{sync} instructions. This can be overridden by passing
+@option{--with-llsc} or @option{--without-llsc} when configuring GCC.
+Since the Linux kernel emulates these instructions if they are
+missing, the default for @samp{mips*-*-linux*} targets is
+@option{--with-llsc}. The @option{--with-llsc} and
+@option{--without-llsc} configure options may be overridden at compile
+time by passing the @option{-mllsc} or @option{-mno-llsc} options to
+the compiler.
+
MIPS systems check for division by zero (unless
@option{-mno-check-zero-division} is passed to the compiler) by
generating either a conditional trap or a break instruction. Using
anything but a MIPS. It does work to cross compile for a MIPS
if you use the GNU assembler and linker.
-The linker from GNU binutils versions prior to 2.17 has a bug which
-causes the runtime linker stubs in @file{libgcj.so} to be incorrectly
-generated. If you want to use libgcj, either use binutils 2.17 or
-later to build it or export @samp{LD_BIND_NOW=1} in your runtime environment.
+The assembler from GNU binutils 2.17 and earlier has a bug in the way
+it sorts relocations for REL targets (o32, o64, EABI). This can cause
+bad code to be generated for simple C++ programs. Also the linker
+from GNU binutils versions prior to 2.17 has a bug which causes the
+runtime linker stubs in very large programs, like @file{libgcj.so}, to
+be incorrectly generated. Binutils CVS snapshots and releases made
+after Nov. 9, 2006 are thought to be free from both of these problems.
@html
<hr />
GNU binutils 2.15 or later. You may also use GNU @command{ld}, but
this is not required and currently causes some problems with Ada.
-The @option{--enable-threads} option doesn't currently work, a patch is
-in preparation for a future release. The @option{--enable-libgcj}
+The @option{--enable-libgcj}
option is disabled by default: IRIX 6 uses a very low default limit
(20480) for the command line length. Although @command{libtool} contains a
workaround for this problem, at least the N64 @samp{libgcj} is known not
single bug. It has been fixed on the 2.15 branch in the CVS repository.
You can obtain a working version by checking out the binutils-2_15-branch
from the CVS repository or applying the patch
-@uref{http://sources.redhat.com/ml/binutils-cvs/2004-09/msg00036.html} to the
+@uref{http://sourceware.org/ml/binutils-cvs/2004-09/msg00036.html} to the
release.
We recommend using GNU binutils 2.16 or later in conjunction with GCC 4.x,
GCC will build under Cygwin without modification; it does not build
with Microsoft's C++ compiler and there are no plans to make it do so.
+For MinGW, GCC will build with and support only MinGW runtime 3.12 and later.
+Earlier versions of headers are incompatible with the new default semantics
+of @code{extern inline} in @code{-std=c99} and @code{-std=gnu99} modes.
+
@html
<hr />
@end html
For some systems, old versions of GNU binutils may also be useful,
and are available from @file{pub/binutils/old-releases} on
-@uref{http://sources.redhat.com/mirrors.html,,sources.redhat.com mirror sites}.
+@uref{http://sourceware.org/mirrors.html,,sourceware.org mirror sites}.
Some of the information on specific systems above relates to
such older systems, but much of the information