1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @c The text of this file appears in the file INSTALL
6 @c in the GCC distribution, as well as in the GCC manual.
8 Note most of this information is out of date and superseded by the
9 online GCC install procedures @uref{http://gcc.gnu.org/install/}. It is
10 provided for historical reference only.
14 @chapter Installing GNU CC
16 @cindex installing GNU CC
19 * Configuration Files:: Files created by running @code{configure}.
20 * Configurations:: Configurations Supported by GNU CC.
21 * Other Dir:: Compiling in a separate directory (not where the source is).
22 * Cross-Compiler:: Building and installing a cross-compiler.
23 * VMS Install:: See below for installation on VMS.
24 * Collect2:: How @code{collect2} works; how it finds @code{ld}.
25 * Header Dirs:: Understanding the standard header file directories.
28 Here is the procedure for installing GNU CC on a GNU or Unix system.
29 See @ref{VMS Install}, for VMS systems. In this section we assume you
30 compile in the same directory that contains the source files; see
31 @ref{Other Dir}, to find out how to compile in a separate directory on
34 You cannot install GNU C by itself on MSDOS; it will not compile under
35 any MSDOS compiler except itself. You need to get the complete
36 compilation package DJGPP, which includes binaries as well as sources,
37 and includes all the necessary compilation tools and libraries.
41 If you have built GNU CC previously in the same directory for a
42 different target machine, do @samp{make distclean} to delete all files
43 that might be invalid. One of the files this deletes is
44 @file{Makefile}; if @samp{make distclean} complains that @file{Makefile}
45 does not exist, it probably means that the directory is already suitably
49 On a System V release 4 system, make sure @file{/usr/bin} precedes
50 @file{/usr/ucb} in @code{PATH}. The @code{cc} command in
51 @file{/usr/ucb} uses libraries which have bugs.
53 @cindex Bison parser generator
54 @cindex parser generator, Bison
56 Make sure the Bison parser generator is installed. (This is unnecessary
57 if the Bison output file @file{c-parse.c} is more recent than
58 @file{c-parse.y},and you do not plan to change the @samp{.y} file.)
60 Bison versions older than Sept 8, 1988 will produce incorrect output
64 If you have chosen a configuration for GNU CC which requires other GNU
65 tools (such as GAS or the GNU linker) instead of the standard system
66 tools, install the required tools in the build directory under the names
67 @file{as}, @file{ld} or whatever is appropriate. This will enable the
68 compiler to find the proper tools for compilation of the program
71 Alternatively, you can do subsequent compilation using a value of the
72 @code{PATH} environment variable such that the necessary GNU tools come
73 before the standard system tools.
76 Specify the host, build and target machine configurations. You do this
77 when you run the @file{configure} script.
79 The @dfn{build} machine is the system which you are using, the
80 @dfn{host} machine is the system where you want to run the resulting
81 compiler (normally the build machine), and the @dfn{target} machine is
82 the system for which you want the compiler to generate code.
84 If you are building a compiler to produce code for the machine it runs
85 on (a native compiler), you normally do not need to specify any operands
86 to @file{configure}; it will try to guess the type of machine you are on
87 and use that as the build, host and target machines. So you don't need
88 to specify a configuration when building a native compiler unless
89 @file{configure} cannot figure out what your configuration is or guesses
92 In those cases, specify the build machine's @dfn{configuration name}
93 with the @samp{--host} option; the host and target will default to be
94 the same as the host machine. (If you are building a cross-compiler,
95 see @ref{Cross-Compiler}.)
100 ./configure --host=sparc-sun-sunos4.1
103 A configuration name may be canonical or it may be more or less
106 A canonical configuration name has three parts, separated by dashes.
107 It looks like this: @samp{@var{cpu}-@var{company}-@var{system}}.
108 (The three parts may themselves contain dashes; @file{configure}
109 can figure out which dashes serve which purpose.) For example,
110 @samp{m68k-sun-sunos4.1} specifies a Sun 3.
112 You can also replace parts of the configuration by nicknames or aliases.
113 For example, @samp{sun3} stands for @samp{m68k-sun}, so
114 @samp{sun3-sunos4.1} is another way to specify a Sun 3.
116 You can specify a version number after any of the system types, and some
117 of the CPU types. In most cases, the version is irrelevant, and will be
118 ignored. So you might as well specify the version if you know it.
120 See @ref{Configurations}, for a list of supported configuration names and
121 notes on many of the configurations. You should check the notes in that
122 section before proceeding any further with the installation of GNU CC.
125 When running @code{configure}, you may also need to specify certain
126 additional options that describe variant hardware and software
127 configurations. These are @samp{--with-gnu-as}, @samp{--with-gnu-ld},
128 @samp{--with-stabs} and @samp{--nfp}.
132 If you will use GNU CC with the GNU assembler (GAS), you should declare
133 this by using the @samp{--with-gnu-as} option when you run
136 Using this option does not install GAS. It only modifies the output of
137 GNU CC to work with GAS. Building and installing GAS is up to you.
139 Conversely, if you @emph{do not} wish to use GAS and do not specify
140 @samp{--with-gnu-as} when building GNU CC, it is up to you to make sure
141 that GAS is not installed. GNU CC searches for a program named
142 @code{as} in various directories; if the program it finds is GAS, then
143 it runs GAS. If you are not sure where GNU CC finds the assembler it is
144 using, try specifying @samp{-v} when you run it.
146 The systems where it makes a difference whether you use GAS are@*
147 @samp{hppa1.0-@var{any}-@var{any}}, @samp{hppa1.1-@var{any}-@var{any}},
148 @samp{i386-@var{any}-sysv}, @samp{i386-@var{any}-isc},@*
149 @samp{i860-@var{any}-bsd}, @samp{m68k-bull-sysv},@*
150 @samp{m68k-hp-hpux}, @samp{m68k-sony-bsd},@*
151 @samp{m68k-altos-sysv}, @samp{m68000-hp-hpux},@*
152 @samp{m68000-att-sysv}, @samp{@var{any}-lynx-lynxos},
153 and @samp{mips-@var{any}}).
154 On any other system, @samp{--with-gnu-as} has no effect.
156 On the systems listed above (except for the HP-PA, for ISC on the
157 386, and for @samp{mips-sgi-irix5.*}), if you use GAS, you should also
158 use the GNU linker (and specify @samp{--with-gnu-ld}).
161 Specify the option @samp{--with-gnu-ld} if you plan to use the GNU
164 This option does not cause the GNU linker to be installed; it just
165 modifies the behavior of GNU CC to work with the GNU linker.
166 @c Specifically, it inhibits the installation of @code{collect2}, a program
167 @c which otherwise serves as a front-end for the system's linker on most
171 On MIPS based systems and on Alphas, you must specify whether you want
172 GNU CC to create the normal ECOFF debugging format, or to use BSD-style
173 stabs passed through the ECOFF symbol table. The normal ECOFF debug
174 format cannot fully handle languages other than C. BSD stabs format can
175 handle other languages, but it only works with the GNU debugger GDB.
177 Normally, GNU CC uses the ECOFF debugging format by default; if you
178 prefer BSD stabs, specify @samp{--with-stabs} when you configure GNU
181 No matter which default you choose when you configure GNU CC, the user
182 can use the @samp{-gcoff} and @samp{-gstabs+} options to specify explicitly
183 the debug format for a particular compilation.
185 @samp{--with-stabs} is meaningful on the ISC system on the 386, also, if
186 @samp{--with-gas} is used. It selects use of stabs debugging
187 information embedded in COFF output. This kind of debugging information
188 supports C++ well; ordinary COFF debugging information does not.
190 @samp{--with-stabs} is also meaningful on 386 systems running SVR4. It
191 selects use of stabs debugging information embedded in ELF output. The
192 C++ compiler currently (2.6.0) does not support the DWARF debugging
193 information normally used on 386 SVR4 platforms; stabs provide a
194 workable alternative. This requires gas and gdb, as the normal SVR4
195 tools can not generate or interpret stabs.
198 On certain systems, you must specify whether the machine has a floating
199 point unit. These systems include @samp{m68k-sun-sunos@var{n}} and
200 @samp{m68k-isi-bsd}. On any other system, @samp{--nfp} currently has no
201 effect, though perhaps there are other systems where it could usefully
204 @cindex Haifa scheduler
205 @cindex scheduler, experimental
207 @itemx --disable-haifa
208 Use @samp{--enable-haifa} to enable use of an experimental instruction
209 scheduler (from IBM Haifa). This may or may not produce better code.
210 Some targets on which it is known to be a win enable it by default; use
211 @samp{--disable-haifa} to disable it in these cases. @code{configure}
212 will print out whether the Haifa scheduler is enabled when it is run.
214 @cindex Objective C threads
215 @cindex threads, Objective C
216 @item --enable-threads=@var{type}
217 Certain systems, notably Linux-based GNU systems, can't be relied on to
218 supply a threads facility for the Objective C runtime and so will
219 default to single-threaded runtime. They may, however, have a library
220 threads implementation available, in which case threads can be enabled
221 with this option by supplying a suitable @var{type}, probably
222 @samp{posix}. The possibilities for @var{type} are @samp{single},
223 @samp{posix}, @samp{win32}, @samp{solaris}, @samp{irix} and @samp{mach}.
225 @cindex Internal Compiler Checking
226 @item --enable-checking
227 When you specify this option, the compiler is built to perform checking
228 of tree node types when referencing fields of that node. This does not
229 change the generated code, but adds error checking within the compiler.
230 This will slow down the compiler and may only work properly if you
231 are building the compiler with GNU C.
233 @cindex Native Language Support
237 The @samp{--enable-nls} option enables Native Language Support (NLS),
238 which lets GCC output diagnostics in languages other than American
239 English. Native Language Support is enabled by default if not doing a
240 canadian cross build. The @samp{--disable-nls} option disables NLS.
242 @cindex @code{gettext}
243 @item --with-included-gettext
244 If NLS is enbled, the @samp{--with-included-gettext} option causes the build
245 procedure to prefer its copy of GNU @code{gettext}. This is the default. If
246 you want the GCC build procedure to prefer the host's @code{gettext}
247 libraries, use @samp{--without-included-gettext}.
249 @cindex @code{catgets}
251 If NLS is enabled, and if the host lacks @code{gettext} but has the
252 inferior @code{catgets} interface, the GCC build procedure normally
253 ignores @code{catgets} and instead uses GCC's copy of the GNU
254 @code{gettext} library. The @samp{--with-catgets} option causes the
255 build procedure to use the host's @code{catgets} in this situation.
257 @cindex @code{maintainer-mode}
258 @item --enable-maintainer-mode
259 The build rules that regenerate the GCC master message catalog
260 @code{gcc.pot} are normally disabled. This is because it can only be rebuilt
261 if the complete source tree is present. If you have changed the sources and
262 want to rebuild the catalog, configuring with
263 @samp{--enable-maintainer-mode} will enable this. Note that you need a
264 special version of the @code{gettext} tools to do so.
266 @cindex Windows32 Registry support
267 @item --enable-win32-registry
268 @itemx --enable-win32-registry=@var{KEY}
269 @itemx --disable-win32-registry
270 The @samp{--enable-win32-registry} option enables Windows-hosted GCC
271 to look up installations paths in the registry using the following key:
274 @code{HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\<KEY>}
277 <KEY> defaults to GCC version number, and can be overridden by the
278 @code{--enable-win32-registry=KEY} option. Vendors and distributors
279 who use custom installers are encouraged to provide a different key,
280 perhaps one comprised of vendor name and GCC version number, to
281 avoid conflict with existing installations. This feature is enabled
282 by default, and can be disabled by @code{--disable-win32-registry}
283 option. This option has no effect on the other hosts.
287 In certain cases, you should specify certain other options when you run
292 The standard directory for installing GNU CC is @file{/usr/local/lib}.
293 If you want to install its files somewhere else, specify
294 @samp{--prefix=@var{dir}} when you run @file{configure}. Here @var{dir}
295 is a directory name to use instead of @file{/usr/local} for all purposes
296 with one exception: the directory @file{/usr/local/include} is searched
297 for header files no matter where you install the compiler. To override
298 this name, use the @code{--with-local-prefix} option below. The directory
299 you specify need not exist, but its parent directory must exist.
302 Specify @samp{--with-local-prefix=@var{dir}} if you want the compiler to
303 search directory @file{@var{dir}/include} for locally installed header
304 files @emph{instead} of @file{/usr/local/include}.
306 You should specify @samp{--with-local-prefix} @strong{only} if your site has
307 a different convention (not @file{/usr/local}) for where to put
310 The default value for @samp{--with-local-prefix} is @file{/usr/local}
311 regardless of the value of @samp{--prefix}. Specifying @samp{--prefix}
312 has no effect on which directory GNU CC searches for local header files.
313 This may seem counterintuitive, but actually it is logical.
315 The purpose of @samp{--prefix} is to specify where to @emph{install GNU
316 CC}. The local header files in @file{/usr/local/include}---if you put
317 any in that directory---are not part of GNU CC. They are part of other
318 programs---perhaps many others. (GNU CC installs its own header files
319 in another directory which is based on the @samp{--prefix} value.)
321 @strong{Do not} specify @file{/usr} as the @samp{--with-local-prefix}! The
322 directory you use for @samp{--with-local-prefix} @strong{must not} contain
323 any of the system's standard header files. If it did contain them,
324 certain programs would be miscompiled (including GNU Emacs, on certain
325 targets), because this would override and nullify the header file
326 corrections made by the @code{fixincludes} script.
328 Indications are that people who use this option use it based on
329 mistaken ideas of what it is for. People use it as if it specified
330 where to install part of GNU CC. Perhaps they make this assumption
331 because installing GNU CC creates the directory.
335 Build the compiler. Just type @samp{make LANGUAGES=c} in the compiler
338 @samp{LANGUAGES=c} specifies that only the C compiler should be
339 compiled. The makefile normally builds compilers for all the supported
340 languages; currently, C, C++, Objective C, Java, FORTRAN, and CHILL.
341 However, C is the only language that is sure to work when you build with
342 other non-GNU C compilers. In addition, building anything but C at this
343 stage is a waste of time.
345 In general, you can specify the languages to build by typing the
346 argument @samp{LANGUAGES="@var{list}"}, where @var{list} is one or more
347 words from the list @samp{c}, @samp{c++}, @samp{objective-c},
348 @samp{java}, @samp{f77}, and @samp{CHILL}. If you have any additional
349 GNU compilers as subdirectories of the GNU CC source directory, you may
350 also specify their names in this list.
352 Ignore any warnings you may see about ``statement not reached'' in
353 @file{insn-emit.c}; they are normal. Also, warnings about ``unknown
354 escape sequence'' are normal in @file{genopinit.c} and perhaps some
355 other files. Likewise, you should ignore warnings about ``constant is
356 so large that it is unsigned'' in @file{insn-emit.c} and
357 @file{insn-recog.c}, and a warning about a comparison always being zero
358 in @file{enquire.o}. Any other compilation errors may represent bugs in
359 the port to your machine or operating system, and
361 should be investigated and reported (@pxref{Bugs}).
364 should be investigated and reported.
367 Some compilers fail to compile GNU CC because they have bugs or
368 limitations. For example, the Microsoft compiler is said to run out of
369 macro space. Some Ultrix compilers run out of expression space; then
370 you need to break up the statement where the problem happens.
373 If you are building a cross-compiler, stop here. @xref{Cross-Compiler}.
377 Move the first-stage object files and executables into a subdirectory
384 The files are moved into a subdirectory named @file{stage1}.
385 Once installation is complete, you may wish to delete these files
386 with @code{rm -r stage1}.
389 If you have chosen a configuration for GNU CC which requires other GNU
390 tools (such as GAS or the GNU linker) instead of the standard system
391 tools, install the required tools in the @file{stage1} subdirectory
392 under the names @file{as}, @file{ld} or whatever is appropriate. This
393 will enable the stage 1 compiler to find the proper tools in the
396 Alternatively, you can do subsequent compilation using a value of the
397 @code{PATH} environment variable such that the necessary GNU tools come
398 before the standard system tools.
401 Recompile the compiler with itself, with this command:
404 make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"
407 This is called making the stage 2 compiler.
409 The command shown above builds compilers for all the supported
410 languages. If you don't want them all, you can specify the languages to
411 build by typing the argument @samp{LANGUAGES="@var{list}"}. @var{list}
412 should contain one or more words from the list @samp{c}, @samp{c++},
413 @samp{objective-c}, and @samp{proto}. Separate the words with spaces.
414 @samp{proto} stands for the programs @code{protoize} and
415 @code{unprotoize}; they are not a separate language, but you use
416 @code{LANGUAGES} to enable or disable their installation.
418 If you are going to build the stage 3 compiler, then you might want to
419 build only the C language in stage 2.
421 Once you have built the stage 2 compiler, if you are short of disk
422 space, you can delete the subdirectory @file{stage1}.
424 On a 68000 or 68020 system lacking floating point hardware,
425 unless you have selected a @file{tm.h} file that expects by default
426 that there is no such hardware, do this instead:
429 make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float"
433 If you wish to test the compiler by compiling it with itself one more
434 time, install any other necessary GNU tools (such as GAS or the GNU
435 linker) in the @file{stage2} subdirectory as you did in the
436 @file{stage1} subdirectory, then do this:
440 make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2"
444 This is called making the stage 3 compiler. Aside from the @samp{-B}
445 option, the compiler options should be the same as when you made the
446 stage 2 compiler. But the @code{LANGUAGES} option need not be the
447 same. The command shown above builds compilers for all the supported
448 languages; if you don't want them all, you can specify the languages to
449 build by typing the argument @samp{LANGUAGES="@var{list}"}, as described
452 If you do not have to install any additional GNU tools, you may use the
456 make bootstrap LANGUAGES=@var{language-list} BOOT_CFLAGS=@var{option-list}
460 instead of making @file{stage1}, @file{stage2}, and performing
461 the two compiler builds.
464 Compare the latest object files with the stage 2 object files---they
465 ought to be identical, aside from time stamps (if any).
467 On some systems, meaningful comparison of object files is impossible;
468 they always appear ``different.'' This is currently true on Solaris and
469 some systems that use ELF object file format. On some versions of Irix
470 on SGI machines and DEC Unix (OSF/1) on Alpha systems, you will not be
471 able to compare the files without specifying @file{-save-temps}; see the
472 description of individual systems above to see if you get comparison
473 failures. You may have similar problems on other systems.
475 Use this command to compare the files:
481 This will mention any object files that differ between stage 2 and stage
482 3. Any difference, no matter how innocuous, indicates that the stage 2
483 compiler has compiled GNU CC incorrectly, and is therefore a potentially
485 serious bug which you should investigate and report (@pxref{Bugs}).
488 serious bug which you should investigate and report.
491 If your system does not put time stamps in the object files, then this
492 is a faster way to compare them (using the Bourne shell):
496 cmp $file stage2/$file
500 If you have built the compiler with the @samp{-mno-mips-tfile} option on
501 MIPS machines, you will not be able to compare the files.
504 Install the compiler driver, the compiler's passes and run-time support
505 with @samp{make install}. Use the same value for @code{CC},
506 @code{CFLAGS} and @code{LANGUAGES} that you used when compiling the
507 files that are being installed. One reason this is necessary is that
508 some versions of Make have bugs and recompile files gratuitously when
509 you do this step. If you use the same variable values, those files will
510 be recompiled properly.
512 For example, if you have built the stage 2 compiler, you can use the
516 make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="@var{list}"
520 This copies the files @file{cc1}, @file{cpp} and @file{libgcc.a} to
521 files @file{cc1}, @file{cpp} and @file{libgcc.a} in the directory
522 @file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}, which is where
523 the compiler driver program looks for them. Here @var{target} is the
524 canonicalized form of target machine type specified when you ran
525 @file{configure}, and @var{version} is the version number of GNU CC.
526 This naming scheme permits various versions and/or cross-compilers to
527 coexist. It also copies the executables for compilers for other
528 languages (e.g., @file{cc1plus} for C++) to the same directory.
530 This also copies the driver program @file{xgcc} into
531 @file{/usr/local/bin/gcc}, so that it appears in typical execution
532 search paths. It also copies @file{gcc.1} into
533 @file{/usr/local/man/man1} and info pages into @file{/usr/local/info}.
535 On some systems, this command causes recompilation of some files. This
536 is usually due to bugs in @code{make}. You should either ignore this
537 problem, or use GNU Make.
539 (It is usually better to install GNU CC executables from stage 2 or 3,
540 since they usually run faster than the ones compiled with some other
544 GNU CC includes a runtime library for Objective-C because it is an
545 integral part of the language. You can find the files associated with
546 the library in the subdirectory @file{objc}. The GNU Objective-C
547 Runtime Library requires header files for the target's C library in
548 order to be compiled,and also requires the header files for the target's
549 thread library if you want thread support. @xref{Cross Headers,
550 Cross-Compilers and Header Files, Cross-Compilers and Header Files}, for
551 discussion about header files issues for cross-compilation.
553 When you run @file{configure}, it picks the appropriate Objective-C
554 thread implementation file for the target platform. In some situations,
555 you may wish to choose a different back-end as some platforms support
556 multiple thread implementations or you may wish to disable thread
557 support completely. You do this by specifying a value for the
558 @var{OBJC_THREAD_FILE} makefile variable on the command line when you
559 run make, for example:
562 make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" OBJC_THREAD_FILE=thr-single
566 Below is a list of the currently available back-ends.
570 Disable thread support, should work for all platforms.
572 DEC OSF/1 thread support.
574 SGI IRIX thread support.
576 Generic MACH thread support, known to work on NEXTSTEP.
578 IBM OS/2 thread support.
580 Generix POSIX thread support.
582 PCThreads on Linux-based GNU systems.
584 SUN Solaris thread support.
586 Microsoft Win32 API thread support.
590 @node Configuration Files
591 @section Files Created by @code{configure}
593 Here we spell out what files will be set up by @code{configure}. Normally
594 you need not be concerned with these files.
599 A file named @file{config.h} is created that contains a @samp{#include}
600 of the top-level config file for the machine you will run the compiler
601 on (@pxref{Config}). This file is responsible for defining information
602 about the host machine. It includes @file{tm.h}.
605 A file named @file{config.h} is created that contains a @samp{#include}
606 of the top-level config file for the machine you will run the compiler
607 on (@pxref{Config,,The Configuration File, gcc.info, Using and Porting
608 GCC}). This file is responsible for defining information about the host
609 machine. It includes @file{tm.h}.
612 The top-level config file is located in the subdirectory @file{config}.
613 Its name is always @file{xm-@var{something}.h}; usually
614 @file{xm-@var{machine}.h}, but there are some exceptions.
616 If your system does not support symbolic links, you might want to
617 set up @file{config.h} to contain a @samp{#include} command which
618 refers to the appropriate file.
621 A file named @file{tconfig.h} is created which includes the top-level config
622 file for your target machine. This is used for compiling certain
623 programs to run on that machine.
626 A file named @file{tm.h} is created which includes the
627 machine-description macro file for your target machine. It should be in
628 the subdirectory @file{config} and its name is often
629 @file{@var{machine}.h}.
632 The command file @file{configure} also constructs the file
633 @file{Makefile} by adding some text to the template file
634 @file{Makefile.in}. The additional text comes from files in the
635 @file{config} directory, named @file{t-@var{target}} and
636 @file{x-@var{host}}. If these files do not exist, it means nothing
637 needs to be added for a given target or host.
641 @section Configurations Supported by GNU CC
642 @cindex configurations supported by GNU CC
644 Here are the possible CPU types:
647 @c gmicro, fx80, spur and tahoe omitted since they don't work.
648 1750a, a29k, alpha, arm, avr, c@var{n}, clipper, dsp16xx, elxsi, fr30, h8300,
649 hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860, i960, m32r,
650 m68000, m68k, m6811, m6812, m88k, mcore, mips, mipsel, mips64, mips64el,
651 mn10200, mn10300, ns32k, pdp11, powerpc, powerpcle, romp, rs6000, sh, sparc,
652 sparclite, sparc64, v850, vax, we32k.
655 Here are the recognized company names. As you can see, customary
656 abbreviations are used rather than the longer official names.
658 @c What should be done about merlin, tek*, dolphin?
660 acorn, alliant, altos, apollo, apple, att, bull,
661 cbm, convergent, convex, crds, dec, dg, dolphin,
662 elxsi, encore, harris, hitachi, hp, ibm, intergraph, isi,
663 mips, motorola, ncr, next, ns, omron, plexus,
664 sequent, sgi, sony, sun, tti, unicom, wrs.
667 The company name is meaningful only to disambiguate when the rest of
668 the information supplied is insufficient. You can omit it, writing
669 just @samp{@var{cpu}-@var{system}}, if it is not needed. For example,
670 @samp{vax-ultrix4.2} is equivalent to @samp{vax-dec-ultrix4.2}.
672 Here is a list of system types:
675 386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff, ctix, cxux,
676 dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, linux,
677 linux-gnu, hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs,
678 netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim,
679 solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta,
680 vxworks, winnt, xenix.
684 You can omit the system type; then @file{configure} guesses the
685 operating system from the CPU and company.
687 You can add a version number to the system type; this may or may not
688 make a difference. For example, you can write @samp{bsd4.3} or
689 @samp{bsd4.4} to distinguish versions of BSD. In practice, the version
690 number is most needed for @samp{sysv3} and @samp{sysv4}, which are often
693 @samp{linux-gnu} is the canonical name for the GNU/Linux target; however
694 GNU CC will also accept @samp{linux}. The version of the kernel in use is
695 not relevant on these systems. A suffix such as @samp{libc1} or @samp{aout}
696 distinguishes major versions of the C library; all of the suffixed versions
699 If you specify an impossible combination such as @samp{i860-dg-vms},
700 then you may get an error message from @file{configure}, or it may
701 ignore part of the information and do the best it can with the rest.
702 @file{configure} always prints the canonical name for the alternative
703 that it used. GNU CC does not support all possible alternatives.
705 Often a particular model of machine has a name. Many machine names are
706 recognized as aliases for CPU/company combinations. Thus, the machine
707 name @samp{sun3}, mentioned above, is an alias for @samp{m68k-sun}.
708 Sometimes we accept a company name as a machine name, when the name is
709 popularly used for a particular machine. Here is a table of the known
713 3300, 3b1, 3b@var{n}, 7300, altos3068, altos,
714 apollo68, att-7300, balance,
715 convex-c@var{n}, crds, decstation-3100,
716 decstation, delta, encore,
717 fx2800, gmicro, hp7@var{nn}, hp8@var{nn},
718 hp9k2@var{nn}, hp9k3@var{nn}, hp9k7@var{nn},
719 hp9k8@var{nn}, iris4d, iris, isi68,
720 m3230, magnum, merlin, miniframe,
721 mmax, news-3600, news800, news, next,
722 pbd, pc532, pmax, powerpc, powerpcle, ps2, risc-news,
723 rtpc, sun2, sun386i, sun386, sun3,
724 sun4, symmetry, tower-32, tower.
728 Remember that a machine name specifies both the cpu type and the company
730 If you want to install your own homemade configuration files, you can
731 use @samp{local} as the company name to access them. If you use
732 configuration @samp{@var{cpu}-local}, the configuration name
733 without the cpu prefix
734 is used to form the configuration file names.
736 Thus, if you specify @samp{m68k-local}, configuration uses
737 files @file{m68k.md}, @file{local.h}, @file{m68k.c},
738 @file{xm-local.h}, @file{t-local}, and @file{x-local}, all in the
739 directory @file{config/m68k}.
741 Here is a list of configurations that have special treatment or special
742 things you must know:
746 MIL-STD-1750A processors.
748 The MIL-STD-1750A cross configuration produces output for
749 @code{as1750}, an assembler/linker available under the GNU Public
750 License for the 1750A. @code{as1750} can be obtained at
751 @uref{ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/}.
752 A similarly licensed simulator for
753 the 1750A is available from same address.
755 You should ignore a fatal error during the building of libgcc (libgcc is
756 not yet implemented for the 1750A.)
758 The @code{as1750} assembler requires the file @file{ms1750.inc}, which is
759 found in the directory @file{config/1750a}.
761 GNU CC produced the same sections as the Fairchild F9450 C Compiler,
766 The program code section.
769 The read/write (RAM) data section.
772 The read-only (ROM) constants section.
775 Initialization section (code to copy KREL to SREL).
778 The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16). This
779 means that type `char' is represented with a 16-bit word per character.
780 The 1750A's "Load/Store Upper/Lower Byte" instructions are not used by
784 Systems using processors that implement the DEC Alpha architecture and
785 are running the DEC Unix (OSF/1) operating system, for example the DEC
786 Alpha AXP systems.CC.)
788 GNU CC writes a @samp{.verstamp} directive to the assembler output file
789 unless it is built as a cross-compiler. It gets the version to use from
790 the system header file @file{/usr/include/stamp.h}. If you install a
791 new version of DEC Unix, you should rebuild GCC to pick up the new version
794 Note that since the Alpha is a 64-bit architecture, cross-compilers from
795 32-bit machines will not generate code as efficient as that generated
796 when the compiler is running on a 64-bit machine because many
797 optimizations that depend on being able to represent a word on the
798 target in an integral value on the host cannot be performed. Building
799 cross-compilers on the Alpha for 32-bit machines has only been tested in
800 a few cases and may not work properly.
802 @code{make compare} may fail on old versions of DEC Unix unless you add
803 @samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
804 assembler input file is stored in the object file, and that makes
805 comparison fail if it differs between the @code{stage1} and
806 @code{stage2} compilations. The option @samp{-save-temps} forces a
807 fixed name to be used for the assembler input file, instead of a
808 randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
809 unless the comparisons fail without that option. If you add
810 @samp{-save-temps}, you will have to manually delete the @samp{.i} and
811 @samp{.s} files after each series of compilations.
813 GNU CC now supports both the native (ECOFF) debugging format used by DBX
814 and GDB and an encapsulated STABS format for use only with GDB. See the
815 discussion of the @samp{--with-stabs} option of @file{configure} above
816 for more information on these formats and how to select them.
818 There is a bug in DEC's assembler that produces incorrect line numbers
819 for ECOFF format when the @samp{.align} directive is used. To work
820 around this problem, GNU CC will not emit such alignment directives
821 while writing ECOFF format debugging information even if optimization is
822 being performed. Unfortunately, this has the very undesirable
823 side-effect that code addresses when @samp{-O} is specified are
824 different depending on whether or not @samp{-g} is also specified.
826 To avoid this behavior, specify @samp{-gstabs+} and use GDB instead of
827 DBX. DEC is now aware of this problem with the assembler and hopes to
828 provide a fix shortly.
831 Argonaut ARC processor.
832 This configuration is intended for embedded systems.
835 Advanced RISC Machines ARM-family processors. These are often used in
836 embedded applications. There are no standard Unix configurations.
837 This configuration corresponds to the basic instruction sequences and will
838 produce @file{a.out} format object modules.
840 You may need to make a variant of the file @file{arm.h} for your particular
844 This configuration is intended for embedded systems.
846 @item arm-*-linux*aout
847 Any of the ARM-family processors running the Linux-based GNU system with
848 the @file{a.out} binary format. This is an obsolete configuration.
851 @itemx arm-*-linux-gnu
852 @itemx arm-*-linux*oldld
853 Any of the ARM-family processors running the Linux-based GNU system with
854 the @file{ELF} binary format. You must use version 2.9.1.0.22 or later
855 of the GNU/Linux binutils, which you can download from
856 @uref{ftp://ftp.varesearch.com/pub/support/hjl/binutils/}.
858 These two configurations differ only in the required version of GNU
859 binutils. For binutils 2.9.1.0.x, use @samp{arm-*-linux-gnuoldld}. For
860 newer versions of binutils, use @samp{arm-*-linux-gnu}.
863 The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD Unix.
864 If you are running a version of RISC iX prior to 1.2 then you must
865 specify the version number during configuration. Note that the
866 assembler shipped with RISC iX does not support stabs debugging
867 information; a new version of the assembler, with stabs support
868 included, is now available from Acorn and via ftp
869 @uref{ftp://ftp.acorn.com/pub/riscix/as+xterm.tar.Z}. To enable stabs
870 debugging, pass @samp{--with-gnu-as} to configure.
872 You will need to install GNU @file{sed} before you can run configure.
875 AMD Am29k-family processors. These are normally used in embedded
876 applications. There are no standard Unix configurations.
878 corresponds to AMD's standard calling sequence and binary interface
879 and is compatible with other 29k tools.
881 You may need to make a variant of the file @file{a29k.h} for your
882 particular configuration.
885 AMD Am29050 used in a system running a variant of BSD Unix.
888 ATMEL AVR-family micro controllers. These are used in embedded
889 applications. There are no standard Unix configurations.
890 @xref{AVR Options}, for the list of supported MCU types.
893 MIPS-based DECstations can support three different personalities:
894 Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products have
895 a configuration name beginning with @samp{alpha-dec}.) To configure GCC
896 for these platforms use the following configurations:
899 @item decstation-ultrix
900 Ultrix configuration.
902 @item decstation-osf1
903 Dec's version of OSF/1.
905 @item decstation-osfrose
906 Open Software Foundation reference port of OSF/1 which uses the
907 OSF/rose object file format instead of ECOFF. Normally, you
908 would not select this configuration.
911 The MIPS C compiler needs to be told to increase its table size
912 for switch statements with the @samp{-Wf,-XNg1500} option in
913 order to compile @file{cp/parse.c}. If you use the @samp{-O2}
914 optimization option, you also need to use @samp{-Olimit 3000}.
915 Both of these options are automatically generated in the
916 @file{Makefile} that the shell script @file{configure} builds.
917 If you override the @code{CC} make variable and use the MIPS
918 compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
920 @item elxsi-elxsi-bsd
921 The Elxsi's C compiler has known limitations that prevent it from
922 compiling GNU C. Please contact @email{mrs@@cygnus.com} for more details.
925 A port to the AT&T DSP1610 family of processors.
929 Alliant FX/8 computer. Note that the standard installed C compiler in
930 Concentrix 5.0 has a bug which prevent it from compiling GNU CC
931 correctly. You can patch the compiler bug as follows:
935 adb -w ./pcc - << EOF
940 Then you must use the @samp{-ip12} option when compiling GNU CC
941 with the patched compiler, as shown here:
944 make CC="./pcc -ip12" CFLAGS=-w
947 Note also that Alliant's version of DBX does not manage to work with the
952 Hitachi H8/300 series of processors.
954 The calling convention and structure layout has changed in release 2.6.
955 All code must be recompiled. The calling convention now passes the
956 first three arguments in function calls in registers. Structures are no
957 longer a multiple of 2 bytes.
960 This port is very preliminary and has many known bugs. We hope to
961 have a higher-quality port for this machine soon.
963 @item i386-*-linux*oldld
964 Use this configuration to generate @file{a.out} binaries on Linux-based
965 GNU systems if you do not have gas/binutils version 2.5.2 or later
966 installed. This is an obsolete configuration.
968 @item i386-*-linux*aout
969 Use this configuration to generate @file{a.out} binaries on Linux-based
970 GNU systems. This configuration is being superseded. You must use
971 gas/binutils version 2.5.2 or later.
974 @itemx i386-*-linux-gnu
975 Use this configuration to generate ELF binaries on Linux-based GNU
976 systems. You must use gas/binutils version 2.5.2 or later.
979 Compilation with RCC is recommended. Also, it may be a good idea to
980 link with GNU malloc instead of the malloc that comes with the system.
982 @item i386-*-sco3.2v4
983 Use this configuration for SCO release 3.2 version 4.
985 @item i386-*-sco3.2v5*
986 Use this for the SCO OpenServer Release 5 family of operating systems.
989 It may be a good idea to link with GNU malloc instead of the malloc that
990 comes with the system.
992 In ISC version 4.1, @file{sed} core dumps when building
993 @file{deduced.h}. Use the version of @file{sed} from version 4.0.
996 It may be good idea to link with GNU malloc instead of the malloc that
997 comes with the system.
1000 You need to use GAS version 2.1 or later, and LD from
1001 GNU binutils version 2.2 or later.
1003 @item i386-sequent-bsd
1004 Go to the Berkeley universe before compiling.
1006 @item i386-sequent-ptx1*
1007 @itemx i386-sequent-ptx2*
1008 You must install GNU @file{sed} before running @file{configure}.
1011 LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
1012 @file{/bin/gcc}. You should compile with this instead of @file{/bin/cc}.
1013 You can tell GNU CC to use the GNU assembler and linker, by specifying
1014 @samp{--with-gnu-as --with-gnu-ld} when configuring. These will produce
1015 COFF format object files and executables; otherwise GNU CC will use the
1016 installed tools, which produce @file{a.out} format executables.
1019 Mitsubishi M32R processor.
1020 This configuration is intended for embedded systems.
1023 HP 9000 series 200 running BSD. Note that the C compiler that comes
1024 with this system cannot compile GNU CC; contact @email{law@@cygnus.com}
1025 to get binaries of GNU CC for bootstrapping.
1028 Altos 3068. You must use the GNU assembler, linker and debugger.
1029 Also, you must fix a kernel bug. Details in the file @file{README.ALTOS}.
1031 @item m68k-apple-aux
1032 Apple Macintosh running A/UX.
1033 You may configure GCC to use either the system assembler and
1034 linker or the GNU assembler and linker. You should use the GNU configuration
1035 if you can, especially if you also want to use GNU C++. You enabled
1036 that configuration with + the @samp{--with-gnu-as} and @samp{--with-gnu-ld}
1037 options to @code{configure}.
1039 Note the C compiler that comes
1040 with this system cannot compile GNU CC. You can find binaries of GNU CC
1041 for bootstrapping on @code{jagubox.gsfc.nasa.gov}.
1042 You will also a patched version of @file{/bin/ld} there that
1043 raises some of the arbitrary limits found in the original.
1046 AT&T 3b1, a.k.a. 7300 PC. This version of GNU CC cannot
1047 be compiled with the system C compiler, which is too buggy.
1048 You will need to get a previous version of GCC and use it to
1049 bootstrap. Binaries are available from the OSU-CIS archive, at
1050 @uref{ftp://archive.cis.ohio-state.edu/pub/att7300/}.
1052 @item m68k-bull-sysv
1053 Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU CC works
1054 either with native assembler or GNU assembler. You can use
1055 GNU assembler with native coff generation by providing @samp{--with-gnu-as} to
1056 the configure script or use GNU assembler with dbx-in-coff encapsulation
1057 by providing @samp{--with-gnu-as --stabs}. For any problem with native
1058 assembler or for availability of the DPX/2 port of GAS, contact
1059 @email{F.Pierresteguy@@frcl.bull.fr}.
1061 @item m68k-crds-unox
1062 Use @samp{configure unos} for building on Unos.
1064 The Unos assembler is named @code{casm} instead of @code{as}. For some
1065 strange reason linking @file{/bin/as} to @file{/bin/casm} changes the
1066 behavior, and does not work. So, when installing GNU CC, you should
1067 install the following script as @file{as} in the subdirectory where
1068 the passes of GCC are installed:
1075 The default Unos library is named @file{libunos.a} instead of
1076 @file{libc.a}. To allow GNU CC to function, either change all
1077 references to @samp{-lc} in @file{gcc.c} to @samp{-lunos} or link
1078 @file{/lib/libc.a} to @file{/lib/libunos.a}.
1080 @cindex @code{alloca}, for Unos
1081 When compiling GNU CC with the standard compiler, to overcome bugs in
1082 the support of @code{alloca}, do not use @samp{-O} when making stage 2.
1083 Then use the stage 2 compiler with @samp{-O} to make the stage 3
1084 compiler. This compiler will have the same characteristics as the usual
1085 stage 2 compiler on other systems. Use it to make a stage 4 compiler
1086 and compare that with stage 3 to verify proper compilation.
1088 (Perhaps simply defining @code{ALLOCA} in @file{x-crds} as described in
1089 the comments there will make the above paragraph superfluous. Please
1090 inform us of whether this works.)
1092 Unos uses memory segmentation instead of demand paging, so you will need
1093 a lot of memory. 5 Mb is barely enough if no other tasks are running.
1094 If linking @file{cc1} fails, try putting the object files into a library
1095 and linking from that library.
1098 HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 has a bug in
1099 the assembler that prevents compilation of GNU CC. To fix it, get patch
1102 In addition, if you wish to use gas @samp{--with-gnu-as} you must use
1103 gas version 2.1 or later, and you must use the GNU linker version 2.1 or
1104 later. Earlier versions of gas relied upon a program which converted the
1105 gas output into the native HP-UX format, but that program has not been
1106 kept up to date. gdb does not understand that native HP-UX format, so
1107 you must use gas if you wish to use gdb.
1110 Sun 3. We do not provide a configuration file to use the Sun FPA by
1111 default, because programs that establish signal handlers for floating
1112 point traps inherently cannot work with the FPA.
1115 Motorola 68HC11 family micro controllers. These are used in embedded
1116 applications. There are no standard Unix configurations.
1119 Motorola 68HC12 family micro controllers. These are used in embedded
1120 applications. There are no standard Unix configurations.
1123 Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
1124 These systems tend to use the Green Hills C, revision 1.8.5, as the
1125 standard C compiler. There are apparently bugs in this compiler that
1126 result in object files differences between stage 2 and stage 3. If this
1127 happens, make the stage 4 compiler and compare it to the stage 3
1128 compiler. If the stage 3 and stage 4 object files are identical, this
1129 suggests you encountered a problem with the standard C compiler; the
1130 stage 3 and 4 compilers may be usable.
1132 It is best, however, to use an older version of GNU CC for bootstrapping
1136 Motorola m88k running DG/UX. To build 88open BCS native or cross
1137 compilers on DG/UX, specify the configuration name as
1138 @samp{m88k-*-dguxbcs} and build in the 88open BCS software development
1139 environment. To build ELF native or cross compilers on DG/UX, specify
1140 @samp{m88k-*-dgux} and build in the DG/UX ELF development environment.
1141 You set the software development environment by issuing
1142 @samp{sde-target} command and specifying either @samp{m88kbcs} or
1143 @samp{m88kdguxelf} as the operand.
1145 If you do not specify a configuration name, @file{configure} guesses the
1146 configuration based on the current software development environment.
1148 @item m88k-tektronix-sysv3
1149 Tektronix XD88 running UTekV 3.2e. Do not turn on
1150 optimization while building stage1 if you bootstrap with
1151 the buggy Green Hills compiler. Also, The bundled LAI
1152 System V NFS is buggy so if you build in an NFS mounted
1153 directory, start from a fresh reboot, or avoid NFS all together.
1154 Otherwise you may have trouble getting clean comparisons
1158 MIPS machines running the MIPS operating system in BSD mode. It's
1159 possible that some old versions of the system lack the functions
1160 @code{memcpy}, @code{memmove}, @code{memcmp}, and @code{memset}. If your
1161 system lacks these, you must remove or undo the definition of
1162 @code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.
1164 The MIPS C compiler needs to be told to increase its table size
1165 for switch statements with the @samp{-Wf,-XNg1500} option in
1166 order to compile @file{cp/parse.c}. If you use the @samp{-O2}
1167 optimization option, you also need to use @samp{-Olimit 3000}.
1168 Both of these options are automatically generated in the
1169 @file{Makefile} that the shell script @file{configure} builds.
1170 If you override the @code{CC} make variable and use the MIPS
1171 compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
1173 @item mips-mips-riscos*
1174 The MIPS C compiler needs to be told to increase its table size
1175 for switch statements with the @samp{-Wf,-XNg1500} option in
1176 order to compile @file{cp/parse.c}. If you use the @samp{-O2}
1177 optimization option, you also need to use @samp{-Olimit 3000}.
1178 Both of these options are automatically generated in the
1179 @file{Makefile} that the shell script @file{configure} builds.
1180 If you override the @code{CC} make variable and use the MIPS
1181 compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
1183 MIPS computers running RISC-OS can support four different
1184 personalities: default, BSD 4.3, System V.3, and System V.4
1185 (older versions of RISC-OS don't support V.4). To configure GCC
1186 for these platforms use the following configurations:
1189 @item mips-mips-riscos@code{rev}
1190 Default configuration for RISC-OS, revision @code{rev}.
1192 @item mips-mips-riscos@code{rev}bsd
1193 BSD 4.3 configuration for RISC-OS, revision @code{rev}.
1195 @item mips-mips-riscos@code{rev}sysv4
1196 System V.4 configuration for RISC-OS, revision @code{rev}.
1198 @item mips-mips-riscos@code{rev}sysv
1199 System V.3 configuration for RISC-OS, revision @code{rev}.
1202 The revision @code{rev} mentioned above is the revision of
1203 RISC-OS to use. You must reconfigure GCC when going from a
1204 RISC-OS revision 4 to RISC-OS revision 5. This has the effect of
1206 @ifclear INSTALLONLY
1207 bug (see @ref{Installation Problems}, for more details).
1214 In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
1215 option must be installed from the CD-ROM supplied from Silicon Graphics.
1216 This is found on the 2nd CD in release 4.0.1.
1218 In order to compile GCC on an SGI running IRIX 5, the "compiler_dev.hdr"
1219 subsystem must be installed from the IDO CD-ROM supplied by Silicon
1222 @code{make compare} may fail on version 5 of IRIX unless you add
1223 @samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
1224 assembler input file is stored in the object file, and that makes
1225 comparison fail if it differs between the @code{stage1} and
1226 @code{stage2} compilations. The option @samp{-save-temps} forces a
1227 fixed name to be used for the assembler input file, instead of a
1228 randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
1229 unless the comparisons fail without that option. If you do you
1230 @samp{-save-temps}, you will have to manually delete the @samp{.i} and
1231 @samp{.s} files after each series of compilations.
1233 The MIPS C compiler needs to be told to increase its table size
1234 for switch statements with the @samp{-Wf,-XNg1500} option in
1235 order to compile @file{cp/parse.c}. If you use the @samp{-O2}
1236 optimization option, you also need to use @samp{-Olimit 3000}.
1237 Both of these options are automatically generated in the
1238 @file{Makefile} that the shell script @file{configure} builds.
1239 If you override the @code{CC} make variable and use the MIPS
1240 compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
1242 On Irix version 4.0.5F, and perhaps on some other versions as well,
1243 there is an assembler bug that reorders instructions incorrectly. To
1244 work around it, specify the target configuration
1245 @samp{mips-sgi-irix4loser}. This configuration inhibits assembler
1248 In a compiler configured with target @samp{mips-sgi-irix4}, you can turn
1249 off assembler optimization by using the @samp{-noasmopt} option. This
1250 compiler option passes the option @samp{-O0} to the assembler, to
1253 The @samp{-noasmopt} option can be useful for testing whether a problem
1254 is due to erroneous assembler reordering. Even if a problem does not go
1255 away with @samp{-noasmopt}, it may still be due to assembler
1256 reordering---perhaps GNU CC itself was miscompiled as a result.
1258 To enable debugging under Irix 5, you must use GNU as 2.5 or later,
1259 and use the @samp{--with-gnu-as} configure option when configuring gcc.
1260 GNU as is distributed as part of the binutils package.
1262 @item mips-sony-sysv
1263 Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2 (which
1264 uses ELF instead of COFF). Support for 5.0.2 will probably be provided
1265 soon by volunteers. In particular, the linker does not like the
1266 code generated by GCC when shared libraries are linked in.
1269 Encore ns32000 system. Encore systems are supported only under BSD.
1272 National Semiconductor ns32000 system. Genix has bugs in @code{alloca}
1273 and @code{malloc}; you must get the compiled versions of these from GNU
1277 Go to the Berkeley universe before compiling.
1280 UTEK ns32000 system (``merlin''). The C compiler that comes with this
1281 system cannot compile GNU CC; contact @samp{tektronix!reed!mason} to get
1282 binaries of GNU CC for bootstrapping.
1286 The only operating systems supported for the IBM RT PC are AOS and
1287 MACH. GNU CC does not support AIX running on the RT. We recommend you
1288 compile GNU CC with an earlier version of itself; if you compile GNU CC
1289 with @code{hc}, the Metaware compiler, it will work, but you will get
1290 mismatches between the stage 2 and stage 3 compilers in various files.
1291 These errors are minor differences in some floating-point constants and
1292 can be safely ignored; the stage 3 compiler is correct.
1295 @itemx powerpc-*-aix
1296 Various early versions of each release of the IBM XLC compiler will not
1297 bootstrap GNU CC. Symptoms include differences between the stage2 and
1298 stage3 object files, and errors when compiling @file{libgcc.a} or
1299 @file{enquire}. Known problematic releases include: xlc-1.2.1.8,
1300 xlc-1.3.0.0 (distributed with AIX 3.2.5), and xlc-1.3.0.19. Both
1301 xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are known to produce working
1302 versions of GNU CC, but most other recent releases correctly bootstrap
1305 Release 4.3.0 of AIX and ones prior to AIX 3.2.4 include a version of
1306 the IBM assembler which does not accept debugging directives: assembler
1307 updates are available as PTFs. Also, if you are using AIX 3.2.5 or
1308 greater and the GNU assembler, you must have a version modified after
1309 October 16th, 1995 in order for the GNU C compiler to build. See the
1310 file @file{README.RS6000} for more details on any of these problems.
1312 GNU CC does not yet support the 64-bit PowerPC instructions.
1314 Objective C does not work on this architecture because it makes assumptions
1315 that are incompatible with the calling conventions.
1317 AIX on the RS/6000 provides support (NLS) for environments outside of
1318 the United States. Compilers and assemblers use NLS to support
1319 locale-specific representations of various objects including
1320 floating-point numbers ("." vs "," for separating decimal fractions).
1321 There have been problems reported where the library linked with GNU CC
1322 does not produce the same floating-point formats that the assembler
1323 accepts. If you have this problem, set the LANG environment variable to
1326 Due to changes in the way that GNU CC invokes the binder (linker) for AIX
1327 4.1, you may now receive warnings of duplicate symbols from the link step
1328 that were not reported before. The assembly files generated by GNU CC for
1329 AIX have always included multiple symbol definitions for certain global
1330 variable and function declarations in the original program. The warnings
1331 should not prevent the linker from producing a correct library or runnable
1334 By default, AIX 4.1 produces code that can be used on either Power or
1337 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1338 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1341 @itemx powerpc-*-sysv4
1342 PowerPC system in big endian mode, running System V.4.
1344 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1345 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1347 @item powerpc-*-linux
1348 @itemx powerpc-*-linux-gnu
1349 PowerPC system in big endian mode, running the Linux-based GNU system.
1351 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1352 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1354 @item powerpc-*-eabiaix
1355 Embedded PowerPC system in big endian mode with -mcall-aix selected as
1358 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1359 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1361 @item powerpc-*-eabisim
1362 Embedded PowerPC system in big endian mode for use in running under the
1365 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1366 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1368 @item powerpc-*-eabi
1369 Embedded PowerPC system in big endian mode.
1371 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1372 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1374 @item powerpcle-*-elf
1375 @itemx powerpcle-*-sysv4
1376 PowerPC system in little endian mode, running System V.4.
1378 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1379 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1381 @item powerpcle-*-eabisim
1382 Embedded PowerPC system in little endian mode for use in running under
1385 @itemx powerpcle-*-eabi
1386 Embedded PowerPC system in little endian mode.
1388 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1389 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1391 @item powerpcle-*-winnt
1392 @itemx powerpcle-*-pe
1393 PowerPC system in little endian mode running Windows NT.
1395 You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
1396 switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
1398 @item vax-dec-ultrix
1399 Don't try compiling with Vax C (@code{vcc}). It produces incorrect code
1400 in some cases (for example, when @code{alloca} is used).
1402 Meanwhile, compiling @file{cp/parse.c} with pcc does not work because of
1403 an internal table size limitation in that compiler. To avoid this
1404 problem, compile just the GNU C compiler first, and use it to recompile
1405 building all the languages that you want to run.
1408 See @ref{VMS Install}, for details on how to install GNU CC on VMS.
1411 These computers are also known as the 3b2, 3b5, 3b20 and other similar
1412 names. (However, the 3b1 is actually a 68000; see
1413 @ref{Configurations}.)
1415 Don't use @samp{-g} when compiling with the system's compiler. The
1416 system's linker seems to be unable to handle such a large program with
1417 debugging information.
1419 The system's compiler runs out of capacity when compiling @file{stmt.c}
1420 in GNU CC. You can work around this by building @file{cpp} in GNU CC
1421 first, then use that instead of the system's preprocessor with the
1422 system's C compiler to compile @file{stmt.c}. Here is how:
1425 mv /lib/cpp /lib/cpp.att
1427 echo '/lib/cpp.gnu -traditional $@{1+"$@@"@}' > /lib/cpp
1431 The system's compiler produces bad code for some of the GNU CC
1432 optimization files. So you must build the stage 2 compiler without
1433 optimization. Then build a stage 3 compiler with optimization.
1434 That executable should work. Here are the necessary commands:
1437 make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
1439 make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
1442 You may need to raise the ULIMIT setting to build a C++ compiler,
1443 as the file @file{cc1plus} is larger than one megabyte.
1447 @section Compilation in a Separate Directory
1448 @cindex other directory, compilation in
1449 @cindex compilation in a separate directory
1450 @cindex separate directory, compilation in
1452 If you wish to build the object files and executables in a directory
1453 other than the one containing the source files, here is what you must
1458 Make sure you have a version of Make that supports the @code{VPATH}
1459 feature. (GNU Make supports it, as do Make versions on most BSD
1463 If you have ever run @file{configure} in the source directory, you must undo
1464 the configuration. Do this by running:
1471 Go to the directory in which you want to build the compiler before
1472 running @file{configure}:
1479 On systems that do not support symbolic links, this directory must be
1480 on the same file system as the source code directory.
1483 Specify where to find @file{configure} when you run it:
1486 ../gcc/configure @dots{}
1489 This also tells @code{configure} where to find the compiler sources;
1490 @code{configure} takes the directory from the file name that was used to
1491 invoke it. But if you want to be sure, you can specify the source
1492 directory with the @samp{--srcdir} option, like this:
1495 ../gcc/configure --srcdir=../gcc @var{other options}
1498 The directory you specify with @samp{--srcdir} need not be the same
1499 as the one that @code{configure} is found in.
1502 Now, you can run @code{make} in that directory. You need not repeat the
1503 configuration steps shown above, when ordinary source files change. You
1504 must, however, run @code{configure} again when the configuration files
1505 change, if your system does not support symbolic links.
1507 @node Cross-Compiler
1508 @section Building and Installing a Cross-Compiler
1509 @cindex cross-compiler, installation
1511 GNU CC can function as a cross-compiler for many machines, but not all.
1515 Cross-compilers for the Mips as target using the Mips assembler
1516 currently do not work, because the auxiliary programs
1517 @file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on
1518 anything but a Mips. It does work to cross compile for a Mips
1519 if you use the GNU assembler and linker.
1522 Cross-compilers between machines with different floating point formats
1523 have not all been made to work. GNU CC now has a floating point
1524 emulator with which these can work, but each target machine description
1525 needs to be updated to take advantage of it.
1528 Cross-compilation between machines of different word sizes is
1529 somewhat problematic and sometimes does not work.
1532 Since GNU CC generates assembler code, you probably need a
1533 cross-assembler that GNU CC can run, in order to produce object files.
1534 If you want to link on other than the target machine, you need a
1535 cross-linker as well. You also need header files and libraries suitable
1536 for the target machine that you can install on the host machine.
1539 * Steps of Cross:: Using a cross-compiler involves several steps
1540 that may be carried out on different machines.
1541 * Configure Cross:: Configuring a cross-compiler.
1542 * Tools and Libraries:: Where to put the linker and assembler, and the C library.
1543 * Cross Headers:: Finding and installing header files
1544 for a cross-compiler.
1545 * Build Cross:: Actually compiling the cross-compiler.
1548 @node Steps of Cross
1549 @subsection Steps of Cross-Compilation
1551 To compile and run a program using a cross-compiler involves several
1556 Run the cross-compiler on the host machine to produce assembler files
1557 for the target machine. This requires header files for the target
1561 Assemble the files produced by the cross-compiler. You can do this
1562 either with an assembler on the target machine, or with a
1563 cross-assembler on the host machine.
1566 Link those files to make an executable. You can do this either with a
1567 linker on the target machine, or with a cross-linker on the host
1568 machine. Whichever machine you use, you need libraries and certain
1569 startup files (typically @file{crt@dots{}.o}) for the target machine.
1572 It is most convenient to do all of these steps on the same host machine,
1573 since then you can do it all with a single invocation of GNU CC. This
1574 requires a suitable cross-assembler and cross-linker. For some targets,
1575 the GNU assembler and linker are available.
1577 @node Configure Cross
1578 @subsection Configuring a Cross-Compiler
1580 To build GNU CC as a cross-compiler, you start out by running
1581 @file{configure}. Use the @samp{--target=@var{target}} to specify the
1582 target type. If @file{configure} was unable to correctly identify the
1583 system you are running on, also specify the @samp{--build=@var{build}}
1584 option. For example, here is how to configure for a cross-compiler that
1585 produces code for an HP 68030 system running BSD on a system that
1586 @file{configure} can correctly identify:
1589 ./configure --target=m68k-hp-bsd4.3
1592 @node Tools and Libraries
1593 @subsection Tools and Libraries for a Cross-Compiler
1595 If you have a cross-assembler and cross-linker available, you should
1596 install them now. Put them in the directory
1597 @file{/usr/local/@var{target}/bin}. Here is a table of the tools
1598 you should put in this directory:
1602 This should be the cross-assembler.
1605 This should be the cross-linker.
1608 This should be the cross-archiver: a program which can manipulate
1609 archive files (linker libraries) in the target machine's format.
1612 This should be a program to construct a symbol table in an archive file.
1615 The installation of GNU CC will find these programs in that directory,
1616 and copy or link them to the proper place to for the cross-compiler to
1617 find them when run later.
1619 The easiest way to provide these files is to build the Binutils package
1620 and GAS. Configure them with the same @samp{--host} and @samp{--target}
1621 options that you use for configuring GNU CC, then build and install
1622 them. They install their executables automatically into the proper
1623 directory. Alas, they do not support all the targets that GNU CC
1626 If you want to install libraries to use with the cross-compiler, such as
1627 a standard C library, put them in the directory
1628 @file{/usr/local/@var{target}/lib}; installation of GNU CC copies
1629 all the files in that subdirectory into the proper place for GNU CC to
1630 find them and link with them. Here's an example of copying some
1631 libraries from a target machine:
1634 ftp @var{target-machine}
1635 lcd /usr/local/@var{target}/lib
1645 The precise set of libraries you'll need, and their locations on
1646 the target machine, vary depending on its operating system.
1649 Many targets require ``start files'' such as @file{crt0.o} and
1650 @file{crtn.o} which are linked into each executable; these too should be
1651 placed in @file{/usr/local/@var{target}/lib}. There may be several
1652 alternatives for @file{crt0.o}, for use with profiling or other
1653 compilation options. Check your target's definition of
1654 @code{STARTFILE_SPEC} to find out what start files it uses.
1655 Here's an example of copying these files from a target machine:
1658 ftp @var{target-machine}
1659 lcd /usr/local/@var{target}/lib
1669 @subsection Cross-Compilers and Header Files
1671 If you are cross-compiling a standalone program or a program for an
1672 embedded system, then you may not need any header files except the few
1673 that are part of GNU CC (and those of your program). However, if you
1674 intend to link your program with a standard C library such as
1675 @file{libc.a}, then you probably need to compile with the header files
1676 that go with the library you use.
1678 The GNU C compiler does not come with these files, because (1) they are
1679 system-specific, and (2) they belong in a C library, not in a compiler.
1681 If the GNU C library supports your target machine, then you can get the
1682 header files from there (assuming you actually use the GNU library when
1683 you link your program).
1685 If your target machine comes with a C compiler, it probably comes with
1686 suitable header files also. If you make these files accessible from the host
1687 machine, the cross-compiler can use them also.
1689 Otherwise, you're on your own in finding header files to use when
1692 When you have found suitable header files, put them in the directory
1693 @file{/usr/local/@var{target}/include}, before building the cross
1694 compiler. Then installation will run fixincludes properly and install
1695 the corrected versions of the header files where the compiler will use
1698 Provide the header files before you build the cross-compiler, because
1699 the build stage actually runs the cross-compiler to produce parts of
1700 @file{libgcc.a}. (These are the parts that @emph{can} be compiled with
1701 GNU CC.) Some of them need suitable header files.
1703 Here's an example showing how to copy the header files from a target
1704 machine. On the target machine, do this:
1707 (cd /usr/include; tar cf - .) > tarfile
1710 Then, on the host machine, do this:
1713 ftp @var{target-machine}
1714 lcd /usr/local/@var{target}/include
1721 @subsection Actually Building the Cross-Compiler
1723 Now you can proceed just as for compiling a single-machine compiler
1724 through the step of building stage 1.
1726 If your target is exotic, you may need to provide the header file
1727 @file{float.h}.One way to do this is to compile @file{enquire} and run
1728 it on your target machine. The job of @file{enquire} is to run on the
1729 target machine and figure out by experiment the nature of its floating
1730 point representation. @file{enquire} records its findings in the header
1731 file @file{float.h}. If you can't produce this file by running
1732 @file{enquire} on the target machine, then you will need to come up with
1733 a suitable @file{float.h} in some other way (or else, avoid using it in
1736 Do not try to build stage 2 for a cross-compiler. It doesn't work to
1737 rebuild GNU CC as a cross-compiler using the cross-compiler, because
1738 that would produce a program that runs on the target machine, not on the
1739 host. For example, if you compile a 386-to-68030 cross-compiler with
1740 itself, the result will not be right either for the 386 (because it was
1741 compiled into 68030 code) or for the 68030 (because it was configured
1742 for a 386 as the host). If you want to compile GNU CC into 68030 code,
1743 whether you compile it on a 68030 or with a cross-compiler on a 386, you
1744 must specify a 68030 as the host when you configure it.
1746 To install the cross-compiler, use @samp{make install}, as usual.
1749 @section Installing GNU CC on VMS
1750 @cindex VMS installation
1751 @cindex installing GNU CC on VMS
1753 The VMS version of GNU CC is distributed in a backup saveset containing
1754 both source code and precompiled binaries.
1756 To install the @file{gcc} command so you can use the compiler easily, in
1757 the same manner as you use the VMS C compiler, you must install the VMS CLD
1758 file for GNU CC as follows:
1762 Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}
1763 to point to the directories where the GNU CC executables
1764 (@file{gcc-cpp.exe}, @file{gcc-cc1.exe}, etc.) and the C include files are
1765 kept respectively. This should be done with the commands:@refill
1768 $ assign /system /translation=concealed -
1770 $ assign /system /translation=concealed -
1771 disk:[gcc.include.] gnu_cc_include
1775 with the appropriate disk and directory names. These commands can be
1776 placed in your system startup file so they will be executed whenever
1777 the machine is rebooted. You may, if you choose, do this via the
1778 @file{GCC_INSTALL.COM} script in the @file{[GCC]} directory.
1781 Install the @file{GCC} command with the command line:
1784 $ set command /table=sys$common:[syslib]dcltables -
1785 /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
1786 $ install replace sys$common:[syslib]dcltables
1790 To install the help file, do the following:
1793 $ library/help sys$library:helplib.hlb gcc.hlp
1797 Now you can invoke the compiler with a command like @samp{gcc /verbose
1798 file.c}, which is equivalent to the command @samp{gcc -v -c file.c} in
1802 If you wish to use GNU C++ you must first install GNU CC, and then
1803 perform the following steps:
1807 Define the VMS logical name @samp{GNU_GXX_INCLUDE} to point to the
1808 directory where the preprocessor will search for the C++ header files.
1809 This can be done with the command:@refill
1812 $ assign /system /translation=concealed -
1813 disk:[gcc.gxx_include.] gnu_gxx_include
1817 with the appropriate disk and directory name. If you are going to be
1818 using a C++ runtime library, this is where its install procedure will install
1822 Obtain the file @file{gcc-cc1plus.exe}, and place this in the same
1823 directory that @file{gcc-cc1.exe} is kept.
1825 The GNU C++ compiler can be invoked with a command like @samp{gcc /plus
1826 /verbose file.cc}, which is equivalent to the command @samp{g++ -v -c
1830 We try to put corresponding binaries and sources on the VMS distribution
1831 tape. But sometimes the binaries will be from an older version than the
1832 sources, because we don't always have time to update them. (Use the
1833 @samp{/version} option to determine the version number of the binaries and
1834 compare it with the source file @file{version.c} to tell whether this is
1835 so.) In this case, you should use the binaries you get to recompile the
1836 sources. If you must recompile, here is how:
1840 Execute the command procedure @file{vmsconfig.com} to set up the files
1841 @file{tm.h}, @file{config.h}, @file{aux-output.c}, and @file{md.}, and
1842 to create files @file{tconfig.h} and @file{hconfig.h}. This procedure
1843 also creates several linker option files used by @file{make-cc1.com} and
1844 a data file used by @file{make-l2.com}.@refill
1851 Setup the logical names and command tables as defined above. In
1852 addition, define the VMS logical name @samp{GNU_BISON} to point at the
1853 to the directories where the Bison executable is kept. This should be
1854 done with the command:@refill
1857 $ assign /system /translation=concealed -
1858 disk:[bison.] gnu_bison
1861 You may, if you choose, use the @file{INSTALL_BISON.COM} script in the
1862 @file{[BISON]} directory.
1865 Install the @samp{BISON} command with the command line:@refill
1868 $ set command /table=sys$common:[syslib]dcltables -
1869 /output=sys$common:[syslib]dcltables -
1870 gnu_bison:[000000]bison
1871 $ install replace sys$common:[syslib]dcltables
1875 Type @samp{@@make-gcc} to recompile everything (alternatively, submit
1876 the file @file{make-gcc.com} to a batch queue). If you wish to build
1877 the GNU C++ compiler as well as the GNU CC compiler, you must first edit
1878 @file{make-gcc.com} and follow the instructions that appear in the
1882 In order to use GCC, you need a library of functions which GCC compiled code
1883 will call to perform certain tasks, and these functions are defined in the
1884 file @file{libgcc2.c}. To compile this you should use the command procedure
1885 @file{make-l2.com}, which will generate the library @file{libgcc2.olb}.
1886 @file{libgcc2.olb} should be built using the compiler built from
1887 the same distribution that @file{libgcc2.c} came from, and
1888 @file{make-gcc.com} will automatically do all of this for you.
1890 To install the library, use the following commands:@refill
1893 $ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
1894 $ library gnu_cc:[000000]gcclib/delete=L_*
1895 $ library libgcc2/extract=*/output=libgcc2.obj
1896 $ library gnu_cc:[000000]gcclib libgcc2.obj
1899 The first command simply removes old modules that will be replaced with
1900 modules from @file{libgcc2} under different module names. The modules
1901 @code{new} and @code{eprintf} may not actually be present in your
1902 @file{gcclib.olb}---if the VMS librarian complains about those modules
1903 not being present, simply ignore the message and continue on with the
1904 next command. The second command removes the modules that came from the
1905 previous version of the library @file{libgcc2.c}.
1907 Whenever you update the compiler on your system, you should also update the
1908 library with the above procedure.
1911 You may wish to build GCC in such a way that no files are written to the
1912 directory where the source files reside. An example would be the when
1913 the source files are on a read-only disk. In these cases, execute the
1914 following DCL commands (substituting your actual path names):
1917 $ assign dua0:[gcc.build_dir.]/translation=concealed, -
1918 dua1:[gcc.source_dir.]/translation=concealed gcc_build
1919 $ set default gcc_build:[000000]
1923 where the directory @file{dua1:[gcc.source_dir]} contains the source
1924 code, and the directory @file{dua0:[gcc.build_dir]} is meant to contain
1925 all of the generated object files and executables. Once you have done
1926 this, you can proceed building GCC as described above. (Keep in mind
1927 that @file{gcc_build} is a rooted logical name, and thus the device
1928 names in each element of the search list must be an actual physical
1929 device name rather than another rooted logical name).
1932 @strong{If you are building GNU CC with a previous version of GNU CC,
1933 you also should check to see that you have the newest version of the
1934 assembler}. In particular, GNU CC version 2 treats global constant
1935 variables slightly differently from GNU CC version 1, and GAS version
1936 1.38.1 does not have the patches required to work with GCC version 2.
1937 If you use GAS 1.38.1, then @code{extern const} variables will not have
1938 the read-only bit set, and the linker will generate warning messages
1939 about mismatched psect attributes for these variables. These warning
1940 messages are merely a nuisance, and can safely be ignored.
1942 If you are compiling with a version of GNU CC older than 1.33, specify
1943 @samp{/DEFINE=("inline=")} as an option in all the compilations. This
1944 requires editing all the @code{gcc} commands in @file{make-cc1.com}.
1945 (The older versions had problems supporting @code{inline}.) Once you
1946 have a working 1.33 or newer GNU CC, you can change this file back.
1949 If you want to build GNU CC with the VAX C compiler, you will need to
1950 make minor changes in @file{make-cccp.com} and @file{make-cc1.com}
1951 to choose alternate definitions of @code{CC}, @code{CFLAGS}, and
1952 @code{LIBS}. See comments in those files. However, you must
1953 also have a working version of the GNU assembler (GNU as, aka GAS) as
1954 it is used as the back-end for GNU CC to produce binary object modules
1955 and is not included in the GNU CC sources. GAS is also needed to
1956 compile @file{libgcc2} in order to build @file{gcclib} (see above);
1957 @file{make-l2.com} expects to be able to find it operational in
1958 @file{gnu_cc:[000000]gnu-as.exe}.
1960 To use GNU CC on VMS, you need the VMS driver programs
1961 @file{gcc.exe}, @file{gcc.com}, and @file{gcc.cld}. They are
1962 distributed with the VMS binaries (@file{gcc-vms}) rather than the
1963 GNU CC sources. GAS is also included in @file{gcc-vms}, as is Bison.
1965 Once you have successfully built GNU CC with VAX C, you should use the
1966 resulting compiler to rebuild itself. Before doing this, be sure to
1967 restore the @code{CC}, @code{CFLAGS}, and @code{LIBS} definitions in
1968 @file{make-cccp.com} and @file{make-cc1.com}. The second generation
1969 compiler will be able to take advantage of many optimizations that must
1970 be suppressed when building with other compilers.
1973 Under previous versions of GNU CC, the generated code would occasionally
1974 give strange results when linked with the sharable @file{VAXCRTL} library.
1975 Now this should work.
1977 Even with this version, however, GNU CC itself should not be linked with
1978 the sharable @file{VAXCRTL}. The version of @code{qsort} in
1979 @file{VAXCRTL} has a bug (known to be present in VMS versions V4.6
1980 through V5.5) which causes the compiler to fail.
1982 The executables are generated by @file{make-cc1.com} and
1983 @file{make-cccp.com} use the object library version of @file{VAXCRTL} in
1984 order to make use of the @code{qsort} routine in @file{gcclib.olb}. If
1985 you wish to link the compiler executables with the shareable image
1986 version of @file{VAXCRTL}, you should edit the file @file{tm.h} (created
1987 by @file{vmsconfig.com}) to define the macro @code{QSORT_WORKAROUND}.
1989 @code{QSORT_WORKAROUND} is always defined when GNU CC is compiled with
1990 VAX C, to avoid a problem in case @file{gcclib.olb} is not yet
1994 @section @code{collect2}
1996 GNU CC uses a utility called @code{collect2} on nearly all systems to arrange
1997 to call various initialization functions at start time.
1999 The program @code{collect2} works by linking the program once and
2000 looking through the linker output file for symbols with particular names
2001 indicating they are constructor functions. If it finds any, it
2002 creates a new temporary @samp{.c} file containing a table of them,
2003 compiles it, and links the program a second time including that file.
2006 @cindex constructors, automatic calls
2007 The actual calls to the constructors are carried out by a subroutine
2008 called @code{__main}, which is called (automatically) at the beginning
2009 of the body of @code{main} (provided @code{main} was compiled with GNU
2010 CC). Calling @code{__main} is necessary, even when compiling C code, to
2011 allow linking C and C++ object code together. (If you use
2012 @samp{-nostdlib}, you get an unresolved reference to @code{__main},
2013 since it's defined in the standard GCC library. Include @samp{-lgcc} at
2014 the end of your compiler command line to resolve this reference.)
2016 The program @code{collect2} is installed as @code{ld} in the directory
2017 where the passes of the compiler are installed. When @code{collect2}
2018 needs to find the @emph{real} @code{ld}, it tries the following file
2023 @file{real-ld} in the directories listed in the compiler's search
2027 @file{real-ld} in the directories listed in the environment variable
2031 The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
2035 @file{ld} in the compiler's search directories, except that
2036 @code{collect2} will not execute itself recursively.
2039 @file{ld} in @code{PATH}.
2042 ``The compiler's search directories'' means all the directories where
2043 @code{gcc} searches for passes of the compiler. This includes
2044 directories that you specify with @samp{-B}.
2046 Cross-compilers search a little differently:
2050 @file{real-ld} in the compiler's search directories.
2053 @file{@var{target}-real-ld} in @code{PATH}.
2056 The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
2060 @file{ld} in the compiler's search directories.
2063 @file{@var{target}-ld} in @code{PATH}.
2066 @code{collect2} explicitly avoids running @code{ld} using the file name
2067 under which @code{collect2} itself was invoked. In fact, it remembers
2068 up a list of such names---in case one copy of @code{collect2} finds
2069 another copy (or version) of @code{collect2} installed as @code{ld} in a
2070 second place in the search path.
2072 @code{collect2} searches for the utilities @code{nm} and @code{strip}
2073 using the same algorithm as above for @code{ld}.
2076 @section Standard Header File Directories
2078 @code{GCC_INCLUDE_DIR} means the same thing for native and cross. It is
2079 where GNU CC stores its private include files, and also where GNU CC
2080 stores the fixed include files. A cross compiled GNU CC runs
2081 @code{fixincludes} on the header files in @file{$(tooldir)/include}.
2082 (If the cross compilation header files need to be fixed, they must be
2083 installed before GNU CC is built. If the cross compilation header files
2084 are already suitable for ISO C and GNU CC, nothing special need be
2087 @code{GPLUSPLUS_INCLUDE_DIR} means the same thing for native and cross. It
2088 is where @code{g++} looks first for header files. The C++ library
2089 installs only target independent header files in that directory.
2091 @code{LOCAL_INCLUDE_DIR} is used only for a native compiler. It is
2092 normally @file{/usr/local/include}. GNU CC searches this directory so
2093 that users can install header files in @file{/usr/local/include}.
2095 @code{CROSS_INCLUDE_DIR} is used only for a cross compiler. GNU CC
2096 doesn't install anything there.
2098 @code{TOOL_INCLUDE_DIR} is used for both native and cross compilers. It
2099 is the place for other packages to install header files that GNU CC will
2100 use. For a cross-compiler, this is the equivalent of
2101 @file{/usr/include}. When you build a cross-compiler,
2102 @code{fixincludes} processes any header files in this directory.