Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 468301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:40:05+00:00 2026-05-12T23:40:05+00:00

According to Apple’s gcc 4.2.1 doc : -arch arch Compile for the specified target

  • 0

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

and

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?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:40:06+00:00Added an answer on May 12, 2026 at 11:40 pm

    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
    
    -m32
    -m64
        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
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know it might not be according to Apple's human interface guidelines for the
According to Apple's description, the aurioTouch sample app is suppose to get the audio
According to Apple , two to three letter prefixes should be used when naming
According to apple my application has to be able to run in both portrait
According to Apple's docs, Subclasses need not override -[UIView drawRect:] if the subclass is
According to Apple , the iPhone 4 has a new and better screen resolution:
I have MAC OS 10.6 (Snow Leopard) and according to Apple's guide on HTTP
i have a application i put Default.png for splash screen according to apple's documentation.the
According to Apple's website, the iPhone 4 is 960-by-640-pixel resolution at 326 ppi. I
According to Apple if one doesn't create an object using alloc or new then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.