[fpc-pascal] Cross compiling Linux to OS X

Jonas Maebe jonas at freepascal.org
Fri Mar 29 17:48:49 CET 2019


On 27/03/2019 22:28, Torsten Bonde Christiansen wrote:
>  > make distclean crossall crossinstall OPT="-O2 -XX -CX -Xs -Xd 
> -Fl/home/epidata/Apple/SDKs/MacOSX10.5.sdk/usr/lib" CPU_TARGET=i386 
> OS_TARGET=darwin BINUTILSPREFIX=i686-apple-darwin10- 
> INSTALL_PREFIX=~/fpc FPMAKEOPT="-o -Aas-darwin"

It surprises me this works with FPC 3.0, as cross-compilation-specific 
options should be passed via CROSSOPT instead of OPT.

Anyway, the non-hacky way to specify a cross-compilation sysroot is with 
-XR instead of -Xd -Fl.

So try this instead:

make distclean crossall crossinstall OPT="-O2 -XX -CX -Xs" 
CROSSOPT="-XR/home/epidata/Apple/SDKs/MacOSX10.5.sdk -Aas-darwin" 
CPU_TARGET=i386 OS_TARGET=darwin BINUTILSPREFIX=i686-apple-darwin10- 
INSTALL_PREFIX=~/fpc

If you split the make invocations into one per command, you can also add 
-j 4 FPMAKEOPT="-T 4" for "crossall" to significantly speed up the process.


Jonas



More information about the fpc-pascal mailing list