Re: Difference gcc options "-m32" and "-arch i386"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ian Lance Taylor <iant@xxxxxxxxxx> writes:
> info4jpk <info4jpk@xxxxxxxxxxxxxx> writes:
> > Could someone please explain me the difference between the two gcc/g++
> > options "-m32" and "-arch i386"? Is there any difference when used as a
> > compiler or linker flag?
> 
> I quote the friendly manual:
>
>   -m32
>   -m64
[snip]
>   -march=cpu-type
[snip]

I think the OP was asking about m?? and *arch* (arch != march). `arch'
is an apple-specific flag.

I'm not sure that -m?? can be used to produce so-called `universal' or
`fat' binaries, whereas it is completely valid (and somewhat common) to
specify:

  gcc -arch i386 -arch x86_64 test.c

to generate a binary which runs as x86_64 code on that architecture,
but still runs correctly on x86.

If you're always building for a single architecture anyway, I would bet
(but do not know) that it doesn't really matter which you use.

Cheers,

-tom

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux