Universally Fat Binaries

Mach-O supports fat files, officially called universal files by Apple. These let you have PowerPC, Intel, and the 32-bit and 64-bit flavors of each kind of code in the same file. This allows for a single application or a single framework to service all the computing worlds.

Fat binaries from the command line

You can use gcc on the command-line, or in makefiles, to generate object code for any of the supported architectures. You can also build the final fat binaries using these command-line tools.

gcc’s -arch flag controls which architecture(s) it should build. For Mac OS X, you can give -arch the ppc, i386, ppc64, and x86_64 flags. iOS is an ARM architecture, so you would use armv6 or armv7 if you were constructing ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.