How can I compile 64-bit Mac programs with Free Pascal?

旧城冷巷雨未停 提交于 2019-12-06 22:23:15

问题


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.

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


回答1:


According to Jonas Maebe on the fpc-pascal mailing list, there are two options:

  • Run fpc with the -Px86_64 option. (The -P option does not appear to be documented yet.)
  • Run ppcx64 directly instead of fpc. (Without any options, fpc runs ppc386 instead.)

Both worked for me.




回答2:


Use -m64.

Actually, the GNU Pascal documentation does not even state that it is supported on Mac OS X. FreePascal, on the other hand, works on all Mac OS X variants (Intel and PPC, 32 and 64 bits).



来源:https://stackoverflow.com/questions/2403662/how-can-i-compile-64-bit-mac-programs-with-free-pascal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!