如何使用 Free Pascal 编译 64 位 Mac 程序? [英] How can I compile 64-bit Mac programs with Free Pascal?
问题描述
我的 Mac 上有一个由 GCC 编译的 x86_64 库,我想将它与使用 Free Pascal 2.4 编译的 Pascal 代码链接起来.我给 fpc
提供什么选项以使其生成 64 位代码?没有任何选项,我只能得到 32 位 .o 文件.
I have an x86_64 library on my Mac compiled by GCC, and I want to link it with Pascal code compiled with Free Pascal 2.4. What options do I give to fpc
to make it generate 64-bit code? Without any options, I only get 32-bit .o files.
我使用的是从 SourceForge 下载的 fpc-2.4.0.intel-macosx.dmg,但是当我运行 fpc -i
时,唯一的目标 Macintosh 平台它列出的是Darwin for i386",尽管 2.4 发行说明说它可以针对64 位 Mac OS X (x86_64/ppc64)".
I'm using the fpc-2.4.0.intel-macosx.dmg download from SourceForge, but when I run fpc -i
, the only target Macintosh platform it lists is "Darwin for i386," although the 2.4 release notes say it can target "64-bit Mac OS X (x86_64/ppc64)."
推荐答案
根据 Jonas Maebe 在 fpc-pascal 邮件列表,有两个选项:
According to Jonas Maebe on the fpc-pascal mailing list, there are two options:
- 使用
-Px86_64
选项运行fpc
.(-P
选项似乎尚未记录.) - 直接运行
ppcx64
而不是fpc
.(没有任何选项,fpc
运行ppc386
.)
- Run
fpc
with the-Px86_64
option. (The-P
option does not appear to be documented yet.) - Run
ppcx64
directly instead offpc
. (Without any options,fpc
runsppc386
instead.)
两者都为我工作.
这篇关于如何使用 Free Pascal 编译 64 位 Mac 程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!