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