This page is here to serve as a place to find information about running gcc as a cross-compiler for the TRS-80 CoCo series.
If you really want to do this, go to this site, as the guy who's maintaining it now is much more serious about than I ever was.
The direct source of these files is at this place, although I have modified some of them to be updated to gcc 3.1.1.
Please click on the sourceforge.net icon above, the latest version of these files can always be found in CVS there.
If you're looking for some other 6809 development tools, you can try this site, as it seems to cover the bases pretty well.
My CoCo page is here, and you can reach me here.
There are no typos in command entries, and descriptions in <> are meant to be replaced with the path described. This page is being written way past my bedtime :), but that I'm sure of. The instructions and language may be incoherent, but the commands are pristinely wonderful.
The version here has a rather serious flaw. When compiling certain source files, it will fail, and complain about an 'unrecognizable insn' at the end of a function. This is fixed in my latest version, which will be posted shortly, along with a libc supporting printf.
First, you need to download a stock gcc 3.1.1 distribution from either
ftp://ftp.gnu.org/gnu/gcc/ or one of its mirrors. Extract it into a directory
where you want to have the sources (for convenience, we'll call it
The archive is 25 MB, and includes a lot of stuff
not related directly to CoCo (or even C/C++) development, but hey, it's free otherwise.
Once you have unpacked the archive (it takes about a minute or so on my 400Mhz G4 PowerMac), you need to apply a couple of patches, and extract an archive:
patch -p0 <<location of m6809-gcc.diff>
patch -p0 <<location of macosx-gcc-3.1.1.diff>
tar xzvf<location of gcc6809-3.1.1.tar.gz>
../gcc-3.1.1/configure --target=m6809 --program-suffix=09 --nfp --enable-obsolete
make cross LANGUAGES="c proto c++"
The process WILL fail when trying to build
libgcc1.a. This is normal. Do not be worried,
later steps will replace it. On with the show:
make LANGUAGES="c proto c++" install
cp xgcc /usr/local/m6809/bin/gcc
ln -s /usr/local/m6809/bin/gcc /usr/local/bin/gcc09
And again, you'll get errors with
libgcc1.a. Again, not to worry. If you
want to test that everything installed well, try
gcc09 -v at the command line.
You'll get some info about the gcc you just built.
Right now, you don't have a working tool chain, you just have the compiler. You could generate object files, maybe, but at this point, you have nothing of any use. You need the assembler, the linker and the runtime files. So download, unpack and build asm-6809 and crt0-coco, following the instructions within the archives. These are almost 100% unmodified from the versions at the site mentioned above.
Also available is a quick, dirty and mostly useless port of libc. No IO stuff is included, simply some basic routines. It's just enough to get gcc to produce a binary, although it does include some math routines that might be useful. There are headers for unimplemented features, simple because I forgot to take them out. :) The sources come from the Thomson gcc page mentioned above, all I modified was the Makefile.
Any mention of thomson, don't worry. It's the name of the machine these tools were originally configured for. However, I looked them over, and they're pretty platform-independant. In other words, it'll work for the CoCo.
Well, and here we get to one of the unfinished parts, the linker will not generate RS-DOS .BIN files (not sure about OS-9 executables, though). It will, however, generate s19 binaries. There's an s19 converter at this place that should do the trick. It works on the CoCo end of things. I haven't tested it.
This works on the unix end of things, and converts an s19 file into a CoCo .BIN. I've used it with great success, and I may just hold on to using that for RS-DOS binaries. However, it would be nice to integrate this into the linker.
Boisy Pitre is woking on OS-9 support, and he can be contacted through the sourceforge.net project page for gcc-coco.
I'll be working on the libc port for RS-DOS when I have the time, and perhaps RS-DOS .BIN support. .DSK support might also be nice, and I may add it, or leave it to someone else.
Note: the best place to grab these files is to get them from CVS from the sourceforge.net project.
© 2003 James Dessart