OSDN Git Service

* doc/install.texi: Define srcdir when sources come from CVS.
[pf3gnuchains/gcc-fork.git] / gcc / doc / install.texi
1 \input texinfo.tex    @c -*-texinfo-*-
2 @c @ifnothtml
3 @c %**start of header
4 @setfilename install.info
5 @settitle Installing GCC
6 @setchapternewpage odd
7 @c %**end of header
8 @c @end ifnothtml
9
10 @c Specify title for specific html page
11 @ifset indexhtml
12 @settitle Installing GCC
13 @end ifset
14 @ifset specifichtml
15 @settitle Host/Target specific installation notes for GCC
16 @end ifset
17 @ifset downloadhtml
18 @settitle Downloading GCC
19 @end ifset
20 @ifset configurehtml
21 @settitle Installing GCC: Configuration
22 @end ifset
23 @ifset buildhtml
24 @settitle Installing GCC: Building
25 @end ifset
26 @ifset testhtml
27 @settitle Installing GCC: Testing
28 @end ifset
29 @ifset finalinstallhtml
30 @settitle Installing GCC: Final installation
31 @end ifset
32 @ifset binarieshtml
33 @settitle Installing GCC: Binaries
34 @end ifset
35
36 @comment $Id: install.texi,v 1.9 2001/05/31 08:15:15 gerald Exp $
37 @c Copyright (C) 2001 Free Software Foundation, Inc.
38 @c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
39
40 @c Include everything if we're not making html
41 @ifnothtml
42 @set indexhtml
43 @set specifichtml
44 @set downloadhtml
45 @set configurehtml
46 @set buildhtml
47 @set testhtml
48 @set finalinstallhtml
49 @set binarieshtml
50 @end ifnothtml
51
52 @c Part 2 Summary Description and Copyright
53 @ifinfo
54
55 Copyright @copyright{} 2001 Free Software Foundation, Inc.
56 @end ifinfo
57
58 @c Part 3 Titlepage and Copyright
59 @titlepage
60 @sp 10
61 @comment The title is printed in a large font.
62 @center @titlefont{Sample Title}
63
64 @c The following two commands start the copyright page.
65 @page
66 vskip 0pt plus 1filll
67 Copyright @copyright{} 2001 Free Software Foundation, Inc.
68 @end titlepage
69
70 @c Part 4 Top node and Master Menu
71 @ifinfo
72 @node    Top, , , (dir)
73 @comment node-name, next,          Previous, up
74
75 @menu
76 * Installing GCC::  This document describes the generic installation
77                     procedure for GCC as well as detailing some target
78                     specific installation instructions. 
79
80 * Specific::        Host/target specific installation notes for GCC.
81 * Binaries::        Where to get pre-compiled binaries.
82
83 * Concept Index::   This index has two entries.
84 @end menu
85 @end ifinfo
86
87 @c Part 5 The Body of the Document
88 @c ***Installing GCC**********************************************************
89 @ifinfo
90 @comment node-name,     next,          previous, up
91 @node    Installing GCC, Binaries, , Top
92 @end ifinfo
93 @ifset indexhtml
94 @html
95 <h1 align="center">Installing GCC</h1>
96 @end html
97 @ifnothtml
98 @chapter Installing GCC
99 @end ifnothtml
100
101 The latest version of this document is always available at
102 @uref{http://gcc.gnu.org/install/,,http://gcc.gnu.org/install/}. 
103
104 This document describes the generic installation procedure for GCC as well
105 as detailing some target specific installation instructions. 
106
107 GCC includes several components that previously were separate distributions 
108 with their own installation instructions. This document supersedes all 
109 package specific installation instructions. We provide the component 
110 specific installation information in the source distribution for historical 
111 reference purposes only. 
112
113 @emph{Before} starting the build/install procedure please check the 
114 @ifnothtml
115 @xref{Specific, host/target specific installation notes}.
116 @end ifnothtml
117 @ifnotinfo
118 @uref{specific.html,,host/target specific installation notes}. 
119 @end ifnotinfo
120 We recommend you browse the entire generic installation instructions before 
121 you proceed.
122
123 The installation procedure itself is broken into five steps. 
124
125 @ifinfo
126 @menu
127 * Downloading the source::
128 * Configuration::
129 * Building::
130 * Testing:: (optional)
131 * Final install::
132 @end menu
133 @end ifinfo
134 @ifnotinfo
135 @enumerate
136 @item 
137 @uref{download.html,,Downloading the source}
138 @item 
139 @uref{configure.html,,Configuration} 
140 @item
141 @uref{build.html,,Building} 
142 @item 
143 @uref{test.html,,Testing} (optional) 
144 @item
145 @uref{finalinstall.html,,Final install}
146 @end enumerate
147 @end ifnotinfo
148
149 Please note that GCC does not support @samp{make uninstall} and probably
150 won't do so in the near future as this would open a can of worms. Instead, 
151 we suggest that you install GCC into a directory of its own and simply
152 remove that directory when you do not need that specific version of GCC
153 any longer. 
154
155 @html
156 <hr>
157 <p>
158 @end html
159 @ifhtml
160 @uref{./index.html,,Return to the GCC Installation page}
161 @end ifhtml
162 @end ifset
163
164 @c ***Downloading the source**************************************************
165 @ifinfo
166 @comment node-name,     next,          previous, up
167 @node    Downloading the source, Configuration, , Installing GCC
168 @end ifinfo
169 @ifset downloadhtml
170 @html
171 <h1 align="center">Downloading GCC</h1>
172 @end html
173 @ifnothtml
174 @chapter Downloading GCC
175 @end ifnothtml
176 @cindex Downloading GCC
177 @cindex Downloading the Source
178
179 GCC is distributed via CVS and FTP tarballs compressed with gzip or
180 bzip2. It is possible to download a full distribution or specific
181 components.
182
183 Please refer to our @uref{http://gcc.gnu.org/releases.html,,releases web page}
184 for information on how to obtain GCC.
185
186 The full distribution includes the C, C++, Objective-C, Fortran, Java,
187 and Chill compilers.  The full distribution also includes runtime libraries
188 for C++, Objective-C and Fortran.  In the future the GNU compiler testsuites
189 will be included in the full distribution.
190
191 If you choose to download specific components, you must download the core
192 gcc distribution plus any language specific distributions you wish to
193 use.  The core distribution includes the C language front-end as well as the
194 shared components. Each language has a tarball which includes the language
195 front-end as well as the language runtime (when appropriate).
196
197 Unpack the core distribution as well as any language specific
198 distributions in the same directory.
199
200 If you also intend to build binutils (either to upgrade an existing
201 installation or for use in place of the corresponding tools of your
202 OS), unpack the binutils distribution either in the same directory or
203 a separate one.  In the latter case, add symbolic links to any
204 components of the binutils you intend to build alongside the compiler
205 (bfd, binutils, gas, gprof, ld, opcodes,...) to the directory containing
206 the GCC sources.
207
208 @html
209 <hr>
210 <p>
211 @end html
212 @ifhtml
213 @uref{./index.html,,Return to the GCC Installation page}
214 @end ifhtml
215 @end ifset
216
217 @c ***Configuration***********************************************************
218 @ifinfo
219 @comment node-name,     next,          previous, up
220 @node    Configuration, Building, Downloading the source, Installing GCC
221 @end ifinfo
222 @ifset configurehtml
223 @html
224 <h1 align="center">Installing GCC: Configuration</h1>
225 @end html
226 @ifnothtml
227 @chapter Installing GCC: Configuration
228 @end ifnothtml
229 @cindex Configuration
230 @cindex Installing GCC: Configuration
231
232 Like most GNU software, GCC must be configured before it can be built.
233 This document describes the recommended configuration procedure
234 for both native and cross targets.
235
236 We use @var{srcdir} to refer to the toplevel source directory for
237 GCC; we use @var{objdir} to refer to the toplevel build/object directory.
238
239 If you obtained the sources via CVS, @var{srcdir} must refer to the top
240 @file{gcc} directory, the one where the @file{MAINTAINERS} can be found,
241 and not its @file{gcc} subdirectory, otherwise the build will fail.
242
243 First, we @strong{highly} recommend that GCC be built into a
244 separate directory than the sources which does @strong{not} reside
245 within the source tree.  This is how we generally build GCC; building
246 where @var{srcdir} == @var{objdir} should still work, but doesn't
247 get extensive testing; building where @var{objdir} is a subdirectory
248 of @var{srcdir} is unsupported.
249
250 Second, when configuring a native system, either @command{cc} or
251 @command{gcc} must be in your path or you must set @env{CC} in
252 your environment before running configure.  Otherwise the configuration
253 scripts may fail.
254
255 To configure GCC:
256
257 @example
258    % mkdir @var{objdir}
259    % cd @var{objdir}
260    % @var{srcdir}/configure @strong{[target] [options]}
261 @end example
262
263
264 @strong{target specification}
265 @itemize @bullet
266 @item
267 GCC has code to correctly determine the correct value for @var{target}
268 for nearly all native systems.  Therefore, we highly recommend you not 
269 provide a configure target when configuring a native compiler.
270
271 @item
272 @var{target} must be specified as @option{--target=}@var{target}
273 when configuring a cross compiler; examples of valid targets would be 
274 i960-rtems, m68k-coff, sh-elf, etc.
275
276 @item
277 Specifying just @var{target} instead of @option{--target=}@var{target}
278 implies that the host defaults to @var{target}.
279 @end itemize
280
281
282 @strong{options specification}
283
284 Use @strong{options} to override several configure time options for
285 GCC.  A partial list of supported @option{options}:
286
287 @itemize @bullet
288 @item
289 @option{--prefix=}@var{dirname} @minus{}@minus{} Specify the toplevel installation
290 directory.  This is the recommended way to install the tools into a directory
291 other than the default.  The toplevel installation directory defaults to
292 @code{/usr/local}.
293
294 We @strong{highly} recommend against @var{dirname} being the same or a
295 subdirectory of @var{objdir} or vice versa.
296
297 These additional options control where certain parts of the distribution
298 are installed.  Normally you should not need to use these options.
299 @itemize @bullet
300 @item
301 @option{--with-local-prefix=}@var{dirname} @minus{}@minus{} Specify the installation
302 directory for local include files.  The default is @file{/usr/local}.
303
304 @item
305 @option{--with-gxx-include-dir=}@var{dirname} @minus{}@minus{} Specify
306 the installation directory for g++ header files.  The default is
307 @file{/usr/local/include/g++}.
308   
309 @end itemize
310
311 @item
312 @option{--enable-shared} @minus{}@minus{} Build shared versions of the
313 C++ runtime libraries if supported. This is the default on most
314 systems. Use @option{--disable-shared} for static libraries. Note that
315 up to the gcc version 2.95.x series, static libraries were the default
316 on all systems.
317
318 @item
319 @html
320 <a name="with-gnu-as">@option{--with-gnu-as}</a>
321 @end html
322 @minus{}@minus{} Specify that the compiler should assume that the
323 assembler it finds is the GNU assembler. However, this does not modify
324 the rules to find an assembler and will result in confusion if found
325 assembler is not actually the GNU assembler.  If you have more than one
326 assembler installed on your system, you may want to use this option in
327 connection with @option{--with-as=@file{/path/to/gas}}.
328
329 @item
330 @option{--with-as=@file{/path/to/as}} @minus{}@minus{} Specify that the
331 compiler should use the assembler pointed to by @var{pathname}, rather
332 than the one found by the standard rules to find an assembler, which
333 are:
334 @itemize @bullet
335 @item
336 Check the
337 @file{@var{exec_prefix}/lib/gcc-lib/@var{target}/@var{version}}
338 directory, where @var{exec_prefix} defaults to @var{prefix} which
339 defaults to @file{/usr/local} unless overridden by the
340 @option{--prefix=/pathname} switch described above. @var{target} is the
341 target system triple, such as @var{sparc-sun-solaris2.7}, and
342 @var{version} denotes the GCC version, such as 2.95.2.
343 @item
344 Check operating system specific directories (e.g. @file{/usr/ccs/bin} on
345 Sun Solaris).
346 @end itemize
347 Note that these rules do not check for the value of @env{PATH}. You may
348 want to use @option{--with-as} if no assembler is installed in the
349 directories listed above, or if you have multiple assemblers installed
350 and want to choose one that is not found by the above rules.
351
352 @item
353 @html
354 <a name="with-gnu-ld">@option{--with-gnu-ld}</a>
355 @end html
356  @minus{}@minus{} Same as @uref{#with-gnu-as,,@option{--with-gnu-as}}
357 but for linker.
358
359
360 @item
361 @option{--with-ld=@file{/path/to/ld}} @minus{}@minus{} Same as
362 @option{--with-as}, but for the linker.
363
364 @item
365 @option{--with-stabs} @minus{}@minus{} Specify that stabs debugging
366 information should be used instead of whatever format the host normally
367 uses.  Normally GCC uses the same debug format as the host system.
368
369 @item
370 @option{--enable-multilib} @minus{}@minus{} Specify that multiple target
371 libraries should be built to support different target variants, calling
372 conventions, etc.  This is the default.
373
374 @item
375 @option{--enable-threads} @minus{}@minus{} Specify that the target
376 supports threads.  This affects the Objective-C compiler and runtime
377 library, and exception handling for other languages like C++ and Java.
378
379 @item
380 @option{--enable-threads=}@var{lib} @minus{}@minus{} Specify that
381 @var{lib} is the thread support library.  This affects the Objective-C
382 compiler and runtime library, and exception handling for other languages
383 like C++ and Java.
384
385 @item
386 @option{--with-cpu=}@var{cpu} @minus{}@minus{} Specify which cpu variant the
387 compiler should generate code for by default.  This is currently
388 only supported on the some ports, specifically arm, powerpc, and
389 SPARC. If configure does not recognize the model name (e.g. arm700,
390 603e, or ultrasparc) you provide, please check the configure script
391 for a complete list of supported models.
392
393 @item
394 @option{--enable-target-optspace} @minus{}@minus{} Specify that target
395 libraries should be optimized for code space instead of code speed.
396 This is the default for the m32r platform.
397
398 @item
399 @option{--enable-cpp} @minus{}@minus{} Specify that a shell script which
400 emulates traditional cpp functionality should be installed.
401
402 @item
403 @option{--enable-cpplib} @minus{}@minus{} Specify that the functionality of
404 CPP should be integrated into the compiler itself.  This option is
405 not supported by snapshots since November 2000.  In snapshots where
406 it is supported, it is not enabled by default, except for snapshots
407 very close to November 2000.
408
409 @item
410 @option{--without-fast-fixincludes} @minus{}@minus{} Specify that the
411 old, slower method of fixing the system header files should be used.
412 EGCS 1.1.x and older releases default to the slow version. GCC 2.95 and
413 newer releases will default to the fast version.
414
415 @item
416 @option{--enable-version-specific-runtime-libs} @minus{}@minus{} Specify
417 that runtime libraries should be installed in the compiler specific
418 subdirectory (@file{@var{libsubdir}}) rather than the usual places.  In
419 addition, libstdc++'s include files will be installed in
420 @file{@var{libsubdir}/include/g++} unless you overruled it by using
421 @option{--with-gxx-include-dir=}@var{dirname}.  Using this option is
422 particularly useful if you intend to use several versions of GCC in
423 parallel. This is currently supported by @option{libf2c} and
424 @option{libstdc++}.
425
426 @item
427 @option{--enable-languages=}@var{lang1}@option{,}@var{lang2}@option{,...}
428 @minus{}@minus{} Specify that only a particular subset of compilers and
429 their runtime libraries should be built. For a list of valid values for
430 @var{lang}@option{x} you can issue the following command in the
431 @file{gcc} directory of your GCC source tree:@* @samp{grep language=
432 */config-lang.in}@* Currently, you can use any of the following:
433 @code{c++}, @code{f77}, @code{java} and @code{objc}.
434 @code{CHILL} is not currently maintained, and will almost
435 certainly fail to compile.  Note that this switch does not work with
436 EGCS 1.1.2 or older versions of egcs.  It is supported in GCC 2.95
437 and newer versions.@*
438 If you do not pass this flag, all languages available in the @file{gcc}
439 sub-tree will be configured.  Re-defining LANGUAGES when calling
440 @samp{make bootstrap} @strong{*does not*} work anymore, as those
441 language sub-directories might not have been configured!
442
443 @item
444 @option{--disable-libgcj} @minus{}@minus{} Specify that the run-time libraries
445 used by GCJ should not be built.  This is useful in case you intend
446 to use GCJ with some other run-time, or you're going to install it
447 separately, or it just happens not to build on your particular
448 machine.  In general, if the Java front-end is enabled, the GCJ
449 libraries will be enabled too, unless they're known to not work on
450 the target platform.  If GCJ is enabled but libgcj isn't built, you
451 may need to port it; in this case, before modifying the top-level
452 configure.in so that libgcj is enabled by default on this platform,
453 you may use @option{--enable-libgcj} to override the default.
454
455 @item
456 @option{--with-dwarf2} @minus{}@minus{} Specify that the compiler should
457 use DWARF2 debugging information as the default.
458 @end itemize
459
460 Some options which only apply to building cross compilers:
461 @itemize @bullet
462 @item
463 @option{--with-headers=}@var{dir} @minus{}@minus{} Specifies a directory
464 which has target include files.
465 @emph{This options is required} when building a cross
466 compiler, if @file{@var{prefix}/@var{target}/sys-include} doesn't pre-exist.
467 These include files will be copied into the @file{gcc} install directory.
468 Fixincludes will be run on these files to make them compatible with
469 @command{gcc}.
470 @item
471 @option{--with-libs=}@emph{``dir1 dir2 ... dirN''} @minus{}@minus{}
472 Specifies a list of directories which contain the target runtime
473 libraries.  These libraries will be copied into the @file{gcc} install
474 directory.
475 @item
476 @option{--with-newlib} @minus{}@minus{} Specifies that ``newlib'' is
477 being used as the target C library.  This causes @code{__eprintf} to be
478 omitted from libgcc.a on the assumption that it will be provided by
479 newlib.
480 @end itemize
481  
482 Note that each @option{--enable} option has a corresponding
483 @option{--disable} option and that each @option{--with} option has a
484 corresponding @option{--without} option.
485
486 @html
487 <hr>
488 <p>
489 @end html
490 @ifhtml
491 @uref{./index.html,,Return to the GCC Installation page}
492 @end ifhtml
493 @end ifset
494
495 @c ***Building****************************************************************
496 @ifinfo
497 @comment node-name,     next,          previous, up
498 @node    Building, Testing, Configuration, Installing GCC
499 @end ifinfo
500 @ifset buildhtml
501 @html
502 <h1 align="center">Installing GCC: Building</h1>
503 @end html
504 @ifnothtml
505 @chapter Building
506 @end ifnothtml
507 @cindex Installing GCC: Building
508
509 Now that GCC is configured, you are ready to build the compiler and
510 runtime libraries.
511
512 We @strong{highly} recommend that GCC be built using GNU make;
513 other versions may work, then again they might not.
514
515 (For example, many broken versions of make will fail if you use the
516 recommended setup where @var{objdir} is different from @var{srcdir}.)
517
518
519 @section Building a native compiler
520
521 For a native build issue the command @samp{make bootstrap}.  This 
522 will build the entire GCC system, which includes the following steps:
523
524 @itemize @bullet
525 @item
526 Build host tools necessary to build the compiler such as texinfo, bison,
527 gperf.
528
529 @item
530 Build target tools for use by the compiler such as binutils (bfd,
531 binutils, gas, gprof, ld, and opcodes)@*
532 if they have been individually linked 
533 or moved into the top level GCC source tree before configuring.
534
535 @item
536 Perform a 3-stage bootstrap of the compiler.
537
538 @item
539 Perform a comparison test of the stage2 and stage3 compilers.
540
541 @item
542 Build runtime libraries using the stage3 compiler from the previous step.
543  
544 @end itemize
545
546 If you are short on disk space you might consider @samp{make
547 bootstrap-lean} instead.  This is identical to @samp{make
548 bootstrap} except that object files from the stage1 and
549 stage2 of the 3-stage bootstrap of the compiler are deleted as
550 soon as they are no longer needed.
551
552
553 If you want to save additional space during the bootstrap and in
554 the final installation as well, you can build the compiler binaries
555 without debugging information with @samp{make CFLAGS='-O' LIBCFLAGS='-g
556 -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap}.  This will save
557 roughly 40% of disk space both for the bootstrap and the final installation.
558 (Libraries will still contain debugging information.)
559
560 If you used the flag @option{--enable-languages=...} to restrict
561 the compilers to be built, only those you've actually enabled will be
562 built. This will of course only build those runtime libraries, for
563 which the particular compiler has been built.  Please note,
564 that re-defining LANGUAGES when calling @samp{make bootstrap}
565 @strong{*does not*} work anymore!
566
567
568 @section Building a cross compiler
569
570 We recommend reading the
571 @uref{http://www.objsw.com/CrossGCC/,,crossgcc FAQ}
572 for information about building cross compilers.
573
574 When building a cross compiler, it is not generally possible to do a
575 3-stage bootstrap of the compiler.  This makes for an interesting problem
576 as parts of GCC can only be built with GCC.
577
578 To build a cross compiler, we first recommend building and installing a
579 native compiler.  You can then use the native GCC compiler to build the
580 cross compiler.
581
582 Assuming you have already installed a native copy of GCC and configured
583 your cross compiler, issue the command @samp{make}, which performs the
584 following steps:
585
586 @itemize @bullet
587 @item
588 Build host tools necessary to build the compiler such as texinfo, bison,
589 gperf.
590
591 @item
592 Build target tools for use by the compiler such as binutils (bfd,
593 binutils, gas, gprof, ld, and opcodes)
594 if they have been individually linked or moved into the top level GCC source
595 tree before configuring.
596
597 @item
598 Build the compiler (single stage only).
599
600 @item
601 Build runtime libraries using the compiler from the previous step.
602 @end itemize
603
604 Note that if an error occurs in any step the make process will exit.
605
606 @section Building in parallel
607
608 If you have a multiprocessor system you can use @samp{make bootstrap
609 MAKE="make -j 2" -j 2} or just @samp{make -j 2 bootstrap}
610 for GNU Make 3.79 and above instead of just @samp{make bootstrap}
611 when building GCC.  You can use a bigger number instead of two if
612 you like.  In most cases, it won't help to use a number bigger than
613 the number of processors in your machine.
614
615 @html
616 <hr>
617 <p>
618 @end html
619 @ifhtml
620 @uref{./index.html,,Return to the GCC Installation page}
621 @end ifhtml
622 @end ifset
623
624 @c ***Testing*****************************************************************
625 @ifinfo
626 @comment node-name,     next,          previous, up
627 @node    Testing, Final install, Building, Installing GCC
628 @end ifinfo
629 @ifset testhtml
630 @html
631 <h1 align="center">Installing GCC: Testing</h1>
632 @end html
633 @ifnothtml
634 @chapter Installing GCC: Testing
635 @end ifnothtml
636 @cindex Testing
637 @cindex Installing GCC: Testing
638 @cindex Testsuite
639
640 @strong{Please note that this is only applicable 
641 to current development versions of GCC and GCC 3.0 or later. 
642 GCC 2.95.x does not come with a testsuite.}
643
644 Before you install GCC, you might wish to run the testsuite. This
645 step is optional and may require you to download additional software.
646
647 First, you must have @uref{download.html,,downloaded the testsuites}. 
648 The full distribution contains testsuites; only if you downloaded the 
649 ``core'' compiler plus any front ends, you do not have the testsuites.
650
651 Second, you must have a @uref{http://www.gnu.org/software/dejagnu/,,current version of DejaGnu} installed;
652 dejagnu 1.3 is not sufficient.
653
654 Now you may need specific preparations:
655
656 @itemize @bullet
657 @item
658 In order to run the libio tests on targets which do not fully
659 support Unix/POSIX commands (e.g. Cygwin), the references to the dbz
660 directory have to be deleted from @code{libio/configure.in}.
661
662 @item
663 The following environment variables must be set appropriately, as in
664 the following example (which assumes that DejaGnu has been installed
665 under @code{/usr/local}):
666
667 @example
668      TCL_LIBRARY = /usr/local/share/tcl8.0
669      DEJAGNULIBS = /usr/local/share/dejagnu
670 @end example
671
672 On systems such as Cygwin, these paths are required to be actual
673 paths, not mounts or links; presumably this is due to some lack of
674 portability in the DejaGnu code.
675
676 @end itemize
677
678 Finally, you can run the testsuite (which may take a long time):
679 @example
680      cd @emph{objdir}; make -k check
681 @end example
682
683 The testing process will try to test as many components in the GCC
684 distribution as possible, including the C, C++ and Fortran compilers as
685 well as the C++ runtime libraries.
686
687 @section How can I run the test suite on selected tests?
688
689 As a first possibility to cut down the number of tests that are run it is
690 possible to use @samp{make check-gcc} or @samp{make check-g++}
691 in the gcc subdirectory of the object directory. To further cut down the
692 tests the following is possible:
693
694 @example
695     make check-gcc RUNTESTFLAGS="execute.exp <other options>"
696 @end example
697
698 This will run all gcc execute tests in the testsuite.
699
700 @example
701     make check-g++ RUNTESTFLAGS="old-deja.exp=9805* <other options>"
702 @end example
703
704 This will run the g++ "old-deja" tests in the testsuite where the filename
705 matches 9805*.
706
707 The *.exp files are located in the testsuite directories of the GCC
708 source, the most important ones being compile.exp, execute.exp, dg.exp
709 and old-deja.exp. To get a list of the possible *.exp files, pipe the
710 output of @samp{make check} into a file and look at the
711 @samp{Running ...  .exp} lines.
712
713 @section How to interpret test results
714
715 After the testsuite has run you'll find various *.sum and *.log
716 files in the testsuite subdirectories. The *.log files contain a
717 detailed log of the compiler invocations and the corresponding
718 results, the *.sum files summarize the results. These summaries list
719 all the tests that have been run with a corresponding status code:
720
721 @itemize @bullet
722 @item
723 PASS: the test passed as expected
724 @item
725 XPASS: the test unexpectedly passed
726 @item
727 FAIL: the test unexpectedly failed
728 @item
729 XFAIL: the test failed as expected
730 @item
731 UNSUPPORTED: the test is not supported on this platform
732 @item
733 ERROR: the testsuite detected an error
734 @item
735 WARNING: the testsuite detected a possible problem
736 @end itemize
737
738 It is normal for some tests to report unexpected failures.  At the
739 current time our testing harness does not allow fine grained control
740 over whether or not a test is expected to fail.  We expect to fix this
741 problem in future releases.
742
743
744 @section Submitting test results
745
746 If you want to report the results to the GCC project, use the
747 @code{contrib/test_summary} shell script. Start it in the @emph{objdir} with
748
749 @example
750     @emph{srcdir}/contrib/test_summary -p your_commentary.txt -m gcc-testresults@@gcc.gnu.org |sh
751 @end example
752
753 This script uses the @code{Mail} program to send the results, so
754 make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is
755 prepended to the testsuite summary and should contain any special
756 remarks you have on your results or your build environment. Please
757 do not edit the testsuite result block or the subject line, as these
758 messages are automatically parsed and presented at the 
759 @uref{http://gcc.gnu.org/testresults/,,GCC testresults} web
760 page.  Here you can also gather information on how specific tests
761 behave on different platforms and compare them with your results. A
762 few failing testcases are possible even on released versions and you
763 should look here first if you think your results are unreasonable.
764
765 @end ifset
766
767 @c ***Final install***********************************************************
768 @ifinfo
769 @comment node-name,     next,          previous, up
770 @node    Final install, , Testing, Installing GCC
771 @end ifinfo
772 @ifset finalinstallhtml
773 @html
774 <h1 align="center">Installing GCC: Final installation</h1>
775 @end html
776 @ifnothtml
777 @chapter Installing GCC: Final installation
778 @end ifnothtml
779
780 Now that GCC has been built and tested, you can install it with
781 @samp{cd @emph{objdir}; make install} for a native compiler or
782 @samp{cd @emph{objdir}; make install LANGUAGES="c c++"} for 
783 a cross compiler (note installing cross compilers will be easier in the 
784 next release!).
785
786 That step completes the installation of GCC; user level binaries can
787 be found in @file{@var{prefix}/bin} where @var{prefix} is the value you
788 specified with the @option{--prefix} to configure (or @file{/usr/local}
789 by default).
790
791 If you don't mind, please quickly review the 
792 @uref{http://gcc.gnu.org/gcc-2.95/buildstat.html,,build status page}.
793 If your system is not listed, send a note to
794 @uref{mailto:gcc@@gcc.gnu.org,,gcc@@gcc.gnu.org} indicating
795 that you successfully built and installed GCC.
796
797 Include the output from running @file{@var{srcdir}/config.guess}.  (Do not
798 send us the config.guess file itself, just the output from running
799 it!)
800
801 If you find a bug, please report it following our
802 @uref{../bugs.html,,bug reporting guidelines}.
803
804 @html
805 <hr>
806 <p>
807 @end html
808 @ifhtml
809 @uref{./index.html,,Return to the GCC Installation page}
810 @end ifhtml
811 @end ifset
812
813 @c ***Binaries****************************************************************
814 @ifinfo
815 @comment node-name,     next,          previous, up
816 @node    Binaries, Specific, Installing GCC, Top
817 @end ifinfo
818 @ifset binarieshtml
819 @html
820 <h1 align="center">Installing GCC: Binaries</h1>
821 @end html
822 @ifnothtml
823 @chapter Installing GCC: Binaries
824 @end ifnothtml
825 @cindex Binaries
826 @cindex Installing GCC: Binaries
827
828 We are often asked about pre-compiled versions of GCC. While we cannot
829 provide these for all platforms, below you'll find links to binaries for
830 various platforms where creating them by yourself is not easy due to various
831 reasons.
832
833 Please note that we did not create these binaries, nor do we
834 support them.  If you have any problems installing them, please
835 contact their makers.
836
837 @itemize
838 @item
839 AIX:
840 @itemize
841 @item
842 @uref{http://www-frec.bull.com/docs/download.htm,,Bull's Freeware and
843 Shareware Archive for AIX};
844
845 @item
846 @uref{http://aixpdlib.seas.ucla.edu,,UCLA Software Library for AIX};
847 @end itemize
848
849 @item
850 DOS - @uref{http://www.delorie.com/djgpp/,,DJGPP};
851
852 @item
853 @uref{http://hpux.cae.wisc.edu/,,HP-UX Porting Center};
854
855 @item
856 @uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
857 OpenServer/Unixware};
858
859 @item
860 Solaris (SPARC, Intel) - @uref{http://www.sunfreeware.com/,,Sunfreeware};
861
862 @item
863 SGI - @uref{http://freeware.sgi.com/,,SGI Freeware};
864
865 @item
866 Windows 95, 98, and NT:
867 @itemize
868 @item
869 The @uref{http://sources.redhat.com/cygwin/,,Cygwin} project;
870 @item
871 @uref{http://www.xraylith.wisc.edu/~khan/software/gnu-win32/,,GNU Win32}
872 related projects by Mumit Khan.
873 @end itemize
874
875 @item
876 @uref{ftp://ftp.thewrittenword.com/packages/free/by-name/gcc-2.95.2/,,The
877 Written Word} offers binaries for Solaris 2.5.1, 2.6, 2.7/SPARC, 2.7/Intel,
878 IRIX 6.2, 6.5, Digital UNIX 4.0D, HP-UX 10.20, and HP-UX 11.00.
879
880 @item
881 Hitachi H8/300[HS] - 
882 @uref{http://h8300-hms.sourceforge.net/,,GNU Development Tools for the 
883 Hitachi H8/300[HS] Series}
884
885 @end itemize
886
887 In addition to those specific offerings, you can get a binary
888 distribution CD-ROM from the
889 @uref{http://www.fsf.org/order/order.html,,Free Software Foundation}. 
890 It contains binaries for a number of platforms, and
891 includes not only GCC, but other stuff as well. The current CD does
892 not contain the latest version of GCC, but it should allow
893 bootstrapping the compiler. An updated version of that disk is in the
894 works.
895
896 @html
897 <hr>
898 <p>
899 @end html
900 @ifhtml
901 @uref{./index.html,,Return to the GCC Installation page}
902 @end ifhtml
903 @end ifset
904
905 @c ***Specific****************************************************************
906 @ifinfo
907 @comment node-name,     next,          previous, up
908 @node    Specific, Concept Index, Binaries, Top
909 @end ifinfo
910 @ifset specifichtml
911 @html
912 <h1 align="center">Host/target specific installation notes for GCC</h1>
913 @end html
914 @ifnothtml
915 @chapter Host/target specific installation notes for GCC
916 @end ifnothtml
917 @cindex Specific
918 @cindex Specific installation notes
919 @cindex Target specific installation
920 @cindex Host specific installation
921 @cindex Target specific installation notes
922
923 Please read this document carefully @emph{before} installing the
924 GNU Compiler Collection on your machine.
925
926 @itemize
927 @item
928 @uref{#alpha*-dec-linux*,,alpha*-dec-linux*}
929 @item
930 @uref{#alpha*-dec-osf*,,alpha*-dec-osf*}
931 @item
932 @uref{#arm*-*-linux-gnu,,arm*-*-linux-gnu}
933 @item
934 @uref{#avr,,avr}
935 @item
936 @uref{#dos,,DOS}
937 @item
938 @uref{#h8300-hms,,h8300-hms}
939 @item
940 @uref{#hppa*-hp-hpux*,,hppa*-hp-hpux*}
941 @item
942 @uref{#hppa*-hp-hpux9,,hppa*-hp-hpux9}
943 @item
944 @uref{#hppa*-hp-hpux10,,hppa*-hp-hpux10}
945 @item
946 @uref{#hppa*-hp-hpux11,,hppa*-hp-hpux11}
947 @item
948 @uref{#*-*-linux-gnu,,*-*-linux-gnu}
949 @item
950 @uref{#ix86-*-linux*,,i?86-*-linux*}
951 @item
952 @uref{#ix86-*-sco3.2v5*,,i?86-*-sco3.2v5*}
953 @item
954 @uref{#ix86-*-solaris*,,i?86-*-solaris*}
955 @item
956 @uref{#ix86-*-udk,,i?86-*-udk}
957 @item
958 @uref{#*-ibm-aix*,,*-ibm-aix*}
959 @item
960 @uref{#m68k-*-nextstep*,,m68k-*-nextstep*}
961 @item
962 @uref{#m68k-sun-sunos4.1.1,,m68k-sun-sunos4.1.1}
963 @item
964 @uref{#mips*-sgi-irix[45],,mips*-sgi-irix[45]}
965 @item
966 @uref{#mips*-sgi-irix6,,mips*-sgi-irix6}
967 @item
968 @uref{#powerpc-*-linux-gnu*,,powerpc-*-linux-gnu*}
969 @item
970 @uref{#*-*-solaris*,,*-*-solaris*}
971 @item
972 @uref{#sparc-sun-solaris*,,sparc-sun-solaris*}
973 @item
974 @uref{#sparc-sun-solaris2.7,,sparc-sun-solaris2.7}
975 @item
976 @uref{#*-sun-solaris2.8,,*-sun-solaris2.8}
977 @item
978 @uref{#sunv5,,Sun V5.0 Compiler Bugs}
979 @item
980 @uref{#sparc-sun-sunos*,,sparc-sun-sunos*}
981 @item
982 @uref{#sparc-unknown-linux-gnulibc1,,sparc-unknown-linux-gnulibc1}
983 @item
984 @uref{#sparc64-*-*,,sparc64-*-*}
985 @item
986 @uref{#windows,,Microsoft Windows}
987 @item
988 @uref{#os2,,OS/2}
989 @item
990 @uref{#older,,Older systems}
991 @end itemize
992
993 @itemize
994 @item
995 @uref{#elf_targets,,all ELF targets} (SVR4, Solaris, etc.)
996 @end itemize
997
998
999 @html
1000 <!-- -------- host/target specific issues start here ---------------- -->
1001 <hr>
1002 <h3><a name="alpha*-dec-linux*">alpha*-dec-linux*</a></h3>
1003 @end html
1004
1005 We require binutils 2.11 or newer.  Previous binutils releases
1006 had a number of problems with DWARF2 debugging information, not
1007 the least of which is incorrect linking of shared libraries.
1008
1009 @html
1010 </p>
1011 <hr>
1012 <h3><a name="alpha*-dec-osf*">alpha*-dec-osf*</a></h3>
1013 @end html
1014
1015 If you install a shared libstdc++ and, when you link a non-trivial C++
1016 program (for example, @file{gcc/testsuite/g++.other/delete3.C}),
1017 the linker reports a couple of errors about multiply-defined symbols
1018 (for example, @code{nothrow}, @code{__throw} and
1019 @code{terminate(void)}), you've probably got a linker bug, for
1020 which there's no known fix.  The officially recommended work-around is
1021 to remove the shared libstdc++.
1022
1023 An alternative solution is to arrange that all symbols from
1024 @code{libgcc} get copied to the shared @code{libstdc++};
1025 see detailed solution below.  (Surprising as it may seem, this does
1026 indeed fix the problem!)  @emph{Beware} that this may bring you
1027 binary-compatibility problems in the future, if you don't use the same
1028 work-around next time you build @code{libstdc++}: if programs
1029 start to depend on @code{libstdc++} to provide symbols that used
1030 to be only in @code{libgcc}, you must arrange that
1031 @code{libstdc++} keeps providing them, otherwise the programs
1032 will have to be relinked.
1033
1034 The magic spell is to add @code{-Wl,-all,-lgcc,-none} to the
1035 definition of macro @code{SHDEPS} in
1036 @file{libstdc++/config/dec-osf.ml} @emph{before}
1037 @file{alpha*-dec-osf*/libstdc++/Makefile} is created (a 
1038 @uref{dec-osf-shlibstdc++.patch,,patch} 
1039 that does just that is available).  If the Makefile already exists, run
1040 @file{./config.status} within directory
1041 @file{alpha*-dec-osf*/libstdc++} (and
1042 @file{alpha*-dec-osf*/ieee/libstdc++}, if it also exists).
1043 Remove any existing @file{libstdc++.so*} from such directories,
1044 and run @samp{make all-target-libstdc++} in the top-level
1045 directory, then @samp{make install-target-libstdc++}.
1046
1047 If you have already removed the build tree, you may just remove
1048 @file{libstdc++.so.2.10.0} from the install tree and re-create
1049 it with the command 
1050 @samp{gcc -shared -o libstdc++.so.2.10.0 -Wl,-all,-lstdc++,-lgcc,-none -lm}.
1051 If the @file{ieee}
1052 sub-directory exists, repeat this command in it, with the additional
1053 flag @option{-mieee}.
1054
1055 @html
1056 </p>
1057 <hr>
1058 <h3><a name="arm*-*-linux-gnu">arm*-*-linux-gnu</a></h3>
1059 @end html
1060
1061 We require GNU binutils 2.10 or newer.
1062
1063 @html
1064 </p>
1065 <hr>
1066 <h3><a name="avr">avr</a></h3>
1067 @end html
1068
1069 Use @samp{configure --target=avr} 
1070 @option{--enable-languages="c"}' to configure GCC.
1071
1072 Further installation notes and other useful information about AVR tools
1073 can also be obtained from:
1074
1075 @itemize @bullet
1076 @item
1077 @uref{http://home.overta.ru/users/denisc,,http://home.overta.ru/users/denisc}
1078 @item
1079 @uref{http://www.itnet.pl/amelektr/avr,,http://www.itnet.pl/amelektr/avr}
1080 @end itemize
1081
1082 We @emph{strongly} recommend using binutils 2.11 or newer.
1083
1084 The following error:
1085 @example
1086   Error: register required
1087 @end example
1088
1089 indicates that you should upgrade to a newer version of the binutils.
1090
1091 @html
1092 </p>
1093 <hr>
1094 <h3><a name="dos">DOS</a></h3>
1095 @end html
1096
1097 Please have a look at our @uref{binaries.html,,binaries page}.
1098
1099 @html
1100 </p>
1101 <hr>
1102 <h3><a name="h8300-hms">h8300-hms</a></h3>
1103 @end html
1104
1105 Please have a look at our @uref{binaries.html,,binaries page}.
1106
1107 @html
1108 </p>
1109 <hr>
1110 <h3><a name="hppa*-hp-hpux*">hppa*-hp-hpux*</a></h3>
1111 @end html
1112
1113 We @emph{highly} recommend using gas/binutils-2.8 or newer on all hppa
1114 platforms; you may encounter a variety of problems when using the HP 
1115 assembler.
1116
1117 Specifically, @option{-g} does not work on HP-UX (since that system
1118 uses a peculiar debugging format which GCC does not know about), unless you
1119 use GAS and GDB and configure GCC with the
1120 @uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
1121 @option{--with-as=...} options.
1122
1123 If you wish to use pa-risc 2.0 architecture support, you must use either
1124 the HP assembler, gas/binutils-2.11 or a recent
1125 @uref{ftp://sources.redhat.com/pub/binutils/snapshots,,snapshot of gas}.
1126
1127 More specific information to hppa*-hp-hpux* targets follows.
1128
1129 @html
1130 </p>
1131 <hr>
1132 <h3><a name="hppa*-hp-hpux9">hppa*-hp-hpux9</a></h3>
1133 @end html
1134
1135 The HP assembler has major problems on this platform.  We've tried to work
1136 around the worst of the problems.  However, those workarounds may be causing
1137 linker crashes in some circumstances; the workarounds also probably prevent
1138 shared libraries from working.  Use the GNU assembler to avoid these problems.
1139
1140
1141 The configuration scripts for GCC will also trigger a bug in the hpux9
1142 shell.  To avoid this problem set @env{CONFIG_SHELL} to @file{/bin/ksh}
1143 and @env{SHELL} to @file{/bin/ksh} in your environment.
1144
1145
1146 @html
1147 </p>
1148 <hr>
1149 <h3><a name="hppa*-hp-hpux10">hppa*-hp-hpux10</a></h3>
1150 @end html
1151
1152 For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch 
1153 @code{PHCO_19798} from HP.  HP has two sites which provide patches free of 
1154 charge:
1155
1156 @itemize @bullet
1157 @item
1158 @html
1159 <a href="http://us-support.external.hp.com">US, Canada, Asia-Pacific, and
1160 Latin-America</a>
1161 @end html
1162 @ifnothtml
1163 @uref{http://us-support.external.hp.com,,}US, Canada, Asia-Pacific, and
1164 Latin-America
1165 @end ifnothtml
1166 @item
1167 @uref{http://europe-support.external.hp.com,,Europe}
1168 @end itemize
1169
1170 The HP assembler on these systems is much better than the hpux9 assembler,
1171 but still has some problems.  Most notably the assembler inserts timestamps
1172 into each object file it creates, causing the 3-stage comparison test to fail
1173 during a @samp{make bootstrap}.  You should be able to continue by 
1174 saying @samp{make all} after getting the failure from @samp{make 
1175 bootstrap}.
1176
1177
1178 @html
1179 </p>
1180 <hr>
1181 <h3><a name="hppa*-hp-hpux11">hppa*-hp-hpux11</a></h3>
1182 @end html
1183
1184 GCC 2.95.2 does not support HP-UX 11, and it cannot generate 64-bit
1185 object files. Current (as of late 2000) snapshots and GCC 3.0 do support
1186 HP-UX 11.
1187
1188
1189 @html
1190 </p>
1191 <hr>
1192 <h3><a name="*-*-linux-gnu">*-*-linux-gnu</a></h3>
1193 @end html
1194
1195 If you use glibc 2.2 (or 2.1.9x), GCC 2.95.2 won't install
1196 out-of-the-box.  You'll get compile errors while building libstdc++.
1197 The patch @uref{glibc-2.2.patch,,glibc-2.2.patch}, that is to be
1198 applied in the GCC source tree, fixes the compatibility problems.
1199
1200 @html
1201 </p>
1202 <hr>
1203 <h3><a name="ix86-*-linux*">i?86-*-linux*</a></h3>
1204 @end html
1205
1206 You will need binutils-2.9.1.0.15 or newer for exception handling to work.
1207
1208 If you receive Signal 11 errors when building on GNU/Linux, then it is
1209 possible you have a hardware problem.  Further information on this can be
1210 found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
1211
1212 @html
1213 </p>
1214 <hr>
1215 <h3><a name="ix86-*-sco3.2v5*">i?86-*-sco3.2v5*</a></h3>
1216 @end html
1217
1218 Unlike earlier versions of GCC, the ability to generate COFF with this
1219 target is no longer provided.
1220
1221 Earlier versions of GCC emitted Dwarf-1 when generating ELF to allow
1222 the system debugger to be used.  That support was too burdensome to
1223 maintain.  GCC now emits only dwarf-2 for this target.  This means you
1224 may use either the UDK debugger or GDB to debug programs built by this
1225 version of GCC.
1226
1227 If you are building languages other than C, you must follow the instructions
1228 about invoking @samp{make bootstrap} because the native OpenServer
1229 compiler will build a @command{cc1plus} that will not correctly parse many
1230 valid C++ programs including those in @file{libgcc.a}.  
1231 @strong{You must do a @samp{make bootstrap} if you are building with the 
1232 native compiler.}
1233
1234 Use of the @option{-march-pentiumpro} flag can result in
1235 unrecognized opcodes when using the native assembler on OS versions before
1236 5.0.6. (Support for P6 opcodes was added to the native ELF assembler in
1237 that version.)  While it's rather rare to see these emitted by GCC yet, 
1238 errors of the basic form:
1239
1240 @example
1241   /usr/tmp/ccaNlqBc.s:22:unknown instruction: fcomip
1242   /usr/tmp/ccaNlqBc.s:50:unknown instruction: fucomip
1243 @end example
1244
1245 are symptoms of this problem.  You may work around this by not
1246 building affected files with that flag, by using the GNU assembler, or
1247 by using the assembler provided with the current version of the OS.
1248 Users of GNU assembler should see the note below for hazards on doing
1249 so.
1250
1251 The native SCO assembler that is provided with the OS at no
1252 charge is normally required.  If, however, you must be able to use
1253 the GNU assembler (perhaps you're compiling code with asms that
1254 require GAS syntax) you may configure this package using the flags
1255 @uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}}.  You must
1256 use a recent version of GNU binutils; versions past 2.9.1 seem to work
1257 well.
1258
1259 In general, the @option{--with-gnu-as} option isn't as well tested
1260 as the native assembler.
1261
1262 Look in @file{gcc/config/i386/sco5.h} (search for "messy") for
1263 additional OpenServer-specific flags.
1264
1265 Systems based on OpenServer before 5.0.4 (@samp{uname -X}
1266 will tell you what you're running) require TLS597 from ftp.sco.com/TLS
1267 for C++ constructors and destructors to work right.
1268
1269 The system linker in (at least) 5.0.4 and 5.0.5 will sometimes
1270 do the wrong thing for a construct that GCC will emit for PIC
1271 code.  This can be seen as execution testsuite failures when using
1272 -fPIC on 921215-1.c, 931002-1.c, nestfunc-1.c, and gcov-1.c.
1273 For 5.0.5, an updated linker that will cure this problem is
1274 available.  You must install both 
1275 @uref{ftp://ftp.sco.com/Supplements/rs505a/,,ftp://ftp.sco.com/Supplements/rs505a/}
1276 and @uref{ftp://ftp.sco.com/SLS/,,OSS499A}.
1277
1278 The dynamic linker in OpenServer 5.0.5 (earlier versions may show
1279 the same problem) aborts on certain g77-compiled programs.  It's particularly
1280 likely to be triggered by building Fortran code with the @option{-fPIC} flag.
1281 Although it's conceivable that the error could be triggered by other
1282 code, only G77-compiled code has been observed to cause this abort.
1283 If you are getting core dumps immediately upon execution of your
1284 g77 program - and especially if it's compiled with -fPIC - try applying
1285 @uref{sco_osr5_g77.patch,,@file{sco_osr5_g77.patch}} to your libf2c and 
1286 rebuilding GCC.  
1287 Affected faults, when analyzed in a debugger, will show a stack
1288 backtrace with a fault occurring in @code{rtld()} and the program
1289 running as @file{/usr/lib/ld.so.1}.  This problem has been reported to SCO 
1290 engineering and will hopefully be addressed in later releases.
1291
1292
1293 @html
1294 </p>
1295 <hr>
1296 <h3><a name="ix86-*-solaris*">i?86-*-solaris*</a></h3>
1297 @end html
1298
1299 GCC 2.95.2, when configured to use the GNU assembler, would invoke
1300 it with the @code{-s} switch, that GNU as up to 2.9.5.0.12 does
1301 not support.  If you'd rather not use a newer GNU as nor the native
1302 assembler, you'll need the patch 
1303 @uref{x86-sol2-gas.patch,,@file{x86-sol2-gas.patch}}.
1304
1305
1306 @html
1307 </p>
1308 <hr>
1309 <h3><a name="ix86-*-udk">i?86-*-udk</a></h3>
1310 @end html
1311
1312 This target emulates the SCO Universal Development Kit and requires that
1313 package be installed.  (If it is installed, you will have a 
1314 @file{/udk/usr/ccs/bin/cc } file present.)  It's very much like the 
1315 @code{i?86-*-unixware7*} target
1316 but is meant to be used when hosting on a system where UDK isn't the
1317 default compiler such as OpenServer 5 or Unixware 2.  This target will
1318 generate binaries that will run on OpenServer, Unixware 2, or Unixware 7, 
1319 with the same warnings and caveats as the SCO UDK.
1320
1321 You can stage1 with either your native compiler or with UDK.   If you
1322 don't do a full bootstrap when initially building with your native compiler
1323 you will have an utterly unusable pile of bits as your reward.
1324
1325 This target is a little tricky to build because we have to distinguish
1326 it from the native tools (so it gets headers, startups, and libraries
1327 from the right place) while making the tools not think we're actually 
1328 building a cross compiler.   The easiest way to do this is with a configure
1329 command like this:
1330
1331 @samp{CC=/udk/usr/ccs/bin/cc <i>/your/path/to/</i>gcc/configure 
1332 --host=i686-pc-udk --target=i686-pc-udk --program-prefix=udk-}
1333
1334 @emph{You should substitute 'i686' in the above command with the appropriate
1335 processor for your host.}
1336
1337 You should follow this with a @samp{make bootstrap}  then
1338 @samp{make install}.  You can then access the UDK-targeted GCC 
1339 tools by adding @command{udk-} before the commonly known name.  For
1340 example, to invoke the C compiler, you would use @command{udk-gcc}.
1341 They will coexist peacefully with any native-target GCC tools you may
1342 have installed.
1343
1344
1345 @html
1346 </p>
1347 <hr>
1348 <h3><a name="*-ibm-aix*">*-ibm-aix*</a></h3>
1349 <!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
1350 @end html
1351
1352 AIX Make frequently has problems with GCC makefiles.  GNU Make 3.76 or
1353 newer is recommended to build on this platform.
1354
1355 Errors involving "alloca" when building GCC generally are due
1356 to an incorrect definition of @var{CC} in the Makefile or mixing files
1357 compiled with the native C compiler and GCC.  During the stage1 phase of
1358 the build, the native AIX compiler @strong{must} be invoked as "cc"
1359 (not "xlc").  Once @command{configure} has been informed of
1360 "xlc", one needs to use @samp{make distclean} to remove the
1361 configure cache files and ensure that @env{CC} environment variable
1362 does not provide a definition that will confuse @command{configure}.
1363 If this error occurs during stage2 or later, then the problem most likely
1364 is the version of Make (see above).
1365
1366 Binutils 2.10 does not support AIX 4.3.  Binutils available from the
1367 @uref{http://www-1.ibm.com/servers/aix/products/aixos/linux/,,AIX
1368 Toolbox for Linux: GNU and Open Source tools for AIX};
1369 website does work.  Binutils 2.11 is expected to include AIX 4.3
1370 support.  The GNU Assembler is necessary for libstdc++ to build.  The
1371 AIX native ld still is recommended.  The native AIX tools do
1372 interoperate with GCC.
1373
1374 Linking executables and shared libraries may produce warnings of
1375 duplicate symbols.  The assembly files generated by GCC for AIX always
1376 have included multiple symbol definitions for certain global variable
1377 and function declarations in the original program.  The warnings should
1378 not prevent the linker from producing a correct library or runnable
1379 executable.
1380
1381 AIX 4.3 utilizes a "large format" archive to support both 32-bit and
1382 64-bit object modules.  The routines provided in AIX 4.3.0 and AIX 4.3.1
1383 to parse archive libraries did not handle the new format correctly.
1384 These routines are used by GCC and result in error messages during
1385 linking such as "not a COFF file".  The version of the routines shipped
1386 with AIX 4.3.1 should work for a 32-bit environment.  The @option{-g}
1387 option of the archive command may be used to create archives of 32-bit
1388 objects using the original "small format".  A correct version of the
1389 routines is shipped with AIX 4.3.2.
1390
1391 Some versions of the AIX binder (linker) can fail with a relocation
1392 overflow severe error when the @option{-bbigtoc} option is used to link
1393 GCC-produced object files into an executable that overflows the TOC.  A fix
1394 for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
1395 available from IBM Customer Support and from its
1396 @uref{http://service.boulder.ibm.com/,,service.boulder.ibm.com}
1397 website as PTF U455193.
1398
1399 The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
1400 with a segmentation fault when invoked by any version of GCC.  A fix for
1401 APAR IX87327 is available from IBM Customer Support and from its
1402 @uref{http://service.boulder.ibm.com/,,service.boulder.ibm.com}
1403 website as PTF U461879.  This fix is incorporated in AIX 4.3.3 and above.
1404
1405 The initial assembler shipped with AIX 4.3.0 generates incorrect object
1406 files.  A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
1407 TO ASSEMBLE/BIND) is available from IBM Customer Support and from its
1408 @uref{http://service.boulder.ibm.com/,,service.boulder.ibm.com}
1409 website as PTF U453956.  This fix is incorporated in AIX 4.3.1 and above.
1410
1411 AIX provides National Language Support (NLS).  Compilers and assemblers
1412 use NLS to support locale-specific representations of various data
1413 formats including floating-point numbers (e.g., "."  vs "," for
1414 separating decimal fractions).  There have been problems reported where
1415 GCC does not produce the same floating-point formats that the assembler
1416 expects.  If one encouters this problem, set the @env{LANG}
1417 environment variable to "C" or "En_US".
1418
1419
1420 @html
1421 </p>
1422 <hr>
1423 <h3><a name="m68k-*-nextstep*">m68k-*-nextstep*</a></h3>
1424 @end html
1425
1426 You absolutely @strong{must} use GNU sed and GNU make on this platform.
1427
1428
1429 On NEXTSTEP 3.x where x < 3 the build of GCC will abort during  
1430 stage1 with an error message like this:
1431
1432 @example
1433   _eh
1434   /usr/tmp/ccbbsZ0U.s:987:Unknown pseudo-op: .section
1435   /usr/tmp/ccbbsZ0U.s:987:Rest of line ignored. 1st junk character
1436   valued 95 (_).
1437 @end example
1438
1439 The reason for this is the fact that NeXT's assembler for these  
1440 versions of the operating system does not support the .section  
1441 pseudo op that's needed for full C++ exception functionality.
1442
1443 As NeXT's assembler is a derived work from GNU as, a free  
1444 replacement that does can be obtained at 
1445 @uref{ftp://ftp.next.peak.org:/next-ftp/next/apps/devtools/as.3.3.NIHS.s.tar.gz,,ftp://ftp.next.peak.org:/next-ftp/next/apps/devtools/as.3.3.NIHS.s.tar.gz}.
1446
1447 If you try to build the integrated C++ & C++ runtime libraries on this system
1448 you will run into trouble with include files.  The way to get around this is
1449 to use the following sequence.  Note you must have write permission to
1450 the directory @var{prefix} you specified in the configuration process of GCC
1451 for this sequence to work.
1452
1453 @example
1454   cd bld-gcc
1455   make all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1456   cd gcc
1457   make bootstrap
1458   make install-headers-tar
1459   cd ..
1460   make bootstrap3
1461 @end example
1462
1463
1464 @html
1465 </p>
1466 <hr>
1467 <h3><a name="m68k-sun-sunos4.1.1">m68k-sun-sunos4.1.1</a></h3>
1468 @end html
1469
1470 It is reported that you may need the GNU assembler on this platform.
1471
1472
1473 @html
1474 </p>
1475 <hr>
1476 <h3><a name="mips*-sgi-irix[45]">mips*-sgi-irix[45]</a></h3>
1477 @end html
1478
1479 You must use GAS on these platforms, as the native assembler can not handle 
1480 the code for exception handling support. Either of these messages indicates 
1481 that you are using the MIPS assembler when instead you should be using GAS:
1482
1483 @samp{  as0: Error: ./libgcc2.c, line 1:Badly delimited numeric literal
1484   .4byte $LECIE1-$LSCIE1
1485   as0: Error: ./libgcc2.c, line 1:malformed statement}
1486
1487 or:
1488
1489 @samp{  as0: Error: /src/bld-gcc/gcc/libgcc2.c, line 1:undefined symbol in expression
1490   .word $LECIE1-$LSCIE1}
1491
1492 These systems don't have ranlib, which various components in GCC need; you
1493 should be able to avoid this problem by installing GNU binutils, which includes
1494 a functional ranlib for this system.
1495
1496 You may get the following warning on irix4 platforms, it can be safely
1497 ignored.
1498 @example
1499   warning: foo.o does not have gp tables for all its sections.
1500 @end example
1501
1502 When building GCC, the build process loops rebuilding cc1 over and
1503 over again.  This happens on mips-sgi-irix5.2, and possibly other platforms.@*
1504 It has been reported that this is a known bug in the make shipped with
1505 IRIX 5.2.  We recommend you use GNU make instead of the vendor supplied
1506 make program; however, you may have success with "smake" on IRIX 5.2 if
1507 you do not have GNU make available.
1508
1509 See @uref{http://freeware.sgi.com/,,http://freeware.sgi.com/} for more
1510 information about using GCC on IRIX platforms.
1511
1512
1513 @html
1514 </p>
1515 <hr>
1516 <h3><a name="mips*-sgi-irix6">mips*-sgi-irix6</a></h3>
1517 @end html
1518
1519 You must @emph{not} use GAS on irix6 platforms; doing so will only
1520 cause problems.
1521
1522 These systems don't have ranlib, which various components in GCC need; you
1523 should be able to avoid this problem by making a dummy script called ranlib
1524 which just exits with zero status and placing it in your path.
1525
1526 If you are using Irix cc as your bootstrap compiler, you must
1527 ensure that the N32 ABI is in use.  To test this, compile a simple C
1528 file with @command{cc} and then run @command{file} on the
1529 resulting object file.  The output should look like:
1530
1531 @example
1532 @code{    test.o: ELF N32 MSB ...}
1533 @end example
1534
1535 If you see:
1536 @example
1537 @code{    test.o: ELF 32-bit MSB}
1538 @end example
1539
1540 then your version of @command{cc} uses the O32 ABI default.  You
1541 should set the environment variable @env{CC} to @samp{cc -n32}
1542 before configuring GCC.
1543
1544 GCC does not currently support generating O32 ABI binaries in the
1545 mips-sgi-irix6 configurations.  It used to be possible to create a GCC
1546 with O32 ABI only support by configuring it for the mips-sgi-irix5
1547 target.  See the link below for details.
1548
1549 GCC does not correctly pass/return structures which are
1550 smaller than 16 bytes and which are not 8 bytes. The problem is very
1551 involved and difficult to fix. It affects a number of other targets also,
1552 but IRIX 6 is affected the most, because it is a 64 bit target, and 4 byte
1553 structures are common. The exact problem is that structures are being padded
1554 at the wrong end, e.g. a 4 byte structure is loaded into the lower 4 bytes
1555 of the register when it should be loaded into the upper 4 bytes of the
1556 register.
1557
1558 GCC is consistent with itself, but not consistent with the SGI C compiler
1559 (and the SGI supplied runtime libraries), so the only failures that can
1560 happen are when there are library functions that take/return such
1561 structures. There are very few such library functions. I can only recall
1562 seeing two of them: inet_ntoa, and semctl.
1563
1564 See @uref{http://freeware.sgi.com/,,http://freeware.sgi.com/} for more
1565 information about using GCC on IRIX platforms.
1566
1567
1568 @html
1569 </p>
1570 <hr>
1571 <h3><a name="powerpc-*-linux-gnu*">powerpc-*-linux-gnu*</a></h3>
1572 @end html
1573
1574 You will need 
1575 @uref{ftp://ftp.varesearch.com/pub/support/hjl/binutils,,binutils-2.9.4.0.8} 
1576 or newer for a working GCC. It is strongly recommended to recompile binutils
1577 if you initially built it with gcc-2.7.2.x.
1578
1579
1580 @html
1581 </p>
1582 <hr>
1583 <h3><a name="*-*-solaris*">*-*-solaris*</a></h3>
1584 @end html
1585
1586 Starting with Solaris, Sun does not ship a C compiler any more. To
1587 bootstrap and install GCC you first have to install a pre-built
1588 compiler, see our @uref{binaries.html,,binaries page} for
1589 details.
1590
1591 You must use GNU Make to build GCC on Solaris 2.  If you don't have GNU
1592 Make installed, you can use the prebuilt compiler mentioned above to
1593 build it.
1594
1595 Sun as 4.X is broken in that it cannot cope with long symbol names.
1596 A typical error message might look similar to the following:
1597
1598 @samp{/usr/ccs/bin/as: "/var/tmp/ccMsw135.s", line 11041: 
1599 error: can't compute value of an expression involving an external symbol.}
1600
1601 This is Sun bug 4237974.  This is fixed with patch 108908-02 and has
1602 been fixed in later (5.x) versions of the assembler.
1603 @html
1604 <p>
1605 <hr>
1606 <h3><a name="sparc-sun-solaris*">sparc-sun-solaris*</a></h3>
1607 @end html
1608
1609 binutils 2.9.1 has known bugs on this platform. We recommend to use
1610 binutils 2.10 or the vendor tools (Sun as, Sun ld).
1611
1612 Unfortunately, C++ shared libraries, including libstdc++, won't work
1613 properly if assembled with Sun as: the linker will complain about
1614 relocations in read-only sections, in the definition of virtual
1615 tables. Also, Sun as fails to process long symbols resulting from
1616 mangling template-heavy C++ function names.
1617
1618
1619 @html
1620 </p>
1621 <hr>
1622 <h3><a name="sparc-sun-solaris2.7">sparc-sun-solaris2.7</a></h3>
1623 @end html
1624
1625 Sun patch 107058-01 (1999-01-13) for SPARC Solaris 7 triggers a bug in
1626 the dynamic linker.  This problem (Sun bug 4210064) affects GCC 2.8
1627 and later, including all EGCS releases.  Sun formerly recommended
1628 107058-01 for all Solaris 7 users, but around 1999-09-01 it started to
1629 recommend it only for people who use Sun's compilers.
1630   
1631 Here are some workarounds to this problem:
1632 @itemize @bullet
1633 @item
1634 Do not install Sun patch 107058-01 until after Sun releases a
1635 complete patch for bug 4210064.  This is the simplest course to take,
1636 unless you must also use Sun's C compiler.  Unfortunately 107058-01
1637 is preinstalled on some new Solaris-based hosts, so you may have to
1638 back it out.
1639   
1640 @item
1641 Copy the original, unpatched Solaris 7
1642 @command{/usr/ccs/bin/as} into
1643 @command{/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.1/as},
1644 adjusting the latter name to fit your local conventions and software
1645 version numbers.
1646
1647 @item
1648 Install Sun patch 106950-03 (1999-05-25) or later.  Nobody with
1649 both 107058-01 and 106950-03 installed has reported the bug with GCC
1650 and Sun's dynamic linker.  This last course of action is riskiest,
1651 for two reasons.  First, you must install 106950 on all hosts that
1652 run code generated by GCC; it doesn't suffice to install it only on
1653 the hosts that run GCC itself.  Second, Sun says that 106950-03 is
1654 only a partial fix for bug 4210064, but Sun doesn't know whether the
1655 partial fix is adequate for GCC.  Revision -08 or later should fix
1656 the bug, but (as of 1999-10-06) it is still being tested.
1657 @end itemize 
1658
1659
1660 @html
1661 <p>
1662 <hr>
1663 <h3><a name="*-sun-solaris2.8">*-sun-solaris2.8</a></h3>
1664 <!-- ripped from the same FAQ that I answered -->
1665 @end html
1666
1667 Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
1668 newer:  g++ will complain that types are missing.  These headers assume
1669 that omitting the type means 'int'; this assumption worked for C89 but
1670 is wrong for C++, and is now wrong for C99 also.
1671
1672 g++ accepts such (illegal) constructs with the option @option{-fpermissive}; it
1673 will assume that any missing type is 'int' (as defined by C89).
1674
1675 For Solaris 8, this is fixed by revision 24 or later of patch 108652
1676 (for SPARCs) or 108653 (for Intels).
1677
1678
1679 @html
1680 <p>
1681 <hr>
1682 <h3><a name="sunv5">Sun V5.0 Compiler Bugs</a></h3>
1683 @end html
1684
1685 The Sun V5.0 compilers are known to mis-compile GCC 2.95 and GCC 2.95.1,
1686 which in turn causes GCC to fail its bootstrap comparison test.
1687 GCC 2.95.2 has a workaround.
1688
1689
1690 @html
1691 </p>
1692 <hr>
1693 <h3><a name="sparc-sun-sunos*">sparc-sun-sunos*</a></h3>
1694 @end html
1695
1696 A bug in the SunOS4 linker will cause it to crash when linking
1697 -fPIC compiled objects (and will therefore not allow you to build
1698 shared libraries).
1699
1700 To fix this problem you can either use the most recent version of
1701 binutils or get the latest SunOS4 linker patch (patch ID 100170-10)
1702 from Sun's patch site.
1703
1704
1705 @html
1706 </p>
1707 <hr>
1708 <h3><a name="sparc-unknown-linux-gnulibc1">sparc-unknown-linux-gnulibc1</a></h3>
1709 @end html
1710
1711 It has been reported that you might need 
1712 @uref{ftp://ftp.yggdrasil.com/private/hjl,,binutils-2.8.1.0.23}
1713 for this platform, too.
1714
1715
1716 @html
1717 </p>
1718 <hr>
1719 <h3><a name="sparc64-*-*">sparc64-*-*</a></h3>
1720 @end html
1721
1722 GCC version 2.95 is not able to compile code correctly for
1723 @code{sparc64} targets.  Users of the Linux kernel, at least,
1724 12~can use the @code{sparc32} program to start up a new shell
1725 invocation with an environment that causes @command{configure} to
1726 recognize (via @samp{uname -a}) the system as @var{sparc-*-*} instead.
1727
1728
1729 @html
1730 </p>
1731 <hr>
1732 <h3><a name="windows"></a>Microsoft Windows (32 bit)</h3>
1733 @end html
1734
1735 A port of GCC 2.95.x is included with the 
1736 @uref{http://www.cygwin.com/,,Cygwin environment}.
1737
1738 Current (as of early 2001) snapshots of GCC will build under Cygwin
1739 without modification.
1740
1741 @html
1742 </p>
1743 <hr>
1744 <h3><a name="os2"></a>OS/2</h3>
1745 @end html
1746
1747 GCC does not currently support OS/2.  However, Andrew Zabolotny has been
1748 working on a generic OS/2 port with pgcc.  The current code code can be found
1749 at @uref{http://www.goof.com/pcg/os2/,,http://www.goof.com/pcg/os2/}.
1750
1751 An older copy of GCC 2.8.1 is included with the EMX tools available at 
1752 @uref{ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/,,
1753 ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/}.
1754
1755 @html
1756 </p>
1757 <hr>
1758 <h3><a name="older"></a>Older systems</h3> 
1759 @end html
1760  
1761 GCC contains support files for many older (1980s and early 
1762 1990s) Unix variants.  For the most part, support for these systems 
1763 has not been deliberately removed, but it has not been maintained for 
1764 several years and may suffer from bitrot.  Support from some systems 
1765 has been removed from GCC 3: fx80, ns32-ns-genix, pyramid, tahoe, 
1766 gmicro, spur; most of these targets had not been updated since GCC 
1767 version 1.
1768  
1769 Support for older systems as targets for cross-compilation is less 
1770 problematic than support for them as hosts for GCC; if an enthusiast 
1771 wishes to make such a target work again (including resurrecting any 
1772 of the targets that never worked with GCC 2, starting from the last 
1773 CVS version before they were removed), patches 
1774 @uref{../contribute.html,,following the usual requirements} 
1775 would be likely to be accepted, since they should not affect the 
1776 support for more modern targets.
1777  
1778 Support for old systems as hosts for GCC can cause problems if the 
1779 workarounds for compiler, library and operating system bugs affect the 
1780 cleanliness or maintainability of the rest of GCC.  In some cases, to 
1781 bring GCC up on such a system, if still possible with current GCC, may 
1782 require first installing an old version of GCC which did work on that 
1783 system, and using it to compile a more recent GCC, to avoid bugs in 
1784 the vendor compiler.  Old releases of GCC 1 and GCC 2 are available in 
1785 the old-releases directory on the 
1786 @uref{../mirrors.html,,GCC mirror sites}.  Header bugs may generally 
1787 be avoided using @command{fixincludes}, but bugs or deficiencies in
1788 libraries and the operating system may still cause problems.
1789  
1790 For some systems, old versions of GNU binutils may also be useful, 
1791 and are available from pub/binutils/old-releases on 
1792 @uref{http://sources.redhat.com/mirrors.html,,sources.redhat.com mirror sites}.
1793  
1794 Some of the information on specific systems above relates to 
1795 such older systems, but much of the information 
1796 about GCC on such systems (which may no longer be applicable to 
1797 current GCC) is to be found in the GCC texinfo manual.
1798  
1799 @html
1800 </p>
1801 <hr>
1802 <h3><a name="elf_targets">all ELF targets (SVR4, Solaris, etc.)</a></h3>
1803 @end html
1804
1805 C++ support is significantly better on ELF targets if you use the
1806 @uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of
1807 inlines, vtables and template instantiations will be discarded
1808 automatically.
1809
1810
1811 @html
1812 </p>
1813 <hr>
1814 <p>
1815 @end html
1816 @ifhtml
1817 @uref{./index.html,,Return to the GCC Installation page}
1818 @end ifhtml
1819 @end ifset
1820
1821 @c ***************************************************************************
1822 @c Part 6 The End of the Document
1823 @ifinfo
1824 @comment node-name,     next,          previous, up
1825 @node    Concept Index, , Specific, Top
1826 @end ifinfo
1827
1828 @ifinfo
1829 @unnumbered Concept Index
1830
1831 @printindex cp
1832
1833 @contents
1834 @end ifinfo
1835 @bye