So - for the last few months I have been meaning to get to this, but finally started to look at it over the last week.
For those that don’t know, Retro68 is a project that brings a modern GCC cross compiler that targets legacy Mac Systems, including PowerPC. The compiler will build PEF executables by generating an XCOFF exe that is then converted to PEF with the MakePef tool and can import PEF libraries and link to them through stubs that are created with another tool called “MakeImport”.
So, I knew it would be possible with work to make this all work for BeOS PowerPC becaue I have used the Mac version of the Metrowerks compilers to build BeOS apps before. So, for at the very least, basic C calls like those in libroot.so it is feasible.
I have been working with the author, Wolfgang Thaller of Retro68. You can see the dev log here. He has kindly made a BeOS branch and has altered the MakeImport tool to accept BeOS style PEF libraries.
Still early days, but today I successfully built a simple command line app that links with
libroot.so and can execute
puts(..). This is significant, as it proves that with work, the full standard C functionality will be possible. Hopefully a cross compiler will be able to be made and we will be in a good place to port modern code to BeOS PowerPC.
Hurdles still to jump:
- we currently don’t execute
main(..), we are going to the initial ‘__start()’ function. This will need to be resolved to make standard C compile.
- the MakeImport works for exported C functions, but there are a few quirks… nothing that can’t be fixed. But we will need to find a solution for the C++ side of things.
- BeOS does a lot of extra start-up that seems to be from the MetroWerks codebase… we need to work out if we need any/all of it. I was surprised the basic app I wrote worked, so there is doubtless more to it I don’t yet know about.
I’ll post more progress as it happens, but this is a passion project and so it will probably be slow going till I can compile more modern real world code.
If anyone want to jump in, feel free to join the fun.