From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::INFO-GCC-REQUEST" 23-AUG-1989 00:21
To:	MRGATE::"ARISIA::EVERHART"
Subj:	cross-gcc: a report

Received: by life.ai.mit.edu (4.1/AI-4.10) id AA05618; Tue, 22 Aug 89 19:48:39 EDT
Return-Path: <info-gcc-request@prep.ai.mit.edu>
Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA05554; Tue, 22 Aug 89 19:41:54 EDT
Received: by tut.cis.ohio-state.edu (5.61/4.890725)
	id AA11867; Tue, 22 Aug 89 16:49:48 -0400
Received: from USENET by tut.cis.ohio-state.edu with netnews
	for info-gcc@prep.ai.mit.edu (info-gcc@prep.ai.mit.edu)
	(contact usenet@tut.cis.ohio-state.edu if you have questions)
Date: 21 Aug 89 16:27:43 GMT
From: mcvax!cernvax!roberto@uunet.uu.net  (roberto bagnara)
Organization: CERN, Geneva, Switzerland
Subject: cross-gcc: a report
Message-Id: <1051@cernvax.UUCP>
Sender: info-gcc-request@prep.ai.mit.edu
To: info-gcc@prep.ai.mit.edu



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
