1 This file documents the installation of the GNU compiler. Copyright
2 (C) 1988, 1989, 1992, 1994, 1995 Free Software Foundation, Inc. You
3 may copy, distribute, and modify it freely as long as you preserve this
4 copyright notice and permission notice.
9 Note most of this information is out of date and superseded by the
10 EGCS install procedures. It is provided for historical reference only.
12 Here is the procedure for installing GNU CC on a GNU or Unix system.
13 See *Note VMS Install::, for VMS systems. In this section we assume you
14 compile in the same directory that contains the source files; see *Note
15 Other Dir::, to find out how to compile in a separate directory on Unix
18 You cannot install GNU C by itself on MSDOS; it will not compile
19 under any MSDOS compiler except itself. You need to get the complete
20 compilation package DJGPP, which includes binaries as well as sources,
21 and includes all the necessary compilation tools and libraries.
23 1. If you have built GNU CC previously in the same directory for a
24 different target machine, do `make distclean' to delete all files
25 that might be invalid. One of the files this deletes is
26 `Makefile'; if `make distclean' complains that `Makefile' does not
27 exist, it probably means that the directory is already suitably
30 2. On a System V release 4 system, make sure `/usr/bin' precedes
31 `/usr/ucb' in `PATH'. The `cc' command in `/usr/ucb' uses
32 libraries which have bugs.
34 3. Make sure the Bison parser generator is installed. (This is
35 unnecessary if the Bison output file `c-parse.c' is more recent
36 than `c-parse.y',and you do not plan to change the `.y' file.)
38 Bison versions older than Sept 8, 1988 will produce incorrect
39 output for `c-parse.c'.
41 4. If you have chosen a configuration for GNU CC which requires other
42 GNU tools (such as GAS or the GNU linker) instead of the standard
43 system tools, install the required tools in the build directory
44 under the names `as', `ld' or whatever is appropriate. This will
45 enable the compiler to find the proper tools for compilation of
46 the program `enquire'.
48 Alternatively, you can do subsequent compilation using a value of
49 the `PATH' environment variable such that the necessary GNU tools
50 come before the standard system tools.
52 5. Specify the host, build and target machine configurations. You do
53 this when you run the `configure' script.
55 The "build" machine is the system which you are using, the "host"
56 machine is the system where you want to run the resulting compiler
57 (normally the build machine), and the "target" machine is the
58 system for which you want the compiler to generate code.
60 If you are building a compiler to produce code for the machine it
61 runs on (a native compiler), you normally do not need to specify
62 any operands to `configure'; it will try to guess the type of
63 machine you are on and use that as the build, host and target
64 machines. So you don't need to specify a configuration when
65 building a native compiler unless `configure' cannot figure out
66 what your configuration is or guesses wrong.
68 In those cases, specify the build machine's "configuration name"
69 with the `--host' option; the host and target will default to be
70 the same as the host machine. (If you are building a
71 cross-compiler, see *Note Cross-Compiler::.)
75 ./configure --host=sparc-sun-sunos4.1
77 A configuration name may be canonical or it may be more or less
80 A canonical configuration name has three parts, separated by
81 dashes. It looks like this: `CPU-COMPANY-SYSTEM'. (The three
82 parts may themselves contain dashes; `configure' can figure out
83 which dashes serve which purpose.) For example,
84 `m68k-sun-sunos4.1' specifies a Sun 3.
86 You can also replace parts of the configuration by nicknames or
87 aliases. For example, `sun3' stands for `m68k-sun', so
88 `sun3-sunos4.1' is another way to specify a Sun 3. You can also
89 use simply `sun3-sunos', since the version of SunOS is assumed by
90 default to be version 4.
92 You can specify a version number after any of the system types,
93 and some of the CPU types. In most cases, the version is
94 irrelevant, and will be ignored. So you might as well specify the
95 version if you know it.
97 See *Note Configurations::, for a list of supported configuration
98 names and notes on many of the configurations. You should check
99 the notes in that section before proceeding any further with the
100 installation of GNU CC.
102 6. When running `configure', you may also need to specify certain
103 additional options that describe variant hardware and software
104 configurations. These are `--with-gnu-as', `--with-gnu-ld',
105 `--with-stabs' and `--nfp'.
108 If you will use GNU CC with the GNU assembler (GAS), you
109 should declare this by using the `--with-gnu-as' option when
112 Using this option does not install GAS. It only modifies the
113 output of GNU CC to work with GAS. Building and installing
116 Conversely, if you *do not* wish to use GAS and do not specify
117 `--with-gnu-as' when building GNU CC, it is up to you to make
118 sure that GAS is not installed. GNU CC searches for a
119 program named `as' in various directories; if the program it
120 finds is GAS, then it runs GAS. If you are not sure where
121 GNU CC finds the assembler it is using, try specifying `-v'
124 The systems where it makes a difference whether you use GAS
126 `hppa1.0-ANY-ANY', `hppa1.1-ANY-ANY', `i386-ANY-sysv',
128 `i860-ANY-bsd', `m68k-bull-sysv',
129 `m68k-hp-hpux', `m68k-sony-bsd',
130 `m68k-altos-sysv', `m68000-hp-hpux',
131 `m68000-att-sysv', `ANY-lynx-lynxos', and `mips-ANY'). On
132 any other system, `--with-gnu-as' has no effect.
134 On the systems listed above (except for the HP-PA, for ISC on
135 the 386, and for `mips-sgi-irix5.*'), if you use GAS, you
136 should also use the GNU linker (and specify `--with-gnu-ld').
139 Specify the option `--with-gnu-ld' if you plan to use the GNU
142 This option does not cause the GNU linker to be installed; it
143 just modifies the behavior of GNU CC to work with the GNU
147 On MIPS based systems and on Alphas, you must specify whether
148 you want GNU CC to create the normal ECOFF debugging format,
149 or to use BSD-style stabs passed through the ECOFF symbol
150 table. The normal ECOFF debug format cannot fully handle
151 languages other than C. BSD stabs format can handle other
152 languages, but it only works with the GNU debugger GDB.
154 Normally, GNU CC uses the ECOFF debugging format by default;
155 if you prefer BSD stabs, specify `--with-stabs' when you
158 No matter which default you choose when you configure GNU CC,
159 the user can use the `-gcoff' and `-gstabs+' options to
160 specify explicitly the debug format for a particular
163 `--with-stabs' is meaningful on the ISC system on the 386,
164 also, if `--with-gas' is used. It selects use of stabs
165 debugging information embedded in COFF output. This kind of
166 debugging information supports C++ well; ordinary COFF
167 debugging information does not.
169 `--with-stabs' is also meaningful on 386 systems running
170 SVR4. It selects use of stabs debugging information embedded
171 in ELF output. The C++ compiler currently (2.6.0) does not
172 support the DWARF debugging information normally used on 386
173 SVR4 platforms; stabs provide a workable alternative. This
174 requires gas and gdb, as the normal SVR4 tools can not
175 generate or interpret stabs.
178 On certain systems, you must specify whether the machine has
179 a floating point unit. These systems include
180 `m68k-sun-sunosN' and `m68k-isi-bsd'. On any other system,
181 `--nfp' currently has no effect, though perhaps there are
182 other systems where it could usefully make a difference.
186 Use `--enable-haifa' to enable use of an experimental
187 instruction scheduler (from IBM Haifa). This may or may not
188 produce better code. Some targets on which it is known to be
189 a win enable it by default; use `--disable-haifa' to disable
190 it in these cases. `configure' will print out whether the
191 Haifa scheduler is enabled when it is run.
193 `--enable-threads=TYPE'
194 Certain systems, notably Linux-based GNU systems, can't be
195 relied on to supply a threads facility for the Objective C
196 runtime and so will default to single-threaded runtime. They
197 may, however, have a library threads implementation
198 available, in which case threads can be enabled with this
199 option by supplying a suitable TYPE, probably `posix'. The
200 possibilities for TYPE are `single', `posix', `win32',
201 `solaris', `irix' and `mach'.
204 When you specify this option, the compiler is built to
205 perform checking of tree node types when referencing fields
206 of that node. This does not change the generated code, but
207 adds error checking within the compiler. This will slow down
208 the compiler and may only work properly if you are building
209 the compiler with GNU C.
211 The `configure' script searches subdirectories of the source
212 directory for other compilers that are to be integrated into
213 GNU CC. The GNU compiler for C++, called G++ is in a
214 subdirectory named `cp'. `configure' inserts rules into
215 `Makefile' to build all of those compilers.
217 Here we spell out what files will be set up by `configure'.
218 Normally you need not be concerned with these files.
220 * A file named `config.h' is created that contains a
221 `#include' of the top-level config file for the machine
222 you will run the compiler on (*note The Configuration
223 File: (gcc.info)Config.). This file is responsible for
224 defining information about the host machine. It
227 The top-level config file is located in the subdirectory
228 `config'. Its name is always `xm-SOMETHING.h'; usually
229 `xm-MACHINE.h', but there are some exceptions.
231 If your system does not support symbolic links, you
232 might want to set up `config.h' to contain a `#include'
233 command which refers to the appropriate file.
235 * A file named `tconfig.h' is created which includes the
236 top-level config file for your target machine. This is
237 used for compiling certain programs to run on that
240 * A file named `tm.h' is created which includes the
241 machine-description macro file for your target machine.
242 It should be in the subdirectory `config' and its name
243 is often `MACHINE.h'.
247 The `--enable-nls' option enables Native Language Support
248 (NLS), which lets GCC output diagnostics in languages other
249 than American English. Native Language Support is enabled by
250 default if not doing a canadian cross build. The
251 `--disable-nls' option disables NLS.
253 `--with-included-gettext'
254 If NLS is enbled, the `--with-included-gettext' option causes
255 the build procedure to prefer its copy of GNU `gettext'. This
256 is the default. If you want the GCC build procedure to prefer
257 the host's `gettext' libraries, use
258 `--without-included-gettext'.
261 If NLS is enabled, and if the host lacks `gettext' but has the
262 inferior `catgets' interface, the GCC build procedure normally
263 ignores `catgets' and instead uses GCC's copy of the GNU
264 `gettext' library. The `--with-catgets' option causes the
265 build procedure to use the host's `catgets' in this situation.
267 `--enable-maintainer-mode'
268 The build rules that regenerate the GCC master message catalog
269 `gcc.pot' are normally disabled. This is because it can only
270 be rebuilt if the complete source tree is present. If you
271 have changed the sources and want to rebuild the catalog,
272 configuring with `--enable-maintainer-mode' will enable this.
273 Note that you need a special version of the `gettext' tools
276 `--enable-win32-registry'
277 `--enable-win32-registry=KEY'
278 `--disable-win32-registry'
279 The `--enable-win32-registry' option enables Windows-hosted
280 GCC to look up installations paths in the registry using the
283 `HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\<KEY>'
285 <KEY> defaults to GCC version number, and can be overridden
286 by the `--enable-win32-registry=KEY' option. Vendors and
287 distributors who use custom installers are encouraged to
288 provide a different key, perhaps one comprised of vendor name
289 and GCC version number, to avoid conflict with existing
290 installations. This feature is enabled by default, and can be
291 disabled by `--disable-win32-registry' option. This option
292 has no effect on the other hosts.
294 7. In certain cases, you should specify certain other options when
297 * The standard directory for installing GNU CC is
298 `/usr/local/lib'. If you want to install its files somewhere
299 else, specify `--prefix=DIR' when you run `configure'. Here
300 DIR is a directory name to use instead of `/usr/local' for
301 all purposes with one exception: the directory
302 `/usr/local/include' is searched for header files no matter
303 where you install the compiler. To override this name, use
304 the `--with-local-prefix' option below. The directory you
305 specify need not exist, but its parent directory must exist.
307 * Specify `--with-local-prefix=DIR' if you want the compiler to
308 search directory `DIR/include' for locally installed header
309 files *instead* of `/usr/local/include'.
311 You should specify `--with-local-prefix' *only* if your site
312 has a different convention (not `/usr/local') for where to put
315 The default value for `--with-local-prefix' is `/usr/local'
316 regardless of the value of `--prefix'. Specifying `--prefix'
317 has no effect on which directory GNU CC searches for local
318 header files. This may seem counterintuitive, but actually
321 The purpose of `--prefix' is to specify where to *install GNU
322 CC*. The local header files in `/usr/local/include'--if you
323 put any in that directory--are not part of GNU CC. They are
324 part of other programs--perhaps many others. (GNU CC
325 installs its own header files in another directory which is
326 based on the `--prefix' value.)
328 *Do not* specify `/usr' as the `--with-local-prefix'! The
329 directory you use for `--with-local-prefix' *must not* contain
330 any of the system's standard header files. If it did contain
331 them, certain programs would be miscompiled (including GNU
332 Emacs, on certain targets), because this would override and
333 nullify the header file corrections made by the `fixincludes'
336 Indications are that people who use this option use it based
337 on mistaken ideas of what it is for. People use it as if it
338 specified where to install part of GNU CC. Perhaps they make
339 this assumption because installing GNU CC creates the
342 8. Build the compiler. Just type `make LANGUAGES=c' in the compiler
345 `LANGUAGES=c' specifies that only the C compiler should be
346 compiled. The makefile normally builds compilers for all the
347 supported languages; currently, C, C++, Objective C, Java,
348 FORTRAN, and CHILL. However, C is the only language that is sure
349 to work when you build with other non-GNU C compilers. In
350 addition, building anything but C at this stage is a waste of time.
352 In general, you can specify the languages to build by typing the
353 argument `LANGUAGES="LIST"', where LIST is one or more words from
354 the list `c', `c++', `objective-c', `java', `f77', and `CHILL'.
355 If you have any additional GNU compilers as subdirectories of the
356 GNU CC source directory, you may also specify their names in this
359 Ignore any warnings you may see about "statement not reached" in
360 `insn-emit.c'; they are normal. Also, warnings about "unknown
361 escape sequence" are normal in `genopinit.c' and perhaps some
362 other files. Likewise, you should ignore warnings about "constant
363 is so large that it is unsigned" in `insn-emit.c' and
364 `insn-recog.c', and a warning about a comparison always being zero
365 in `enquire.o'. Any other compilation errors may represent bugs in
366 the port to your machine or operating system, and should be
367 investigated and reported.
369 Some compilers fail to compile GNU CC because they have bugs or
370 limitations. For example, the Microsoft compiler is said to run
371 out of macro space. Some Ultrix compilers run out of expression
372 space; then you need to break up the statement where the problem
375 9. If you are building a cross-compiler, stop here. *Note
378 10. Move the first-stage object files and executables into a
379 subdirectory with this command:
383 The files are moved into a subdirectory named `stage1'. Once
384 installation is complete, you may wish to delete these files with
387 11. If you have chosen a configuration for GNU CC which requires other
388 GNU tools (such as GAS or the GNU linker) instead of the standard
389 system tools, install the required tools in the `stage1'
390 subdirectory under the names `as', `ld' or whatever is
391 appropriate. This will enable the stage 1 compiler to find the
392 proper tools in the following stage.
394 Alternatively, you can do subsequent compilation using a value of
395 the `PATH' environment variable such that the necessary GNU tools
396 come before the standard system tools.
398 12. Recompile the compiler with itself, with this command:
400 make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"
402 This is called making the stage 2 compiler.
404 The command shown above builds compilers for all the supported
405 languages. If you don't want them all, you can specify the
406 languages to build by typing the argument `LANGUAGES="LIST"'. LIST
407 should contain one or more words from the list `c', `c++',
408 `objective-c', and `proto'. Separate the words with spaces.
409 `proto' stands for the programs `protoize' and `unprotoize'; they
410 are not a separate language, but you use `LANGUAGES' to enable or
411 disable their installation.
413 If you are going to build the stage 3 compiler, then you might
414 want to build only the C language in stage 2.
416 Once you have built the stage 2 compiler, if you are short of disk
417 space, you can delete the subdirectory `stage1'.
419 On a 68000 or 68020 system lacking floating point hardware, unless
420 you have selected a `tm.h' file that expects by default that there
421 is no such hardware, do this instead:
423 make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float"
425 13. If you wish to test the compiler by compiling it with itself one
426 more time, install any other necessary GNU tools (such as GAS or
427 the GNU linker) in the `stage2' subdirectory as you did in the
428 `stage1' subdirectory, then do this:
431 make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2"
433 This is called making the stage 3 compiler. Aside from the `-B'
434 option, the compiler options should be the same as when you made
435 the stage 2 compiler. But the `LANGUAGES' option need not be the
436 same. The command shown above builds compilers for all the
437 supported languages; if you don't want them all, you can specify
438 the languages to build by typing the argument `LANGUAGES="LIST"',
441 If you do not have to install any additional GNU tools, you may
444 make bootstrap LANGUAGES=LANGUAGE-LIST BOOT_CFLAGS=OPTION-LIST
446 instead of making `stage1', `stage2', and performing the two
449 14. Compare the latest object files with the stage 2 object files--they
450 ought to be identical, aside from time stamps (if any).
452 On some systems, meaningful comparison of object files is
453 impossible; they always appear "different." This is currently
454 true on Solaris and some systems that use ELF object file format.
455 On some versions of Irix on SGI machines and DEC Unix (OSF/1) on
456 Alpha systems, you will not be able to compare the files without
457 specifying `-save-temps'; see the description of individual
458 systems above to see if you get comparison failures. You may have
459 similar problems on other systems.
461 Use this command to compare the files:
465 This will mention any object files that differ between stage 2 and
466 stage 3. Any difference, no matter how innocuous, indicates that
467 the stage 2 compiler has compiled GNU CC incorrectly, and is
468 therefore a potentially serious bug which you should investigate
471 If your system does not put time stamps in the object files, then
472 this is a faster way to compare them (using the Bourne shell):
475 cmp $file stage2/$file
478 If you have built the compiler with the `-mno-mips-tfile' option on
479 MIPS machines, you will not be able to compare the files.
481 15. Install the compiler driver, the compiler's passes and run-time
482 support with `make install'. Use the same value for `CC',
483 `CFLAGS' and `LANGUAGES' that you used when compiling the files
484 that are being installed. One reason this is necessary is that
485 some versions of Make have bugs and recompile files gratuitously
486 when you do this step. If you use the same variable values, those
487 files will be recompiled properly.
489 For example, if you have built the stage 2 compiler, you can use
490 the following command:
492 make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="LIST"
494 This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1',
495 `cpp' and `libgcc.a' in the directory
496 `/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the
497 compiler driver program looks for them. Here TARGET is the
498 canonicalized form of target machine type specified when you ran
499 `configure', and VERSION is the version number of GNU CC. This
500 naming scheme permits various versions and/or cross-compilers to
501 coexist. It also copies the executables for compilers for other
502 languages (e.g., `cc1plus' for C++) to the same directory.
504 This also copies the driver program `xgcc' into
505 `/usr/local/bin/gcc', so that it appears in typical execution
506 search paths. It also copies `gcc.1' into `/usr/local/man/man1'
507 and info pages into `/usr/local/info'.
509 On some systems, this command causes recompilation of some files.
510 This is usually due to bugs in `make'. You should either ignore
511 this problem, or use GNU Make.
513 *Warning: there is a bug in `alloca' in the Sun library. To avoid
514 this bug, be sure to install the executables of GNU CC that were
515 compiled by GNU CC. (That is, the executables from stage 2 or 3,
516 not stage 1.) They use `alloca' as a built-in function and never
517 the one in the library.*
519 (It is usually better to install GNU CC executables from stage 2
520 or 3, since they usually run faster than the ones compiled with
521 some other compiler.)
523 16. If you're going to use C++, you need to install the C++ runtime
524 library. This includes all I/O functionality, special class
527 The standard C++ runtime library for GNU CC is called `libstdc++'.
528 An obsolescent library `libg++' may also be available, but it's
529 necessary only for older software that hasn't been converted yet;
530 if you don't know whether you need `libg++' then you probably don't
533 Here's one way to build and install `libstdc++' for GNU CC:
535 * Build and install GNU CC, so that invoking `gcc' obtains the
536 GNU CC that was just built.
538 * Obtain a copy of a compatible `libstdc++' distribution. For
539 example, the `libstdc++-2.8.0.tar.gz' distribution should be
540 compatible with GCC 2.8.0. GCC distributors normally
541 distribute `libstdc++' as well.
543 * Set the `CXX' environment variable to `gcc' while running the
544 `libstdc++' distribution's `configure' command. Use the same
545 `configure' options that you used when you invoked GCC's
548 * Invoke `make' to build the C++ runtime.
550 * Invoke `make install' to install the C++ runtime.
552 To summarize, after building and installing GNU CC, invoke the
553 following shell commands in the topmost directory of the C++
554 library distribution. For CONFIGURE-OPTIONS, use the same options
555 that you used to configure GNU CC.
557 $ CXX=gcc ./configure CONFIGURE-OPTIONS
561 17. GNU CC includes a runtime library for Objective-C because it is an
562 integral part of the language. You can find the files associated
563 with the library in the subdirectory `objc'. The GNU Objective-C
564 Runtime Library requires header files for the target's C library in
565 order to be compiled,and also requires the header files for the
566 target's thread library if you want thread support. *Note
567 Cross-Compilers and Header Files: Cross Headers, for discussion
568 about header files issues for cross-compilation.
570 When you run `configure', it picks the appropriate Objective-C
571 thread implementation file for the target platform. In some
572 situations, you may wish to choose a different back-end as some
573 platforms support multiple thread implementations or you may wish
574 to disable thread support completely. You do this by specifying a
575 value for the OBJC_THREAD_FILE makefile variable on the command
576 line when you run make, for example:
578 make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" OBJC_THREAD_FILE=thr-single
580 Below is a list of the currently available back-ends.
582 * thr-single Disable thread support, should work for all
585 * thr-decosf1 DEC OSF/1 thread support.
587 * thr-irix SGI IRIX thread support.
589 * thr-mach Generic MACH thread support, known to work on
592 * thr-os2 IBM OS/2 thread support.
594 * thr-posix Generix POSIX thread support.
596 * thr-pthreads PCThreads on Linux-based GNU systems.
598 * thr-solaris SUN Solaris thread support.
600 * thr-win32 Microsoft Win32 API thread support.
602 Files Created by `configure'
603 ============================
605 Here we spell out what files will be set up by `configure'. Normally
606 you need not be concerned with these files.
608 * A file named `config.h' is created that contains a `#include' of
609 the top-level config file for the machine you will run the compiler
610 on (*note The Configuration File: (gcc.info)Config.). This file
611 is responsible for defining information about the host machine.
614 The top-level config file is located in the subdirectory `config'.
615 Its name is always `xm-SOMETHING.h'; usually `xm-MACHINE.h', but
616 there are some exceptions.
618 If your system does not support symbolic links, you might want to
619 set up `config.h' to contain a `#include' command which refers to
620 the appropriate file.
622 * A file named `tconfig.h' is created which includes the top-level
623 config file for your target machine. This is used for compiling
624 certain programs to run on that machine.
626 * A file named `tm.h' is created which includes the
627 machine-description macro file for your target machine. It should
628 be in the subdirectory `config' and its name is often `MACHINE.h'.
630 * The command file `configure' also constructs the file `Makefile'
631 by adding some text to the template file `Makefile.in'. The
632 additional text comes from files in the `config' directory, named
633 `t-TARGET' and `x-HOST'. If these files do not exist, it means
634 nothing needs to be added for a given target or host.
636 Configurations Supported by GNU CC
637 ==================================
639 Here are the possible CPU types:
641 1750a, a29k, alpha, arm, avr, cN, clipper, dsp16xx, elxsi, fr30,
642 h8300, hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860,
643 i960, m32r, m68000, m68k, m88k, mcore, mips, mipsel, mips64,
644 mips64el, mn10200, mn10300, ns32k, pdp11, powerpc, powerpcle,
645 romp, rs6000, sh, sparc, sparclite, sparc64, v850, vax, we32k.
647 Here are the recognized company names. As you can see, customary
648 abbreviations are used rather than the longer official names.
650 acorn, alliant, altos, apollo, apple, att, bull, cbm, convergent,
651 convex, crds, dec, dg, dolphin, elxsi, encore, harris, hitachi,
652 hp, ibm, intergraph, isi, mips, motorola, ncr, next, ns, omron,
653 plexus, sequent, sgi, sony, sun, tti, unicom, wrs.
655 The company name is meaningful only to disambiguate when the rest of
656 the information supplied is insufficient. You can omit it, writing
657 just `CPU-SYSTEM', if it is not needed. For example, `vax-ultrix4.2'
658 is equivalent to `vax-dec-ultrix4.2'.
660 Here is a list of system types:
662 386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff,
663 ctix, cxux, dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms,
664 genix, gnu, linux, linux-gnu, hiux, hpux, iris, irix, isc, luna,
665 lynxos, mach, minix, msdos, mvs, netbsd, newsos, nindy, ns, osf,
666 osfrose, ptx, riscix, riscos, rtu, sco, sim, solaris, sunos, sym,
667 sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta, vxworks,
670 You can omit the system type; then `configure' guesses the operating
671 system from the CPU and company.
673 You can add a version number to the system type; this may or may not
674 make a difference. For example, you can write `bsd4.3' or `bsd4.4' to
675 distinguish versions of BSD. In practice, the version number is most
676 needed for `sysv3' and `sysv4', which are often treated differently.
678 `linux-gnu' is the canonical name for the GNU/Linux target; however
679 GNU CC will also accept `linux'. The version of the kernel in use is
680 not relevant on these systems. A suffix such as `libc1' or `aout'
681 distinguishes major versions of the C library; all of the suffixed
682 versions are obsolete.
684 If you specify an impossible combination such as `i860-dg-vms', then
685 you may get an error message from `configure', or it may ignore part of
686 the information and do the best it can with the rest. `configure'
687 always prints the canonical name for the alternative that it used. GNU
688 CC does not support all possible alternatives.
690 Often a particular model of machine has a name. Many machine names
691 are recognized as aliases for CPU/company combinations. Thus, the
692 machine name `sun3', mentioned above, is an alias for `m68k-sun'.
693 Sometimes we accept a company name as a machine name, when the name is
694 popularly used for a particular machine. Here is a table of the known
697 3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300,
698 balance, convex-cN, crds, decstation-3100, decstation, delta,
699 encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN,
700 hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe,
701 mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc,
702 powerpcle, ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3,
703 sun4, symmetry, tower-32, tower.
705 Remember that a machine name specifies both the cpu type and the company
706 name. If you want to install your own homemade configuration files,
707 you can use `local' as the company name to access them. If you use
708 configuration `CPU-local', the configuration name without the cpu prefix
709 is used to form the configuration file names.
711 Thus, if you specify `m68k-local', configuration uses files
712 `m68k.md', `local.h', `m68k.c', `xm-local.h', `t-local', and `x-local',
713 all in the directory `config/m68k'.
715 Here is a list of configurations that have special treatment or
716 special things you must know:
719 MIL-STD-1750A processors.
721 The MIL-STD-1750A cross configuration produces output for
722 `as1750', an assembler/linker available under the GNU Public
723 License for the 1750A. `as1750' can be obtained at
724 *ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/*. A similarly
725 licensed simulator for the 1750A is available from same address.
727 You should ignore a fatal error during the building of libgcc
728 (libgcc is not yet implemented for the 1750A.)
730 The `as1750' assembler requires the file `ms1750.inc', which is
731 found in the directory `config/1750a'.
733 GNU CC produced the same sections as the Fairchild F9450 C
737 The program code section.
740 The read/write (RAM) data section.
743 The read-only (ROM) constants section.
746 Initialization section (code to copy KREL to SREL).
748 The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16).
749 This means that type `char' is represented with a 16-bit word per
750 character. The 1750A's "Load/Store Upper/Lower Byte" instructions
751 are not used by GNU CC.
754 Systems using processors that implement the DEC Alpha architecture
755 and are running the DEC Unix (OSF/1) operating system, for example
756 the DEC Alpha AXP systems.CC.)
758 GNU CC writes a `.verstamp' directive to the assembler output file
759 unless it is built as a cross-compiler. It gets the version to
760 use from the system header file `/usr/include/stamp.h'. If you
761 install a new version of DEC Unix, you should rebuild GCC to pick
762 up the new version stamp.
764 Note that since the Alpha is a 64-bit architecture,
765 cross-compilers from 32-bit machines will not generate code as
766 efficient as that generated when the compiler is running on a
767 64-bit machine because many optimizations that depend on being
768 able to represent a word on the target in an integral value on the
769 host cannot be performed. Building cross-compilers on the Alpha
770 for 32-bit machines has only been tested in a few cases and may
773 `make compare' may fail on old versions of DEC Unix unless you add
774 `-save-temps' to `CFLAGS'. On these systems, the name of the
775 assembler input file is stored in the object file, and that makes
776 comparison fail if it differs between the `stage1' and `stage2'
777 compilations. The option `-save-temps' forces a fixed name to be
778 used for the assembler input file, instead of a randomly chosen
779 name in `/tmp'. Do not add `-save-temps' unless the comparisons
780 fail without that option. If you add `-save-temps', you will have
781 to manually delete the `.i' and `.s' files after each series of
784 GNU CC now supports both the native (ECOFF) debugging format used
785 by DBX and GDB and an encapsulated STABS format for use only with
786 GDB. See the discussion of the `--with-stabs' option of
787 `configure' above for more information on these formats and how to
790 There is a bug in DEC's assembler that produces incorrect line
791 numbers for ECOFF format when the `.align' directive is used. To
792 work around this problem, GNU CC will not emit such alignment
793 directives while writing ECOFF format debugging information even
794 if optimization is being performed. Unfortunately, this has the
795 very undesirable side-effect that code addresses when `-O' is
796 specified are different depending on whether or not `-g' is also
799 To avoid this behavior, specify `-gstabs+' and use GDB instead of
800 DBX. DEC is now aware of this problem with the assembler and
801 hopes to provide a fix shortly.
804 Argonaut ARC processor. This configuration is intended for
808 Advanced RISC Machines ARM-family processors. These are often
809 used in embedded applications. There are no standard Unix
810 configurations. This configuration corresponds to the basic
811 instruction sequences and will produce `a.out' format object
814 You may need to make a variant of the file `arm.h' for your
815 particular configuration.
818 This configuration is intended for embedded systems.
821 Any of the ARM-family processors running the Linux-based GNU
822 system with the `a.out' binary format. This is an obsolete
828 Any of the ARM-family processors running the Linux-based GNU
829 system with the `ELF' binary format. You must use version
830 2.9.1.0.22 or later of the GNU/Linux binutils, which you can
831 download from `ftp.varesearch.com:/pub/support/hjl/binutils'.
833 These two configurations differ only in the required version of GNU
834 binutils. For binutils 2.9.1.0.x, use `arm-*-linux-gnuoldld'. For
835 newer versions of binutils, use `arm-*-linux-gnu'.
838 The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD
839 Unix. If you are running a version of RISC iX prior to 1.2 then
840 you must specify the version number during configuration. Note
841 that the assembler shipped with RISC iX does not support stabs
842 debugging information; a new version of the assembler, with stabs
843 support included, is now available from Acorn and via ftp
844 `ftp.acorn.com:/pub/riscix/as+xterm.tar.Z'. To enable stabs
845 debugging, pass `--with-gnu-as' to configure.
847 You will need to install GNU `sed' before you can run configure.
850 AMD Am29k-family processors. These are normally used in embedded
851 applications. There are no standard Unix configurations. This
852 configuration corresponds to AMD's standard calling sequence and
853 binary interface and is compatible with other 29k tools.
855 You may need to make a variant of the file `a29k.h' for your
856 particular configuration.
859 AMD Am29050 used in a system running a variant of BSD Unix.
862 ATMEL AVR-family micro controllers. These are used in embedded
863 applications. There are no standard Unix configurations.
864 Supports following MCU's: - AT90S23xx - ATtiny22 - AT90S44xx -
865 AT90S85xx - ATmega603/603L - ATmega103/103L
868 MIPS-based DECstations can support three different personalities:
869 Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products
870 have a configuration name beginning with `alpha-dec'.) To
871 configure GCC for these platforms use the following configurations:
874 Ultrix configuration.
877 Dec's version of OSF/1.
880 Open Software Foundation reference port of OSF/1 which uses
881 the OSF/rose object file format instead of ECOFF. Normally,
882 you would not select this configuration.
884 The MIPS C compiler needs to be told to increase its table size
885 for switch statements with the `-Wf,-XNg1500' option in order to
886 compile `cp/parse.c'. If you use the `-O2' optimization option,
887 you also need to use `-Olimit 3000'. Both of these options are
888 automatically generated in the `Makefile' that the shell script
889 `configure' builds. If you override the `CC' make variable and
890 use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
894 The Elxsi's C compiler has known limitations that prevent it from
895 compiling GNU C. Please contact `mrs@cygnus.com' for more details.
898 A port to the AT&T DSP1610 family of processors.
901 Hitachi H8/300 series of processors.
903 The calling convention and structure layout has changed in release
904 2.6. All code must be recompiled. The calling convention now
905 passes the first three arguments in function calls in registers.
906 Structures are no longer a multiple of 2 bytes.
909 There are several variants of the HP-PA processor which run a
910 variety of operating systems. GNU CC must be configured to use
911 the correct processor type and operating system, or GNU CC will
912 not function correctly. The easiest way to handle this problem is
913 to *not* specify a target when configuring GNU CC, the `configure'
914 script will try to automatically determine the right processor
915 type and operating system.
917 `-g' does not work on HP-UX, since that system uses a peculiar
918 debugging format which GNU CC does not know about. However, `-g'
919 will work if you also use GAS and GDB in conjunction with GCC. We
920 highly recommend using GAS for all HP-PA configurations.
922 You should be using GAS-2.6 (or later) along with GDB-4.16 (or
923 later). These can be retrieved from all the traditional GNU ftp
926 On some versions of HP-UX, you will need to install GNU `sed'.
928 You will need to be install GAS into a directory before `/bin',
929 `/usr/bin', and `/usr/ccs/bin' in your search path. You should
930 install GAS before you build GNU CC.
932 To enable debugging, you must configure GNU CC with the
933 `--with-gnu-as' option before building.
936 This port is very preliminary and has many known bugs. We hope to
937 have a higher-quality port for this machine soon.
940 Use this configuration to generate `a.out' binaries on Linux-based
941 GNU systems if you do not have gas/binutils version 2.5.2 or later
942 installed. This is an obsolete configuration.
945 Use this configuration to generate `a.out' binaries on Linux-based
946 GNU systems. This configuration is being superseded. You must use
947 gas/binutils version 2.5.2 or later.
951 Use this configuration to generate ELF binaries on Linux-based GNU
952 systems. You must use gas/binutils version 2.5.2 or later.
955 Compilation with RCC is recommended. Also, it may be a good idea
956 to link with GNU malloc instead of the malloc that comes with the
960 Use this configuration for SCO release 3.2 version 4.
963 Use this for the SCO OpenServer Release family including 5.0.0,
964 5.0.2, 5.0.4, 5.0.5, Internet FastStart 1.0, and Internet
967 GNU CC can generate COFF binaries if you specify `-mcoff' or ELF
968 binaries, the default. A full `make bootstrap' is recommended
969 so that an ELF compiler that builds ELF is generated.
971 You must have TLS597 from `ftp://ftp.sco.com/TLS' installed for ELF
972 C++ binaries to work correctly on releases before 5.0.4.
974 The native SCO assembler that is provided with the OS at no charge
975 is normally required. If, however, you must be able to use the GNU
976 assembler (perhaps you have complex asms) you must configure this
977 package `--with-gnu-as'. To do this, install (cp or symlink)
978 gcc/as to your copy of the GNU assembler. You must use a recent
979 version of GNU binutils; version 2.9.1 seems to work well. If you
980 select this option, you will be unable to build COFF images.
981 Trying to do so will result in non-obvious failures. In general,
982 the "-with-gnu-as" option isn't as well tested as the native
985 *NOTE:* If you are building C++, you must follow the instructions
986 about invoking `make bootstrap' because the native OpenServer
987 compiler may build a `cc1plus' that will not correctly parse many
988 valid C++ programs. You must do a `make bootstrap' if you are
989 building with the native compiler.
992 It may be a good idea to link with GNU malloc instead of the
993 malloc that comes with the system.
995 In ISC version 4.1, `sed' core dumps when building `deduced.h'.
996 Use the version of `sed' from version 4.0.
999 It may be good idea to link with GNU malloc instead of the malloc
1000 that comes with the system.
1003 You need to use GAS version 2.1 or later, and LD from GNU binutils
1004 version 2.2 or later.
1007 Go to the Berkeley universe before compiling.
1009 `i386-sequent-ptx1*'
1010 `i386-sequent-ptx2*'
1011 You must install GNU `sed' before running `configure'.
1014 You may find that you need another version of GNU CC to begin
1015 bootstrapping with, since the current version when built with the
1016 system's own compiler seems to get an infinite loop compiling part
1017 of `libgcc2.c'. GNU CC version 2 compiled with GNU CC (any
1018 version) seems not to have this problem.
1020 See *Note Sun Install::, for information on installing GNU CC on
1023 `i[345]86-*-winnt3.5'
1024 This version requires a GAS that has not yet been released. Until
1025 it is, you can get a prebuilt binary version via anonymous ftp from
1026 `cs.washington.edu:pub/gnat' or `cs.nyu.edu:pub/gnat'. You must
1027 also use the Microsoft header files from the Windows NT 3.5 SDK.
1028 Find these on the CDROM in the `/mstools/h' directory dated
1029 9/4/94. You must use a fixed version of Microsoft linker made
1030 especially for NT 3.5, which is also is available on the NT 3.5
1031 SDK CDROM. If you do not have this linker, can you also use the
1032 linker from Visual C/C++ 1.0 or 2.0.
1034 Installing GNU CC for NT builds a wrapper linker, called `ld.exe',
1035 which mimics the behaviour of Unix `ld' in the specification of
1036 libraries (`-L' and `-l'). `ld.exe' looks for both Unix and
1037 Microsoft named libraries. For example, if you specify `-lfoo',
1038 `ld.exe' will look first for `libfoo.a' and then for `foo.lib'.
1040 You may install GNU CC for Windows NT in one of two ways,
1041 depending on whether or not you have a Unix-like shell and various
1042 Unix-like utilities.
1044 1. If you do not have a Unix-like shell and few Unix-like
1045 utilities, you will use a DOS style batch script called
1046 `configure.bat'. Invoke it as `configure winnt' from an
1047 MSDOS console window or from the program manager dialog box.
1048 `configure.bat' assumes you have already installed and have
1049 in your path a Unix-like `sed' program which is used to
1050 create a working `Makefile' from `Makefile.in'.
1052 `Makefile' uses the Microsoft Nmake program maintenance
1053 utility and the Visual C/C++ V8.00 compiler to build GNU CC.
1054 You need only have the utilities `sed' and `touch' to use
1055 this installation method, which only automatically builds the
1056 compiler itself. You must then examine what `fixinc.winnt'
1057 does, edit the header files by hand and build `libgcc.a'
1060 2. The second type of installation assumes you are running a
1061 Unix-like shell, have a complete suite of Unix-like utilities
1062 in your path, and have a previous version of GNU CC already
1063 installed, either through building it via the above
1064 installation method or acquiring a pre-built binary. In this
1065 case, use the `configure' script in the normal fashion.
1068 This is the Paragon. If you have version 1.0 of the operating
1069 system, you need to take special steps to build GNU CC due to
1070 peculiarities of the system. Newer system versions have no
1071 problem. See the section `Installation Problems' in the GNU CC
1075 LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
1076 `/bin/gcc'. You should compile with this instead of `/bin/cc'.
1077 You can tell GNU CC to use the GNU assembler and linker, by
1078 specifying `--with-gnu-as --with-gnu-ld' when configuring. These
1079 will produce COFF format object files and executables; otherwise
1080 GNU CC will use the installed tools, which produce `a.out' format
1084 Mitsubishi M32R processor. This configuration is intended for
1088 HP 9000 series 200 running BSD. Note that the C compiler that
1089 comes with this system cannot compile GNU CC; contact
1090 `law@cygnus.com' to get binaries of GNU CC for bootstrapping.
1093 Altos 3068. You must use the GNU assembler, linker and debugger.
1094 Also, you must fix a kernel bug. Details in the file
1098 Apple Macintosh running A/UX. You may configure GCC to use
1099 either the system assembler and linker or the GNU assembler and
1100 linker. You should use the GNU configuration if you can,
1101 especially if you also want to use GNU C++. You enabled that
1102 configuration with + the `--with-gnu-as' and `--with-gnu-ld'
1103 options to `configure'.
1105 Note the C compiler that comes with this system cannot compile GNU
1106 CC. You can find binaries of GNU CC for bootstrapping on
1107 `jagubox.gsfc.nasa.gov'. You will also a patched version of
1108 `/bin/ld' there that raises some of the arbitrary limits found in
1112 AT&T 3b1, a.k.a. 7300 PC. This version of GNU CC cannot be
1113 compiled with the system C compiler, which is too buggy. You will
1114 need to get a previous version of GCC and use it to bootstrap.
1115 Binaries are available from the OSU-CIS archive, at
1116 `ftp://archive.cis.ohio-state.edu/pub/att7300/'.
1119 Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU
1120 CC works either with native assembler or GNU assembler. You can use
1121 GNU assembler with native coff generation by providing
1122 `--with-gnu-as' to the configure script or use GNU assembler with
1123 dbx-in-coff encapsulation by providing `--with-gnu-as --stabs'.
1124 For any problem with native assembler or for availability of the
1125 DPX/2 port of GAS, contact `F.Pierresteguy@frcl.bull.fr'.
1128 Use `configure unos' for building on Unos.
1130 The Unos assembler is named `casm' instead of `as'. For some
1131 strange reason linking `/bin/as' to `/bin/casm' changes the
1132 behavior, and does not work. So, when installing GNU CC, you
1133 should install the following script as `as' in the subdirectory
1134 where the passes of GCC are installed:
1139 The default Unos library is named `libunos.a' instead of `libc.a'.
1140 To allow GNU CC to function, either change all references to
1141 `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to
1144 When compiling GNU CC with the standard compiler, to overcome bugs
1145 in the support of `alloca', do not use `-O' when making stage 2.
1146 Then use the stage 2 compiler with `-O' to make the stage 3
1147 compiler. This compiler will have the same characteristics as the
1148 usual stage 2 compiler on other systems. Use it to make a stage 4
1149 compiler and compare that with stage 3 to verify proper
1152 (Perhaps simply defining `ALLOCA' in `x-crds' as described in the
1153 comments there will make the above paragraph superfluous. Please
1154 inform us of whether this works.)
1156 Unos uses memory segmentation instead of demand paging, so you
1157 will need a lot of memory. 5 Mb is barely enough if no other
1158 tasks are running. If linking `cc1' fails, try putting the object
1159 files into a library and linking from that library.
1162 HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 has a
1163 bug in the assembler that prevents compilation of GNU CC. To fix
1164 it, get patch PHCO_4484 from HP.
1166 In addition, if you wish to use gas `--with-gnu-as' you must use
1167 gas version 2.1 or later, and you must use the GNU linker version
1168 2.1 or later. Earlier versions of gas relied upon a program which
1169 converted the gas output into the native HP-UX format, but that
1170 program has not been kept up to date. gdb does not understand
1171 that native HP-UX format, so you must use gas if you wish to use
1175 Sun 3. We do not provide a configuration file to use the Sun FPA
1176 by default, because programs that establish signal handlers for
1177 floating point traps inherently cannot work with the FPA.
1179 See *Note Sun Install::, for information on installing GNU CC on
1183 Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
1184 These systems tend to use the Green Hills C, revision 1.8.5, as the
1185 standard C compiler. There are apparently bugs in this compiler
1186 that result in object files differences between stage 2 and stage
1187 3. If this happens, make the stage 4 compiler and compare it to
1188 the stage 3 compiler. If the stage 3 and stage 4 object files are
1189 identical, this suggests you encountered a problem with the
1190 standard C compiler; the stage 3 and 4 compilers may be usable.
1192 It is best, however, to use an older version of GNU CC for
1193 bootstrapping if you have one.
1196 Motorola m88k running DG/UX. To build 88open BCS native or cross
1197 compilers on DG/UX, specify the configuration name as
1198 `m88k-*-dguxbcs' and build in the 88open BCS software development
1199 environment. To build ELF native or cross compilers on DG/UX,
1200 specify `m88k-*-dgux' and build in the DG/UX ELF development
1201 environment. You set the software development environment by
1202 issuing `sde-target' command and specifying either `m88kbcs' or
1203 `m88kdguxelf' as the operand.
1205 If you do not specify a configuration name, `configure' guesses the
1206 configuration based on the current software development
1209 `m88k-tektronix-sysv3'
1210 Tektronix XD88 running UTekV 3.2e. Do not turn on optimization
1211 while building stage1 if you bootstrap with the buggy Green Hills
1212 compiler. Also, The bundled LAI System V NFS is buggy so if you
1213 build in an NFS mounted directory, start from a fresh reboot, or
1214 avoid NFS all together. Otherwise you may have trouble getting
1215 clean comparisons between stages.
1218 MIPS machines running the MIPS operating system in BSD mode. It's
1219 possible that some old versions of the system lack the functions
1220 `memcpy', `memcmp', and `memset'. If your system lacks these, you
1221 must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in
1224 The MIPS C compiler needs to be told to increase its table size
1225 for switch statements with the `-Wf,-XNg1500' option in order to
1226 compile `cp/parse.c'. If you use the `-O2' optimization option,
1227 you also need to use `-Olimit 3000'. Both of these options are
1228 automatically generated in the `Makefile' that the shell script
1229 `configure' builds. If you override the `CC' make variable and
1230 use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
1234 The MIPS C compiler needs to be told to increase its table size
1235 for switch statements with the `-Wf,-XNg1500' option in order to
1236 compile `cp/parse.c'. If you use the `-O2' optimization option,
1237 you also need to use `-Olimit 3000'. Both of these options are
1238 automatically generated in the `Makefile' that the shell script
1239 `configure' builds. If you override the `CC' make variable and
1240 use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
1243 MIPS computers running RISC-OS can support four different
1244 personalities: default, BSD 4.3, System V.3, and System V.4 (older
1245 versions of RISC-OS don't support V.4). To configure GCC for
1246 these platforms use the following configurations:
1248 `mips-mips-riscos`rev''
1249 Default configuration for RISC-OS, revision `rev'.
1251 `mips-mips-riscos`rev'bsd'
1252 BSD 4.3 configuration for RISC-OS, revision `rev'.
1254 `mips-mips-riscos`rev'sysv4'
1255 System V.4 configuration for RISC-OS, revision `rev'.
1257 `mips-mips-riscos`rev'sysv'
1258 System V.3 configuration for RISC-OS, revision `rev'.
1260 The revision `rev' mentioned above is the revision of RISC-OS to
1261 use. You must reconfigure GCC when going from a RISC-OS revision
1262 4 to RISC-OS revision 5. This has the effect of avoiding a linker
1266 In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
1267 option must be installed from the CD-ROM supplied from Silicon
1268 Graphics. This is found on the 2nd CD in release 4.0.1.
1270 In order to compile GCC on an SGI running IRIX 5, the
1271 "compiler_dev.hdr" subsystem must be installed from the IDO CD-ROM
1272 supplied by Silicon Graphics.
1274 `make compare' may fail on version 5 of IRIX unless you add
1275 `-save-temps' to `CFLAGS'. On these systems, the name of the
1276 assembler input file is stored in the object file, and that makes
1277 comparison fail if it differs between the `stage1' and `stage2'
1278 compilations. The option `-save-temps' forces a fixed name to be
1279 used for the assembler input file, instead of a randomly chosen
1280 name in `/tmp'. Do not add `-save-temps' unless the comparisons
1281 fail without that option. If you do you `-save-temps', you will
1282 have to manually delete the `.i' and `.s' files after each series
1285 The MIPS C compiler needs to be told to increase its table size
1286 for switch statements with the `-Wf,-XNg1500' option in order to
1287 compile `cp/parse.c'. If you use the `-O2' optimization option,
1288 you also need to use `-Olimit 3000'. Both of these options are
1289 automatically generated in the `Makefile' that the shell script
1290 `configure' builds. If you override the `CC' make variable and
1291 use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
1294 On Irix version 4.0.5F, and perhaps on some other versions as well,
1295 there is an assembler bug that reorders instructions incorrectly.
1296 To work around it, specify the target configuration
1297 `mips-sgi-irix4loser'. This configuration inhibits assembler
1300 In a compiler configured with target `mips-sgi-irix4', you can turn
1301 off assembler optimization by using the `-noasmopt' option. This
1302 compiler option passes the option `-O0' to the assembler, to
1305 The `-noasmopt' option can be useful for testing whether a problem
1306 is due to erroneous assembler reordering. Even if a problem does
1307 not go away with `-noasmopt', it may still be due to assembler
1308 reordering--perhaps GNU CC itself was miscompiled as a result.
1310 To enable debugging under Irix 5, you must use GNU as 2.5 or later,
1311 and use the `--with-gnu-as' configure option when configuring gcc.
1312 GNU as is distributed as part of the binutils package.
1315 Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2
1316 (which uses ELF instead of COFF). Support for 5.0.2 will probably
1317 be provided soon by volunteers. In particular, the linker does
1318 not like the code generated by GCC when shared libraries are
1322 Encore ns32000 system. Encore systems are supported only under
1326 National Semiconductor ns32000 system. Genix has bugs in `alloca'
1327 and `malloc'; you must get the compiled versions of these from GNU
1331 Go to the Berkeley universe before compiling.
1334 UTEK ns32000 system ("merlin"). The C compiler that comes with
1335 this system cannot compile GNU CC; contact `tektronix!reed!mason'
1336 to get binaries of GNU CC for bootstrapping.
1340 The only operating systems supported for the IBM RT PC are AOS and
1341 MACH. GNU CC does not support AIX running on the RT. We
1342 recommend you compile GNU CC with an earlier version of itself; if
1343 you compile GNU CC with `hc', the Metaware compiler, it will work,
1344 but you will get mismatches between the stage 2 and stage 3
1345 compilers in various files. These errors are minor differences in
1346 some floating-point constants and can be safely ignored; the stage
1347 3 compiler is correct.
1351 Various early versions of each release of the IBM XLC compiler
1352 will not bootstrap GNU CC. Symptoms include differences between
1353 the stage2 and stage3 object files, and errors when compiling
1354 `libgcc.a' or `enquire'. Known problematic releases include:
1355 xlc-1.2.1.8, xlc-1.3.0.0 (distributed with AIX 3.2.5), and
1356 xlc-1.3.0.19. Both xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are
1357 known to produce working versions of GNU CC, but most other recent
1358 releases correctly bootstrap GNU CC.
1360 Release 4.3.0 of AIX and ones prior to AIX 3.2.4 include a version
1361 of the IBM assembler which does not accept debugging directives:
1362 assembler updates are available as PTFs. Also, if you are using
1363 AIX 3.2.5 or greater and the GNU assembler, you must have a
1364 version modified after October 16th, 1995 in order for the GNU C
1365 compiler to build. See the file `README.RS6000' for more details
1366 on any of these problems.
1368 GNU CC does not yet support the 64-bit PowerPC instructions.
1370 Objective C does not work on this architecture because it makes
1371 assumptions that are incompatible with the calling conventions.
1373 AIX on the RS/6000 provides support (NLS) for environments outside
1374 of the United States. Compilers and assemblers use NLS to support
1375 locale-specific representations of various objects including
1376 floating-point numbers ("." vs "," for separating decimal
1377 fractions). There have been problems reported where the library
1378 linked with GNU CC does not produce the same floating-point
1379 formats that the assembler accepts. If you have this problem, set
1380 the LANG environment variable to "C" or "En_US".
1382 Due to changes in the way that GNU CC invokes the binder (linker)
1383 for AIX 4.1, you may now receive warnings of duplicate symbols
1384 from the link step that were not reported before. The assembly
1385 files generated by GNU CC for AIX have always included multiple
1386 symbol definitions for certain global variable and function
1387 declarations in the original program. The warnings should not
1388 prevent the linker from producing a correct library or runnable
1391 By default, AIX 4.1 produces code that can be used on either Power
1392 or PowerPC processors.
1394 You can specify a default version for the `-mcpu='CPU_TYPE switch
1395 by using the configure option `--with-cpu-'CPU_TYPE.
1399 PowerPC system in big endian mode, running System V.4.
1401 You can specify a default version for the `-mcpu='CPU_TYPE switch
1402 by using the configure option `--with-cpu-'CPU_TYPE.
1405 `powerpc-*-linux-gnu'
1406 PowerPC system in big endian mode, running the Linux-based GNU
1409 You can specify a default version for the `-mcpu='CPU_TYPE switch
1410 by using the configure option `--with-cpu-'CPU_TYPE.
1413 Embedded PowerPC system in big endian mode with -mcall-aix
1414 selected as the default.
1416 You can specify a default version for the `-mcpu='CPU_TYPE switch
1417 by using the configure option `--with-cpu-'CPU_TYPE.
1420 Embedded PowerPC system in big endian mode for use in running
1421 under the PSIM simulator.
1423 You can specify a default version for the `-mcpu='CPU_TYPE switch
1424 by using the configure option `--with-cpu-'CPU_TYPE.
1427 Embedded PowerPC system in big endian mode.
1429 You can specify a default version for the `-mcpu='CPU_TYPE switch
1430 by using the configure option `--with-cpu-'CPU_TYPE.
1434 PowerPC system in little endian mode, running System V.4.
1436 You can specify a default version for the `-mcpu='CPU_TYPE switch
1437 by using the configure option `--with-cpu-'CPU_TYPE.
1439 `powerpcle-*-solaris2*'
1440 PowerPC system in little endian mode, running Solaris 2.5.1 or
1443 You can specify a default version for the `-mcpu='CPU_TYPE switch
1444 by using the configure option `--with-cpu-'CPU_TYPE. Beta
1445 versions of the Sun 4.0 compiler do not seem to be able to build
1446 GNU CC correctly. There are also problems with the host assembler
1447 and linker that are fixed by using the GNU versions of these tools.
1449 `powerpcle-*-eabisim'
1450 Embedded PowerPC system in little endian mode for use in running
1451 under the PSIM simulator.
1454 Embedded PowerPC system in little endian mode.
1456 You can specify a default version for the `-mcpu='CPU_TYPE switch
1457 by using the configure option `--with-cpu-'CPU_TYPE.
1461 PowerPC system in little endian mode running Windows NT.
1463 You can specify a default version for the `-mcpu='CPU_TYPE switch
1464 by using the configure option `--with-cpu-'CPU_TYPE.
1467 Don't try compiling with Vax C (`vcc'). It produces incorrect code
1468 in some cases (for example, when `alloca' is used).
1470 Meanwhile, compiling `cp/parse.c' with pcc does not work because of
1471 an internal table size limitation in that compiler. To avoid this
1472 problem, compile just the GNU C compiler first, and use it to
1473 recompile building all the languages that you want to run.
1476 See *Note Sun Install::, for information on installing GNU CC on
1480 See *Note VMS Install::, for details on how to install GNU CC on
1484 These computers are also known as the 3b2, 3b5, 3b20 and other
1485 similar names. (However, the 3b1 is actually a 68000; see *Note
1488 Don't use `-g' when compiling with the system's compiler. The
1489 system's linker seems to be unable to handle such a large program
1490 with debugging information.
1492 The system's compiler runs out of capacity when compiling `stmt.c'
1493 in GNU CC. You can work around this by building `cpp' in GNU CC
1494 first, then use that instead of the system's preprocessor with the
1495 system's C compiler to compile `stmt.c'. Here is how:
1497 mv /lib/cpp /lib/cpp.att
1499 echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp
1502 The system's compiler produces bad code for some of the GNU CC
1503 optimization files. So you must build the stage 2 compiler without
1504 optimization. Then build a stage 3 compiler with optimization.
1505 That executable should work. Here are the necessary commands:
1507 make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
1509 make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
1511 You may need to raise the ULIMIT setting to build a C++ compiler,
1512 as the file `cc1plus' is larger than one megabyte.
1514 Compilation in a Separate Directory
1515 ===================================
1517 If you wish to build the object files and executables in a directory
1518 other than the one containing the source files, here is what you must
1521 1. Make sure you have a version of Make that supports the `VPATH'
1522 feature. (GNU Make supports it, as do Make versions on most BSD
1525 2. If you have ever run `configure' in the source directory, you must
1526 undo the configuration. Do this by running:
1530 3. Go to the directory in which you want to build the compiler before
1531 running `configure':
1536 On systems that do not support symbolic links, this directory must
1537 be on the same file system as the source code directory.
1539 4. Specify where to find `configure' when you run it:
1541 ../gcc/configure ...
1543 This also tells `configure' where to find the compiler sources;
1544 `configure' takes the directory from the file name that was used to
1545 invoke it. But if you want to be sure, you can specify the source
1546 directory with the `--srcdir' option, like this:
1548 ../gcc/configure --srcdir=../gcc OTHER OPTIONS
1550 The directory you specify with `--srcdir' need not be the same as
1551 the one that `configure' is found in.
1553 Now, you can run `make' in that directory. You need not repeat the
1554 configuration steps shown above, when ordinary source files change. You
1555 must, however, run `configure' again when the configuration files
1556 change, if your system does not support symbolic links.
1558 Building and Installing a Cross-Compiler
1559 ========================================
1561 GNU CC can function as a cross-compiler for many machines, but not
1564 * Cross-compilers for the Mips as target using the Mips assembler
1565 currently do not work, because the auxiliary programs
1566 `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything
1567 but a Mips. It does work to cross compile for a Mips if you use
1568 the GNU assembler and linker.
1570 * Cross-compilers between machines with different floating point
1571 formats have not all been made to work. GNU CC now has a floating
1572 point emulator with which these can work, but each target machine
1573 description needs to be updated to take advantage of it.
1575 * Cross-compilation between machines of different word sizes is
1576 somewhat problematic and sometimes does not work.
1578 Since GNU CC generates assembler code, you probably need a
1579 cross-assembler that GNU CC can run, in order to produce object files.
1580 If you want to link on other than the target machine, you need a
1581 cross-linker as well. You also need header files and libraries suitable
1582 for the target machine that you can install on the host machine.
1584 Steps of Cross-Compilation
1585 --------------------------
1587 To compile and run a program using a cross-compiler involves several
1590 * Run the cross-compiler on the host machine to produce assembler
1591 files for the target machine. This requires header files for the
1594 * Assemble the files produced by the cross-compiler. You can do this
1595 either with an assembler on the target machine, or with a
1596 cross-assembler on the host machine.
1598 * Link those files to make an executable. You can do this either
1599 with a linker on the target machine, or with a cross-linker on the
1600 host machine. Whichever machine you use, you need libraries and
1601 certain startup files (typically `crt....o') for the target
1604 It is most convenient to do all of these steps on the same host
1605 machine, since then you can do it all with a single invocation of GNU
1606 CC. This requires a suitable cross-assembler and cross-linker. For
1607 some targets, the GNU assembler and linker are available.
1609 Configuring a Cross-Compiler
1610 ----------------------------
1612 To build GNU CC as a cross-compiler, you start out by running
1613 `configure'. Use the `--target=TARGET' to specify the target type. If
1614 `configure' was unable to correctly identify the system you are running
1615 on, also specify the `--build=BUILD' option. For example, here is how
1616 to configure for a cross-compiler that produces code for an HP 68030
1617 system running BSD on a system that `configure' can correctly identify:
1619 ./configure --target=m68k-hp-bsd4.3
1621 Tools and Libraries for a Cross-Compiler
1622 ----------------------------------------
1624 If you have a cross-assembler and cross-linker available, you should
1625 install them now. Put them in the directory `/usr/local/TARGET/bin'.
1626 Here is a table of the tools you should put in this directory:
1629 This should be the cross-assembler.
1632 This should be the cross-linker.
1635 This should be the cross-archiver: a program which can manipulate
1636 archive files (linker libraries) in the target machine's format.
1639 This should be a program to construct a symbol table in an archive
1642 The installation of GNU CC will find these programs in that
1643 directory, and copy or link them to the proper place to for the
1644 cross-compiler to find them when run later.
1646 The easiest way to provide these files is to build the Binutils
1647 package and GAS. Configure them with the same `--host' and `--target'
1648 options that you use for configuring GNU CC, then build and install
1649 them. They install their executables automatically into the proper
1650 directory. Alas, they do not support all the targets that GNU CC
1653 If you want to install libraries to use with the cross-compiler,
1654 such as a standard C library, put them in the directory
1655 `/usr/local/TARGET/lib'; installation of GNU CC copies all the files in
1656 that subdirectory into the proper place for GNU CC to find them and
1657 link with them. Here's an example of copying some libraries from a
1661 lcd /usr/local/TARGET/lib
1669 The precise set of libraries you'll need, and their locations on the
1670 target machine, vary depending on its operating system.
1672 Many targets require "start files" such as `crt0.o' and `crtn.o'
1673 which are linked into each executable; these too should be placed in
1674 `/usr/local/TARGET/lib'. There may be several alternatives for
1675 `crt0.o', for use with profiling or other compilation options. Check
1676 your target's definition of `STARTFILE_SPEC' to find out what start
1677 files it uses. Here's an example of copying these files from a target
1681 lcd /usr/local/TARGET/lib
1689 `libgcc.a' and Cross-Compilers
1690 ------------------------------
1692 Code compiled by GNU CC uses certain runtime support functions
1693 implicitly. Some of these functions can be compiled successfully with
1694 GNU CC itself, but a few cannot be. These problem functions are in the
1695 source file `libgcc1.c'; the library made from them is called
1698 When you build a native compiler, these functions are compiled with
1699 some other compiler-the one that you use for bootstrapping GNU CC.
1700 Presumably it knows how to open code these operations, or else knows how
1701 to call the run-time emulation facilities that the machine comes with.
1702 But this approach doesn't work for building a cross-compiler. The
1703 compiler that you use for building knows about the host system, not the
1706 So, when you build a cross-compiler you have to supply a suitable
1707 library `libgcc1.a' that does the job it is expected to do.
1709 To compile `libgcc1.c' with the cross-compiler itself does not work.
1710 The functions in this file are supposed to implement arithmetic
1711 operations that GNU CC does not know how to open code for your target
1712 machine. If these functions are compiled with GNU CC itself, they will
1713 compile into infinite recursion.
1715 On any given target, most of these functions are not needed. If GNU
1716 CC can open code an arithmetic operation, it will not call these
1717 functions to perform the operation. It is possible that on your target
1718 machine, none of these functions is needed. If so, you can supply an
1719 empty library as `libgcc1.a'.
1721 Many targets need library support only for multiplication and
1722 division. If you are linking with a library that contains functions for
1723 multiplication and division, you can tell GNU CC to call them directly
1724 by defining the macros `MULSI3_LIBCALL', and the like. These macros
1725 need to be defined in the target description macro file. For some
1726 targets, they are defined already. This may be sufficient to avoid the
1727 need for libgcc1.a; if so, you can supply an empty library.
1729 Some targets do not have floating point instructions; they need other
1730 functions in `libgcc1.a', which do floating arithmetic. Recent
1731 versions of GNU CC have a file which emulates floating point. With a
1732 certain amount of work, you should be able to construct a floating
1733 point emulator that can be used as `libgcc1.a'. Perhaps future
1734 versions will contain code to do this automatically and conveniently.
1735 That depends on whether someone wants to implement it.
1737 Some embedded targets come with all the necessary `libgcc1.a'
1738 routines written in C or assembler. These targets build `libgcc1.a'
1739 automatically and you do not need to do anything special for them.
1740 Other embedded targets do not need any `libgcc1.a' routines since all
1741 the necessary operations are supported by the hardware.
1743 If your target system has another C compiler, you can configure GNU
1744 CC as a native compiler on that machine, build just `libgcc1.a' with
1745 `make libgcc1.a' on that machine, and use the resulting file with the
1746 cross-compiler. To do this, execute the following on the target
1750 ./configure --host=sparc --target=sun3
1753 And then this on the host machine:
1761 Another way to provide the functions you need in `libgcc1.a' is to
1762 define the appropriate `perform_...' macros for those functions. If
1763 these definitions do not use the C arithmetic operators that they are
1764 meant to implement, you should be able to compile them with the
1765 cross-compiler you are building. (If these definitions already exist
1766 for your target file, then you are all set.)
1768 To build `libgcc1.a' using the perform macros, use
1769 `LIBGCC1=libgcc1.a OLDCC=./xgcc' when building the compiler.
1770 Otherwise, you should place your replacement library under the name
1771 `libgcc1.a' in the directory in which you will build the
1772 cross-compiler, before you run `make'.
1774 Cross-Compilers and Header Files
1775 --------------------------------
1777 If you are cross-compiling a standalone program or a program for an
1778 embedded system, then you may not need any header files except the few
1779 that are part of GNU CC (and those of your program). However, if you
1780 intend to link your program with a standard C library such as `libc.a',
1781 then you probably need to compile with the header files that go with
1782 the library you use.
1784 The GNU C compiler does not come with these files, because (1) they
1785 are system-specific, and (2) they belong in a C library, not in a
1788 If the GNU C library supports your target machine, then you can get
1789 the header files from there (assuming you actually use the GNU library
1790 when you link your program).
1792 If your target machine comes with a C compiler, it probably comes
1793 with suitable header files also. If you make these files accessible
1794 from the host machine, the cross-compiler can use them also.
1796 Otherwise, you're on your own in finding header files to use when
1799 When you have found suitable header files, put them in the directory
1800 `/usr/local/TARGET/include', before building the cross compiler. Then
1801 installation will run fixincludes properly and install the corrected
1802 versions of the header files where the compiler will use them.
1804 Provide the header files before you build the cross-compiler, because
1805 the build stage actually runs the cross-compiler to produce parts of
1806 `libgcc.a'. (These are the parts that *can* be compiled with GNU CC.)
1807 Some of them need suitable header files.
1809 Here's an example showing how to copy the header files from a target
1810 machine. On the target machine, do this:
1812 (cd /usr/include; tar cf - .) > tarfile
1814 Then, on the host machine, do this:
1817 lcd /usr/local/TARGET/include
1822 Actually Building the Cross-Compiler
1823 ------------------------------------
1825 Now you can proceed just as for compiling a single-machine compiler
1826 through the step of building stage 1. If you have not provided some
1827 sort of `libgcc1.a', then compilation will give up at the point where
1828 it needs that file, printing a suitable error message. If you do
1829 provide `libgcc1.a', then building the compiler will automatically
1830 compile and link a test program called `libgcc1-test'; if you get
1831 errors in the linking, it means that not all of the necessary routines
1832 in `libgcc1.a' are available.
1834 You must provide the header file `float.h'. One way to do this is
1835 to compile `enquire' and run it on your target machine. The job of
1836 `enquire' is to run on the target machine and figure out by experiment
1837 the nature of its floating point representation. `enquire' records its
1838 findings in the header file `float.h'. If you can't produce this file
1839 by running `enquire' on the target machine, then you will need to come
1840 up with a suitable `float.h' in some other way (or else, avoid using it
1843 Do not try to build stage 2 for a cross-compiler. It doesn't work to
1844 rebuild GNU CC as a cross-compiler using the cross-compiler, because
1845 that would produce a program that runs on the target machine, not on the
1846 host. For example, if you compile a 386-to-68030 cross-compiler with
1847 itself, the result will not be right either for the 386 (because it was
1848 compiled into 68030 code) or for the 68030 (because it was configured
1849 for a 386 as the host). If you want to compile GNU CC into 68030 code,
1850 whether you compile it on a 68030 or with a cross-compiler on a 386, you
1851 must specify a 68030 as the host when you configure it.
1853 To install the cross-compiler, use `make install', as usual.
1855 Installing GNU CC on the Sun
1856 ============================
1858 On Solaris, do not use the linker or other tools in `/usr/ucb' to
1859 build GNU CC. Use `/usr/ccs/bin'.
1861 If the assembler reports `Error: misaligned data' when bootstrapping,
1862 you are probably using an obsolete version of the GNU assembler.
1863 Upgrade to the latest version of GNU `binutils', or use the Solaris
1866 Make sure the environment variable `FLOAT_OPTION' is not set when
1867 you compile `libgcc.a'. If this option were set to `f68881' when
1868 `libgcc.a' is compiled, the resulting code would demand to be linked
1869 with a special startup file and would not link properly without special
1872 There is a bug in `alloca' in certain versions of the Sun library.
1873 To avoid this bug, install the binaries of GNU CC that were compiled by
1874 GNU CC. They use `alloca' as a built-in function and never the one in
1877 Some versions of the Sun compiler crash when compiling GNU CC. The
1878 problem is a segmentation fault in cpp. This problem seems to be due to
1879 the bulk of data in the environment variables. You may be able to avoid
1880 it by using the following command to compile GNU CC with Sun CC:
1882 make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
1884 SunOS 4.1.3 and 4.1.3_U1 have bugs that can cause intermittent core
1885 dumps when compiling GNU CC. A common symptom is an internal compiler
1886 error which does not recur if you run it again. To fix the problem,
1887 install Sun recommended patch 100726 (for SunOS 4.1.3) or 101508 (for
1888 SunOS 4.1.3_U1), or upgrade to a later SunOS release.
1890 Installing GNU CC on VMS
1891 ========================
1893 The VMS version of GNU CC is distributed in a backup saveset
1894 containing both source code and precompiled binaries.
1896 To install the `gcc' command so you can use the compiler easily, in
1897 the same manner as you use the VMS C compiler, you must install the VMS
1898 CLD file for GNU CC as follows:
1900 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
1901 point to the directories where the GNU CC executables
1902 (`gcc-cpp.exe', `gcc-cc1.exe', etc.) and the C include files are
1903 kept respectively. This should be done with the commands:
1905 $ assign /system /translation=concealed -
1907 $ assign /system /translation=concealed -
1908 disk:[gcc.include.] gnu_cc_include
1910 with the appropriate disk and directory names. These commands can
1911 be placed in your system startup file so they will be executed
1912 whenever the machine is rebooted. You may, if you choose, do this
1913 via the `GCC_INSTALL.COM' script in the `[GCC]' directory.
1915 2. Install the `GCC' command with the command line:
1917 $ set command /table=sys$common:[syslib]dcltables -
1918 /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
1919 $ install replace sys$common:[syslib]dcltables
1921 3. To install the help file, do the following:
1923 $ library/help sys$library:helplib.hlb gcc.hlp
1925 Now you can invoke the compiler with a command like `gcc /verbose
1926 file.c', which is equivalent to the command `gcc -v -c file.c' in
1929 If you wish to use GNU C++ you must first install GNU CC, and then
1930 perform the following steps:
1932 1. Define the VMS logical name `GNU_GXX_INCLUDE' to point to the
1933 directory where the preprocessor will search for the C++ header
1934 files. This can be done with the command:
1936 $ assign /system /translation=concealed -
1937 disk:[gcc.gxx_include.] gnu_gxx_include
1939 with the appropriate disk and directory name. If you are going to
1940 be using a C++ runtime library, this is where its install
1941 procedure will install its header files.
1943 2. Obtain the file `gcc-cc1plus.exe', and place this in the same
1944 directory that `gcc-cc1.exe' is kept.
1946 The GNU C++ compiler can be invoked with a command like `gcc /plus
1947 /verbose file.cc', which is equivalent to the command `g++ -v -c
1950 We try to put corresponding binaries and sources on the VMS
1951 distribution tape. But sometimes the binaries will be from an older
1952 version than the sources, because we don't always have time to update
1953 them. (Use the `/version' option to determine the version number of
1954 the binaries and compare it with the source file `version.c' to tell
1955 whether this is so.) In this case, you should use the binaries you get
1956 to recompile the sources. If you must recompile, here is how:
1958 1. Execute the command procedure `vmsconfig.com' to set up the files
1959 `tm.h', `config.h', `aux-output.c', and `md.', and to create files
1960 `tconfig.h' and `hconfig.h'. This procedure also creates several
1961 linker option files used by `make-cc1.com' and a data file used by
1966 2. Setup the logical names and command tables as defined above. In
1967 addition, define the VMS logical name `GNU_BISON' to point at the
1968 to the directories where the Bison executable is kept. This
1969 should be done with the command:
1971 $ assign /system /translation=concealed -
1972 disk:[bison.] gnu_bison
1974 You may, if you choose, use the `INSTALL_BISON.COM' script in the
1975 `[BISON]' directory.
1977 3. Install the `BISON' command with the command line:
1979 $ set command /table=sys$common:[syslib]dcltables -
1980 /output=sys$common:[syslib]dcltables -
1981 gnu_bison:[000000]bison
1982 $ install replace sys$common:[syslib]dcltables
1984 4. Type `@make-gcc' to recompile everything (alternatively, submit
1985 the file `make-gcc.com' to a batch queue). If you wish to build
1986 the GNU C++ compiler as well as the GNU CC compiler, you must
1987 first edit `make-gcc.com' and follow the instructions that appear
1990 5. In order to use GCC, you need a library of functions which GCC
1991 compiled code will call to perform certain tasks, and these
1992 functions are defined in the file `libgcc2.c'. To compile this
1993 you should use the command procedure `make-l2.com', which will
1994 generate the library `libgcc2.olb'. `libgcc2.olb' should be built
1995 using the compiler built from the same distribution that
1996 `libgcc2.c' came from, and `make-gcc.com' will automatically do
1997 all of this for you.
1999 To install the library, use the following commands:
2001 $ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
2002 $ library gnu_cc:[000000]gcclib/delete=L_*
2003 $ library libgcc2/extract=*/output=libgcc2.obj
2004 $ library gnu_cc:[000000]gcclib libgcc2.obj
2006 The first command simply removes old modules that will be replaced
2007 with modules from `libgcc2' under different module names. The
2008 modules `new' and `eprintf' may not actually be present in your
2009 `gcclib.olb'--if the VMS librarian complains about those modules
2010 not being present, simply ignore the message and continue on with
2011 the next command. The second command removes the modules that
2012 came from the previous version of the library `libgcc2.c'.
2014 Whenever you update the compiler on your system, you should also
2015 update the library with the above procedure.
2017 6. You may wish to build GCC in such a way that no files are written
2018 to the directory where the source files reside. An example would
2019 be the when the source files are on a read-only disk. In these
2020 cases, execute the following DCL commands (substituting your
2023 $ assign dua0:[gcc.build_dir.]/translation=concealed, -
2024 dua1:[gcc.source_dir.]/translation=concealed gcc_build
2025 $ set default gcc_build:[000000]
2027 where the directory `dua1:[gcc.source_dir]' contains the source
2028 code, and the directory `dua0:[gcc.build_dir]' is meant to contain
2029 all of the generated object files and executables. Once you have
2030 done this, you can proceed building GCC as described above. (Keep
2031 in mind that `gcc_build' is a rooted logical name, and thus the
2032 device names in each element of the search list must be an actual
2033 physical device name rather than another rooted logical name).
2035 7. *If you are building GNU CC with a previous version of GNU CC, you
2036 also should check to see that you have the newest version of the
2037 assembler*. In particular, GNU CC version 2 treats global constant
2038 variables slightly differently from GNU CC version 1, and GAS
2039 version 1.38.1 does not have the patches required to work with GCC
2040 version 2. If you use GAS 1.38.1, then `extern const' variables
2041 will not have the read-only bit set, and the linker will generate
2042 warning messages about mismatched psect attributes for these
2043 variables. These warning messages are merely a nuisance, and can
2046 If you are compiling with a version of GNU CC older than 1.33,
2047 specify `/DEFINE=("inline=")' as an option in all the
2048 compilations. This requires editing all the `gcc' commands in
2049 `make-cc1.com'. (The older versions had problems supporting
2050 `inline'.) Once you have a working 1.33 or newer GNU CC, you can
2051 change this file back.
2053 8. If you want to build GNU CC with the VAX C compiler, you will need
2054 to make minor changes in `make-cccp.com' and `make-cc1.com' to
2055 choose alternate definitions of `CC', `CFLAGS', and `LIBS'. See
2056 comments in those files. However, you must also have a working
2057 version of the GNU assembler (GNU as, aka GAS) as it is used as
2058 the back-end for GNU CC to produce binary object modules and is
2059 not included in the GNU CC sources. GAS is also needed to compile
2060 `libgcc2' in order to build `gcclib' (see above); `make-l2.com'
2061 expects to be able to find it operational in
2062 `gnu_cc:[000000]gnu-as.exe'.
2064 To use GNU CC on VMS, you need the VMS driver programs `gcc.exe',
2065 `gcc.com', and `gcc.cld'. They are distributed with the VMS
2066 binaries (`gcc-vms') rather than the GNU CC sources. GAS is also
2067 included in `gcc-vms', as is Bison.
2069 Once you have successfully built GNU CC with VAX C, you should use
2070 the resulting compiler to rebuild itself. Before doing this, be
2071 sure to restore the `CC', `CFLAGS', and `LIBS' definitions in
2072 `make-cccp.com' and `make-cc1.com'. The second generation
2073 compiler will be able to take advantage of many optimizations that
2074 must be suppressed when building with other compilers.
2076 Under previous versions of GNU CC, the generated code would
2077 occasionally give strange results when linked with the sharable
2078 `VAXCRTL' library. Now this should work.
2080 Even with this version, however, GNU CC itself should not be linked
2081 with the sharable `VAXCRTL'. The version of `qsort' in `VAXCRTL' has a
2082 bug (known to be present in VMS versions V4.6 through V5.5) which
2083 causes the compiler to fail.
2085 The executables are generated by `make-cc1.com' and `make-cccp.com'
2086 use the object library version of `VAXCRTL' in order to make use of the
2087 `qsort' routine in `gcclib.olb'. If you wish to link the compiler
2088 executables with the shareable image version of `VAXCRTL', you should
2089 edit the file `tm.h' (created by `vmsconfig.com') to define the macro
2092 `QSORT_WORKAROUND' is always defined when GNU CC is compiled with
2093 VAX C, to avoid a problem in case `gcclib.olb' is not yet available.
2098 GNU CC uses a utility called `collect2' on nearly all systems to
2099 arrange to call various initialization functions at start time.
2101 The program `collect2' works by linking the program once and looking
2102 through the linker output file for symbols with particular names
2103 indicating they are constructor functions. If it finds any, it creates
2104 a new temporary `.c' file containing a table of them, compiles it, and
2105 links the program a second time including that file.
2107 The actual calls to the constructors are carried out by a subroutine
2108 called `__main', which is called (automatically) at the beginning of
2109 the body of `main' (provided `main' was compiled with GNU CC). Calling
2110 `__main' is necessary, even when compiling C code, to allow linking C
2111 and C++ object code together. (If you use `-nostdlib', you get an
2112 unresolved reference to `__main', since it's defined in the standard
2113 GCC library. Include `-lgcc' at the end of your compiler command line
2114 to resolve this reference.)
2116 The program `collect2' is installed as `ld' in the directory where
2117 the passes of the compiler are installed. When `collect2' needs to
2118 find the *real* `ld', it tries the following file names:
2120 * `real-ld' in the directories listed in the compiler's search
2123 * `real-ld' in the directories listed in the environment variable
2126 * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
2129 * `ld' in the compiler's search directories, except that `collect2'
2130 will not execute itself recursively.
2134 "The compiler's search directories" means all the directories where
2135 `gcc' searches for passes of the compiler. This includes directories
2136 that you specify with `-B'.
2138 Cross-compilers search a little differently:
2140 * `real-ld' in the compiler's search directories.
2142 * `TARGET-real-ld' in `PATH'.
2144 * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
2147 * `ld' in the compiler's search directories.
2149 * `TARGET-ld' in `PATH'.
2151 `collect2' explicitly avoids running `ld' using the file name under
2152 which `collect2' itself was invoked. In fact, it remembers up a list
2153 of such names--in case one copy of `collect2' finds another copy (or
2154 version) of `collect2' installed as `ld' in a second place in the
2157 `collect2' searches for the utilities `nm' and `strip' using the
2158 same algorithm as above for `ld'.
2160 Standard Header File Directories
2161 ================================
2163 `GCC_INCLUDE_DIR' means the same thing for native and cross. It is
2164 where GNU CC stores its private include files, and also where GNU CC
2165 stores the fixed include files. A cross compiled GNU CC runs
2166 `fixincludes' on the header files in `$(tooldir)/include'. (If the
2167 cross compilation header files need to be fixed, they must be installed
2168 before GNU CC is built. If the cross compilation header files are
2169 already suitable for ANSI C and GNU CC, nothing special need be done).
2171 `GPLUSPLUS_INCLUDE_DIR' means the same thing for native and cross.
2172 It is where `g++' looks first for header files. The C++ library
2173 installs only target independent header files in that directory.
2175 `LOCAL_INCLUDE_DIR' is used only for a native compiler. It is
2176 normally `/usr/local/include'. GNU CC searches this directory so that
2177 users can install header files in `/usr/local/include'.
2179 `CROSS_INCLUDE_DIR' is used only for a cross compiler. GNU CC
2180 doesn't install anything there.
2182 `TOOL_INCLUDE_DIR' is used for both native and cross compilers. It
2183 is the place for other packages to install header files that GNU CC will
2184 use. For a cross-compiler, this is the equivalent of `/usr/include'.
2185 When you build a cross-compiler, `fixincludes' processes any header
2186 files in this directory.