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