【问题标题】:Compiling 32-bit OS X binaries on a 64-bit environment在 64 位环境中编译 32 位 OS X 二进制文件
【发布时间】:2012-11-19 00:12:17
【问题描述】:

在 64 位命令行环境中编译 32 位 Intel OS X 二进制文件涉及什么?是否像添加-m32 标志一样简单?我没有使用 Xcode,但如果需要,可以使用它来安装 gcc 可以使用的库。谢谢你的建议。

【问题讨论】:

    标签: macos gcc compilation 64-bit 32-bit


    【解决方案1】:

    如果您在使用 Apple 的 GCC 实现的 Macintosh 计算机上进行编译,您可以传递的额外选项之一是“-arch”参数。

    The man page 这么说:

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

    【讨论】:

    • i386 是否总是(我的意思是总是)32 位英特尔?
    • AFAIK...除非 AMD 或我不知道的其他英特尔竞争对手正在为 Apple 电脑制造芯片。
    • 好的,我会试一试,看看能找到什么。谢谢。
    • 请更新“手册页”的链接。
    • 完成@Boris; gcc 不再默认在 Mac 上发布,IIRC。 OpenSource contributors are still "working on it" for M1 macs.
    猜你喜欢
    • 1970-01-01
    • 2011-11-26
    • 2013-12-20
    • 2015-09-28
    • 1970-01-01
    • 1970-01-01
    • 2011-08-28
    • 1970-01-01
    • 2014-04-01
    相关资源
    最近更新 更多