The GNU C compiler is now available for ftp from the file
/u2/emacs/gcc.tar on prep.ai.mit.edu. This includes machine
descriptions for vax and sun, 60 pages of documentation on writing
machine descriptions (internals.texinfo, internals.dvi and Info
file internals).

This also contains the ANSI standard (Nov 86) C preprocessor and 30
pages of reference manual for it.

This compiler compiles itself correctly on the 68020 and did so
recently on the vax. It recently compiled Emacs correctly on the
68020, and has also compiled tex-in-C and Kyoto Common Lisp.
However, it probably still has numerous bugs that I hope you will
find for me.

I will be away for a month, so bugs reported now will not be
handled until then.

If you can’t ftp, you can order a compiler beta-test tape from the
Free Software Foundation for $150 (plus 5% sales tax in
Massachusetts, or plus $15 overseas if you want air mail).

Free Software Foundation
1000 Mass Ave
Cambridge, MA 02138

[tapes are generally in Unix tar format. If you have other needs,
write to the above address, and ask if they can be met. -len]

And indeed, the files are dated 22/03/1987 making this the first public release of GCC.

GNU CC is a fairly portable optimizing C compiler intended for
machines with 32-bit words that have several registers and address
memory in terms of 8-bit bytes. It supports full ANSI standard C, not
including libraries (which we do not consider to be part of a
compiler).
Currently we have working machine descriptions for the Vax and for
the 68000/68020 (including 68881 support).
Optimizations performed by GNU CC include:

GNU CC runs about as fast as PCC.
Most of the optimizations are machine-independent or controlled by a
machine description. GNU CC takes advantage of all the 68020
addressing modes that we can see how to make the Sun assembler
assemble. Debugging output for DBX is available whether you request
optimization or not.

Seeing as 4.3BSD didn’t ship until 1988, I went ahead and set out to build this on 4.2BSD. The first stumbling block I hit is that GCC needs bison. The oldest version of bison I have is 1.25 which honestly is just too new! However in the same location as GCC is this file gnu1988.tar.bz2 which contains all of the current GNU software of 1988! And what is on that tape?

bison-1.00

gcc-1.21

gdb-2.5.1

gplusplus-1.21

libgplusplus

So this is probably as old as it is going to get, so I downloaded and went to compile bison, however getopt is a missing call! A creative search found getopt.c and even better PCC liked it enough to get a running bison so I could then configure GCC.

Configuring GCC is a manual process, but not too involved:

Make a symbolic link from file `config.h’ to the top-level
config file for the machine you are using. Its name should be
`config-MACHINE.h’. This file is responsible for
defining information about the host machine. It includes
`tm.h’.

Make a symbolic link from `tm.h’ to the machine-description
macro file for your machine (its name should be
`tm-MACHINE.h’).

Make a symbolic link from `md’ to the
machine description pattern file (its name should be
`MACHINE.md’)

Make a symbolic link from
`aux-output.c’ to the output-subroutine file for your machine
(its name should be `MACHINE-output.c’).Make sure the Bison parser generator is installed.Build the compiler. Just type `make’ in the compiler directory.

And in a minute I had GCC compiled. I ran it with -v and got this output:

# gcc -v
ld /lib/crt0.o -lc
Undefined:
_main

It really is nowhere near as featured as 1.21 that is for sure! So time to do a simple hello world program:

I went ahead and tried the oldest version of GAS I could find, 1.19 that identifies as “Gnu assembler version 1.19 (I guess.)”… Anyways it’s very buggy unfortunately. I can compile simple stuff like hello world fine, but trying to build bison it injects blank symbols, when building with GCC, and building with CC it fails to assemble entire blocks.

I guess the solution is to simply use a later version, but I guess it’s worth knowing on 4.2BSD at any rate it doesn’t work that well on the VAX. I suspect it may fare better on the 68020 based SUN-2 kit that I think they used in the FSF in the mid to late 1980s.