[Coco] Announcement : Nitros-9 C compiler tool cross chain for Linux

Walter Zambotti zambotti at iinet.net.au
Tue Apr 28 21:38:19 EDT 2020


I just spent several hours trying to get the Nitros9 C tool chain working under mingw.

The very sad news is while it all compiles cleanly it will never run without extensive modification.

There are two main problems both are incompatibilities with Windows.

The first is the path format.  The tool chain is OS9 based and expects paths with forward slashes and explicitly looks for that.  When run under mingw it creates paths with back slashes and worse prepends the device letter (C:) to the path.

The second problem is worse.  When run under mingw it spits out all output with the wrong line terminators.  The apps are specifically looking for OS9 line terminators. This is very ingrain into the code and would require an extensive modifications.

If you run the output of each stage through a conversion to modify the path strings and convert the line format then yes it works.

The only chance of getting this going in Windows is in Cygwin.

Walter


-----Original Message-----
From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Walter Zambotti
Sent: Monday, 27 April 2020 4:02 PM
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Subject: [Coco] Announcement : Nitros-9 C compiler tool cross chain for Linux

I managed the get the full C tool chain working.

Here is the readme from the github site:

https://github.com/WallyZambotti/Nitros9-CC-CrossCompiler

Linux CC cross compiler for (CoCo) Nitros-9

It contains:

- cc2.5.3 : c front end
- cprep19 : c preprocessor
- c.comp : c compiler
- c.opt - (c) rma asm optimizer
- rma(r63) - relocating macro assembler
- rlink - linker
- ansifront - ANSI C to K&R preprocessor

It has been successfully compiled and tested on Ubuntu 18.04 (AMD).

All Linux binaries produced are 32bit.  Some binaries are required to be compiled with no optimization or they will fail.  Be warned if you change the make files.

It is known to work on Intel (AMD) platforms.

This C compiler tools chain produces binaries compatible with:

  Nitros-9 (MC6809 or HD6309).

A test directory is provided that contains a dd directory.  You should place the Linux executables in the dd/cmds directory and create a symbolic link from /dd to that directory:

  $ sudo ln -s ~/Nitros9-CC-CrossCompiler/test/dd /dd

And add the cmds directory to your path:

  $ PATH=$PATH:/dd/cmds

Some libraries and defs files are also provided under the test/dd/lib & test/dd/defs directories.  You can add more by copying them from a Nitros-9 distribution.

You will then be able to compile Nitros-9 C programs with the same instructions as normally used under Nitros-9:

  $ cc253 -A -s helloworld.c -f=helloworld
  $ cc253 main.c sub1.c sub2.r mylib.r -f=myprog
  
The provided example in the test directory can be compiled with:

  $ cc253 -A -s texturebm.c gfxlib.c gpulib.c -f=texturebm

(However this example program will only run on the OVCC emulator with the MPU device installed in one of the MPI slots.)

When copying the executables to Nitros-9 (either real or emulator) for execution remember to set the execute attributes:

  $ attr myprogram e pe


--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list