Subject: Re: X-compiling (was style guide)
To: Peter Svensson <>
From: Bill Studenmund <>
List: current-users
Date: 03/08/1996 13:08:43
On Fri, 8 Mar 1996, Peter Svensson wrote:

> On Thu, 7 Mar 1996, Bruce Albrecht wrote:
> > J.T. Conklin writes:
> >  > We'd like to make it possible for NetBSD to be compiled with pre-ANSI
> >  > compilers.
> > 
> > I know this was discussed to death a couple of months ago, but... Can
> > gcc be compiled with a pre-ANSI compiler?  Is it possible to bootstrap
> > gcc, and then build the rest?  For that matter, how many platforms out
> > there still don't have an ANSI compiler available for them?  I see
> > nothing wrong with backwards-compatibility as long as it's truly
> > necessary, but I wonder if it's really necessary anymore.

It was my understanding that the reason gcc has two stages of compiler 
generation is so that gcc can be compiled on a K&R system. The first 
stage (note: it's been a year; my terminology might be a bit off) 
compiler for gcc is made to be tolerant of all sort of grossnesses of the 
default system cc. It is good-enough to then come along and make the real 
gcc in the second stage. Or so I recall.

> Better yet, make it easy to cross compile from a computer running NetBSD 
> to another. 
> We have a few MicroVAX II stuffed away, which we would love to run NetBSD.
> It would be a lot more fun if we could compile things on another computer
> though. 

The reason I was looking at gcc was we have an NCR file server which was 
shipped w/o a c compiler, so I wanted to make gcc for it. gcc has the 
capability (and documentation suport) for cross-compilation, so I think 
the only things we'd need for the cross-compilation you describe is the 
right abstraction of compilers. I.E. the DESTDIR setup needs to know that 
there are (possibly) 3 compilers: cc for compiling on the host for the 
host, cc for compiling on the host for execution on the target, and cc 
for compiling on the target for execution on the target.

compiler	runs on			generates code for
cc_a		host				host
cc_b		host				target
cc_c		target				target

So a compile would build cc_b, put it somewhere off of DESTDIR, and then 
use cc_b to compile everything, including cc_c.

I'm not in a position to play with this much, but I am interested as I'd 
like to (eventually) help w/ the powerPC port, and such a setup would let 
me leverage off of my working NetBSD system.

Someone on the port-mac68k list has set this part up by hand, and is 
compiling the world off of an RS/6k running AIX. The only problem, 
besides everything being quite manual (AFAI can tell), is/was getting 
config to run under AIX.


Take care,