|
|
1.1.1.15 root 1: This is a copy of one node from the Info file gcc.info-3.
1.1 root 2: For full information on installing and porting GCC, refer to the
1.1.1.6 root 3: GCC manual:
1.1 root 4:
1.1.1.6 root 5: Info file gcc.info
6: TeX output gcc.dvi
7: TeX source gcc.texinfo
8:
1.1 root 9: Installing GNU CC
10: *****************
11:
1.1.1.16 root 12: Here is the procedure for installing GNU CC on a Unix system.
1.1 root 13:
14: * Menu:
15:
1.1.1.12 root 16: * Other Dir:: Compiling in a separate directory (not where the source is).
17: * Sun Install:: See below for installation on the Sun.
18: * 3B1 Install:: See below for installation on the 3B1.
1.1.1.15 root 19: * SCO Install:: See below for installation on SCO System V 3.2. (Or ESIX.)
1.1 root 20: * VMS Install:: See below for installation on VMS.
1.1.1.13 root 21: * HPUX Install:: See below for installation on HPUX.
1.1.1.15 root 22: * Tower Install:: See below for installation on an NCR Tower.
1.1 root 23:
1.1.1.17! root 24: 1. Edit `Makefile'. If you are using HPUX, or any form of system V,
! 25: you must make a few changes described in comments at the beginning
! 26: of the file. Genix requires changes also, and so does the Pyramid.
1.1.1.2 root 27:
28: 2. On a Sequent system, go to the Berkeley universe.
1.1 root 29:
1.1.1.17! root 30: 3. Choose configuration files. The easy way to do this is to run the
! 31: command file `config.gcc' with a single argument, which specifies
! 32: the type of machine (and in some cases which operating system).
1.1.1.7 root 33:
1.1.1.17! root 34: Here is a list of the possible arguments:
1.1.1.8 root 35:
36: `vax'
37: Vaxes running BSD.
38:
39: `vms'
40: Vaxes running VMS.
41:
42: `vax-sysv'
43: Vaxes running system V.
44:
45: `i386-sysv'
46: Intel 386 PCs running system V.
47:
1.1.1.9 root 48: `i386-sysv-gas'
49: Intel 386 PCs running system V, using the GNU assembler and
50: GNU linker.
51:
1.1.1.17! root 52: `i386-sysv4'
! 53: Intel 386 PCs running system V.4. You must run the shell
! 54: script `fixincludes-V4' in order for GNU CC to work properly.
! 55: You must also uncomment some lines in `Makefile'.
! 56:
1.1.1.10 root 57: `sequent-i386'
1.1.1.8 root 58: Sequent with Intel 386 processors.
59:
1.1.1.12 root 60: `i386-aix'
61: Intel 386 PCs or PS/2s running AIX.
62:
1.1.1.8 root 63: `sun2'
64: Sun 2 running system version 2 or 3.
65:
66: `sun3'
1.1.1.17! root 67: Sun 3 running system version 4, with 68881. Note there we do
! 68: not provide a configuration file to use an FPA by default,
! 69: because programs that establish signal handlers for floating
! 70: point traps inherently cannot work with the FPA.
1.1.1.11 root 71:
1.1.1.9 root 72: `sun3-nfp'
1.1.1.16 root 73: Sun 3 running system version 4, without 68881.
1.1.1.9 root 74:
1.1.1.8 root 75: `sun4'
1.1.1.16 root 76: Sun 4 running system version 4. *Note Incompatibilities::,
1.1.1.17! root 77: for calling convention incompatibilities on the Sun 4 (sparc).
1.1.1.8 root 78:
79: `sun2-os4'
80: Sun 2 running system version 4.
81:
1.1.1.16 root 82: `sun3-os3'
83: Sun 3 running system version 2 or 3, with 68881.
1.1.1.9 root 84:
1.1.1.16 root 85: `sun3-nfp-os3'
86: Sun 3 running system version 2 or 3, without 68881.
1.1.1.9 root 87:
1.1.1.16 root 88: `sun4-os3'
89: Sun 4 running system version 2 or 3. *Note
1.1.1.17! root 90: Incompatibilities::, for calling convention incompatibilities
! 91: on the Sun 4 (sparc).
1.1.1.8 root 92:
93: `sun386'
1.1.1.14 root 94: Sun 386 ("roadrunner").
1.1.1.8 root 95:
1.1.1.9 root 96: `alliant'
1.1.1.12 root 97: Alliant FX/8 computer. Note that the standard installed C
98: compiler in Concentrix 5.0 has a bug which prevent it from
99: compiling GNU CC correctly. You can patch the compiler bug
100: as follows:
101:
102: cp /bin/pcc ./pcc
1.1.1.13 root 103: adb -w ./pcc - << EOF
1.1.1.12 root 104: 15f6?w 6610
105: EOF
106:
107: Then you must use the `-ip12' option when compiling GNU CC
108: with the patched compiler, as shown here:
109:
110: make CC="./pcc -ip12" CFLAGS=-w
111:
112: Note also that Alliant's version of DBX does not manage to
113: work with the output from GNU CC.
114:
115: `tahoe'
116: The tahoe computer (running BSD, and using DBX).
117:
118: `decstation'
1.1.1.17! root 119: The DEC 3100 Mips machine ("pmax"). Note that GNU CC cannot
! 120: generate debugging information in the unusual format used on
! 121: the Mips.
! 122:
! 123: `mips-sysv-os5'
! 124: The Mips computer, RS series, with the System V environment
! 125: running on revision 5.00 of RISC-OS as default. Note that GNU
! 126: CC cannot generate debugging information in the unusual
! 127: format used on the Mips, and also cannot be used to create
! 128: programs that use shared libraries.
1.1.1.12 root 129:
130: `mips-sysv'
131: The Mips computer, RS series, with the System V environment
1.1.1.17! root 132: as default. Note that GNU CC cannot generate debugging
1.1.1.12 root 133: information in the unusual format used on the Mips.
134:
1.1.1.17! root 135: `mips-bsd43-os5'
1.1.1.12 root 136: The Mips computer, RS series, with the BSD 4.3 environment
1.1.1.17! root 137: running revision 5.00 of RISC-OS as default. Note that GNU CC
! 138: cannot generate debugging information in the unusual format
! 139: used on the Mips, and also cannot be used to create programs
! 140: that use shared libraries.
! 141:
! 142: `mips-bsd43'
! 143: The Mips computer, RS series, with the BSD 4.3 environment as
! 144: default. Note that GNU CC cannot generate debugging
1.1.1.12 root 145: information in the unusual format used on the Mips.
1.1.1.9 root 146:
1.1.1.17! root 147: `mips-os5'
! 148: The Mips computer, M series running revision 5.00 of RISC-OS.
! 149: Note that GNU CC cannot generate debugging information in the
! 150: unusual format used on the Mips, and also cannot be used to
! 151: create programs that use shared libraries.
! 152:
1.1.1.11 root 153: `mips'
1.1.1.12 root 154: The Mips computer, M series. Note that GNU CC cannot
1.1.1.17! root 155: generate debugging information in the unusual format used on
! 156: the Mips.
1.1.1.12 root 157:
158: `iris'
1.1.1.14 root 159: Another variant of the Mips computer, the Silicon Graphics
1.1.1.17! root 160: Iris 4D. Note that GNU CC cannot generate debugging
1.1.1.14 root 161: information in the unusual format used on the Mips.
1.1.1.11 root 162:
1.1.1.9 root 163: `convex-c1'
1.1.1.17! root 164: Convex C1 computer. With operating system version 9, use `cc
! 165: -pcc' as the compilation command when building stage 1 of GNU
! 166: CC.
1.1.1.9 root 167:
168: `convex-c2'
1.1.1.17! root 169: Convex C2 computer. With operating system version 9, use `cc
! 170: -pcc' as the compilation command when building stage 1 of GNU
! 171: CC.
1.1.1.9 root 172:
1.1.1.12 root 173: `pyramid'
174: Pyramid computer.
175:
1.1.1.8 root 176: `hp9k320'
1.1.1.11 root 177: HP 9000 series 300 using HPUX assembler. Note there is no
178: support in GNU CC for HP's debugger; thus, `-g' is not
179: available in this configuration.
1.1.1.8 root 180:
1.1.1.12 root 181: `hp9k320-gas'
1.1.1.8 root 182: HP 9000 series 300 using GNU assembler, linker and debugger.
1.1.1.17! root 183: This requires the HP-adapt package, which is available along
! 184: with the GNU linker as part of the "binutils" distribution.
! 185: This is on the GNU CC distribution tape.
1.1.1.8 root 186:
1.1.1.12 root 187: `hp9k320-old'
1.1.1.17! root 188: HP 9000 series 300 using HPUX assembler, in operating system
! 189: versions older than 6.5. Note there is no support in GNU CC
! 190: for HP's debugger; thus, `-g' is not available in this
! 191: configuration.
1.1.1.12 root 192:
193: `hp9k320-bsd'
194: HP 9000 series 300 running BSD.
195:
1.1.1.16 root 196: `hp9k200-bsd'
197: HP 9000 series 200 running BSD. Note that the C compiler
198: that comes with this system cannot compile GNU CC; contact
1.1.1.17! root 199: `[email protected]' to get binaries of GNU CC for bootstrapping.
! 200: Additionally, a minor patch is necessary if you wish to build
! 201: kernels with GNU CC; contact `[email protected]' to get a copy of
! 202: the patch.
1.1.1.16 root 203:
1.1.1.8 root 204: `isi68'
1.1.1.12 root 205: ISI 68000 or 68020 system with a 68881.
206:
207: `isi68-nfp'
208: ISI 68000 or 68020 system without a 68881.
1.1.1.8 root 209:
210: `news800'
211: Sony NEWS 68020 system.
212:
1.1.1.10 root 213: `next'
214: NeXT system.
215:
1.1.1.14 root 216: `tower'
217: NCR Tower 32 system.
218:
1.1.1.11 root 219: `altos'
1.1.1.17! root 220: Altos 3068. Note that you must use the GNU assembler, linker
! 221: and debugger, with COFF-encapsulation. Also, you must fix a
! 222: kernel bug. Details in the file `ALTOS-README'.
1.1.1.11 root 223:
1.1.1.8 root 224: `3b1'
1.1.1.12 root 225: AT&T 3b1, a.k.a. 7300 PC. Note that special procedures are
226: needed to compile GNU CC with this machine's standard C
1.1.1.17! root 227: compiler, due to bugs in that compiler. *Note 3b1 Install::.
! 228: You can bootstrap it more easily with previous versions of
! 229: GNU CC if you have them.
1.1.1.8 root 230:
1.1.1.13 root 231: `3b1-gas'
232: AT&T 3b1 using the GNU assembler.
233:
1.1.1.8 root 234: `sequent-ns32k'
235: Sequent containing ns32000 processors.
236:
237: `encore'
238: Encore ns32000 system.
239:
240: `genix'
241: National Semiconductor ns32000 system.
242:
243: `88000'
244: Motorola 88000 processor. This port is not finished.
245:
1.1.1.17! root 246: Here we spell out what files need to be set up:
1.1 root 247:
1.1.1.17! root 248: * Make a symbolic link named `config.h' to the top-level config
! 249: file for the machine you are using (*note Config::.). This
! 250: file is responsible for defining information about the host
! 251: machine. It includes `tm.h'.
1.1.1.4 root 252:
1.1.1.11 root 253: The file is located in the subdirectory `config'. Its name
254: should be `xm-MACHINE.h', with these exceptions:
1.1.1.4 root 255:
1.1.1.8 root 256: `xm-vms.h'
1.1.1.4 root 257: for vaxen running VMS.
258:
1.1.1.8 root 259: `xm-vaxv.h'
1.1.1.4 root 260: for vaxen running system V.
261:
1.1.1.8 root 262: `xm-i386v.h'
1.1.1.4 root 263: for Intel 80386's running system V.
264:
1.1.1.8 root 265: `xm-sun386i.h'
1.1.1.17! root 266: for Sun roadrunner running any version of the operating
! 267: system.
1.1.1.8 root 268:
269: `xm-hp9k320.h'
1.1.1.4 root 270: for the HP 9000 series 300.
271:
1.1.1.8 root 272: `xm-genix.h'
1.1.1.4 root 273: for the ns32000 running Genix
274:
275: If your system does not support symbolic links, you might
276: want to set up `config.h' to contain a `#include' command
277: which refers to the appropriate file.
278:
1.1.1.17! root 279: * Make a symbolic link named `tm.h' to the machine-description
! 280: macro file for your machine. It should be in the subdirectory
! 281: `config' and its name should be `tm-MACHINE.h'.
1.1.1.4 root 282:
283: If your system is a 68000, don't use the file `tm-m68k.h'
284: directly. Instead, use one of these files:
285:
286: `tm-sun3.h'
1.1.1.9 root 287: for Sun 3 machines with 68881.
288:
289: `tm-sun3-nfp.h'
290: for Sun 3 machines with no hardware floating point.
1.1.1.4 root 291:
1.1.1.12 root 292: `tm-sun3os3.h'
293: for Sun 3 machines with 68881, running Sunos version 3.
294:
295: `tm-sun3os3nf.h'
296: for Sun 3 machines with no hardware floating point,
297: running Sunos version 3.
298:
1.1.1.4 root 299: `tm-sun2.h'
300: for Sun 2 machines.
301:
302: `tm-3b1.h'
303: for AT&T 3b1 (aka 7300 Unix PC).
304:
305: `tm-isi68.h'
1.1.1.17! root 306: for Integrated Solutions systems. This file assumes you
! 307: use the GNU assembler.
1.1.1.4 root 308:
1.1.1.12 root 309: `tm-isi68-nfp.h'
1.1.1.17! root 310: for Integrated Solutions systems without a 68881. This
! 311: file assumes you use the GNU assembler.
1.1.1.12 root 312:
1.1.1.4 root 313: `tm-news800.h'
1.1.1.12 root 314: for Sony NEWS systems.
1.1.1.4 root 315:
316: `tm-hp9k320.h'
317: for HPUX systems, if you are using GNU CC with the
318: system's assembler and linker.
319:
320: `tm-hp9k320g.h'
321: for HPUX systems, if you are using the GNU assembler,
322: linker and other utilities. Not all of the pieces of
323: GNU software needed for this mode of operation are as
1.1.1.17! root 324: yet in distribution; full instructions will appear here
! 325: in the future.
1.1.1.4 root 326:
1.1.1.14 root 327: `tm-tower-as.h'
328: for NCR Tower 32 systems, using the standard system
329: assembler.
330:
1.1.1.4 root 331: For the vax, use `tm-vax.h' on BSD Unix, `tm-vaxv.h' on
332: system V, or `tm-vms.h' on VMS.
333:
1.1.1.17! root 334: For the Motorola 88000, use `tm-m88k.h'. The support for the
! 335: 88000 does not currently work; it requires extensive changes
! 336: which we hope to reconcile in version 2.
1.1.1.4 root 337:
338: For the 80386, don't use `tm-i386.h' directly. Use
339: `tm-i386v.h' if the target machine is running system V,
1.1.1.17! root 340: `tm-i386gas.h' if it is running system V but you are using the
! 341: GNU assembler and linker, `tm-seq386.h' for a Sequent 386
! 342: system, or `tm-compaq.h' for a Compaq, or `tm-sun386i.h' for
! 343: a Sun 386 system.
1.1.1.4 root 344:
1.1.1.12 root 345: For the Mips computer, there are five choices: `tm-mips.h'
1.1.1.17! root 346: for the M series, `tm-mips-bsd.h' for the RS series with BSD,
! 347: `tm-mips-sysv.h' for the RS series with System V, `tm-iris.h'
! 348: for the Iris version of the machine, and `tm-decstatn.h' for
! 349: the Decstation.
1.1.1.12 root 350:
1.1.1.17! root 351: For the 32000, use `tm-sequent.h' if you are using a Sequent
! 352: machine, or `tm-encore.h' for an Encore machine, or
1.1.1.8 root 353: `tm-genix.h' if you are using Genix version 3; otherwise,
1.1.1.4 root 354: perhaps `tm-ns32k.h' will work for you.
355:
356: Note that Genix has bugs in `alloca' and `malloc'; you must
357: get the compiled versions of these from GNU Emacs and edit
358: GNU CC's `Makefile' to use them.
1.1 root 359:
1.1.1.2 root 360: Note that Encore systems are supported only under BSD.
1.1 root 361:
1.1.1.10 root 362: For Sparc (Sun 4) machines, use `tm-sparc.h' with operating
363: system version 4, and `tm-sun4os3.h' with system version 3.
364:
1.1.1.17! root 365: For Convex systems before version 8.1, use `tm-conv1os7.h' or
! 366: `tm-conv2os7.h'. For versions 8.1 and greater, use
! 367: `tm-convex1.h' or `tm-convex2.h'. You should also bootstrap
! 368: GCC with `pcc' rather than `cc'; one way to do this is with
! 369: the following commands.
1.1.1.14 root 370:
371: ln -s /bin/pcc ./cc
372: set path = (. $path)
373:
1.1 root 374: * Make a symbolic link named `md' to the machine description
1.1.1.17! root 375: pattern file. It should be in the `config' subdirectory and
! 376: its name should be `MACHINE.md'; but MACHINE is often not the
! 377: same as the name used in the `tm.h' file because the `md'
! 378: files are more general.
1.1 root 379:
380: * Make a symbolic link named `aux-output.c' to the output
1.1.1.11 root 381: subroutine file for your machine. It should be in the
382: `config' subdirectory and its name should be `out-MACHINE.c'.
1.1 root 383:
1.1.1.4 root 384: 4. Make sure the Bison parser generator is installed. (This is
1.1.1.17! root 385: unnecessary if the Bison output files `c-parse.tab.c' and `cexp.c'
! 386: are more recent than `c-parse.y' and `cexp.y' and you do not plan
! 387: to change the `.y' files.)
1.1.1.4 root 388:
1.1.1.17! root 389: Bison versions older than Sept 8, 1988 will produce incorrect
1.1.1.5 root 390: output for `c-parse.tab.c'.
1.1 root 391:
1.1.1.17! root 392: 5. If you have a previous version of GCC installed, then chances are
! 393: you can compile the new version with that. Do the following:
1.1.1.14 root 394:
395: make CC="gcc -O"
396:
397: Since this produces an optimized executable right away, there is
398: no need to bootstrap the result with itself except to test it.
399: Therefore, you can skip directly to the `make install' step below.
1.1 root 400:
1.1.1.14 root 401: 6. Build the compiler. Just type `make' in the compiler directory.
402:
1.1.1.17! root 403: Ignore any warnings you may see about "statement not reached" in
! 404: the `insn-emit.c'; they are normal. Any other compilation errors
! 405: may represent bugs in the port to your machine or operating
! 406: system, and should be investigated and reported (*note Bugs::.).
! 407:
! 408: Some commercial compilers fail to compile GNU CC because they have
! 409: bugs or limitations. For example, the Microsoft compiler is said
! 410: to run out of macro space. Some Ultrix compilers run out of
! 411: expression space; then you need to break up the statement where
! 412: the problem happens.
! 413:
! 414: 7. If you are using COFF-encapsulation, you must convert `gnulib' to
! 415: a GNU-format library at this point. See the file `README-ENCAP'
! 416: in the directory containing the GNU binary file utilities, for
! 417: directions.
1.1.1.9 root 418:
1.1.1.14 root 419: 8. Move the first-stage object files and executables into a
1.1.1.4 root 420: subdirectory with this command:
1.1 root 421:
422: make stage1
423:
1.1.1.17! root 424: The files are moved into a subdirectory named `stage1'. Once
! 425: installation is complete, you may wish to delete these files with
! 426: `rm -r stage1'.
1.1 root 427:
1.1.1.14 root 428: 9. Recompile the compiler with itself, with this command:
1.1 root 429:
430: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
431:
1.1.1.17! root 432: This is called making the stage 2 compiler.
1.1.1.14 root 433:
1.1.1.17! root 434: On a 68000 or 68020 system lacking floating point hardware, unless
! 435: you have selected a `tm.h' file that expects by default that there
! 436: is no such hardware, do this instead:
1.1 root 437:
438: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float"
439:
1.1.1.14 root 440: 10. If you wish to test the compiler by compiling it with itself one
1.1.1.11 root 441: more time, do this (in C shell):
1.1 root 442:
443: make stage2
1.1.1.6 root 444: make CC=stage2/gcc CFLAGS="-g -O -Bstage2/"
1.1 root 445: foreach file (*.o)
446: cmp $file stage2/$file
447: end
448:
1.1.1.14 root 449: This is called making the stage 3 compiler. Aside from the `-B'
1.1.1.17! root 450: option, the options should be the same as when you made the stage 2
! 451: compiler.
1.1.1.4 root 452:
1.1.1.17! root 453: The `foreach' command (written in C shell) will notify you if any
! 454: of these stage 3 object files differs from those of stage 2. On
! 455: BSD systems, any difference, no matter how innocuous, indicates
! 456: that the stage 2 compiler has compiled GNU CC incorrectly, and is
! 457: therefore a potentially serious bug which you should investigate
! 458: and report (*note Bugs::.).
! 459:
! 460: On systems that use COFF object files, bytes 5 to 8 will always be
! 461: different, since it is a timestamp. On these systems, you can do
! 462: the comparison as follows (in Bourne shell):
1.1.1.11 root 463:
464: for file in *.o; do
465: echo $file
1.1.1.14 root 466: tail +10c $file > foo1
467: tail +10c stage2/$file > foo2
1.1.1.11 root 468: cmp foo1 foo2
469: done
470:
1.1.1.17! root 471: On MIPS machines, you should use the shell script `ecoff-cmp' to
! 472: compare two object files.
1.1.1.14 root 473:
474: 11. Install the compiler driver, the compiler's passes and run-time
1.1.1.17! root 475: support. You can use the following command:
1.1 root 476:
477: make install
478:
1.1.1.4 root 479: This copies the files `cc1', `cpp' and `gnulib' to files
480: `gcc-cc1', `gcc-cpp' and `gcc-gnulib' in directory
1.1.1.17! root 481: `/usr/local/lib', which is where the compiler driver program looks
! 482: for them. It also copies the driver program `gcc' into the
! 483: directory `/usr/local/bin', so that it appears in typical
1.1.1.4 root 484: execution search paths.
485:
1.1.1.17! root 486: *Warning: there is a bug in `alloca' in the Sun library. To avoid
! 487: this bug, install the binaries of GNU CC that were compiled by GNU
! 488: CC. They use `alloca' as a built-in function and never the one in
! 489: the library.*
! 490:
! 491: *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' and
! 492: other system header files unless the `-traditional' option is
! 493: used.* The bug is in the header files: at least on some machines,
! 494: they rely on behavior that is incompatible with ANSI C. This
! 495: behavior consists of substituting for macro argument names when
! 496: they appear inside of character constants. The `-traditional'
! 497: option tells GNU CC to behave the way these headers expect.
1.1 root 498:
1.1.1.17! root 499: Because of this problem, you might prefer to configure GNU CC to
! 500: use the system's own C preprocessor. To do so, make the file
1.1 root 501: `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
502:
1.1.1.17! root 503: Alternatively, on Sun systems and 4.3BSD at least, you can correct
! 504: the include files by running the shell script `fixincludes'. This
! 505: installs modified, corrected copies of the files `ioctl.h',
! 506: `ttychars.h' and many others, in a special directory where only
! 507: GNU CC will normally look for them. This script will work on
! 508: various systems because it chooses the files by searching all the
! 509: system headers for the problem cases that we know about.
1.1 root 510:
1.1.1.17! root 511: Use the following command to do this:
1.1.1.14 root 512:
513: make includes
514:
1.1.1.17! root 515: If you selected a different directory for GNU CC installation when
! 516: you installed it, by specifying the Make variable `prefix' or
! 517: `libdir', specify it the same way in this command.
! 518:
! 519: Note that some systems are starting to come with ANSI C system
! 520: header files. On these systems, don't run `fixincludes'; it may
! 521: not work, and is certainly not necessary.
! 522:
! 523: *Warning:* `fixincludes' does not work on many MIPS systems,
! 524: because those systems come with circular symbolic links which cause
! 525: `ls -lR' to go into an infinite loop.
! 526:
! 527: If you cannot install the compiler's passes and run-time support in
! 528: `/usr/local/lib', you can alternatively use the `-B' option to specify
! 529: a prefix by which they may be found. The compiler concatenates the
! 530: prefix with the names `cpp', `cc1' and `gnulib'. Thus, you can put the
! 531: files in a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' when
! 532: you run GNU CC.
1.1.1.4 root 533:
1.1.1.16 root 534: Also, you can specify an alternative default directory for these
1.1.1.4 root 535: files by setting the Make variable `libdir' when you make GNU CC.
1.1 root 536:
1.1.1.11 root 537:
1.1.1.12 root 538: File: gcc.info, Node: Other Dir, Next: Sun Install, Prev: Installation, Up: Installation
1.1.1.2 root 539:
1.1.1.12 root 540: Compilation in a Separate Directory
541: ===================================
1.1 root 542:
1.1.1.17! root 543: If you wish to build the object files and executables in a directory
! 544: other than the one containing the source files, here is what you must
! 545: do differently:
1.1.1.8 root 546:
1.1.1.12 root 547: 1. Go to that directory before running `config.gcc':
1.1.1.4 root 548:
1.1.1.12 root 549: mkdir gcc-sun3
550: cd gcc-sun3
1.1 root 551:
1.1.1.17! root 552: On systems that do not support symbolic links, this directory must
! 553: be on the same file system as the source code directory.
1.1.1.2 root 554:
1.1.1.12 root 555: 2. Specify where to find `config.gcc' when you run it:
556:
557: ../gcc-1.36/config.gcc ...
558:
559: 3. Specify where to find the sources, as an argument to `config.gcc':
560:
561: ../gcc-1.36/config.gcc -srcdir=../gcc-1.36 sun3
562:
1.1.1.17! root 563: The `-srcdir=DIR' option is not needed when the source directory
! 564: is the parent of the current directory, because `config.gcc'
! 565: detects that case automatically.
! 566:
! 567: Now, you can run `make' in that directory. You need not repeat the
! 568: configuration steps shown above, when ordinary source files change. You
! 569: must, however, run `config.gcc' again when the configuration files
! 570: change, if your system does not support symbolic links.
1.1.1.12 root 571:
572:
573: File: gcc.info, Node: Sun Install, Next: 3b1 Install, Prev: Other Dir, Up: Installation
574:
575: Installing GNU CC on the Sun
576: ============================
577:
1.1.1.16 root 578: Make sure the environment variable `FLOAT_OPTION' is not set when
579: you compile `gnulib'. If this option were set to `f68881' when
1.1.1.17! root 580: `gnulib' is compiled, the resulting code would demand to be linked with
! 581: a special startup file and would not link properly without special
! 582: pains.
1.1.1.12 root 583:
1.1.1.16 root 584: There is a bug in `alloca' in certain versions of the Sun library.
1.1.1.17! root 585: To avoid this bug, install the binaries of GNU CC that were compiled by
! 586: GNU CC. They use `alloca' as a built-in function and never the one in
! 587: the library.
! 588:
! 589: Some versions of the Sun compiler crash when compiling GNU CC, with a
! 590: segmentation fault in cpp. This can sometimes be due to the bulk of
! 591: data in the environment variables. You may be able to avoid it by using
! 592: the following command to compile GNU CC with Sun CC:
1.1.1.12 root 593:
594: make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
595:
1.1.1.16 root 596: Another problem that often happens on Suns is that you get a crash
1.1.1.15 root 597: when building stage 2, when `genflags' is run.
598:
1.1.1.16 root 599: One reason for such as crash is if you configured GNU CC for the
1.1.1.15 root 600: wrong version of SunOS. Starting with version 1.38, configurations
601: `sun3' and `sun4' are for SunOS 4, so this problem should no longer
602: happen.
603:
1.1.1.17! root 604: Another cause of the same symptom is having installed the GNU linker
! 605: with an earlier version of SunOS. The version that worked before
! 606: stopped working due to a change in the format of executables in SunOS
! 607: 4.1. Many sites have installed the GNU linker as
1.1.1.15 root 608: `/usr/local/lib/gcc-ld', often as part of installing GNU C++. So if
609: you get such crashes and you have used the proper configuration, try
610: deleting `/usr/local/lib/gcc-ld'.
611:
1.1.1.17! root 612: The current version of the GNU linker, found in the current binutils
! 613: release, does work with SunOS 4.1.
1.1.1.12 root 614:
615:
1.1.1.14 root 616: File: gcc.info, Node: 3b1 Install, Next: SCO Install, Prev: Sun Install, Up: Installation
1.1.1.12 root 617:
618: Installing GNU CC on the 3b1
619: ============================
620:
1.1.1.17! root 621: Installing GNU CC on the 3b1 is difficult if you do not already have
! 622: GNU CC running, due to bugs in the installed C compiler. However, the
! 623: following procedure might work. We are unable to test it.
! 624:
! 625: 1. Comment out the `#include "config.h"' line on line 37 of `cccp.c'
! 626: and do `make cpp'. This makes a preliminary version of GNU cpp.
1.1.1.12 root 627:
628: 2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to that
629: file name.
630:
631: 3. Undo your change in `cccp.c', or reinstall the original version,
632: and do `make cpp' again.
633:
634: 4. Copy this final version of GNU cpp into `/lib/cpp'.
635:
1.1.1.13 root 636: 5. Replace every occurrence of `obstack_free' in `tree.c' with
1.1.1.12 root 637: `_obstack_free'.
638:
639: 6. Run `make' to get the first-stage GNU CC.
640:
641: 7. Reinstall the original version of `/lib/cpp'.
642:
1.1.1.17! root 643: 8. Now you can compile GNU CC with itself and install it in the normal
! 644: fashion.
1.1.1.12 root 645:
1.1.1.17! root 646: If you have installed an earlier version of GCC, you can compile the
! 647: newer version with that. However, you will run into trouble compiling
! 648: `gnulib', since that is normally compiled with CC. To solve the
! 649: problem, uncomment this line in `Makefile':
1.1.1.13 root 650:
651: CCLIBFLAGS = -B/usr/local/lib/gcc- -tp -Wp,-traditional
652:
1.1.1.12 root 653:
1.1.1.14 root 654: File: gcc.info, Node: SCO Install, Next: VMS Install, Prev: 3B1 Install, Up: Installation
655:
656: Installing GNU CC on SCO System V 3.2
657: =====================================
658:
1.1.1.17! root 659: The compiler that comes with this system does not work properly with
! 660: `-O'. Therefore, you should redefine the Make variable `CCLIBFLAGS'
! 661: not to use `-O'.
! 662:
! 663: You should also edit `Makefile' to enable the lines that set `CLIB'
! 664: to `-lPW', and the ones specifically labeled as being for SCO, that set
! 665: `RANLIB', and that set `CC' and `OLDCC' to `rcc -Di386 -DM_UNIX
! 666: -DM_I386 -DM_SYSV -DM_COFF'.
1.1.1.15 root 667:
1.1.1.16 root 668: Also, edit the definition of `USER_H' to remove the file `limits.h'.
1.1.1.15 root 669:
1.1.1.16 root 670: Then you can run `config.gcc i386-sco' and finish building GNU CC
1.1.1.15 root 671: normally.
672:
1.1.1.17! root 673: Note that the function `memmove' is broken in 3.2v2; it clobbers
! 674: register `%ebx'. See the file `sco-memmove.s'.
! 675:
! 676: The same recipe should work on ESIX, but use `config.gcc i386-esix'
! 677: instead.
1.1.1.14 root 678:
679:
680: File: gcc.info, Node: VMS Install, Next: HPUX Install, Prev: SCO Install, Up: Installation
1.1.1.12 root 681:
682: Installing GNU CC on VMS
683: ========================
1.1.1.9 root 684:
1.1.1.16 root 685: The VMS version of GNU CC is distributed in a backup saveset
1.1.1.12 root 686: containing both source code and precompiled binaries.
687:
1.1.1.17! root 688: To install the `gcc' command so you can use the compiler easily, in
! 689: the same manner as you use the VMS C compiler, you must install the VMS
! 690: CLD file for GNU CC as follows:
1.1.1.4 root 691:
692: 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
1.1.1.17! root 693: point to the directories where the GNU CC executables (`gcc-cpp',
! 694: `gcc-cc1', etc.) and the C include files are kept. This should be
! 695: done with the commands:
1.1.1.2 root 696:
1.1.1.12 root 697: $ assign /super /system disk:[gcc.] gnu_cc
698: $ assign /super /system disk:[gcc.include.] gnu_cc_include
1.1.1.2 root 699:
1.1.1.17! root 700: with the appropriate disk and directory names. These commands can
! 701: be placed in your system startup file so they will be executed
! 702: whenever the machine is rebooted. You may, if you choose, do this
! 703: via the `GCC_INSTALL.COM' script in the `[GCC]' directory.
1.1.1.2 root 704:
705: 2. Install the `GCC' command with the command line:
706:
1.1.1.12 root 707: $ set command /table=sys$library:dcltables gnu_cc:[000000]gcc
1.1.1.2 root 708:
1.1.1.11 root 709: 3. To install the help file, do the following:
710:
711: $ lib/help sys$library:helplib.hlb gcc.hlp
712:
1.1.1.17! root 713: Now you can invoke the compiler with a command like `gcc /verbose
! 714: file.c', which is equivalent to the command `gcc -v -c file.c' in
! 715: Unix.
1.1.1.9 root 716:
1.1.1.16 root 717: We try to put corresponding binaries and sources on the VMS
1.1.1.12 root 718: distribution tape. But sometimes the binaries will be from an older
719: version that the sources, because we don't always have time to update
720: them. (Use the `/verbose' option to determine the version number of
721: the binaries and compare it with the source file `version.c' to tell
1.1.1.17! root 722: whether this is so.) In this case, you should use the binaries you get
! 723: to recompile the sources. If you must recompile, here is how:
1.1.1.12 root 724:
725: 1. Copy the file `tm-vms.h' to `tm.h', `xm-vms.h' to `config.h',
1.1.1.17! root 726: `vax.md' to `md.' and `out-vax.c' to `aux-output.c'. The files to
! 727: be copied are found in the subdirectory named `config'; they
1.1.1.12 root 728: should be copied to the main directory of GNU CC.
729:
730: 2. Setup the logical names and command tables as defined above. In
1.1.1.17! root 731: addition, define the vms logical name `GNU_BISON' to point at the
! 732: to the directories where the Bison executable is kept. This
1.1.1.12 root 733: should be done with the command:
734:
735: $ assign /super /system disk:[bison.] gnu_bison
736:
1.1.1.17! root 737: You may, if you choose, use the `INSTALL_BISON.COM' script in the
! 738: `[BISON]' directory.
1.1.1.12 root 739:
740: 3. Install the `BISON' command with the command line:
741:
742: $ set command /table=sys$library:dcltables gnu_bison:[000000]bison
743:
744: 4. Type `@make' to do recompile everything.
745:
1.1.1.17! root 746: If you are compiling with a version of GNU CC older than 1.33,
! 747: specify `/DEFINE=("inline=")' as an option in all the
1.1.1.12 root 748: compilations. This requires editing all the `gcc' commands in
1.1.1.17! root 749: `make-cc1.com'. (The older versions had problems supporting
! 750: `inline'.) Once you have a working 1.33 or newer GNU CC, you can
! 751: change this file back.
! 752:
! 753: Due to the differences between the filesystems of Unix and VMS, the
! 754: preprocessor attempts to translate the names of include files into
! 755: something that VMS will understand. The basic strategy is to prepend a
! 756: prefix to the specification of the include file, convert the whole
! 757: filename to a VMS filename, and then try to open the file. The
! 758: preprocessor tries various prefixes until one of them succeeds.
1.1.1.16 root 759:
760: The first prefix is the `GNU_CC_INCLUDE:' logical name: this is
1.1.1.17! root 761: where GNU_C header files are traditionally stored. If a header file is
! 762: not found there, `SYS$SYSROOT:[SYSLIB.]' is tried next. If the
1.1.1.16 root 763: preprocessor is still unable to locate the file, it then assumes that
764: the include file specification is a valid VMS filename all by itself,
1.1.1.17! root 765: and it uses this filename to attempt to open the include file. If none
! 766: of these strategies succeeds, the preprocessor reports an error.
1.1.1.16 root 767:
1.1.1.17! root 768: If you wish to store header files in non-standard locations, then you
! 769: can assign the logical `GNU_CC_INCLUDE' to be a search list, where each
! 770: element of the list is suitable for use with a rooted logical.
1.1.1.16 root 771:
772: With this version of GNU CC, `const' global variables now work
1.1.1.14 root 773: properly. Unless, however, the `const' modifier is also specified in
774: every external declaration of the variable in all of the source files
1.1.1.17! root 775: that use that variable, the linker will issue warnings about conflicting
! 776: attributes for the variable, since the linker does not know if the
! 777: variable should be read-only. The program will still work, but the
! 778: variable will be placed in writable storage.
1.1.1.14 root 779:
1.1.1.16 root 780: Due to an assembler bug, offsets to static constants are sometimes
1.1.1.17! root 781: incorrectly evaluated. This bug is present in GAS 1.38.1, and should be
! 782: fixed in the next version.
1.1.1.16 root 783:
784: Under previous versions of GNU CC, the generated code would
1.1.1.17! root 785: occasionally give strange results when linked to the sharable `VAXCRTL'
! 786: library. Now this should work.
1.1.1.14 root 787:
1.1.1.17! root 788: Even with this version, however, GNU CC itself should not be linked
! 789: to the sharable `VAXCRTL'. The `qsort' routine supplied with `VAXCRTL'
! 790: has a bug which can cause a compiler crash.
1.1.1.16 root 791:
792: Similarly, the preprocessor should not be linked to the sharable
793: `VAXCRTL'. The `strncat' routine supplied with `VAXCRTL' has a bug
794: which can cause the preprocessor to go into an infinite loop.
795:
1.1.1.17! root 796: It should be pointed out that if you attempt to link to the sharable
! 797: `VAXCRTL', the VMS linker will strongly resist any effort to force it
! 798: to use the `qsort' and `strncat' routines from `gcclib'. Until the
! 799: bugs in `VAXCRTL' have been fixed, linking any of the compiler
! 800: components to the sharable VAXCRTL is not recommended. (These routines
! 801: can be bypassed by placing duplicate copies of `qsort' and `strncat' in
! 802: `gcclib' under different names, and patching the compiler sources to
! 803: use these routines). Both of the bugs in `VAXCRTL' are still present
! 804: in VMS version 5.4-1, which is the most recent version as of this
! 805: writing.
1.1.1.16 root 806:
807: The executables that are generated by `make-cc1.com' and
808: `make-cccp.com' use the non-shared version of `VAXCRTL' (and thus use
809: the `qsort' and `strncat' routines from `gcclib.olb').
1.1.1.14 root 810:
1.1.1.16 root 811: Note that GNU CC on VMS now generates debugging information to
1.1.1.14 root 812: describe the programs symbols to the VMS debugger. However, you need
813: version 1.37 or later of GAS in order to output them properly in the
814: object file.
1.1.1.13 root 815:
1.1.1.16 root 816: The VMS linker does not distinguish between upper and lower case
817: letters in function and variable names. However, usual practice in C
1.1.1.17! root 818: is to distinguish case. Normally GNU C (by means of the assembler GAS)
! 819: implements usual C behavior by augmenting each name that is not all
! 820: lower-case. A name is augmented by truncating it to at most 23
! 821: characters and then adding more characters at the end which encode the
! 822: case pattern the rest.
1.1.1.16 root 823:
824: Name augmentation yields bad results for programs that use
825: precompiled libraries (such as Xlib) which were generated by another
826: compiler. Use the compiler option `/NOCASE_HACK' to inhibits
827: augmentation; it makes external C functions and variables
828: case-independent as is usual on VMS. Alternatively, you could write
829: all references to the functions and variables in such libraries using
830: lower case; this will work on VMS, but is not portable to other
1.1.1.17! root 831: systems. In cases where you need to selectively inhibit augmentation,
! 832: you can define a macro for each mixed case symbol for which you wish to
! 833: inhibit augmentation, where the macro expands into the lower case
! 834: equivalent of the name.
1.1.1.13 root 835:
836:
1.1.1.16 root 837: File: gcc.info, Node: HPUX Install, Next: Tower Install, Prev: VMS Install, Up: Installation
1.1.1.13 root 838:
839: Installing GNU CC on HPUX
840: =========================
841:
1.1.1.16 root 842: To install GNU CC on HPUX, you must start by editing the file
1.1.1.17! root 843: `Makefile'. Search for the string `HPUX' to find comments saying what
! 844: to change. You need to change some variable definitions and (if you
! 845: are using GAS) some lines in the rule for the target `gnulib'.
1.1.1.13 root 846:
1.1.1.16 root 847: To avoid errors when linking programs with `-g', create an empty
1.1.1.14 root 848: library named `libg.a'. An easy way to do this is:
849:
850: ar rc /usr/local/lib/libg.a
851:
1.1.1.16 root 852: To compile with the HPUX C compiler, you must specify get the file
1.1.1.13 root 853: `alloca.c' from GNU Emacs. Then, when you run `make', use this
854: argument:
855:
856: make ALLOCA=alloca.o
857:
1.1.1.17! root 858: When recompiling GNU CC with itself, do not define `ALLOCA'.
1.1.1.13 root 859: Instead, an `-I' option needs to be added to `CFLAGS' as follows:
860:
861: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -I../binutils/hp-include"
1.1.1.14 root 862:
1.1.1.15 root 863:
1.1.1.16 root 864: File: gcc.info, Node: Tower Install, Prev: HPUX Install, Up: Installation
1.1.1.15 root 865:
866: Installing GNU CC on an NCR Tower
867: =================================
868:
1.1.1.16 root 869: On an NCR Tower model 4x0 or 6x0, you may have trouble because the
1.1.1.15 root 870: default maximum virtual address size of a process is just 1 Mb. Most
871: often you will find this problem while compiling GNU CC with itself.
872:
1.1.1.17! root 873: The only way to solve the problem is to reconfigure the kernel. Add
! 874: a line such as this to the configuration file:
1.1.1.15 root 875:
876: MAXUMEM = 4096
877:
878: and then relink the kernel and reboot the machine.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.