|
|
1.1.1.3 ! root 1: This is Info file gcc.info, produced by Makeinfo-1.47 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: 6: Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc. 7: 1.1.1.3 ! root 8: Permission is granted to make and distribute verbatim copies of this ! 9: manual provided the copyright notice and this permission notice are ! 10: preserved on all copies. 1.1 root 11: 12: Permission is granted to copy and distribute modified versions of 13: this manual under the conditions for verbatim copying, provided also 1.1.1.3 ! root 14: that the sections entitled "GNU General Public License" and "Boycott" ! 15: are included exactly as in the original, and provided that the entire ! 16: resulting derived work is distributed under the terms of a permission ! 17: notice identical to this one. 1.1 root 18: 19: Permission is granted to copy and distribute translations of this 20: manual into another language, under the above conditions for modified 1.1.1.3 ! root 21: versions, except that the sections entitled "GNU General Public ! 22: License" and "Boycott", and this permission notice, may be included in ! 23: translations approved by the Free Software Foundation instead of in the ! 24: original English. 1.1 root 25: 26: 27: File: gcc.info, Node: M88K Options, Next: RS/6000 Options, Prev: AMD29K Options, Up: Submodel Options 28: 29: M88K Options 30: ------------ 31: 32: These `-m' options are defined for Motorola 88K architectures: 33: 34: `-m88000' 35: Generate code that works well on both the m88100 and the m88110. 36: 37: `-m88100' 38: Generate code tha Generate code that works best for the m88100, 39: but that also runs on the m88110. 40: 41: `-m88110' 42: Generate code that works best for the m88110, and may not run on 43: the m88100. 44: 45: `-midentify-revision' 46: Include an `ident' directive in the assembler output recording the 47: source file name, compiler name and version, timestamp, and 48: compilation flags used. 49: 50: `-mno-underscores' 1.1.1.3 ! root 51: In assembler output, emit symbol names without adding an underscore ! 52: character at the beginning of each name. The default is to use an ! 53: underscore as prefix on each name. 1.1 root 54: 55: `-mocs-debug-info' 56: `-mno-ocs-debug-info' 57: Include (or omit) additional debugging information (about 58: registers used in each stack frame) as specified in the 88open 59: Object Compatibility Standard, "OCS". This extra information 60: allows debugging of code that has had the frame pointer 61: eliminated. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is 62: to include this information; other 88k configurations omit this 63: information by default. 64: 65: `-mocs-frame-position' 66: When emitting COFF debugging information for automatic variables 67: and parameters stored on the stack, use the offset from the 68: canonical frame address, which is the stack pointer (register 31) 69: on entry to the function. The DG/UX, SVr4, Delta88 SVr3.2, and 70: BCS configurations use `-mocs-frame-position'; other 88k 71: configurations have the default `-mno-ocs-frame-position'. 72: 73: `-mno-ocs-frame-position' 74: When emitting COFF debugging information for automatic variables 75: and parameters stored on the stack, use the offset from the frame 76: pointer register (register 30). When this option is in effect, 77: the frame pointer is not eliminated when debugging information is 78: selected by the -g switch. 79: 80: `-moptimize-arg-area' 81: `-mno-optimize-arg-area' 1.1.1.3 ! root 82: Control how to store function arguments in stack frames. ! 83: `-moptimize-arg-area' saves space, but was ruled illegal by 88open. ! 84: `-mno-optimize-arg-area' conforms to the 88open standards. By ! 85: default GNU CC does not optimize the argument area. 1.1 root 86: 87: `-mshort-data-NUM' 88: Generate smaller data references by making them relative to `r0', 89: which allows loading a value using a single instruction (rather 90: than the usual two). You control which data references are 91: affected by specifying NUM with this option. For example, if you 92: specify `-mshort-data-512', then the data references affected are 1.1.1.3 ! root 93: those involving displacements of less than 512 bytes. 1.1 root 94: `-mshort-data-NUM' is not effective for NUM greater than 64K. 95: 96: `-msvr4' 97: `-msvr3' 98: Turn on (`-msvr4') or off (`-msvr3') compiler extensions related 99: to System V release 4 (SVr4). This controls the following: 100: 101: 1. Which variant of the assembler syntax to emit (which you can 102: select independently using `-mversion-03.00'). 103: 104: 2. `-msvr4' makes the C preprocessor recognize `#pragma weak' 105: that is used on System V release 4. 106: 1.1.1.3 ! root 107: 3. `-msvr4' makes GNU CC issue additional declaration directives ! 108: used in SVr4. 1.1 root 109: 110: `-msvr3' is the default for all m88K configurations except the 111: SVr4 configuration. 112: 113: `-mversion-03.00' 114: In the DG/UX configuration, there are two flavors of SVr4. This 115: option modifies `-msvr4' to select whether the hybrid-COFF or 116: real-ELF flavor is used. All other configurations ignore this 117: option. 118: 119: `-mno-check-zero-division' 120: `-mcheck-zero-division' 1.1.1.3 ! root 121: Early models of the 88K architecture had problems with division by ! 122: zero; in particular, many of them didn't trap. Use these options ! 123: to avoid including (or to include explicitly) additional code to ! 124: detect division by zero and signal an exception. All GNU CC ! 125: configurations for the 88K use `-mcheck-zero-division' by default. 1.1 root 126: 127: `-muse-div-instruction' 128: Do not emit code to check both the divisor and dividend when doing 129: signed integer division to see if either is negative, and adjust 130: the signs so the divide is done using non-negative numbers. 131: Instead, rely on the operating system to calculate the correct 1.1.1.3 ! root 132: value when the `div' instruction traps. This results in different ! 133: behavior when the most negative number is divided by -1, but is ! 134: useful when most or all signed integer divisions are done with ! 135: positive numbers. 1.1 root 136: 137: `-mtrap-large-shift' 138: `-mhandle-large-shift' 139: Include code to detect bit-shifts of more than 31 bits; 140: respectively, trap such shifts or emit code to handle them 141: properly. By default GNU CC makes no special provision for large 142: bit shifts. 143: 144: `-mwarn-passed-structs' 1.1.1.3 ! root 145: Warn when a function passes a struct as an argument or result. ! 146: Structure-passing conventions have changed during the evolution of ! 147: the C language, and are often the source of portability problems. ! 148: By default, GNU CC issues no such warning. 1.1 root 149: 150: 151: File: gcc.info, Node: RS/6000 Options, Next: RT Options, Prev: M88K Options, Up: Submodel Options 152: 153: IBM RS/6000 Options 154: ------------------- 155: 156: Only one pair of `-m' options is defined for the IBM RS/6000: 157: 158: `-mfp-in-toc' 159: `-mno-fp-in-toc' 160: Control whether or not floating-point constants go in the Table of 161: Contents (TOC), a table of all global variable and function 1.1.1.3 ! root 162: addresses. By default GNU CC puts floating-point constants there; ! 163: if the TOC overflows, `-mno-fp-in-toc' will reduce the size of the ! 164: TOC, which may avoid the overflow. 1.1 root 165: 166: 167: File: gcc.info, Node: RT Options, Next: MIPS Options, Prev: RS/6000 Options, Up: Submodel Options 168: 169: IBM RT Options 170: -------------- 171: 172: These `-m' options are defined for the IBM RT PC: 173: 174: `-min-line-mul' 175: Use an in-line code sequence for integer multiplies. This is the 176: default. 177: 178: `-mcall-lib-mul' 179: Call `lmul$$' for integer multiples. 180: 181: `-mfull-fp-blocks' 182: Generate full-size floating point data blocks, including the 183: minimum amount of scratch space recommended by IBM. This is the 184: default. 185: 186: `-mminimum-fp-blocks' 1.1.1.3 ! root 187: Do not include extra scratch space in floating point data blocks. ! 188: This results in smaller code, but slower execution, since scratch ! 189: space must be allocated dynamically. 1.1 root 190: 191: `-mfp-arg-in-fpregs' 192: Use a calling sequence incompatible with the IBM calling 193: convention in which floating point arguments are passed in 1.1.1.3 ! root 194: floating point registers. Note that `varargs.h' and `stdargs.h' 1.1 root 195: will not work with floating point operands if this option is 196: specified. 197: 198: `-mfp-arg-in-gregs' 199: Use the normal calling convention for floating point arguments. 200: This is the default. 201: 202: `-mhc-struct-return' 1.1.1.3 ! root 203: Return structures of more than one word in memory, rather than in a ! 204: register. This provides compatibility with the MetaWare HighC (hc) ! 205: compiler. Use `-fpcc-struct-return' for compatibility with the ! 206: Portable C Compiler (pcc). 1.1 root 207: 208: `-mnohc-struct-return' 209: Return some structures of more than one word in registers, when 210: convenient. This is the default. For compatibility with the 211: IBM-supplied compilers, use either `-fpcc-struct-return' or 212: `-mhc-struct-return'. 213: 214: 1.1.1.2 root 215: File: gcc.info, Node: MIPS Options, Next: i386 Options, Prev: RT Options, Up: Submodel Options 1.1 root 216: 217: MIPS Options 218: ------------ 219: 220: These `-m' options are defined for the MIPS family of computers: 221: 222: `-mcpu=CPU TYPE' 223: Assume the defaults for the machine type CPU TYPE when scheduling 1.1.1.2 root 224: instructions. The default CPU TYPE is `default', which picks the 1.1 root 225: longest cycles times for any of the machines, in order that the 1.1.1.3 ! root 226: code run at reasonable rates on all MIPS cpu's. Other choices for ! 227: CPU TYPE are `r2000', `r3000', `r4000', and `r6000'. While ! 228: picking a specific CPU TYPE will schedule things appropriately for ! 229: that particular chip, the compiler will not generate any code that ! 230: does not meet level 1 of the MIPS ISA (instruction set ! 231: architecture) without the `-mips2' or `-mips3' switches being used. 1.1 root 232: 233: `-mips2' 234: Issue instructions from level 2 of the MIPS ISA (branch likely, 235: square root instructions). The `-mcpu=r4000' or `-mcpu=r6000' 1.1.1.3 ! root 236: switch must be used in conjunction with `-mips2'. 1.1 root 237: 238: `-mips3' 239: Issue instructions from level 3 of the MIPS ISA (64 bit 1.1.1.3 ! root 240: instructions). You must use the `-mcpu=r4000' switch along with 1.1 root 241: `-mips3'. 242: 243: `-mint64' 244: `-mlong64' 245: `-mlonglong128' 246: These options don't work at present. 247: 248: `-mmips-as' 249: Generate code for the MIPS assembler, and invoke `mips-tfile' to 250: add normal debug information. This is the default for all 251: platforms except for the OSF/1 reference platform, using the 252: OSF/rose object format. If the either of the `-gstabs' or 253: `-gstabs+' switches are used, the `mips-tfile' program will 254: encapsulate the stabs within MIPS ECOFF. 255: 256: `-mgas' 257: Generate code for the GNU assembler. This is the default on the 258: OSF/1 reference platform, using the OSF/rose object format. 259: 260: `-mrnames' 261: `-mno-rnames' 262: The `-mrnames' switch says to output code using the MIPS software 263: names for the registers, instead of the hardware names (ie, A0 1.1.1.3 ! root 264: instead of $4). The GNU assembler does not support the `-mrnames' ! 265: switch, and the MIPS assembler will be instructed to run the MIPS ! 266: C preprocessor over the source file. The `-mno-rnames' switch is ! 267: default. 1.1 root 268: 269: `-mgpopt' 270: `-mno-gpopt' 271: The `-mgpopt' switch says to write all of the data declarations 1.1.1.2 root 272: before the instructions in the text section, this allows the MIPS 1.1 root 273: assembler to generate one word memory references instead of using 274: two words for short global or static data items. This is on by 275: default if optimization is selected. 276: 277: `-mstats' 278: `-mno-stats' 279: For each non-inline function processed, the `-mstats' switch 280: causes the compiler to emit one line to the standard error file to 281: print statistics about the program (number of registers saved, 282: stack size, etc.). 283: 284: `-mmemcpy' 285: `-mno-memcpy' 286: The `-mmemcpy' switch makes all block moves call the appropriate 287: string function (`memcpy' or `bcopy') instead of possibly 288: generating inline code. 289: 290: `-mmips-tfile' 291: `-mno-mips-tfile' 292: The `-mno-mips-tfile' switch causes the compiler not postprocess 293: the object file with the `mips-tfile' program, after the MIPS 294: assembler has generated it to add debug support. If `mips-tfile' 295: is not run, then no local variables will be available to the 296: debugger. In addition, `stage2' and `stage3' objects will have 297: the temporary file names passed to the assembler embedded in the 1.1.1.2 root 298: object file, which means the objects will not compare the same. 299: The `-mno-mips-tfile' switch should only be used when there are 300: bugs in the `mips-tfile' program that prevents compilation. 1.1 root 301: 302: `-msoft-float' 1.1.1.3 ! root 303: Generate output containing library calls for floating point. ! 304: *Warning:* the requisite libraries are not part of GNU CC. 1.1 root 305: Normally the facilities of the machine's usual C compiler are 306: used, but this can't be done directly in cross-compilation. You 307: must make your own arrangements to provide suitable library 308: functions for cross-compilation. 309: 310: `-mhard-float' 311: Generate output containing floating point instructions. This is 312: the default if you use the unmodified sources. 313: 314: `-mfp64' 315: Assume that the FR bit in the status word is on, and that there 316: are 32 64-bit floating point registers, instead of 32 32-bit 1.1.1.3 ! root 317: floating point registers. You must also specify the `-mcpu=r4000' ! 318: and `-mips3' switches. 1.1 root 319: 320: `-mfp32' 1.1.1.3 ! root 321: Assume that there are 32 32-bit floating point registers. This is ! 322: the default. 1.1 root 323: 324: `-mabicalls' 325: `-mno-abicalls' 326: Emit the `.abicalls', `.cpload', and `.cprestore' pseudo 1.1.1.3 ! root 327: operations that some System V.4 ports use for position independent ! 328: code. 1.1 root 329: 330: `-mhalf-pic' 331: `-mno-half-pic' 332: Put pointers to extern references into the data section and load 333: them up, rather than put the references in the text section. 334: These options do not work at present. 335: 336: `-G NUM' 337: Put global and static items less than or equal to NUM bytes into 338: the small data or bss sections instead of the normal data or bss 339: section. This allows the assembler to emit one word memory 340: reference instructions based on the global pointer (GP or $28), 341: instead of the normal two words used. By default, NUM is 8 when 1.1.1.3 ! root 342: the MIPS assembler is used, and 0 when the GNU assembler is used. ! 343: The `-G NUM' switch is also passed to the assembler and linker. 1.1 root 344: All modules should be compiled with the same `-G NUM' value. 345: 1.1.1.2 root 346: `-nocpp' 347: Tell the MIPS assembler to not run it's preprocessor over user 348: assembler files (with a `.s' suffix) when assembling them. 349: 1.1 root 350: These options are defined by the macro `TARGET_SWITCHES' in the 351: machine description. The default for the options is also defined by 352: that macro, which enables you to change the defaults. 353: 354: 1.1.1.2 root 355: File: gcc.info, Node: i386 Options, Prev: MIPS Options, Up: Submodel Options 356: 357: Intel 386 Options 358: ----------------- 359: 360: These `-m' options are defined for the i386 family of computers: 361: 362: `-m486' 363: `-mno486' 364: Control whether or not code is optimized for a 486 instead of an 365: 386. Code generated for an 486 will run on a 386 and vice versa. 366: 367: `-msoft-float' 1.1.1.3 ! root 368: Generate output containing library calls for floating point. ! 369: *Warning:* the requisite libraries are not part of GNU CC. 1.1.1.2 root 370: Normally the facilities of the machine's usual C compiler are 371: used, but this can't be done directly in cross-compilation. You 372: must make your own arrangements to provide suitable library 373: functions for cross-compilation. 374: 1.1.1.3 ! root 375: On machines where a function returnings float point results in the ! 376: 80387 register stack, some floating point opcodes may be emitted ! 377: even if `-msoft-float' is used. 1.1.1.2 root 378: 379: 1.1 root 380: File: gcc.info, Node: Code Gen Options, Next: Environment Variables, Prev: Submodel Options, Up: Invoking GCC 381: 382: Options for Code Generation Conventions 383: ======================================= 384: 385: These machine-independent options control the interface conventions 386: used in code generation. 387: 1.1.1.3 ! root 388: Most of them have both positive and negative forms; the negative form ! 389: of `-ffoo' would be `-fno-foo'. In the table below, only one of the ! 390: forms is listed--the one which is not the default. You can figure out ! 391: the other form by either removing `no-' or adding it. 1.1 root 392: 393: `-fpcc-struct-return' 394: Use the same convention for returning `struct' and `union' values 395: that is used by the usual C compiler on your system. This 396: convention is less efficient for small structures, and on many 397: machines it fails to be reentrant; but it has the advantage of 398: allowing intercallability between GNU CC-compiled code and 399: PCC-compiled code. 400: 401: `-fshort-enums' 402: Allocate to an `enum' type only as many bytes as it needs for the 403: declared range of possible values. Specifically, the `enum' type 404: will be equivalent to the smallest integer type which has enough 405: room. 406: 407: `-fshort-double' 408: Use the same size for `double' as for `float'. 409: 410: `-fshared-data' 411: Requests that the data and non-`const' variables of this 412: compilation be shared data rather than private data. The 413: distinction makes sense only on certain operating systems, where 414: shared data is shared between processes running the same program, 415: while private data exists in one copy per process. 416: 417: `-fno-common' 1.1.1.3 ! root 418: Allocate even uninitialized global variables in the bss section of ! 419: the object file, rather than generating them as common blocks. ! 420: This has the effect that if the same variable is declared (without ! 421: `extern') in two different compilations, you will get an error ! 422: when you link them. The only reason this might be useful is if you ! 423: wish to verify that the program will work on other systems which ! 424: always work this way. 1.1 root 425: 426: `-fno-ident' 427: Ignore the `#ident' directive. 428: 429: `-fno-gnu-linker' 430: Don't output global initializations such as C++ constructors and 431: destructors in the form used by the GNU linker (on systems where 1.1.1.3 ! root 432: the GNU linker is the standard method of handling them). Use this ! 433: option when you want to use a "collect" program and a non-GNU ! 434: linker. 1.1 root 435: 436: `-finhibit-size-directive' 437: Don't output a `.size' assembler directive, or anything else that 1.1.1.3 ! root 438: would cause trouble if the function is split in the middle, and the ! 439: two halves are placed at locations far apart in memory. This ! 440: option is used when compiling `crtstuff.c'; you should not need to ! 441: use it for anything else. ! 442: ! 443: `-fverbose-asm' ! 444: Put extra commentary information in the generated assembly code to ! 445: make it more readable. This option is generally only of use to ! 446: those who actually need to read the generated assembly code ! 447: (perhaps while debugging the compiler itself). 1.1 root 448: 449: `-fvolatile' 450: Consider all memory references through pointers to be volatile. 451: 452: `-fpic' 1.1.1.3 ! root 453: If supported for the target machines, generate position-independent ! 454: code, suitable for use in a shared library. All addresses will be ! 455: accessed through a global offset table (GOT). If the GOT size for ! 456: the linked executable exceeds a machine-specific maximum size, you ! 457: will get an error message from the linker indicating that `-fpic' ! 458: does not work; recompile with `-fPIC' instead. (These maximums ! 459: are 16k on the m88k, 8k on the Sparc, and 32k on the m68k and ! 460: RS/6000. The 386 has no such limit.) 1.1 root 461: 462: Position-independent code requires special support, and therefore 463: works only on certain machines. Code generated for the IBM 464: RS/6000 is always position-independent. 465: 1.1.1.3 ! root 466: The GNU assembler does not fully support PIC. Currently, you must ! 467: use some other assembler in order for PIC to work. We would 1.1.1.2 root 468: welcome volunteers to upgrade GAS to handle this; the first part 1.1.1.3 ! root 469: of the job is to figure out what the assembler must do differently. 1.1.1.2 root 470: 1.1 root 471: `-fPIC' 472: If supported for the target machine, emit position-independent 473: code, suitable for dynamic linking and avoiding any limit on the 474: size of the global offset table. This option makes a difference 475: on the m68k, m88k and the Sparc. 476: 477: Position-independent code requires special support, and therefore 478: works only on certain machines. 479: 480: `-ffixed-REG' 481: Treat the register named REG as a fixed register; generated code 482: should never refer to it (except perhaps as a stack pointer, frame 483: pointer or in some other fixed role). 484: 485: REG must be the name of a register. The register names accepted 1.1.1.3 ! root 486: are machine-specific and are defined in the `REGISTER_NAMES' macro ! 487: in the machine description macro file. 1.1 root 488: 489: This flag does not have a negative form, because it specifies a 490: three-way choice. 491: 492: `-fcall-used-REG' 493: Treat the register named REG as an allocatable register that is 494: clobbered by function calls. It may be allocated for temporaries 495: or variables that do not live across a call. Functions compiled 496: this way will not save and restore the register REG. 497: 1.1.1.3 ! root 498: Use of this flag for a register that has a fixed pervasive role in ! 499: the machine's execution model, such as the stack pointer or frame ! 500: pointer, will produce disastrous results. 1.1 root 501: 502: This flag does not have a negative form, because it specifies a 503: three-way choice. 504: 505: `-fcall-saved-REG' 506: Treat the register named REG as an allocatable register saved by 507: functions. It may be allocated even for temporaries or variables 508: that live across a call. Functions compiled this way will save 509: and restore the register REG if they use it. 510: 1.1.1.3 ! root 511: Use of this flag for a register that has a fixed pervasive role in ! 512: the machine's execution model, such as the stack pointer or frame ! 513: pointer, will produce disastrous results. 1.1 root 514: 1.1.1.3 ! root 515: A different sort of disaster will result from the use of this flag ! 516: for a register in which function values may be returned. 1.1 root 517: 518: This flag does not have a negative form, because it specifies a 519: three-way choice. 520: 521: 522: File: gcc.info, Node: Environment Variables, Prev: Code Gen Options, Up: Invoking GCC 523: 524: Environment Variables Affecting GNU CC 525: ====================================== 526: 1.1.1.3 ! root 527: This section describes several environment variables that affect how ! 528: GNU CC operates. They work by specifying directories or prefixes to use ! 529: when searching for various kinds of files. 1.1 root 530: 1.1.1.3 ! root 531: Note that you can also specify places to search using options such as ! 532: `-B', `-I' and `-L' (*note Directory Options::.). These take 1.1 root 533: precedence over places specified using environment variables, which in 534: turn take precedence over those specified by the configuration of GNU 535: CC. *Note Driver::. 536: 537: `TMPDIR' 1.1.1.3 ! root 538: If `TMPDIR' is set, it specifies the directory to use for temporary ! 539: files. GNU CC uses temporary files to hold the output of one ! 540: stage of compilation which is to be used as input to the next ! 541: stage: for example, the output of the preprocessor, which is the ! 542: input to the compiler proper. 1.1 root 543: 544: `GCC_EXEC_PREFIX' 545: If `GCC_EXEC_PREFIX' is set, it specifies a prefix to use in the 546: names of the subprograms executed by the compiler. No slash is 547: added when this prefix is combined with the name of a subprogram, 548: but you can specify a prefix that ends with a slash if you wish. 549: 1.1.1.3 ! root 550: If GNU CC cannot find the subprogram using the specified prefix, it ! 551: tries looking in the usual places for the subprogram. 1.1 root 552: 553: Other prefixes specified with `-B' take precedence over this 554: prefix. 555: 556: This prefix is also used for finding files such as `crt0.o' that 557: are used for linking. 558: 559: In addition, the prefix is used in an unusual way in finding the 560: directories to search for header files. For each of the standard 1.1.1.2 root 561: directories whose name normally begins with 562: `/usr/local/lib/gcc-lib' (more precisely, with the value of 1.1.1.3 ! root 563: `GCC_INCLUDE_DIR'), GNU CC tries replacing that beginning with the ! 564: specified prefix to produce an alternate directory name. Thus, ! 565: with `-Bfoo/', GNU CC will search `foo/bar' where it would ! 566: normally search `/usr/local/lib/bar'. These alternate directories ! 567: are searched first; the standard directories come next. 1.1 root 568: 569: `COMPILER_PATH' 570: The value of `COMPILER_PATH' is a colon-separated list of 571: directories, much like `PATH'. GNU CC tries the directories thus 572: specified when searching for subprograms, if it can't find the 573: subprograms using `GCC_EXEC_PREFIX'. 574: 575: `LIBRARY_PATH' 576: The value of `LIBRARY_PATH' is a colon-separated list of 577: directories, much like `PATH'. GNU CC tries the directories thus 578: specified when searching for special linker files, if it can't 1.1.1.3 ! root 579: find them using `GCC_EXEC_PREFIX'. Linking using GNU CC also uses ! 580: these directories when searching for ordinary libraries for the ! 581: `-l' option (but directories specified with `-L' come first). 1.1 root 582: 583: `C_INCLUDE_PATH' 1.1.1.2 root 584: `CPLUS_INCLUDE_PATH' 1.1 root 585: `OBJC_INCLUDE_PATH' 586: These environment variables pertain to particular languages. Each 587: variable's value is a colon-separated list of directories, much 588: like `PATH'. When GNU CC searches for header files, it tries the 1.1.1.3 ! root 589: directories listed in the variable for the language you are using, ! 590: after the directories specified with `-I' but before the standard ! 591: header file directories. 1.1 root 592: 593: `DEPENDENCIES_OUTPUT' 594: If this variable is set, its value specifies how to output 595: dependencies for Make based on the header files processed by the 596: compiler. This output looks much like the output from the `-M' 597: option (*note Preprocessor Options::.), but it goes to a separate 598: file, and is in addition to the usual results of compilation. 599: 600: The value of `DEPENDENCIES_OUTPUT' can be just a file name, in 601: which case the Make rules are written to that file, guessing the 602: target name from the source file name. Or the value can have the 603: form `FILE TARGET', in which case the rules are written to file 604: FILE using TARGET as the target name. 605: 606: 1.1.1.3 ! root 607: File: gcc.info, Node: Installation, Next: Extensions, Prev: Invoking GCC, Up: Top 1.1 root 608: 609: Installing GNU CC 610: ***************** 611: 612: Here is the procedure for installing GNU CC on a Unix system. 613: 614: * Menu: 615: 616: * Other Dir:: Compiling in a separate directory (not where the source is). 1.1.1.3 ! root 617: * Cross-Compiler:: Building and installing a cross-compiler. ! 618: * PA Install:: See below for installation on the HP Precision Architecture. 1.1 root 619: * Sun Install:: See below for installation on the Sun. 1.1.1.3 ! root 620: * 3b1 Install:: See below for installation on the 3b1. 1.1 root 621: * Unos Install:: See below for installation on Unos (from CRDS). 1.1.1.3 ! root 622: * VMS Install:: See below for installation on VMS. 1.1 root 623: 624: 1. If you have built GNU CC previously in the same directory for a 1.1.1.2 root 625: different target machine, do `make distclean' to delete all files 626: that might be invalid. 1.1 root 627: 1.1.1.3 ! root 628: 2. On a System V release 4 system, make sure `/usr/bin' precedes 1.1 root 629: `/usr/ucb' in `PATH'. The `cc' command in `/usr/ucb' uses 630: libraries which have bugs. 631: 1.1.1.3 ! root 632: 3. Specify the host and target machine configurations. You do this by ! 633: running the file `configure' with appropriate arguments. 1.1 root 634: 1.1.1.3 ! root 635: If you are building a compiler to produce code for the machine it ! 636: runs on, specify just one machine type. Use the `--target' ! 637: option; the host type will default to be the same as the target. ! 638: (For information on building a cross-compiler, see *Note ! 639: Cross-Compiler::.) The command looks like this: 1.1 root 640: 1.1.1.3 ! root 641: configure --target=sparc-sun-sunos4.1 1.1 root 642: 1.1.1.3 ! root 643: A configuration name may be canonical or it may be more or less 1.1 root 644: abbreviated. 645: 1.1.1.3 ! root 646: A canonical configuration name has three parts, separated by ! 647: dashes. It looks like this: `CPU-COMPANY-SYSTEM'. (The three parts ! 648: may themselves contain dashes; `configure' can figure out which ! 649: dashes serve which purpose.) For example, `m68k-sun-sunos4.1' ! 650: specifies a Sun 3. 1.1 root 651: 1.1.1.3 ! root 652: You can also replace parts of the configuration by nicknames or ! 653: aliases. For example, `sun3' stands for `m68k-sun', so 1.1 root 654: `sun3-sunos4.1' is another way to specify a Sun 3. You can also 1.1.1.2 root 655: use simply `sun3-sunos', since the version of SunOS is assumed by 1.1.1.3 ! root 656: default to be version 4. `sun3-bsd' also works, since `configure' ! 657: knows that the only BSD variant on a Sun 3 is SunOS. ! 658: ! 659: You can specify a version number after any of the system types, ! 660: and some of the CPU types. In most cases, the version is ! 661: irrelevant, and will be ignored. So you might as well specify the ! 662: version if you know it. 1.1 root 663: 1.1.1.3 ! root 664: Here are the possible CPU types: ! 665: ! 666: a29k, arm, cN, hppa1.0, hppa1.1, i386, i860, i960, m68000, ! 667: m68k, m88k, mips, ns32k, romp, rs6000, sparc, vax, we32k. ! 668: ! 669: Here are the recognized company names. As you can see, customary ! 670: abbreviations are used rather than the longer official names. 1.1 root 671: 672: alliant, altos, apollo, att, convergent, convex, crds, dec, 673: dg, encore, harris, hp, ibm, mips, motorola, ncr, next, ns, 674: omron, sequent, sgi, sony, sun, tti, unicom. 675: 1.1.1.3 ! root 676: The company name is meaningful only to disambiguate when the rest ! 677: of the information supplied is insufficient. You can omit it, ! 678: writing just `CPU-SYSTEM', if it is not needed. For example, 1.1 root 679: `vax-ultrix4.2' is equivalent to `vax-dec-ultrix4.2'. 680: 1.1.1.3 ! root 681: Here is a list of system types: 1.1 root 682: 1.1.1.2 root 683: bsd, sysv, mach, minix, genix, ultrix, vms, sco, isc, aix, 684: sunos, hpux, unos, luna, dgux, newsos, osfrose, osf, dynix, 685: aos, ctix. 1.1 root 686: 687: You can omit the system type; then `configure' guesses the 688: operating system from the CPU and company. 689: 1.1.1.3 ! root 690: You can add a version number to the system type; this may or may ! 691: not make a difference. For example, you can write `bsd4.3' or 1.1.1.2 root 692: `bsd4.4' to distinguish versions of BSD. In practice, the version 693: number is most needed for `sysv3' and `sysv4', which are often 694: treated differently. 695: 1.1.1.3 ! root 696: If you specify an impossible combination such as `i860-dg-vms', 1.1.1.2 root 697: then you may get an error message from `configure', or it may 698: ignore part of the information and do the best it can with the 1.1.1.3 ! root 699: rest. `configure' always prints the canonical name for the 1.1.1.2 root 700: alternative that it used. 701: 1.1.1.3 ! root 702: Often a particular model of machine has a name. Many machine 1.1.1.2 root 703: names are recognized as aliases for CPU/company combinations. 704: Thus, the machine name `sun3', mentioned above, is an alias for 1.1.1.3 ! root 705: `m68k-sun'. Sometimes we accept a company name as a machine name, ! 706: when the name is popularly used for a particular machine. Here is ! 707: a table of the known machine names: ! 708: ! 709: 3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300, ! 710: balance, convex-cN, crds, decstation-3100, decstation, delta, ! 711: encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, ! 712: hp9k7NN, hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, ! 713: miniframe, mmax, news-3600, news800, news, next, pbd, pc532, ! 714: pmax, ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3, ! 715: sun4, symmetry, tower-32, tower. 1.1 root 716: 1.1.1.2 root 717: Remember that a machine name specifies both the cpu type and the 718: company name. 1.1 root 719: 1.1.1.3 ! root 720: There are three additional options you can specify independently to ! 721: describe variant hardware and software configurations. These are ! 722: `--with-gnu-as', `--with-gnu-ld', and `--nfp'. ! 723: ! 724: `--with-gnu-as' ! 725: On certain systems, you must specify whether you want GNU CC ! 726: to work with the usual compilation tools or with the GNU ! 727: compilation tools (including GAS). Use the `--with-gnu-as' ! 728: argument when you run `configure', if you want to use the GNU ! 729: tools. (Specify `--with-gnu-ld' as well, since on these ! 730: systems GAS works only with the GNU linker.) The systems ! 731: were this makes a difference are `i386-ANYTHING-sysv', ! 732: `i860-ANYTHING-bsd', `m68k-hp-hpux', `m68k-sony-bsd', ! 733: `m68k-altos-sysv', `m68000-hp-hpux', and `m68000-att-sysv'. ! 734: On any other system, `--with-gnu-as' has no effect. ! 735: ! 736: `--with-gnu-ld' ! 737: Specify the option `--with-gnu-ld' if you plan to use the GNU ! 738: linker. This inhibits the installation of `collect2', a ! 739: program which otherwise serves as a front-end for the ! 740: system's linker on most configurations. ! 741: ! 742: `--nfp' ! 743: On certain systems, you must specify whether the machine has ! 744: a floating point unit. These systems are `m68k-sun-sunosN' ! 745: and `m68k-isi-bsd'. On any other system, `--nfp' currently ! 746: has no effect, though perhaps there are other systems where ! 747: it could usefully make a difference. ! 748: ! 749: If you want to install your own homemade configuration files, you ! 750: can use `local' as the company name to access them. If you use ! 751: configuration `CPU-local', the entire configuration name is used ! 752: to form the configuration file names. 1.1 root 753: 1.1.1.3 ! root 754: Thus, if you specify `m68k-local', then the files used are 1.1 root 755: `m68k-local.md', `m68k-local.h', `m68k-local.c', 756: `xm-m68k-local.h', `t-m68k-local', and `x-m68k-local'. 757: 1.1.1.3 ! root 758: Here is a list of configurations that have special treatment or ! 759: special things you must know: 1.1.1.2 root 760: 761: `i386-*-sco' 762: Compilation with RCC is recommended, but it produces lots of 763: spurious warnings. They do not necessarily indicate that 764: anything is wrong. 1.1 root 765: 1.1.1.3 ! root 766: `i386-sequent' ! 767: Go to the Berkeley universe before compiling. In addition, ! 768: you probably need to create a file named `string.h' ! 769: containing just one line: `#include <strings.h>'. ! 770: 1.1 root 771: `m68000-att' 772: AT&T 3b1, a.k.a. 7300 PC. Special procedures are needed to 773: compile GNU CC with this machine's standard C compiler, due 774: to bugs in that compiler. *Note 3b1 Install::. You can 775: bootstrap it more easily with previous versions of GNU CC if 776: you have them. 777: 778: `m68000-hp-bsd' 779: HP 9000 series 200 running BSD. Note that the C compiler 780: that comes with this system cannot compile GNU CC; contact 1.1.1.3 ! root 781: `[email protected]' to get binaries of GNU CC for bootstrapping. 1.1 root 782: 783: `m68k-altos' 784: Altos 3068. You must use the GNU assembler, linker and 785: debugger, with COFF-encapsulation. Also, you must fix a 1.1.1.3 ! root 786: kernel bug. Details in the file `README.ALTOS'. 1.1 root 787: 788: `m68k-hp-hpux' 1.1.1.2 root 789: HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 790: has a bug in the assembler that prevents compilation of GNU 791: CC. To fix it, get patch PHCO_0800 from HP. 792: 793: In addition, `--gas' does not currently work with this 794: configuration. Changes in HP-UX have broken the library 795: conversion tool and the linker. 1.1 root 796: 797: `m68k-sun' 1.1.1.3 ! root 798: Sun 3. We do not provide a configuration file to use the Sun ! 799: FPA by default, because programs that establish signal ! 800: handlers for floating point traps inherently cannot work with ! 801: the FPA. ! 802: ! 803: `m88k-svr3' ! 804: Motorola m88k running the AT&T/Unisoft/Motorla V.3 reference ! 805: port. These systems tend to use the Green Hills C, revision ! 806: 1.8.5, as the standard C compiler. There are apparently bugs ! 807: in this compiler that result in object files differences ! 808: between stage 2 and stage 3. If this happens, make the stage ! 809: 4 compiler and compare it to the stage 3 compiler. If the ! 810: stage 3 and stage 4 object files are identical, this suggests ! 811: a problem with the standard C compiler. It is best, however, ! 812: to use an older version of GNU CC for bootstrapping. 1.1 root 813: 814: `m88k-dgux' 815: Motorola m88k running DG/UX. To build native or cross 816: compilers on DG/UX, you must first change to the 88open BCS 817: software development environment. This is done by issuing 818: this command: 819: 820: eval `sde-target m88kbcs` 821: 1.1.1.2 root 822: `mips-mips-bsd' 1.1.1.3 ! root 823: MIPS machines running the MIPS operating system in BSD mode. ! 824: It's possible that some old versions of the system lack the 1.1.1.2 root 825: functions `memcpy', `memcmp', and `memset'. If your system 826: lacks these, you must remove or undo the definition of 827: `TARGET_MEM_FUNCTIONS' in `mips-bsd.h'. 828: 1.1.1.3 ! root 829: `mips-sony-sysv' ! 830: Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2 ! 831: (which uses ELF instead of COFF). Support for 5.0.2 will ! 832: probably be provided soon by volunteers. ! 833: 1.1 root 834: `ns32k-encore' 835: Encore ns32000 system. Encore systems are supported only 836: under BSD. 837: 838: `ns32k-*-genix' 839: National Semiconductor ns32000 system. Genix has bugs in 840: `alloca' and `malloc'; you must get the compiled versions of 841: these from GNU Emacs. 842: 1.1.1.3 ! root 843: `ns32k-sequent' ! 844: Go to the Berkeley universe before compiling. In addition, ! 845: you probably need to create a file named `string.h' ! 846: containing just one line: `#include <strings.h>'. ! 847: 1.1 root 848: `ns32k-utek' 849: UTEK ns32000 system ("merlin"). The C compiler that comes 850: with this system cannot compile GNU CC; contact 851: `tektronix!reed!mason' to get binaries of GNU CC for 852: bootstrapping. 853: 1.1.1.3 ! root 854: `romp-*-aos' ! 855: `romp-*-mach' ! 856: The only operating systems supported for the IBM RT PC are ! 857: AOS and MACH. GNU CC does not support AIX running on the RT. ! 858: ! 859: `rs6000-*-aix' ! 860: Read the file `README.RS6000' for information on how to get a ! 861: fix for a problem in the IBM assembler that prevents use of ! 862: GNU CC. 1.1 root 863: 864: `vax-dec-ultrix' 865: Don't try compiling with Vax C (`vcc'). It produces 866: incorrect code in some cases (for example, when `alloca' is 867: used). 868: 869: Meanwhile, compiling `cp-parse.c' with pcc does not work 870: because of an internal table size limitation in that 871: compiler. To avoid this problem, compile just the GNU C 872: compiler first, and use it to recompile building all the 873: languages that you want to run. 874: 1.1.1.3 ! root 875: `we32k-att-sysv' ! 876: Don't use `-g' when compiling GNU CC. The system's linker ! 877: seems to be unable to handle such a large program with ! 878: debugging information. ! 879: ! 880: Here we spell out what files will be set up by `configure'. 1.1 root 881: Normally you need not be concerned with these files. 882: 883: * A symbolic link named `config.h' is made to the top-level 884: config file for the machine you will run the compiler on 1.1.1.3 ! root 885: (*note Config::.). This file is responsible for defining 1.1 root 886: information about the host machine. It includes `tm.h'. 887: 888: The top-level config file is located in the subdirectory 1.1.1.3 ! root 889: `config'. Its name is always `xm-SOMETHING.h'; usually 1.1 root 890: `xm-MACHINE.h', but there are some exceptions. 891: 892: If your system does not support symbolic links, you might 893: want to set up `config.h' to contain a `#include' command 894: which refers to the appropriate file. 895: 896: * A symbolic link named `tconfig.h' is made to the top-level 897: config file for your target machine. This is used for 898: compiling certain programs to run on that machine. 899: 900: * A symbolic link named `tm.h' is made to the 901: machine-description macro file for your target machine. It 902: should be in the subdirectory `config' and its name is often 903: `MACHINE.h'. 904: 905: * A symbolic link named `md' will be made to the machine 906: description pattern file. It should be in the `config' 1.1.1.3 ! root 907: subdirectory and its name should be `MACHINE.md'; but MACHINE ! 908: is often not the same as the name used in the `tm.h' file ! 909: because the `md' files are more general. 1.1 root 910: 911: * A symbolic link named `aux-output.c' will be made to the 1.1.1.3 ! root 912: output subroutine file for your machine. It should be in the ! 913: `config' subdirectory and its name should be `MACHINE.c'. 1.1 root 914: 915: * The command file `configure' also constructs `Makefile' by 916: adding some text to the template file `Makefile.in'. The 917: additional text comes from files in the `config' directory, 918: named `t-TARGET' and `h-HOST'. If these files do not exist, 1.1.1.3 ! root 919: it means nothing needs to be added for a given target or host. 1.1 root 920: 1.1.1.3 ! root 921: 4. Make sure the Bison parser generator is installed. (This is ! 922: unnecessary if the Bison output files `c-parse.c' and `cexp.c' are ! 923: more recent than `c-parse.y' and `cexp.y' and you do not plan to ! 924: change the `.y' files.) 1.1 root 925: 1.1.1.3 ! root 926: Bison versions older than Sept 8, 1988 will produce incorrect 1.1 root 927: output for `c-parse.c'. 928: 1.1.1.3 ! root 929: 5. Build the compiler. Just type `make LANGUAGES=c' in the compiler 1.1 root 930: directory. 931: 1.1.1.3 ! root 932: `LANGUAGES=c' specifies that only the C compiler should be 1.1 root 933: compiled. The makefile normally builds compilers for all the 934: supported languages; currently, C, C++ and Objective C. However, 935: C is the only language that is sure to work when you build with 936: other non-GNU C compilers. In addition, building anything but C 937: at this stage is a waste of time. 938: 1.1.1.3 ! root 939: In general, you can specify the languages to build by typing the ! 940: argument `LANGUAGES="LIST"', where LIST is one or more words from ! 941: the list `c', `c++', and `objective-c'. ! 942: ! 943: Ignore any warnings you may see about "statement not reached" in ! 944: `insn-emit.c'; they are normal. Any other compilation errors may ! 945: represent bugs in the port to your machine or operating system, and ! 946: should be investigated and reported (*note Bugs::.). ! 947: ! 948: Some commercial compilers fail to compile GNU CC because they have ! 949: bugs or limitations. For example, the Microsoft compiler is said ! 950: to run out of macro space. Some Ultrix compilers run out of 1.1 root 951: expression space; then you need to break up the statement where 952: the problem happens. 953: 1.1.1.3 ! root 954: If you are building with a previous GNU C compiler, do not use ! 955: `CC=gcc' on the make command or by editing the Makefile. Instead, ! 956: use a full pathname to specify the compiler, such as ! 957: `CC=/usr/local/bin/gcc'. This is because make might execute the ! 958: `gcc' in the current directory before all of the compiler ! 959: components have been built. ! 960: ! 961: 6. If you are using COFF-encapsulation, you must convert `libgcc.a' to ! 962: a GNU-format library at this point. See the file `README.ENCAP' ! 963: in the directory containing the GNU binary file utilities, for ! 964: directions. ! 965: ! 966: 7. If you are building a cross-compiler, stop here. *Note ! 967: Cross-Compiler::. 1.1 root 968: 969: 8. Move the first-stage object files and executables into a 970: subdirectory with this command: 971: 972: make stage1 973: 1.1.1.3 ! root 974: The files are moved into a subdirectory named `stage1'. Once 1.1 root 975: installation is complete, you may wish to delete these files with 976: `rm -r stage1'. 977: 978: 9. Recompile the compiler with itself, with this command: 979: 1.1.1.3 ! root 980: make CC="stage1/gcc -Bstage1/" CFLAGS="-g -O" 1.1 root 981: 1.1.1.3 ! root 982: This is called making the stage 2 compiler. 1.1 root 983: 1.1.1.3 ! root 984: The command shown above builds compilers for all the supported 1.1 root 985: languages. If you don't want them all, you can specify the 1.1.1.3 ! root 986: languages to build by typing the argument `LANGUAGES="LIST"'. LIST ! 987: should contain one or more words from the list `c', `c++', ! 988: `objective-c', and `proto'. Separate the words with spaces. ! 989: `proto' stands for the programs `protoize' and `unprotoize'; they ! 990: are not a separate language, but you use `LANGUAGES' to enable or ! 991: disable their installation. ! 992: ! 993: If you are going to build the stage 3 compiler, then you might ! 994: want to build only the C language in stage 2. ! 995: ! 996: Once you have built the stage 2 compiler, if you are short of disk ! 997: space, you can delete the subdirectory `stage1'. ! 998: ! 999: On a 68000 or 68020 system lacking floating point hardware, unless ! 1000: you have selected a `tm.h' file that expects by default that there ! 1001: is no such hardware, do this instead: 1.1 root 1002: 1.1.1.3 ! root 1003: make CC="stage1/gcc -Bstage1/" CFLAGS="-g -O -msoft-float" 1.1 root 1004: 1005: 10. If you wish to test the compiler by compiling it with itself one 1006: more time, do this: 1007: 1008: make stage2 1.1.1.3 ! root 1009: make CC="stage2/gcc -Bstage2/" CFLAGS="-g -O" 1.1 root 1010: 1011: This is called making the stage 3 compiler. Aside from the `-B' 1.1.1.3 ! root 1012: option, the options should be the same as when you made the stage 2 ! 1013: compiler. 1.1 root 1014: 1.1.1.3 ! root 1015: The command shown above builds compilers for all the supported ! 1016: languages. If you don't want them all, you can specify the ! 1017: languages to build by typing the argument `LANGUAGES="LIST"', as ! 1018: described above. 1.1 root 1019: 1.1.1.3 ! root 1020: Then compare the latest object files with the stage 2 object ! 1021: files--they ought to be identical, unless they contain time stamps. ! 1022: You can compare the files, disregarding the time stamps if any, ! 1023: like this: ! 1024: ! 1025: make compare ! 1026: ! 1027: This will mention any object files that differ between stage 2 and ! 1028: stage 3. Any difference, no matter how innocuous, indicates that ! 1029: the stage 2 compiler has compiled GNU CC incorrectly, and is 1.1 root 1030: therefore a potentially serious bug which you should investigate 1031: and report (*note Bugs::.). 1032: 1.1.1.3 ! root 1033: If your system does not put time stamps in the object files, then ! 1034: this is a faster way to compare them (using the Bourne shell): 1.1 root 1035: 1036: for file in *.o; do 1.1.1.3 ! root 1037: cmp $file stage2/$file 1.1 root 1038: done 1039: 1.1.1.3 ! root 1040: If you have built the compiler with the `-mno-mips-tfile' option on ! 1041: MIPS machines, you will not be able to compare the files. 1.1 root 1042: 1043: 11. Install the compiler driver, the compiler's passes and run-time 1.1.1.3 ! root 1044: support. You can use the following command: 1.1 root 1045: 1.1.1.3 ! root 1046: make CC="stage2/gcc -Bstage2/" CFLAGS="-g -O" install LANGUAGES="LIST" 1.1 root 1047: 1.1.1.3 ! root 1048: (Use the same value for `CC', `CFLAGS' and `LANGUAGES' that you ! 1049: used when compiling the files that are being installed. One ! 1050: reason this is necessary is that some versions of Make have bugs ! 1051: and recompile files gratuitously when you do this step. If you ! 1052: use the same variable values, those files will be recompiled ! 1053: properly. 1.1 root 1054: 1.1.1.3 ! root 1055: This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1', ! 1056: `cpp' and `libgcc.a' in directory 1.1.1.2 root 1057: `/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the 1058: compiler driver program looks for them. Here TARGET is the target 1059: machine type specified when you ran `configure', and VERSION is 1060: the version number of GNU CC. This naming scheme permits various 1.1 root 1061: versions and/or cross-compilers to coexist. 1062: 1.1.1.3 ! root 1063: It also copies the driver program `gcc' into the directory 1.1 root 1064: `/usr/local/bin', so that it appears in typical execution search 1065: paths. 1066: 1.1.1.3 ! root 1067: On some systems, this command will cause recompilation of some ! 1068: files. This is usually due to bugs in `make'. You should either ! 1069: ignore this problem, or use GNU Make. ! 1070: ! 1071: *Warning: there is a bug in `alloca' in the Sun library. To avoid ! 1072: this bug, be sure to install the executables of GNU CC that were ! 1073: compiled by GNU CC. (That is, the executables from stage 2 or 3, ! 1074: not stage 1.) They use `alloca' as a built-in function and never ! 1075: the one in the library.* 1.1.1.2 root 1076: 1.1.1.3 ! root 1077: (It is usually better to install GNU CC executables from stage 2 ! 1078: or 3, since they usually run faster than the ones compiled with 1.1.1.2 root 1079: some other compiler.) 1.1 root 1080: 1.1.1.3 ! root 1081: 12. Correct errors in the header files on your machine. 1.1 root 1082: 1.1.1.3 ! root 1083: Various system header files often contain constructs which are 1.1 root 1084: incompatible with ANSI C, and they will not work when you compile 1085: programs with GNU CC. This behavior consists of substituting for 1086: macro argument names when they appear inside of character 1087: constants. The most common offender is `ioctl.h'. 1088: 1.1.1.3 ! root 1089: You can overcome this problem when you compile by specifying the ! 1090: `-traditional' option. 1.1 root 1091: 1.1.1.3 ! root 1092: Alternatively, on Sun systems and 4.3BSD at least, you can correct ! 1093: the include files by running the shell script `fixincludes'. This ! 1094: installs modified, corrected copies of the files `ioctl.h', ! 1095: `ttychars.h' and many others, in a special directory where only ! 1096: GNU CC will normally look for them. This script will work on ! 1097: various systems because it chooses the files by searching all the ! 1098: system headers for the problem cases that we know about. 1.1 root 1099: 1.1.1.3 ! root 1100: Use the following command to do this: 1.1 root 1101: 1102: make install-fixincludes 1103: 1.1.1.3 ! root 1104: If you selected a different directory for GNU CC installation when ! 1105: you installed it, by specifying the Make variable `prefix' or 1.1 root 1106: `libdir', specify it the same way in this command. 1107: 1.1.1.3 ! root 1108: Note that some systems are starting to come with ANSI C system 1.1 root 1109: header files. On these systems, don't run `fixincludes'; it may 1110: not work, and is certainly not necessary. 1111: 1112: If you cannot install the compiler's passes and run-time support in 1113: `/usr/local/lib', you can alternatively use the `-B' option to specify 1114: a prefix by which they may be found. The compiler concatenates the 1.1.1.3 ! root 1115: prefix with the names `cpp', `cc1' and `libgcc.a'. Thus, you can put 1.1 root 1116: the files in a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' 1117: when you run GNU CC. 1118: 1119: Also, you can specify an alternative default directory for these 1120: files by setting the Make variable `libdir' when you make GNU CC. 1121: 1122: 1.1.1.3 ! root 1123: File: gcc.info, Node: Other Dir, Next: Cross-Compiler, Up: Installation 1.1 root 1124: 1125: Compilation in a Separate Directory 1126: =================================== 1127: 1128: If you wish to build the object files and executables in a directory 1129: other than the one containing the source files, here is what you must 1130: do differently: 1131: 1132: 1. Make sure you have a version of Make that supports the `VPATH' 1133: feature. (GNU Make supports it, as do Make versions on most BSD 1134: systems.) 1135: 1.1.1.3 ! root 1136: 2. If you have ever run `configure' in the source directory, you must ! 1137: undo the configuration. Do this by running: 1.1.1.2 root 1138: 1.1.1.3 ! root 1139: make distclean 1.1.1.2 root 1140: 1141: 3. Go to the directory in which you want to build the compiler before 1142: running `configure': 1.1 root 1143: 1144: mkdir gcc-sun3 1145: cd gcc-sun3 1146: 1.1.1.3 ! root 1147: On systems that do not support symbolic links, this directory must ! 1148: be on the same file system as the source code directory. 1.1 root 1149: 1.1.1.2 root 1150: 4. Specify where to find `configure' when you run it: 1.1 root 1151: 1.1.1.3 ! root 1152: ../gcc/configure ... 1.1 root 1153: 1.1.1.3 ! root 1154: This also tells `configure' where to find the compiler sources; ! 1155: `configure' takes the directory from the file name that was used to ! 1156: invoke it. But if you want to be sure, you can specify the source ! 1157: directory with the `--srcdir' option, like this: 1.1 root 1158: 1.1.1.3 ! root 1159: ../gcc/configure --srcdir=../gcc sun3 1.1 root 1160: 1.1.1.3 ! root 1161: The directory you specify with `--srcdir' need not be the same as ! 1162: the one that `configure' is found in. 1.1 root 1163: 1164: Now, you can run `make' in that directory. You need not repeat the 1.1.1.3 ! root 1165: configuration steps shown above, when ordinary source files change. You ! 1166: must, however, run `configure' again when the configuration files 1.1 root 1167: change, if your system does not support symbolic links. 1168: 1169:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.