Personal tools
You are here: Home downloads Gem Documentation GemFAQ How do I make fat binaries?
Document Actions

How do I make fat binaries?

Up to Table of Contents

This FAQ applies to: Any version.

I'd like to create multi-arch (aka: fat) binaries

multi-arch binaries (aka "fat" or "universal" binaries) are only possible on OSX.

super simple solution:

  • pass the --enable-fat-binary flag to Gem's configure. by default, this will create fat binaries for PowerPC (ppc) and MacIntel (i386)
  • you can also specify the architectures, e.g. --enable-fat-binary=x86_64 will create a "fat" binary with one architecture (MacIntel 64bit)

using compiler/linker flags:

  • add "-arch " (multiple times, if you need multiple architectures) to your compiler & linker flags; really, the super simple solution does exactly that behind the scenes
  • e.g. adding -arch i386 -arch x86_64 to your CXXFLAGS and LDFLAGS will create fat binaries to run on MacIntel 32bit and 64bit

generating fat binaries from non-fat binaries:

  • sometimes it is simpler to merge a number of non-fat binaries into a single fat binary
  • using lipo for this:
        lipo -create <file1> <file2> <...> -output <file>
    
  • e.g.:
        lipo -create ppc/Gem.pd_darwin i386/Gem.pd_darwin ia64/Gem.pd_darwin -output Gem.d_fat
    
by IOhannes m zmoelnig last modified 2011-11-29 06:43 PM

Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser