From: hyc@hanauma.jpl.nasa.gov (Howard Chu)
Subject: Re: Sozobon (or other free C's): would this strategy work?
Organization: SAR Systems Development & Processing, JPL
Distribution: comp
Date: Tue, 5 Jan 1993 22:30:44 GMT

In article <1993Jan5.023237.18823@cs.yale.edu> bobf@flint.geology.yale.edu (Bob Fischer) writes:
>J R Evans (ngse18@castle.ed.ac.uk) wrote:
>: I week or so back, I offered the suggestion that it might be a
>: reasonably modest task to convert Sozobon C (a fairly small K&R C for
>: the Atari) to work on the Mac.  There has been some follow-up
>: discussion....
>
>The outlined strategy may work, but I'm not so sure it's a good idea.
>If I were going to port a C to the Mac, I'd do GNU C, and port it "the
>right way".  Sure it's huge, but as you said, memory on the Mac isn't
>such a big deal anymore.  The smallest Mac you can buy nowadays is 2
>Mbytes, more than adequate for GCC.  My reasons for this assessment
>follow:

>* GCC runs on many systems, including a zillion flavors of UNIX,
>MS-DOS, and the Atari ST.  Therefore, a program written in GCC is more
>likely to work on other systems than a program developed with _any_
>other C compiler (like, say, SUN's compiler, or Mark Williams C).  A program
>written with one GCC need only be compiled by another GCC to provide an
>easy port.  Potential problems of hidden compiler incompatibilities
>between systems are eliminated.

Not necessarily, some brain-dead CPU architectures still require weird
machine-specific #pragma's to control their behavior. (Look at the i386
support for GCC, for a notable example...)
>
>* GCC is backed by the Free Software Foundation.  This is not a
>program which will lose support when one or two people taking care of
>it decide to do something else.  (I know.  I wrote The Vault, and now

As others have already mentioned, the FSF is vehemently opposed to having
GNU software ported to Apple platforms.

>* Finally, the most compelling reason is that I think that GCC would
>be the easiest to port!  GCC was written in a modular way, so that it
>can be ported to any system, running any instruction set.  What
>porting it consists of is describing, in GCC's machine-description
>language, the properties of your computer's instruction set.  The code
>generators and optimizers use this information to generate code for
>your computer.  Adding a new machine description to GCC does does not
>eliminate the possibilities for GCC to generate code for other
>machines.  (This means that GCC can be easily used as a cross-compiler
>--- build the standard distribution to run on one system, but to
>produce code for another.)  Since someone has already described the
>68000 instruction set to GCC, you would just have to modify the
>description, to make it work with the Mac quirks (like the special
>status of A5).  To encourage people to port GCC, Richard Stallman
>(author of GCC) has written a 190-page manual describing in detail how
>to port GCC.  I don't believe any other program comes with such
>carefully written porting instructions.

It probably would be pretty simple to customize the m68k description to
support the Mac. Especially given that the Atari ST port now also uses
a global data pointer (I chose a4 instead of a5; TOS clobbers a5 during
a Supexec call). However, I don't see any reason to undertake this port.
What's the ultimate purpose of this effort, just to have a freeware C
compiler on the Mac?
-- 
  -- Howard Chu @ Jet Propulsion Laboratory, Pasadena, CA

There's a rough border between genius and insanity, but I'm a dual citizen.
Newsgroups: comp.sys.mac.programmer