macos - 在 64 位环境中编译 32 位 OS X 二进制文件

标签 macos gcc compilation 64-bit 32-bit

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

最佳答案

如果您使用 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)

关于macos - 在 64 位环境中编译 32 位 OS X 二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13650888/

相关文章:

c - 使用 shark 启动带有参数和配置文件的进程

php - 如何在 Xampp Mac 上安装 Memcached

mysql - 在 Mac OS X 服务器上升级 MySQL

gcc - 未识别 GEN 变量 - PARI 库 C

c - 这些无用的 assembly 线从何而来?

c - 编译器警告消息

python - 如何在终端 Mac 上使用 python 3

c++ - 将指针传递给成员函数可以在 MinGW-w64 中编译,但不能在 gcc 中编译

c - 是否可以更改 x64 的 gcc 中的调用约定?

c# - Visual Studio 2010 创建编译代码的应用程序