Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 508
Rob Kennedy Avatar asked Mar 08 '10 18:03

Rob Kennedy


1 Answers

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.

like image 151
Rob Kennedy Avatar answered Nov 02 '22 12:11

Rob Kennedy