[Self-interest] Self on PPC

Valery Ushakov uwe at stderr.spb.ru
Sat Feb 18 20:51:06 UTC 2023

I have spent a couple of evenings kicking the source tree to get it to
compile on NetBSD/macppc, hoping for some low-hanging fruits to fall.
I see from the history that the port was removed but then David rolled
that change back, so I guess it's not entirely unwanted.

I pushed the results to github:


This branch is off the feature/netbsd-i386 branch that Russell might
hopefully merge to dev.

The changes are confined to the ppc subdir except for bringing back
ppc support in cmake files and one small tweak to netbsd-specific
kludge in allocation.cpp.  These changes should not affect i386 builds
in any way.

One manual kludge I have to use to build the tree is to compile only
the search_ppc.cpp file with -maltivec - my cmake-fu is non existent,
so I don't know how to do express that properly.

(I tried to keep macosx/ppc parts intact.  I guess I can eventually
set up macos on an external drive - I have the retail dvd for the last
version that supported ppc - and see if it compiles, but I guess the
demand for that is vanishingly small and I'd rather sink my not so
copious free time into making it actually work on netbsd. :)

The resulting binary doesn't work - not that I expected it to.  After
I had time to look past the surface level problems of making it to
compile, I see that the frame code is written for the macos ABI:

  Inside Macintosh: Introduction to PowerPC System Software, 1-44

so of course that doesn't work on ELF ABI with a different stack frame

Adapting to ELF ABI (while, ideally, not breaking macos) is a bit too
much for my current time budget.  I realize there's probably not much
practical demand for the working ppc port, but doing these changes was
quick and easy, didn't break anything (hopefully) and that leaves it
in a batter shape. So on an off chance that someone might be
interested in picking this up, the tree is in a mostly buildable
state.  Broken windows theory and all that...


More information about the Self-interest mailing list