--- gcc/INSTALL 2018/04/24 16:51:46 1.1.1.11 +++ gcc/INSTALL 2018/04/24 16:55:27 1.1.1.14 @@ -13,17 +13,25 @@ Here is the procedure for installing GNU * Menu: +* Other Dir:: Compiling in a separate directory (not where the source is). +* Sun Install:: See below for installation on the Sun. +* 3B1 Install:: See below for installation on the 3B1. +* SCO Install:: See below for installation on SCO System V 3.2. * VMS Install:: See below for installation on VMS. +* HPUX Install:: See below for installation on HPUX. +* MIPS Install:: See below for installation on MIPS. 1. Edit `Makefile'. If you are using HPUX, or any form of system V, you must make a few changes described in comments at the - beginning of the file. Genix requires changes also. + beginning of the file. Genix requires changes also, and so does + the Pyramid. 2. On a Sequent system, go to the Berkeley universe. 3. Choose configuration files. The easy way to do this is to run - the command file `config.gcc' with a single argument, which is - the name of the machine (and operating system, in some cases). + the command file `config.gcc' with a single argument, which + specifies the type of machine (and in some cases which operating + system). Here is a list of the possible arguments: @@ -46,22 +54,25 @@ Here is the procedure for installing GNU `sequent-i386' Sequent with Intel 386 processors. + `i386-aix' + Intel 386 PCs or PS/2s running AIX. + `sun2' Sun 2 running system version 2 or 3. `sun3' - Sun 3 running system version 2 or 3, with 68881. - - Note there we do not provide a configuration file to use an - FPA by default because programs that establish signal - handlers for floating point traps inherently cannot work - with the FPA. + Sun 3 running system version 2 or 3, with 68881. Note + there we do not provide a configuration file to use an FPA + by default, because programs that establish signal handlers + for floating point traps inherently cannot work with the FPA. `sun3-nfp' Sun 3 running system version 2 or 3, without 68881. `sun4' - Sun 4 running system version 2 or 3. + Sun 4 running system version 2 or 3. *Note + Incompatibilities::, for calling convention + incompatibilities on the Sun 4 (sparc). `sun2-os4' Sun 2 running system version 4. @@ -73,22 +84,59 @@ Here is the procedure for installing GNU Sun 3 running system version 4, without 68881. `sun4-os4' - Sun 4 running system version 4. + Sun 4 running system version 4. *Note Incompatibilities::, + for calling convention incompatibilities on the Sun 4 + (sparc). `sun386' - Sun 386 (``roadrunner''). + Sun 386 ("roadrunner"). `alliant' - Alliant FX/8 computer. Currently, there are bugs in the - support for floating point. Also note that Alliant's - version of dbx does not manage to work with the output from - GNU CC. + Alliant FX/8 computer. Note that the standard installed C + compiler in Concentrix 5.0 has a bug which prevent it from + compiling GNU CC correctly. You can patch the compiler bug + as follows: + + cp /bin/pcc ./pcc + adb -w ./pcc - << EOF + 15f6?w 6610 + EOF + + Then you must use the `-ip12' option when compiling GNU CC + with the patched compiler, as shown here: + + make CC="./pcc -ip12" CFLAGS=-w + + Note also that Alliant's version of DBX does not manage to + work with the output from GNU CC. + + `tahoe' + The tahoe computer (running BSD, and using DBX). + + `decstation' + The DEC 3100 Mips machine ("pmax"). Note that GNU CC + cannot generate debugging information in the unusual format + used on the Mips. + + `mips-sysv' + The Mips computer, RS series, with the System V environment + as default. Note that GNU CC cannot generate debugging + information in the unusual format used on the Mips. + + `mips-bsd43' + The Mips computer, RS series, with the BSD 4.3 environment + as default. Note that GNU CC cannot generate debugging + information in the unusual format used on the Mips. `mips' - Some variant of MIPS computer (but not the one from DEC). - Note that this machine description was written for GNU CC - version 1.32 and may require some updating to work with the - current version. + The Mips computer, M series. Note that GNU CC cannot + generate debugging information in the unusual format used + on the Mips. + + `iris' + Another variant of the Mips computer, the Silicon Graphics + Iris 4D. Note that GNU CC cannot generate debugging + information in the unusual format used on the Mips. `convex-c1' Convex C1 computer. @@ -96,19 +144,34 @@ Here is the procedure for installing GNU `convex-c2' Convex C2 computer. + `pyramid' + Pyramid computer. + `hp9k320' HP 9000 series 300 using HPUX assembler. Note there is no support in GNU CC for HP's debugger; thus, `-g' is not available in this configuration. - `hp9k320g' + `hp9k320-gas' HP 9000 series 300 using GNU assembler, linker and debugger. This requires the HP-adapt package, which is available - along with the GNU linker as part of the ``binutils'' + along with the GNU linker as part of the "binutils" distribution. This is on the GNU CC distribution tape. + `hp9k320-old' + HP 9000 series 300 using HPUX assembler, in operating + system versions older than 6.5. Note there is no support + in GNU CC for HP's debugger; thus, `-g' is not available in + this configuration. + + `hp9k320-bsd' + HP 9000 series 300 running BSD. + `isi68' - ISI 68000 or 68020 system. + ISI 68000 or 68020 system with a 68881. + + `isi68-nfp' + ISI 68000 or 68020 system without a 68881. `news800' Sony NEWS 68020 system. @@ -116,17 +179,23 @@ Here is the procedure for installing GNU `next' NeXT system. + `tower' + NCR Tower 32 system. + `altos' Altos 3068. Note that you must use the GNU assembler, linker and debugger, with COFF-encapsulation. Also, you must fix a kernel bug. Details in the file `ALTOS-README'. `3b1' - AT&T 3b1, a.k.a. 7300 PC. Note that the current version of - GNU CC cannot be compiled with the Unix compiler on this - machine, due to bugs in the Unix comiler. GNU CC does work - correctly, however, if you can compile it with older - version of GNU CC or cross-compile it. + AT&T 3b1, a.k.a. 7300 PC. Note that special procedures are + needed to compile GNU CC with this machine's standard C + compiler, due to bugs in that compiler. *Note 3b1 + Install::. You can bootstrap it more easily with previous + versions of GNU CC if you have them. + + `3b1-gas' + AT&T 3b1 using the GNU assembler. `sequent-ns32k' Sequent containing ns32000 processors. @@ -159,11 +228,6 @@ Here is the procedure for installing GNU `xm-i386v.h' for Intel 80386's running system V. - `xm-sunos4.h' - for Suns (model 2, 3 or 4) running *operating system* - version 4. (Use `xm-m68k.h' or `xm-sparc.h' for - version 3.) - `xm-sun386i.h' for Sun roadrunner running any version of the operating system. @@ -192,6 +256,13 @@ Here is the procedure for installing GNU `tm-sun3-nfp.h' for Sun 3 machines with no hardware floating point. + `tm-sun3os3.h' + for Sun 3 machines with 68881, running Sunos version 3. + + `tm-sun3os3nf.h' + for Sun 3 machines with no hardware floating point, + running Sunos version 3. + `tm-sun2.h' for Sun 2 machines. @@ -202,8 +273,12 @@ Here is the procedure for installing GNU for Integrated Solutions systems. This file assumes you use the GNU assembler. + `tm-isi68-nfp.h' + for Integrated Solutions systems without a 68881. + This file assumes you use the GNU assembler. + `tm-news800.h' - for SONY News systems. + for Sony NEWS systems. `tm-hp9k320.h' for HPUX systems, if you are using GNU CC with the @@ -216,13 +291,16 @@ Here is the procedure for installing GNU yet in distribution; full instructions will appear here in the future. + `tm-tower-as.h' + for NCR Tower 32 systems, using the standard system + assembler. + For the vax, use `tm-vax.h' on BSD Unix, `tm-vaxv.h' on system V, or `tm-vms.h' on VMS. For the Motorola 88000, use `tm-m88k.h'. The support for - the 88000 has a few unfinished spots because there was no - way to run the output. Bugs are suspected in handling of - branch-tables and in the function prologue and epilogue. + the 88000 does not currently work; it requires extensive + changes which we hope to reconcile in version 2. For the 80386, don't use `tm-i386.h' directly. Use `tm-i386v.h' if the target machine is running system V, @@ -231,6 +309,12 @@ Here is the procedure for installing GNU 386 system, or `tm-compaq.h' for a Compaq, or `tm-sun386i.h' for a Sun 386 system. + For the Mips computer, there are five choices: `tm-mips.h' + for the M series, `tm-mips-bsd.h' for the RS series with + BSD, `tm-mips-sysv.h' for the RS series with System V, + `tm-iris.h' for the Iris version of the machine, and + `tm-decstatn.h' for the Decstation. + For the 32000, use `tm-sequent.h' if you are using a Sequent machine, or `tm-encore.h' for an Encore machine, or `tm-genix.h' if you are using Genix version 3; otherwise, @@ -245,6 +329,15 @@ Here is the procedure for installing GNU For Sparc (Sun 4) machines, use `tm-sparc.h' with operating system version 4, and `tm-sun4os3.h' with system version 3. + For Convex systems before version 8.1, use `tm-conv1os7.h' + or `tm-conv2os7.h'. For versions 8.1 and greater, use + `tm-convex1.h' or `tm-convex2.h'. You should also + bootstrap GCC with `pcc' rather than `cc'; one way to do + this is with the following commands. + + ln -s /bin/pcc ./cc + set path = (. $path) + * Make a symbolic link named `md' to the machine description pattern file. It should be in the `config' subdirectory and its name should be `MACHINE.md'; but MACHINE is often @@ -260,34 +353,38 @@ Here is the procedure for installing GNU `cexp.c' are more recent than `c-parse.y' and `cexp.y' and you do not plan to change the `.y' files.) - Bison versions older that Sept 8, 1988 will produce incorrect + Bison versions older than Sept 8, 1988 will produce incorrect output for `c-parse.tab.c'. - 5. If you are using a Sun, make sure the environment variable - `FLOAT_OPTION' is not set. If this option were set to `f68881' - when `gnulib' is compiled, the resulting code would demand to be - linked with a special startup file and will not link properly - without special pains. + 5. If you have a previous version of GCC installed, then chances + are you can compile the new version with that. Do the following: + + make CC="gcc -O" + + Since this produces an optimized executable right away, there is + no need to bootstrap the result with itself except to test it. + Therefore, you can skip directly to the `make install' step below. 6. Build the compiler. Just type `make' in the compiler directory. - Ignore any warnings you may see about ``statement not reached'' - in the `insn-emit.c'; they are normal. Any other compilation + Ignore any warnings you may see about "statement not reached" in + the `insn-emit.c'; they are normal. Any other compilation errors may represent bugs in the port to your machine or operating system, and should be investigated and reported (*note Bugs::.). - 7. Optionally, install the library functions for 64-bit integer - arithmetic. You do this with the command `make gnulib2'. In - the future this will happen automatically; for now, it is - optional, until we are sure it works on all machines. + Some commercial compilers fail to compile GNU CC because they + have bugs or limitations. For example, the Microsoft compiler + is said to run out of macro space. Some Ultrix compilers run + out of expression space; then you need to break up the statement + where the problem happens. - 8. If you are using COFF-encapsulation, you must convert `gnulib' + 7. If you are using COFF-encapsulation, you must convert `gnulib' to a GNU-format library at this point. See the file `README-ENCAP' in the directory containing the GNU binary file utilities, for directions. - 9. Move the first-stage object files and executables into a + 8. Move the first-stage object files and executables into a subdirectory with this command: make stage1 @@ -296,17 +393,19 @@ Here is the procedure for installing GNU installation is complete, you may wish to delete these files with `rm -r stage1'. - 10. Recompile the compiler with itself, with this command: + 9. Recompile the compiler with itself, with this command: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/" + This is called making the stage 2 compiler. + On a 68000 or 68020 system lacking floating point hardware, unless you have selected a `tm.h' file that expects by default that there is no such hardware, do this instead: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -msoft-float" - 11. If you wish to test the compiler by compiling it with itself one + 10. If you wish to test the compiler by compiling it with itself one more time, do this (in C shell): make stage2 @@ -315,8 +414,9 @@ Here is the procedure for installing GNU cmp $file stage2/$file end - Aside from the `-B' option, the options should be the same as - when you made stage 2. + This is called making the stage 3 compiler. Aside from the `-B' + option, the options should be the same as when you made the + stage 2 compiler. The `foreach' command (written in C shell) will notify you if any of these stage 3 object files differs from those of stage 2. @@ -331,12 +431,15 @@ Here is the procedure for installing GNU for file in *.o; do echo $file - tail +10 $file > foo1 - tail +10 stage2/$file > foo2 + tail +10c $file > foo1 + tail +10c stage2/$file > foo2 cmp foo1 foo2 done - 12. Install the compiler driver, the compiler's passes and run-time + On MIPS machines, you should use the shell script `ecoff-cmp' to + compare two object files. + + 11. Install the compiler driver, the compiler's passes and run-time support. You can use the following command: make install @@ -375,6 +478,18 @@ Here is the procedure for installing GNU by searching all the system headers for the problem cases that we know about. + Use the following command to do this: + + make includes + + If you selected a different directory for GNU CC installation + when you installed it, by specifying the Make variable `prefix' + or `libdir', specify it the same way in this command. + + Note that some systems are starting to come with ANSI C system + header files. On these systems, don't run `fixincludes'; it may + not work, and is certainly not necessary. + If you cannot install the compiler's passes and run-time support in `/usr/local/lib', you can alternatively use the `-B' option to specify a prefix by which they may be found. The compiler @@ -387,32 +502,143 @@ files by setting the Make variable `libd  -File: gcc.info, Node: VMS Install, Prev: Installation, Up: Installation +File: gcc.info, Node: Other Dir, Next: Sun Install, Prev: Installation, Up: Installation -Installing GNU CC on VMS -======================== +Compilation in a Separate Directory +=================================== -The VMS version of GNU CC is distributed in a backup saveset -containing both source code and precompiled binaries. +If you wish to build the object files and executables in a directory +other than the one containing the source files, here is what you must +do differently: -Sometimes the binaries will be from an older version that the -sources, because we don't always have time to update them. In this -case, you should use the binaries you get to recompile the sources. -If you must recompile, here is how: + 1. Go to that directory before running `config.gcc': - 1. Copy the file `tm-vms.h' to `tm.h', `xm-vms.h' to `config.h', - `vax.md' to `md.' and `output-vax.c' to `aux-output.c'. + mkdir gcc-sun3 + cd gcc-sun3 - 2. Type `@make' to do recompile everything. + On systems that do not support symbolic links, this directory + must be on the same file system as the source code directory. - If you are compiling with a version of GCC older than 1.33, - specify `/DEFINE=("inline=")' as an option in all the - compilations. This requires editing all the `gcc' commands in - `make-cc1.com'. (The older versions had problems supporting - `inline'.) Once you have a working 1.33 or newer GCC, you can - change this file back. + 2. Specify where to find `config.gcc' when you run it: + + ../gcc-1.36/config.gcc ... + + 3. Specify where to find the sources, as an argument to `config.gcc': + + ../gcc-1.36/config.gcc -srcdir=../gcc-1.36 sun3 + + The `-srcdir=DIR' option is not needed when the source directory + is the parent of the current directory, because `config.gcc' + detects that case automatically. + +Now, you can run `make' in that directory. You need not repeat the +configuration steps shown above, when ordinary source files change. +You must, however, run `config.gcc' again when the configuration +files change, if your system does not support symbolic links. + + + +File: gcc.info, Node: Sun Install, Next: 3b1 Install, Prev: Other Dir, Up: Installation + +Installing GNU CC on the Sun +============================ + +Make sure the environment variable `FLOAT_OPTION' is not set when you +compile `gnulib'. If this option were set to `f68881' when `gnulib' +is compiled, the resulting code would demand to be linked with a +special startup file and would not link properly without special +pains. + +There is a bug in `alloca' in certain versions of the Sun library. +To avoid this bug, install the binaries of GNU CC that were compiled +by GNU CC. They use `alloca' as a built-in function and never the +one in the library. + +Some versions of the Sun compiler crash when compiling GNU CC. The +problem is a segmentation fault in cpp. + +This problem seems to be due to the bulk of data in the environment +variables. You may be able to avoid it by using the following +command to compile GNU CC with Sun CC: + + make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc" + + + +File: gcc.info, Node: 3b1 Install, Next: SCO Install, Prev: Sun Install, Up: Installation + +Installing GNU CC on the 3b1 +============================ + +Installing GNU CC on the 3b1 is difficult if you do not already have +GNU CC running, due to bugs in the installed C compiler. However, +the following procedure might work. We are unable to test it. + + 1. Comment out the `#include "config.h"' line on line 37 of + `cccp.c' and do `make cpp'. This makes a preliminary version of + GNU cpp. + + 2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to that + file name. + + 3. Undo your change in `cccp.c', or reinstall the original version, + and do `make cpp' again. + + 4. Copy this final version of GNU cpp into `/lib/cpp'. + + 5. Replace every occurrence of `obstack_free' in `tree.c' with + `_obstack_free'. -To install the `GCC' command so you can use the compiler easily, in + 6. Run `make' to get the first-stage GNU CC. + + 7. Reinstall the original version of `/lib/cpp'. + + 8. Now you can compile GNU CC with itself and install it in the + normal fashion. + +If you have installed an earlier version of GCC, you can compile the +newer version with that. However, you will run into trouble +compiling `gnulib', since that is normally compiled with CC. To +solve the problem, uncomment this line in `Makefile': + + CCLIBFLAGS = -B/usr/local/lib/gcc- -tp -Wp,-traditional + + + +File: gcc.info, Node: SCO Install, Next: VMS Install, Prev: 3B1 Install, Up: Installation + +Installing GNU CC on SCO System V 3.2 +===================================== + +The compiler that comes with this system does not work properly with +`-O'. Therefore, you should redefine the Make variable `CCLIBFLAGS' +not to use `-O'. + +In addition, the compiler produces incorrect output when compiling +parts of GNU CC; the resulting executable `cc1' does not work +properly when it is used with `-O'. + +Therefore, what you must do after building the first stage is use GNU +CC to compile itself without optimization. Here is how: + + make -k cc1 CC="./gcc -B./" + +You can think of this as "stage 1.1" of the installation process. +However, using this command has the effect of discarding the faulty +stage 1 executable for `cc1' and replacing it with stage 1.1. You +can then proceed with `make stage1' and the rest of installation. + + + +File: gcc.info, Node: VMS Install, Next: HPUX Install, Prev: SCO Install, Up: Installation + +Installing GNU CC on VMS +======================== + +The VMS version of GNU CC is distributed in a backup saveset +containing both source code and precompiled binaries. + +To install the `gcc' command so you can use the compiler easily, in the same manner as you use the VMS C compiler, you must install the VMS CLD file for GNU CC as follows: @@ -421,16 +647,18 @@ VMS CLD file for GNU CC as follows: (`gcc-cpp', `gcc-cc1', etc.) and the C include files are kept. This should be done with the commands: - $ assign /super /system disk:[gcc] gnu_cc - $ assign /super /system disk:[gcc.include] gnu_cc_include + $ assign /super /system disk:[gcc.] gnu_cc + $ assign /super /system disk:[gcc.include.] gnu_cc_include with the appropriate disk and directory names. These commands can be placed in your system startup file so they will be - executed whenever the machine is rebooted. + executed whenever the machine is rebooted. You may, if you + choose, do this via the `GCC_INSTALL.COM' script in the `[GCC]' + directory. 2. Install the `GCC' command with the command line: - $ set command /table=sys$library:dcltables gnu_cc:gcc + $ set command /table=sys$library:dcltables gnu_cc:[000000]gcc 3. To install the help file, do the following: @@ -440,12 +668,102 @@ VMS CLD file for GNU CC as follows: /verbose file.c', which is equivalent to the command `gcc -v -c file.c' in Unix. -There is a known problem on VMS: `const' global variables don't work -compatibly with the VMS C compiler; we don't know a way to get them -to the linker properly. - -Note that GNU CC on VMS does not generate debugging information to -describe the program's symbols. It is not straightforward to -implement this, and we have no time to spend on it, but we might -consent to install a very modular implementation if you write it. -You will probably have to modify GAS as well as GNU CC. +We try to put corresponding binaries and sources on the VMS +distribution tape. But sometimes the binaries will be from an older +version that the sources, because we don't always have time to update +them. (Use the `/verbose' option to determine the version number of +the binaries and compare it with the source file `version.c' to tell +whether this is so.) In this case, you should use the binaries you +get to recompile the sources. If you must recompile, here is how: + + 1. Copy the file `tm-vms.h' to `tm.h', `xm-vms.h' to `config.h', + `vax.md' to `md.' and `out-vax.c' to `aux-output.c'. The files + to be copied are found in the subdirectory named `config'; they + should be copied to the main directory of GNU CC. + + 2. Setup the logical names and command tables as defined above. In + addition, define the vms logical name `GNU_BISON' to point at + the to the directories where the Bison executable is kept. This + should be done with the command: + + $ assign /super /system disk:[bison.] gnu_bison + + You may, if you choose, use the `INSTALL_BISON.COM' script in + the `[BISON]' directory. + + 3. Install the `BISON' command with the command line: + + $ set command /table=sys$library:dcltables gnu_bison:[000000]bison + + 4. Type `@make' to do recompile everything. + + If you are compiling with a version of GNU CC older than 1.33, + specify `/DEFINE=("inline=")' as an option in all the + compilations. This requires editing all the `gcc' commands in + `make-cc1.com'. (The older versions had problems supporting + `inline'.) Once you have a working 1.33 or newer GNU CC, you + can change this file back. + +With this version of GNU CC, `const' global variables now work +properly. Unless, however, the `const' modifier is also specified in +every external declaration of the variable in all of the source files +that use that variable, the linker will issue warnings about +conflicting attributes for the variable, since the linker does not +know if the variable should be read-only. The program will still +work, but the variable will be placed in writable storage. + +Under previous versions of GNU CC, the generated code would +occasionally give strange results when linked to the sharable +`VAXCRTL' library. Now this should work. + +Even with this version, however, GNU CC itself should not be linked +to the sharable `VAXCRTL', unless you force the linker to use the +`qsort' routine from `gcclib.olb'. The `qsort' routine supplied with +`VAXCRTL' has a bug which causes a compiler crash. The executable +that is generated by `make-cc1.com' uses the non-shared version of +`VAXCRTL' (and thus the `qsort' routine from `gcclib.olb'). + +Note that GNU CC on VMS now generates debugging information to +describe the programs symbols to the VMS debugger. However, you need +version 1.37 or later of GAS in order to output them properly in the +object file. + + + +File: gcc.info, Node: HPUX Install, Next: MIPS Install, Prev: VMS Install, Up: Installation + +Installing GNU CC on HPUX +========================= + +To install GNU CC on HPUX, you must start by editing the file +`Makefile'. Search for the string `HPUX' to find comments saying +what to change. You need to change some variable definitions and (if +you are using GAS) some lines in the rule for the target `gnulib'. + +To avoid errors when linking programs with `-g', create an empty +library named `libg.a'. An easy way to do this is: + + ar rc /usr/local/lib/libg.a + +To compile with the HPUX C compiler, you must specify get the file +`alloca.c' from GNU Emacs. Then, when you run `make', use this +argument: + + make ALLOCA=alloca.o + +When recompiling GNU CC with itself, do not define `ALLOCA'. +Instead, an `-I' option needs to be added to `CFLAGS' as follows: + + make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -I../binutils/hp-include" + + + +File: gcc.info, Node: MIPS Install, Prev: HPUX Install, Up: Installation + +Installing GNU CC on MIPS +========================= + +To avoid errors when linking programs with `-g', create an empty +library named `libg.a'. An easy way to do this is: + + ar rc /usr/local/lib/libg.a