This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: m68k MacOS target support?


Michael Sokolov wrote:
> 
> I can't say anything for sure until I get the sources for Stan Shebs' two ports
> and get answers to the questions about the C library and the headers, but it
> looks like as the m68k port maintainer I'll be able to create a UNIX-hosted
> MacOS-targeting port with very little additional work beyond what I would have
> to do anyway for other projects that interest me, and thus it would be
> imprudent for me as the m68k port maintainer not to do so. This port would be
> very good from the GNU viewpoint (full proper current GCC and Binutils), but
> would do very little from the Mac viewpoint other than letting you call MacOS
> APIs yourself with no involvement from the compiler. I would use Cygnus Newlib,
> and all of its free-standing embedded functionality would be fully working,
> which is great, but not being a Mac programmer and having no interest in the
> actual Mac business, I'm the wrong guy to ask for things like implementing
> UNIX-like open, read, write, console I/O, etc. on top of MacOS or for hosting
> on MacOS.

I'm afraid it won't be quite that simple.  You still have to conform to the
Mac ABI, which has a very particular format for function calls, variable
refs, and so forth.  Also, much of the functionality, such as opening a
window, is only available through traps which have to be passed arguments
in particular registers (which seemed like a great idea for personal computers
ca 1980 when all this was first designed...).  Since there's no console
equivalent on Macs, you can only do stdio by providing your own console
library, similar to MPW's SIOW or MW's Sioux libraries, which are proprietary,
there may be a free one out there by now.

> I wonder, how would this compare to what most proprietary Mac compilers offer
> in terms of the C library? (I'm not a Mac person and have never used any, so I
> don't know.) Do they offer free-standing functions that are better or worse
> than Cygnus Newlib? Do they offer open, read, write, etc. on top of the MacOS
> filesystem?

The MacOS these days includes literally about 9,000 functions in its API.
There are many flavors of open, read, write, etc from which to choose!
The API headers include all the weird extensions though, so even building
the little Unix boot programs sucks you into supporting the extensions.

If you want to discuss the details further, they get pretty arcane, so I'd
suggest continuing in private email.

Stan

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]