Work Stuff

Here is a complete archive of everything you should need to get gcc to compile for ppc. It runs under Warpup and was put together from various sources. Starting with the GeekGadgets May 98 CD then adding the files from egcs-2.91.66. Then updating with the files from 2.95.1, and new includes from Jarmo Laakkonen. Finally I recompiled the entire thing to get a new driver and some C++ stuff that was missing.

To benefit from all my hard work just download the archive below and untgz to GG:. The compiler is called ppc-amigaos-gcc, to produce an executable you have to also run elf2exe2 on the output of the compiler though.

ppc-amigaos-gcc -o prog.warpelf prog.c
elf2exe2 prog.warpelf prog.exe

Keep the .warpelf file for debugging purposes as elf2exe2 strips all the debug info while converting it to amiga-hunk format. A useful tip for debugging is to get the offset for which the exception/enforcer hit occurred and use

ppc-amigaos-objdump -l --source --start-offset=0x? --stop-offset=0x? prog.warpelf
The start and stop addresses should be slightly before and after the target address and you should end up with the assembler instructions and the C source that generated them, if you compiled with debugging info on that is.

You should have an up to date ixemul.library to run this, v48.0 is the last version on aminet and has some bugs which show up quite often when trying to use the cross-compiler. I have v48.1 which fixes some but not all of the bugs, unfortunately I only have a version for 060s at the moment. Please update to at least v48.1 before reporting bugs if you can, you can download it from here. There are still some problems with this version though, some ppc commands never return and have to be CTRL-C'ed. If this happens just run the prog again and it usually works second time around, very strange. I'm looking into this and hope to have a new version soon.

Note, this is the second version of ppc-amigaos-gcc 2.95.1 I have put up. The first version contained some old includes which should be deleted because they interfere with calling OS functions. The offending files are in GG:os-includeppc/ so delete everything in that directory.

The compiler produces Warpup executables but can be made to produce Powerup executables in theory by adding the -pup option to the command line and replacing the elf2exe2 command with Protect prog.exe +e to make it run. However, it has been pointed out to me that in practice this doesn't actually work. I don't use powerup though and so I'm not going to bother trying to fix this. If you find the problem though, tell me and I'll add the fix to my site (as long as it doesn't break Warpup :-).

ppc-amigaos-gcc 2.95.1

When compiling C++ you should add -liostream to the link stage aswell.

Steffen Hauser has just sent me an archive to update gcc to 2.95.2, I have not installed it as I've only just got 2.95.1 working to my satisfaction and don't have the source for 2.95.2 but if you want you can use it.
Download ppc-amigaos-gcc 2.95.2 update
You will have to tell the driver to use the new version as there is no new driver, so run it with

ppc-amigaos-gcc -V 2.95.2

With the help of Peter Annuss I have found a workaround for the stdio relative path problem. If you find fopen failing to open files in parent dirs then try this fix. It is simply to remove the unix->amiga path conversion routine which doesn't appear to work properly by adding

const char *__amigapath(const char *path)
{
    return (path);
}

to one of the source files. If you need the support for unix paths then stick your own conversion code in there or use mine.

If you need help with setting up gcc for either m68k or ppc then I might be able to help so email me.

Finally, I would like to say a big thankyou to Peter Annuss (aka Paladin) for creating this cross-compiler, he has obviously put a lot of work into this.


Back to Homepage


Last Updated: 28/04/2000