source: trunk/third/gcc/gcc.info-7 @ 11288

Revision 11288, 46.3 KB checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r11287, which included commits to RCS files with non-trunk default branches.
Line 
1This is Info file gcc.info, produced by Makeinfo version 1.67 from the
2input file gcc.texi.
3
4   This file documents the use and the internals of the GNU compiler.
5
6   Published by the Free Software Foundation 59 Temple Place - Suite 330
7Boston, MA 02111-1307 USA
8
9   Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998
10Free Software Foundation, Inc.
11
12   Permission is granted to make and distribute verbatim copies of this
13manual provided the copyright notice and this permission notice are
14preserved on all copies.
15
16   Permission is granted to copy and distribute modified versions of
17this manual under the conditions for verbatim copying, provided also
18that the sections entitled "GNU General Public License," "Funding for
19Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
20included exactly as in the original, and provided that the entire
21resulting derived work is distributed under the terms of a permission
22notice identical to this one.
23
24   Permission is granted to copy and distribute translations of this
25manual into another language, under the above conditions for modified
26versions, except that the sections entitled "GNU General Public
27License," "Funding for Free Software," and "Protect Your Freedom--Fight
28`Look And Feel'", and this permission notice, may be included in
29translations approved by the Free Software Foundation instead of in the
30original English.
31
32
33File: gcc.info,  Node: Configurations,  Next: Other Dir,  Up: Installation
34
35Configurations Supported by GNU CC
36==================================
37
38   Here are the possible CPU types:
39
40     1750a, a29k, alpha, arm, cN, clipper, dsp16xx, elxsi, h8300,
41     hppa1.0, hppa1.1, i370, i386, i486, i586, i860, i960, m32r,
42     m68000, m68k, m88k, mips, mipsel, mips64, mips64el, ns32k,
43     powerpc, powerpcle, pyramid, romp, rs6000, sh, sparc, sparclite,
44     sparc64, vax, we32k.
45
46   Here are the recognized company names.  As you can see, customary
47abbreviations are used rather than the longer official names.
48
49     acorn, alliant, altos, apollo, apple, att, bull, cbm, convergent,
50     convex, crds, dec, dg, dolphin, elxsi, encore, harris, hitachi,
51     hp, ibm, intergraph, isi, mips, motorola, ncr, next, ns, omron,
52     plexus, sequent, sgi, sony, sun, tti, unicom, wrs.
53
54   The company name is meaningful only to disambiguate when the rest of
55the information supplied is insufficient.  You can omit it, writing
56just `CPU-SYSTEM', if it is not needed.  For example, `vax-ultrix4.2'
57is equivalent to `vax-dec-ultrix4.2'.
58
59   Here is a list of system types:
60
61     386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff,
62     ctix, cxux, dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms,
63     genix, gnu, linux-gnu, hiux, hpux, iris, irix, isc, luna, lynxos,
64     mach, minix, msdos, mvs, netbsd, newsos, nindy, ns, osf, osfrose,
65     ptx, riscix, riscos, rtu, sco, sim, solaris, sunos, sym, sysv,
66     udi, ultrix, unicos, uniplus, unos, vms, vsta, vxworks, winnt,
67     xenix.
68
69You can omit the system type; then `configure' guesses the operating
70system from the CPU and company.
71
72   You can add a version number to the system type; this may or may not
73make a difference.  For example, you can write `bsd4.3' or `bsd4.4' to
74distinguish versions of BSD.  In practice, the version number is most
75needed for `sysv3' and `sysv4', which are often treated differently.
76
77   If you specify an impossible combination such as `i860-dg-vms', then
78you may get an error message from `configure', or it may ignore part of
79the information and do the best it can with the rest.  `configure'
80always prints the canonical name for the alternative that it used.  GNU
81CC does not support all possible alternatives.
82
83   Often a particular model of machine has a name.  Many machine names
84are recognized as aliases for CPU/company combinations.  Thus, the
85machine name `sun3', mentioned above, is an alias for `m68k-sun'.
86Sometimes we accept a company name as a machine name, when the name is
87popularly used for a particular machine.  Here is a table of the known
88machine names:
89
90     3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300,
91     balance, convex-cN, crds, decstation-3100, decstation, delta,
92     encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN,
93     hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe,
94     mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc,
95     powerpcle, ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3,
96     sun4, symmetry, tower-32, tower.
97
98Remember that a machine name specifies both the cpu type and the company
99name.  If you want to install your own homemade configuration files,
100you can use `local' as the company name to access them.  If you use
101configuration `CPU-local', the configuration name without the cpu prefix
102is used to form the configuration file names.
103
104   Thus, if you specify `m68k-local', configuration uses files
105`m68k.md', `local.h', `m68k.c', `xm-local.h', `t-local', and `x-local',
106all in the directory `config/m68k'.
107
108   Here is a list of configurations that have special treatment or
109special things you must know:
110
111`1750a-*-*'
112     MIL-STD-1750A processors.
113
114     The MIL-STD-1750A cross configuration produces output for
115     `as1750', an assembler/linker available under the GNU Public
116     License for the 1750A. `as1750' can be obtained at
117     *ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/*.  A similarly
118     licensed simulator for the 1750A is available from same address.
119
120     You should ignore a fatal error during the building of libgcc
121     (libgcc is not yet implemented for the 1750A.)
122
123     The `as1750' assembler requires the file `ms1750.inc', which is
124     found in the directory `config/1750a'.
125
126     GNU CC produced the same sections as the Fairchild F9450 C
127     Compiler, namely:
128
129    `Normal'
130          The program code section.
131
132    `Static'
133          The read/write (RAM) data section.
134
135    `Konst'
136          The read-only (ROM) constants section.
137
138    `Init'
139          Initialization section (code to copy KREL to SREL).
140
141     The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16).
142     This means that type `char' is represented with a 16-bit word per
143     character.  The 1750A's "Load/Store Upper/Lower Byte" instructions
144     are not used by GNU CC.
145
146`alpha-*-osf1'
147     Systems using processors that implement the DEC Alpha architecture
148     and are running the DEC Unix (OSF/1) operating system, for example
149     the DEC Alpha AXP systems.CC.)
150
151     GNU CC writes a `.verstamp' directive to the assembler output file
152     unless it is built as a cross-compiler.  It gets the version to
153     use from the system header file `/usr/include/stamp.h'.  If you
154     install a new version of DEC Unix, you should rebuild GCC to pick
155     up the new version stamp.
156
157     Note that since the Alpha is a 64-bit architecture,
158     cross-compilers from 32-bit machines will not generate code as
159     efficient as that generated when the compiler is running on a
160     64-bit machine because many optimizations that depend on being
161     able to represent a word on the target in an integral value on the
162     host cannot be performed.  Building cross-compilers on the Alpha
163     for 32-bit machines has only been tested in a few cases and may
164     not work properly.
165
166     `make compare' may fail on old versions of DEC Unix unless you add
167     `-save-temps' to `CFLAGS'.  On these systems, the name of the
168     assembler input file is stored in the object file, and that makes
169     comparison fail if it differs between the `stage1' and `stage2'
170     compilations.  The option `-save-temps' forces a fixed name to be
171     used for the assembler input file, instead of a randomly chosen
172     name in `/tmp'.  Do not add `-save-temps' unless the comparisons
173     fail without that option.  If you add `-save-temps', you will have
174     to manually delete the `.i' and `.s' files after each series of
175     compilations.
176
177     GNU CC now supports both the native (ECOFF) debugging format used
178     by DBX and GDB and an encapsulated STABS format for use only with
179     GDB.  See the discussion of the `--with-stabs' option of
180     `configure' above for more information on these formats and how to
181     select them.
182
183     There is a bug in DEC's assembler that produces incorrect line
184     numbers for ECOFF format when the `.align' directive is used.  To
185     work around this problem, GNU CC will not emit such alignment
186     directives while writing ECOFF format debugging information even
187     if optimization is being performed.  Unfortunately, this has the
188     very undesirable side-effect that code addresses when `-O' is
189     specified are different depending on whether or not `-g' is also
190     specified.
191
192     To avoid this behavior, specify `-gstabs+' and use GDB instead of
193     DBX.  DEC is now aware of this problem with the assembler and
194     hopes to provide a fix shortly.
195
196`arc-*-elf'
197     Argonaut ARC processor.  This configuration is intended for
198     embedded systems.
199
200`arm-*-aout'
201     Advanced RISC Machines ARM-family processors.  These are often
202     used in embedded applications.  There are no standard Unix
203     configurations.  This configuration corresponds to the basic
204     instruction sequences and will produce `a.out' format object
205     modules.
206
207     You may need to make a variant of the file `arm.h' for your
208     particular configuration.
209
210`arm-*-linuxaout'
211     Any of the ARM family processors running the Linux-based GNU
212     system with the `a.out' binary format (ELF is not yet supported).
213     You must use version 2.8.1.0.7 or later of the GNU/Linux binutils,
214     which you can download from `sunsite.unc.edu:/pub/Linux/GCC' and
215     other mirror sites for Linux-based GNU systems.
216
217`arm-*-riscix'
218     The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD
219     Unix.  If you are running a version of RISC iX prior to 1.2 then
220     you must specify the version number during configuration.  Note
221     that the assembler shipped with RISC iX does not support stabs
222     debugging information; a new version of the assembler, with stabs
223     support included, is now available from Acorn and via ftp
224     `ftp.acorn.com:/pub/riscix/as+xterm.tar.Z'.  To enable stabs
225     debugging, pass `--with-gnu-as' to configure.
226
227     You will need to install GNU `sed' before you can run configure.
228
229`a29k'
230     AMD Am29k-family processors.  These are normally used in embedded
231     applications.  There are no standard Unix configurations.  This
232     configuration corresponds to AMD's standard calling sequence and
233     binary interface and is compatible with other 29k tools.
234
235     You may need to make a variant of the file `a29k.h' for your
236     particular configuration.
237
238`a29k-*-bsd'
239     AMD Am29050 used in a system running a variant of BSD Unix.
240
241`decstation-*'
242     MIPS-based DECstations can support three different personalities:
243     Ultrix, DEC OSF/1, and OSF/rose.  (Alpha-based DECstation products
244     have a configuration name beginning with `alpha-dec'.)  To
245     configure GCC for these platforms use the following configurations:
246
247    `decstation-ultrix'
248          Ultrix configuration.
249
250    `decstation-osf1'
251          Dec's version of OSF/1.
252
253    `decstation-osfrose'
254          Open Software Foundation reference port of OSF/1 which uses
255          the OSF/rose object file format instead of ECOFF.  Normally,
256          you would not select this configuration.
257
258     The MIPS C compiler needs to be told to increase its table size
259     for switch statements with the `-Wf,-XNg1500' option in order to
260     compile `cp/parse.c'.  If you use the `-O2' optimization option,
261     you also need to use `-Olimit 3000'.  Both of these options are
262     automatically generated in the `Makefile' that the shell script
263     `configure' builds.  If you override the `CC' make variable and
264     use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
265     3000'.
266
267`elxsi-elxsi-bsd'
268     The Elxsi's C compiler has known limitations that prevent it from
269     compiling GNU C.  Please contact `mrs@cygnus.com' for more details.
270
271`dsp16xx'
272     A port to the AT&T DSP1610 family of processors.
273
274`h8300-*-*'
275     Hitachi H8/300 series of processors.
276
277     The calling convention and structure layout has changed in release
278     2.6.  All code must be recompiled.  The calling convention now
279     passes the first three arguments in function calls in registers.
280     Structures are no longer a multiple of 2 bytes.
281
282`hppa*-*-*'
283     There are several variants of the HP-PA processor which run a
284     variety of operating systems.  GNU CC must be configured to use
285     the correct processor type and operating system, or GNU CC will
286     not function correctly.  The easiest way to handle this problem is
287     to *not* specify a target when configuring GNU CC, the `configure'
288     script will try to automatically determine the right processor
289     type and operating system.
290
291     `-g' does not work on HP-UX, since that system uses a peculiar
292     debugging format which GNU CC does not know about.  However, `-g'
293     will work if you also use GAS and GDB in conjunction with GCC.  We
294     highly recommend using GAS for all HP-PA configurations.
295
296     You should be using GAS-2.6 (or later) along with GDB-4.16 (or
297     later).  These can be retrieved from all the traditional GNU ftp
298     archive sites.
299
300     GAS will need to be installed into a directory before `/bin',
301     `/usr/bin', and `/usr/ccs/bin' in your search path.  You should
302     install GAS before you build GNU CC.
303
304     To enable debugging, you must configure GNU CC with the
305     `--with-gnu-as' option before building.
306
307`i370-*-*'
308     This port is very preliminary and has many known bugs.  We hope to
309     have a higher-quality port for this machine soon.
310
311`i386-*-linux-gnuoldld'
312     Use this configuration to generate `a.out' binaries on Linux-based
313     GNU systems if you do not have gas/binutils version 2.5.2 or later
314     installed. This is an obsolete configuration.
315
316`i386-*-linux-gnuaout'
317     Use this configuration to generate `a.out' binaries on Linux-based
318     GNU systems. This configuration is being superseded. You must use
319     gas/binutils version 2.5.2 or later.
320
321`i386-*-linux-gnu'
322     Use this configuration to generate ELF binaries on Linux-based GNU
323     systems.  You must use gas/binutils version 2.5.2 or later.
324
325`i386-*-sco'
326     Compilation with RCC is recommended.  Also, it may be a good idea
327     to link with GNU malloc instead of the malloc that comes with the
328     system.
329
330`i386-*-sco3.2v4'
331     Use this configuration for SCO release 3.2 version 4.
332
333`i386-*-sco3.2v5*'
334     Use this for the SCO OpenServer Release family including 5.0.0,
335     5.0.2, 5.0.4, Internet FastStart 1.0, and Internet FastStart 1.1.
336
337     GNU CC can generate either ELF or COFF binaries.   ELF is the
338     default.  To get COFF output, you must specify `-mcoff' on the
339     command line.
340
341     For 5.0.0 and 5.0.2, you must install TLS597 from ftp.sco.com/TLS.
342     5.0.4 and later do not require this patch.
343
344     *NOTE:* You must follow the instructions about invoking `make
345     bootstrap' because the native OpenServer compiler builds a
346     `cc1plus' that will not correctly parse many valid C++ programs.
347     You must do a `make bootstrap' if you are building with the native
348     compiler.
349
350`i386-*-isc'
351     It may be a good idea to link with GNU malloc instead of the
352     malloc that comes with the system.
353
354     In ISC version 4.1, `sed' core dumps when building `deduced.h'.
355     Use the version of `sed' from version 4.0.
356
357`i386-*-esix'
358     It may be good idea to link with GNU malloc instead of the malloc
359     that comes with the system.
360
361`i386-ibm-aix'
362     You need to use GAS version 2.1 or later, and LD from GNU binutils
363     version 2.2 or later.
364
365`i386-sequent-bsd'
366     Go to the Berkeley universe before compiling.
367
368`i386-sequent-ptx1*'
369     Sequent DYNIX/ptx 1.x.
370
371`i386-sequent-ptx2*'
372     Sequent DYNIX/ptx 2.x.
373
374`i386-sun-sunos4'
375     You may find that you need another version of GNU CC to begin
376     bootstrapping with, since the current version when built with the
377     system's own compiler seems to get an infinite loop compiling part
378     of `libgcc2.c'.  GNU CC version 2 compiled with GNU CC (any
379     version) seems not to have this problem.
380
381     See *Note Sun Install::, for information on installing GNU CC on
382     Sun systems.
383
384`i[345]86-*-winnt3.5'
385     This version requires a GAS that has not yet been released.  Until
386     it is, you can get a prebuilt binary version via anonymous ftp from
387     `cs.washington.edu:pub/gnat' or `cs.nyu.edu:pub/gnat'. You must
388     also use the Microsoft header files from the Windows NT 3.5 SDK.
389     Find these on the CDROM in the `/mstools/h' directory dated
390     9/4/94.  You must use a fixed version of Microsoft linker made
391     especially for NT 3.5, which is also is available on the NT 3.5
392     SDK CDROM.  If you do not have this linker, can you also use the
393     linker from Visual C/C++ 1.0 or 2.0.
394
395     Installing GNU CC for NT builds a wrapper linker, called `ld.exe',
396     which mimics the behaviour of Unix `ld' in the specification of
397     libraries (`-L' and `-l').  `ld.exe' looks for both Unix and
398     Microsoft named libraries.  For example, if you specify `-lfoo',
399     `ld.exe' will look first for `libfoo.a' and then for `foo.lib'.
400
401     You may install GNU CC for Windows NT in one of two ways,
402     depending on whether or not you have a Unix-like shell and various
403     Unix-like utilities.
404
405       1. If you do not have a Unix-like shell and few Unix-like
406          utilities, you will use a DOS style batch script called
407          `configure.bat'.  Invoke it as `configure winnt' from an
408          MSDOS console window or from the program manager dialog box.
409          `configure.bat' assumes you have already installed and have
410          in your path a Unix-like `sed' program which is used to
411          create a working `Makefile' from `Makefile.in'.
412
413          `Makefile' uses the Microsoft Nmake program maintenance
414          utility and the Visual C/C++ V8.00 compiler to build GNU CC.
415          You need only have the utilities `sed' and `touch' to use
416          this installation method, which only automatically builds the
417          compiler itself.  You must then examine what `fixinc.winnt'
418          does, edit the header files by hand and build `libgcc.a'
419          manually.
420
421       2. The second type of installation assumes you are running a
422          Unix-like shell, have a complete suite of Unix-like utilities
423          in your path, and have a previous version of GNU CC already
424          installed, either through building it via the above
425          installation method or acquiring a pre-built binary.  In this
426          case, use the `configure' script in the normal fashion.
427
428`i860-intel-osf1'
429     This is the Paragon.  If you have version 1.0 of the operating
430     system, see *Note Installation Problems::, for special things you
431     need to do to compensate for peculiarities in the system.
432
433`*-lynx-lynxos'
434     LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
435     `/bin/gcc'.  You should compile with this instead of `/bin/cc'.
436     You can tell GNU CC to use the GNU assembler and linker, by
437     specifying `--with-gnu-as --with-gnu-ld' when configuring.  These
438     will produce COFF format object files and executables;  otherwise
439     GNU CC will use the installed tools, which produce `a.out' format
440     executables.
441
442`m32r-*-elf'
443     Mitsubishi M32R processor.  This configuration is intended for
444     embedded systems.
445
446`m68000-hp-bsd'
447     HP 9000 series 200 running BSD.  Note that the C compiler that
448     comes with this system cannot compile GNU CC; contact
449     `law@cygnus.com' to get binaries of GNU CC for bootstrapping.
450
451`m68k-altos'
452     Altos 3068.  You must use the GNU assembler, linker and debugger.
453     Also, you must fix a kernel bug.  Details in the file
454     `README.ALTOS'.
455
456`m68k-apple-aux'
457     Apple Macintosh running A/UX.  You may configure GCC  to use
458     either the system assembler and linker or the GNU assembler and
459     linker.  You should use the GNU configuration if you can,
460     especially if you also want to use GNU C++.  You enabled that
461     configuration with + the `--with-gnu-as' and `--with-gnu-ld'
462     options to `configure'.
463
464     Note the C compiler that comes with this system cannot compile GNU
465     CC.  You can fine binaries of GNU CC for bootstrapping on
466     `jagubox.gsfc.nasa.gov'.  You will also a patched version of
467     `/bin/ld' there that raises some of the arbitrary limits found in
468     the original.
469
470`m68k-att-sysv'
471     AT&T 3b1, a.k.a. 7300 PC.  Special procedures are needed to
472     compile GNU CC with this machine's standard C compiler, due to
473     bugs in that compiler.  You can bootstrap it more easily with
474     previous versions of GNU CC if you have them.
475
476     Installing GNU CC on the 3b1 is difficult if you do not already
477     have GNU CC running, due to bugs in the installed C compiler.
478     However, the following procedure might work.  We are unable to
479     test it.
480
481       1. Comment out the `#include "config.h"' line near the start of
482          `cccp.c' and do `make cpp'.  This makes a preliminary version
483          of GNU cpp.
484
485       2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to
486          that file name.
487
488       3. Undo your change in `cccp.c', or reinstall the original
489          version, and do `make cpp' again.
490
491       4. Copy this final version of GNU cpp into `/lib/cpp'.
492
493       5. Replace every occurrence of `obstack_free' in the file
494          `tree.c' with `_obstack_free'.
495
496       6. Run `make' to get the first-stage GNU CC.
497
498       7. Reinstall the original version of `/lib/cpp'.
499
500       8. Now you can compile GNU CC with itself and install it in the
501          normal fashion.
502
503`m68k-bull-sysv'
504     Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU
505     CC works either with native assembler or GNU assembler. You can use
506     GNU assembler with native coff generation by providing
507     `--with-gnu-as' to the configure script or use GNU assembler with
508     dbx-in-coff encapsulation by providing `--with-gnu-as --stabs'.
509     For any problem with native assembler or for availability of the
510     DPX/2 port of GAS, contact `F.Pierresteguy@frcl.bull.fr'.
511
512`m68k-crds-unox'
513     Use `configure unos' for building on Unos.
514
515     The Unos assembler is named `casm' instead of `as'.  For some
516     strange reason linking `/bin/as' to `/bin/casm' changes the
517     behavior, and does not work.  So, when installing GNU CC, you
518     should install the following script as `as' in the subdirectory
519     where the passes of GCC are installed:
520
521          #!/bin/sh
522          casm $*
523
524     The default Unos library is named `libunos.a' instead of `libc.a'.
525     To allow GNU CC to function, either change all references to
526     `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to
527     `/lib/libunos.a'.
528
529     When compiling GNU CC with the standard compiler, to overcome bugs
530     in the support of `alloca', do not use `-O' when making stage 2.
531     Then use the stage 2 compiler with `-O' to make the stage 3
532     compiler.  This compiler will have the same characteristics as the
533     usual stage 2 compiler on other systems.  Use it to make a stage 4
534     compiler and compare that with stage 3 to verify proper
535     compilation.
536
537     (Perhaps simply defining `ALLOCA' in `x-crds' as described in the
538     comments there will make the above paragraph superfluous.  Please
539     inform us of whether this works.)
540
541     Unos uses memory segmentation instead of demand paging, so you
542     will need a lot of memory.  5 Mb is barely enough if no other
543     tasks are running.  If linking `cc1' fails, try putting the object
544     files into a library and linking from that library.
545
546`m68k-hp-hpux'
547     HP 9000 series 300 or 400 running HP-UX.  HP-UX version 8.0 has a
548     bug in the assembler that prevents compilation of GNU CC.  To fix
549     it, get patch PHCO_4484 from HP.
550
551     In addition, if you wish to use gas `--with-gnu-as' you must use
552     gas version 2.1 or later, and you must use the GNU linker version
553     2.1 or later.  Earlier versions of gas relied upon a program which
554     converted the gas output into the native HP/UX format, but that
555     program has not been kept up to date.  gdb does not understand
556     that native HP/UX format, so you must use gas if you wish to use
557     gdb.
558
559`m68k-sun'
560     Sun 3.  We do not provide a configuration file to use the Sun FPA
561     by default, because programs that establish signal handlers for
562     floating point traps inherently cannot work with the FPA.
563
564     See *Note Sun Install::, for information on installing GNU CC on
565     Sun systems.
566
567`m88k-*-svr3'
568     Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
569     These systems tend to use the Green Hills C, revision 1.8.5, as the
570     standard C compiler.  There are apparently bugs in this compiler
571     that result in object files differences between stage 2 and stage
572     3.  If this happens, make the stage 4 compiler and compare it to
573     the stage 3 compiler.  If the stage 3 and stage 4 object files are
574     identical, this suggests you encountered a problem with the
575     standard C compiler; the stage 3 and 4 compilers may be usable.
576
577     It is best, however, to use an older version of GNU CC for
578     bootstrapping if you have one.
579
580`m88k-*-dgux'
581     Motorola m88k running DG/UX.  To build 88open BCS native or cross
582     compilers on DG/UX, specify the configuration name as
583     `m88k-*-dguxbcs' and build in the 88open BCS software development
584     environment.  To build ELF native or cross compilers on DG/UX,
585     specify `m88k-*-dgux' and build in the DG/UX ELF development
586     environment.  You set the software development environment by
587     issuing `sde-target' command and specifying either `m88kbcs' or
588     `m88kdguxelf' as the operand.
589
590     If you do not specify a configuration name, `configure' guesses the
591     configuration based on the current software development
592     environment.
593
594`m88k-tektronix-sysv3'
595     Tektronix XD88 running UTekV 3.2e.  Do not turn on optimization
596     while building stage1 if you bootstrap with the buggy Green Hills
597     compiler.  Also, The bundled LAI System V NFS is buggy so if you
598     build in an NFS mounted directory, start from a fresh reboot, or
599     avoid NFS all together.  Otherwise you may have trouble getting
600     clean comparisons between stages.
601
602`mips-mips-bsd'
603     MIPS machines running the MIPS operating system in BSD mode.  It's
604     possible that some old versions of the system lack the functions
605     `memcpy', `memcmp', and `memset'.  If your system lacks these, you
606     must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in
607     `mips-bsd.h'.
608
609     The MIPS C compiler needs to be told to increase its table size
610     for switch statements with the `-Wf,-XNg1500' option in order to
611     compile `cp/parse.c'.  If you use the `-O2' optimization option,
612     you also need to use `-Olimit 3000'.  Both of these options are
613     automatically generated in the `Makefile' that the shell script
614     `configure' builds.  If you override the `CC' make variable and
615     use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
616     3000'.
617
618`mips-mips-riscos*'
619     The MIPS C compiler needs to be told to increase its table size
620     for switch statements with the `-Wf,-XNg1500' option in order to
621     compile `cp/parse.c'.  If you use the `-O2' optimization option,
622     you also need to use `-Olimit 3000'.  Both of these options are
623     automatically generated in the `Makefile' that the shell script
624     `configure' builds.  If you override the `CC' make variable and
625     use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
626     3000'.
627
628     MIPS computers running RISC-OS can support four different
629     personalities: default, BSD 4.3, System V.3, and System V.4 (older
630     versions of RISC-OS don't support V.4).  To configure GCC for
631     these platforms use the following configurations:
632
633    `mips-mips-riscos`rev''
634          Default configuration for RISC-OS, revision `rev'.
635
636    `mips-mips-riscos`rev'bsd'
637          BSD 4.3 configuration for RISC-OS, revision `rev'.
638
639    `mips-mips-riscos`rev'sysv4'
640          System V.4 configuration for RISC-OS, revision `rev'.
641
642    `mips-mips-riscos`rev'sysv'
643          System V.3 configuration for RISC-OS, revision `rev'.
644
645     The revision `rev' mentioned above is the revision of RISC-OS to
646     use.  You must reconfigure GCC when going from a RISC-OS revision
647     4 to RISC-OS revision 5.  This has the effect of avoiding a linker
648     bug (see *Note Installation Problems::, for more details).
649
650`mips-sgi-*'
651     In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
652     option must be installed from the CD-ROM supplied from Silicon
653     Graphics.  This is found on the 2nd CD in release 4.0.1.
654
655     In order to compile GCC on an SGI running IRIX 5, the
656     "compiler_dev.hdr" subsystem must be installed from the IDO CD-ROM
657     supplied by Silicon Graphics.
658
659     `make compare' may fail on version 5 of IRIX unless you add
660     `-save-temps' to `CFLAGS'.  On these systems, the name of the
661     assembler input file is stored in the object file, and that makes
662     comparison fail if it differs between the `stage1' and `stage2'
663     compilations.  The option `-save-temps' forces a fixed name to be
664     used for the assembler input file, instead of a randomly chosen
665     name in `/tmp'.  Do not add `-save-temps' unless the comparisons
666     fail without that option.  If you do you `-save-temps', you will
667     have to manually delete the `.i' and `.s' files after each series
668     of compilations.
669
670     The MIPS C compiler needs to be told to increase its table size
671     for switch statements with the `-Wf,-XNg1500' option in order to
672     compile `cp/parse.c'.  If you use the `-O2' optimization option,
673     you also need to use `-Olimit 3000'.  Both of these options are
674     automatically generated in the `Makefile' that the shell script
675     `configure' builds.  If you override the `CC' make variable and
676     use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
677     3000'.
678
679     On Irix version 4.0.5F, and perhaps on some other versions as well,
680     there is an assembler bug that reorders instructions incorrectly.
681     To work around it, specify the target configuration
682     `mips-sgi-irix4loser'.  This configuration inhibits assembler
683     optimization.
684
685     In a compiler configured with target `mips-sgi-irix4', you can turn
686     off assembler optimization by using the `-noasmopt' option.  This
687     compiler option passes the option `-O0' to the assembler, to
688     inhibit reordering.
689
690     The `-noasmopt' option can be useful for testing whether a problem
691     is due to erroneous assembler reordering.  Even if a problem does
692     not go away with `-noasmopt', it may still be due to assembler
693     reordering--perhaps GNU CC itself was miscompiled as a result.
694
695     To enable debugging under Irix 5, you must use GNU as 2.5 or later,
696     and use the `--with-gnu-as' configure option when configuring gcc.
697     GNU as is distributed as part of the binutils package.
698
699`mips-sony-sysv'
700     Sony MIPS NEWS.  This works in NEWSOS 5.0.1, but not in 5.0.2
701     (which uses ELF instead of COFF).  Support for 5.0.2 will probably
702     be provided soon by volunteers.  In particular, the linker does
703     not like the code generated by GCC when shared libraries are
704     linked in.
705
706`ns32k-encore'
707     Encore ns32000 system.  Encore systems are supported only under
708     BSD.
709
710`ns32k-*-genix'
711     National Semiconductor ns32000 system.  Genix has bugs in `alloca'
712     and `malloc'; you must get the compiled versions of these from GNU
713     Emacs.
714
715`ns32k-sequent'
716     Go to the Berkeley universe before compiling.
717
718`ns32k-utek'
719     UTEK ns32000 system ("merlin").  The C compiler that comes with
720     this system cannot compile GNU CC; contact `tektronix!reed!mason'
721     to get binaries of GNU CC for bootstrapping.
722
723`romp-*-aos'
724`romp-*-mach'
725     The only operating systems supported for the IBM RT PC are AOS and
726     MACH.  GNU CC does not support AIX running on the RT.  We
727     recommend you compile GNU CC with an earlier version of itself; if
728     you compile GNU CC with `hc', the Metaware compiler, it will work,
729     but you will get mismatches between the stage 2 and stage 3
730     compilers in various files.  These errors are minor differences in
731     some floating-point constants and can be safely ignored; the stage
732     3 compiler is correct.
733
734`rs6000-*-aix'
735`powerpc-*-aix'
736     Various early versions of each release of the IBM XLC compiler
737     will not bootstrap GNU CC.  Symptoms include differences between
738     the stage2 and stage3 object files, and errors when compiling
739     `libgcc.a' or `enquire'.  Known problematic releases include:
740     xlc-1.2.1.8, xlc-1.3.0.0 (distributed with AIX 3.2.5), and
741     xlc-1.3.0.19.  Both xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are
742     known to produce working versions of GNU CC, but most other recent
743     releases correctly bootstrap GNU CC.
744
745     Release 4.3.0 of AIX and ones prior to AIX 3.2.4 include a version
746     of the IBM assembler which does not accept debugging directives:
747     assembler updates are available as PTFs.  Also, if you are using
748     AIX 3.2.5 or greater and the GNU assembler, you must have a
749     version modified after October 16th, 1995 in order for the GNU C
750     compiler to build.  See the file `README.RS6000' for more details
751     on any of these problems.
752
753     GNU CC does not yet support the 64-bit PowerPC instructions.
754
755     Objective C does not work on this architecture because it makes
756     assumptions that are incompatible with the calling conventions.
757
758     AIX on the RS/6000 provides support (NLS) for environments outside
759     of the United States.  Compilers and assemblers use NLS to support
760     locale-specific representations of various objects including
761     floating-point numbers ("." vs "," for separating decimal
762     fractions).  There have been problems reported where the library
763     linked with GNU CC does not produce the same floating-point
764     formats that the assembler accepts.  If you have this problem, set
765     the LANG environment variable to "C" or "En_US".
766
767     Due to changes in the way that GNU CC invokes the binder (linker)
768     for AIX 4.1, you may now receive warnings of duplicate symbols
769     from the link step that were not reported before.  The assembly
770     files generated by GNU CC for AIX have always included multiple
771     symbol definitions for certain global variable and function
772     declarations in the original program.  The warnings should not
773     prevent the linker from producing a correct library or runnable
774     executable.
775
776     By default, AIX 4.1 produces code that can be used on either Power
777     or PowerPC processors.
778
779     You can specify a default version for the `-mcpu='CPU_TYPE switch
780     by using the configure option `--with-cpu-'CPU_TYPE.
781
782`powerpc-*-elf'
783`powerpc-*-sysv4'
784     PowerPC system in big endian mode, running System V.4.
785
786     You can specify a default version for the `-mcpu='CPU_TYPE switch
787     by using the configure option `--with-cpu-'CPU_TYPE.
788
789`powerpc-*-linux-gnu'
790     PowerPC system in big endian mode, running the Linux-based GNU
791     system.
792
793     You can specify a default version for the `-mcpu='CPU_TYPE switch
794     by using the configure option `--with-cpu-'CPU_TYPE.
795
796`powerpc-*-eabiaix'
797     Embedded PowerPC system in big endian mode with -mcall-aix
798     selected as the default.
799
800     You can specify a default version for the `-mcpu='CPU_TYPE switch
801     by using the configure option `--with-cpu-'CPU_TYPE.
802
803`powerpc-*-eabisim'
804     Embedded PowerPC system in big endian mode for use in running
805     under the PSIM simulator.
806
807     You can specify a default version for the `-mcpu='CPU_TYPE switch
808     by using the configure option `--with-cpu-'CPU_TYPE.
809
810`powerpc-*-eabi'
811     Embedded PowerPC system in big endian mode.
812
813     You can specify a default version for the `-mcpu='CPU_TYPE switch
814     by using the configure option `--with-cpu-'CPU_TYPE.
815
816`powerpcle-*-elf'
817`powerpcle-*-sysv4'
818     PowerPC system in little endian mode, running System V.4.
819
820     You can specify a default version for the `-mcpu='CPU_TYPE switch
821     by using the configure option `--with-cpu-'CPU_TYPE.
822
823`powerpcle-*-solaris2*'
824     PowerPC system in little endian mode, running Solaris 2.5.1 or
825     higher.
826
827     You can specify a default version for the `-mcpu='CPU_TYPE switch
828     by using the configure option `--with-cpu-'CPU_TYPE.  Beta
829     versions of the Sun 4.0 compiler do not seem to be able to build
830     GNU CC correctly.  There are also problems with the host assembler
831     and linker that are fixed by using the GNU versions of these tools.
832
833`powerpcle-*-eabisim'
834     Embedded PowerPC system in little endian mode for use in running
835     under the PSIM simulator.
836
837`powerpcle-*-eabi'
838     Embedded PowerPC system in little endian mode.
839
840     You can specify a default version for the `-mcpu='CPU_TYPE switch
841     by using the configure option `--with-cpu-'CPU_TYPE.
842
843`powerpcle-*-winnt'
844`powerpcle-*-pe'
845     PowerPC system in little endian mode running Windows NT.
846
847     You can specify a default version for the `-mcpu='CPU_TYPE switch
848     by using the configure option `--with-cpu-'CPU_TYPE.
849
850`vax-dec-ultrix'
851     Don't try compiling with Vax C (`vcc').  It produces incorrect code
852     in some cases (for example, when `alloca' is used).
853
854     Meanwhile, compiling `cp/parse.c' with pcc does not work because of
855     an internal table size limitation in that compiler.  To avoid this
856     problem, compile just the GNU C compiler first, and use it to
857     recompile building all the languages that you want to run.
858
859`sparc-sun-*'
860     See *Note Sun Install::, for information on installing GNU CC on
861     Sun systems.
862
863`vax-dec-vms'
864     See *Note VMS Install::, for details on how to install GNU CC on
865     VMS.
866
867`we32k-*-*'
868     These computers are also known as the 3b2, 3b5, 3b20 and other
869     similar names.  (However, the 3b1 is actually a 68000; see *Note
870     Configurations::.)
871
872     Don't use `-g' when compiling with the system's compiler.  The
873     system's linker seems to be unable to handle such a large program
874     with debugging information.
875
876     The system's compiler runs out of capacity when compiling `stmt.c'
877     in GNU CC.  You can work around this by building `cpp' in GNU CC
878     first, then use that instead of the system's preprocessor with the
879     system's C compiler to compile `stmt.c'.  Here is how:
880
881          mv /lib/cpp /lib/cpp.att
882          cp cpp /lib/cpp.gnu
883          echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp
884          chmod +x /lib/cpp
885
886     The system's compiler produces bad code for some of the GNU CC
887     optimization files.  So you must build the stage 2 compiler without
888     optimization.  Then build a stage 3 compiler with optimization.
889     That executable should work.  Here are the necessary commands:
890
891          make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
892          make stage2
893          make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
894
895     You may need to raise the ULIMIT setting to build a C++ compiler,
896     as the file `cc1plus' is larger than one megabyte.
897
898
899File: gcc.info,  Node: Other Dir,  Next: Cross-Compiler,  Prev: Configurations,  Up: Installation
900
901Compilation in a Separate Directory
902===================================
903
904   If you wish to build the object files and executables in a directory
905other than the one containing the source files, here is what you must
906do differently:
907
908  1. Make sure you have a version of Make that supports the `VPATH'
909     feature.  (GNU Make supports it, as do Make versions on most BSD
910     systems.)
911
912  2. If you have ever run `configure' in the source directory, you must
913     undo the configuration.  Do this by running:
914
915          make distclean
916
917  3. Go to the directory in which you want to build the compiler before
918     running `configure':
919
920          mkdir gcc-sun3
921          cd gcc-sun3
922
923     On systems that do not support symbolic links, this directory must
924     be on the same file system as the source code directory.
925
926  4. Specify where to find `configure' when you run it:
927
928          ../gcc/configure ...
929
930     This also tells `configure' where to find the compiler sources;
931     `configure' takes the directory from the file name that was used to
932     invoke it.  But if you want to be sure, you can specify the source
933     directory with the `--srcdir' option, like this:
934
935          ../gcc/configure --srcdir=../gcc OTHER OPTIONS
936
937     The directory you specify with `--srcdir' need not be the same as
938     the one that `configure' is found in.
939
940   Now, you can run `make' in that directory.  You need not repeat the
941configuration steps shown above, when ordinary source files change.  You
942must, however, run `configure' again when the configuration files
943change, if your system does not support symbolic links.
944
945
946File: gcc.info,  Node: Cross-Compiler,  Next: Sun Install,  Prev: Other Dir,  Up: Installation
947
948Building and Installing a Cross-Compiler
949========================================
950
951   GNU CC can function as a cross-compiler for many machines, but not
952all.
953
954   * Cross-compilers for the Mips as target using the Mips assembler
955     currently do not work, because the auxiliary programs
956     `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything
957     but a Mips.  It does work to cross compile for a Mips if you use
958     the GNU assembler and linker.
959
960   * Cross-compilers between machines with different floating point
961     formats have not all been made to work.  GNU CC now has a floating
962     point emulator with which these can work, but each target machine
963     description needs to be updated to take advantage of it.
964
965   * Cross-compilation between machines of different word sizes is
966     somewhat problematic and sometimes does not work.
967
968   Since GNU CC generates assembler code, you probably need a
969cross-assembler that GNU CC can run, in order to produce object files.
970If you want to link on other than the target machine, you need a
971cross-linker as well.  You also need header files and libraries suitable
972for the target machine that you can install on the host machine.
973
974* Menu:
975
976* Steps of Cross::      Using a cross-compiler involves several steps
977                          that may be carried out on different machines.
978* Configure Cross::     Configuring a cross-compiler.
979* Tools and Libraries:: Where to put the linker and assembler, and the C library.
980* Cross Headers::       Finding and installing header files
981                          for a cross-compiler.
982* Cross Runtime::       Supplying arithmetic runtime routines (`libgcc1.a').
983* Build Cross::         Actually compiling the cross-compiler.
984
985
986File: gcc.info,  Node: Steps of Cross,  Next: Configure Cross,  Up: Cross-Compiler
987
988Steps of Cross-Compilation
989--------------------------
990
991   To compile and run a program using a cross-compiler involves several
992steps:
993
994   * Run the cross-compiler on the host machine to produce assembler
995     files for the target machine.  This requires header files for the
996     target machine.
997
998   * Assemble the files produced by the cross-compiler.  You can do this
999     either with an assembler on the target machine, or with a
1000     cross-assembler on the host machine.
1001
1002   * Link those files to make an executable.  You can do this either
1003     with a linker on the target machine, or with a cross-linker on the
1004     host machine.  Whichever machine you use, you need libraries and
1005     certain startup files (typically `crt....o') for the target
1006     machine.
1007
1008   It is most convenient to do all of these steps on the same host
1009machine, since then you can do it all with a single invocation of GNU
1010CC.  This requires a suitable cross-assembler and cross-linker.  For
1011some targets, the GNU assembler and linker are available.
1012
1013
1014File: gcc.info,  Node: Configure Cross,  Next: Tools and Libraries,  Prev: Steps of Cross,  Up: Cross-Compiler
1015
1016Configuring a Cross-Compiler
1017----------------------------
1018
1019   To build GNU CC as a cross-compiler, you start out by running
1020`configure'.  Use the `--target=TARGET' to specify the target type.  If
1021`configure' was unable to correctly identify the system you are running
1022on, also specify the `--build=BUILD' option.  For example, here is how
1023to configure for a cross-compiler that produces code for an HP 68030
1024system running BSD on a system that `configure' can correctly identify:
1025
1026     ./configure --target=m68k-hp-bsd4.3
1027
1028
1029File: gcc.info,  Node: Tools and Libraries,  Next: Cross Headers,  Prev: Configure Cross,  Up: Cross-Compiler
1030
1031Tools and Libraries for a Cross-Compiler
1032----------------------------------------
1033
1034   If you have a cross-assembler and cross-linker available, you should
1035install them now.  Put them in the directory `/usr/local/TARGET/bin'.
1036Here is a table of the tools you should put in this directory:
1037
1038`as'
1039     This should be the cross-assembler.
1040
1041`ld'
1042     This should be the cross-linker.
1043
1044`ar'
1045     This should be the cross-archiver: a program which can manipulate
1046     archive files (linker libraries) in the target machine's format.
1047
1048`ranlib'
1049     This should be a program to construct a symbol table in an archive
1050     file.
1051
1052   The installation of GNU CC will find these programs in that
1053directory, and copy or link them to the proper place to for the
1054cross-compiler to find them when run later.
1055
1056   The easiest way to provide these files is to build the Binutils
1057package and GAS.  Configure them with the same `--host' and `--target'
1058options that you use for configuring GNU CC, then build and install
1059them.  They install their executables automatically into the proper
1060directory.  Alas, they do not support all the targets that GNU CC
1061supports.
1062
1063   If you want to install libraries to use with the cross-compiler,
1064such as a standard C library, put them in the directory
1065`/usr/local/TARGET/lib'; installation of GNU CC copies all the files in
1066that subdirectory into the proper place for GNU CC to find them and
1067link with them.  Here's an example of copying some libraries from a
1068target machine:
1069
1070     ftp TARGET-MACHINE
1071     lcd /usr/local/TARGET/lib
1072     cd /lib
1073     get libc.a
1074     cd /usr/lib
1075     get libg.a
1076     get libm.a
1077     quit
1078
1079The precise set of libraries you'll need, and their locations on the
1080target machine, vary depending on its operating system.
1081
1082   Many targets require "start files" such as `crt0.o' and `crtn.o'
1083which are linked into each executable; these too should be placed in
1084`/usr/local/TARGET/lib'.  There may be several alternatives for
1085`crt0.o', for use with profiling or other compilation options.  Check
1086your target's definition of `STARTFILE_SPEC' to find out what start
1087files it uses.  Here's an example of copying these files from a target
1088machine:
1089
1090     ftp TARGET-MACHINE
1091     lcd /usr/local/TARGET/lib
1092     prompt
1093     cd /lib
1094     mget *crt*.o
1095     cd /usr/lib
1096     mget *crt*.o
1097     quit
1098
Note: See TracBrowser for help on using the repository browser.