如何使用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.
我正在使用 fpc-2.4.0.intel-macosx.dmg 从SourceForge下载,但是当我运行 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屋!