Fat binary
Encyclopedia : F : FA : FAT : Fat binary
A fat binary (or multiarchitecture binary) is a computer program that is native to multiple instruction set architectures (ISA) and thus can be run on multiple processor types. The usual method of implementation is to include a version of the machine code for each ISA, resulting in a file larger than a normal one-architecture binary, thus the name.
Fat binary support is not commonplace among operating systems; there are several alternatives to solve the same problem, such as the use of an installer program to choose an architecture-specific binary at install time, distributing software in source code form and compiling it in-place, or the use of a virtual machine and Just In Time compilation.
Examples
Apple's Fat Binary
A fat binary scheme smoothed the Apple Macintosh's transition, beginning in 1994, from the 68000 microprocessor to the PowerPC microprocessor. Many applications for the old platform ran transparently on the new platform under an evolving emulation scheme, but emulated code generally runs slower than native code. Applications released as "fat binary" took up more space, but they ran at full speed on either platform. They achieved this by packaging both a 68000-compiled version and a PowerPC-compiled version of the same program into their executable files. The older 68000 code (CFM-68K or classic 68K) continued to be stored in the resource fork, while the newer PowerPC code was contained in the data fork, in PEF format. )
Next's Mach-O format
Fat binaries are a feature of the Mach-O object file format used in NeXT's NeXTSTEP (1989) and OPENSTEP (1993) operating systems. Mach-O allowed software on a NeXT Cube to be compiled and run on an Intel machine running NeXTSTEP, and so on. This solution was originally intended to allow OPENSTEP applications to run on IA-32 and the various RISC platforms it supported.
Mach-O and Mac OS X
Apple Computer acquired NeXT in 1996 and continued to work with the OPENSTEP code. Mach-O became the native object file format in Apple's free Darwin operating system (2000) and Apple's Mac OS X (2001). Under Mac OS X, Mach-O can be used to support multiple variants of an architecture, for instance to have different versions of 32-bit code optimized for the PowerPC G3, PowerPC G4, and PowerPC 970 generations of processors. It can also be used to support multiple architectures, such as 32-bit and 64-bit PowerPC or, as mentioned in the next section, PowerPC and x86.
Apple's Universal Binary
In 2005, Apple announced another transition, from PowerPC processors to Intel x86 processors. Apple promotes the distribution of new applications that support both PowerPC and x86 natively by using fat binary executable files in Mach-O format. Apple calls such programs "Universal Applications" and calls the file format "Universal Binary," perhaps to distinguish this new transition from the previous transition and other uses of Mach-O.
Universal Binary is not necessary for forward migration of pre-existing native PowerPC applications. Pre-existing applications can install and run on the new x86 platform. They execute under emulation by Rosetta, but not as fast as native x86 code. Universal Binary is not necessary for new applications that are compiled to native code for both platforms. Newly published applications can support both PowerPC and x86 by distributing a separate version for each, or a combined version with one installer for each. The obvious cost of Universal Binary is that every installed executable file is bigger. Universal Binary bundles two executable codes into every executable file, even though most of the time only one executable code is useful on any one computer. If disk space were more expensive, there might be cries of software bloat, and fat binary "thinning" utilities (such as GUI wrappers for OS X'slipo command-line application) might be published. The benefits of Universal Binary are harder to identify. Universal Binary gives the user some peace of mind by the implied promise that the application functions exactly the same on both platforms. Universal Binary might allow the user of an x86 computer a fallback option, to force an application to run as the emulated PowerPC version, ignoring the available native x86 code. Universal Binary suggests that executable files could be copied from an x86 machine to a PowerPC machine and execute there unmodified, provided that every related file is also copied. (But copying applications from computer to computer is not common, except for some small stand-alone programs. Normally, the installer has to be run separately on the other computer.) Fat binaries bring a large enabling benefit in cases where an older PowerPC application calls a newer application's libraries, given that Rosetta does not allow an emulated program to call a native x86 library; execution cannot continue unless the called library also contains PowerPC code.
References
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
