Apple Universal Binary Question
Posted by Scott Laird Wed, 08 Jun 2005 17:05:00 GMT
So, with Apple’s new “Universal” binary format, where Xcode creates programs that will run natively on both PPC and x86 chips, is there actually a single Mach-O file that contains code sections for both processor types, or are there two different executable files hiding inside of an application bundle?
Apple’s documentation kind of implies that the two architectures are stuffed into a single binary:
You can force a command line tool to run translated by entering the following in Terminal:
ditto -arch ppc tool /tmp/<toolname> /tmp/<toolname>
There only other statement that I see in the documentation that gives any details is this little gem:
Note: Xcode has per-architecure SDK support. For example, you can target Mac OS X v10.3 for PowerPC while also targeting Mac OS X v10.4.1 for Intel.
Between the two statements, it seems pretty likely that the PPC and x86 binaries are crammed into the same file, but probably don’t share static strings or any of the other parts of the executable file. They’re really just two distinct program files combined into a single physical file.
Are any other details on the universal binary process public yet?

I saw a screencap of someone running ‘file’ (I think - it might have been something else) on a universal binary, but I can’t seem to find the reference now.
They definitely are shoving both architectures in a single file.
-tim
“Universal” really is just a new name for the good old Fat binaries. But apparently, “Fat” is out.
As to PPC binaries for 10.3, I have succesfully created a Fat (Universal) binary consisting of a gcc4 binary for x86 and a gcc3 binary for PPC. Because as well all know (or didn’t), ggc4 binaries work only with 10.3.9 and up. And some of my code is designed to run even on 10.2. For Intel that does not matter as we will never see 10.2 for that architecture.
Everything about fat binaries can be found in
man lipo, send me an eMail if you need more info (don’t send it to “stuff”, but to “alex” instead).Bye
Alex