Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling 32-bit OS X binaries on a 64-bit environment

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.

like image 932
Alex Reynolds Avatar asked Nov 30 '12 18:11

Alex Reynolds


1 Answers

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)
like image 160
Michael Dautermann Avatar answered Sep 22 '22 07:09

Michael Dautermann