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