manojkumarsure / quadra

Automatically exported from code.google.com/p/quadra
0 stars 0 forks source link

Quadra endianness and Mac Universal Binary #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is just a reminder-issue: will Quadra run correctly on Intel Mac if 
built by a PPC mac and/or vice-versa?
Do we have Universal Binary compilation enabled?
Are the config file and 'res' file endian-compatible between platforms?

Original issue reported on code.google.com by rveill...@gmail.com on 23 Apr 2008 at 12:22

GoogleCodeExporter commented 9 years ago
That is an excellent question, actually. Didn't think of it. :-)

A PPC binary should run correctly on Intel, maybe a little bit slow (under 
Rosetta),
but it ran okay on my old 486, so that shouldn't be too much of a problem. If 
built
on Intel, it should be an "universal binary" (ah, good old fat binaries 
returns!),
and I'm not entirely sure of how to make one with gcc/ld, but it should be a 
checkbox
somewhere in Xcode. If it's only an Intel binary, it won't run at all on PPC.

For the config file, it shouldn't be too much of a problem, even if it's written
backward, it'll be read backward too on the same machine.

The resource file, though, is another thing. I doubt it'll work correctly... The
resources themselves should be fine, but there are few other things in the 
resource
file. Let's have a look...

Oh! dgryski rules the day! The thing is peppered with INTELWORD()s. Ironically, 
it
looks like it's just missing the one for the signature. Heh.

Original comment by pphaneuf on 23 Apr 2008 at 3:02

GoogleCodeExporter commented 9 years ago
And the signature is kept as a character array, so it looks okay. For testing, 
I took
the quadra.res generated on my Linux/Intel machine, and used it on my Mac OS 
X/PPC
machine.

Original comment by pphaneuf on 25 Apr 2008 at 3:48

GoogleCodeExporter commented 9 years ago
For future reference, you can pass "-arch ppc -arch i386" to Apple's gcc (the 
one
provided with Xcode) while compiling and linking, and it will produce "fat" 
object
files and binaries.

I don't remember if I tested with a PPC binary on my Intel Mac, that *should* 
work
fine, but should check...

Original comment by pphaneuf on 6 May 2009 at 8:36