Annotation of gcc/INSTALL, revision 1.1.1.16

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.