Building GCC 1.37.1 for the Apollo 4-May-90 John Vasta These changes enable GCC 1.37.1 to be used on Apollo SR10.2 systems with some restrictions: 1. There is no debug information at all (although DDE lets you debug in assembly language). 2. The header files in /usr/apollo/include cannot be compiled, because of the C++-style "reference type" syntax, which is not implemented in GCC. All the Unix header files should compile, however. 3. The compiler generates code which is link-compatible with the Apollo C compiler and libraries. The GNU assembler was hacked to produce COFF output modules. In order to use the Apollo global libraries, the code sections are actually put into writable data sections, so that the loader can relocate them (GCC doesn't generate code which needs no relocation, like the Apollo compilers). This means that program text cannot be shared, and loading may take slightly longer, but I don't think it will be noticable. The following prerequisites are required: 1. Running SR10.2 or later and using version 6.7 or later of the Apollo C compiler (it may work on earlier SR10 releases and C compilers, but I haven't tried it). 2. Running in a bsd4.3 environment in order to build the GNU software (although the resulting binaries will work in any environment). 3. Virgin distribution of GCC 1.37.1 (available via anonymous ftp from prep.ai.mit.edu in the /pub/gnu directory, as well as from other sites). 4. Virgin distribution of GAS 1.36. 5. Recent version of Bison (I'm using 1.03) Here are the steps to follow: 1. Get the required GNU software and set it up (you should have a gas-1.36 directory and a gcc-1.37.1 directory) 2. If you got the tar file containing my changes, then you got complete replacements for the following files: gas-1.36/Makefile gas-1.36/as.c gas-1.36/write.c gas-1.36/coff-convert.c (this is a new file) gcc-1.37.1/Makefile gcc-1.37.1/c-parse.tab.c gcc-1.37.1/c-parse.y gcc-1.37.1/expr.c gcc-1.37.1/stmt.c gcc-1.37.1/config/tm-apollo68.h If you unpacked the tar file in the directory containing the gas and gcc directories, then the files were overlaid and you're all set. Otherwise you'll need to move the files into the correct places. If you got the shar file containing diffs, then you should have unpacked it to get these files: apollo-gas-1.36.diffs gas-1.36/coff-convert.c apollo-gcc-1.37.1.diffs Patch the files in gas-1.36 using apollo-gas-1.36.diffs as the patch input, and patch the files in gcc-1.37.1 using apollo-gcc-1.37.1.diffs. NOTE: if you use the /usr/new/patch utility you should use the -p option so that it will patch files in subdirectories, and do the patching from the directory containing the gas and gcc directories. For example, if you have the directory /usr/local/gnu/gas-1.36, then do this: cd /usr/local/gnu patch -p m-generic.h Run "make" Run "make install" (copies it to /usr/local/lib/gcc-as) 4. Build Bison: just add `-A nansi' to the CFLAGS macro in the Makefile, run "make", then "make install". 5. Build GCC: Make sure the gcc files have been updated Create configuration links by running the config.gcc script with the argument 'apollo68' (i.e. `config.gcc apollo68') Run make Install it with 'make install' 6. If you want to test GCC by using it to compile itself (twice), then do 'make bootstrap CFLAGS=""' Be sure to use gcc to link your programs. It makes sure that the GCC runtime library is linked in, and that the startup file is linked in. Using ld directly won't work, unless you explicitly link in /usr/lib/crt0.o and /usr/local/lib/gcc-gnulib. John Vasta Hewlett-Packard Apollo Systems Division vasta@apollo.hp.com M.S. CHA-01-LT (508) 256-6600 x6362 300 Apollo Drive, Chelmsford, MA 01824 UUCP: {decwrl!decvax, mit-eddie, attunix}!apollo!vasta