|
|
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.18! root 479: On some machines, you will find that starts to recompile the `.c'
! 480: files, due to a bug in Make. If that happens, cancel it and try
! 481: again specifying the same values for Make variables that you used
! 482: in the last compilation; that may not prevent the spurious
! 483: recompilation, but will at least do it properly. For example:
! 484:
! 485: make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" install
! 486:
! 487: The `install' target copies the files `cc1', `cpp' and `gnulib' to
! 488: files `gcc-cc1', `gcc-cpp' and `gcc-gnulib' in directory
1.1.1.17 root 489: `/usr/local/lib', which is where the compiler driver program looks
490: for them. It also copies the driver program `gcc' into the
491: directory `/usr/local/bin', so that it appears in typical
1.1.1.4 root 492: execution search paths.
493:
1.1.1.17 root 494: *Warning: there is a bug in `alloca' in the Sun library. To avoid
495: this bug, install the binaries of GNU CC that were compiled by GNU
496: CC. They use `alloca' as a built-in function and never the one in
497: the library.*
498:
499: *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' and
500: other system header files unless the `-traditional' option is
501: used.* The bug is in the header files: at least on some machines,
502: they rely on behavior that is incompatible with ANSI C. This
503: behavior consists of substituting for macro argument names when
504: they appear inside of character constants. The `-traditional'
505: option tells GNU CC to behave the way these headers expect.
1.1 root 506:
1.1.1.17 root 507: Because of this problem, you might prefer to configure GNU CC to
508: use the system's own C preprocessor. To do so, make the file
1.1 root 509: `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'.
510:
1.1.1.17 root 511: Alternatively, on Sun systems and 4.3BSD at least, you can correct
512: the include files by running the shell script `fixincludes'. This
513: installs modified, corrected copies of the files `ioctl.h',
514: `ttychars.h' and many others, in a special directory where only
515: GNU CC will normally look for them. This script will work on
516: various systems because it chooses the files by searching all the
517: system headers for the problem cases that we know about.
1.1 root 518:
1.1.1.17 root 519: Use the following command to do this:
1.1.1.14 root 520:
521: make includes
522:
1.1.1.17 root 523: If you selected a different directory for GNU CC installation when
524: you installed it, by specifying the Make variable `prefix' or
525: `libdir', specify it the same way in this command.
526:
527: Note that some systems are starting to come with ANSI C system
528: header files. On these systems, don't run `fixincludes'; it may
529: not work, and is certainly not necessary.
530:
531: *Warning:* `fixincludes' does not work on many MIPS systems,
532: because those systems come with circular symbolic links which cause
1.1.1.18! root 533: `ls -lR' to go into an infinite loop. The same problem may occur
! 534: on some versions of SunOS. If you encounter this problem, try
! 535: using `fixinc.new' instead opf `fixincludes'.
1.1.1.17 root 536:
537: If you cannot install the compiler's passes and run-time support in
538: `/usr/local/lib', you can alternatively use the `-B' option to specify
539: a prefix by which they may be found. The compiler concatenates the
540: prefix with the names `cpp', `cc1' and `gnulib'. Thus, you can put the
541: files in a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' when
542: you run GNU CC.
1.1.1.4 root 543:
1.1.1.16 root 544: Also, you can specify an alternative default directory for these
1.1.1.4 root 545: files by setting the Make variable `libdir' when you make GNU CC.
1.1 root 546:
1.1.1.11 root 547:
1.1.1.12 root 548: File: gcc.info, Node: Other Dir, Next: Sun Install, Prev: Installation, Up: Installation
1.1.1.2 root 549:
1.1.1.12 root 550: Compilation in a Separate Directory
551: ===================================
1.1 root 552:
1.1.1.17 root 553: If you wish to build the object files and executables in a directory
554: other than the one containing the source files, here is what you must
555: do differently:
1.1.1.8 root 556:
1.1.1.12 root 557: 1. Go to that directory before running `config.gcc':
1.1.1.4 root 558:
1.1.1.12 root 559: mkdir gcc-sun3
560: cd gcc-sun3
1.1 root 561:
1.1.1.17 root 562: On systems that do not support symbolic links, this directory must
563: be on the same file system as the source code directory.
1.1.1.2 root 564:
1.1.1.12 root 565: 2. Specify where to find `config.gcc' when you run it:
566:
567: ../gcc-1.36/config.gcc ...
568:
569: 3. Specify where to find the sources, as an argument to `config.gcc':
570:
571: ../gcc-1.36/config.gcc -srcdir=../gcc-1.36 sun3
572:
1.1.1.17 root 573: The `-srcdir=DIR' option is not needed when the source directory
574: is the parent of the current directory, because `config.gcc'
575: detects that case automatically.
576:
577: Now, you can run `make' in that directory. You need not repeat the
578: configuration steps shown above, when ordinary source files change. You
579: must, however, run `config.gcc' again when the configuration files
580: change, if your system does not support symbolic links.
1.1.1.12 root 581:
582:
583: File: gcc.info, Node: Sun Install, Next: 3b1 Install, Prev: Other Dir, Up: Installation
584:
585: Installing GNU CC on the Sun
586: ============================
587:
1.1.1.16 root 588: Make sure the environment variable `FLOAT_OPTION' is not set when
589: you compile `gnulib'. If this option were set to `f68881' when
1.1.1.17 root 590: `gnulib' is compiled, the resulting code would demand to be linked with
591: a special startup file and would not link properly without special
592: pains.
1.1.1.12 root 593:
1.1.1.16 root 594: There is a bug in `alloca' in certain versions of the Sun library.
1.1.1.17 root 595: To avoid this bug, install the binaries of GNU CC that were compiled by
596: GNU CC. They use `alloca' as a built-in function and never the one in
597: the library.
598:
599: Some versions of the Sun compiler crash when compiling GNU CC, with a
600: segmentation fault in cpp. This can sometimes be due to the bulk of
601: data in the environment variables. You may be able to avoid it by using
602: the following command to compile GNU CC with Sun CC:
1.1.1.12 root 603:
604: make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
605:
1.1.1.16 root 606: Another problem that often happens on Suns is that you get a crash
1.1.1.15 root 607: when building stage 2, when `genflags' is run.
608:
1.1.1.16 root 609: One reason for such as crash is if you configured GNU CC for the
1.1.1.15 root 610: wrong version of SunOS. Starting with version 1.38, configurations
611: `sun3' and `sun4' are for SunOS 4, so this problem should no longer
612: happen.
613:
1.1.1.17 root 614: Another cause of the same symptom is having installed the GNU linker
615: with an earlier version of SunOS. The version that worked before
616: stopped working due to a change in the format of executables in SunOS
617: 4.1. Many sites have installed the GNU linker as
1.1.1.15 root 618: `/usr/local/lib/gcc-ld', often as part of installing GNU C++. So if
619: you get such crashes and you have used the proper configuration, try
620: deleting `/usr/local/lib/gcc-ld'.
621:
1.1.1.17 root 622: The current version of the GNU linker, found in the current binutils
623: release, does work with SunOS 4.1.
1.1.1.12 root 624:
625:
1.1.1.14 root 626: File: gcc.info, Node: 3b1 Install, Next: SCO Install, Prev: Sun Install, Up: Installation
1.1.1.12 root 627:
628: Installing GNU CC on the 3b1
629: ============================
630:
1.1.1.17 root 631: Installing GNU CC on the 3b1 is difficult if you do not already have
632: GNU CC running, due to bugs in the installed C compiler. However, the
633: following procedure might work. We are unable to test it.
634:
635: 1. Comment out the `#include "config.h"' line on line 37 of `cccp.c'
636: and do `make cpp'. This makes a preliminary version of GNU cpp.
1.1.1.12 root 637:
638: 2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to that
639: file name.
640:
641: 3. Undo your change in `cccp.c', or reinstall the original version,
642: and do `make cpp' again.
643:
644: 4. Copy this final version of GNU cpp into `/lib/cpp'.
645:
1.1.1.13 root 646: 5. Replace every occurrence of `obstack_free' in `tree.c' with
1.1.1.12 root 647: `_obstack_free'.
648:
649: 6. Run `make' to get the first-stage GNU CC.
650:
651: 7. Reinstall the original version of `/lib/cpp'.
652:
1.1.1.17 root 653: 8. Now you can compile GNU CC with itself and install it in the normal
654: fashion.
1.1.1.12 root 655:
1.1.1.17 root 656: If you have installed an earlier version of GCC, you can compile the
657: newer version with that. However, you will run into trouble compiling
658: `gnulib', since that is normally compiled with CC. To solve the
659: problem, uncomment this line in `Makefile':
1.1.1.13 root 660:
661: CCLIBFLAGS = -B/usr/local/lib/gcc- -tp -Wp,-traditional
662:
1.1.1.12 root 663:
1.1.1.14 root 664: File: gcc.info, Node: SCO Install, Next: VMS Install, Prev: 3B1 Install, Up: Installation
665:
666: Installing GNU CC on SCO System V 3.2
667: =====================================
668:
1.1.1.17 root 669: The compiler that comes with this system does not work properly with
670: `-O'. Therefore, you should redefine the Make variable `CCLIBFLAGS'
671: not to use `-O'.
672:
673: You should also edit `Makefile' to enable the lines that set `CLIB'
674: to `-lPW', and the ones specifically labeled as being for SCO, that set
675: `RANLIB', and that set `CC' and `OLDCC' to `rcc -Di386 -DM_UNIX
676: -DM_I386 -DM_SYSV -DM_COFF'.
1.1.1.15 root 677:
1.1.1.16 root 678: Also, edit the definition of `USER_H' to remove the file `limits.h'.
1.1.1.15 root 679:
1.1.1.16 root 680: Then you can run `config.gcc i386-sco' and finish building GNU CC
1.1.1.15 root 681: normally.
682:
1.1.1.17 root 683: Note that the function `memmove' is broken in 3.2v2; it clobbers
684: register `%ebx'. See the file `sco-memmove.s'.
685:
686: The same recipe should work on ESIX, but use `config.gcc i386-esix'
687: instead.
1.1.1.14 root 688:
689:
690: File: gcc.info, Node: VMS Install, Next: HPUX Install, Prev: SCO Install, Up: Installation
1.1.1.12 root 691:
692: Installing GNU CC on VMS
693: ========================
1.1.1.9 root 694:
1.1.1.16 root 695: The VMS version of GNU CC is distributed in a backup saveset
1.1.1.12 root 696: containing both source code and precompiled binaries.
697:
1.1.1.17 root 698: To install the `gcc' command so you can use the compiler easily, in
699: the same manner as you use the VMS C compiler, you must install the VMS
700: CLD file for GNU CC as follows:
1.1.1.4 root 701:
702: 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
1.1.1.17 root 703: point to the directories where the GNU CC executables (`gcc-cpp',
704: `gcc-cc1', etc.) and the C include files are kept. This should be
705: done with the commands:
1.1.1.2 root 706:
1.1.1.12 root 707: $ assign /super /system disk:[gcc.] gnu_cc
708: $ assign /super /system disk:[gcc.include.] gnu_cc_include
1.1.1.2 root 709:
1.1.1.17 root 710: with the appropriate disk and directory names. These commands can
711: be placed in your system startup file so they will be executed
712: whenever the machine is rebooted. You may, if you choose, do this
713: via the `GCC_INSTALL.COM' script in the `[GCC]' directory.
1.1.1.2 root 714:
715: 2. Install the `GCC' command with the command line:
716:
1.1.1.12 root 717: $ set command /table=sys$library:dcltables gnu_cc:[000000]gcc
1.1.1.2 root 718:
1.1.1.11 root 719: 3. To install the help file, do the following:
720:
721: $ lib/help sys$library:helplib.hlb gcc.hlp
722:
1.1.1.17 root 723: Now you can invoke the compiler with a command like `gcc /verbose
724: file.c', which is equivalent to the command `gcc -v -c file.c' in
725: Unix.
1.1.1.9 root 726:
1.1.1.16 root 727: We try to put corresponding binaries and sources on the VMS
1.1.1.12 root 728: distribution tape. But sometimes the binaries will be from an older
729: version that the sources, because we don't always have time to update
730: them. (Use the `/verbose' option to determine the version number of
731: the binaries and compare it with the source file `version.c' to tell
1.1.1.17 root 732: whether this is so.) In this case, you should use the binaries you get
733: to recompile the sources. If you must recompile, here is how:
1.1.1.12 root 734:
735: 1. Copy the file `tm-vms.h' to `tm.h', `xm-vms.h' to `config.h',
1.1.1.17 root 736: `vax.md' to `md.' and `out-vax.c' to `aux-output.c'. The files to
737: be copied are found in the subdirectory named `config'; they
1.1.1.12 root 738: should be copied to the main directory of GNU CC.
739:
740: 2. Setup the logical names and command tables as defined above. In
1.1.1.17 root 741: addition, define the vms logical name `GNU_BISON' to point at the
742: to the directories where the Bison executable is kept. This
1.1.1.12 root 743: should be done with the command:
744:
745: $ assign /super /system disk:[bison.] gnu_bison
746:
1.1.1.17 root 747: You may, if you choose, use the `INSTALL_BISON.COM' script in the
748: `[BISON]' directory.
1.1.1.12 root 749:
750: 3. Install the `BISON' command with the command line:
751:
752: $ set command /table=sys$library:dcltables gnu_bison:[000000]bison
753:
754: 4. Type `@make' to do recompile everything.
755:
1.1.1.17 root 756: If you are compiling with a version of GNU CC older than 1.33,
757: specify `/DEFINE=("inline=")' as an option in all the
1.1.1.12 root 758: compilations. This requires editing all the `gcc' commands in
1.1.1.17 root 759: `make-cc1.com'. (The older versions had problems supporting
760: `inline'.) Once you have a working 1.33 or newer GNU CC, you can
761: change this file back.
762:
763: Due to the differences between the filesystems of Unix and VMS, the
764: preprocessor attempts to translate the names of include files into
765: something that VMS will understand. The basic strategy is to prepend a
766: prefix to the specification of the include file, convert the whole
767: filename to a VMS filename, and then try to open the file. The
768: preprocessor tries various prefixes until one of them succeeds.
1.1.1.16 root 769:
770: The first prefix is the `GNU_CC_INCLUDE:' logical name: this is
1.1.1.17 root 771: where GNU_C header files are traditionally stored. If a header file is
772: not found there, `SYS$SYSROOT:[SYSLIB.]' is tried next. If the
1.1.1.16 root 773: preprocessor is still unable to locate the file, it then assumes that
774: the include file specification is a valid VMS filename all by itself,
1.1.1.17 root 775: and it uses this filename to attempt to open the include file. If none
776: of these strategies succeeds, the preprocessor reports an error.
1.1.1.16 root 777:
1.1.1.17 root 778: If you wish to store header files in non-standard locations, then you
779: can assign the logical `GNU_CC_INCLUDE' to be a search list, where each
780: element of the list is suitable for use with a rooted logical.
1.1.1.16 root 781:
782: With this version of GNU CC, `const' global variables now work
1.1.1.14 root 783: properly. Unless, however, the `const' modifier is also specified in
784: every external declaration of the variable in all of the source files
1.1.1.17 root 785: that use that variable, the linker will issue warnings about conflicting
786: attributes for the variable, since the linker does not know if the
787: variable should be read-only. The program will still work, but the
788: variable will be placed in writable storage.
1.1.1.14 root 789:
1.1.1.16 root 790: Due to an assembler bug, offsets to static constants are sometimes
1.1.1.17 root 791: incorrectly evaluated. This bug is present in GAS 1.38.1, and should be
792: fixed in the next version.
1.1.1.16 root 793:
794: Under previous versions of GNU CC, the generated code would
1.1.1.17 root 795: occasionally give strange results when linked to the sharable `VAXCRTL'
796: library. Now this should work.
1.1.1.14 root 797:
1.1.1.17 root 798: Even with this version, however, GNU CC itself should not be linked
799: to the sharable `VAXCRTL'. The `qsort' routine supplied with `VAXCRTL'
800: has a bug which can cause a compiler crash.
1.1.1.16 root 801:
802: Similarly, the preprocessor should not be linked to the sharable
803: `VAXCRTL'. The `strncat' routine supplied with `VAXCRTL' has a bug
804: which can cause the preprocessor to go into an infinite loop.
805:
1.1.1.17 root 806: It should be pointed out that if you attempt to link to the sharable
807: `VAXCRTL', the VMS linker will strongly resist any effort to force it
808: to use the `qsort' and `strncat' routines from `gcclib'. Until the
809: bugs in `VAXCRTL' have been fixed, linking any of the compiler
810: components to the sharable VAXCRTL is not recommended. (These routines
811: can be bypassed by placing duplicate copies of `qsort' and `strncat' in
812: `gcclib' under different names, and patching the compiler sources to
813: use these routines). Both of the bugs in `VAXCRTL' are still present
814: in VMS version 5.4-1, which is the most recent version as of this
815: writing.
1.1.1.16 root 816:
817: The executables that are generated by `make-cc1.com' and
818: `make-cccp.com' use the non-shared version of `VAXCRTL' (and thus use
819: the `qsort' and `strncat' routines from `gcclib.olb').
1.1.1.14 root 820:
1.1.1.16 root 821: Note that GNU CC on VMS now generates debugging information to
1.1.1.14 root 822: describe the programs symbols to the VMS debugger. However, you need
823: version 1.37 or later of GAS in order to output them properly in the
824: object file.
1.1.1.13 root 825:
1.1.1.16 root 826: The VMS linker does not distinguish between upper and lower case
827: letters in function and variable names. However, usual practice in C
1.1.1.17 root 828: is to distinguish case. Normally GNU C (by means of the assembler GAS)
829: implements usual C behavior by augmenting each name that is not all
830: lower-case. A name is augmented by truncating it to at most 23
831: characters and then adding more characters at the end which encode the
832: case pattern the rest.
1.1.1.16 root 833:
834: Name augmentation yields bad results for programs that use
835: precompiled libraries (such as Xlib) which were generated by another
836: compiler. Use the compiler option `/NOCASE_HACK' to inhibits
837: augmentation; it makes external C functions and variables
838: case-independent as is usual on VMS. Alternatively, you could write
839: all references to the functions and variables in such libraries using
840: lower case; this will work on VMS, but is not portable to other
1.1.1.17 root 841: systems. In cases where you need to selectively inhibit augmentation,
842: you can define a macro for each mixed case symbol for which you wish to
843: inhibit augmentation, where the macro expands into the lower case
844: equivalent of the name.
1.1.1.13 root 845:
846:
1.1.1.16 root 847: File: gcc.info, Node: HPUX Install, Next: Tower Install, Prev: VMS Install, Up: Installation
1.1.1.13 root 848:
849: Installing GNU CC on HPUX
850: =========================
851:
1.1.1.16 root 852: To install GNU CC on HPUX, you must start by editing the file
1.1.1.17 root 853: `Makefile'. Search for the string `HPUX' to find comments saying what
854: to change. You need to change some variable definitions and (if you
855: are using GAS) some lines in the rule for the target `gnulib'.
1.1.1.13 root 856:
1.1.1.16 root 857: To avoid errors when linking programs with `-g', create an empty
1.1.1.14 root 858: library named `libg.a'. An easy way to do this is:
859:
860: ar rc /usr/local/lib/libg.a
861:
1.1.1.16 root 862: To compile with the HPUX C compiler, you must specify get the file
1.1.1.13 root 863: `alloca.c' from GNU Emacs. Then, when you run `make', use this
864: argument:
865:
866: make ALLOCA=alloca.o
867:
1.1.1.17 root 868: When recompiling GNU CC with itself, do not define `ALLOCA'.
1.1.1.13 root 869: Instead, an `-I' option needs to be added to `CFLAGS' as follows:
870:
871: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -I../binutils/hp-include"
1.1.1.14 root 872:
1.1.1.15 root 873:
1.1.1.16 root 874: File: gcc.info, Node: Tower Install, Prev: HPUX Install, Up: Installation
1.1.1.15 root 875:
876: Installing GNU CC on an NCR Tower
877: =================================
878:
1.1.1.16 root 879: On an NCR Tower model 4x0 or 6x0, you may have trouble because the
1.1.1.15 root 880: default maximum virtual address size of a process is just 1 Mb. Most
881: often you will find this problem while compiling GNU CC with itself.
882:
1.1.1.17 root 883: The only way to solve the problem is to reconfigure the kernel. Add
884: a line such as this to the configuration file:
1.1.1.15 root 885:
886: MAXUMEM = 4096
887:
888: 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.