OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / INSTALL
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.
5
6 Installing GNU CC
7 *****************
8
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.
11
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
16 systems.
17
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.
22
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
28      clean.
29
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.
33
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.)
37
38      Bison versions older than Sept 8, 1988 will produce incorrect
39      output for `c-parse.c'.
40
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'.
47
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.
51
52   5. Specify the host, build and target machine configurations.  You do
53      this when you run the `configure' script.
54
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.
59
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.
67
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::.)
72
73      Here is an example:
74
75           ./configure --host=sparc-sun-sunos4.1
76
77      A configuration name may be canonical or it may be more or less
78      abbreviated.
79
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.
85
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.
91
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.
96
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.
101
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'.
106
107     `--with-gnu-as'
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
110           you run `configure'.
111
112           Using this option does not install GAS.  It only modifies the
113           output of GNU CC to work with GAS.  Building and installing
114           GAS is up to you.
115
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'
122           when you run it.
123
124           The systems where it makes a difference whether you use GAS
125           are
126           `hppa1.0-ANY-ANY', `hppa1.1-ANY-ANY', `i386-ANY-sysv',
127           `i386-ANY-isc',
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.
133
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').
137
138     `--with-gnu-ld'
139           Specify the option `--with-gnu-ld' if you plan to use the GNU
140           linker with GNU CC.
141
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
144           linker.
145
146     `--with-stabs'
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.
153
154           Normally, GNU CC uses the ECOFF debugging format by default;
155           if you prefer BSD stabs, specify `--with-stabs' when you
156           configure GNU CC.
157
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
161           compilation.
162
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.
168
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.
176
177     `--nfp'
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.
183
184     `--enable-haifa'
185     `--disable-haifa'
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.
192
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'.
202
203     `--enable-checking'
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.
210
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.
216
217           Here we spell out what files will be set up by `configure'.
218           Normally you need not be concerned with these files.
219
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
225                includes `tm.h'.
226
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.
230
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.
234
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
238                machine.
239
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'.
244
245     `--enable-nls'
246     `--disable-nls'
247           The `--enable-nls' option enables Native Language Support
248           (NLS), which lets GCC output diagnostics in languages other
249           than American English.  No translations are available yet, so
250           the main users of this option now are those translating GCC's
251           diagnostics who want to test their work.  Once translations
252           become available, Native Language Support will become enabled
253           by default.  The `--disable-nls' option disables NLS.
254
255     `--with-included-gettext'
256           If NLS is enabled, the GCC build procedure normally attempts
257           to use the host's `gettext' libraries, and falls back on
258           GCC's copy of the GNU `gettext' library only if the host
259           libraries do not suffice.  The `--with-included-gettext'
260           option causes the build procedure to prefer its copy of GNU
261           `gettext'.
262
263     `--with-catgets'
264           If NLS is enabled, and if the host lacks `gettext' but has the
265           inferior `catgets' interface, the GCC build procedure normally
266           ignores `catgets' and instead uses GCC's copy of the GNU
267           `gettext' library.  The `--with-catgets' option causes the
268           build procedure to use the host's `catgets' in this situation.
269
270     `--enable-win32-registry'
271     `--enable-win32-registry=KEY'
272     `--disable-win32-registry'
273           The `--enable-win32-registry' option enables Windows-hosted
274           GCC to look up installations paths in the registry using the
275           following key:
276
277                `HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\<KEY>'
278
279           <KEY> defaults to GCC version number, and can be overridden
280           by the `--enable-win32-registry=KEY' option. Vendors and
281           distributors who use custom installers are encouraged to
282           provide a different key, perhaps one comprised of vendor name
283           and GCC version number, to avoid conflict with existing
284           installations. This feature is enabled by default, and can be
285           disabled by `--disable-win32-registry' option.  This option
286           has no effect on the other hosts.
287
288   7. In certain cases, you should specify certain other options when
289      you run `configure'.
290
291         * The standard directory for installing GNU CC is
292           `/usr/local/lib'.  If you want to install its files somewhere
293           else, specify `--prefix=DIR' when you run `configure'.  Here
294           DIR is a directory name to use instead of `/usr/local' for
295           all purposes with one exception: the directory
296           `/usr/local/include' is searched for header files no matter
297           where you install the compiler.  To override this name, use
298           the `--with-local-prefix' option below.  The directory you
299           specify need not exist, but its parent directory must exist.
300
301         * Specify `--with-local-prefix=DIR' if you want the compiler to
302           search directory `DIR/include' for locally installed header
303           files *instead* of `/usr/local/include'.
304
305           You should specify `--with-local-prefix' *only* if your site
306           has a different convention (not `/usr/local') for where to put
307           site-specific files.
308
309           The default value for `--with-local-prefix' is `/usr/local'
310           regardless of the value of `--prefix'.  Specifying `--prefix'
311           has no effect on which directory GNU CC searches for local
312           header files.  This may seem counterintuitive, but actually
313           it is logical.
314
315           The purpose of `--prefix' is to specify where to *install GNU
316           CC*.  The local header files in `/usr/local/include'--if you
317           put any in that directory--are not part of GNU CC.  They are
318           part of other programs--perhaps many others.  (GNU CC
319           installs its own header files in another directory which is
320           based on the `--prefix' value.)
321
322           *Do not* specify `/usr' as the `--with-local-prefix'!  The
323           directory you use for `--with-local-prefix' *must not* contain
324           any of the system's standard header files.  If it did contain
325           them, certain programs would be miscompiled (including GNU
326           Emacs, on certain targets), because this would override and
327           nullify the header file corrections made by the `fixincludes'
328           script.
329
330           Indications are that people who use this option use it based
331           on mistaken ideas of what it is for.  People use it as if it
332           specified where to install part of GNU CC.  Perhaps they make
333           this assumption because installing GNU CC creates the
334           directory.
335
336   8. Build the compiler.  Just type `make LANGUAGES=c' in the compiler
337      directory.
338
339      `LANGUAGES=c' specifies that only the C compiler should be
340      compiled.  The makefile normally builds compilers for all the
341      supported languages; currently, C, C++ and Objective C.  However,
342      C is the only language that is sure to work when you build with
343      other non-GNU C compilers.  In addition, building anything but C
344      at this stage is a waste of time.
345
346      In general, you can specify the languages to build by typing the
347      argument `LANGUAGES="LIST"', where LIST is one or more words from
348      the list `c', `c++', and `objective-c'.  If you have any
349      additional GNU compilers as subdirectories of the GNU CC source
350      directory, you may also specify their names in this list.
351
352      Ignore any warnings you may see about "statement not reached" in
353      `insn-emit.c'; they are normal.  Also, warnings about "unknown
354      escape sequence" are normal in `genopinit.c' and perhaps some
355      other files.  Likewise, you should ignore warnings about "constant
356      is so large that it is unsigned" in `insn-emit.c' and
357      `insn-recog.c', and a warning about a comparison always being zero
358      in `enquire.o'.  Any other compilation errors may represent bugs in
359      the port to your machine or operating system, and should be
360      investigated and reported.
361
362      Some compilers fail to compile GNU CC because they have bugs or
363      limitations.  For example, the Microsoft compiler is said to run
364      out of macro space.  Some Ultrix compilers run out of expression
365      space; then you need to break up the statement where the problem
366      happens.
367
368   9. If you are building a cross-compiler, stop here.  *Note
369      Cross-Compiler::.
370
371  10. Move the first-stage object files and executables into a
372      subdirectory with this command:
373
374           make stage1
375
376      The files are moved into a subdirectory named `stage1'.  Once
377      installation is complete, you may wish to delete these files with
378      `rm -r stage1'.
379
380  11. If you have chosen a configuration for GNU CC which requires other
381      GNU tools (such as GAS or the GNU linker) instead of the standard
382      system tools, install the required tools in the `stage1'
383      subdirectory under the names `as', `ld' or whatever is
384      appropriate.  This will enable the stage 1 compiler to find the
385      proper tools in the following stage.
386
387      Alternatively, you can do subsequent compilation using a value of
388      the `PATH' environment variable such that the necessary GNU tools
389      come before the standard system tools.
390
391  12. Recompile the compiler with itself, with this command:
392
393           make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"
394
395      This is called making the stage 2 compiler.
396
397      The command shown above builds compilers for all the supported
398      languages.  If you don't want them all, you can specify the
399      languages to build by typing the argument `LANGUAGES="LIST"'.  LIST
400      should contain one or more words from the list `c', `c++',
401      `objective-c', and `proto'.  Separate the words with spaces.
402      `proto' stands for the programs `protoize' and `unprotoize'; they
403      are not a separate language, but you use `LANGUAGES' to enable or
404      disable their installation.
405
406      If you are going to build the stage 3 compiler, then you might
407      want to build only the C language in stage 2.
408
409      Once you have built the stage 2 compiler, if you are short of disk
410      space, you can delete the subdirectory `stage1'.
411
412      On a 68000 or 68020 system lacking floating point hardware, unless
413      you have selected a `tm.h' file that expects by default that there
414      is no such hardware, do this instead:
415
416           make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float"
417
418  13. If you wish to test the compiler by compiling it with itself one
419      more time, install any other necessary GNU tools (such as GAS or
420      the GNU linker) in the `stage2' subdirectory as you did in the
421      `stage1' subdirectory, then do this:
422
423           make stage2
424           make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2"
425
426      This is called making the stage 3 compiler.  Aside from the `-B'
427      option, the compiler options should be the same as when you made
428      the stage 2 compiler.  But the `LANGUAGES' option need not be the
429      same.  The command shown above builds compilers for all the
430      supported languages; if you don't want them all, you can specify
431      the languages to build by typing the argument `LANGUAGES="LIST"',
432      as described above.
433
434      If you do not have to install any additional GNU tools, you may
435      use the command
436
437           make bootstrap LANGUAGES=LANGUAGE-LIST BOOT_CFLAGS=OPTION-LIST
438
439      instead of making `stage1', `stage2', and performing the two
440      compiler builds.
441
442  14. Compare the latest object files with the stage 2 object files--they
443      ought to be identical, aside from time stamps (if any).
444
445      On some systems, meaningful comparison of object files is
446      impossible; they always appear "different."  This is currently
447      true on Solaris and some systems that use ELF object file format.
448      On some versions of Irix on SGI machines and DEC Unix (OSF/1) on
449      Alpha systems, you will not be able to compare the files without
450      specifying `-save-temps'; see the description of individual
451      systems above to see if you get comparison failures.  You may have
452      similar problems on other systems.
453
454      Use this command to compare the files:
455
456           make compare
457
458      This will mention any object files that differ between stage 2 and
459      stage 3.  Any difference, no matter how innocuous, indicates that
460      the stage 2 compiler has compiled GNU CC incorrectly, and is
461      therefore a potentially serious bug which you should investigate
462      and report.
463
464      If your system does not put time stamps in the object files, then
465      this is a faster way to compare them (using the Bourne shell):
466
467           for file in *.o; do
468           cmp $file stage2/$file
469           done
470
471      If you have built the compiler with the `-mno-mips-tfile' option on
472      MIPS machines, you will not be able to compare the files.
473
474  15. Install the compiler driver, the compiler's passes and run-time
475      support with `make install'.  Use the same value for `CC',
476      `CFLAGS' and `LANGUAGES' that you used when compiling the files
477      that are being installed.  One reason this is necessary is that
478      some versions of Make have bugs and recompile files gratuitously
479      when you do this step.  If you use the same variable values, those
480      files will be recompiled properly.
481
482      For example, if you have built the stage 2 compiler, you can use
483      the following command:
484
485           make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="LIST"
486
487      This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1',
488      `cpp' and `libgcc.a' in the directory
489      `/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the
490      compiler driver program looks for them.  Here TARGET is the
491      canonicalized form of target machine type specified when you ran
492      `configure', and VERSION is the version number of GNU CC.  This
493      naming scheme permits various versions and/or cross-compilers to
494      coexist.  It also copies the executables for compilers for other
495      languages (e.g., `cc1plus' for C++) to the same directory.
496
497      This also copies the driver program `xgcc' into
498      `/usr/local/bin/gcc', so that it appears in typical execution
499      search paths.  It also copies `gcc.1' into `/usr/local/man/man1'
500      and info pages into `/usr/local/info'.
501
502      On some systems, this command causes recompilation of some files.
503      This is usually due to bugs in `make'.  You should either ignore
504      this problem, or use GNU Make.
505
506      *Warning: there is a bug in `alloca' in the Sun library.  To avoid
507      this bug, be sure to install the executables of GNU CC that were
508      compiled by GNU CC.  (That is, the executables from stage 2 or 3,
509      not stage 1.)  They use `alloca' as a built-in function and never
510      the one in the library.*
511
512      (It is usually better to install GNU CC executables from stage 2
513      or 3, since they usually run faster than the ones compiled with
514      some other compiler.)
515
516  16. If you're going to use C++, you need to install the C++ runtime
517      library.  This includes all I/O functionality, special class
518      libraries, etc.
519
520      The standard C++ runtime library for GNU CC is called `libstdc++'.
521      An obsolescent library `libg++' may also be available, but it's
522      necessary only for older software that hasn't been converted yet;
523      if you don't know whether you need `libg++' then you probably don't
524      need it.
525
526      Here's one way to build and install `libstdc++' for GNU CC:
527
528         * Build and install GNU CC, so that invoking `gcc' obtains the
529           GNU CC that was just built.
530
531         * Obtain a copy of a compatible `libstdc++' distribution.  For
532           example, the `libstdc++-2.8.0.tar.gz' distribution should be
533           compatible with GCC 2.8.0.  GCC distributors normally
534           distribute `libstdc++' as well.
535
536         * Set the `CXX' environment variable to `gcc' while running the
537           `libstdc++' distribution's `configure' command.  Use the same
538           `configure' options that you used when you invoked GCC's
539           `configure' command.
540
541         * Invoke `make' to build the C++ runtime.
542
543         * Invoke `make install' to install the C++ runtime.
544
545      To summarize, after building and installing GNU CC, invoke the
546      following shell commands in the topmost directory of the C++
547      library distribution.  For CONFIGURE-OPTIONS, use the same options
548      that you used to configure GNU CC.
549
550           $ CXX=gcc ./configure CONFIGURE-OPTIONS
551           $ make
552           $ make install
553
554  17. GNU CC includes a runtime library for Objective-C because it is an
555      integral part of the language.  You can find the files associated
556      with the library in the subdirectory `objc'.  The GNU Objective-C
557      Runtime Library requires header files for the target's C library in
558      order to be compiled,and also requires the header files for the
559      target's thread library if you want thread support.  *Note
560      Cross-Compilers and Header Files: Cross Headers, for discussion
561      about header files issues for cross-compilation.
562
563      When you run `configure', it picks the appropriate Objective-C
564      thread implementation file for the target platform.  In some
565      situations, you may wish to choose a different back-end as some
566      platforms support multiple thread implementations or you may wish
567      to disable thread support completely.  You do this by specifying a
568      value for the OBJC_THREAD_FILE makefile variable on the command
569      line when you run make, for example:
570
571           make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" OBJC_THREAD_FILE=thr-single
572
573      Below is a list of the currently available back-ends.
574
575         * thr-single Disable thread support, should work for all
576           platforms.
577
578         * thr-decosf1 DEC OSF/1 thread support.
579
580         * thr-irix SGI IRIX thread support.
581
582         * thr-mach Generic MACH thread support, known to work on
583           NEXTSTEP.
584
585         * thr-os2 IBM OS/2 thread support.
586
587         * thr-posix Generix POSIX thread support.
588
589         * thr-pthreads PCThreads on Linux-based GNU systems.
590
591         * thr-solaris SUN Solaris thread support.
592
593         * thr-win32 Microsoft Win32 API thread support.
594
595 Files Created by `configure'
596 ============================
597
598    Here we spell out what files will be set up by `configure'.  Normally
599 you need not be concerned with these files.
600
601    * A file named `config.h' is created that contains a `#include' of
602      the top-level config file for the machine you will run the compiler
603      on (*note The Configuration File: (gcc.info)Config.).  This file
604      is responsible for defining information about the host machine.
605      It includes `tm.h'.
606
607      The top-level config file is located in the subdirectory `config'.
608      Its name is always `xm-SOMETHING.h'; usually `xm-MACHINE.h', but
609      there are some exceptions.
610
611      If your system does not support symbolic links, you might want to
612      set up `config.h' to contain a `#include' command which refers to
613      the appropriate file.
614
615    * A file named `tconfig.h' is created which includes the top-level
616      config file for your target machine.  This is used for compiling
617      certain programs to run on that machine.
618
619    * A file named `tm.h' is created which includes the
620      machine-description macro file for your target machine.  It should
621      be in the subdirectory `config' and its name is often `MACHINE.h'.
622
623    * The command file `configure' also constructs the file `Makefile'
624      by adding some text to the template file `Makefile.in'.  The
625      additional text comes from files in the `config' directory, named
626      `t-TARGET' and `x-HOST'.  If these files do not exist, it means
627      nothing needs to be added for a given target or host.
628
629 Configurations Supported by GNU CC
630 ==================================
631
632    Here are the possible CPU types:
633
634      1750a, a29k, alpha, arm, avr, cN, clipper, dsp16xx, elxsi, fr30,
635      h8300, hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860,
636      i960, m32r, m68000, m68k, m88k, mcore, mips, mipsel, mips64,
637      mips64el, mn10200, mn10300, ns32k, pdp11, powerpc, powerpcle,
638      romp, rs6000, sh, sparc, sparclite, sparc64, v850, vax, we32k.
639
640    Here are the recognized company names.  As you can see, customary
641 abbreviations are used rather than the longer official names.
642
643      acorn, alliant, altos, apollo, apple, att, bull, cbm, convergent,
644      convex, crds, dec, dg, dolphin, elxsi, encore, harris, hitachi,
645      hp, ibm, intergraph, isi, mips, motorola, ncr, next, ns, omron,
646      plexus, sequent, sgi, sony, sun, tti, unicom, wrs.
647
648    The company name is meaningful only to disambiguate when the rest of
649 the information supplied is insufficient.  You can omit it, writing
650 just `CPU-SYSTEM', if it is not needed.  For example, `vax-ultrix4.2'
651 is equivalent to `vax-dec-ultrix4.2'.
652
653    Here is a list of system types:
654
655      386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff,
656      ctix, cxux, dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms,
657      genix, gnu, linux-gnu, hiux, hpux, iris, irix, isc, luna, lynxos,
658      mach, minix, msdos, mvs, netbsd, newsos, nindy, ns, osf, osfrose,
659      ptx, riscix, riscos, rtu, sco, sim, solaris, sunos, sym, sysv,
660      udi, ultrix, unicos, uniplus, unos, vms, vsta, vxworks, winnt,
661      xenix.
662
663 You can omit the system type; then `configure' guesses the operating
664 system from the CPU and company.
665
666    You can add a version number to the system type; this may or may not
667 make a difference.  For example, you can write `bsd4.3' or `bsd4.4' to
668 distinguish versions of BSD.  In practice, the version number is most
669 needed for `sysv3' and `sysv4', which are often treated differently.
670
671    If you specify an impossible combination such as `i860-dg-vms', then
672 you may get an error message from `configure', or it may ignore part of
673 the information and do the best it can with the rest.  `configure'
674 always prints the canonical name for the alternative that it used.  GNU
675 CC does not support all possible alternatives.
676
677    Often a particular model of machine has a name.  Many machine names
678 are recognized as aliases for CPU/company combinations.  Thus, the
679 machine name `sun3', mentioned above, is an alias for `m68k-sun'.
680 Sometimes we accept a company name as a machine name, when the name is
681 popularly used for a particular machine.  Here is a table of the known
682 machine names:
683
684      3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300,
685      balance, convex-cN, crds, decstation-3100, decstation, delta,
686      encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN,
687      hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe,
688      mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc,
689      powerpcle, ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3,
690      sun4, symmetry, tower-32, tower.
691
692 Remember that a machine name specifies both the cpu type and the company
693 name.  If you want to install your own homemade configuration files,
694 you can use `local' as the company name to access them.  If you use
695 configuration `CPU-local', the configuration name without the cpu prefix
696 is used to form the configuration file names.
697
698    Thus, if you specify `m68k-local', configuration uses files
699 `m68k.md', `local.h', `m68k.c', `xm-local.h', `t-local', and `x-local',
700 all in the directory `config/m68k'.
701
702    Here is a list of configurations that have special treatment or
703 special things you must know:
704
705 `1750a-*-*'
706      MIL-STD-1750A processors.
707
708      The MIL-STD-1750A cross configuration produces output for
709      `as1750', an assembler/linker available under the GNU Public
710      License for the 1750A. `as1750' can be obtained at
711      *ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/*.  A similarly
712      licensed simulator for the 1750A is available from same address.
713
714      You should ignore a fatal error during the building of libgcc
715      (libgcc is not yet implemented for the 1750A.)
716
717      The `as1750' assembler requires the file `ms1750.inc', which is
718      found in the directory `config/1750a'.
719
720      GNU CC produced the same sections as the Fairchild F9450 C
721      Compiler, namely:
722
723     `Normal'
724           The program code section.
725
726     `Static'
727           The read/write (RAM) data section.
728
729     `Konst'
730           The read-only (ROM) constants section.
731
732     `Init'
733           Initialization section (code to copy KREL to SREL).
734
735      The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16).
736      This means that type `char' is represented with a 16-bit word per
737      character.  The 1750A's "Load/Store Upper/Lower Byte" instructions
738      are not used by GNU CC.
739
740 `alpha-*-osf1'
741      Systems using processors that implement the DEC Alpha architecture
742      and are running the DEC Unix (OSF/1) operating system, for example
743      the DEC Alpha AXP systems.CC.)
744
745      GNU CC writes a `.verstamp' directive to the assembler output file
746      unless it is built as a cross-compiler.  It gets the version to
747      use from the system header file `/usr/include/stamp.h'.  If you
748      install a new version of DEC Unix, you should rebuild GCC to pick
749      up the new version stamp.
750
751      Note that since the Alpha is a 64-bit architecture,
752      cross-compilers from 32-bit machines will not generate code as
753      efficient as that generated when the compiler is running on a
754      64-bit machine because many optimizations that depend on being
755      able to represent a word on the target in an integral value on the
756      host cannot be performed.  Building cross-compilers on the Alpha
757      for 32-bit machines has only been tested in a few cases and may
758      not work properly.
759
760      `make compare' may fail on old versions of DEC Unix unless you add
761      `-save-temps' to `CFLAGS'.  On these systems, the name of the
762      assembler input file is stored in the object file, and that makes
763      comparison fail if it differs between the `stage1' and `stage2'
764      compilations.  The option `-save-temps' forces a fixed name to be
765      used for the assembler input file, instead of a randomly chosen
766      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
767      fail without that option.  If you add `-save-temps', you will have
768      to manually delete the `.i' and `.s' files after each series of
769      compilations.
770
771      GNU CC now supports both the native (ECOFF) debugging format used
772      by DBX and GDB and an encapsulated STABS format for use only with
773      GDB.  See the discussion of the `--with-stabs' option of
774      `configure' above for more information on these formats and how to
775      select them.
776
777      There is a bug in DEC's assembler that produces incorrect line
778      numbers for ECOFF format when the `.align' directive is used.  To
779      work around this problem, GNU CC will not emit such alignment
780      directives while writing ECOFF format debugging information even
781      if optimization is being performed.  Unfortunately, this has the
782      very undesirable side-effect that code addresses when `-O' is
783      specified are different depending on whether or not `-g' is also
784      specified.
785
786      To avoid this behavior, specify `-gstabs+' and use GDB instead of
787      DBX.  DEC is now aware of this problem with the assembler and
788      hopes to provide a fix shortly.
789
790 `arc-*-elf'
791      Argonaut ARC processor.  This configuration is intended for
792      embedded systems.
793
794 `arm-*-aout'
795      Advanced RISC Machines ARM-family processors.  These are often
796      used in embedded applications.  There are no standard Unix
797      configurations.  This configuration corresponds to the basic
798      instruction sequences and will produce `a.out' format object
799      modules.
800
801      You may need to make a variant of the file `arm.h' for your
802      particular configuration.
803
804 `arm-*-elf'
805      This configuration is intended for embedded systems.
806
807 `arm-*-linux-gnuaout'
808      Any of the ARM-family processors running the Linux-based GNU
809      system with the `a.out' binary format.  This is an obsolete
810      configuration.
811
812 `arm-*-linux-gnu'
813 `arm-*-linux-gnuoldld'
814      Any of the ARM-family processors running the Linux-based GNU
815      system with the `ELF' binary format.  You must use version
816      2.9.1.0.22 or later of the GNU/Linux binutils, which you can
817      download from `ftp.varesearch.com:/pub/support/hjl/binutils'.
818
819      These two configurations differ only in the required version of GNU
820      binutils.  For binutils 2.9.1.0.x, use `arm-*-linux-gnuoldld'.  For
821      newer versions of binutils, use `arm-*-linux-gnu'.
822
823 `arm-*-riscix'
824      The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD
825      Unix.  If you are running a version of RISC iX prior to 1.2 then
826      you must specify the version number during configuration.  Note
827      that the assembler shipped with RISC iX does not support stabs
828      debugging information; a new version of the assembler, with stabs
829      support included, is now available from Acorn and via ftp
830      `ftp.acorn.com:/pub/riscix/as+xterm.tar.Z'.  To enable stabs
831      debugging, pass `--with-gnu-as' to configure.
832
833      You will need to install GNU `sed' before you can run configure.
834
835 `a29k'
836      AMD Am29k-family processors.  These are normally used in embedded
837      applications.  There are no standard Unix configurations.  This
838      configuration corresponds to AMD's standard calling sequence and
839      binary interface and is compatible with other 29k tools.
840
841      You may need to make a variant of the file `a29k.h' for your
842      particular configuration.
843
844 `a29k-*-bsd'
845      AMD Am29050 used in a system running a variant of BSD Unix.
846
847 `avr'
848      ATMEL AVR-family micro controllers.  These are used in embedded
849      applications.  There are no standard Unix configurations.
850      Supports following MCU's:  - AT90S23xx  - ATtiny22  - AT90S44xx  -
851      AT90S85xx  - ATmega603/603L  - ATmega103/103L
852
853 `decstation-*'
854      MIPS-based DECstations can support three different personalities:
855      Ultrix, DEC OSF/1, and OSF/rose.  (Alpha-based DECstation products
856      have a configuration name beginning with `alpha-dec'.)  To
857      configure GCC for these platforms use the following configurations:
858
859     `decstation-ultrix'
860           Ultrix configuration.
861
862     `decstation-osf1'
863           Dec's version of OSF/1.
864
865     `decstation-osfrose'
866           Open Software Foundation reference port of OSF/1 which uses
867           the OSF/rose object file format instead of ECOFF.  Normally,
868           you would not select this configuration.
869
870      The MIPS C compiler needs to be told to increase its table size
871      for switch statements with the `-Wf,-XNg1500' option in order to
872      compile `cp/parse.c'.  If you use the `-O2' optimization option,
873      you also need to use `-Olimit 3000'.  Both of these options are
874      automatically generated in the `Makefile' that the shell script
875      `configure' builds.  If you override the `CC' make variable and
876      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
877      3000'.
878
879 `elxsi-elxsi-bsd'
880      The Elxsi's C compiler has known limitations that prevent it from
881      compiling GNU C.  Please contact `mrs@cygnus.com' for more details.
882
883 `dsp16xx'
884      A port to the AT&T DSP1610 family of processors.
885
886 `h8300-*-*'
887      Hitachi H8/300 series of processors.
888
889      The calling convention and structure layout has changed in release
890      2.6.  All code must be recompiled.  The calling convention now
891      passes the first three arguments in function calls in registers.
892      Structures are no longer a multiple of 2 bytes.
893
894 `hppa*-*-*'
895      There are several variants of the HP-PA processor which run a
896      variety of operating systems.  GNU CC must be configured to use
897      the correct processor type and operating system, or GNU CC will
898      not function correctly.  The easiest way to handle this problem is
899      to *not* specify a target when configuring GNU CC, the `configure'
900      script will try to automatically determine the right processor
901      type and operating system.
902
903      `-g' does not work on HP-UX, since that system uses a peculiar
904      debugging format which GNU CC does not know about.  However, `-g'
905      will work if you also use GAS and GDB in conjunction with GCC.  We
906      highly recommend using GAS for all HP-PA configurations.
907
908      You should be using GAS-2.6 (or later) along with GDB-4.16 (or
909      later).  These can be retrieved from all the traditional GNU ftp
910      archive sites.
911
912      On some versions of HP-UX, you will need to install GNU `sed'.
913
914      You will need to be install GAS into a directory before `/bin',
915      `/usr/bin', and `/usr/ccs/bin' in your search path.  You should
916      install GAS before you build GNU CC.
917
918      To enable debugging, you must configure GNU CC with the
919      `--with-gnu-as' option before building.
920
921 `i370-*-*'
922      This port is very preliminary and has many known bugs.  We hope to
923      have a higher-quality port for this machine soon.
924
925 `i386-*-linux-gnuoldld'
926      Use this configuration to generate `a.out' binaries on Linux-based
927      GNU systems if you do not have gas/binutils version 2.5.2 or later
928      installed. This is an obsolete configuration.
929
930 `i386-*-linux-gnuaout'
931      Use this configuration to generate `a.out' binaries on Linux-based
932      GNU systems. This configuration is being superseded. You must use
933      gas/binutils version 2.5.2 or later.
934
935 `i386-*-linux-gnu'
936      Use this configuration to generate ELF binaries on Linux-based GNU
937      systems.  You must use gas/binutils version 2.5.2 or later.
938
939 `i386-*-sco'
940      Compilation with RCC is recommended.  Also, it may be a good idea
941      to link with GNU malloc instead of the malloc that comes with the
942      system.
943
944 `i386-*-sco3.2v4'
945      Use this configuration for SCO release 3.2 version 4.
946
947 `i386-*-sco3.2v5*'
948      Use this for the SCO OpenServer Release family including 5.0.0,
949      5.0.2, 5.0.4, 5.0.5, Internet FastStart 1.0, and Internet
950      FastStart 1.1.
951
952      GNU CC can generate COFF binaries if you specify `-mcoff' or ELF
953      binaries, the default.    A full `make bootstrap' is recommended
954      so that an ELF compiler that builds ELF is generated.
955
956      You must have TLS597 from `ftp://ftp.sco.com/TLS' installed for ELF
957      C++ binaries to work correctly on releases before 5.0.4.
958
959      The native SCO assembler that is provided with the OS at no charge
960      is normally required.  If, however, you must be able to use the GNU
961      assembler (perhaps you have complex asms) you must configure this
962      package `--with-gnu-as'.  To do this, install (cp or symlink)
963      gcc/as to your copy of the GNU assembler.  You must use a recent
964      version of GNU binutils; version 2.9.1 seems to work well.  If you
965      select this option, you will be unable to build COFF images.
966      Trying to do so will result in non-obvious failures.  In general,
967      the "-with-gnu-as" option isn't as well tested as the native
968      assembler.
969
970      *NOTE:* If you are building C++, you must follow the instructions
971      about invoking `make bootstrap' because the native OpenServer
972      compiler may build a `cc1plus' that will not correctly parse many
973      valid C++ programs.  You must do a `make bootstrap' if you are
974      building with the native compiler.
975
976 `i386-*-isc'
977      It may be a good idea to link with GNU malloc instead of the
978      malloc that comes with the system.
979
980      In ISC version 4.1, `sed' core dumps when building `deduced.h'.
981      Use the version of `sed' from version 4.0.
982
983 `i386-*-esix'
984      It may be good idea to link with GNU malloc instead of the malloc
985      that comes with the system.
986
987 `i386-ibm-aix'
988      You need to use GAS version 2.1 or later, and LD from GNU binutils
989      version 2.2 or later.
990
991 `i386-sequent-bsd'
992      Go to the Berkeley universe before compiling.
993
994 `i386-sequent-ptx1*'
995 `i386-sequent-ptx2*'
996      You must install GNU `sed' before running `configure'.
997
998 `i386-sun-sunos4'
999      You may find that you need another version of GNU CC to begin
1000      bootstrapping with, since the current version when built with the
1001      system's own compiler seems to get an infinite loop compiling part
1002      of `libgcc2.c'.  GNU CC version 2 compiled with GNU CC (any
1003      version) seems not to have this problem.
1004
1005      See *Note Sun Install::, for information on installing GNU CC on
1006      Sun systems.
1007
1008 `i[345]86-*-winnt3.5'
1009      This version requires a GAS that has not yet been released.  Until
1010      it is, you can get a prebuilt binary version via anonymous ftp from
1011      `cs.washington.edu:pub/gnat' or `cs.nyu.edu:pub/gnat'. You must
1012      also use the Microsoft header files from the Windows NT 3.5 SDK.
1013      Find these on the CDROM in the `/mstools/h' directory dated
1014      9/4/94.  You must use a fixed version of Microsoft linker made
1015      especially for NT 3.5, which is also is available on the NT 3.5
1016      SDK CDROM.  If you do not have this linker, can you also use the
1017      linker from Visual C/C++ 1.0 or 2.0.
1018
1019      Installing GNU CC for NT builds a wrapper linker, called `ld.exe',
1020      which mimics the behaviour of Unix `ld' in the specification of
1021      libraries (`-L' and `-l').  `ld.exe' looks for both Unix and
1022      Microsoft named libraries.  For example, if you specify `-lfoo',
1023      `ld.exe' will look first for `libfoo.a' and then for `foo.lib'.
1024
1025      You may install GNU CC for Windows NT in one of two ways,
1026      depending on whether or not you have a Unix-like shell and various
1027      Unix-like utilities.
1028
1029        1. If you do not have a Unix-like shell and few Unix-like
1030           utilities, you will use a DOS style batch script called
1031           `configure.bat'.  Invoke it as `configure winnt' from an
1032           MSDOS console window or from the program manager dialog box.
1033           `configure.bat' assumes you have already installed and have
1034           in your path a Unix-like `sed' program which is used to
1035           create a working `Makefile' from `Makefile.in'.
1036
1037           `Makefile' uses the Microsoft Nmake program maintenance
1038           utility and the Visual C/C++ V8.00 compiler to build GNU CC.
1039           You need only have the utilities `sed' and `touch' to use
1040           this installation method, which only automatically builds the
1041           compiler itself.  You must then examine what `fixinc.winnt'
1042           does, edit the header files by hand and build `libgcc.a'
1043           manually.
1044
1045        2. The second type of installation assumes you are running a
1046           Unix-like shell, have a complete suite of Unix-like utilities
1047           in your path, and have a previous version of GNU CC already
1048           installed, either through building it via the above
1049           installation method or acquiring a pre-built binary.  In this
1050           case, use the `configure' script in the normal fashion.
1051
1052 `i860-intel-osf1'
1053      This is the Paragon.  If you have version 1.0 of the operating
1054      system, you need to take special steps to build GNU CC due to
1055      peculiarities of the system.  Newer system versions have no
1056      problem.  See the section `Installation Problems' in the GNU CC
1057      Manual.
1058
1059 `*-lynx-lynxos'
1060      LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
1061      `/bin/gcc'.  You should compile with this instead of `/bin/cc'.
1062      You can tell GNU CC to use the GNU assembler and linker, by
1063      specifying `--with-gnu-as --with-gnu-ld' when configuring.  These
1064      will produce COFF format object files and executables;  otherwise
1065      GNU CC will use the installed tools, which produce `a.out' format
1066      executables.
1067
1068 `m32r-*-elf'
1069      Mitsubishi M32R processor.  This configuration is intended for
1070      embedded systems.
1071
1072 `m68000-hp-bsd'
1073      HP 9000 series 200 running BSD.  Note that the C compiler that
1074      comes with this system cannot compile GNU CC; contact
1075      `law@cygnus.com' to get binaries of GNU CC for bootstrapping.
1076
1077 `m68k-altos'
1078      Altos 3068.  You must use the GNU assembler, linker and debugger.
1079      Also, you must fix a kernel bug.  Details in the file
1080      `README.ALTOS'.
1081
1082 `m68k-apple-aux'
1083      Apple Macintosh running A/UX.  You may configure GCC  to use
1084      either the system assembler and linker or the GNU assembler and
1085      linker.  You should use the GNU configuration if you can,
1086      especially if you also want to use GNU C++.  You enabled that
1087      configuration with + the `--with-gnu-as' and `--with-gnu-ld'
1088      options to `configure'.
1089
1090      Note the C compiler that comes with this system cannot compile GNU
1091      CC.  You can find binaries of GNU CC for bootstrapping on
1092      `jagubox.gsfc.nasa.gov'.  You will also a patched version of
1093      `/bin/ld' there that raises some of the arbitrary limits found in
1094      the original.
1095
1096 `m68k-att-sysv'
1097      AT&T 3b1, a.k.a. 7300 PC.  This version of GNU CC cannot be
1098      compiled with the system C compiler, which is too buggy.  You will
1099      need to get a previous version of GCC and use it to bootstrap.
1100      Binaries are available from the OSU-CIS archive, at
1101      `ftp://archive.cis.ohio-state.edu/pub/att7300/'.
1102
1103 `m68k-bull-sysv'
1104      Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU
1105      CC works either with native assembler or GNU assembler. You can use
1106      GNU assembler with native coff generation by providing
1107      `--with-gnu-as' to the configure script or use GNU assembler with
1108      dbx-in-coff encapsulation by providing `--with-gnu-as --stabs'.
1109      For any problem with native assembler or for availability of the
1110      DPX/2 port of GAS, contact `F.Pierresteguy@frcl.bull.fr'.
1111
1112 `m68k-crds-unox'
1113      Use `configure unos' for building on Unos.
1114
1115      The Unos assembler is named `casm' instead of `as'.  For some
1116      strange reason linking `/bin/as' to `/bin/casm' changes the
1117      behavior, and does not work.  So, when installing GNU CC, you
1118      should install the following script as `as' in the subdirectory
1119      where the passes of GCC are installed:
1120
1121           #!/bin/sh
1122           casm $*
1123
1124      The default Unos library is named `libunos.a' instead of `libc.a'.
1125      To allow GNU CC to function, either change all references to
1126      `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to
1127      `/lib/libunos.a'.
1128
1129      When compiling GNU CC with the standard compiler, to overcome bugs
1130      in the support of `alloca', do not use `-O' when making stage 2.
1131      Then use the stage 2 compiler with `-O' to make the stage 3
1132      compiler.  This compiler will have the same characteristics as the
1133      usual stage 2 compiler on other systems.  Use it to make a stage 4
1134      compiler and compare that with stage 3 to verify proper
1135      compilation.
1136
1137      (Perhaps simply defining `ALLOCA' in `x-crds' as described in the
1138      comments there will make the above paragraph superfluous.  Please
1139      inform us of whether this works.)
1140
1141      Unos uses memory segmentation instead of demand paging, so you
1142      will need a lot of memory.  5 Mb is barely enough if no other
1143      tasks are running.  If linking `cc1' fails, try putting the object
1144      files into a library and linking from that library.
1145
1146 `m68k-hp-hpux'
1147      HP 9000 series 300 or 400 running HP-UX.  HP-UX version 8.0 has a
1148      bug in the assembler that prevents compilation of GNU CC.  To fix
1149      it, get patch PHCO_4484 from HP.
1150
1151      In addition, if you wish to use gas `--with-gnu-as' you must use
1152      gas version 2.1 or later, and you must use the GNU linker version
1153      2.1 or later.  Earlier versions of gas relied upon a program which
1154      converted the gas output into the native HP-UX format, but that
1155      program has not been kept up to date.  gdb does not understand
1156      that native HP-UX format, so you must use gas if you wish to use
1157      gdb.
1158
1159 `m68k-sun'
1160      Sun 3.  We do not provide a configuration file to use the Sun FPA
1161      by default, because programs that establish signal handlers for
1162      floating point traps inherently cannot work with the FPA.
1163
1164      See *Note Sun Install::, for information on installing GNU CC on
1165      Sun systems.
1166
1167 `m88k-*-svr3'
1168      Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
1169      These systems tend to use the Green Hills C, revision 1.8.5, as the
1170      standard C compiler.  There are apparently bugs in this compiler
1171      that result in object files differences between stage 2 and stage
1172      3.  If this happens, make the stage 4 compiler and compare it to
1173      the stage 3 compiler.  If the stage 3 and stage 4 object files are
1174      identical, this suggests you encountered a problem with the
1175      standard C compiler; the stage 3 and 4 compilers may be usable.
1176
1177      It is best, however, to use an older version of GNU CC for
1178      bootstrapping if you have one.
1179
1180 `m88k-*-dgux'
1181      Motorola m88k running DG/UX.  To build 88open BCS native or cross
1182      compilers on DG/UX, specify the configuration name as
1183      `m88k-*-dguxbcs' and build in the 88open BCS software development
1184      environment.  To build ELF native or cross compilers on DG/UX,
1185      specify `m88k-*-dgux' and build in the DG/UX ELF development
1186      environment.  You set the software development environment by
1187      issuing `sde-target' command and specifying either `m88kbcs' or
1188      `m88kdguxelf' as the operand.
1189
1190      If you do not specify a configuration name, `configure' guesses the
1191      configuration based on the current software development
1192      environment.
1193
1194 `m88k-tektronix-sysv3'
1195      Tektronix XD88 running UTekV 3.2e.  Do not turn on optimization
1196      while building stage1 if you bootstrap with the buggy Green Hills
1197      compiler.  Also, The bundled LAI System V NFS is buggy so if you
1198      build in an NFS mounted directory, start from a fresh reboot, or
1199      avoid NFS all together.  Otherwise you may have trouble getting
1200      clean comparisons between stages.
1201
1202 `mips-mips-bsd'
1203      MIPS machines running the MIPS operating system in BSD mode.  It's
1204      possible that some old versions of the system lack the functions
1205      `memcpy', `memcmp', and `memset'.  If your system lacks these, you
1206      must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in
1207      `mips-bsd.h'.
1208
1209      The MIPS C compiler needs to be told to increase its table size
1210      for switch statements with the `-Wf,-XNg1500' option in order to
1211      compile `cp/parse.c'.  If you use the `-O2' optimization option,
1212      you also need to use `-Olimit 3000'.  Both of these options are
1213      automatically generated in the `Makefile' that the shell script
1214      `configure' builds.  If you override the `CC' make variable and
1215      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
1216      3000'.
1217
1218 `mips-mips-riscos*'
1219      The MIPS C compiler needs to be told to increase its table size
1220      for switch statements with the `-Wf,-XNg1500' option in order to
1221      compile `cp/parse.c'.  If you use the `-O2' optimization option,
1222      you also need to use `-Olimit 3000'.  Both of these options are
1223      automatically generated in the `Makefile' that the shell script
1224      `configure' builds.  If you override the `CC' make variable and
1225      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
1226      3000'.
1227
1228      MIPS computers running RISC-OS can support four different
1229      personalities: default, BSD 4.3, System V.3, and System V.4 (older
1230      versions of RISC-OS don't support V.4).  To configure GCC for
1231      these platforms use the following configurations:
1232
1233     `mips-mips-riscos`rev''
1234           Default configuration for RISC-OS, revision `rev'.
1235
1236     `mips-mips-riscos`rev'bsd'
1237           BSD 4.3 configuration for RISC-OS, revision `rev'.
1238
1239     `mips-mips-riscos`rev'sysv4'
1240           System V.4 configuration for RISC-OS, revision `rev'.
1241
1242     `mips-mips-riscos`rev'sysv'
1243           System V.3 configuration for RISC-OS, revision `rev'.
1244
1245      The revision `rev' mentioned above is the revision of RISC-OS to
1246      use.  You must reconfigure GCC when going from a RISC-OS revision
1247      4 to RISC-OS revision 5.  This has the effect of avoiding a linker
1248      bug.
1249
1250 `mips-sgi-*'
1251      In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
1252      option must be installed from the CD-ROM supplied from Silicon
1253      Graphics.  This is found on the 2nd CD in release 4.0.1.
1254
1255      In order to compile GCC on an SGI running IRIX 5, the
1256      "compiler_dev.hdr" subsystem must be installed from the IDO CD-ROM
1257      supplied by Silicon Graphics.
1258
1259      `make compare' may fail on version 5 of IRIX unless you add
1260      `-save-temps' to `CFLAGS'.  On these systems, the name of the
1261      assembler input file is stored in the object file, and that makes
1262      comparison fail if it differs between the `stage1' and `stage2'
1263      compilations.  The option `-save-temps' forces a fixed name to be
1264      used for the assembler input file, instead of a randomly chosen
1265      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
1266      fail without that option.  If you do you `-save-temps', you will
1267      have to manually delete the `.i' and `.s' files after each series
1268      of compilations.
1269
1270      The MIPS C compiler needs to be told to increase its table size
1271      for switch statements with the `-Wf,-XNg1500' option in order to
1272      compile `cp/parse.c'.  If you use the `-O2' optimization option,
1273      you also need to use `-Olimit 3000'.  Both of these options are
1274      automatically generated in the `Makefile' that the shell script
1275      `configure' builds.  If you override the `CC' make variable and
1276      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
1277      3000'.
1278
1279      On Irix version 4.0.5F, and perhaps on some other versions as well,
1280      there is an assembler bug that reorders instructions incorrectly.
1281      To work around it, specify the target configuration
1282      `mips-sgi-irix4loser'.  This configuration inhibits assembler
1283      optimization.
1284
1285      In a compiler configured with target `mips-sgi-irix4', you can turn
1286      off assembler optimization by using the `-noasmopt' option.  This
1287      compiler option passes the option `-O0' to the assembler, to
1288      inhibit reordering.
1289
1290      The `-noasmopt' option can be useful for testing whether a problem
1291      is due to erroneous assembler reordering.  Even if a problem does
1292      not go away with `-noasmopt', it may still be due to assembler
1293      reordering--perhaps GNU CC itself was miscompiled as a result.
1294
1295      To enable debugging under Irix 5, you must use GNU as 2.5 or later,
1296      and use the `--with-gnu-as' configure option when configuring gcc.
1297      GNU as is distributed as part of the binutils package.
1298
1299      Under Irix 6, if you are using Irix `cc' as your bootstrap
1300      compiler, you must ensure that the N32 ABI is in use.  To test
1301      this, compile a simple C file with `cc' and then run `file'
1302      on the resulting object file.  The output should look like:
1303
1304                 test.o:         ELF N32 MSB ...
1305
1306      If you see:
1307
1308                 test.o:         ELF 32-bit MSB
1309
1310      then your version of `cc' uses the O32 ABI default.  You should
1311      set the environment variable `CC' to `cc -n32' before configuring
1312      GCC.
1313
1314 `mips-sony-sysv'
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
1319      linked in.
1320
1321 `ns32k-encore'
1322      Encore ns32000 system.  Encore systems are supported only under
1323      BSD.
1324
1325 `ns32k-*-genix'
1326      National Semiconductor ns32000 system.  Genix has bugs in `alloca'
1327      and `malloc'; you must get the compiled versions of these from GNU
1328      Emacs.
1329
1330 `ns32k-sequent'
1331      Go to the Berkeley universe before compiling.
1332
1333 `ns32k-utek'
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.
1337
1338 `romp-*-aos'
1339 `romp-*-mach'
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.
1348
1349 `rs6000-*-aix'
1350 `powerpc-*-aix'
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.
1359
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.
1367
1368      GNU CC does not yet support the 64-bit PowerPC instructions.
1369
1370      Objective C does not work on this architecture because it makes
1371      assumptions that are incompatible with the calling conventions.
1372
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".
1381
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
1389      executable.
1390
1391      By default, AIX 4.1 produces code that can be used on either Power
1392      or PowerPC processors.
1393
1394      You can specify a default version for the `-mcpu='CPU_TYPE switch
1395      by using the configure option `--with-cpu-'CPU_TYPE.
1396
1397 `powerpc-*-elf'
1398 `powerpc-*-sysv4'
1399      PowerPC system in big endian mode, running System V.4.
1400
1401      You can specify a default version for the `-mcpu='CPU_TYPE switch
1402      by using the configure option `--with-cpu-'CPU_TYPE.
1403
1404 `powerpc-*-linux-gnu'
1405      PowerPC system in big endian mode, running the Linux-based GNU
1406      system.
1407
1408      You can specify a default version for the `-mcpu='CPU_TYPE switch
1409      by using the configure option `--with-cpu-'CPU_TYPE.
1410
1411 `powerpc-*-eabiaix'
1412      Embedded PowerPC system in big endian mode with -mcall-aix
1413      selected as the default.
1414
1415      You can specify a default version for the `-mcpu='CPU_TYPE switch
1416      by using the configure option `--with-cpu-'CPU_TYPE.
1417
1418 `powerpc-*-eabisim'
1419      Embedded PowerPC system in big endian mode for use in running
1420      under the PSIM simulator.
1421
1422      You can specify a default version for the `-mcpu='CPU_TYPE switch
1423      by using the configure option `--with-cpu-'CPU_TYPE.
1424
1425 `powerpc-*-eabi'
1426      Embedded PowerPC system in big endian mode.
1427
1428      You can specify a default version for the `-mcpu='CPU_TYPE switch
1429      by using the configure option `--with-cpu-'CPU_TYPE.
1430
1431 `powerpcle-*-elf'
1432 `powerpcle-*-sysv4'
1433      PowerPC system in little endian mode, running System V.4.
1434
1435      You can specify a default version for the `-mcpu='CPU_TYPE switch
1436      by using the configure option `--with-cpu-'CPU_TYPE.
1437
1438 `powerpcle-*-solaris2*'
1439      PowerPC system in little endian mode, running Solaris 2.5.1 or
1440      higher.
1441
1442      You can specify a default version for the `-mcpu='CPU_TYPE switch
1443      by using the configure option `--with-cpu-'CPU_TYPE.  Beta
1444      versions of the Sun 4.0 compiler do not seem to be able to build
1445      GNU CC correctly.  There are also problems with the host assembler
1446      and linker that are fixed by using the GNU versions of these tools.
1447
1448 `powerpcle-*-eabisim'
1449      Embedded PowerPC system in little endian mode for use in running
1450      under the PSIM simulator.
1451
1452 `powerpcle-*-eabi'
1453      Embedded PowerPC system in little endian mode.
1454
1455      You can specify a default version for the `-mcpu='CPU_TYPE switch
1456      by using the configure option `--with-cpu-'CPU_TYPE.
1457
1458 `powerpcle-*-winnt'
1459 `powerpcle-*-pe'
1460      PowerPC system in little endian mode running Windows NT.
1461
1462      You can specify a default version for the `-mcpu='CPU_TYPE switch
1463      by using the configure option `--with-cpu-'CPU_TYPE.
1464
1465 `vax-dec-ultrix'
1466      Don't try compiling with Vax C (`vcc').  It produces incorrect code
1467      in some cases (for example, when `alloca' is used).
1468
1469      Meanwhile, compiling `cp/parse.c' with pcc does not work because of
1470      an internal table size limitation in that compiler.  To avoid this
1471      problem, compile just the GNU C compiler first, and use it to
1472      recompile building all the languages that you want to run.
1473
1474 `sparc-sun-*'
1475      See *Note Sun Install::, for information on installing GNU CC on
1476      Sun systems.
1477
1478 `vax-dec-vms'
1479      See *Note VMS Install::, for details on how to install GNU CC on
1480      VMS.
1481
1482 `we32k-*-*'
1483      These computers are also known as the 3b2, 3b5, 3b20 and other
1484      similar names.  (However, the 3b1 is actually a 68000; see *Note
1485      Configurations::.)
1486
1487      Don't use `-g' when compiling with the system's compiler.  The
1488      system's linker seems to be unable to handle such a large program
1489      with debugging information.
1490
1491      The system's compiler runs out of capacity when compiling `stmt.c'
1492      in GNU CC.  You can work around this by building `cpp' in GNU CC
1493      first, then use that instead of the system's preprocessor with the
1494      system's C compiler to compile `stmt.c'.  Here is how:
1495
1496           mv /lib/cpp /lib/cpp.att
1497           cp cpp /lib/cpp.gnu
1498           echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp
1499           chmod +x /lib/cpp
1500
1501      The system's compiler produces bad code for some of the GNU CC
1502      optimization files.  So you must build the stage 2 compiler without
1503      optimization.  Then build a stage 3 compiler with optimization.
1504      That executable should work.  Here are the necessary commands:
1505
1506           make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
1507           make stage2
1508           make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
1509
1510      You may need to raise the ULIMIT setting to build a C++ compiler,
1511      as the file `cc1plus' is larger than one megabyte.
1512
1513 Compilation in a Separate Directory
1514 ===================================
1515
1516    If you wish to build the object files and executables in a directory
1517 other than the one containing the source files, here is what you must
1518 do differently:
1519
1520   1. Make sure you have a version of Make that supports the `VPATH'
1521      feature.  (GNU Make supports it, as do Make versions on most BSD
1522      systems.)
1523
1524   2. If you have ever run `configure' in the source directory, you must
1525      undo the configuration.  Do this by running:
1526
1527           make distclean
1528
1529   3. Go to the directory in which you want to build the compiler before
1530      running `configure':
1531
1532           mkdir gcc-sun3
1533           cd gcc-sun3
1534
1535      On systems that do not support symbolic links, this directory must
1536      be on the same file system as the source code directory.
1537
1538   4. Specify where to find `configure' when you run it:
1539
1540           ../gcc/configure ...
1541
1542      This also tells `configure' where to find the compiler sources;
1543      `configure' takes the directory from the file name that was used to
1544      invoke it.  But if you want to be sure, you can specify the source
1545      directory with the `--srcdir' option, like this:
1546
1547           ../gcc/configure --srcdir=../gcc OTHER OPTIONS
1548
1549      The directory you specify with `--srcdir' need not be the same as
1550      the one that `configure' is found in.
1551
1552    Now, you can run `make' in that directory.  You need not repeat the
1553 configuration steps shown above, when ordinary source files change.  You
1554 must, however, run `configure' again when the configuration files
1555 change, if your system does not support symbolic links.
1556
1557 Building and Installing a Cross-Compiler
1558 ========================================
1559
1560    GNU CC can function as a cross-compiler for many machines, but not
1561 all.
1562
1563    * Cross-compilers for the Mips as target using the Mips assembler
1564      currently do not work, because the auxiliary programs
1565      `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything
1566      but a Mips.  It does work to cross compile for a Mips if you use
1567      the GNU assembler and linker.
1568
1569    * Cross-compilers between machines with different floating point
1570      formats have not all been made to work.  GNU CC now has a floating
1571      point emulator with which these can work, but each target machine
1572      description needs to be updated to take advantage of it.
1573
1574    * Cross-compilation between machines of different word sizes is
1575      somewhat problematic and sometimes does not work.
1576
1577    Since GNU CC generates assembler code, you probably need a
1578 cross-assembler that GNU CC can run, in order to produce object files.
1579 If you want to link on other than the target machine, you need a
1580 cross-linker as well.  You also need header files and libraries suitable
1581 for the target machine that you can install on the host machine.
1582
1583 Steps of Cross-Compilation
1584 --------------------------
1585
1586    To compile and run a program using a cross-compiler involves several
1587 steps:
1588
1589    * Run the cross-compiler on the host machine to produce assembler
1590      files for the target machine.  This requires header files for the
1591      target machine.
1592
1593    * Assemble the files produced by the cross-compiler.  You can do this
1594      either with an assembler on the target machine, or with a
1595      cross-assembler on the host machine.
1596
1597    * Link those files to make an executable.  You can do this either
1598      with a linker on the target machine, or with a cross-linker on the
1599      host machine.  Whichever machine you use, you need libraries and
1600      certain startup files (typically `crt....o') for the target
1601      machine.
1602
1603    It is most convenient to do all of these steps on the same host
1604 machine, since then you can do it all with a single invocation of GNU
1605 CC.  This requires a suitable cross-assembler and cross-linker.  For
1606 some targets, the GNU assembler and linker are available.
1607
1608 Configuring a Cross-Compiler
1609 ----------------------------
1610
1611    To build GNU CC as a cross-compiler, you start out by running
1612 `configure'.  Use the `--target=TARGET' to specify the target type.  If
1613 `configure' was unable to correctly identify the system you are running
1614 on, also specify the `--build=BUILD' option.  For example, here is how
1615 to configure for a cross-compiler that produces code for an HP 68030
1616 system running BSD on a system that `configure' can correctly identify:
1617
1618      ./configure --target=m68k-hp-bsd4.3
1619
1620 Tools and Libraries for a Cross-Compiler
1621 ----------------------------------------
1622
1623    If you have a cross-assembler and cross-linker available, you should
1624 install them now.  Put them in the directory `/usr/local/TARGET/bin'.
1625 Here is a table of the tools you should put in this directory:
1626
1627 `as'
1628      This should be the cross-assembler.
1629
1630 `ld'
1631      This should be the cross-linker.
1632
1633 `ar'
1634      This should be the cross-archiver: a program which can manipulate
1635      archive files (linker libraries) in the target machine's format.
1636
1637 `ranlib'
1638      This should be a program to construct a symbol table in an archive
1639      file.
1640
1641    The installation of GNU CC will find these programs in that
1642 directory, and copy or link them to the proper place to for the
1643 cross-compiler to find them when run later.
1644
1645    The easiest way to provide these files is to build the Binutils
1646 package and GAS.  Configure them with the same `--host' and `--target'
1647 options that you use for configuring GNU CC, then build and install
1648 them.  They install their executables automatically into the proper
1649 directory.  Alas, they do not support all the targets that GNU CC
1650 supports.
1651
1652    If you want to install libraries to use with the cross-compiler,
1653 such as a standard C library, put them in the directory
1654 `/usr/local/TARGET/lib'; installation of GNU CC copies all the files in
1655 that subdirectory into the proper place for GNU CC to find them and
1656 link with them.  Here's an example of copying some libraries from a
1657 target machine:
1658
1659      ftp TARGET-MACHINE
1660      lcd /usr/local/TARGET/lib
1661      cd /lib
1662      get libc.a
1663      cd /usr/lib
1664      get libg.a
1665      get libm.a
1666      quit
1667
1668 The precise set of libraries you'll need, and their locations on the
1669 target machine, vary depending on its operating system.
1670
1671    Many targets require "start files" such as `crt0.o' and `crtn.o'
1672 which are linked into each executable; these too should be placed in
1673 `/usr/local/TARGET/lib'.  There may be several alternatives for
1674 `crt0.o', for use with profiling or other compilation options.  Check
1675 your target's definition of `STARTFILE_SPEC' to find out what start
1676 files it uses.  Here's an example of copying these files from a target
1677 machine:
1678
1679      ftp TARGET-MACHINE
1680      lcd /usr/local/TARGET/lib
1681      prompt
1682      cd /lib
1683      mget *crt*.o
1684      cd /usr/lib
1685      mget *crt*.o
1686      quit
1687
1688 `libgcc.a' and Cross-Compilers
1689 ------------------------------
1690
1691    Code compiled by GNU CC uses certain runtime support functions
1692 implicitly.  Some of these functions can be compiled successfully with
1693 GNU CC itself, but a few cannot be.  These problem functions are in the
1694 source file `libgcc1.c'; the library made from them is called
1695 `libgcc1.a'.
1696
1697    When you build a native compiler, these functions are compiled with
1698 some other compiler-the one that you use for bootstrapping GNU CC.
1699 Presumably it knows how to open code these operations, or else knows how
1700 to call the run-time emulation facilities that the machine comes with.
1701 But this approach doesn't work for building a cross-compiler.  The
1702 compiler that you use for building knows about the host system, not the
1703 target system.
1704
1705    So, when you build a cross-compiler you have to supply a suitable
1706 library `libgcc1.a' that does the job it is expected to do.
1707
1708    To compile `libgcc1.c' with the cross-compiler itself does not work.
1709 The functions in this file are supposed to implement arithmetic
1710 operations that GNU CC does not know how to open code for your target
1711 machine.  If these functions are compiled with GNU CC itself, they will
1712 compile into infinite recursion.
1713
1714    On any given target, most of these functions are not needed.  If GNU
1715 CC can open code an arithmetic operation, it will not call these
1716 functions to perform the operation.  It is possible that on your target
1717 machine, none of these functions is needed.  If so, you can supply an
1718 empty library as `libgcc1.a'.
1719
1720    Many targets need library support only for multiplication and
1721 division.  If you are linking with a library that contains functions for
1722 multiplication and division, you can tell GNU CC to call them directly
1723 by defining the macros `MULSI3_LIBCALL', and the like.  These macros
1724 need to be defined in the target description macro file.  For some
1725 targets, they are defined already.  This may be sufficient to avoid the
1726 need for libgcc1.a; if so, you can supply an empty library.
1727
1728    Some targets do not have floating point instructions; they need other
1729 functions in `libgcc1.a', which do floating arithmetic.  Recent
1730 versions of GNU CC have a file which emulates floating point.  With a
1731 certain amount of work, you should be able to construct a floating
1732 point emulator that can be used as `libgcc1.a'.  Perhaps future
1733 versions will contain code to do this automatically and conveniently.
1734 That depends on whether someone wants to implement it.
1735
1736    Some embedded targets come with all the necessary `libgcc1.a'
1737 routines written in C or assembler.  These targets build `libgcc1.a'
1738 automatically and you do not need to do anything special for them.
1739 Other embedded targets do not need any `libgcc1.a' routines since all
1740 the necessary operations are supported by the hardware.
1741
1742    If your target system has another C compiler, you can configure GNU
1743 CC as a native compiler on that machine, build just `libgcc1.a' with
1744 `make libgcc1.a' on that machine, and use the resulting file with the
1745 cross-compiler.  To do this, execute the following on the target
1746 machine:
1747
1748      cd TARGET-BUILD-DIR
1749      ./configure --host=sparc --target=sun3
1750      make libgcc1.a
1751
1752 And then this on the host machine:
1753
1754      ftp TARGET-MACHINE
1755      binary
1756      cd TARGET-BUILD-DIR
1757      get libgcc1.a
1758      quit
1759
1760    Another way to provide the functions you need in `libgcc1.a' is to
1761 define the appropriate `perform_...' macros for those functions.  If
1762 these definitions do not use the C arithmetic operators that they are
1763 meant to implement, you should be able to compile them with the
1764 cross-compiler you are building.  (If these definitions already exist
1765 for your target file, then you are all set.)
1766
1767    To build `libgcc1.a' using the perform macros, use
1768 `LIBGCC1=libgcc1.a OLDCC=./xgcc' when building the compiler.
1769 Otherwise, you should place your replacement library under the name
1770 `libgcc1.a' in the directory in which you will build the
1771 cross-compiler, before you run `make'.
1772
1773 Cross-Compilers and Header Files
1774 --------------------------------
1775
1776    If you are cross-compiling a standalone program or a program for an
1777 embedded system, then you may not need any header files except the few
1778 that are part of GNU CC (and those of your program).  However, if you
1779 intend to link your program with a standard C library such as `libc.a',
1780 then you probably need to compile with the header files that go with
1781 the library you use.
1782
1783    The GNU C compiler does not come with these files, because (1) they
1784 are system-specific, and (2) they belong in a C library, not in a
1785 compiler.
1786
1787    If the GNU C library supports your target machine, then you can get
1788 the header files from there (assuming you actually use the GNU library
1789 when you link your program).
1790
1791    If your target machine comes with a C compiler, it probably comes
1792 with suitable header files also.  If you make these files accessible
1793 from the host machine, the cross-compiler can use them also.
1794
1795    Otherwise, you're on your own in finding header files to use when
1796 cross-compiling.
1797
1798    When you have found suitable header files, put them in the directory
1799 `/usr/local/TARGET/include', before building the cross compiler.  Then
1800 installation will run fixincludes properly and install the corrected
1801 versions of the header files where the compiler will use them.
1802
1803    Provide the header files before you build the cross-compiler, because
1804 the build stage actually runs the cross-compiler to produce parts of
1805 `libgcc.a'.  (These are the parts that *can* be compiled with GNU CC.)
1806 Some of them need suitable header files.
1807
1808    Here's an example showing how to copy the header files from a target
1809 machine.  On the target machine, do this:
1810
1811      (cd /usr/include; tar cf - .) > tarfile
1812
1813    Then, on the host machine, do this:
1814
1815      ftp TARGET-MACHINE
1816      lcd /usr/local/TARGET/include
1817      get tarfile
1818      quit
1819      tar xf tarfile
1820
1821 Actually Building the Cross-Compiler
1822 ------------------------------------
1823
1824    Now you can proceed just as for compiling a single-machine compiler
1825 through the step of building stage 1.  If you have not provided some
1826 sort of `libgcc1.a', then compilation will give up at the point where
1827 it needs that file, printing a suitable error message.  If you do
1828 provide `libgcc1.a', then building the compiler will automatically
1829 compile and link a test program called `libgcc1-test'; if you get
1830 errors in the linking, it means that not all of the necessary routines
1831 in `libgcc1.a' are available.
1832
1833    You must provide the header file `float.h'.  One way to do this is
1834 to compile `enquire' and run it on your target machine.  The job of
1835 `enquire' is to run on the target machine and figure out by experiment
1836 the nature of its floating point representation.  `enquire' records its
1837 findings in the header file `float.h'.  If you can't produce this file
1838 by running `enquire' on the target machine, then you will need to come
1839 up with a suitable `float.h' in some other way (or else, avoid using it
1840 in your programs).
1841
1842    Do not try to build stage 2 for a cross-compiler.  It doesn't work to
1843 rebuild GNU CC as a cross-compiler using the cross-compiler, because
1844 that would produce a program that runs on the target machine, not on the
1845 host.  For example, if you compile a 386-to-68030 cross-compiler with
1846 itself, the result will not be right either for the 386 (because it was
1847 compiled into 68030 code) or for the 68030 (because it was configured
1848 for a 386 as the host).  If you want to compile GNU CC into 68030 code,
1849 whether you compile it on a 68030 or with a cross-compiler on a 386, you
1850 must specify a 68030 as the host when you configure it.
1851
1852    To install the cross-compiler, use `make install', as usual.
1853
1854 Installing GNU CC on the Sun
1855 ============================
1856
1857    On Solaris, do not use the linker or other tools in `/usr/ucb' to
1858 build GNU CC.  Use `/usr/ccs/bin'.
1859
1860    If the assembler reports `Error: misaligned data' when bootstrapping,
1861 you are probably using an obsolete version of the GNU assembler.
1862 Upgrade to the latest version of GNU `binutils', or use the Solaris
1863 assembler.
1864
1865    Make sure the environment variable `FLOAT_OPTION' is not set when
1866 you compile `libgcc.a'.  If this option were set to `f68881' when
1867 `libgcc.a' is compiled, the resulting code would demand to be linked
1868 with a special startup file and would not link properly without special
1869 pains.
1870
1871    There is a bug in `alloca' in certain versions of the Sun library.
1872 To avoid this bug, install the binaries of GNU CC that were compiled by
1873 GNU CC.  They use `alloca' as a built-in function and never the one in
1874 the library.
1875
1876    Some versions of the Sun compiler crash when compiling GNU CC.  The
1877 problem is a segmentation fault in cpp.  This problem seems to be due to
1878 the bulk of data in the environment variables.  You may be able to avoid
1879 it by using the following command to compile GNU CC with Sun CC:
1880
1881      make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
1882
1883    SunOS 4.1.3 and 4.1.3_U1 have bugs that can cause intermittent core
1884 dumps when compiling GNU CC.  A common symptom is an internal compiler
1885 error which does not recur if you run it again.  To fix the problem,
1886 install Sun recommended patch 100726 (for SunOS 4.1.3) or 101508 (for
1887 SunOS 4.1.3_U1), or upgrade to a later SunOS release.
1888
1889 Installing GNU CC on VMS
1890 ========================
1891
1892    The VMS version of GNU CC is distributed in a backup saveset
1893 containing both source code and precompiled binaries.
1894
1895    To install the `gcc' command so you can use the compiler easily, in
1896 the same manner as you use the VMS C compiler, you must install the VMS
1897 CLD file for GNU CC as follows:
1898
1899   1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
1900      point to the directories where the GNU CC executables
1901      (`gcc-cpp.exe', `gcc-cc1.exe', etc.) and the C include files are
1902      kept respectively.  This should be done with the commands:
1903
1904           $ assign /system /translation=concealed -
1905             disk:[gcc.] gnu_cc
1906           $ assign /system /translation=concealed -
1907             disk:[gcc.include.] gnu_cc_include
1908
1909      with the appropriate disk and directory names.  These commands can
1910      be placed in your system startup file so they will be executed
1911      whenever the machine is rebooted.  You may, if you choose, do this
1912      via the `GCC_INSTALL.COM' script in the `[GCC]' directory.
1913
1914   2. Install the `GCC' command with the command line:
1915
1916           $ set command /table=sys$common:[syslib]dcltables -
1917             /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
1918           $ install replace sys$common:[syslib]dcltables
1919
1920   3. To install the help file, do the following:
1921
1922           $ library/help sys$library:helplib.hlb gcc.hlp
1923
1924      Now you can invoke the compiler with a command like `gcc /verbose
1925      file.c', which is equivalent to the command `gcc -v -c file.c' in
1926      Unix.
1927
1928    If you wish to use GNU C++ you must first install GNU CC, and then
1929 perform the following steps:
1930
1931   1. Define the VMS logical name `GNU_GXX_INCLUDE' to point to the
1932      directory where the preprocessor will search for the C++ header
1933      files.  This can be done with the command:
1934
1935           $ assign /system /translation=concealed -
1936             disk:[gcc.gxx_include.] gnu_gxx_include
1937
1938      with the appropriate disk and directory name.  If you are going to
1939      be using a C++ runtime library, this is where its install
1940      procedure will install its header files.
1941
1942   2. Obtain the file `gcc-cc1plus.exe', and place this in the same
1943      directory that `gcc-cc1.exe' is kept.
1944
1945      The GNU C++ compiler can be invoked with a command like `gcc /plus
1946      /verbose file.cc', which is equivalent to the command `g++ -v -c
1947      file.cc' in Unix.
1948
1949    We try to put corresponding binaries and sources on the VMS
1950 distribution tape.  But sometimes the binaries will be from an older
1951 version than the sources, because we don't always have time to update
1952 them.  (Use the `/version' option to determine the version number of
1953 the binaries and compare it with the source file `version.c' to tell
1954 whether this is so.)  In this case, you should use the binaries you get
1955 to recompile the sources.  If you must recompile, here is how:
1956
1957   1. Execute the command procedure `vmsconfig.com' to set up the files
1958      `tm.h', `config.h', `aux-output.c', and `md.', and to create files
1959      `tconfig.h' and `hconfig.h'.  This procedure also creates several
1960      linker option files used by `make-cc1.com' and a data file used by
1961      `make-l2.com'.
1962
1963           $ @vmsconfig.com
1964
1965   2. Setup the logical names and command tables as defined above.  In
1966      addition, define the VMS logical name `GNU_BISON' to point at the
1967      to the directories where the Bison executable is kept.  This
1968      should be done with the command:
1969
1970           $ assign /system /translation=concealed -
1971             disk:[bison.] gnu_bison
1972
1973      You may, if you choose, use the `INSTALL_BISON.COM' script in the
1974      `[BISON]' directory.
1975
1976   3. Install the `BISON' command with the command line:
1977
1978           $ set command /table=sys$common:[syslib]dcltables -
1979             /output=sys$common:[syslib]dcltables -
1980             gnu_bison:[000000]bison
1981           $ install replace sys$common:[syslib]dcltables
1982
1983   4. Type `@make-gcc' to recompile everything (alternatively, submit
1984      the file `make-gcc.com' to a batch queue).  If you wish to build
1985      the GNU C++ compiler as well as the GNU CC compiler, you must
1986      first edit `make-gcc.com' and follow the instructions that appear
1987      in the comments.
1988
1989   5. In order to use GCC, you need a library of functions which GCC
1990      compiled code will call to perform certain tasks, and these
1991      functions are defined in the file `libgcc2.c'.  To compile this
1992      you should use the command procedure `make-l2.com', which will
1993      generate the library `libgcc2.olb'.  `libgcc2.olb' should be built
1994      using the compiler built from the same distribution that
1995      `libgcc2.c' came from, and `make-gcc.com' will automatically do
1996      all of this for you.
1997
1998      To install the library, use the following commands:
1999
2000           $ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
2001           $ library gnu_cc:[000000]gcclib/delete=L_*
2002           $ library libgcc2/extract=*/output=libgcc2.obj
2003           $ library gnu_cc:[000000]gcclib libgcc2.obj
2004
2005      The first command simply removes old modules that will be replaced
2006      with modules from `libgcc2' under different module names.  The
2007      modules `new' and `eprintf' may not actually be present in your
2008      `gcclib.olb'--if the VMS librarian complains about those modules
2009      not being present, simply ignore the message and continue on with
2010      the next command.  The second command removes the modules that
2011      came from the previous version of the library `libgcc2.c'.
2012
2013      Whenever you update the compiler on your system, you should also
2014      update the library with the above procedure.
2015
2016   6. You may wish to build GCC in such a way that no files are written
2017      to the directory where the source files reside.  An example would
2018      be the when the source files are on a read-only disk.  In these
2019      cases, execute the following DCL commands (substituting your
2020      actual path names):
2021
2022           $ assign dua0:[gcc.build_dir.]/translation=concealed, -
2023                    dua1:[gcc.source_dir.]/translation=concealed  gcc_build
2024           $ set default gcc_build:[000000]
2025
2026      where the directory `dua1:[gcc.source_dir]' contains the source
2027      code, and the directory `dua0:[gcc.build_dir]' is meant to contain
2028      all of the generated object files and executables.  Once you have
2029      done this, you can proceed building GCC as described above.  (Keep
2030      in mind that `gcc_build' is a rooted logical name, and thus the
2031      device names in each element of the search list must be an actual
2032      physical device name rather than another rooted logical name).
2033
2034   7. *If you are building GNU CC with a previous version of GNU CC, you
2035      also should check to see that you have the newest version of the
2036      assembler*.  In particular, GNU CC version 2 treats global constant
2037      variables slightly differently from GNU CC version 1, and GAS
2038      version 1.38.1 does not have the patches required to work with GCC
2039      version 2.  If you use GAS 1.38.1, then `extern const' variables
2040      will not have the read-only bit set, and the linker will generate
2041      warning messages about mismatched psect attributes for these
2042      variables.  These warning messages are merely a nuisance, and can
2043      safely be ignored.
2044
2045      If you are compiling with a version of GNU CC older than 1.33,
2046      specify `/DEFINE=("inline=")' as an option in all the
2047      compilations.  This requires editing all the `gcc' commands in
2048      `make-cc1.com'.  (The older versions had problems supporting
2049      `inline'.)  Once you have a working 1.33 or newer GNU CC, you can
2050      change this file back.
2051
2052   8. If you want to build GNU CC with the VAX C compiler, you will need
2053      to make minor changes in `make-cccp.com' and `make-cc1.com' to
2054      choose alternate definitions of `CC', `CFLAGS', and `LIBS'.  See
2055      comments in those files.  However, you must also have a working
2056      version of the GNU assembler (GNU as, aka GAS) as it is used as
2057      the back-end for GNU CC to produce binary object modules and is
2058      not included in the GNU CC sources.  GAS is also needed to compile
2059      `libgcc2' in order to build `gcclib' (see above); `make-l2.com'
2060      expects to be able to find it operational in
2061      `gnu_cc:[000000]gnu-as.exe'.
2062
2063      To use GNU CC on VMS, you need the VMS driver programs `gcc.exe',
2064      `gcc.com', and `gcc.cld'.  They are distributed with the VMS
2065      binaries (`gcc-vms') rather than the GNU CC sources.  GAS is also
2066      included in `gcc-vms', as is Bison.
2067
2068      Once you have successfully built GNU CC with VAX C, you should use
2069      the resulting compiler to rebuild itself.  Before doing this, be
2070      sure to restore the `CC', `CFLAGS', and `LIBS' definitions in
2071      `make-cccp.com' and `make-cc1.com'.  The second generation
2072      compiler will be able to take advantage of many optimizations that
2073      must be suppressed when building with other compilers.
2074
2075    Under previous versions of GNU CC, the generated code would
2076 occasionally give strange results when linked with the sharable
2077 `VAXCRTL' library.  Now this should work.
2078
2079    Even with this version, however, GNU CC itself should not be linked
2080 with the sharable `VAXCRTL'.  The version of `qsort' in `VAXCRTL' has a
2081 bug (known to be present in VMS versions V4.6 through V5.5) which
2082 causes the compiler to fail.
2083
2084    The executables are generated by `make-cc1.com' and `make-cccp.com'
2085 use the object library version of `VAXCRTL' in order to make use of the
2086 `qsort' routine in `gcclib.olb'.  If you wish to link the compiler
2087 executables with the shareable image version of `VAXCRTL', you should
2088 edit the file `tm.h' (created by `vmsconfig.com') to define the macro
2089 `QSORT_WORKAROUND'.
2090
2091    `QSORT_WORKAROUND' is always defined when GNU CC is compiled with
2092 VAX C, to avoid a problem in case `gcclib.olb' is not yet available.
2093
2094 `collect2'
2095 ==========
2096
2097    GNU CC uses a utility called `collect2' on nearly all systems to
2098 arrange to call various initialization functions at start time.
2099
2100    The program `collect2' works by linking the program once and looking
2101 through the linker output file for symbols with particular names
2102 indicating they are constructor functions.  If it finds any, it creates
2103 a new temporary `.c' file containing a table of them, compiles it, and
2104 links the program a second time including that file.
2105
2106    The actual calls to the constructors are carried out by a subroutine
2107 called `__main', which is called (automatically) at the beginning of
2108 the body of `main' (provided `main' was compiled with GNU CC).  Calling
2109 `__main' is necessary, even when compiling C code, to allow linking C
2110 and C++ object code together.  (If you use `-nostdlib', you get an
2111 unresolved reference to `__main', since it's defined in the standard
2112 GCC library.  Include `-lgcc' at the end of your compiler command line
2113 to resolve this reference.)
2114
2115    The program `collect2' is installed as `ld' in the directory where
2116 the passes of the compiler are installed.  When `collect2' needs to
2117 find the *real* `ld', it tries the following file names:
2118
2119    * `real-ld' in the directories listed in the compiler's search
2120      directories.
2121
2122    * `real-ld' in the directories listed in the environment variable
2123      `PATH'.
2124
2125    * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
2126      if specified.
2127
2128    * `ld' in the compiler's search directories, except that `collect2'
2129      will not execute itself recursively.
2130
2131    * `ld' in `PATH'.
2132
2133    "The compiler's search directories" means all the directories where
2134 `gcc' searches for passes of the compiler.  This includes directories
2135 that you specify with `-B'.
2136
2137    Cross-compilers search a little differently:
2138
2139    * `real-ld' in the compiler's search directories.
2140
2141    * `TARGET-real-ld' in `PATH'.
2142
2143    * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
2144      if specified.
2145
2146    * `ld' in the compiler's search directories.
2147
2148    * `TARGET-ld' in `PATH'.
2149
2150    `collect2' explicitly avoids running `ld' using the file name under
2151 which `collect2' itself was invoked.  In fact, it remembers up a list
2152 of such names--in case one copy of `collect2' finds another copy (or
2153 version) of `collect2' installed as `ld' in a second place in the
2154 search path.
2155
2156    `collect2' searches for the utilities `nm' and `strip' using the
2157 same algorithm as above for `ld'.
2158
2159 Standard Header File Directories
2160 ================================
2161
2162    `GCC_INCLUDE_DIR' means the same thing for native and cross.  It is
2163 where GNU CC stores its private include files, and also where GNU CC
2164 stores the fixed include files.  A cross compiled GNU CC runs
2165 `fixincludes' on the header files in `$(tooldir)/include'.  (If the
2166 cross compilation header files need to be fixed, they must be installed
2167 before GNU CC is built.  If the cross compilation header files are
2168 already suitable for ANSI C and GNU CC, nothing special need be done).
2169
2170    `GPLUSPLUS_INCLUDE_DIR' means the same thing for native and cross.
2171 It is where `g++' looks first for header files.  The C++ library
2172 installs only target independent header files in that directory.
2173
2174    `LOCAL_INCLUDE_DIR' is used only for a native compiler.  It is
2175 normally `/usr/local/include'.  GNU CC searches this directory so that
2176 users can install header files in `/usr/local/include'.
2177
2178    `CROSS_INCLUDE_DIR' is used only for a cross compiler.  GNU CC
2179 doesn't install anything there.
2180
2181    `TOOL_INCLUDE_DIR' is used for both native and cross compilers.  It
2182 is the place for other packages to install header files that GNU CC will
2183 use.  For a cross-compiler, this is the equivalent of `/usr/include'.
2184 When you build a cross-compiler, `fixincludes' processes any header
2185 files in this directory.
2186