OSDN Git Service

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