]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/install.texi
root.texi: Fix typo in patches e-mail address.
[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
5791e6da 36@comment $Id: install.texi,v 1.13 2001/06/02 22:33:30 jsm28 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.
ef88b07d 62@center @titlefont{Installing GCC}
f42974dc
DW
63
64@c The following two commands start the copyright page.
65@page
ef88b07d 66@vskip 0pt plus 1filll
f42974dc
DW
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
38209993 149Please note that GCC does not support @samp{make uninstall} and probably
f42974dc
DW
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
38209993
LG
152remove that directory when you do not need that specific version of GCC
153any longer.
f42974dc
DW
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
179GCC is distributed via CVS and FTP tarballs compressed with gzip or
180bzip2. It is possible to download a full distribution or specific
181components.
182
183Please refer to our @uref{http://gcc.gnu.org/releases.html,,releases web page}
184for information on how to obtain GCC.
185
186The full distribution includes the C, C++, Objective-C, Fortran, Java,
187and Chill compilers. The full distribution also includes runtime libraries
188for C++, Objective-C and Fortran. In the future the GNU compiler testsuites
189will be included in the full distribution.
190
191If you choose to download specific components, you must download the core
192gcc distribution plus any language specific distributions you wish to
193use. The core distribution includes the C language front-end as well as the
194shared components. Each language has a tarball which includes the language
195front-end as well as the language runtime (when appropriate).
196
197Unpack the core distribution as well as any language specific
198distributions in the same directory.
199
200If you also intend to build binutils (either to upgrade an existing
201installation or for use in place of the corresponding tools of your
202OS), unpack the binutils distribution either in the same directory or
203a separate one. In the latter case, add symbolic links to any
204components of the binutils you intend to build alongside the compiler
205(bfd, binutils, gas, gprof, ld, opcodes,...) to the directory containing
206the 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
232Like most GNU software, GCC must be configured before it can be built.
233This document describes the recommended configuration procedure
234for both native and cross targets.
235
38209993
LG
236We use @var{srcdir} to refer to the toplevel source directory for
237GCC; we use @var{objdir} to refer to the toplevel build/object directory.
238
239If 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,
241and not its @file{gcc} subdirectory, otherwise the build will fail.
f42974dc
DW
242
243First, we @strong{highly} recommend that GCC be built into a
244separate directory than the sources which does @strong{not} reside
245within the source tree. This is how we generally build GCC; building
38209993
LG
246where @var{srcdir} == @var{objdir} should still work, but doesn't
247get extensive testing; building where @var{objdir} is a subdirectory
248of @var{srcdir} is unsupported.
f42974dc 249
38209993
LG
250Second, when configuring a native system, either @command{cc} or
251@command{gcc} must be in your path or you must set @env{CC} in
df002c7d
DE
252your environment before running configure. Otherwise the configuration
253scripts may fail.
f42974dc
DW
254
255To configure GCC:
256
257@example
38209993
LG
258 % mkdir @var{objdir}
259 % cd @var{objdir}
ef88b07d 260 % @var{srcdir}/configure [@var{target}] [@var{options}]
f42974dc
DW
261@end example
262
263
ef88b07d 264@heading Target specification
f42974dc
DW
265@itemize @bullet
266@item
38209993 267GCC has code to correctly determine the correct value for @var{target}
f42974dc
DW
268for nearly all native systems. Therefore, we highly recommend you not
269provide a configure target when configuring a native compiler.
270
271@item
38209993 272@var{target} must be specified as @option{--target=}@var{target}
f42974dc
DW
273when configuring a cross compiler; examples of valid targets would be
274i960-rtems, m68k-coff, sh-elf, etc.
275
276@item
38209993
LG
277Specifying just @var{target} instead of @option{--target=}@var{target}
278implies that the host defaults to @var{target}.
f42974dc
DW
279@end itemize
280
281
ef88b07d 282@heading Options specification
f42974dc 283
ef88b07d
JM
284Use @var{options} to override several configure time options for
285GCC. A partial list of supported @var{options}:
f42974dc 286
ef88b07d
JM
287@table @code
288@item --prefix=@var{dirname}
289Specify the toplevel installation
f42974dc
DW
290directory. This is the recommended way to install the tools into a directory
291other than the default. The toplevel installation directory defaults to
292@code{/usr/local}.
293
38209993
LG
294We @strong{highly} recommend against @var{dirname} being the same or a
295subdirectory of @var{objdir} or vice versa.
f42974dc
DW
296
297These additional options control where certain parts of the distribution
298are installed. Normally you should not need to use these options.
ef88b07d 299@table @code
f42974dc 300
ef88b07d
JM
301@item --with-gxx-include-dir=@var{dirname}
302Specify
38209993
LG
303the installation directory for g++ header files. The default is
304@file{/usr/local/include/g++}.
f42974dc 305
ef88b07d 306@end table
f42974dc 307
ef88b07d
JM
308@item --with-local-prefix=@var{dirname}
309Specify the
6ac48571
JM
310installation directory for local include files. The default is
311@file{/usr/local}. Specify this option if you want the compiler to
312search directory @file{@var{dirname}/include} for locally installed
313header files @emph{instead} of @file{/usr/local/include}.
314
315You should specify @option{--with-local-prefix} @strong{only} if your
316site has a different convention (not @file{/usr/local}) for where to put
317site-specific files.
318
319The default value for @option{--with-local-prefix} is @file{/usr/local}
320regardless of the value of @option{--prefix}. Specifying
321@option{--prefix} has no effect on which directory GCC searches for
322local header files. This may seem counterintuitive, but actually it is
323logical.
324
325The purpose of @option{--prefix} is to specify where to @emph{install
326GCC}. The local header files in @file{/usr/local/include}---if you put
327any in that directory---are not part of GCC. They are part of other
328programs---perhaps many others. (GCC installs its own header files in
329another directory which is based on the @option{--prefix} value.)
330
331@strong{Do not} specify @file{/usr} as the @option{--with-local-prefix}!
332The directory you use for @option{--with-local-prefix} @strong{must not}
333contain any of the system's standard header files. If it did contain
334them, certain programs would be miscompiled (including GNU Emacs, on
335certain targets), because this would override and nullify the header
336file corrections made by the @code{fixincludes} script.
337
338Indications are that people who use this option use it based on mistaken
339ideas of what it is for. People use it as if it specified where to
340install part of GCC. Perhaps they make this assumption because
341installing GCC creates the directory.
342
ef88b07d
JM
343@item --enable-shared
344Build shared versions of the
38209993
LG
345C++ runtime libraries if supported. This is the default on most
346systems. Use @option{--disable-shared} for static libraries. Note that
347up to the gcc version 2.95.x series, static libraries were the default
348on all systems.
f42974dc 349
ef88b07d
JM
350@item @anchor{with-gnu-as}--with-gnu-as
351Specify that the compiler should assume that the
38209993
LG
352assembler it finds is the GNU assembler. However, this does not modify
353the rules to find an assembler and will result in confusion if found
354assembler is not actually the GNU assembler. If you have more than one
355assembler installed on your system, you may want to use this option in
356connection with @option{--with-as=@file{/path/to/gas}}.
357
ef88b07d
JM
358@item --with-as=@file{/path/to/as}
359Specify that the
38209993
LG
360compiler should use the assembler pointed to by @var{pathname}, rather
361than the one found by the standard rules to find an assembler, which
362are:
f42974dc
DW
363@itemize @bullet
364@item
38209993
LG
365Check the
366@file{@var{exec_prefix}/lib/gcc-lib/@var{target}/@var{version}}
367directory, where @var{exec_prefix} defaults to @var{prefix} which
368defaults to @file{/usr/local} unless overridden by the
369@option{--prefix=/pathname} switch described above. @var{target} is the
370target system triple, such as @var{sparc-sun-solaris2.7}, and
371@var{version} denotes the GCC version, such as 2.95.2.
f42974dc 372@item
38209993
LG
373Check operating system specific directories (e.g. @file{/usr/ccs/bin} on
374Sun Solaris).
f42974dc 375@end itemize
38209993
LG
376Note that these rules do not check for the value of @env{PATH}. You may
377want to use @option{--with-as} if no assembler is installed in the
378directories listed above, or if you have multiple assemblers installed
379and want to choose one that is not found by the above rules.
f42974dc 380
ef88b07d
JM
381@item @anchor{with-gnu-ld}--with-gnu-ld
382Same as @uref{#with-gnu-as,,@option{--with-gnu-as}}
38209993 383but for linker.
20293b4c 384
f42974dc 385
ef88b07d
JM
386@item --with-ld=@file{/path/to/ld}
387Same as
38209993 388@option{--with-as}, but for the linker.
f42974dc 389
ef88b07d
JM
390@item --with-stabs
391Specify that stabs debugging
38209993
LG
392information should be used instead of whatever format the host normally
393uses. Normally GCC uses the same debug format as the host system.
f42974dc 394
ef88b07d
JM
395@item --enable-multilib
396Specify that multiple target
38209993
LG
397libraries should be built to support different target variants, calling
398conventions, etc. This is the default.
f42974dc 399
ef88b07d
JM
400@item --enable-threads
401Specify that the target
38209993
LG
402supports threads. This affects the Objective-C compiler and runtime
403library, and exception handling for other languages like C++ and Java.
6ac48571 404On some systems, this is the default.
f42974dc 405
ef88b07d
JM
406@item --enable-threads=@var{lib}
407Specify that
38209993
LG
408@var{lib} is the thread support library. This affects the Objective-C
409compiler and runtime library, and exception handling for other languages
6ac48571
JM
410like 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}.
f42974dc 414
ef88b07d
JM
415@item --with-cpu=@var{cpu}
416Specify which cpu variant the
f42974dc
DW
417compiler should generate code for by default. This is currently
418only supported on the some ports, specifically arm, powerpc, and
419SPARC. If configure does not recognize the model name (e.g. arm700,
420603e, or ultrasparc) you provide, please check the configure script
421for a complete list of supported models.
422
ef88b07d
JM
423@item --enable-target-optspace
424Specify that target
38209993
LG
425libraries should be optimized for code space instead of code speed.
426This is the default for the m32r platform.
f42974dc 427
ef88b07d
JM
428@item --enable-cpp
429Specify that a shell script which
38209993 430emulates traditional cpp functionality should be installed.
f42974dc 431
ef88b07d
JM
432@item --enable-cpplib
433Specify that the functionality of
f42974dc
DW
434CPP should be integrated into the compiler itself. This option is
435not supported by snapshots since November 2000. In snapshots where
436it is supported, it is not enabled by default, except for snapshots
437very close to November 2000.
438
ef88b07d
JM
439@item --enable-maintainer-mode
440The build rules that
6ac48571
JM
441regenerate the GCC master message catalog @code{gcc.pot} are normally
442disabled. This is because it can only be rebuilt if the complete source
443tree is present. If you have changed the sources and want to rebuild the
444catalog, configuring with @option{--enable-maintainer-mode} will enable
445this. Note that you need a recent version of the @code{gettext} tools
446to do so.
447
ef88b07d
JM
448@item --without-fast-fixincludes
449Specify that the
38209993 450old, slower method of fixing the system header files should be used.
f42974dc
DW
451EGCS 1.1.x and older releases default to the slow version. GCC 2.95 and
452newer releases will default to the fast version.
453
ef88b07d
JM
454@item --enable-version-specific-runtime-libs
455Specify
38209993
LG
456that runtime libraries should be installed in the compiler specific
457subdirectory (@file{@var{libsubdir}}) rather than the usual places. In
458addition, 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
461particularly useful if you intend to use several versions of GCC in
462parallel. This is currently supported by @option{libf2c} and
463@option{libstdc++}.
464
ef88b07d
JM
465@item --enable-languages=@var{lang1},@var{lang2},@dots{}
466Specify that only a particular subset of compilers and
38209993
LG
467their 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}.
f42974dc
DW
472@code{CHILL} is not currently maintained, and will almost
473certainly fail to compile. Note that this switch does not work with
474EGCS 1.1.2 or older versions of egcs. It is supported in GCC 2.95
475and newer versions.@*
38209993
LG
476If you do not pass this flag, all languages available in the @file{gcc}
477sub-tree will be configured. Re-defining LANGUAGES when calling
ef88b07d 478@samp{make bootstrap} @strong{does not} work anymore, as those
38209993 479language sub-directories might not have been configured!
f42974dc 480
ef88b07d
JM
481@item --disable-libgcj
482Specify that the run-time libraries
f42974dc
DW
483used by GCJ should not be built. This is useful in case you intend
484to use GCJ with some other run-time, or you're going to install it
485separately, or it just happens not to build on your particular
486machine. In general, if the Java front-end is enabled, the GCJ
487libraries will be enabled too, unless they're known to not work on
488the target platform. If GCJ is enabled but libgcj isn't built, you
489may need to port it; in this case, before modifying the top-level
490configure.in so that libgcj is enabled by default on this platform,
491you may use @option{--enable-libgcj} to override the default.
492
ef88b07d
JM
493@item --with-dwarf2
494Specify that the compiler should
38209993 495use DWARF2 debugging information as the default.
ef88b07d 496@end table
f42974dc
DW
497
498Some options which only apply to building cross compilers:
ef88b07d
JM
499@table @code
500@item --with-headers=@var{dir}
501Specifies a directory
38209993 502which has target include files.
f42974dc 503@emph{This options is required} when building a cross
38209993
LG
504compiler, if @file{@var{prefix}/@var{target}/sys-include} doesn't pre-exist.
505These include files will be copied into the @file{gcc} install directory.
506Fixincludes will be run on these files to make them compatible with
507@command{gcc}.
ef88b07d 508@item --with-libs=``@var{dir1} @var{dir2} @dots{} @var{dirN}''
38209993
LG
509Specifies a list of directories which contain the target runtime
510libraries. These libraries will be copied into the @file{gcc} install
511directory.
ef88b07d
JM
512@item --with-newlib
513Specifies that ``newlib'' is
38209993
LG
514being used as the target C library. This causes @code{__eprintf} to be
515omitted from libgcc.a on the assumption that it will be provided by
516newlib.
ef88b07d 517@end table
f42974dc 518
38209993
LG
519Note that each @option{--enable} option has a corresponding
520@option{--disable} option and that each @option{--with} option has a
521corresponding @option{--without} option.
f42974dc
DW
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
546Now that GCC is configured, you are ready to build the compiler and
547runtime libraries.
548
549We @strong{highly} recommend that GCC be built using GNU make;
550other versions may work, then again they might not.
551
552(For example, many broken versions of make will fail if you use the
b8df899a
JM
553recommended setup where @var{objdir} is different from @var{srcdir}.
554Other broken versions may recompile parts of the compiler when
555installing the compiler.)
f42974dc 556
b8df899a
JM
557Some commands executed when making the compiler may fail (return a
558non-zero status) and be ignored by @code{make}. These failures, which
559are often due to files that were not found, are expected, and can safely
560be ignored.
561
562It is normal to have compiler warnings when compiling certain files.
563Unless you are a GCC developer, you can generally ignore these warnings
564unless they cause compilation to fail.
565
566On certain old systems, defining certain environment variables such as
567@code{CC} can interfere with the functioning of @code{make}.
568
569If you encounter seemingly strange errors when trying to build the
570compiler in a directory other than the source directory, it could be
571because you have previously configured the compiler in the source
572directory. Make sure you have done all the necessary preparations.
573
574If you build GCC on a BSD system using a directory stored in an old System
575V file system, problems may occur in running @code{fixincludes} if the
576System V file system doesn't support symbolic links. These problems
577result in a failure to fix the declaration of @code{size_t} in
578@file{sys/types.h}. If you find that @code{size_t} is a signed type and
579that type mismatches occur, this could be the cause.
580
581The solution is not to use such a directory for building GCC.
f42974dc
DW
582
583@section Building a native compiler
584
38209993 585For a native build issue the command @samp{make bootstrap}. This
f42974dc
DW
586will build the entire GCC system, which includes the following steps:
587
588@itemize @bullet
589@item
590Build host tools necessary to build the compiler such as texinfo, bison,
591gperf.
592
593@item
594Build target tools for use by the compiler such as binutils (bfd,
595binutils, gas, gprof, ld, and opcodes)@*
596if they have been individually linked
597or moved into the top level GCC source tree before configuring.
598
599@item
600Perform a 3-stage bootstrap of the compiler.
601
602@item
603Perform a comparison test of the stage2 and stage3 compilers.
604
605@item
606Build runtime libraries using the stage3 compiler from the previous step.
607
608@end itemize
609
38209993
LG
610If you are short on disk space you might consider @samp{make
611bootstrap-lean} instead. This is identical to @samp{make
612bootstrap} except that object files from the stage1 and
f42974dc
DW
613stage2 of the 3-stage bootstrap of the compiler are deleted as
614soon as they are no longer needed.
615
616
617If you want to save additional space during the bootstrap and in
618the final installation as well, you can build the compiler binaries
38209993
LG
619without debugging information with @samp{make CFLAGS='-O' LIBCFLAGS='-g
620-O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap}. This will save
f42974dc
DW
621roughly 40% of disk space both for the bootstrap and the final installation.
622(Libraries will still contain debugging information.)
623
38209993 624If you used the flag @option{--enable-languages=...} to restrict
f42974dc
DW
625the compilers to be built, only those you've actually enabled will be
626built. This will of course only build those runtime libraries, for
627which the particular compiler has been built. Please note,
38209993 628that re-defining LANGUAGES when calling @samp{make bootstrap}
ef88b07d 629@strong{does not} work anymore!
f42974dc
DW
630
631
632@section Building a cross compiler
633
634We recommend reading the
635@uref{http://www.objsw.com/CrossGCC/,,crossgcc FAQ}
636for information about building cross compilers.
637
638When building a cross compiler, it is not generally possible to do a
6393-stage bootstrap of the compiler. This makes for an interesting problem
640as parts of GCC can only be built with GCC.
641
642To build a cross compiler, we first recommend building and installing a
643native compiler. You can then use the native GCC compiler to build the
644cross compiler.
645
646Assuming you have already installed a native copy of GCC and configured
38209993 647your cross compiler, issue the command @samp{make}, which performs the
f42974dc
DW
648following steps:
649
650@itemize @bullet
651@item
652Build host tools necessary to build the compiler such as texinfo, bison,
653gperf.
654
655@item
656Build target tools for use by the compiler such as binutils (bfd,
657binutils, gas, gprof, ld, and opcodes)
658if they have been individually linked or moved into the top level GCC source
659tree before configuring.
660
661@item
662Build the compiler (single stage only).
663
664@item
665Build runtime libraries using the compiler from the previous step.
666@end itemize
667
668Note that if an error occurs in any step the make process will exit.
669
670@section Building in parallel
671
38209993
LG
672If you have a multiprocessor system you can use @samp{make bootstrap
673MAKE="make -j 2" -j 2} or just @samp{make -j 2 bootstrap}
674for GNU Make 3.79 and above instead of just @samp{make bootstrap}
f42974dc
DW
675when building GCC. You can use a bigger number instead of two if
676you like. In most cases, it won't help to use a number bigger than
677the number of processors in your machine.
678
679@html
680<hr>
681<p>
682@end html
683@ifhtml
684@uref{./index.html,,Return to the GCC Installation page}
685@end ifhtml
686@end ifset
687
688@c ***Testing*****************************************************************
689@ifinfo
690@comment node-name, next, previous, up
691@node Testing, Final install, Building, Installing GCC
692@end ifinfo
693@ifset testhtml
694@html
695<h1 align="center">Installing GCC: Testing</h1>
696@end html
697@ifnothtml
698@chapter Installing GCC: Testing
699@end ifnothtml
700@cindex Testing
701@cindex Installing GCC: Testing
702@cindex Testsuite
703
704@strong{Please note that this is only applicable
705to current development versions of GCC and GCC 3.0 or later.
706GCC 2.95.x does not come with a testsuite.}
707
708Before you install GCC, you might wish to run the testsuite. This
709step is optional and may require you to download additional software.
710
711First, you must have @uref{download.html,,downloaded the testsuites}.
712The full distribution contains testsuites; only if you downloaded the
713``core'' compiler plus any front ends, you do not have the testsuites.
714
715Second, you must have a @uref{http://www.gnu.org/software/dejagnu/,,current version of DejaGnu} installed;
716dejagnu 1.3 is not sufficient.
717
718Now you may need specific preparations:
719
720@itemize @bullet
721@item
722In order to run the libio tests on targets which do not fully
723support Unix/POSIX commands (e.g. Cygwin), the references to the dbz
724directory have to be deleted from @code{libio/configure.in}.
725
726@item
727The following environment variables must be set appropriately, as in
728the following example (which assumes that DejaGnu has been installed
729under @code{/usr/local}):
730
731@example
732 TCL_LIBRARY = /usr/local/share/tcl8.0
733 DEJAGNULIBS = /usr/local/share/dejagnu
734@end example
735
736On systems such as Cygwin, these paths are required to be actual
737paths, not mounts or links; presumably this is due to some lack of
738portability in the DejaGnu code.
739
740@end itemize
741
742Finally, you can run the testsuite (which may take a long time):
743@example
ef88b07d 744 cd @var{objdir}; make -k check
f42974dc
DW
745@end example
746
747The testing process will try to test as many components in the GCC
748distribution as possible, including the C, C++ and Fortran compilers as
749well as the C++ runtime libraries.
750
751@section How can I run the test suite on selected tests?
752
753As a first possibility to cut down the number of tests that are run it is
38209993 754possible to use @samp{make check-gcc} or @samp{make check-g++}
f42974dc
DW
755in the gcc subdirectory of the object directory. To further cut down the
756tests the following is possible:
757
758@example
759 make check-gcc RUNTESTFLAGS="execute.exp <other options>"
760@end example
761
762This will run all gcc execute tests in the testsuite.
763
764@example
765 make check-g++ RUNTESTFLAGS="old-deja.exp=9805* <other options>"
766@end example
767
768This will run the g++ "old-deja" tests in the testsuite where the filename
769matches 9805*.
770
771The *.exp files are located in the testsuite directories of the GCC
772source, the most important ones being compile.exp, execute.exp, dg.exp
773and old-deja.exp. To get a list of the possible *.exp files, pipe the
38209993
LG
774output of @samp{make check} into a file and look at the
775@samp{Running ... .exp} lines.
f42974dc
DW
776
777@section How to interpret test results
778
779After the testsuite has run you'll find various *.sum and *.log
780files in the testsuite subdirectories. The *.log files contain a
781detailed log of the compiler invocations and the corresponding
782results, the *.sum files summarize the results. These summaries list
783all the tests that have been run with a corresponding status code:
784
785@itemize @bullet
786@item
787PASS: the test passed as expected
788@item
789XPASS: the test unexpectedly passed
790@item
791FAIL: the test unexpectedly failed
792@item
793XFAIL: the test failed as expected
794@item
795UNSUPPORTED: the test is not supported on this platform
796@item
797ERROR: the testsuite detected an error
798@item
799WARNING: the testsuite detected a possible problem
800@end itemize
801
38209993
LG
802It is normal for some tests to report unexpected failures. At the
803current time our testing harness does not allow fine grained control
804over whether or not a test is expected to fail. We expect to fix this
805problem in future releases.
f42974dc
DW
806
807
808@section Submitting test results
809
810If you want to report the results to the GCC project, use the
ef88b07d 811@code{contrib/test_summary} shell script. Start it in the @var{objdir} with
f42974dc
DW
812
813@example
ef88b07d 814 @var{srcdir}/contrib/test_summary -p your_commentary.txt -m gcc-testresults@@gcc.gnu.org |sh
f42974dc
DW
815@end example
816
817This script uses the @code{Mail} program to send the results, so
818make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is
819prepended to the testsuite summary and should contain any special
820remarks you have on your results or your build environment. Please
821do not edit the testsuite result block or the subject line, as these
822messages are automatically parsed and presented at the
823@uref{http://gcc.gnu.org/testresults/,,GCC testresults} web
824page. Here you can also gather information on how specific tests
825behave on different platforms and compare them with your results. A
826few failing testcases are possible even on released versions and you
827should look here first if you think your results are unreasonable.
828
829@end ifset
830
831@c ***Final install***********************************************************
832@ifinfo
833@comment node-name, next, previous, up
834@node Final install, , Testing, Installing GCC
835@end ifinfo
836@ifset finalinstallhtml
837@html
838<h1 align="center">Installing GCC: Final installation</h1>
839@end html
840@ifnothtml
841@chapter Installing GCC: Final installation
842@end ifnothtml
843
844Now that GCC has been built and tested, you can install it with
ef88b07d
JM
845@samp{cd @var{objdir}; make install} for a native compiler or
846@samp{cd @var{objdir}; make install LANGUAGES="c c++"} for
f42974dc
DW
847a cross compiler (note installing cross compilers will be easier in the
848next release!).
849
850That step completes the installation of GCC; user level binaries can
38209993
LG
851be found in @file{@var{prefix}/bin} where @var{prefix} is the value you
852specified with the @option{--prefix} to configure (or @file{/usr/local}
853by default).
f42974dc
DW
854
855If you don't mind, please quickly review the
856@uref{http://gcc.gnu.org/gcc-2.95/buildstat.html,,build status page}.
857If your system is not listed, send a note to
858@uref{mailto:gcc@@gcc.gnu.org,,gcc@@gcc.gnu.org} indicating
859that you successfully built and installed GCC.
860
38209993 861Include the output from running @file{@var{srcdir}/config.guess}. (Do not
f42974dc
DW
862send us the config.guess file itself, just the output from running
863it!)
864
865If you find a bug, please report it following our
866@uref{../bugs.html,,bug reporting guidelines}.
867
868@html
869<hr>
870<p>
871@end html
872@ifhtml
873@uref{./index.html,,Return to the GCC Installation page}
874@end ifhtml
875@end ifset
876
877@c ***Binaries****************************************************************
878@ifinfo
879@comment node-name, next, previous, up
880@node Binaries, Specific, Installing GCC, Top
881@end ifinfo
882@ifset binarieshtml
883@html
884<h1 align="center">Installing GCC: Binaries</h1>
885@end html
886@ifnothtml
887@chapter Installing GCC: Binaries
888@end ifnothtml
889@cindex Binaries
890@cindex Installing GCC: Binaries
891
892We are often asked about pre-compiled versions of GCC. While we cannot
893provide these for all platforms, below you'll find links to binaries for
894various platforms where creating them by yourself is not easy due to various
895reasons.
896
897Please note that we did not create these binaries, nor do we
898support them. If you have any problems installing them, please
899contact their makers.
900
901@itemize
902@item
df002c7d
DE
903AIX:
904@itemize
905@item
38209993
LG
906@uref{http://www-frec.bull.com/docs/download.htm,,Bull's Freeware and
907Shareware Archive for AIX};
df002c7d
DE
908
909@item
910@uref{http://aixpdlib.seas.ucla.edu,,UCLA Software Library for AIX};
911@end itemize
f42974dc
DW
912
913@item
914DOS - @uref{http://www.delorie.com/djgpp/,,DJGPP};
915
916@item
917@uref{http://hpux.cae.wisc.edu/,,HP-UX Porting Center};
918
919@item
38209993
LG
920@uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
921OpenServer/Unixware};
f42974dc
DW
922
923@item
924Solaris (SPARC, Intel) - @uref{http://www.sunfreeware.com/,,Sunfreeware};
925
926@item
927SGI - @uref{http://freeware.sgi.com/,,SGI Freeware};
928
929@item
930Windows 95, 98, and NT:
931@itemize
932@item
933The @uref{http://sources.redhat.com/cygwin/,,Cygwin} project;
934@item
935@uref{http://www.xraylith.wisc.edu/~khan/software/gnu-win32/,,GNU Win32}
936related projects by Mumit Khan.
937@end itemize
938
939@item
940@uref{ftp://ftp.thewrittenword.com/packages/free/by-name/gcc-2.95.2/,,The
941Written Word} offers binaries for Solaris 2.5.1, 2.6, 2.7/SPARC, 2.7/Intel,
942IRIX 6.2, 6.5, Digital UNIX 4.0D, HP-UX 10.20, and HP-UX 11.00.
943
944@item
945Hitachi H8/300[HS] -
946@uref{http://h8300-hms.sourceforge.net/,,GNU Development Tools for the
947Hitachi H8/300[HS] Series}
948
949@end itemize
950
951In addition to those specific offerings, you can get a binary
952distribution CD-ROM from the
953@uref{http://www.fsf.org/order/order.html,,Free Software Foundation}.
954It contains binaries for a number of platforms, and
955includes not only GCC, but other stuff as well. The current CD does
956not contain the latest version of GCC, but it should allow
957bootstrapping the compiler. An updated version of that disk is in the
958works.
959
960@html
961<hr>
962<p>
963@end html
964@ifhtml
965@uref{./index.html,,Return to the GCC Installation page}
966@end ifhtml
967@end ifset
968
969@c ***Specific****************************************************************
970@ifinfo
971@comment node-name, next, previous, up
972@node Specific, Concept Index, Binaries, Top
973@end ifinfo
974@ifset specifichtml
975@html
976<h1 align="center">Host/target specific installation notes for GCC</h1>
977@end html
978@ifnothtml
979@chapter Host/target specific installation notes for GCC
980@end ifnothtml
981@cindex Specific
982@cindex Specific installation notes
983@cindex Target specific installation
984@cindex Host specific installation
985@cindex Target specific installation notes
986
987Please read this document carefully @emph{before} installing the
988GNU Compiler Collection on your machine.
989
ef88b07d 990@ifhtml
f42974dc
DW
991@itemize
992@item
b8df899a
JM
993@uref{#1750a-*-*,,1750a-*-*}
994@item
995@uref{#a29k,,a29k}
996@item
997@uref{#a29k-*-bsd,,a29k-*-bsd}
998@item
f42974dc
DW
999@uref{#alpha*-dec-linux*,,alpha*-dec-linux*}
1000@item
b8df899a
JM
1001@uref{#alpha-*-osf1,,alpha-*-osf1}
1002@item
f42974dc
DW
1003@uref{#alpha*-dec-osf*,,alpha*-dec-osf*}
1004@item
b8df899a
JM
1005@uref{#arc-*-elf,,arc-*-elf}
1006@item
1007@uref{#arm-*-aout,,arm-*-aout}
1008@item
1009@uref{#arm-*-elf,,arm-*-elf}
1010@item
476c334e
PB
1011@uref{#arm*-*-linux-gnu,,arm*-*-linux-gnu}
1012@item
b8df899a
JM
1013@uref{#arm-*-riscix,,arm-*-riscix}
1014@item
f42974dc
DW
1015@uref{#avr,,avr}
1016@item
b8df899a
JM
1017@uref{#decstation-*,,decstation-*}
1018@item
f42974dc
DW
1019@uref{#dos,,DOS}
1020@item
b8df899a
JM
1021@uref{#dsp16xx,,dsp16xx}
1022@item
1023@uref{#elxsi-elxsi-bsd,,elxsi-elxsi-bsd}
1024@item
f42974dc
DW
1025@uref{#h8300-hms,,h8300-hms}
1026@item
1027@uref{#hppa*-hp-hpux*,,hppa*-hp-hpux*}
1028@item
1029@uref{#hppa*-hp-hpux9,,hppa*-hp-hpux9}
1030@item
1031@uref{#hppa*-hp-hpux10,,hppa*-hp-hpux10}
1032@item
1033@uref{#hppa*-hp-hpux11,,hppa*-hp-hpux11}
1034@item
b8df899a
JM
1035@uref{#i370-*-*,,i370-*-*}
1036@item
f42974dc
DW
1037@uref{#*-*-linux-gnu,,*-*-linux-gnu}
1038@item
b8df899a
JM
1039@uref{#ix86-*-linux*oldld,,i?86-*-linux*oldld}
1040@item
1041@uref{#ix86-*-linux*aout,,i?86-*-linux*aout}
1042@item
f42974dc
DW
1043@uref{#ix86-*-linux*,,i?86-*-linux*}
1044@item
b8df899a
JM
1045@uref{#ix86-*-sco,,i?86-*-sco}
1046@item
1047@uref{#ix86-*-sco3.2v4,,i?86-*-sco3.2v4}
1048@item
f42974dc
DW
1049@uref{#ix86-*-sco3.2v5*,,i?86-*-sco3.2v5*}
1050@item
1051@uref{#ix86-*-solaris*,,i?86-*-solaris*}
1052@item
1053@uref{#ix86-*-udk,,i?86-*-udk}
1054@item
b8df899a
JM
1055@uref{#ix86-*-isc,,i?86-*-isc}
1056@item
1057@uref{#ix86-*-esix,,i?86-*-esix}
1058@item
1059@uref{#ix86-ibm-aix,,i?86-ibm-aix}
1060@item
1061@uref{#ix86-sequent-bsd,,i?86-sequent-bsd}
1062@item
1063@uref{#ix86-sequent-ptx1*,,i?86-sequent-ptx1*, i?86-sequent-ptx2*}
1064@item
1065@uref{#ix86-*-sysv3*,,i?86-*-sysv3*}
1066@item
1067@uref{#i860-intel-osf*,,i860-intel-osf*}
1068@item
1069@uref{#*-lynx-lynxos,,*-lynx-lynxos}
1070@item
f42974dc
DW
1071@uref{#*-ibm-aix*,,*-ibm-aix*}
1072@item
b8df899a
JM
1073@uref{#m32r-*-elf,,m32r-*-elf}
1074@item
1075@uref{#m68000-hp-bsd,,m68000-hp-bsd}
1076@item
1077@uref{#m6811-elf,,m6811-elf}
1078@item
1079@uref{#m6812-elf,,m6812-elf}
1080@item
1081@uref{#m68k-altos,,m68k-altos}
1082@item
1083@uref{#m68k-apple-aux,,m68k-apple-aux}
1084@item
1085@uref{#m68k-att-sysv,,m68k-att-sysv}
1086@item
1087@uref{#m68k-bull-sysv,,m68k-bull-sysv}
1088@item
1089@uref{#m68k-crds-unox,,m68k-crds-unox}
1090@item
1091@uref{#m68k-hp-hpux,,m68k-hp-hpux}
1092@item
f42974dc
DW
1093@uref{#m68k-*-nextstep*,,m68k-*-nextstep*}
1094@item
b8df899a
JM
1095@uref{#m68k-ncr-*,,m68k-ncr-*}
1096@item
1097@uref{#m68k-sun,,m68k-sun}
1098@item
f42974dc
DW
1099@uref{#m68k-sun-sunos4.1.1,,m68k-sun-sunos4.1.1}
1100@item
b8df899a
JM
1101@uref{#m88k-*-svr3,,m88k-*-svr3}
1102@item
1103@uref{#m88k-*-dgux,,m88k-*-dgux}
1104@item
1105@uref{#m88k-tektronix-sysv3,,m88k-tektronix-sysv3}
1106@item
1107@uref{#mips-*-*,,mips-*-*}
1108@item
1109@uref{#mips-mips-bsd,,mips-mips-bsd}
1110@item
1111@uref{#mips-mips-riscos*,,mips-mips-riscos*}
1112@item
f42974dc
DW
1113@uref{#mips*-sgi-irix[45],,mips*-sgi-irix[45]}
1114@item
1115@uref{#mips*-sgi-irix6,,mips*-sgi-irix6}
1116@item
b8df899a
JM
1117@uref{#mips-sony-sysv,,mips-sony-sysv}
1118@item
1119@uref{#ns32k-encore,,ns32k-encore}
1120@item
1121@uref{#ns32k-*-genix,,ns32k-*-genix}
1122@item
1123@uref{#ns32k-sequent,,ns32k-sequent}
1124@item
1125@uref{#ns32k-utek,,ns32k-utek}
1126@item
b8df899a
JM
1127@uref{#powerpc-*-elf,,powerpc-*-elf, powerpc-*-sysv4}
1128@item
f42974dc
DW
1129@uref{#powerpc-*-linux-gnu*,,powerpc-*-linux-gnu*}
1130@item
b8df899a
JM
1131@uref{#powerpc-*-eabiaix,,powerpc-*-eabiaix}
1132@item
1133@uref{#powerpc-*-eabisim,,powerpc-*-eabisim}
1134@item
1135@uref{#powerpc-*-eabi,,powerpc-*-eabi}
1136@item
1137@uref{#powerpcle-*-elf,,powerpcle-*-elf, powerpcle-*-sysv4}
1138@item
1139@uref{#powerpcle-*-eabisim,,powerpcle-*-eabisim}
1140@item
1141@uref{#powerpcle-*-eabi,,powerpcle-*-eabi}
1142@item
1143@uref{#powerpcle-*-winnt,,powerpcle-*-winnt, powerpcle-*-pe}
1144@item
1145@uref{#romp-*-aos,,romp-*-aos, romp-*-mach}
1146@item
f42974dc
DW
1147@uref{#*-*-solaris*,,*-*-solaris*}
1148@item
b8df899a
JM
1149@uref{#sparc-sun-*,,sparc-sun-*}
1150@item
f42974dc
DW
1151@uref{#sparc-sun-solaris*,,sparc-sun-solaris*}
1152@item
1153@uref{#sparc-sun-solaris2.7,,sparc-sun-solaris2.7}
1154@item
1155@uref{#*-sun-solaris2.8,,*-sun-solaris2.8}
1156@item
1157@uref{#sunv5,,Sun V5.0 Compiler Bugs}
1158@item
1159@uref{#sparc-sun-sunos*,,sparc-sun-sunos*}
1160@item
1161@uref{#sparc-unknown-linux-gnulibc1,,sparc-unknown-linux-gnulibc1}
1162@item
1163@uref{#sparc64-*-*,,sparc64-*-*}
1164@item
b8df899a
JM
1165@uref{#*-*-sysv*,,*-*-sysv*}
1166@item
1167@uref{#vax-dec-ultrix,,vax-dec-ultrix}
1168@item
1169@uref{#we32k-*-*,,we32k-*-*}
1170@item
f42974dc
DW
1171@uref{#windows,,Microsoft Windows}
1172@item
1173@uref{#os2,,OS/2}
1174@item
1175@uref{#older,,Older systems}
1176@end itemize
1177
1178@itemize
1179@item
1180@uref{#elf_targets,,all ELF targets} (SVR4, Solaris, etc.)
1181@end itemize
ef88b07d 1182@end ifhtml
f42974dc
DW
1183
1184
1185@html
1186<!-- -------- host/target specific issues start here ---------------- -->
1187<hr>
f42974dc 1188@end html
b8df899a
JM
1189@heading @anchor{1750a-*-*}1750a-*-*
1190MIL-STD-1750A processors.
1191
1192The MIL-STD-1750A cross configuration produces output for
1193@code{as1750}, an assembler/linker available under the GNU Public
1194License for the 1750A. @code{as1750} can be obtained at
1195@uref{ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/}.
1196A similarly licensed simulator for
1197the 1750A is available from same address.
1198
1199You should ignore a fatal error during the building of libgcc (libgcc is
1200not yet implemented for the 1750A.)
1201
1202The @code{as1750} assembler requires the file @file{ms1750.inc}, which is
1203found in the directory @file{config/1750a}.
1204
1205GNU CC produced the same sections as the Fairchild F9450 C Compiler,
1206namely:
1207
1208@table @code
1209@item Normal
1210The program code section.
1211
1212@item Static
1213The read/write (RAM) data section.
1214
1215@item Konst
1216The read-only (ROM) constants section.
1217
1218@item Init
1219Initialization section (code to copy KREL to SREL).
1220@end table
1221
1222The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16). This
1223means that type `char' is represented with a 16-bit word per character.
1224The 1750A's "Load/Store Upper/Lower Byte" instructions are not used by
1225GNU CC.
1226
1227@html
1228</p>
1229<hr>
1230@end html
1231@heading @anchor{a29k}a29k
1232AMD Am29k-family processors. These are normally used in embedded
1233applications. There are no standard Unix configurations.
1234This configuration
1235corresponds to AMD's standard calling sequence and binary interface
1236and is compatible with other 29k tools.
1237
1238You may need to make a variant of the file @file{a29k.h} for your
1239particular configuration.
1240
1241@html
1242</p>
1243<hr>
1244@end html
1245@heading @anchor{a29k-*-bsd}a29k-*-bsd
1246AMD Am29050 used in a system running a variant of BSD Unix.
1247
1248@html
1249</p>
1250<hr>
1251@end html
ef88b07d 1252@heading @anchor{alpha*-dec-linux*}alpha*-dec-linux*
f42974dc 1253
75f3e3c8
RH
1254We require binutils 2.11 or newer. Previous binutils releases
1255had a number of problems with DWARF2 debugging information, not
1256the least of which is incorrect linking of shared libraries.
f42974dc 1257
b8df899a
JM
1258@html
1259</p>
1260<hr>
1261@end html
1262@heading @anchor{alpha-*-osf1}alpha-*-osf1
1263Systems using processors that implement the DEC Alpha architecture and
1264are running the DEC Unix (OSF/1) operating system, for example the DEC
1265Alpha AXP systems.CC.)
1266
1267GNU CC writes a @samp{.verstamp} directive to the assembler output file
1268unless it is built as a cross-compiler. It gets the version to use from
1269the system header file @file{/usr/include/stamp.h}. If you install a
1270new version of DEC Unix, you should rebuild GCC to pick up the new version
1271stamp.
1272
1273Note that since the Alpha is a 64-bit architecture, cross-compilers from
127432-bit machines will not generate code as efficient as that generated
1275when the compiler is running on a 64-bit machine because many
1276optimizations that depend on being able to represent a word on the
1277target in an integral value on the host cannot be performed. Building
1278cross-compilers on the Alpha for 32-bit machines has only been tested in
1279a few cases and may not work properly.
1280
1281@code{make compare} may fail on old versions of DEC Unix unless you add
1282@samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
1283assembler input file is stored in the object file, and that makes
1284comparison fail if it differs between the @code{stage1} and
1285@code{stage2} compilations. The option @samp{-save-temps} forces a
1286fixed name to be used for the assembler input file, instead of a
1287randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
1288unless the comparisons fail without that option. If you add
1289@samp{-save-temps}, you will have to manually delete the @samp{.i} and
1290@samp{.s} files after each series of compilations.
1291
1292GNU CC now supports both the native (ECOFF) debugging format used by DBX
1293and GDB and an encapsulated STABS format for use only with GDB. See the
1294discussion of the @samp{--with-stabs} option of @file{configure} above
1295for more information on these formats and how to select them.
1296
1297There is a bug in DEC's assembler that produces incorrect line numbers
1298for ECOFF format when the @samp{.align} directive is used. To work
1299around this problem, GNU CC will not emit such alignment directives
1300while writing ECOFF format debugging information even if optimization is
1301being performed. Unfortunately, this has the very undesirable
1302side-effect that code addresses when @samp{-O} is specified are
1303different depending on whether or not @samp{-g} is also specified.
1304
1305To avoid this behavior, specify @samp{-gstabs+} and use GDB instead of
1306DBX. DEC is now aware of this problem with the assembler and hopes to
1307provide a fix shortly.
1308
f42974dc
DW
1309@html
1310</p>
1311<hr>
f42974dc 1312@end html
ef88b07d 1313@heading @anchor{alpha*-dec-osf*}alpha*-dec-osf*
f42974dc
DW
1314
1315If you install a shared libstdc++ and, when you link a non-trivial C++
38209993 1316program (for example, @file{gcc/testsuite/g++.other/delete3.C}),
f42974dc
DW
1317the linker reports a couple of errors about multiply-defined symbols
1318(for example, @code{nothrow}, @code{__throw} and
1319@code{terminate(void)}), you've probably got a linker bug, for
1320which there's no known fix. The officially recommended work-around is
1321to remove the shared libstdc++.
1322
1323An alternative solution is to arrange that all symbols from
1324@code{libgcc} get copied to the shared @code{libstdc++};
1325see detailed solution below. (Surprising as it may seem, this does
1326indeed fix the problem!) @emph{Beware} that this may bring you
1327binary-compatibility problems in the future, if you don't use the same
1328work-around next time you build @code{libstdc++}: if programs
1329start to depend on @code{libstdc++} to provide symbols that used
1330to be only in @code{libgcc}, you must arrange that
1331@code{libstdc++} keeps providing them, otherwise the programs
1332will have to be relinked.
1333
1334The magic spell is to add @code{-Wl,-all,-lgcc,-none} to the
1335definition of macro @code{SHDEPS} in
38209993
LG
1336@file{libstdc++/config/dec-osf.ml} @emph{before}
1337@file{alpha*-dec-osf*/libstdc++/Makefile} is created (a
f42974dc
DW
1338@uref{dec-osf-shlibstdc++.patch,,patch}
1339that does just that is available). If the Makefile already exists, run
38209993
LG
1340@file{./config.status} within directory
1341@file{alpha*-dec-osf*/libstdc++} (and
1342@file{alpha*-dec-osf*/ieee/libstdc++}, if it also exists).
1343Remove any existing @file{libstdc++.so*} from such directories,
1344and run @samp{make all-target-libstdc++} in the top-level
1345directory, then @samp{make install-target-libstdc++}.
f42974dc
DW
1346
1347If you have already removed the build tree, you may just remove
38209993 1348@file{libstdc++.so.2.10.0} from the install tree and re-create
f42974dc 1349it with the command
38209993
LG
1350@samp{gcc -shared -o libstdc++.so.2.10.0 -Wl,-all,-lstdc++,-lgcc,-none -lm}.
1351If the @file{ieee}
f42974dc 1352sub-directory exists, repeat this command in it, with the additional
38209993 1353flag @option{-mieee}.
f42974dc 1354
b8df899a
JM
1355@html
1356</p>
1357<hr>
1358@end html
1359@heading @anchor{arc-*-elf}arc-*-elf
1360Argonaut ARC processor.
1361This configuration is intended for embedded systems.
1362
1363@html
1364</p>
1365<hr>
1366@end html
1367@heading @anchor{arm-*-aout}arm-*-aout
1368Advanced RISC Machines ARM-family processors. These are often used in
1369embedded applications. There are no standard Unix configurations.
1370This configuration corresponds to the basic instruction sequences and will
1371produce @file{a.out} format object modules.
1372
1373You may need to make a variant of the file @file{arm.h} for your particular
1374configuration.
1375
1376@html
1377</p>
1378<hr>
1379@end html
1380@heading @anchor{arm-*-elf}arm-*-elf
1381This configuration is intended for embedded systems.
1382
476c334e
PB
1383@html
1384</p>
1385<hr>
476c334e 1386@end html
ef88b07d 1387@heading @anchor{arm*-*-linux-gnu}arm*-*-linux-gnu
476c334e
PB
1388
1389We require GNU binutils 2.10 or newer.
1390
b8df899a
JM
1391@html
1392</p>
1393<hr>
1394@end html
1395@heading @anchor{arm-*-riscix}arm-*-riscix
1396The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD Unix.
1397If you are running a version of RISC iX prior to 1.2 then you must
1398specify the version number during configuration. Note that the
1399assembler shipped with RISC iX does not support stabs debugging
1400information; a new version of the assembler, with stabs support
1401included, is now available from Acorn and via ftp
1402@uref{ftp://ftp.acorn.com/pub/riscix/as+xterm.tar.Z}. To enable stabs
1403debugging, pass @samp{--with-gnu-as} to configure.
1404
1405You will need to install GNU @file{sed} before you can run configure.
1406
f42974dc
DW
1407@html
1408</p>
1409<hr>
f42974dc 1410@end html
ef88b07d 1411@heading @anchor{avr}avr
f42974dc 1412
b8df899a
JM
1413ATMEL AVR-family micro controllers. These are used in embedded
1414applications. There are no standard Unix configurations. @xref{AVR
1415Options,, AVR Options, gcc, Using and Porting the GNU Compiler
1416Collection (GCC)}, for the list of supported MCU types.
1417
38209993 1418Use @samp{configure --target=avr}
f42974dc
DW
1419@option{--enable-languages="c"}' to configure GCC.
1420
1421Further installation notes and other useful information about AVR tools
1422can also be obtained from:
1423
1424@itemize @bullet
1425@item
1426@uref{http://home.overta.ru/users/denisc,,http://home.overta.ru/users/denisc}
1427@item
1428@uref{http://www.itnet.pl/amelektr/avr,,http://www.itnet.pl/amelektr/avr}
1429@end itemize
1430
20293b4c 1431We @emph{strongly} recommend using binutils 2.11 or newer.
f42974dc
DW
1432
1433The following error:
1434@example
1435 Error: register required
1436@end example
1437
1438indicates that you should upgrade to a newer version of the binutils.
1439
b8df899a
JM
1440@html
1441</p>
1442<hr>
1443@end html
1444@heading @anchor{decstation-*}decstation-*
1445MIPS-based DECstations can support three different personalities:
1446Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products have
1447a configuration name beginning with @samp{alpha-dec}.) To configure GCC
1448for these platforms use the following configurations:
1449
1450@table @samp
1451@item decstation-ultrix
1452Ultrix configuration.
1453
1454@item decstation-osf1
1455Dec's version of OSF/1.
1456
1457@item decstation-osfrose
1458Open Software Foundation reference port of OSF/1 which uses the
1459OSF/rose object file format instead of ECOFF. Normally, you
1460would not select this configuration.
1461@end table
1462
1463The MIPS C compiler needs to be told to increase its table size
1464for switch statements with the @samp{-Wf,-XNg1500} option in
1465order to compile @file{cp/parse.c}. If you use the @samp{-O2}
1466optimization option, you also need to use @samp{-Olimit 3000}.
1467Both of these options are automatically generated in the
1468@file{Makefile} that the shell script @file{configure} builds.
1469If you override the @code{CC} make variable and use the MIPS
1470compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
1471
f42974dc
DW
1472@html
1473</p>
1474<hr>
f42974dc 1475@end html
ef88b07d 1476@heading @anchor{dos}DOS
f42974dc
DW
1477
1478Please have a look at our @uref{binaries.html,,binaries page}.
1479
b8df899a
JM
1480@html
1481</p>
1482<hr>
1483@end html
1484@heading @anchor{dsp16xx}dsp16xx
1485A port to the AT&T DSP1610 family of processors.
1486
1487@html
1488</p>
1489<hr>
1490@end html
1491@heading @anchor{elxsi-elxsi-bsd}elxsi-elxsi-bsd
1492The Elxsi's C compiler has known limitations that prevent it from
1493compiling GNU C. Please contact @email{mrs@@cygnus.com} for more details.
1494
f42974dc
DW
1495@html
1496</p>
1497<hr>
f42974dc 1498@end html
ef88b07d 1499@heading @anchor{h8300-hms}h8300-hms
b8df899a 1500Hitachi H8/300 series of processors.
f42974dc
DW
1501
1502Please have a look at our @uref{binaries.html,,binaries page}.
1503
b8df899a
JM
1504The calling convention and structure layout has changed in release 2.6.
1505All code must be recompiled. The calling convention now passes the
1506first three arguments in function calls in registers. Structures are no
1507longer a multiple of 2 bytes.
1508
f42974dc
DW
1509@html
1510</p>
1511<hr>
f42974dc 1512@end html
ef88b07d 1513@heading @anchor{hppa*-hp-hpux*}hppa*-hp-hpux*
f42974dc
DW
1514
1515We @emph{highly} recommend using gas/binutils-2.8 or newer on all hppa
1516platforms; you may encounter a variety of problems when using the HP
1517assembler.
1518
1519Specifically, @option{-g} does not work on HP-UX (since that system
1520uses a peculiar debugging format which GCC does not know about), unless you
38209993
LG
1521use GAS and GDB and configure GCC with the
1522@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
1523@option{--with-as=...} options.
f42974dc
DW
1524
1525If you wish to use pa-risc 2.0 architecture support, you must use either
20293b4c 1526the HP assembler, gas/binutils-2.11 or a recent
f42974dc
DW
1527@uref{ftp://sources.redhat.com/pub/binutils/snapshots,,snapshot of gas}.
1528
1529More specific information to hppa*-hp-hpux* targets follows.
1530
1531@html
1532</p>
1533<hr>
f42974dc 1534@end html
ef88b07d 1535@heading @anchor{hppa*-hp-hpux9}hppa*-hp-hpux9
f42974dc
DW
1536
1537The HP assembler has major problems on this platform. We've tried to work
1538around the worst of the problems. However, those workarounds may be causing
1539linker crashes in some circumstances; the workarounds also probably prevent
1540shared libraries from working. Use the GNU assembler to avoid these problems.
1541
1542
1543The configuration scripts for GCC will also trigger a bug in the hpux9
38209993
LG
1544shell. To avoid this problem set @env{CONFIG_SHELL} to @file{/bin/ksh}
1545and @env{SHELL} to @file{/bin/ksh} in your environment.
f42974dc
DW
1546
1547
1548@html
1549</p>
1550<hr>
f42974dc 1551@end html
ef88b07d 1552@heading @anchor{hppa*-hp-hpux10}hppa*-hp-hpux10
f42974dc
DW
1553
1554For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
1555@code{PHCO_19798} from HP. HP has two sites which provide patches free of
1556charge:
1557
1558@itemize @bullet
1559@item
1560@html
1561<a href="http://us-support.external.hp.com">US, Canada, Asia-Pacific, and
1562Latin-America</a>
1563@end html
1564@ifnothtml
1565@uref{http://us-support.external.hp.com,,}US, Canada, Asia-Pacific, and
1566Latin-America
1567@end ifnothtml
1568@item
1569@uref{http://europe-support.external.hp.com,,Europe}
1570@end itemize
1571
1572The HP assembler on these systems is much better than the hpux9 assembler,
1573but still has some problems. Most notably the assembler inserts timestamps
1574into each object file it creates, causing the 3-stage comparison test to fail
38209993
LG
1575during a @samp{make bootstrap}. You should be able to continue by
1576saying @samp{make all} after getting the failure from @samp{make
1577bootstrap}.
f42974dc
DW
1578
1579
1580@html
1581</p>
1582<hr>
f42974dc 1583@end html
ef88b07d 1584@heading @anchor{hppa*-hp-hpux11}hppa*-hp-hpux11
f42974dc
DW
1585
1586GCC 2.95.2 does not support HP-UX 11, and it cannot generate 64-bit
1587object files. Current (as of late 2000) snapshots and GCC 3.0 do support
1588HP-UX 11.
1589
1590
b8df899a
JM
1591@html
1592</p>
1593<hr>
1594@end html
1595@heading @anchor{i370-*-*}i370-*-*
1596This port is very preliminary and has many known bugs. We hope to
1597have a higher-quality port for this machine soon.
1598
f42974dc
DW
1599@html
1600</p>
1601<hr>
f42974dc 1602@end html
ef88b07d 1603@heading @anchor{*-*-linux-gnu}*-*-linux-gnu
f42974dc
DW
1604
1605If you use glibc 2.2 (or 2.1.9x), GCC 2.95.2 won't install
1606out-of-the-box. You'll get compile errors while building libstdc++.
1607The patch @uref{glibc-2.2.patch,,glibc-2.2.patch}, that is to be
1608applied in the GCC source tree, fixes the compatibility problems.
1609
b8df899a
JM
1610@html
1611</p>
1612<hr>
1613@end html
1614@heading @anchor{ix86-*-linux*oldld}i?86-*-linux*oldld
1615Use this configuration to generate @file{a.out} binaries on Linux-based
1616GNU systems if you do not have gas/binutils version 2.5.2 or later
1617installed. This is an obsolete configuration.
1618
1619@html
1620</p>
1621<hr>
1622@end html
1623@heading @anchor{ix86-*-linux*aout}i?86-*-linux*aout
1624Use this configuration to generate @file{a.out} binaries on Linux-based
1625GNU systems. This configuration is being superseded. You must use
1626gas/binutils version 2.5.2 or later.
1627
f42974dc
DW
1628@html
1629</p>
1630<hr>
f42974dc 1631@end html
ef88b07d 1632@heading @anchor{ix86-*-linux*}i?86-*-linux*
f42974dc
DW
1633
1634You will need binutils-2.9.1.0.15 or newer for exception handling to work.
1635
1636If you receive Signal 11 errors when building on GNU/Linux, then it is
1637possible you have a hardware problem. Further information on this can be
1638found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
1639
b8df899a
JM
1640@html
1641</p>
1642<hr>
1643@end html
1644@heading @anchor{ix86-*-sco}i?86-*-sco
1645Compilation with RCC is recommended. Also, it may be a good idea to
1646link with GNU malloc instead of the malloc that comes with the system.
1647
1648@html
1649</p>
1650<hr>
1651@end html
1652@heading @anchor{ix86-*-sco3.2v4}i?86-*-sco3.2v4
1653Use this configuration for SCO release 3.2 version 4.
1654
f42974dc
DW
1655@html
1656</p>
1657<hr>
f42974dc 1658@end html
ef88b07d 1659@heading @anchor{ix86-*-sco3.2v5*}i?86-*-sco3.2v5*
b8df899a 1660Use this for the SCO OpenServer Release 5 family of operating systems.
f42974dc
DW
1661
1662Unlike earlier versions of GCC, the ability to generate COFF with this
1663target is no longer provided.
1664
1665Earlier versions of GCC emitted Dwarf-1 when generating ELF to allow
1666the system debugger to be used. That support was too burdensome to
1667maintain. GCC now emits only dwarf-2 for this target. This means you
1668may use either the UDK debugger or GDB to debug programs built by this
1669version of GCC.
1670
1671If you are building languages other than C, you must follow the instructions
38209993
LG
1672about invoking @samp{make bootstrap} because the native OpenServer
1673compiler will build a @command{cc1plus} that will not correctly parse many
1674valid C++ programs including those in @file{libgcc.a}.
1675@strong{You must do a @samp{make bootstrap} if you are building with the
f42974dc
DW
1676native compiler.}
1677
38209993 1678Use of the @option{-march-pentiumpro} flag can result in
f42974dc
DW
1679unrecognized opcodes when using the native assembler on OS versions before
16805.0.6. (Support for P6 opcodes was added to the native ELF assembler in
1681that version.) While it's rather rare to see these emitted by GCC yet,
1682errors of the basic form:
1683
1684@example
1685 /usr/tmp/ccaNlqBc.s:22:unknown instruction: fcomip
1686 /usr/tmp/ccaNlqBc.s:50:unknown instruction: fucomip
1687@end example
1688
1689are symptoms of this problem. You may work around this by not
1690building affected files with that flag, by using the GNU assembler, or
1691by using the assembler provided with the current version of the OS.
1692Users of GNU assembler should see the note below for hazards on doing
1693so.
1694
1695The native SCO assembler that is provided with the OS at no
1696charge is normally required. If, however, you must be able to use
1697the GNU assembler (perhaps you're compiling code with asms that
1698require GAS syntax) you may configure this package using the flags
38209993
LG
1699@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}}. You must
1700use a recent version of GNU binutils; versions past 2.9.1 seem to work
1701well.
f42974dc
DW
1702
1703In general, the @option{--with-gnu-as} option isn't as well tested
1704as the native assembler.
1705
1706Look in @file{gcc/config/i386/sco5.h} (search for "messy") for
1707additional OpenServer-specific flags.
1708
38209993 1709Systems based on OpenServer before 5.0.4 (@samp{uname -X}
f42974dc
DW
1710will tell you what you're running) require TLS597 from ftp.sco.com/TLS
1711for C++ constructors and destructors to work right.
1712
1713The system linker in (at least) 5.0.4 and 5.0.5 will sometimes
1714do the wrong thing for a construct that GCC will emit for PIC
1715code. This can be seen as execution testsuite failures when using
1716-fPIC on 921215-1.c, 931002-1.c, nestfunc-1.c, and gcov-1.c.
1717For 5.0.5, an updated linker that will cure this problem is
1718available. You must install both
38209993 1719@uref{ftp://ftp.sco.com/Supplements/rs505a/,,ftp://ftp.sco.com/Supplements/rs505a/}
f42974dc
DW
1720and @uref{ftp://ftp.sco.com/SLS/,,OSS499A}.
1721
1722The dynamic linker in OpenServer 5.0.5 (earlier versions may show
1723the same problem) aborts on certain g77-compiled programs. It's particularly
1724likely to be triggered by building Fortran code with the @option{-fPIC} flag.
1725Although it's conceivable that the error could be triggered by other
1726code, only G77-compiled code has been observed to cause this abort.
1727If you are getting core dumps immediately upon execution of your
1728g77 program - and especially if it's compiled with -fPIC - try applying
38209993 1729@uref{sco_osr5_g77.patch,,@file{sco_osr5_g77.patch}} to your libf2c and
f42974dc
DW
1730rebuilding GCC.
1731Affected faults, when analyzed in a debugger, will show a stack
1732backtrace with a fault occurring in @code{rtld()} and the program
38209993 1733running as @file{/usr/lib/ld.so.1}. This problem has been reported to SCO
f42974dc
DW
1734engineering and will hopefully be addressed in later releases.
1735
1736
1737@html
1738</p>
1739<hr>
f42974dc 1740@end html
ef88b07d 1741@heading @anchor{ix86-*-solaris*}i?86-*-solaris*
f42974dc
DW
1742
1743GCC 2.95.2, when configured to use the GNU assembler, would invoke
1744it with the @code{-s} switch, that GNU as up to 2.9.5.0.12 does
1745not support. If you'd rather not use a newer GNU as nor the native
1746assembler, you'll need the patch
38209993 1747@uref{x86-sol2-gas.patch,,@file{x86-sol2-gas.patch}}.
f42974dc
DW
1748
1749
1750@html
1751</p>
1752<hr>
f42974dc 1753@end html
ef88b07d 1754@heading @anchor{ix86-*-udk}i?86-*-udk
f42974dc
DW
1755
1756This target emulates the SCO Universal Development Kit and requires that
1757package be installed. (If it is installed, you will have a
1758@file{/udk/usr/ccs/bin/cc } file present.) It's very much like the
1759@code{i?86-*-unixware7*} target
1760but is meant to be used when hosting on a system where UDK isn't the
1761default compiler such as OpenServer 5 or Unixware 2. This target will
1762generate binaries that will run on OpenServer, Unixware 2, or Unixware 7,
1763with the same warnings and caveats as the SCO UDK.
1764
1765You can stage1 with either your native compiler or with UDK. If you
1766don't do a full bootstrap when initially building with your native compiler
1767you will have an utterly unusable pile of bits as your reward.
1768
1769This target is a little tricky to build because we have to distinguish
1770it from the native tools (so it gets headers, startups, and libraries
1771from the right place) while making the tools not think we're actually
1772building a cross compiler. The easiest way to do this is with a configure
1773command like this:
1774
38209993 1775@samp{CC=/udk/usr/ccs/bin/cc <i>/your/path/to/</i>gcc/configure
f42974dc
DW
1776--host=i686-pc-udk --target=i686-pc-udk --program-prefix=udk-}
1777
1778@emph{You should substitute 'i686' in the above command with the appropriate
1779processor for your host.}
1780
38209993
LG
1781You should follow this with a @samp{make bootstrap} then
1782@samp{make install}. You can then access the UDK-targeted GCC
1783tools by adding @command{udk-} before the commonly known name. For
1784example, to invoke the C compiler, you would use @command{udk-gcc}.
1785They will coexist peacefully with any native-target GCC tools you may
1786have installed.
f42974dc
DW
1787
1788
b8df899a
JM
1789@html
1790</p>
1791<hr>
1792@end html
1793@heading @anchor{ix86-*-isc}i?86-*-isc
1794It may be a good idea to link with GNU malloc instead of the malloc that
1795comes with the system.
1796
1797In ISC version 4.1, @file{sed} core dumps when building
1798@file{deduced.h}. Use the version of @file{sed} from version 4.0.
1799
1800@html
1801</p>
1802<hr>
1803@end html
1804@heading @anchor{ix86-*-esix}i?86-*-esix
1805It may be good idea to link with GNU malloc instead of the malloc that
1806comes with the system.
1807
1808@html
1809</p>
1810<hr>
1811@end html
1812@heading @anchor{ix86-ibm-aix}i?86-ibm-aix
1813You need to use GAS version 2.1 or later, and LD from
1814GNU binutils version 2.2 or later.
1815
1816@html
1817</p>
1818<hr>
1819@end html
1820@heading @anchor{ix86-sequent-bsd}i?86-sequent-bsd
1821Go to the Berkeley universe before compiling.
1822
1823@html
1824</p>
1825<hr>
1826@end html
1827@heading @anchor{ix86-sequent-ptx1*}i?86-sequent-ptx1*, i?86-sequent-ptx2*
1828You must install GNU @file{sed} before running @file{configure}.
1829
1830@html
1831</p>
1832<hr>
1833@end html
1834@heading @anchor{#ix86-*-sysv3*}i?86-*-sysv3*
1835The @code{fixproto} shell script may trigger a bug in the system shell.
1836If you encounter this problem, upgrade your operating system or
1837use BASH (the GNU shell) to run @code{fixproto}.
1838
1839
1840@html
1841</p>
1842<hr>
1843@end html
1844@heading @anchor{i860-intel-osf*}i860-intel-osf*
1845On the Intel Paragon (an i860 machine), if you are using operating
1846system version 1.0, you will get warnings or errors about redefinition
1847of @code{va_arg} when you build GCC.
1848
1849If this happens, then you need to link most programs with the library
1850@file{iclib.a}. You must also modify @file{stdio.h} as follows: before
1851the lines
1852
1853@example
1854#if defined(__i860__) && !defined(_VA_LIST)
1855#include <va_list.h>
1856@end example
1857
1858@noindent
1859insert the line
1860
1861@example
1862#if __PGC__
1863@end example
1864
1865@noindent
1866and after the lines
1867
1868@example
1869extern int vprintf(const char *, va_list );
1870extern int vsprintf(char *, const char *, va_list );
1871#endif
1872@end example
1873
1874@noindent
1875insert the line
1876
1877@example
1878#endif /* __PGC__ */
1879@end example
1880
1881These problems don't exist in operating system version 1.1.
1882
1883@html
1884</p>
1885<hr>
1886@end html
1887@heading @anchor{*-lynx-lynxos}*-lynx-lynxos
1888LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
1889@file{/bin/gcc}. You should compile with this instead of @file{/bin/cc}.
1890You can tell GNU CC to use the GNU assembler and linker, by specifying
1891@samp{--with-gnu-as --with-gnu-ld} when configuring. These will produce
1892COFF format object files and executables; otherwise GNU CC will use the
1893installed tools, which produce @file{a.out} format executables.
1894
f42974dc
DW
1895@html
1896</p>
1897<hr>
f42974dc
DW
1898<!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
1899@end html
ef88b07d 1900@heading @anchor{*-ibm-aix*}*-ibm-aix*
f42974dc
DW
1901
1902AIX Make frequently has problems with GCC makefiles. GNU Make 3.76 or
1903newer is recommended to build on this platform.
1904
1905Errors involving "alloca" when building GCC generally are due
38209993 1906to an incorrect definition of @var{CC} in the Makefile or mixing files
f42974dc
DW
1907compiled with the native C compiler and GCC. During the stage1 phase of
1908the build, the native AIX compiler @strong{must} be invoked as "cc"
1909(not "xlc"). Once @command{configure} has been informed of
38209993
LG
1910"xlc", one needs to use @samp{make distclean} to remove the
1911configure cache files and ensure that @env{CC} environment variable
f42974dc
DW
1912does not provide a definition that will confuse @command{configure}.
1913If this error occurs during stage2 or later, then the problem most likely
1914is the version of Make (see above).
1915
df002c7d 1916Binutils 2.10 does not support AIX 4.3. Binutils available from the
38209993
LG
1917@uref{http://www-1.ibm.com/servers/aix/products/aixos/linux/,,AIX
1918Toolbox for Linux: GNU and Open Source tools for AIX};
df002c7d
DE
1919website does work. Binutils 2.11 is expected to include AIX 4.3
1920support. The GNU Assembler is necessary for libstdc++ to build. The
1921AIX native ld still is recommended. The native AIX tools do
1922interoperate with GCC.
1923
1924Linking executables and shared libraries may produce warnings of
1925duplicate symbols. The assembly files generated by GCC for AIX always
1926have included multiple symbol definitions for certain global variable
1927and function declarations in the original program. The warnings should
1928not prevent the linker from producing a correct library or runnable
1929executable.
1930
1931AIX 4.3 utilizes a "large format" archive to support both 32-bit and
193264-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
1933to parse archive libraries did not handle the new format correctly.
1934These routines are used by GCC and result in error messages during
1935linking such as "not a COFF file". The version of the routines shipped
1936with AIX 4.3.1 should work for a 32-bit environment. The @option{-g}
1937option of the archive command may be used to create archives of 32-bit
1938objects using the original "small format". A correct version of the
1939routines is shipped with AIX 4.3.2.
1940
f42974dc
DW
1941Some versions of the AIX binder (linker) can fail with a relocation
1942overflow severe error when the @option{-bbigtoc} option is used to link
1943GCC-produced object files into an executable that overflows the TOC. A fix
1944for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
1945available from IBM Customer Support and from its
1946@uref{http://service.boulder.ibm.com/,,service.boulder.ibm.com}
1947website as PTF U455193.
1948
df002c7d
DE
1949The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
1950with a segmentation fault when invoked by any version of GCC. A fix for
1951APAR IX87327 is available from IBM Customer Support and from its
1952@uref{http://service.boulder.ibm.com/,,service.boulder.ibm.com}
1953website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above.
f42974dc
DW
1954
1955The initial assembler shipped with AIX 4.3.0 generates incorrect object
1956files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
1957TO ASSEMBLE/BIND) is available from IBM Customer Support and from its
1958@uref{http://service.boulder.ibm.com/,,service.boulder.ibm.com}
1959website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above.
1960
df002c7d
DE
1961AIX provides National Language Support (NLS). Compilers and assemblers
1962use NLS to support locale-specific representations of various data
1963formats including floating-point numbers (e.g., "." vs "," for
1964separating decimal fractions). There have been problems reported where
1965GCC does not produce the same floating-point formats that the assembler
38209993 1966expects. If one encouters this problem, set the @env{LANG}
df002c7d 1967environment variable to "C" or "En_US".
f42974dc 1968
5791e6da
DE
1969By default, GCC for AIX 4.1 and above produces code that can be used on
1970both Power or PowerPC processors.
1971
1972You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1973switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
f42974dc 1974
b8df899a
JM
1975@html
1976</p>
1977<hr>
1978@end html
1979@heading @anchor{m32r-*-elf}m32r-*-elf
1980Mitsubishi M32R processor.
1981This configuration is intended for embedded systems.
1982
1983@html
1984</p>
1985<hr>
1986@end html
1987@heading @anchor{m68000-hp-bsd}m68000-hp-bsd
1988HP 9000 series 200 running BSD. Note that the C compiler that comes
1989with this system cannot compile GNU CC; contact @email{law@@cygnus.com}
1990to get binaries of GNU CC for bootstrapping.
1991
1992@html
1993</p>
1994<hr>
1995@end html
1996@heading @anchor{m6811-elf}m6811-elf
1997Motorola 68HC11 family micro controllers. These are used in embedded
1998applications. There are no standard Unix configurations.
1999
2000@html
2001</p>
2002<hr>
2003@end html
2004@heading @anchor{m6812-elf}m6812-elf
2005Motorola 68HC12 family micro controllers. These are used in embedded
2006applications. There are no standard Unix configurations.
2007
2008@html
2009</p>
2010<hr>
2011@end html
2012@heading @anchor{m68k-altos}m68k-altos
2013Altos 3068. You must use the GNU assembler, linker and debugger.
2014Also, you must fix a kernel bug. Details in the file @file{README.ALTOS}.
2015
2016@html
2017</p>
2018<hr>
2019@end html
2020@heading @anchor{m68k-apple-aux}m68k-apple-aux
2021Apple Macintosh running A/UX.
2022You may configure GCC to use either the system assembler and
2023linker or the GNU assembler and linker. You should use the GNU configuration
2024if you can, especially if you also want to use GNU C++. You enabled
2025that configuration with + the @samp{--with-gnu-as} and @samp{--with-gnu-ld}
2026options to @code{configure}.
2027
2028Note the C compiler that comes
2029with this system cannot compile GNU CC. You can find binaries of GNU CC
2030for bootstrapping on @code{jagubox.gsfc.nasa.gov}.
2031You will also a patched version of @file{/bin/ld} there that
2032raises some of the arbitrary limits found in the original.
2033
2034@html
2035</p>
2036<hr>
2037@end html
2038@heading @anchor{m68k-att-sysv}m68k-att-sysv
2039AT&T 3b1, a.k.a. 7300 PC. This version of GNU CC cannot
2040be compiled with the system C compiler, which is too buggy.
2041You will need to get a previous version of GCC and use it to
2042bootstrap. Binaries are available from the OSU-CIS archive, at
2043@uref{ftp://archive.cis.ohio-state.edu/pub/att7300/}.
2044
2045@html
2046</p>
2047<hr>
2048@end html
2049@heading @anchor{m68k-bull-sysv}m68k-bull-sysv
2050Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU CC works
2051either with native assembler or GNU assembler. You can use
2052GNU assembler with native coff generation by providing @samp{--with-gnu-as} to
2053the configure script or use GNU assembler with dbx-in-coff encapsulation
2054by providing @samp{--with-gnu-as --stabs}. For any problem with native
2055assembler or for availability of the DPX/2 port of GAS, contact
2056@email{F.Pierresteguy@@frcl.bull.fr}.
2057
2058@html
2059</p>
2060<hr>
2061@end html
2062@heading @anchor{m68k-crds-unox}m68k-crds-unox
2063Use @samp{configure unos} for building on Unos.
2064
2065The Unos assembler is named @code{casm} instead of @code{as}. For some
2066strange reason linking @file{/bin/as} to @file{/bin/casm} changes the
2067behavior, and does not work. So, when installing GNU CC, you should
2068install the following script as @file{as} in the subdirectory where
2069the passes of GCC are installed:
2070
2071@example
2072#!/bin/sh
2073casm $*
2074@end example
2075
2076The default Unos library is named @file{libunos.a} instead of
2077@file{libc.a}. To allow GNU CC to function, either change all
2078references to @samp{-lc} in @file{gcc.c} to @samp{-lunos} or link
2079@file{/lib/libc.a} to @file{/lib/libunos.a}.
2080
2081@cindex @code{alloca}, for Unos
2082When compiling GNU CC with the standard compiler, to overcome bugs in
2083the support of @code{alloca}, do not use @samp{-O} when making stage 2.
2084Then use the stage 2 compiler with @samp{-O} to make the stage 3
2085compiler. This compiler will have the same characteristics as the usual
2086stage 2 compiler on other systems. Use it to make a stage 4 compiler
2087and compare that with stage 3 to verify proper compilation.
2088
2089(Perhaps simply defining @code{ALLOCA} in @file{x-crds} as described in
2090the comments there will make the above paragraph superfluous. Please
2091inform us of whether this works.)
2092
2093Unos uses memory segmentation instead of demand paging, so you will need
2094a lot of memory. 5 Mb is barely enough if no other tasks are running.
2095If linking @file{cc1} fails, try putting the object files into a library
2096and linking from that library.
2097
2098@html
2099</p>
2100<hr>
2101@end html
2102@heading @anchor{m68k-hp-hpux}m68k-hp-hpux
2103HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 has a bug in
2104the assembler that prevents compilation of GNU CC. This
2105bug manifests itself during the first stage of compilation, while
2106building @file{libgcc2.a}:
2107
2108@smallexample
2109_floatdisf
2110cc1: warning: `-g' option not supported on this version of GCC
2111cc1: warning: `-g1' option not supported on this version of GCC
2112./xgcc: Internal compiler error: program as got fatal signal 11
2113@end smallexample
2114
2115A patched version of the assembler is available as the file
2116@uref{ftp://altdorf.ai.mit.edu/archive/cph/hpux-8.0-assembler}. If you
2117have HP software support, the patch can also be obtained directly from
2118HP, as described in the following note:
2119
2120@quotation
2121This is the patched assembler, to patch SR#1653-010439, where the
2122assembler aborts on floating point constants.
2123
2124The bug is not really in the assembler, but in the shared library
2125version of the function ``cvtnum(3c)''. The bug on ``cvtnum(3c)'' is
2126SR#4701-078451. Anyway, the attached assembler uses the archive
2127library version of ``cvtnum(3c)'' and thus does not exhibit the bug.
2128@end quotation
2129
2130This patch is also known as PHCO_4484.
2131
2132In addition, if you wish to use gas @samp{--with-gnu-as} you must use
2133gas version 2.1 or later, and you must use the GNU linker version 2.1 or
2134later. Earlier versions of gas relied upon a program which converted the
2135gas output into the native HP-UX format, but that program has not been
2136kept up to date. gdb does not understand that native HP-UX format, so
2137you must use gas if you wish to use gdb.
2138
2139On HP-UX version 8.05, but not on 8.07 or more recent versions, the
2140@code{fixproto} shell script triggers a bug in the system shell. If you
2141encounter this problem, upgrade your operating system or use BASH (the
2142GNU shell) to run @code{fixproto}. This bug will cause the fixproto
2143program to report an error of the form:
2144
2145@example
2146./fixproto: sh internal 1K buffer overflow
2147@end example
2148
2149To fix this, you can also change the first line of the fixproto script
2150to look like:
2151
2152@example
2153#!/bin/ksh
2154@end example
2155
2156
f42974dc
DW
2157@html
2158</p>
2159<hr>
f42974dc 2160@end html
ef88b07d 2161@heading @anchor{m68k-*-nextstep*}m68k-*-nextstep*
f42974dc 2162
b8df899a
JM
2163Current GCC versions probably do not work on version 2 of the NeXT
2164operating system.
2165
2166On NeXTStep 3.0, the Objective C compiler does not work, due,
2167apparently, to a kernel bug that it happens to trigger. This problem
2168does not happen on 3.1.
2169
f42974dc
DW
2170You absolutely @strong{must} use GNU sed and GNU make on this platform.
2171
2172
2173On NEXTSTEP 3.x where x < 3 the build of GCC will abort during
2174stage1 with an error message like this:
2175
2176@example
2177 _eh
2178 /usr/tmp/ccbbsZ0U.s:987:Unknown pseudo-op: .section
2179 /usr/tmp/ccbbsZ0U.s:987:Rest of line ignored. 1st junk character
2180 valued 95 (_).
2181@end example
2182
2183The reason for this is the fact that NeXT's assembler for these
2184versions of the operating system does not support the .section
2185pseudo op that's needed for full C++ exception functionality.
2186
2187As NeXT's assembler is a derived work from GNU as, a free
2188replacement that does can be obtained at
2189@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}.
2190
2191If you try to build the integrated C++ & C++ runtime libraries on this system
2192you will run into trouble with include files. The way to get around this is
2193to use the following sequence. Note you must have write permission to
38209993 2194the directory @var{prefix} you specified in the configuration process of GCC
f42974dc
DW
2195for this sequence to work.
2196
2197@example
2198 cd bld-gcc
2199 make all-texinfo all-bison all-byacc all-binutils all-gas all-ld
2200 cd gcc
2201 make bootstrap
2202 make install-headers-tar
2203 cd ..
2204 make bootstrap3
2205@end example
2206
b8df899a
JM
2207@html
2208</p>
2209<hr>
2210@end html
2211@heading @anchor{m68k-ncr-*}m68k-ncr-*
2212On the Tower models 4@var{n}0 and 6@var{n}0, by default a process is not
2213allowed to have more than one megabyte of memory. GCC cannot compile
2214itself (or many other programs) with @samp{-O} in that much memory.
2215
2216To solve this problem, reconfigure the kernel adding the following line
2217to the configuration file:
2218
2219@smallexample
2220MAXUMEM = 4096
2221@end smallexample
2222
2223
2224@html
2225</p>
2226<hr>
2227@end html
2228@heading @anchor{m68k-sun}m68k-sun
2229Sun 3. We do not provide a configuration file to use the Sun FPA by
2230default, because programs that establish signal handlers for floating
2231point traps inherently cannot work with the FPA.
f42974dc
DW
2232
2233@html
2234</p>
2235<hr>
f42974dc 2236@end html
ef88b07d 2237@heading @anchor{m68k-sun-sunos4.1.1}m68k-sun-sunos4.1.1
f42974dc
DW
2238
2239It is reported that you may need the GNU assembler on this platform.
2240
2241
b8df899a
JM
2242@html
2243</p>
2244<hr>
2245@end html
2246@heading @anchor{m88k-*-svr3}m88k-*-svr3
2247Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
2248These systems tend to use the Green Hills C, revision 1.8.5, as the
2249standard C compiler. There are apparently bugs in this compiler that
2250result in object files differences between stage 2 and stage 3. If this
2251happens, make the stage 4 compiler and compare it to the stage 3
2252compiler. If the stage 3 and stage 4 object files are identical, this
2253suggests you encountered a problem with the standard C compiler; the
2254stage 3 and 4 compilers may be usable.
2255
2256It is best, however, to use an older version of GNU CC for bootstrapping
2257if you have one.
2258
2259@html
2260</p>
2261<hr>
2262@end html
2263@heading @anchor{m88k-*-dgux}m88k-*-dgux
2264Motorola m88k running DG/UX. To build 88open BCS native or cross
2265compilers on DG/UX, specify the configuration name as
2266@samp{m88k-*-dguxbcs} and build in the 88open BCS software development
2267environment. To build ELF native or cross compilers on DG/UX, specify
2268@samp{m88k-*-dgux} and build in the DG/UX ELF development environment.
2269You set the software development environment by issuing
2270@samp{sde-target} command and specifying either @samp{m88kbcs} or
2271@samp{m88kdguxelf} as the operand.
2272
2273If you do not specify a configuration name, @file{configure} guesses the
2274configuration based on the current software development environment.
2275
2276@html
2277</p>
2278<hr>
2279@end html
2280@heading @anchor{m88k-tektronix-sysv3}m88k-tektronix-sysv3
2281Tektronix XD88 running UTekV 3.2e. Do not turn on
2282optimization while building stage1 if you bootstrap with
2283the buggy Green Hills compiler. Also, The bundled LAI
2284System V NFS is buggy so if you build in an NFS mounted
2285directory, start from a fresh reboot, or avoid NFS all together.
2286Otherwise you may have trouble getting clean comparisons
2287between stages.
2288
2289@html
2290</p>
2291<hr>
2292@end html
2293@heading @anchor{mips-*-*}mips-*-*
2294If you use the 1.31 version of the MIPS assembler (such as was shipped
2295with Ultrix 3.1), you will need to use the -fno-delayed-branch switch
2296when optimizing floating point code. Otherwise, the assembler will
2297complain when the GCC compiler fills a branch delay slot with a
2298floating point instruction, such as @code{add.d}.
2299
2300If on a MIPS system you get an error message saying ``does not have gp
2301sections for all it's [sic] sectons [sic]'', don't worry about it. This
2302happens whenever you use GAS with the MIPS linker, but there is not
2303really anything wrong, and it is okay to use the output file. You can
2304stop such warnings by installing the GNU linker.
2305
2306It would be nice to extend GAS to produce the gp tables, but they are
2307optional, and there should not be a warning about their absence.
2308
2309Users have reported some problems with version 2.0 of the MIPS
2310compiler tools that were shipped with Ultrix 4.1. Version 2.10
2311which came with Ultrix 4.2 seems to work fine.
2312
2313Users have also reported some problems with version 2.20 of the
2314MIPS compiler tools that were shipped with RISC/os 4.x. The earlier
2315version 2.11 seems to work fine.
2316
2317Some versions of the MIPS linker will issue an assertion failure
2318when linking code that uses @code{alloca} against shared
2319libraries on RISC-OS 5.0, and DEC's OSF/1 systems. This is a bug
2320in the linker, that is supposed to be fixed in future revisions.
2321To protect against this, GCC passes @samp{-non_shared} to the
2322linker unless you pass an explicit @samp{-shared} or
2323@samp{-call_shared} switch.
2324
2325@heading @anchor{mips-mips-bsd}mips-mips-bsd
2326MIPS machines running the MIPS operating system in BSD mode. It's
2327possible that some old versions of the system lack the functions
2328@code{memcpy}, @code{memmove}, @code{memcmp}, and @code{memset}. If your
2329system lacks these, you must remove or undo the definition of
2330@code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.
2331
2332The MIPS C compiler needs to be told to increase its table size
2333for switch statements with the @samp{-Wf,-XNg1500} option in
2334order to compile @file{cp/parse.c}. If you use the @samp{-O2}
2335optimization option, you also need to use @samp{-Olimit 3000}.
2336Both of these options are automatically generated in the
2337@file{Makefile} that the shell script @file{configure} builds.
2338If you override the @code{CC} make variable and use the MIPS
2339compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
2340
2341@html
2342</p>
2343<hr>
2344@end html
2345@heading @anchor{mips-mips-riscos*}mips-mips-riscos*
2346The MIPS C compiler needs to be told to increase its table size
2347for switch statements with the @samp{-Wf,-XNg1500} option in
2348order to compile @file{cp/parse.c}. If you use the @samp{-O2}
2349optimization option, you also need to use @samp{-Olimit 3000}.
2350Both of these options are automatically generated in the
2351@file{Makefile} that the shell script @file{configure} builds.
2352If you override the @code{CC} make variable and use the MIPS
2353compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
2354
2355MIPS computers running RISC-OS can support four different
2356personalities: default, BSD 4.3, System V.3, and System V.4
2357(older versions of RISC-OS don't support V.4). To configure GCC
2358for these platforms use the following configurations:
2359
2360@table @samp
2361@item mips-mips-riscos@code{rev}
2362Default configuration for RISC-OS, revision @code{rev}.
2363
2364@item mips-mips-riscos@code{rev}bsd
2365BSD 4.3 configuration for RISC-OS, revision @code{rev}.
2366
2367@item mips-mips-riscos@code{rev}sysv4
2368System V.4 configuration for RISC-OS, revision @code{rev}.
2369
2370@html
2371</p>
2372<hr>
2373@end html
2374@item mips-mips-riscos@code{rev}sysv
2375System V.3 configuration for RISC-OS, revision @code{rev}.
2376@end table
2377
2378The revision @code{rev} mentioned above is the revision of
2379RISC-OS to use. You must reconfigure GCC when going from a
2380RISC-OS revision 4 to RISC-OS revision 5. This has the effect of
2381avoiding a linker bug.
2382
f42974dc
DW
2383@html
2384</p>
2385<hr>
f42974dc 2386@end html
ef88b07d 2387@heading @anchor{mips*-sgi-irix[45]}mips*-sgi-irix[45]
f42974dc 2388
b8df899a
JM
2389In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
2390option must be installed from the CD-ROM supplied from Silicon Graphics.
2391This is found on the 2nd CD in release 4.0.1.
2392
2393In order to compile GCC on an SGI running IRIX 5, the "compiler_dev.hdr"
2394subsystem must be installed from the IDO CD-ROM supplied by Silicon
2395Graphics.
2396
2397@code{make compare} may fail on version 5 of IRIX unless you add
2398@samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
2399assembler input file is stored in the object file, and that makes
2400comparison fail if it differs between the @code{stage1} and
2401@code{stage2} compilations. The option @samp{-save-temps} forces a
2402fixed name to be used for the assembler input file, instead of a
2403randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
2404unless the comparisons fail without that option. If you do you
2405@samp{-save-temps}, you will have to manually delete the @samp{.i} and
2406@samp{.s} files after each series of compilations.
2407
2408The MIPS C compiler needs to be told to increase its table size
2409for switch statements with the @samp{-Wf,-XNg1500} option in
2410order to compile @file{cp/parse.c}. If you use the @samp{-O2}
2411optimization option, you also need to use @samp{-Olimit 3000}.
2412Both of these options are automatically generated in the
2413@file{Makefile} that the shell script @file{configure} builds.
2414If you override the @code{CC} make variable and use the MIPS
2415compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
2416
2417On Irix version 4.0.5F, and perhaps on some other versions as well,
2418there is an assembler bug that reorders instructions incorrectly. To
2419work around it, specify the target configuration
2420@samp{mips-sgi-irix4loser}. This configuration inhibits assembler
2421optimization.
2422
2423In a compiler configured with target @samp{mips-sgi-irix4}, you can turn
2424off assembler optimization by using the @samp{-noasmopt} option. This
2425compiler option passes the option @samp{-O0} to the assembler, to
2426inhibit reordering.
2427
2428The @samp{-noasmopt} option can be useful for testing whether a problem
2429is due to erroneous assembler reordering. Even if a problem does not go
2430away with @samp{-noasmopt}, it may still be due to assembler
2431reordering---perhaps GNU CC itself was miscompiled as a result.
2432
2433To enable debugging under Irix 5, you must use GNU as 2.5 or later,
2434and use the @samp{--with-gnu-as} configure option when configuring gcc.
2435GNU as is distributed as part of the binutils package.
2436
f42974dc
DW
2437You must use GAS on these platforms, as the native assembler can not handle
2438the code for exception handling support. Either of these messages indicates
2439that you are using the MIPS assembler when instead you should be using GAS:
2440
2441@samp{ as0: Error: ./libgcc2.c, line 1:Badly delimited numeric literal
2442 .4byte $LECIE1-$LSCIE1
2443 as0: Error: ./libgcc2.c, line 1:malformed statement}
2444
2445or:
2446
2447@samp{ as0: Error: /src/bld-gcc/gcc/libgcc2.c, line 1:undefined symbol in expression
2448 .word $LECIE1-$LSCIE1}
2449
2450These systems don't have ranlib, which various components in GCC need; you
2451should be able to avoid this problem by installing GNU binutils, which includes
2452a functional ranlib for this system.
2453
2454You may get the following warning on irix4 platforms, it can be safely
2455ignored.
2456@example
2457 warning: foo.o does not have gp tables for all its sections.
2458@end example
2459
2460When building GCC, the build process loops rebuilding cc1 over and
2461over again. This happens on mips-sgi-irix5.2, and possibly other platforms.@*
2462It has been reported that this is a known bug in the make shipped with
2463IRIX 5.2. We recommend you use GNU make instead of the vendor supplied
2464make program; however, you may have success with "smake" on IRIX 5.2 if
2465you do not have GNU make available.
2466
3aa8219e
GP
2467See @uref{http://freeware.sgi.com/,,http://freeware.sgi.com/} for more
2468information about using GCC on IRIX platforms.
f42974dc
DW
2469
2470
2471@html
2472</p>
2473<hr>
f42974dc 2474@end html
ef88b07d 2475@heading @anchor{mips*-sgi-irix6}mips*-sgi-irix6
f42974dc
DW
2476
2477You must @emph{not} use GAS on irix6 platforms; doing so will only
2478cause problems.
2479
2480These systems don't have ranlib, which various components in GCC need; you
2481should be able to avoid this problem by making a dummy script called ranlib
2482which just exits with zero status and placing it in your path.
2483
2484If you are using Irix cc as your bootstrap compiler, you must
2485ensure that the N32 ABI is in use. To test this, compile a simple C
2486file with @command{cc} and then run @command{file} on the
2487resulting object file. The output should look like:
2488
2489@example
2490@code{ test.o: ELF N32 MSB ...}
2491@end example
2492
2493If you see:
2494@example
2495@code{ test.o: ELF 32-bit MSB}
2496@end example
2497
2498then your version of @command{cc} uses the O32 ABI default. You
38209993 2499should set the environment variable @env{CC} to @samp{cc -n32}
f42974dc
DW
2500before configuring GCC.
2501
2502GCC does not currently support generating O32 ABI binaries in the
2503mips-sgi-irix6 configurations. It used to be possible to create a GCC
2504with O32 ABI only support by configuring it for the mips-sgi-irix5
2505target. See the link below for details.
2506
2507GCC does not correctly pass/return structures which are
2508smaller than 16 bytes and which are not 8 bytes. The problem is very
2509involved and difficult to fix. It affects a number of other targets also,
2510but IRIX 6 is affected the most, because it is a 64 bit target, and 4 byte
2511structures are common. The exact problem is that structures are being padded
2512at the wrong end, e.g. a 4 byte structure is loaded into the lower 4 bytes
2513of the register when it should be loaded into the upper 4 bytes of the
2514register.
2515
2516GCC is consistent with itself, but not consistent with the SGI C compiler
2517(and the SGI supplied runtime libraries), so the only failures that can
2518happen are when there are library functions that take/return such
2519structures. There are very few such library functions. I can only recall
2520seeing two of them: inet_ntoa, and semctl.
2521
3aa8219e
GP
2522See @uref{http://freeware.sgi.com/,,http://freeware.sgi.com/} for more
2523information about using GCC on IRIX platforms.
f42974dc
DW
2524
2525
b8df899a
JM
2526@html
2527</p>
2528<hr>
2529@end html
2530@heading @anchor{mips-sony-sysv}mips-sony-sysv
2531Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2 (which
2532uses ELF instead of COFF). Support for 5.0.2 will probably be provided
2533soon by volunteers. In particular, the linker does not like the
2534code generated by GCC when shared libraries are linked in.
2535
2536
2537@html
2538</p>
2539<hr>
2540@end html
2541@heading @anchor{ns32k-encore}ns32k-encore
2542Encore ns32000 system. Encore systems are supported only under BSD.
2543
2544@html
2545</p>
2546<hr>
2547@end html
2548@heading @anchor{ns32k-*-genix}ns32k-*-genix
2549National Semiconductor ns32000 system. Genix has bugs in @code{alloca}
2550and @code{malloc}; you must get the compiled versions of these from GNU
2551Emacs.
2552
2553@html
2554</p>
2555<hr>
2556@end html
2557@heading @anchor{ns32k-sequent}ns32k-sequent
2558Go to the Berkeley universe before compiling.
2559
2560@html
2561</p>
2562<hr>
2563@end html
2564@heading @anchor{ns32k-utek}ns32k-utek
2565UTEK ns32000 system (``merlin''). The C compiler that comes with this
2566system cannot compile GNU CC; contact @samp{tektronix!reed!mason} to get
2567binaries of GNU CC for bootstrapping.
2568
2569
b8df899a
JM
2570@html
2571</p>
2572<hr>
2573@end html
2574@heading @anchor{powerpc-*-elf}powerpc-*-elf, powerpc-*-sysv4
2575PowerPC system in big endian mode, running System V.4.
2576
2577You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2578switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2579
f42974dc
DW
2580@html
2581</p>
2582<hr>
f42974dc 2583@end html
ef88b07d 2584@heading @anchor{powerpc-*-linux-gnu*}powerpc-*-linux-gnu*
f42974dc
DW
2585
2586You will need
2587@uref{ftp://ftp.varesearch.com/pub/support/hjl/binutils,,binutils-2.9.4.0.8}
2588or newer for a working GCC. It is strongly recommended to recompile binutils
2589if you initially built it with gcc-2.7.2.x.
2590
b8df899a
JM
2591You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2592switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2593
2594@html
2595</p>
2596<hr>
2597@end html
2598@heading @anchor{powerpc-*-eabiaix}powerpc-*-eabiaix
2599Embedded PowerPC system in big endian mode with -mcall-aix selected as
2600the default.
2601
2602You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2603switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2604
2605@html
2606</p>
2607<hr>
2608@end html
2609@heading @anchor{powerpc-*-eabisim}powerpc-*-eabisim
2610Embedded PowerPC system in big endian mode for use in running under the
2611PSIM simulator.
2612
2613You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2614switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2615
2616@html
2617</p>
2618<hr>
2619@end html
2620@heading @anchor{powerpc-*-eabi}powerpc-*-eabi
2621Embedded PowerPC system in big endian mode.
2622
2623You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2624switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2625
2626@html
2627</p>
2628<hr>
2629@end html
2630@heading @anchor{powerpcle-*-elf}powerpcle-*-elf, powerpcle-*-sysv4
2631PowerPC system in little endian mode, running System V.4.
2632
2633You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2634switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2635
2636@html
2637</p>
2638<hr>
2639@end html
2640@heading @anchor{powerpcle-*-eabisim}powerpcle-*-eabisim
2641Embedded PowerPC system in little endian mode for use in running under
2642the PSIM simulator.
2643
2644@html
2645</p>
2646<hr>
2647@end html
2648@heading @anchor{powerpcle-*-eabi}powerpcle-*-eabi
2649Embedded PowerPC system in little endian mode.
2650
2651You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2652switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2653
2654@html
2655</p>
2656<hr>
2657@end html
2658@heading @anchor{powerpcle-*-winnt}powerpcle-*-winnt, powerpcle-*-pe
2659PowerPC system in little endian mode running Windows NT.
2660
2661You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
2662switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
2663
2664@html
2665</p>
2666<hr>
2667@end html
2668@heading @anchor{romp-*-aos}romp-*-aos, romp-*-mach
2669The only operating systems supported for the IBM RT PC are AOS and
2670MACH. GNU CC does not support AIX running on the RT. We recommend you
2671compile GNU CC with an earlier version of itself; if you compile GNU CC
2672with @code{hc}, the Metaware compiler, it will work, but you will get
2673mismatches between the stage 2 and stage 3 compilers in various files.
2674These errors are minor differences in some floating-point constants and
2675can be safely ignored; the stage 3 compiler is correct.
f42974dc
DW
2676
2677@html
2678</p>
2679<hr>
f42974dc 2680@end html
ef88b07d 2681@heading @anchor{*-*-solaris*}*-*-solaris*
f42974dc
DW
2682
2683Starting with Solaris, Sun does not ship a C compiler any more. To
2684bootstrap and install GCC you first have to install a pre-built
2685compiler, see our @uref{binaries.html,,binaries page} for
2686details.
2687
e6855a2d
MM
2688You must use GNU Make to build GCC on Solaris 2. If you don't have GNU
2689Make installed, you can use the prebuilt compiler mentioned above to
2690build it.
2691
f42974dc
DW
2692Sun as 4.X is broken in that it cannot cope with long symbol names.
2693A typical error message might look similar to the following:
2694
2695@samp{/usr/ccs/bin/as: "/var/tmp/ccMsw135.s", line 11041:
2696error: can't compute value of an expression involving an external symbol.}
2697
e6855a2d
MM
2698This is Sun bug 4237974. This is fixed with patch 108908-02 and has
2699been fixed in later (5.x) versions of the assembler.
b8df899a
JM
2700
2701@html
2702<p>
2703<hr>
2704@end html
2705@heading @anchor{sparc-sun-*}sparc-sun-*
2706Sometimes on a Sun 4 you may observe a crash in the program
2707@code{genflags} or @code{genoutput} while building GCC. This is said to
2708be due to a bug in @code{sh}. You can probably get around it by running
2709@code{genflags} or @code{genoutput} manually and then retrying the
2710@code{make}.
2711
f42974dc
DW
2712@html
2713<p>
2714<hr>
f42974dc 2715@end html
ef88b07d 2716@heading @anchor{sparc-sun-solaris*}sparc-sun-solaris*
b8df899a
JM
2717On Solaris 2, executables of GCC version 2.0.2 are commonly
2718available, but they have a bug that shows up when compiling current
2719versions of GCC: undefined symbol errors occur during assembly if you
2720use @samp{-g}.
2721
2722The solution is to compile the current version of GCC without
2723@samp{-g}. That makes a working compiler which you can use to recompile
2724with @samp{-g}.
2725
2726Solaris 2 comes with a number of optional OS packages. Some of these
2727packages are needed to use GCC fully. If you did not install all
2728optional packages when installing Solaris, you will need to verify that
2729the packages that GCC needs are installed.
2730
2731To check whether an optional package is installed, use
2732the @code{pkginfo} command. To add an optional package, use the
2733@code{pkgadd} command. For further details, see the Solaris
2734documentation.
2735
2736For Solaris 2.0 and 2.1, GCC needs six packages: @samp{SUNWarc},
2737@samp{SUNWbtool}, @samp{SUNWesu}, @samp{SUNWhea}, @samp{SUNWlibm}, and
2738@samp{SUNWtoo}.
2739
2740For Solaris 2.2, GCC needs an additional seventh package: @samp{SUNWsprot}.
2741
2742On Solaris 2, trying to use the linker and other tools in
2743@file{/usr/ucb} to install GCC has been observed to cause trouble.
2744For example, the linker may hang indefinitely. The fix is to remove
2745@file{/usr/ucb} from your @code{PATH}.
f42974dc
DW
2746
2747binutils 2.9.1 has known bugs on this platform. We recommend to use
2748binutils 2.10 or the vendor tools (Sun as, Sun ld).
2749
2750Unfortunately, C++ shared libraries, including libstdc++, won't work
2751properly if assembled with Sun as: the linker will complain about
2752relocations in read-only sections, in the definition of virtual
2753tables. Also, Sun as fails to process long symbols resulting from
2754mangling template-heavy C++ function names.
2755
2756
2757@html
2758</p>
2759<hr>
f42974dc 2760@end html
ef88b07d 2761@heading @anchor{sparc-sun-solaris2.7}sparc-sun-solaris2.7
f42974dc
DW
2762
2763Sun patch 107058-01 (1999-01-13) for SPARC Solaris 7 triggers a bug in
2764the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8
2765and later, including all EGCS releases. Sun formerly recommended
2766107058-01 for all Solaris 7 users, but around 1999-09-01 it started to
2767recommend it only for people who use Sun's compilers.
2768
2769Here are some workarounds to this problem:
2770@itemize @bullet
2771@item
2772Do not install Sun patch 107058-01 until after Sun releases a
2773complete patch for bug 4210064. This is the simplest course to take,
2774unless you must also use Sun's C compiler. Unfortunately 107058-01
2775is preinstalled on some new Solaris-based hosts, so you may have to
2776back it out.
2777
2778@item
2779Copy the original, unpatched Solaris 7
2780@command{/usr/ccs/bin/as} into
2781@command{/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.1/as},
2782adjusting the latter name to fit your local conventions and software
2783version numbers.
2784
2785@item
2786Install Sun patch 106950-03 (1999-05-25) or later. Nobody with
2787both 107058-01 and 106950-03 installed has reported the bug with GCC
2788and Sun's dynamic linker. This last course of action is riskiest,
2789for two reasons. First, you must install 106950 on all hosts that
2790run code generated by GCC; it doesn't suffice to install it only on
2791the hosts that run GCC itself. Second, Sun says that 106950-03 is
2792only a partial fix for bug 4210064, but Sun doesn't know whether the
2793partial fix is adequate for GCC. Revision -08 or later should fix
2794the bug, but (as of 1999-10-06) it is still being tested.
2795@end itemize
2796
2797
2798@html
2799<p>
2800<hr>
f42974dc
DW
2801<!-- ripped from the same FAQ that I answered -->
2802@end html
ef88b07d 2803@heading @anchor{*-sun-solaris2.8}*-sun-solaris2.8
f42974dc
DW
2804
2805Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
2806newer: g++ will complain that types are missing. These headers assume
2807that omitting the type means 'int'; this assumption worked for C89 but
2808is wrong for C++, and is now wrong for C99 also.
2809
2810g++ accepts such (illegal) constructs with the option @option{-fpermissive}; it
2811will assume that any missing type is 'int' (as defined by C89).
2812
9a3db543 2813For Solaris 8, this is fixed by revision 24 or later of patch 108652
f42974dc
DW
2814(for SPARCs) or 108653 (for Intels).
2815
2816
2817@html
2818<p>
2819<hr>
f42974dc 2820@end html
ef88b07d 2821@heading @anchor{sunv5}Sun V5.0 Compiler Bugs
f42974dc
DW
2822
2823The Sun V5.0 compilers are known to mis-compile GCC 2.95 and GCC 2.95.1,
2824which in turn causes GCC to fail its bootstrap comparison test.
2825GCC 2.95.2 has a workaround.
2826
2827
2828@html
2829</p>
2830<hr>
f42974dc 2831@end html
ef88b07d 2832@heading @anchor{sparc-sun-sunos*}sparc-sun-sunos*
f42974dc
DW
2833
2834A bug in the SunOS4 linker will cause it to crash when linking
2835-fPIC compiled objects (and will therefore not allow you to build
2836shared libraries).
2837
2838To fix this problem you can either use the most recent version of
2839binutils or get the latest SunOS4 linker patch (patch ID 100170-10)
2840from Sun's patch site.
2841
2842
2843@html
2844</p>
2845<hr>
f42974dc 2846@end html
ef88b07d 2847@heading @anchor{sparc-unknown-linux-gnulibc1}sparc-unknown-linux-gnulibc1
f42974dc
DW
2848
2849It has been reported that you might need
2850@uref{ftp://ftp.yggdrasil.com/private/hjl,,binutils-2.8.1.0.23}
2851for this platform, too.
2852
2853
2854@html
2855</p>
2856<hr>
f42974dc 2857@end html
ef88b07d 2858@heading @anchor{sparc64-*-*}sparc64-*-*
f42974dc
DW
2859
2860GCC version 2.95 is not able to compile code correctly for
2861@code{sparc64} targets. Users of the Linux kernel, at least,
286212~can use the @code{sparc32} program to start up a new shell
2863invocation with an environment that causes @command{configure} to
38209993 2864recognize (via @samp{uname -a}) the system as @var{sparc-*-*} instead.
f42974dc
DW
2865
2866
b8df899a
JM
2867@html
2868</p>
2869<hr>
2870@end html
2871@heading @anchor{#*-*-sysv*}*-*-sysv*
2872On System V release 3, you may get this error message
2873while linking:
2874
2875@smallexample
2876ld fatal: failed to write symbol name @var{something}
2877 in strings table for file @var{whatever}
2878@end smallexample
2879
2880This probably indicates that the disk is full or your ULIMIT won't allow
2881the file to be as large as it needs to be.
2882
2883This problem can also result because the kernel parameter @code{MAXUMEM}
2884is too small. If so, you must regenerate the kernel and make the value
2885much larger. The default value is reported to be 1024; a value of 32768
2886is said to work. Smaller values may also work.
2887
2888On System V, if you get an error like this,
2889
2890@example
2891/usr/local/lib/bison.simple: In function `yyparse':
2892/usr/local/lib/bison.simple:625: virtual memory exhausted
2893@end example
2894
2895@noindent
2896that too indicates a problem with disk space, ULIMIT, or @code{MAXUMEM}.
2897
2898
2899@html
2900</p>
2901<hr>
2902@end html
2903@heading @anchor{vax-dec-ultrix}vax-dec-ultrix
2904Don't try compiling with Vax C (@code{vcc}). It produces incorrect code
2905in some cases (for example, when @code{alloca} is used).
2906
2907Meanwhile, compiling @file{cp/parse.c} with pcc does not work because of
2908an internal table size limitation in that compiler. To avoid this
2909problem, compile just the GNU C compiler first, and use it to recompile
2910building all the languages that you want to run.
2911
2912@html
2913</p>
2914<hr>
2915@end html
2916@heading @anchor{we32k-*-*}we32k-*-*
2917These computers are also known as the 3b2, 3b5, 3b20 and other similar
2918names. (However, the 3b1 is actually a 68000.)
2919
2920Don't use @samp{-g} when compiling with the system's compiler. The
2921system's linker seems to be unable to handle such a large program with
2922debugging information.
2923
2924The system's compiler runs out of capacity when compiling @file{stmt.c}
2925in GNU CC. You can work around this by building @file{cpp} in GNU CC
2926first, then use that instead of the system's preprocessor with the
2927system's C compiler to compile @file{stmt.c}. Here is how:
2928
2929@smallexample
2930mv /lib/cpp /lib/cpp.att
2931cp cpp /lib/cpp.gnu
2932echo '/lib/cpp.gnu -traditional $@{1+"$@@"@}' > /lib/cpp
2933chmod +x /lib/cpp
2934@end smallexample
2935
2936The system's compiler produces bad code for some of the GNU CC
2937optimization files. So you must build the stage 2 compiler without
2938optimization. Then build a stage 3 compiler with optimization.
2939That executable should work. Here are the necessary commands:
2940
2941@smallexample
2942make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
2943make stage2
2944make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
2945@end smallexample
2946
2947You may need to raise the ULIMIT setting to build a C++ compiler,
2948as the file @file{cc1plus} is larger than one megabyte.
2949
f42974dc
DW
2950@html
2951</p>
2952<hr>
f42974dc 2953@end html
ef88b07d 2954@heading @anchor{windows}Microsoft Windows (32 bit)
f42974dc
DW
2955
2956A port of GCC 2.95.x is included with the
2957@uref{http://www.cygwin.com/,,Cygwin environment}.
2958
2959Current (as of early 2001) snapshots of GCC will build under Cygwin
2960without modification.
2961
2962@html
2963</p>
2964<hr>
f42974dc 2965@end html
ef88b07d 2966@heading @anchor{os2}OS/2
f42974dc
DW
2967
2968GCC does not currently support OS/2. However, Andrew Zabolotny has been
2969working on a generic OS/2 port with pgcc. The current code code can be found
2970at @uref{http://www.goof.com/pcg/os2/,,http://www.goof.com/pcg/os2/}.
2971
2972An older copy of GCC 2.8.1 is included with the EMX tools available at
2973@uref{ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/,,
2974ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/}.
2975
2976@html
2977</p>
2978<hr>
f42974dc 2979@end html
ef88b07d 2980@heading @anchor{older}Older systems
f42974dc
DW
2981
2982GCC contains support files for many older (1980s and early
29831990s) Unix variants. For the most part, support for these systems
2984has not been deliberately removed, but it has not been maintained for
2985several years and may suffer from bitrot. Support from some systems
2986has been removed from GCC 3: fx80, ns32-ns-genix, pyramid, tahoe,
2987gmicro, spur; most of these targets had not been updated since GCC
2988version 1.
2989
2990Support for older systems as targets for cross-compilation is less
2991problematic than support for them as hosts for GCC; if an enthusiast
2992wishes to make such a target work again (including resurrecting any
2993of the targets that never worked with GCC 2, starting from the last
2994CVS version before they were removed), patches
2995@uref{../contribute.html,,following the usual requirements}
2996would be likely to be accepted, since they should not affect the
2997support for more modern targets.
2998
2999Support for old systems as hosts for GCC can cause problems if the
3000workarounds for compiler, library and operating system bugs affect the
3001cleanliness or maintainability of the rest of GCC. In some cases, to
3002bring GCC up on such a system, if still possible with current GCC, may
3003require first installing an old version of GCC which did work on that
3004system, and using it to compile a more recent GCC, to avoid bugs in
3005the vendor compiler. Old releases of GCC 1 and GCC 2 are available in
3006the old-releases directory on the
3007@uref{../mirrors.html,,GCC mirror sites}. Header bugs may generally
38209993
LG
3008be avoided using @command{fixincludes}, but bugs or deficiencies in
3009libraries and the operating system may still cause problems.
f42974dc
DW
3010
3011For some systems, old versions of GNU binutils may also be useful,
3012and are available from pub/binutils/old-releases on
3013@uref{http://sources.redhat.com/mirrors.html,,sources.redhat.com mirror sites}.
3014
3015Some of the information on specific systems above relates to
3016such older systems, but much of the information
3017about GCC on such systems (which may no longer be applicable to
3018current GCC) is to be found in the GCC texinfo manual.
3019
3020@html
3021</p>
3022<hr>
f42974dc 3023@end html
ef88b07d 3024@heading @anchor{elf_targets}all ELF targets (SVR4, Solaris, etc.)
f42974dc 3025
38209993
LG
3026C++ support is significantly better on ELF targets if you use the
3027@uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of
3028inlines, vtables and template instantiations will be discarded
3029automatically.
f42974dc
DW
3030
3031
3032@html
3033</p>
3034<hr>
3035<p>
3036@end html
3037@ifhtml
3038@uref{./index.html,,Return to the GCC Installation page}
3039@end ifhtml
3040@end ifset
3041
3042@c ***************************************************************************
3043@c Part 6 The End of the Document
3044@ifinfo
3045@comment node-name, next, previous, up
3046@node Concept Index, , Specific, Top
3047@end ifinfo
3048
3049@ifinfo
3050@unnumbered Concept Index
3051
3052@printindex cp
3053
3054@contents
3055@end ifinfo
3056@bye