[gnu.gcc] cross-gcc: a report

roberto@cernvax.UUCP (roberto bagnara) (08/21/89)

I've successfully turned GCC 1.35 into a cross-compiler currently hosted
on VAXes both under VMS and Ultrix 3.0, and targeted to the 680x0 family
of microprocessors. The assembly code produced by GCC is processed by
M68020, the CERN assembler producing CUFOM (CERN Universal Format for
Object Modules), whose syntax is exactly the one you can find in the
Motorola User's Manual for the CPU's.

Furthermore the produced code follows the CERN convention for programming
the 680x0 (caller saves registers, use of the frame pointer, stackframe
layout etc.).

This has been possible just by:

	a) writing a new tm-m68k-cern.h file, that includes tm-m68k.h
	b) slightly modifying out-m68k.c
	c) writing m68020-asm.c, a new module containing some functions
	   needed to output assembly code digestable by M68020
	   (MOVEM wants a list of registers, declaring external symbols
	   is compulsory etc.)

and by:

	d) adding 1 line to final.c
	e  modifying 3 lines in cccp.c

in the next article whose subject is "cross-gcc: two possible changes", I
suggest a reasonable and easy way to remove modifications d) and e).
So, basically it has been possible to produce an ad-hoc (CERN syntax,
CERN convention) cross-compiler from the native version modifying only
the target dependent modules.

I think that this is a big achievement, many of you will remember a lot
of messages like

	"I'm desperately looking for a public-domain/free/not-too-expensive
	C cross-compiler for the XYZZY processor..."

flowing on the net. Maybe now the general problem of finding a good
C cross-compiler for some not-too-strange microprocessors has been solved.
Thanks to RMS and to all the people who contributed efforts to GCC.

If somebody is interested and needs more info, he shouldn't hesitate to
contact me. If nobody is interested, my apologies for having posted that.
Cordially

                  Roberto Bagnara
                  Data Handling Division
                  CERN
                  CH-1211 GENEVA 23