苹果的gcc,-arch i386和-m32有什么区别?
-拱形拱形
针对指定目标进行编译 建筑拱门。允许的 值为“i386”、“x86_64”、“ppc”和 'ppc64'。多种选择有效,并且 指示编译器生成 包括对象的“通用”二进制文件 指定每个架构的代码 与-arch。此选项仅在以下情况下有效 汇编器和库可用 对于每个指定的架构。 (仅限苹果)
这两个调用之间有什么区别:
gcc -arch i386 program.c
那么
gcc -m32 program.c
是否只是 -arch 更强大,因为它更灵活,并且在指定多个 arch 时可以生成通用二进制文件?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定,但通过阅读手册页,我得到了与您类似的结论。
我想唯一真正的区别是
-arch
可用于创建通用二进制文件。因为这可以创建通用二进制文件
,但实际上您无法确定以下内容的语义应该是什么(它们甚至可能是无效的语法)。特别是第三个应该是无效的,因为手册页说要为 32 位或 64 位环境生成。
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
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.