comparison gcc/doc/install.texi @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
70 @end ifnothtml 70 @end ifnothtml
71 71
72 @c Part 2 Summary Description and Copyright 72 @c Part 2 Summary Description and Copyright
73 @copying 73 @copying
74 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 74 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
75 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 75 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
76 2008 Free Software Foundation, Inc. 76 2010 Free Software Foundation, Inc.
77 @sp 1 77 @sp 1
78 Permission is granted to copy, distribute and/or modify this document 78 Permission is granted to copy, distribute and/or modify this document
79 under the terms of the GNU Free Documentation License, Version 1.2 or 79 under the terms of the GNU Free Documentation License, Version 1.3 or
80 any later version published by the Free Software Foundation; with no 80 any later version published by the Free Software Foundation; with no
81 Invariant Sections, the Front-Cover texts being (a) (see below), and 81 Invariant Sections, the Front-Cover texts being (a) (see below), and
82 with the Back-Cover Texts being (b) (see below). A copy of the 82 with the Back-Cover Texts being (b) (see below). A copy of the
83 license is included in the section entitled ``@uref{./gfdl.html,,GNU 83 license is included in the section entitled ``@uref{./gfdl.html,,GNU
84 Free Documentation License}''. 84 Free Documentation License}''.
330 in your default library search path. See also @option{--with-mpc-lib} 330 in your default library search path. See also @option{--with-mpc-lib}
331 and @option{--with-mpc-include}. Alternatively, if an MPC source 331 and @option{--with-mpc-include}. Alternatively, if an MPC source
332 distribution is found in a subdirectory of your GCC sources named 332 distribution is found in a subdirectory of your GCC sources named
333 @file{mpc}, it will be built together with GCC@. 333 @file{mpc}, it will be built together with GCC@.
334 334
335 @item Parma Polyhedra Library (PPL) version 0.10 335 @item Parma Polyhedra Library (PPL) version 0.11
336 336
337 Necessary to build GCC with the Graphite loop optimizations. 337 Necessary to build GCC with the Graphite loop optimizations.
338 It can be downloaded from @uref{http://www.cs.unipr.it/ppl/Download/}. 338 It can be downloaded from @uref{http://www.cs.unipr.it/ppl/Download/}.
339 339
340 The @option{--with-ppl} configure option should be used if PPL is not 340 The @option{--with-ppl} configure option should be used if PPL is not
341 installed in your default library search path. 341 installed in your default library search path.
342 342
343 @item CLooG-PPL version 0.15 343 @item CLooG-PPL version 0.15 or CLooG 0.16
344 344
345 Necessary to build GCC with the Graphite loop optimizations. It can 345 Necessary to build GCC with the Graphite loop optimizations. There
346 be downloaded from @uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/}. 346 are two versions available. CLooG-PPL 0.15 as well as CLooG 0.16.
347 The code in @file{cloog-ppl-0.15.tar.gz} comes from a branch of CLooG 347 The former is the default right now. It can be downloaded from
348 available from @uref{http://repo.or.cz/w/cloog-ppl.git}. CLooG-PPL 348 @uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/} as
349 should be configured with @option{--with-ppl}. 349 @file{cloog-ppl-0.15.tar.gz}.
350 350
351 The @option{--with-cloog} configure option should be used if CLooG is 351 CLooG 0.16 support is still in testing stage, but will be the
352 not installed in your default library search path. 352 default in future GCC releases. It is also available at
353 @uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/} as
354 @file{cloog-0.16.1.tar.gz}. To use it add the additional configure
355 option @option{--enable-cloog-backend=isl}. Even if CLooG 0.16
356 does not use PPL, PPL is still required for Graphite.
357
358 In both cases @option{--with-cloog} configure option should be used
359 if CLooG is not installed in your default library search path.
353 360
354 @item @command{jar}, or InfoZIP (@command{zip} and @command{unzip}) 361 @item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})
355 362
356 Necessary to build libgcj, the GCJ runtime. 363 Necessary to build libgcj, the GCJ runtime.
357
358 @item libelf version 0.8.12 (or later)
359
360 Necessary to build link-time optimization (LTO) support. It can be
361 downloaded from @uref{http://www.mr511.de/software/libelf-0.8.12.tar.gz},
362 though it is commonly available in several systems. The version in
363 IRIX 6.5 doesn't work since it lacks @file{gelf.h}. The version in
364 Solaris 2 does work.
365
366 The @option{--with-libelf} configure option should be used if libelf is
367 not installed in your default library search patch.
368 364
369 @end table 365 @end table
370 366
371 @heading Tools/packages necessary for modifying GCC 367 @heading Tools/packages necessary for modifying GCC
372 @table @asis 368 @table @asis
454 @item Perl version 5.6.1 (or later) 450 @item Perl version 5.6.1 (or later)
455 451
456 Necessary when regenerating @file{Makefile} dependencies in libiberty. 452 Necessary when regenerating @file{Makefile} dependencies in libiberty.
457 Necessary when regenerating @file{libiberty/functions.texi}. 453 Necessary when regenerating @file{libiberty/functions.texi}.
458 Necessary when generating manpages from Texinfo manuals. 454 Necessary when generating manpages from Texinfo manuals.
459 Necessary when targetting Darwin, building libstdc++, 455 Necessary when targetting Darwin, building @samp{libstdc++},
460 and not using @option{--disable-symvers}. 456 and not using @option{--disable-symvers}.
457 Necessary when targetting Solaris 2 with Sun @command{ld}, building
458 @samp{libstdc++}, and not using @option{--disable-symvers}. A helper
459 scripts needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
460 included in Solaris@tie{}8. The bundled @command{perl} in Solaris@tie{}9 and up
461 works.
461 Used by various scripts to generate some files included in SVN (mainly 462 Used by various scripts to generate some files included in SVN (mainly
462 Unicode-related and rarely changing) from source tables. 463 Unicode-related and rarely changing) from source tables.
463 464
464 @item GNU diffutils version 2.7 (or later) 465 @item GNU diffutils version 2.7 (or later)
465 466
627 @end ignore 628 @end ignore
628 629
629 To configure GCC: 630 To configure GCC:
630 631
631 @smallexample 632 @smallexample
632 % mkdir @var{objdir} 633 % mkdir @var{objdir}
633 % cd @var{objdir} 634 % cd @var{objdir}
634 % @var{srcdir}/configure [@var{options}] [@var{target}] 635 % @var{srcdir}/configure [@var{options}] [@var{target}]
635 @end smallexample 636 @end smallexample
636 637
637 @heading Distributor options 638 @heading Distributor options
638 639
639 If you will be distributing binary versions of GCC, with modifications 640 If you will be distributing binary versions of GCC, with modifications
888 If a list of packages is given as an argument, build shared libraries 889 If a list of packages is given as an argument, build shared libraries
889 only for the listed packages. For other packages, only static libraries 890 only for the listed packages. For other packages, only static libraries
890 will be built. Package names currently recognized in the GCC tree are 891 will be built. Package names currently recognized in the GCC tree are
891 @samp{libgcc} (also known as @samp{gcc}), @samp{libstdc++} (not 892 @samp{libgcc} (also known as @samp{gcc}), @samp{libstdc++} (not
892 @samp{libstdc++-v3}), @samp{libffi}, @samp{zlib}, @samp{boehm-gc}, 893 @samp{libstdc++-v3}), @samp{libffi}, @samp{zlib}, @samp{boehm-gc},
893 @samp{ada}, @samp{libada}, @samp{libjava} and @samp{libobjc}. 894 @samp{ada}, @samp{libada}, @samp{libjava}, @samp{libgo}, and @samp{libobjc}.
894 Note @samp{libiberty} does not support shared libraries at all. 895 Note @samp{libiberty} does not support shared libraries at all.
895 896
896 Use @option{--disable-shared} to build only static libraries. Note that 897 Use @option{--disable-shared} to build only static libraries. Note that
897 @option{--disable-shared} does not accept a list of package names as 898 @option{--disable-shared} does not accept a list of package names as
898 argument, only @option{--enable-shared} does. 899 argument, only @option{--enable-shared} does.
1050 @end smallexample 1051 @end smallexample
1051 1052
1052 Example 2: to configure a compiler for both SH4A and SH4AL-DSP, but with 1053 Example 2: to configure a compiler for both SH4A and SH4AL-DSP, but with
1053 only little endian SH4AL: 1054 only little endian SH4AL:
1054 @smallexample 1055 @smallexample
1055 --with-cpu=sh4a --with-endian=little,big --with-multilib-list=sh4al,!mb/m4al 1056 --with-cpu=sh4a --with-endian=little,big \
1057 --with-multilib-list=sh4al,!mb/m4al
1056 @end smallexample 1058 @end smallexample
1057 1059
1058 @item --with-endian=@var{endians} 1060 @item --with-endian=@var{endians}
1059 Specify what endians to use. 1061 Specify what endians to use.
1060 Currently only implemented for sh*-*-*. 1062 Currently only implemented for sh*-*-*.
1170 1172
1171 @item --with-mode=@var{mode} 1173 @item --with-mode=@var{mode}
1172 Specify if the compiler should default to @option{-marm} or @option{-mthumb}. 1174 Specify if the compiler should default to @option{-marm} or @option{-mthumb}.
1173 This option is only supported on ARM targets. 1175 This option is only supported on ARM targets.
1174 1176
1175 @item --with-fpmath=sse 1177 @item --with-fpmath=@var{isa}
1176 Specify if the compiler should default to @option{-msse2} and 1178 This options sets @option{-mfpmath=sse} by default and specifies the default
1177 @option{-mfpmath=sse}. This option is only supported on i386 and 1179 ISA for floating-point arithmetics. You can select either @samp{sse} which
1178 x86-64 targets. 1180 enables @option{-msse2} or @samp{avx} which enables @option{-mavx} by default.
1181 This option is only supported on i386 and x86-64 targets.
1179 1182
1180 @item --with-divide=@var{type} 1183 @item --with-divide=@var{type}
1181 Specify how the compiler should generate code for checking for 1184 Specify how the compiler should generate code for checking for
1182 division by zero. This option is only supported on the MIPS target. 1185 division by zero. This option is only supported on the MIPS target.
1183 The possibilities for @var{type} are: 1186 The possibilities for @var{type} are:
1222 This is essential for fully standards-compliant handling of 1225 This is essential for fully standards-compliant handling of
1223 destructors, but requires __cxa_atexit in libc. This option is currently 1226 destructors, but requires __cxa_atexit in libc. This option is currently
1224 only available on systems with GNU libc. When enabled, this will cause 1227 only available on systems with GNU libc. When enabled, this will cause
1225 @option{-fuse-cxa-atexit} to be passed by default. 1228 @option{-fuse-cxa-atexit} to be passed by default.
1226 1229
1230 @item --enable-indirect-function
1231 Define if you want to enable the @code{ifunc} attribute. This option is
1232 currently only available on systems with GNU libc on certain targets.
1233
1227 @item --enable-target-optspace 1234 @item --enable-target-optspace
1228 Specify that target 1235 Specify that target
1229 libraries should be optimized for code space instead of code speed. 1236 libraries should be optimized for code space instead of code speed.
1230 This is the default for the m32r platform. 1237 This is the default for the m32r platform.
1231 1238
1304 @file{gcc} directory of your GCC source tree:@* 1311 @file{gcc} directory of your GCC source tree:@*
1305 @smallexample 1312 @smallexample
1306 grep language= */config-lang.in 1313 grep language= */config-lang.in
1307 @end smallexample 1314 @end smallexample
1308 Currently, you can use any of the following: 1315 Currently, you can use any of the following:
1309 @code{all}, @code{ada}, @code{c}, @code{c++}, @code{fortran}, @code{java}, 1316 @code{all}, @code{ada}, @code{c}, @code{c++}, @code{fortran},
1310 @code{objc}, @code{obj-c++}. 1317 @code{go}, @code{java}, @code{objc}, @code{obj-c++}.
1311 Building the Ada compiler has special requirements, see below. 1318 Building the Ada compiler has special requirements, see below.
1312 If you do not pass this flag, or specify the option @code{all}, then all 1319 If you do not pass this flag, or specify the option @code{all}, then all
1313 default languages available in the @file{gcc} sub-tree will be configured. 1320 default languages available in the @file{gcc} sub-tree will be configured.
1314 Ada and Objective-C++ are not default languages; the rest are. 1321 Ada, Go and Objective-C++ are not default languages; the rest are.
1315 Re-defining @code{LANGUAGES} when calling @samp{make} @strong{does not}
1316 work anymore, as those language sub-directories might not have been
1317 configured!
1318 1322
1319 @item --enable-stage1-languages=@var{lang1},@var{lang2},@dots{} 1323 @item --enable-stage1-languages=@var{lang1},@var{lang2},@dots{}
1320 Specify that a particular subset of compilers and their runtime 1324 Specify that a particular subset of compilers and their runtime
1321 libraries should be built with the system C compiler during stage 1 of 1325 libraries should be built with the system C compiler during stage 1 of
1322 the bootstrap process, rather than only in later stages with the 1326 the bootstrap process, rather than only in later stages with the
1338 do a @samp{make -C gcc gnatlib_and_tools}. 1342 do a @samp{make -C gcc gnatlib_and_tools}.
1339 1343
1340 @item --disable-libssp 1344 @item --disable-libssp
1341 Specify that the run-time libraries for stack smashing protection 1345 Specify that the run-time libraries for stack smashing protection
1342 should not be built. 1346 should not be built.
1347
1348 @item --disable-libquadmath
1349 Specify that the GCC quad-precision math library should not be built.
1350 On some systems, the library is required to be linkable when building
1351 the Fortran front end, unless @option{--disable-libquadmath-support}
1352 is used.
1353
1354 @item --disable-libquadmath-support
1355 Specify that the Fortran front end and @code{libgfortran} do not add
1356 support for @code{libquadmath} on systems supporting it.
1343 1357
1344 @item --disable-libgomp 1358 @item --disable-libgomp
1345 Specify that the run-time libraries used by GOMP should not be built. 1359 Specify that the run-time libraries used by GOMP should not be built.
1346 1360
1347 @item --with-dwarf2 1361 @item --with-dwarf2
1551 @itemx --with-mpc-lib=@var{pathname} 1565 @itemx --with-mpc-lib=@var{pathname}
1552 If you do not have GMP (the GNU Multiple Precision library), the MPFR 1566 If you do not have GMP (the GNU Multiple Precision library), the MPFR
1553 library and/or the MPC library installed in a standard location and 1567 library and/or the MPC library installed in a standard location and
1554 you want to build GCC, you can explicitly specify the directory where 1568 you want to build GCC, you can explicitly specify the directory where
1555 they are installed (@samp{--with-gmp=@var{gmpinstalldir}}, 1569 they are installed (@samp{--with-gmp=@var{gmpinstalldir}},
1556 @samp{--with-mpfr=@var{mpfrinstalldir}}, 1570 @samp{--with-mpfr=@/@var{mpfrinstalldir}},
1557 @samp{--with-mpc=@var{mpcinstalldir}}). The 1571 @samp{--with-mpc=@/@var{mpcinstalldir}}). The
1558 @option{--with-gmp=@var{gmpinstalldir}} option is shorthand for 1572 @option{--with-gmp=@/@var{gmpinstalldir}} option is shorthand for
1559 @option{--with-gmp-lib=@var{gmpinstalldir}/lib} and 1573 @option{--with-gmp-lib=@/@var{gmpinstalldir}/lib} and
1560 @option{--with-gmp-include=@var{gmpinstalldir}/include}. Likewise the 1574 @option{--with-gmp-include=@/@var{gmpinstalldir}/include}. Likewise the
1561 @option{--with-mpfr=@var{mpfrinstalldir}} option is shorthand for 1575 @option{--with-mpfr=@/@var{mpfrinstalldir}} option is shorthand for
1562 @option{--with-mpfr-lib=@var{mpfrinstalldir}/lib} and 1576 @option{--with-mpfr-lib=@/@var{mpfrinstalldir}/lib} and
1563 @option{--with-mpfr-include=@var{mpfrinstalldir}/include}, also the 1577 @option{--with-mpfr-include=@/@var{mpfrinstalldir}/include}, also the
1564 @option{--with-mpc=@var{mpcinstalldir}} option is shorthand for 1578 @option{--with-mpc=@/@var{mpcinstalldir}} option is shorthand for
1565 @option{--with-mpc-lib=@var{mpcinstalldir}/lib} and 1579 @option{--with-mpc-lib=@/@var{mpcinstalldir}/lib} and
1566 @option{--with-mpc-include=@var{mpcinstalldir}/include}. If these 1580 @option{--with-mpc-include=@/@var{mpcinstalldir}/include}. If these
1567 shorthand assumptions are not correct, you can use the explicit 1581 shorthand assumptions are not correct, you can use the explicit
1568 include and lib options directly. 1582 include and lib options directly. You might also need to ensure the
1583 shared libraries can be found by the dynamic linker when building and
1584 using GCC, for example by setting the runtime shared library path
1585 variable (@env{LD_LIBRARY_PATH} on GNU/Linux and Solaris systems).
1586
1587 These flags are applicable to the host platform only. When building
1588 a cross compiler, they will not be used to configure target libraries.
1569 1589
1570 @item --with-ppl=@var{pathname} 1590 @item --with-ppl=@var{pathname}
1571 @itemx --with-ppl-include=@var{pathname} 1591 @itemx --with-ppl-include=@var{pathname}
1572 @itemx --with-ppl-lib=@var{pathname} 1592 @itemx --with-ppl-lib=@var{pathname}
1573 @itemx --with-cloog=@var{pathname} 1593 @itemx --with-cloog=@var{pathname}
1574 @itemx --with-cloog-include=@var{pathname} 1594 @itemx --with-cloog-include=@var{pathname}
1575 @itemx --with-cloog-lib=@var{pathname} 1595 @itemx --with-cloog-lib=@var{pathname}
1576 If you do not have PPL (the Parma Polyhedra Library) and the CLooG 1596 If you do not have PPL (the Parma Polyhedra Library) and the CLooG
1577 libraries installed in a standard location and you want to build GCC, 1597 libraries installed in a standard location and you want to build GCC,
1578 you can explicitly specify the directory where they are installed 1598 you can explicitly specify the directory where they are installed
1579 (@samp{--with-ppl=@var{pplinstalldir}}, 1599 (@samp{--with-ppl=@/@var{pplinstalldir}},
1580 @samp{--with-cloog=@var{clooginstalldir}}). The 1600 @samp{--with-cloog=@/@var{clooginstalldir}}). The
1581 @option{--with-ppl=@var{pplinstalldir}} option is shorthand for 1601 @option{--with-ppl=@/@var{pplinstalldir}} option is shorthand for
1582 @option{--with-ppl-lib=@var{pplinstalldir}/lib} and 1602 @option{--with-ppl-lib=@/@var{pplinstalldir}/lib} and
1583 @option{--with-ppl-include=@var{pplinstalldir}/include}. Likewise the 1603 @option{--with-ppl-include=@/@var{pplinstalldir}/include}. Likewise the
1584 @option{--with-cloog=@var{clooginstalldir}} option is shorthand for 1604 @option{--with-cloog=@/@var{clooginstalldir}} option is shorthand for
1585 @option{--with-cloog-lib=@var{clooginstalldir}/lib} and 1605 @option{--with-cloog-lib=@/@var{clooginstalldir}/lib} and
1586 @option{--with-cloog-include=@var{clooginstalldir}/include}. If these 1606 @option{--with-cloog-include=@/@var{clooginstalldir}/include}. If these
1587 shorthand assumptions are not correct, you can use the explicit 1607 shorthand assumptions are not correct, you can use the explicit
1588 include and lib options directly. 1608 include and lib options directly.
1609
1610 These flags are applicable to the host platform only. When building
1611 a cross compiler, they will not be used to configure target libraries.
1589 1612
1590 @item --with-host-libstdcxx=@var{linker-args} 1613 @item --with-host-libstdcxx=@var{linker-args}
1591 If you are linking with a static copy of PPL, you can use this option 1614 If you are linking with a static copy of PPL, you can use this option
1592 to specify how the linker should find the standard C++ library used 1615 to specify how the linker should find the standard C++ library used
1593 internally by PPL. Typical values of @var{linker-args} might be 1616 internally by PPL. Typical values of @var{linker-args} might be
1607 @option{--disable-bootstrap}. The default is the argument to 1630 @option{--disable-bootstrap}. The default is the argument to
1608 @option{--with-host-libstdcxx}, if specified. 1631 @option{--with-host-libstdcxx}, if specified.
1609 1632
1610 @item --with-boot-ldflags=@var{flags} 1633 @item --with-boot-ldflags=@var{flags}
1611 This option may be used to set linker flags to be used when linking 1634 This option may be used to set linker flags to be used when linking
1612 stage 2 and later when bootstrapping GCC. By default no special flags 1635 stage 2 and later when bootstrapping GCC. If neither --with-boot-libs
1613 are used. 1636 nor --with-host-libstdcxx is set to a value, then the default is
1637 @samp{-static-libstdc++ -static-libgcc}.
1614 1638
1615 @item --with-boot-libs=@var{libs} 1639 @item --with-boot-libs=@var{libs}
1616 This option may be used to set libraries to be used when linking stage 2 1640 This option may be used to set libraries to be used when linking stage 2
1617 and later when bootstrapping GCC. The default is the argument to 1641 and later when bootstrapping GCC. The default is the argument to
1618 @option{--with-host-libstdcxx}, if specified. 1642 @option{--with-host-libstdcxx}, if specified.
1636 static data members and inline function local statics. Enabled by 1660 static data members and inline function local statics. Enabled by
1637 default for a native toolchain with an assembler that accepts it and 1661 default for a native toolchain with an assembler that accepts it and
1638 GLIBC 2.11 or above, otherwise disabled. 1662 GLIBC 2.11 or above, otherwise disabled.
1639 1663
1640 @item --enable-lto 1664 @item --enable-lto
1665 @itemx --disable-lto
1641 Enable support for link-time optimization (LTO). This is enabled by 1666 Enable support for link-time optimization (LTO). This is enabled by
1642 default if a working libelf implementation is found (see 1667 default, and may be disabled using @option{--disable-lto}.
1643 @option{--with-libelf}). 1668
1644 1669 @item --with-plugin-ld=@var{pathname}
1645 @item --with-libelf=@var{pathname} 1670 Enable an alternate linker to be used at link-time optimization (LTO)
1646 @itemx --with-libelf-include=@var{pathname} 1671 link time when @option{-fuse-linker-plugin} is enabled.
1647 @itemx --with-libelf-lib=@var{pathname} 1672 This linker should have plugin support such as gold starting with
1648 If you do not have libelf installed in a standard location and you 1673 version 2.20 or GNU ld starting with version 2.21.
1649 want to enable support for link-time optimization (LTO), you can 1674 See @option{-fuse-linker-plugin} for details.
1650 explicitly specify the directory where libelf is installed
1651 (@samp{--with-libelf=@var{libelfinstalldir}}). The
1652 @option{--with-libelf=@var{libelfinstalldir}} option is shorthand for
1653 @option{--with-libelf-include=@var{libelfinstalldir}/include}
1654 @option{--with-libelf-lib=@var{libelfinstalldir}/lib}.
1655
1656 @item --enable-gold
1657 Enable support for using @command{gold} as the linker. If gold support is
1658 enabled together with @option{--enable-lto}, an additional directory
1659 @file{lto-plugin} will be built. The code in this directory is a
1660 plugin for gold that allows the link-time optimizer to extract object
1661 files with LTO information out of library archives. See
1662 @option{-flto} and @option{-fwhopr} for details.
1663 @end table 1675 @end table
1664 1676
1665 @subheading Cross-Compiler-Specific Options 1677 @subheading Cross-Compiler-Specific Options
1666 The following options only apply to building cross compilers. 1678 The following options only apply to building cross compilers.
1667 1679
1668 @table @code 1680 @table @code
1669 @item --with-sysroot 1681 @item --with-sysroot
1670 @itemx --with-sysroot=@var{dir} 1682 @itemx --with-sysroot=@var{dir}
1671 Tells GCC to consider @var{dir} as the root of a tree that contains a 1683 Tells GCC to consider @var{dir} as the root of a tree that contains
1672 (subset of) the root filesystem of the target operating system. 1684 (a subset of) the root filesystem of the target operating system.
1673 Target system headers, libraries and run-time object files will be 1685 Target system headers, libraries and run-time object files will be
1674 searched in there. More specifically, this acts as if 1686 searched in there. More specifically, this acts as if
1675 @option{--sysroot=@var{dir}} was added to the default options of the built 1687 @option{--sysroot=@var{dir}} was added to the default options of the built
1676 compiler. The specified directory is not copied into the 1688 compiler. The specified directory is not copied into the
1677 install tree, unlike the options @option{--with-headers} and 1689 install tree, unlike the options @option{--with-headers} and
1977 @item --disable-libarttest 1989 @item --disable-libarttest
1978 Do not try to compile and run a test libart program. 1990 Do not try to compile and run a test libart program.
1979 1991
1980 @end table 1992 @end table
1981 1993
1994 @subsubheading Overriding @command{configure} test results
1995
1996 Sometimes, it might be necessary to override the result of some
1997 @command{configure} test, for example in order to ease porting to a new
1998 system or work around a bug in a test. The toplevel @command{configure}
1999 script provides three variables for this:
2000
2001 @table @code
2002
2003 @item build_configargs
2004 @cindex @code{build_configargs}
2005 The contents of this variable is passed to all build @command{configure}
2006 scripts.
2007
2008 @item host_configargs
2009 @cindex @code{host_configargs}
2010 The contents of this variable is passed to all host @command{configure}
2011 scripts.
2012
2013 @item target_configargs
2014 @cindex @code{target_configargs}
2015 The contents of this variable is passed to all target @command{configure}
2016 scripts.
2017
2018 @end table
2019
2020 In order to avoid shell and @command{make} quoting issues for complex
2021 overrides, you can pass a setting for @env{CONFIG_SITE} and set
2022 variables in the site file.
2023
1982 @html 2024 @html
1983 <hr /> 2025 <hr />
1984 <p> 2026 <p>
1985 @end html 2027 @end html
1986 @ifhtml 2028 @ifhtml
2089 following example. This will save roughly 40% of disk space both for 2131 following example. This will save roughly 40% of disk space both for
2090 the bootstrap and the final installation. (Libraries will still contain 2132 the bootstrap and the final installation. (Libraries will still contain
2091 debugging information.) 2133 debugging information.)
2092 2134
2093 @smallexample 2135 @smallexample
2094 make BOOT_CFLAGS='-O' bootstrap 2136 make BOOT_CFLAGS='-O' bootstrap
2095 @end smallexample 2137 @end smallexample
2096 2138
2097 You can place non-default optimization flags into @code{BOOT_CFLAGS}; they 2139 You can place non-default optimization flags into @code{BOOT_CFLAGS}; they
2098 are less well tested here than the default of @samp{-g -O2}, but should 2140 are less well tested here than the default of @samp{-g -O2}, but should
2099 still work. In a few cases, you may find that you need to specify special 2141 still work. In a few cases, you may find that you need to specify special
2147 @option{-O1} to it. @samp{BUILD_CONFIG=bootstrap-O1} is equivalent to 2189 @option{-O1} to it. @samp{BUILD_CONFIG=bootstrap-O1} is equivalent to
2148 @samp{BOOT_CFLAGS='-g -O1'}. 2190 @samp{BOOT_CFLAGS='-g -O1'}.
2149 2191
2150 @item @samp{bootstrap-O3} 2192 @item @samp{bootstrap-O3}
2151 Analogous to @code{bootstrap-O1}. 2193 Analogous to @code{bootstrap-O1}.
2194
2195 @item @samp{bootstrap-lto}
2196 Enables Link-Time Optimization for host tools during bootstrapping.
2197 @samp{BUILD_CONFIG=bootstrap-lto} is equivalent to adding
2198 @option{-flto} to @samp{BOOT_CFLAGS}.
2152 2199
2153 @item @samp{bootstrap-debug} 2200 @item @samp{bootstrap-debug}
2154 Verifies that the compiler generates the same executable code, whether 2201 Verifies that the compiler generates the same executable code, whether
2155 or not it is asked to emit debug information. To this end, this 2202 or not it is asked to emit debug information. To this end, this
2156 option builds stage2 host programs without debug information, and uses 2203 option builds stage2 host programs without debug information, and uses
2299 and network filesystems. 2346 and network filesystems.
2300 2347
2301 @section Building the Ada compiler 2348 @section Building the Ada compiler
2302 2349
2303 In order to build GNAT, the Ada compiler, you need a working GNAT 2350 In order to build GNAT, the Ada compiler, you need a working GNAT
2304 compiler (GCC version 3.4 or later). 2351 compiler (GCC version 4.0 or later).
2305 This includes GNAT tools such as @command{gnatmake} and 2352 This includes GNAT tools such as @command{gnatmake} and
2306 @command{gnatlink}, since the Ada front end is written in Ada and 2353 @command{gnatlink}, since the Ada front end is written in Ada and
2307 uses some GNAT-specific extensions. 2354 uses some GNAT-specific extensions.
2308 2355
2309 In order to build a cross compiler, it is suggested to install 2356 In order to build a cross compiler, it is suggested to install
2385 installed are not in the @env{PATH}, you may need to set the following 2432 installed are not in the @env{PATH}, you may need to set the following
2386 environment variables appropriately, as in the following example (which 2433 environment variables appropriately, as in the following example (which
2387 assumes that DejaGnu has been installed under @file{/usr/local}): 2434 assumes that DejaGnu has been installed under @file{/usr/local}):
2388 2435
2389 @smallexample 2436 @smallexample
2390 TCL_LIBRARY = /usr/local/share/tcl8.0 2437 TCL_LIBRARY = /usr/local/share/tcl8.0
2391 DEJAGNULIBS = /usr/local/share/dejagnu 2438 DEJAGNULIBS = /usr/local/share/dejagnu
2392 @end smallexample 2439 @end smallexample
2393 2440
2394 (On systems such as Cygwin, these paths are required to be actual 2441 (On systems such as Cygwin, these paths are required to be actual
2395 paths, not mounts or links; presumably this is due to some lack of 2442 paths, not mounts or links; presumably this is due to some lack of
2396 portability in the DejaGnu code.) 2443 portability in the DejaGnu code.)
2397 2444
2398 2445
2399 Finally, you can run the testsuite (which may take a long time): 2446 Finally, you can run the testsuite (which may take a long time):
2400 @smallexample 2447 @smallexample
2401 cd @var{objdir}; make -k check 2448 cd @var{objdir}; make -k check
2402 @end smallexample 2449 @end smallexample
2403 2450
2404 This will test various components of GCC, such as compiler 2451 This will test various components of GCC, such as compiler
2405 front ends and runtime libraries. While running the testsuite, DejaGnu 2452 front ends and runtime libraries. While running the testsuite, DejaGnu
2406 might emit some harmless messages resembling 2453 might emit some harmless messages resembling
2420 2467
2421 A more selective way to just run all @command{gcc} execute tests in the 2468 A more selective way to just run all @command{gcc} execute tests in the
2422 testsuite is to use 2469 testsuite is to use
2423 2470
2424 @smallexample 2471 @smallexample
2425 make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}" 2472 make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
2426 @end smallexample 2473 @end smallexample
2427 2474
2428 Likewise, in order to run only the @command{g++} ``old-deja'' tests in 2475 Likewise, in order to run only the @command{g++} ``old-deja'' tests in
2429 the testsuite with filenames matching @samp{9805*}, you would use 2476 the testsuite with filenames matching @samp{9805*}, you would use
2430 2477
2431 @smallexample 2478 @smallexample
2432 make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}" 2479 make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
2433 @end smallexample 2480 @end smallexample
2434 2481
2435 The @file{*.exp} files are located in the testsuite directories of the GCC 2482 The @file{*.exp} files are located in the testsuite directories of the GCC
2436 source, the most important ones being @file{compile.exp}, 2483 source, the most important ones being @file{compile.exp},
2437 @file{execute.exp}, @file{dg.exp} and @file{old-deja.exp}. 2484 @file{execute.exp}, @file{dg.exp} and @file{old-deja.exp}.
2445 @samp{--target_board} option of DejaGNU, either passed as part of 2492 @samp{--target_board} option of DejaGNU, either passed as part of
2446 @samp{RUNTESTFLAGS}, or directly to @command{runtest} if you prefer to 2493 @samp{RUNTESTFLAGS}, or directly to @command{runtest} if you prefer to
2447 work outside the makefiles. For example, 2494 work outside the makefiles. For example,
2448 2495
2449 @smallexample 2496 @smallexample
2450 make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants" 2497 make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
2451 @end smallexample 2498 @end smallexample
2452 2499
2453 will run the standard @command{g++} testsuites (``unix'' is the target name 2500 will run the standard @command{g++} testsuites (``unix'' is the target name
2454 for a standard native testsuite situation), passing 2501 for a standard native testsuite situation), passing
2455 @samp{-O3 -fmerge-constants} to the compiler on every test, i.e., 2502 @samp{-O3 -fmerge-constants} to the compiler on every test, i.e.,
2457 2504
2458 You can run the testsuites multiple times using combinations of options 2505 You can run the testsuites multiple times using combinations of options
2459 with a syntax similar to the brace expansion of popular shells: 2506 with a syntax similar to the brace expansion of popular shells:
2460 2507
2461 @smallexample 2508 @smallexample
2462 @dots{}"--target_board=arm-sim\@{-mhard-float,-msoft-float\@}\@{-O1,-O2,-O3,\@}" 2509 @dots{}"--target_board=arm-sim\@{-mhard-float,-msoft-float\@}\@{-O1,-O2,-O3,\@}"
2463 @end smallexample 2510 @end smallexample
2464 2511
2465 (Note the empty option caused by the trailing comma in the final group.) 2512 (Note the empty option caused by the trailing comma in the final group.)
2466 The following will run each testsuite eight times using the @samp{arm-sim} 2513 The following will run each testsuite eight times using the @samp{arm-sim}
2467 target, as if you had specified all possible combinations yourself: 2514 target, as if you had specified all possible combinations yourself:
2468 2515
2469 @smallexample 2516 @smallexample
2470 --target_board=arm-sim/-mhard-float/-O1 2517 --target_board=arm-sim/-mhard-float/-O1
2471 --target_board=arm-sim/-mhard-float/-O2 2518 --target_board=arm-sim/-mhard-float/-O2
2472 --target_board=arm-sim/-mhard-float/-O3 2519 --target_board=arm-sim/-mhard-float/-O3
2473 --target_board=arm-sim/-mhard-float 2520 --target_board=arm-sim/-mhard-float
2474 --target_board=arm-sim/-msoft-float/-O1 2521 --target_board=arm-sim/-msoft-float/-O1
2475 --target_board=arm-sim/-msoft-float/-O2 2522 --target_board=arm-sim/-msoft-float/-O2
2476 --target_board=arm-sim/-msoft-float/-O3 2523 --target_board=arm-sim/-msoft-float/-O3
2477 --target_board=arm-sim/-msoft-float 2524 --target_board=arm-sim/-msoft-float
2478 @end smallexample 2525 @end smallexample
2479 2526
2480 They can be combined as many times as you wish, in arbitrary ways. This 2527 They can be combined as many times as you wish, in arbitrary ways. This
2481 list: 2528 list:
2482 2529
2483 @smallexample 2530 @smallexample
2484 @dots{}"--target_board=unix/-Wextra\@{-O3,-fno-strength\@}\@{-fomit-frame,\@}" 2531 @dots{}"--target_board=unix/-Wextra\@{-O3,-fno-strength\@}\@{-fomit-frame,\@}"
2485 @end smallexample 2532 @end smallexample
2486 2533
2487 will generate four combinations, all involving @samp{-Wextra}. 2534 will generate four combinations, all involving @samp{-Wextra}.
2488 2535
2489 The disadvantage to this method is that the testsuites are run in serial, 2536 The disadvantage to this method is that the testsuites are run in serial,
2492 parallel by having the shell perform the combinations and @command{make} 2539 parallel by having the shell perform the combinations and @command{make}
2493 do the parallel runs. Instead of using @samp{--target_board}, use a 2540 do the parallel runs. Instead of using @samp{--target_board}, use a
2494 special makefile target: 2541 special makefile target:
2495 2542
2496 @smallexample 2543 @smallexample
2497 make -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{option2}/@dots{} 2544 make -j@var{N} check-@var{testsuite}//@var{test-target}/@var{option1}/@var{option2}/@dots{}
2498 @end smallexample 2545 @end smallexample
2499 2546
2500 For example, 2547 For example,
2501 2548
2502 @smallexample 2549 @smallexample
2503 make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@} 2550 make -j3 check-gcc//sh-hms-sim/@{-m1,-m2,-m3,-m3e,-m4@}/@{,-nofpu@}
2504 @end smallexample 2551 @end smallexample
2505 2552
2506 will run three concurrent ``make-gcc'' testsuites, eventually testing all 2553 will run three concurrent ``make-gcc'' testsuites, eventually testing all
2507 ten combinations as described above. Note that this is currently only 2554 ten combinations as described above. Note that this is currently only
2508 supported in the @file{gcc} subdirectory. (To see how this works, try 2555 supported in the @file{gcc} subdirectory. (To see how this works, try
2557 2604
2558 If you want to report the results to the GCC project, use the 2605 If you want to report the results to the GCC project, use the
2559 @file{contrib/test_summary} shell script. Start it in the @var{objdir} with 2606 @file{contrib/test_summary} shell script. Start it in the @var{objdir} with
2560 2607
2561 @smallexample 2608 @smallexample
2562 @var{srcdir}/contrib/test_summary -p your_commentary.txt \ 2609 @var{srcdir}/contrib/test_summary -p your_commentary.txt \
2563 -m gcc-testresults@@gcc.gnu.org |sh 2610 -m gcc-testresults@@gcc.gnu.org |sh
2564 @end smallexample 2611 @end smallexample
2565 2612
2566 This script uses the @command{Mail} program to send the results, so 2613 This script uses the @command{Mail} program to send the results, so
2567 make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is 2614 make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is
2568 prepended to the testsuite summary and should contain any special 2615 prepended to the testsuite summary and should contain any special
2589 @chapter Installing GCC: Final installation 2636 @chapter Installing GCC: Final installation
2590 @end ifnothtml 2637 @end ifnothtml
2591 2638
2592 Now that GCC has been built (and optionally tested), you can install it with 2639 Now that GCC has been built (and optionally tested), you can install it with
2593 @smallexample 2640 @smallexample
2594 cd @var{objdir}; make install 2641 cd @var{objdir} && make install
2595 @end smallexample 2642 @end smallexample
2596 2643
2597 We strongly recommend to install into a target directory where there is 2644 We strongly recommend to install into a target directory where there is
2598 no previous version of GCC present. Also, the GNAT runtime should not 2645 no previous version of GCC present. Also, the GNAT runtime should not
2599 be stripped, as this would break certain features of the debugger that 2646 be stripped, as this would break certain features of the debugger that
2625 2672
2626 @smallexample 2673 @smallexample
2627 make DESTDIR=@var{path-to-rootdir} install 2674 make DESTDIR=@var{path-to-rootdir} install
2628 @end smallexample 2675 @end smallexample
2629 2676
2630 @noindent where @var{path-to-rootdir} is the absolute path of 2677 @noindent
2678 where @var{path-to-rootdir} is the absolute path of
2631 a directory relative to which all installation paths will be 2679 a directory relative to which all installation paths will be
2632 interpreted. Note that the directory specified by @code{DESTDIR} 2680 interpreted. Note that the directory specified by @code{DESTDIR}
2633 need not exist yet; it will be created if necessary. 2681 need not exist yet; it will be created if necessary.
2634 2682
2635 There is a subtle point with tooldirs and @code{DESTDIR}: 2683 There is a subtle point with tooldirs and @code{DESTDIR}:
2638 @file{@var{rootdir}/@var{exec-prefix}/@var{target-alias}/bin} will 2686 @file{@var{rootdir}/@var{exec-prefix}/@var{target-alias}/bin} will
2639 be filled with duplicated GCC executables only if it already exists, 2687 be filled with duplicated GCC executables only if it already exists,
2640 it will not be created otherwise. This is regarded as a feature, 2688 it will not be created otherwise. This is regarded as a feature,
2641 not as a bug, because it gives slightly more control to the packagers 2689 not as a bug, because it gives slightly more control to the packagers
2642 using the @code{DESTDIR} feature. 2690 using the @code{DESTDIR} feature.
2691
2692 You can install stripped programs and libraries with
2693
2694 @smallexample
2695 make install-strip
2696 @end smallexample
2643 2697
2644 If you are bootstrapping a released version of GCC then please 2698 If you are bootstrapping a released version of GCC then please
2645 quickly review the build status page for your release, available from 2699 quickly review the build status page for your release, available from
2646 @uref{http://gcc.gnu.org/buildstat.html}. 2700 @uref{http://gcc.gnu.org/buildstat.html}.
2647 If your system is not listed for the version of GCC that you built, 2701 If your system is not listed for the version of GCC that you built,
2775 2829
2776 @item 2830 @item
2777 HP-UX: 2831 HP-UX:
2778 @itemize 2832 @itemize
2779 @item 2833 @item
2780 @uref{http://hpux.cs.utah.edu/,,HP-UX Porting Center}; 2834 @uref{http://hpux.connect.org.uk/,,HP-UX Porting Center};
2781 2835
2782 @item 2836 @item
2783 @uref{ftp://sunsite.informatik.rwth-aachen.de/pub/packages/gcc_hpux/,,Binaries for HP-UX 11.00 at Aachen University of Technology}. 2837 @uref{ftp://sunsite.informatik.rwth-aachen.de/pub/packages/gcc_hpux/,,Binaries for HP-UX 11.00 at Aachen University of Technology}.
2784 @end itemize 2838 @end itemize
2785 2839
2786 @item 2840 @item
2787 Motorola 68HC11/68HC12---@uref{http://www.gnu-m68hc11.org,,GNU
2788 Development Tools for the Motorola 68HC11/68HC12}.
2789
2790 @item
2791 @uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO 2841 @uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
2792 OpenServer/Unixware}. 2842 OpenServer/Unixware}.
2793 2843
2794 @item 2844 @item
2795 Solaris 2 (SPARC, Intel)---@uref{http://www.sunfreeware.com/,,Sunfreeware}. 2845 Solaris 2 (SPARC, Intel):
2796 2846 @itemize
2797 @item 2847 @item
2798 SGI---@uref{http://freeware.sgi.com/,,SGI Freeware}. 2848 @uref{http://www.sunfreeware.com/,,Sunfreeware}
2849
2850 @item
2851 @uref{http://www.blastwave.org/,,Blastwave}
2852
2853 @item
2854 @uref{http://www.opencsw.org/,,OpenCSW}
2855
2856 @item
2857 @uref{http://jupiterrise.com/tgcware/,,TGCware}
2858 @end itemize
2859
2860 @item
2861 SGI IRIX:
2862 @itemize
2863 @item
2864 @uref{http://nekochan.net/,,Nekoware}
2865
2866 @item
2867 @uref{http://jupiterrise.com/tgcware/,,TGCware}
2868 @end itemize
2799 2869
2800 @item 2870 @item
2801 Microsoft Windows: 2871 Microsoft Windows:
2802 @itemize 2872 @itemize
2803 @item 2873 @item
2886 @item 2956 @item
2887 @uref{#x-x-linux-gnu,,*-*-linux-gnu} 2957 @uref{#x-x-linux-gnu,,*-*-linux-gnu}
2888 @item 2958 @item
2889 @uref{#ix86-x-linux,,i?86-*-linux*} 2959 @uref{#ix86-x-linux,,i?86-*-linux*}
2890 @item 2960 @item
2961 @uref{#ix86-x-solaris289,,i?86-*-solaris2.[89]}
2962 @item
2891 @uref{#ix86-x-solaris210,,i?86-*-solaris2.10} 2963 @uref{#ix86-x-solaris210,,i?86-*-solaris2.10}
2892 @item 2964 @item
2893 @uref{#ia64-x-linux,,ia64-*-linux} 2965 @uref{#ia64-x-linux,,ia64-*-linux}
2894 @item 2966 @item
2895 @uref{#ia64-x-hpux,,ia64-*-hpux*} 2967 @uref{#ia64-x-hpux,,ia64-*-hpux*}
2914 @item 2986 @item
2915 @uref{#m68k-uclinux,,m68k-uclinux} 2987 @uref{#m68k-uclinux,,m68k-uclinux}
2916 @item 2988 @item
2917 @uref{#mep-x-elf,,mep-*-elf} 2989 @uref{#mep-x-elf,,mep-*-elf}
2918 @item 2990 @item
2991 @uref{#microblaze-x-elf,,microblaze-*-elf}
2992 @item
2919 @uref{#mips-x-x,,mips-*-*} 2993 @uref{#mips-x-x,,mips-*-*}
2920 @item 2994 @item
2921 @uref{#mips-sgi-irix5,,mips-sgi-irix5} 2995 @uref{#mips-sgi-irix5,,mips-sgi-irix5}
2922 @item 2996 @item
2923 @uref{#mips-sgi-irix6,,mips-sgi-irix6} 2997 @uref{#mips-sgi-irix6,,mips-sgi-irix6}
2947 @uref{#s390x-x-linux,,s390x-*-linux*} 3021 @uref{#s390x-x-linux,,s390x-*-linux*}
2948 @item 3022 @item
2949 @uref{#s390x-ibm-tpf,,s390x-ibm-tpf*} 3023 @uref{#s390x-ibm-tpf,,s390x-ibm-tpf*}
2950 @item 3024 @item
2951 @uref{#x-x-solaris2,,*-*-solaris2*} 3025 @uref{#x-x-solaris2,,*-*-solaris2*}
3026 @item
3027 @uref{#sparc-x-x,,sparc*-*-*}
2952 @item 3028 @item
2953 @uref{#sparc-sun-solaris2,,sparc-sun-solaris2*} 3029 @uref{#sparc-sun-solaris2,,sparc-sun-solaris2*}
2954 @item 3030 @item
2955 @uref{#sparc-sun-solaris210,,sparc-sun-solaris2.10} 3031 @uref{#sparc-sun-solaris210,,sparc-sun-solaris2.10}
2956 @item 3032 @item
3101 3177
3102 We @emph{strongly} recommend using binutils 2.13 or newer. 3178 We @emph{strongly} recommend using binutils 2.13 or newer.
3103 3179
3104 The following error: 3180 The following error:
3105 @smallexample 3181 @smallexample
3106 Error: register required 3182 Error: register required
3107 @end smallexample 3183 @end smallexample
3108 3184
3109 indicates that you should upgrade to a newer version of the binutils. 3185 indicates that you should upgrade to a newer version of the binutils.
3110 3186
3111 @html 3187 @html
3154 3230
3155 For @code{cris-axis-elf} you need binutils 2.11 3231 For @code{cris-axis-elf} you need binutils 2.11
3156 or newer. For @code{cris-axis-linux-gnu} you need binutils 2.12 or newer. 3232 or newer. For @code{cris-axis-linux-gnu} you need binutils 2.12 or newer.
3157 3233
3158 Pre-packaged tools can be obtained from 3234 Pre-packaged tools can be obtained from
3159 @uref{ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/}. More 3235 @uref{ftp://ftp.axis.com/@/pub/@/axis/@/tools/@/cris/@/compiler-kit/}. More
3160 information about this platform is available at 3236 information about this platform is available at
3161 @uref{http://developer.axis.com/}. 3237 @uref{http://developer.axis.com/}.
3162 3238
3163 @html 3239 @html
3164 <hr /> 3240 <hr />
3181 GCC@ for building a CRX cross-compiler. The option @samp{--target=crx-elf} 3257 GCC@ for building a CRX cross-compiler. The option @samp{--target=crx-elf}
3182 is also used to build the @samp{newlib} C library for CRX. 3258 is also used to build the @samp{newlib} C library for CRX.
3183 3259
3184 It is also possible to build libstdc++-v3 for the CRX architecture. This 3260 It is also possible to build libstdc++-v3 for the CRX architecture. This
3185 needs to be done in a separate step with the following configure settings: 3261 needs to be done in a separate step with the following configure settings:
3186 @samp{gcc/libstdc++-v3/configure --host=crx-elf --with-newlib 3262
3187 --enable-sjlj-exceptions --enable-cxx-flags='-fexceptions -frtti'} 3263 @smallexample
3264 gcc/libstdc++-v3/configure --host=crx-elf --with-newlib \
3265 --enable-sjlj-exceptions --enable-cxx-flags='-fexceptions -frtti'
3266 @end smallexample
3188 3267
3189 @html 3268 @html
3190 <hr /> 3269 <hr />
3191 @end html 3270 @end html
3192 @heading @anchor{dos}DOS 3271 @heading @anchor{dos}DOS
3205 3284
3206 Support for FreeBSD 1 was discontinued in GCC 3.2. Support for 3285 Support for FreeBSD 1 was discontinued in GCC 3.2. Support for
3207 FreeBSD 2 (and any mutant a.out variants of FreeBSD 3) was 3286 FreeBSD 2 (and any mutant a.out variants of FreeBSD 3) was
3208 discontinued in GCC 4.0. 3287 discontinued in GCC 4.0.
3209 3288
3210 In GCC 4.5, we enabled the use of @code{dl_iterate_phdr} inside boehm-gc on 3289 In order to better utilize FreeBSD base system functionality and match
3211 FreeBSD 7 or later. In order to better match the configuration of the 3290 the configuration of the system compiler, GCC 4.5 and above as well as
3212 FreeBSD system compiler: We also enabled the check to see if libc 3291 GCC 4.4 past 2010-06-20 leverage SSP support in libc (which is present
3213 provides SSP support (which it does on FreeBSD 7), the use of 3292 on FreeBSD 7 or later) and the use of @code{__cxa_atexit} by default
3214 @code{dl_iterate_phdr} inside @file{libgcc_s.so.1} (on FreeBSD 7 or later) 3293 (on FreeBSD 6 or later). The use of @code{dl_iterate_phdr} inside
3215 and the use of @code{__cxa_atexit} by default (on FreeBSD 6 or later). 3294 @file{libgcc_s.so.1} and boehm-gc (on FreeBSD 7 or later) is enabled
3295 by GCC 4.5 and above.
3216 3296
3217 We support FreeBSD using the ELF file format with DWARF 2 debugging 3297 We support FreeBSD using the ELF file format with DWARF 2 debugging
3218 for all CPU architectures. You may use @option{-gstabs} instead of 3298 for all CPU architectures. You may use @option{-gstabs} instead of
3219 @option{-g}, if you really want the old debugging format. There are 3299 @option{-g}, if you really want the old debugging format. There are
3220 no known issues with mixing object files and libraries with different 3300 no known issues with mixing object files and libraries with different
3304 <hr /> 3384 <hr />
3305 @end html 3385 @end html
3306 @heading @anchor{hppa-hp-hpux10}hppa*-hp-hpux10 3386 @heading @anchor{hppa-hp-hpux10}hppa*-hp-hpux10
3307 3387
3308 For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch 3388 For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
3309 @code{PHCO_19798} from HP@. HP has two sites which provide patches free of 3389 @code{PHCO_19798} from HP@.
3310 charge:
3311
3312 @itemize @bullet
3313 @item
3314 @html
3315 <a href="http://us.itrc.hp.com/service/home/home.do">US, Canada, Asia-Pacific, and
3316 Latin-America</a>
3317 @end html
3318 @ifnothtml
3319 @uref{http://us.itrc.hp.com/service/home/home.do,,} US, Canada, Asia-Pacific,
3320 and Latin-America.
3321 @end ifnothtml
3322 @item
3323 @uref{http://europe.itrc.hp.com/service/home/home.do,,} Europe.
3324 @end itemize
3325 3390
3326 The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces are 3391 The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces are
3327 used for one-only code and data. This resolves many of the previous 3392 used for one-only code and data. This resolves many of the previous
3328 problems in using C++ on this target. However, the ABI is not compatible 3393 problems in using C++ on this target. However, the ABI is not compatible
3329 with the one implemented under HP-UX 11 using secondary definitions. 3394 with the one implemented under HP-UX 11 using secondary definitions.
3461 found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}. 3526 found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
3462 3527
3463 @html 3528 @html
3464 <hr /> 3529 <hr />
3465 @end html 3530 @end html
3531 @heading @anchor{ix86-x-solaris289}i?86-*-solaris2.[89]
3532 The Sun assembler in Solaris 8 and 9 has several bugs and limitations.
3533 While GCC works around them, several features are missing, so it is
3534 @c FIXME: which ones?
3535 recommended to use the GNU assembler instead. There is no bundled
3536 version, but the current version, from GNU binutils 2.20.1, is known to
3537 work.
3538
3539 Solaris@tie{}2/x86 doesn't support the execution of SSE/SSE2 instructions
3540 before Solaris@tie{}9 4/04, even if the CPU supports them. Programs will
3541 receive @code{SIGILL} if they try. The fix is available both in
3542 Solaris@tie{}9 Update@tie{}6 and kernel patch 112234-12 or newer. There is no
3543 corresponding patch for Solaris 8. To avoid this problem,
3544 @option{-march} defaults to @samp{pentiumpro} on Solaris 8 and 9. If
3545 you have the patch installed, you can configure GCC with an appropriate
3546 @option{--with-arch} option, but need GNU @command{as} for SSE2 support.
3547
3548 @html
3549 <hr />
3550 @end html
3466 @heading @anchor{ix86-x-solaris210}i?86-*-solaris2.10 3551 @heading @anchor{ix86-x-solaris210}i?86-*-solaris2.10
3467 Use this for Solaris 10 or later on x86 and x86-64 systems. This 3552 Use this for Solaris 10 or later on x86 and x86-64 systems. This
3468 configuration is supported by GCC 4.0 and later versions only. Unlike 3553 configuration is supported by GCC 4.0 and later versions only. Unlike
3469 @samp{sparcv9-sun-solaris2*}, there is no corresponding 64-bit 3554 @samp{sparcv9-sun-solaris2*}, there is no corresponding 64-bit
3470 configuration like @samp{amd64-*-solaris2*} or @samp{x86_64-*-solaris2*}. 3555 configuration like @samp{amd64-*-solaris2*} or @samp{x86_64-*-solaris2*}.
3483 due to a packaging bug the version in Solaris 10, from GNU binutils 3568 due to a packaging bug the version in Solaris 10, from GNU binutils
3484 2.15, cannot be used, while the version in Solaris 11, from GNU binutils 3569 2.15, cannot be used, while the version in Solaris 11, from GNU binutils
3485 2.19, works, as does the latest version, from GNU binutils 2.20.1. 3570 2.19, works, as does the latest version, from GNU binutils 2.20.1.
3486 3571
3487 To use GNU @command{as}, configure with the options 3572 To use GNU @command{as}, configure with the options
3488 @option{--with-gnu-as --with-as=/usr/sfw/bin/gas}. It may be necessary 3573 @option{--with-gnu-as --with-as=@//usr/@/sfw/@/bin/@/gas}. It may be necessary
3489 to configure with @option{--without-gnu-ld --with-ld=/usr/ccs/bin/ld} to 3574 to configure with @option{--without-gnu-ld --with-ld=@//usr/@/ccs/@/bin/@/ld} to
3490 guarantee use of Sun @command{ld}. 3575 guarantee use of Sun @command{ld}.
3491 @c FIXME: why --without-gnu-ld --with-ld? 3576 @c FIXME: why --without-gnu-ld --with-ld?
3492 3577
3493 @html 3578 @html
3494 <hr /> 3579 <hr />
3540 with an earlier release of GCC is recommended. Bootstrapping with XLC 3625 with an earlier release of GCC is recommended. Bootstrapping with XLC
3541 requires a larger data segment, which can be enabled through the 3626 requires a larger data segment, which can be enabled through the
3542 @var{LDR_CNTRL} environment variable, e.g., 3627 @var{LDR_CNTRL} environment variable, e.g.,
3543 3628
3544 @smallexample 3629 @smallexample
3545 % LDR_CNTRL=MAXDATA=0x50000000 3630 % LDR_CNTRL=MAXDATA=0x50000000
3546 % export LDR_CNTRL 3631 % export LDR_CNTRL
3547 @end smallexample 3632 @end smallexample
3548 3633
3549 One can start with a pre-compiled version of GCC to build from 3634 One can start with a pre-compiled version of GCC to build from
3550 sources. One may delete GCC's ``fixed'' header files when starting 3635 sources. One may delete GCC's ``fixed'' header files when starting
3551 with a version of GCC built for an earlier release of AIX. 3636 with a version of GCC built for an earlier release of AIX.
3552 3637
3553 To speed up the configuration phases of bootstrapping and installing GCC, 3638 To speed up the configuration phases of bootstrapping and installing GCC,
3554 one may use GNU Bash instead of AIX @command{/bin/sh}, e.g., 3639 one may use GNU Bash instead of AIX @command{/bin/sh}, e.g.,
3555 3640
3556 @smallexample 3641 @smallexample
3557 % CONFIG_SHELL=/opt/freeware/bin/bash 3642 % CONFIG_SHELL=/opt/freeware/bin/bash
3558 % export CONFIG_SHELL 3643 % export CONFIG_SHELL
3559 @end smallexample 3644 @end smallexample
3560 3645
3561 and then proceed as described in @uref{build.html,,the build 3646 and then proceed as described in @uref{build.html,,the build
3562 instructions}, where we strongly recommend specifying an absolute path 3647 instructions}, where we strongly recommend specifying an absolute path
3563 to invoke @var{srcdir}/configure. 3648 to invoke @var{srcdir}/configure.
3601 multilib @file{libstdc++.a} installed: 3686 multilib @file{libstdc++.a} installed:
3602 3687
3603 Extract the shared objects from the currently installed 3688 Extract the shared objects from the currently installed
3604 @file{libstdc++.a} archive: 3689 @file{libstdc++.a} archive:
3605 @smallexample 3690 @smallexample
3606 % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5 3691 % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
3607 @end smallexample 3692 @end smallexample
3608 3693
3609 Enable the @samp{F_LOADONLY} flag so that the shared object will be 3694 Enable the @samp{F_LOADONLY} flag so that the shared object will be
3610 available for runtime dynamic loading, but not linking: 3695 available for runtime dynamic loading, but not linking:
3611 @smallexample 3696 @smallexample
3612 % strip -e libstdc++.so.4 libstdc++.so.5 3697 % strip -e libstdc++.so.4 libstdc++.so.5
3613 @end smallexample 3698 @end smallexample
3614 3699
3615 Archive the runtime-only shared object in the GCC 3.4 3700 Archive the runtime-only shared object in the GCC 3.4
3616 @file{libstdc++.a} archive: 3701 @file{libstdc++.a} archive:
3617 @smallexample 3702 @smallexample
3618 % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5 3703 % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
3619 @end smallexample 3704 @end smallexample
3620 3705
3621 Linking executables and shared libraries may produce warnings of 3706 Linking executables and shared libraries may produce warnings of
3622 duplicate symbols. The assembly files generated by GCC for AIX always 3707 duplicate symbols. The assembly files generated by GCC for AIX always
3623 have included multiple symbol definitions for certain global variable 3708 have included multiple symbol definitions for certain global variable
3761 This configuration is intended for embedded systems. 3846 This configuration is intended for embedded systems.
3762 3847
3763 @html 3848 @html
3764 <hr /> 3849 <hr />
3765 @end html 3850 @end html
3851 @heading @anchor{microblaze-x-elf}microblaze-*-elf
3852 Xilinx MicroBlaze processor.
3853 This configuration is intended for embedded systems.
3854
3855 @html
3856 <hr />
3857 @end html
3766 @heading @anchor{mips-x-x}mips-*-* 3858 @heading @anchor{mips-x-x}mips-*-*
3767 If on a MIPS system you get an error message saying ``does not have gp 3859 If on a MIPS system you get an error message saying ``does not have gp
3768 sections for all it's [sic] sectons [sic]'', don't worry about it. This 3860 sections for all it's [sic] sectons [sic]'', don't worry about it. This
3769 happens whenever you use GAS with the MIPS linker, but there is not 3861 happens whenever you use GAS with the MIPS linker, but there is not
3770 really anything wrong, and it is okay to use the output file. You can 3862 really anything wrong, and it is okay to use the output file. You can
3948 PowerPC running Darwin (Mac OS X kernel). 4040 PowerPC running Darwin (Mac OS X kernel).
3949 4041
3950 Pre-installed versions of Mac OS X may not include any developer tools, 4042 Pre-installed versions of Mac OS X may not include any developer tools,
3951 meaning that you will not be able to build GCC from source. Tool 4043 meaning that you will not be able to build GCC from source. Tool
3952 binaries are available at 4044 binaries are available at
3953 @uref{http://developer.apple.com/darwin/projects/compiler/} (free 4045 @uref{http://opensource.apple.com/}.
3954 registration required).
3955 4046
3956 This version of GCC requires at least cctools-590.36. The 4047 This version of GCC requires at least cctools-590.36. The
3957 cctools-590.36 package referenced from 4048 cctools-590.36 package referenced from
3958 @uref{http://gcc.gnu.org/ml/gcc/2006-03/msg00507.html} will not work 4049 @uref{http://gcc.gnu.org/ml/gcc/2006-03/msg00507.html} will not work
3959 on systems older than 10.3.9 (aka darwin7.9.0). 4050 on systems older than 10.3.9 (aka darwin7.9.0).
4056 The Solaris 2 @command{/bin/sh} will often fail to configure 4147 The Solaris 2 @command{/bin/sh} will often fail to configure
4057 @samp{libstdc++-v3}, @samp{boehm-gc} or @samp{libjava}. We therefore 4148 @samp{libstdc++-v3}, @samp{boehm-gc} or @samp{libjava}. We therefore
4058 recommend using the following initial sequence of commands 4149 recommend using the following initial sequence of commands
4059 4150
4060 @smallexample 4151 @smallexample
4061 % CONFIG_SHELL=/bin/ksh 4152 % CONFIG_SHELL=/bin/ksh
4062 % export CONFIG_SHELL 4153 % export CONFIG_SHELL
4063 @end smallexample 4154 @end smallexample
4064 4155
4065 @noindent 4156 @noindent
4066 and proceed as described in @uref{configure.html,,the configure instructions}. 4157 and proceed as described in @uref{configure.html,,the configure instructions}.
4067 In addition we strongly recommend specifying an absolute path to invoke 4158 In addition we strongly recommend specifying an absolute path to invoke
4102 GNU @command{ld} usually works as well, although the version included in 4193 GNU @command{ld} usually works as well, although the version included in
4103 Solaris 10 cannot be used due to several bugs. Again, the current 4194 Solaris 10 cannot be used due to several bugs. Again, the current
4104 version (2.20.1) is known to work, but generally lacks platform specific 4195 version (2.20.1) is known to work, but generally lacks platform specific
4105 features, so better stay with Sun @command{ld}. 4196 features, so better stay with Sun @command{ld}.
4106 4197
4198 To enable symbol versioning in @samp{libstdc++} with Sun @command{ld},
4199 you need to have any version of GNU @command{c++filt}, which is part of
4200 GNU binutils. @samp{libstdc++} symbol versioning will be disabled if no
4201 appropriate version is found. Sun @command{c++filt} from the Sun Studio
4202 compilers does @emph{not} work.
4203
4107 Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or 4204 Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
4108 newer: @command{g++} will complain that types are missing. These headers 4205 newer: @command{g++} will complain that types are missing. These headers
4109 assume that omitting the type means @code{int}; this assumption worked for 4206 assume that omitting the type means @code{int}; this assumption worked for
4110 C90 but is wrong for C++, and is now wrong for C99 also. 4207 C90 but is wrong for C++, and is now wrong for C99 also.
4111 4208
4124 testsuite failures appear. 4221 testsuite failures appear.
4125 4222
4126 There are patches for Solaris 8 (117350-12 or newer for SPARC, 4223 There are patches for Solaris 8 (117350-12 or newer for SPARC,
4127 117351-12 or newer for Intel) and Solaris 9 (117171-11 or newer for 4224 117351-12 or newer for Intel) and Solaris 9 (117171-11 or newer for
4128 SPARC, 117172-11 or newer for Intel) that address this problem. 4225 SPARC, 117172-11 or newer for Intel) that address this problem.
4226
4227 Solaris@tie{}8 provides an alternate implementation of the thread libraries,
4228 @samp{libpthread} and @samp{libthread}. They are required for TLS
4229 support and have been made the default in Solaris@tie{}9, so they are always
4230 used on Solaris@tie{}8.
4231
4232 Thread-local storage (TLS) is supported in Solaris@tie{}8 and 9, but requires
4233 some patches. The @samp{libthread} patches provide the
4234 @code{__tls_get_addr} (SPARC, 64-bit x86) resp.@ @code{___tls_get_addr}
4235 (32-bit x86) functions. On Solaris@tie{}8, you need 108993-26 or newer on
4236 SPARC, 108994-26 or newer on Intel. On Solaris@tie{}9, the necessary support
4237 on SPARC is present since FCS, while 114432-05 or newer is required on
4238 Intel. Additionally, on Solaris@tie{}8, patch 109147-14 or newer on SPARC or
4239 109148-22 or newer on Intel are required for the Sun @command{ld} and
4240 runtime linker (@command{ld.so.1}) support. Again, Solaris@tie{}9/SPARC
4241 works since FCS, while 113986-02 is required on Intel. The linker
4242 patches must be installed even if GNU @command{ld} is used. Sun
4243 @command{as} in Solaris@tie{}8 and 9 doesn't support the necessary
4244 relocations, so GNU @command{as} must be used. The @command{configure}
4245 script checks for those prerequisites and automatically enables TLS
4246 support if they are met. Although those minimal patch versions should
4247 work, it is recommended to use the latest patch versions which include
4248 additional bug fixes.
4249
4250 @html
4251 <hr />
4252 @end html
4253 @heading @anchor{sparc-x-x}sparc*-*-*
4254
4255 This section contains general configuration information for all
4256 SPARC-based platforms. In addition to reading this section, please
4257 read all other sections that match your target.
4258
4259 Newer versions of the GNU Multiple Precision Library (GMP), the MPFR
4260 library and the MPC library are known to be miscompiled by earlier
4261 versions of GCC on these platforms. We therefore recommend the use
4262 of the exact versions of these libraries listed as minimal versions
4263 in @uref{prerequisites.html,,the prerequisites}.
4129 4264
4130 @html 4265 @html
4131 <hr /> 4266 <hr />
4132 @end html 4267 @end html
4133 @heading @anchor{sparc-sun-solaris2}sparc-sun-solaris2* 4268 @heading @anchor{sparc-sun-solaris2}sparc-sun-solaris2*
4177 4312
4178 @noindent 4313 @noindent
4179 To work around this problem, compile with @option{-gstabs+} instead of 4314 To work around this problem, compile with @option{-gstabs+} instead of
4180 plain @option{-g}. 4315 plain @option{-g}.
4181 4316
4182 When configuring the GNU Multiple Precision Library (GMP) or the MPFR 4317 When configuring the GNU Multiple Precision Library (GMP), the MPFR
4183 library on a Solaris 7 or later system, the canonical target triplet 4318 library or the MPC library on a Solaris 7 or later system, the canonical
4184 must be specified as the @command{build} parameter on the configure 4319 target triplet must be specified as the @command{build} parameter on the
4185 line. This triplet can be obtained by invoking @command{./config.guess} in 4320 configure line. This target triplet can be obtained by invoking @command{./config.guess} in the toplevel source directory of GCC (and
4186 the toplevel source directory of GCC (and not that of GMP or MPFR). 4321 not that of GMP or MPFR or MPC). For example on a Solaris 9 system:
4187 For example on a Solaris 9 system:
4188 4322
4189 @smallexample 4323 @smallexample
4190 % ./configure --build=sparc-sun-solaris2.9 --prefix=xxx 4324 % ./configure --build=sparc-sun-solaris2.9 --prefix=xxx
4191 @end smallexample 4325 @end smallexample
4192 4326
4193 @html 4327 @html
4194 <hr /> 4328 <hr />
4195 @end html 4329 @end html
4225 MPFR library, the canonical target triplet must be specified as 4359 MPFR library, the canonical target triplet must be specified as
4226 the @command{build} parameter on the configure line. For example 4360 the @command{build} parameter on the configure line. For example
4227 on a Solaris 9 system: 4361 on a Solaris 9 system:
4228 4362
4229 @smallexample 4363 @smallexample
4230 % ./configure --build=sparc64-sun-solaris2.9 --prefix=xxx 4364 % ./configure --build=sparc64-sun-solaris2.9 --prefix=xxx
4231 @end smallexample 4365 @end smallexample
4232 4366
4233 The following compiler flags must be specified in the configure 4367 The following compiler flags must be specified in the configure
4234 step in order to bootstrap this target with the Sun compiler: 4368 step in order to bootstrap this target with the Sun compiler:
4235 4369
4236 @smallexample 4370 @smallexample
4237 % CC="cc -xarch=v9 -xildoff" @var{srcdir}/configure [@var{options}] [@var{target}] 4371 % CC="cc -xarch=v9 -xildoff" @var{srcdir}/configure [@var{options}] [@var{target}]
4238 @end smallexample 4372 @end smallexample
4239 4373
4240 @noindent 4374 @noindent
4241 @option{-xarch=v9} specifies the SPARC-V9 architecture to the Sun toolchain 4375 @option{-xarch=v9} specifies the SPARC-V9 architecture to the Sun toolchain
4242 and @option{-xildoff} turns off the incremental linker. 4376 and @option{-xildoff} turns off the incremental linker.
4404 4538
4405 The Interix target is used by OpenNT, Interix, Services For UNIX (SFU), 4539 The Interix target is used by OpenNT, Interix, Services For UNIX (SFU),
4406 and Subsystem for UNIX-based Applications (SUA). Applications compiled 4540 and Subsystem for UNIX-based Applications (SUA). Applications compiled
4407 with this target run in the Interix subsystem, which is separate from 4541 with this target run in the Interix subsystem, which is separate from
4408 the Win32 subsystem. This target was last known to work in GCC 3.3. 4542 the Win32 subsystem. This target was last known to work in GCC 3.3.
4409
4410 For more information, see @uref{http://www.interix.com/}.
4411 4543
4412 @html 4544 @html
4413 <hr /> 4545 <hr />
4414 @end html 4546 @end html
4415 @heading @anchor{x-x-mingw32}*-*-mingw32 4547 @heading @anchor{x-x-mingw32}*-*-mingw32