Hacker News new | ask | show | jobs
by johndoe0815 1384 days ago
Would it be possible to create a true universal binary that also runs on NeXT/Openstep on 68k, SPARC, PA-RISC and x86 as well as Rhapsody on PPC and x86?
1 comments

This requires some investigation. Technically, I believe it is possible if the following 2 conditions are met:

1. The Mach-O executable format was not changed between all those OS versions (likely).

2. It is possible to gather sub-binaries for one CPU type but different OS types (less likely).

And SDK's and compillers (in emulator or on hardware) are required to try.

> Apple already documents that you could have a five-way binary

But enough about my private life. You're making us blush

I had a closer look at the earliest available NeXTstep version (0.8) running in the previous emulator - I still need to refurbish the MO drive in my Cube to run it natively (I have a 68030 CPU board)... C and ObjC compilers (though the objc.exe (!) provided seems to be a source-to-source compiler) are included in the image available on winworldpc and I can compile the included demo source code.

It seems that this early version is significantly different from later NeXTstep (3.3) and OpenStep versions. For example, it does not use app bundles. System apps installed in the /Apps folder, such as Terminal, are simple Mach-O executable m68k binaries.

If we wanted to target such an early NeXTstep, in addition, the source code of TinyClock would have to be changed significantly. One problem is that early versions of AppKit used "NX" instead of "NS" prefixes. More difficult is that a number of classes used by TinyClock seem to be unimplemented - not even NSString (resp. NXString) seems to be available. More complex classes such as NSCalendarDate or NSBezierPath also seem to be a later addition (unless the 0.8 install image is missing some header files, the earliest documentation I could find was on 1.0).

So it seems that a completely universal binary is out of the question, unfortunately.

1 is true, 2 is not.