byteworksinc / ORCA-C

Other
80 stars 7 forks source link

[feature request] Would it be possible to run the compiler on a PC as a cross compiler? #76

Open Fabrizio-Caruso opened 2 years ago

Fabrizio-Caruso commented 2 years ago

If I have understood well this is only a native C compiler. Are you considering the possibility to have this compiler also work as a cross compiler? I am asking this because other similar projects like ACK or CC6303 can be built both as native and cross compilers. If this were possible, it would make coding so much easier and convenient.

MikeW50 commented 2 years ago

Not really. The compiler is written in ORCA/Pascal and assembly.

I did a translation years ago for MPW on the Mac. That one compiled in MPW Pascal. If someone wanted to put in (or pay for) the effort, that one could be ported to some generally available Pascal.

Mike's iPhone

On Apr 22, 2022, at 2:13 AM, Fabrizio Caruso @.***> wrote:

 If I have understood well this is only a native C compiler. Are you considering the possibility to have this compiler also work as a cross compiler? I am asking this because other similar projects like ACK or CC6303 can be built both as native and cross compilers. If this were possible, it would make coding so much easier and convenient.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

sheumann commented 2 years ago

Note that ORCA/C (and other ORCA languages and shell programs) can be run on modern systems using the Golden Gate compatibility layer. This effectively allows ORCA/C to be used as a cross compiler, even though it is native IIGS code.

Given that Golden Gate is available, I have not considered it a priority to make a version that runs natively on modern systems, and I have no particular plans to do so. That said, it would potentially be possible if someone wanted to do the work. As Mike mentioned, the MPW version might be useful as a basis, although it is out of date with respect to changes in more recent versions of ORCA/C.

Fabrizio-Caruso commented 2 years ago

@sheumann my goal is to add support for an ANSI C (C89 even without floats) compiler for the Apple IIgs into my universal vintage WORA framework Cross-Lib (https://github.com/Fabrizio-Caruso/CROSS-LIB), which already supports about 200 different targets and more than a dozen compilers. In order for this to be able, I would need to be able to run the compilation through a shell in a POSIX environment (Cygwin, Linux, FreeBSD, etc.). So does the solution that you suggest allow me to compile and link C programs from a Unix shell or Cygwin/Windows?

sheumann commented 2 years ago

If you have Golden Gate installed and ORCA/C installed under it, then you can run ORCA/C on a modern Windows/Linux/Mac system by using ORCA commands prefixed by iix (e.g. iix compile ...). It also provides a command called occ, which is a wrapper used to invoke ORCA/C with a cc-like command-line interface. See the Golden Gate documentation for details.

ksherlock commented 2 years ago

A number of years back I ported MPW Orca C to compile with Free Pascal so it can be done. I thought of it as a bit of a dead end since the other utilities to go along with it (linker, assembler, resource compiler, etc) are still missing.