--- gcc/INSTALL 2018/04/24 16:40:06 1.1.1.2 +++ gcc/INSTALL 2018/04/24 16:48:15 1.1.1.8 @@ -1,10 +1,12 @@ -This is a copy of one node from the Info file internals-1. +This is a copy of one node from the Info file gcc.info-1. For full information on installing and porting GCC, refer to the -internals manual: +GCC manual: - Info file internals - TeX output internals.dvi - TeX source internals.texinfo + Info file gcc.info + TeX output gcc.dvi + TeX source gcc.texinfo + +File: gcc.info, Node: Installation, Next: Trouble, Prev: Options, Up: Top Installing GNU CC ***************** @@ -15,109 +17,231 @@ Here is the procedure for installing GNU * VMS Install:: See below for installation on VMS. - - 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. + 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. 2. On a Sequent system, go to the Berkeley universe. - 3. Choose configuration files. + 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). + + Here is a list of the possible arguments: + + `vax' + Vaxes running BSD. + + `vms' + Vaxes running VMS. + + `vax-sysv' + Vaxes running system V. + + `i386-sysv' + Intel 386 PCs running system V. + + `sequent-386' + Sequent with Intel 386 processors. + + `sun2' + Sun 2 running system version 2 or 3. + + `sun3' + Sun 3 running system version 2 or 3. + + `sun4' + Sun 4 running system version 2 or 3. + + `sun2-os4' + Sun 2 running system version 4. + + `sun3-os4' + Sun 3 running system version 4. + + `sun4-os4' + Sun 4 running system version 4. + + `sun386' + Sun 386 (``roadrunner''). + + `hp9k320' + HP 9000 series 300 using HPUX assembler. + + `kp9k320g' + HP 9000 series 300 using GNU assembler, linker and debugger. + This requires the HP-adapt package which is or will soon be + available in the same places as GNU CC. + + `isi68' + ISI 68000 or 68020 system. + + `news800' + Sony NEWS 68020 system. + + `3b1' + AT&T 3b1, a.k.a. 7300 PC. + + `sequent-ns32k' + Sequent containing ns32000 processors. + + `encore' + Encore ns32000 system. + + `genix' + National Semiconductor ns32000 system. + + `88000' + Motorola 88000 processor. This port is not finished. + + Here we spell out what files need to be set up: + + * Make a symbolic link named `config.h' to the top-level + config file for the machine you are using (*note + Config::.). This file is responsible for defining + information about the host machine. It includes `tm.h'. + + The file's name should be `xm-MACHINE.h', with these + exceptions: - * Make a symbolic link named `config.h' to the top-level config - file for the machine you are using (*Note Config::.). This file - is responsible for defining information about the host machine. - It includes `tm.h'. - - The file's name should be `config-MACHINE.h'. On VMS, use - `config-vms.h' rather than `config-vax.h'. On the HP 9000 series - 300, use `config-hp9k3.h' rather than `config-m68k.h'. - - If your system does not support symbolic links, you might want to - set up `config.h' to contain a `#include' command which refers to - the appropriate file. - - * Make a symbolic link named `tm.h' to the machine-description - macro file for your machine (its name should be `tm-MACHINE.h'). - - For the 68000/68020, do not use `tm-m68k.h' directly; instead use - one of the files `tm-sun3.h', `tm-sun2.h', `tm-isi68.h', - `tm-news800.h' or `tm-3b1.h'. Each of those files includes - `tm-m68k.h' but sets up a few things differently as appropriate - to the specific model of machine. - - There are two files you can use for a 680x0 running HPUX: - `tm-hp9k320.h' and `tm-hp9k320g.h'. Use the former if you are - installing GNU CC alone. The latter is for another option where - GNU CC together with the GNU assembler, linker, debugger and - other utilities are used to replace all of HPUX that deals with - compilation. Not all of the pieces of GNU software needed for - this mode of operation are as yet in distribution; full - instructions will appear here in the future. - - For the vax, use `tm-vax.h' on Unix, or `tm-vms.h' on VMS. - - For the sparc, use `tm-sparc.h'. - - For the 32000, use `tm-sequent.h' if you are using a Sequent - machine, or `tm-encore.h' for an Encore machine; otherwise, - perhaps `tm-ns32k.h' will work for you. If you are trying to use - GNU CC on GENIX, you may need to get the version of `malloc' from - GNU Emacs instead of the system library version, and you probably - need to cause the following assembler code to be executed in - `crt0.o' in order to run the GNU CC output: - - lprd sb,$0 - sprd mod,r0 - movqd $0,0(r0) + `xm-vms.h' + for vaxen running VMS. + + `xm-vaxv.h' + for vaxen running system V. + + `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. + + `xm-hp9k320.h' + for the HP 9000 series 300. + + `xm-genix.h' + for the ns32000 running Genix + + If your system does not support symbolic links, you might + want to set up `config.h' to contain a `#include' command + which refers to the appropriate file. + + * Make a symbolic link named `tm.h' to the + machine-description macro file for your machine (its name + should be `tm-MACHINE.h'). + + If your system is a 68000, don't use the file `tm-m68k.h' + directly. Instead, use one of these files: + + `tm-sun3.h' + for Sun 3 machines. + + `tm-sun2.h' + for Sun 2 machines. + + `tm-3b1.h' + for AT&T 3b1 (aka 7300 Unix PC). + + `tm-isi68.h' + for Integrated Solutions systems. This file assumes + you use the GNU assembler. + + `tm-news800.h' + for SONY News systems. + + `tm-hp9k320.h' + for HPUX systems, if you are using GNU CC with the + system's assembler and linker. + + `tm-hp9k320g.h' + for HPUX systems, if you are using the GNU assembler, + linker and other utilities. Not all of the pieces of + GNU software needed for this mode of operation are as + yet in distribution; full instructions will appear + here in the future. + + 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. + + For the 80386, don't use `tm-i386.h' directly. Use + `tm-i386v.h' if the target machine is running system V, + `tm-seq386.h' for a Sequent 386 system, or `tm-compaq.h' + for a Compaq, or `tm-sun386i.h' for a Sun 386 system. + + 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, + perhaps `tm-ns32k.h' will work for you. + + Note that Genix has bugs in `alloca' and `malloc'; you must + get the compiled versions of these from GNU Emacs and edit + GNU CC's `Makefile' to use them. Note that Encore systems are supported only under BSD. * Make a symbolic link named `md' to the machine description - pattern file (its name should be `MACHINE.md'). + pattern file. Its name should be `MACHINE.md', but MACHINE + is often not the same as the name used in the `tm.h' file + because the `md' files are more general. * Make a symbolic link named `aux-output.c' to the output subroutine file for your machine (its name should be - `OUTPUT-MACHINE.c'). + `output-MACHINE.c'). - 4. Make sure the Bison parser generator is installed. (This is unnecessary - if the Bison output files `parse.tab.c' and `cexp.c' are more recent - than `parse.y' and `cexp.y' and you do not plan to change the `.y' - files.) - - Note that if you have an old version of Bison you may get an error - from the line with the `%expect' directive. If so, simply remove that - line from `parse.y' and proceed. + 4. Make sure the Bison parser generator is installed. (This is + unnecessary if the Bison output files `c-parse.tab.c' and + `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 + 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. + `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. 6. Build the compiler. Just type `make' in the compiler directory. - 7. Move the first-stage object files and executables into a subdirectory - with this command: + 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. Move the first-stage object files and executables into a + subdirectory with this command: make stage1 The files are moved into a subdirectory named `stage1'. Once - installation is complete, you may wish to delete these files with `rm - -r stage1'. + installation is complete, you may wish to delete these files + with `rm -r stage1'. 8. Recompile the compiler with itself, with this command: make CC=stage1/gcc CFLAGS="-g -O -Bstage1/" - 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: + 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" - 9. If you wish to test the compiler by compiling it with itself one more - time, do this: + 9. If you wish to test the compiler by compiling it with itself one + more time, do this: make stage2 make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" @@ -125,96 +249,103 @@ Here is the procedure for installing GNU cmp $file stage2/$file end - This will notify you if any of these stage 3 object files differs from - those of stage 2. Any difference, no matter how innocuous, indicates - that the stage 2 compiler has compiled GNU CC incorrectly, and is - therefore a potentially serious bug which you should investigate and - report (*Note Bugs::.). + This will notify you if any of these stage 3 object files + differs from those of stage 2. Any difference, no matter how + innocuous, indicates that the stage 2 compiler has compiled GNU + CC incorrectly, and is therefore a potentially serious bug which + you should investigate and report (*note Bugs::.). + + Aside from the `-B' option, the options should be the same as + when you made stage 2. - 10. Install the compiler driver, the compiler's passes and run-time support. - You can use the following command: + 10. Install the compiler driver, the compiler's passes and run-time + support. You can use the following command: make install - This copies the files `cc1', `cpp' and `gnulib' to files `gcc-cc1', - `gcc-cpp' and `gcc-gnulib' in directory `/usr/local/lib', which is - where the compiler driver program looks for them. It also copies the - driver program `gcc' into the directory `/usr/local', so that it - appears in typical execution search paths. - - *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' and - other system header files unless the `-traditional' option is used.* - The bug is in the header files: at least on some machines, they rely - on behavior that is incompatible with ANSI C. This behavior consists - of substituting for macro argument names when they appear inside of - character constants. The `-traditional' option tells GNU CC to behave - the way these headers expect. + This copies the files `cc1', `cpp' and `gnulib' to files + `gcc-cc1', `gcc-cpp' and `gcc-gnulib' in directory + `/usr/local/lib', which is where the compiler driver program + looks for them. It also copies the driver program `gcc' into + the directory `/usr/local', so that it appears in typical + execution search paths. + + *Warning: there is a bug in `alloca' in 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.* + + *Warning: the GNU CPP may not work for `ioctl.h', `ttychars.h' + and other system header files unless the `-traditional' option + is used.* The bug is in the header files: at least on some + machines, they rely on behavior that is incompatible with ANSI + C. This behavior consists of substituting for macro argument + names when they appear inside of character constants. The + `-traditional' option tells GNU CC to behave the way these + headers expect. - Because of this problem, you might prefer to configure GNU CC to use - the system's own C preprocessor. To do so, make the file + Because of this problem, you might prefer to configure GNU CC to + use the system's own C preprocessor. To do so, make the file `/usr/local/lib/gcc-cpp' a link to `/lib/cpp'. - Alternatively, on Sun systems and 4.3BSD at least, you can correct the - include files by running the shell script `fixincludes'. This - installs modified, corrected copies of the files `ioctl.h' and - `ttychars.h' in a special directory where only GNU CC will normally - look for them. - - The file `/usr/include/vaxuba/qvioctl.h' used in the X window system - needs a similar correction. + Alternatively, on Sun systems and 4.3BSD at least, you can + correct the include files by running the shell script + `fixincludes'. This installs modified, corrected copies of the + files `ioctl.h', `ttychars.h' and many others, in a special + directory where only GNU CC will normally look for them. This + script will work on various systems because it choose the files + by searching all the system headers for the problem cases that + we know about. 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 concatenates the prefix -with the names `cpp', `cc1' and `gnulib'. Thus, you can put the files in -a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' when you run GNU CC. +`/usr/local/lib', you can alternatively use the `-B' option to +specify a prefix by which they may be found. The compiler +concatenates the prefix with the names `cpp', `cc1' and `gnulib'. +Thus, you can put the files in a directory `/usr/foo/gcc' and specify +`-B/usr/foo/gcc/' when you run GNU CC. + +Also, you can specify an alternative default directory for these +files by setting the Make variable `libdir' when you make GNU CC. -Also, you can specify an alternative default directory for these files by -setting the Make variable `libdir' when you make GNU CC. - -File: internals, Node: VMS Install, Prev: Installation, Up: Installation +File: gcc.info, Node: VMS Install, Prev: Installation, Up: Installation Installing GNU CC on VMS ======================== -The VMS version of GNU CC is distributed in an unusual tape format which -consists of several tape files. The first is a command file; the second is -an executable program which reads Unix tar format; the third is another -command file which uses this program to read the remainder of the tape. - -To load the tape, it suffices to mount it `/foreign' and then do `@mta0:' -to execute the command file at the beginning of the tape. - -The tape contains executables and object files as well as sources, so no -compilation is necessary unless you change the sources. (This is a good -thing, since you probably don't have any other C compiler.) If you must -recompile, here is how: +The VMS version of GNU CC is distributed in a backup saveset +containing both source code and precompiled binaries. + +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. Copy the file `tm-vms.h' to `tm.h', `config-vms.h' to `config.h', + 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'. 2. Type `@make' to do recompile everything. -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: - - 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to point to - the directories where the GNU CC executables (`gcc-cpp', `gcc-cc1', - etc.) and the C include files are kept. This should be done with the - commands: +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: + + 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to + point to the directories where the GNU CC executables + (`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 - 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. + 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. 2. Install the `GCC' command with the command line: $ set command /table=sys$library:dcltables gnu_cc:gcc - Now you can invoke the compiler with a command like `gcc /verbose - file.c', which is equivalent to the command `gcc -v -c file.c' in Unix. + Now you can invoke the compiler with a command like `gcc + /verbose file.c', which is equivalent to the command `gcc -v -c + file.c' in Unix.