6

What is involved in compiling 32-bit Intel OS X binaries on a 64-bit command-line environment? Is it as simple as adding a -m32 flag? I'm not using Xcode, but could use it to install libraries that gcc could use, if needed. Thanks for your advice.

Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345

1 Answers1

8

If you're compiling on a Macintosh computer using Apple's implementation of GCC, one of the extra options you can pass along is the "-arch" parameter.

The man page says this:

-arch arch
   Compile for the specified target architecture arch.  
   The allowable values are i386, x86_64, ppc and ppc64.  
   Multiple options work, and direct the compiler to produce "universal" 
   binaries including object code for each architecture specified with -arch.  
   This option only works if assembler and libraries are available 
   for each architecture specified.  (APPLE ONLY)
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215