Apple's gcc, what's the difference between -arch i386 and -m32?

According to Apple's gcc 4.2.1 doc:

-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)

So what's the difference between these two calls:

gcc -arch i386 program.c


gcc -m32 program.c

Is it just that -arch is more powerful as it's more flexible and can produce universal binaries when specifiying multiple archs?


I'm not sure but from reading the man page I get to similar conclusions as you do.

I guess the only real difference is that -arch can be used to create universal binaries.

As this works to create universal binaries

gcc -arch i386 -arch x86_64 foo.c

but you actually can't be sure what the semantics of the following should be (they probably are even invalid syntax). Especially the third should be invalid as the man pages says to generate for for 32- or 64-bit environments.

gcc -m32 -arch i386 -arch x86_64 foo.c
gcc -m64 -arch i386 -arch x86_64 foo.c
gcc -m32 -m64 -arch i386 -arch x86_64 foo.c
    Generate code for a 32-bit or 64-bit environment.  The 32-bit environment
    sets int, long and pointer to 32 bits and generates code that runs on any
    i386 system.  The 64-bit environment sets int to 32 bits and long and
    pointer to 64 bits and generates code for AMDs x86-64 architecture.
    For darwin only the -m64 option turns off the -fno-pic and 
    -mdynamic-no-pic options.

-arch //already included in question

Need Your Help

How would I add a title before the ul using wp_nav_menu?

wordpress menu

I need to add a title to my menu, which is being built by wp_nav_menu...something like this:

Implementing claims-based security (WCF/ASP.NET)

wcf-security saml federated-identity geneva-framework sts-securitytokenservice

After researching on the topic of claims-Based security (or a federated security model). I've been coming across many examples that use CardSpace as an example. The main article that I read that ga...