Hello-
How do I cross-compile from Lazarus 1.4.2 i386 on OS X 10.10 to a 64-bit application? I have followed the instructions at
http://wiki.lazarus.freepascal.org/Cross_compiling#Cross_compiling_the_LCLand I can successfully build an fpc program to x86_64, but lazbuild and the user interface always create i386. My program is set for the (presumably 64-bit compatible) Cocoa widgetset, and runs fine except is 32-bit. (by the way, the program has only one button with the following onClick:
" {$IFDEF LCLCarbon}
Showmessage('carbon');
{$ENDIF}
{$IFDEF LCLCocoa}
Showmessage('cocoa');
{$ENDIF}
{$IFDEF CPU64}
Showmessage('64');
{$ENDIF}
{$IFDEF CPU32}
Showmessage('32');
{$ENDIF} "
>fpc -Px86_64 test.pas
>./test: Mach-O 64-bit executable x86_64
>./test
DATE 2015/07/21
FPCTARGET x86_64
FPCTARGETCPU x86_64
FPCTARGETOS Darwin
FPCVERSION 2.6.4
lazbuild -B project1.lpr --ws=cocoa --cpu=x86_64 --os=darwin
file ./project1
./project1: Mach-O executable i386
------------
Here is the output of Lazbuild
primary config path: /Users/rorden/.lazarus
TBuildManager.SetBuildTarget Old=i386-darwin-carbon New=x86_64-darwin-cocoa FPC=True LCL=True
TBuildManager.SetBuildTarget Old=x86_64-darwin-cocoa New=x86_64-darwin-cocoa FPC=True LCL=False
TCompiler.Compile WorkingDir="/Users/rorden/Desktop/cocoa/" CompilerFilename="/usr/local/bin/ppc386" CompilerParams=" -Tdarwin -Px86_64 -MObjFPC -Scghi -O1 -g -gl -k-framework -kCocoa -l -vewnhibq -Fi/Users/rorden/Desktop/cocoa/lib/x86_64-darwin -Fu/Developer/lazarus/lcl/units/x86_64-darwin/cocoa -Fu/Developer/lazarus/lcl/units/x86_64-darwin -Fu/Developer/lazarus/components/lazutils/lib/x86_64-darwin -Fu/Developer/lazarus/packager/units/x86_64-darwin -Fu/Users/rorden/Desktop/cocoa/ -FU/Users/rorden/Desktop/cocoa/lib/x86_64-darwin/ -dLCL -dLCLcocoa project1.lpr"
[TCompiler.Compile] CmdLine="/usr/local/bin/ppc386 -B -Tdarwin -Px86_64 -MObjFPC -Scghi -O1 -g -gl -k-framework -kCocoa -l -vewnhibq -Fi/Users/rorden/Desktop/cocoa/lib/x86_64-darwin -Fu/Developer/lazarus/lcl/units/x86_64-darwin/cocoa -Fu/Developer/lazarus/lcl/units/x86_64-darwin -Fu/Developer/lazarus/components/lazutils/lib/x86_64-darwin -Fu/Developer/lazarus/packager/units/x86_64-darwin -Fu/Users/rorden/Desktop/cocoa/ -FU/Users/rorden/Desktop/cocoa/lib/x86_64-darwin/ -dLCL -dLCLcocoa project1.lpr"
TBuildManager.MacroFuncInstantFPCCache /usr/local/bin/instantfpc
RunTool /usr/local/bin/instantfpc "--get-cache"
TBuildManager.MacroFuncInstantFPCCache /Users/rorden/.cache/instantfpc/
TExternalTool.DoExecute Title="Compile Project, CPU: x86_64, Target: project1" Process.CurrentDirectory="/Users/rorden/Desktop/cocoa/" Executable="/usr/local/bin/ppc386" Params:
-B
-Tdarwin
-Px86_64
-MObjFPC
-Scghi
-O1
-g
-gl
-k-framework
-kCocoa
-l
-vewnhibq
-Fi/Users/rorden/Desktop/cocoa/lib/x86_64-darwin
-Fu/Developer/lazarus/lcl/units/x86_64-darwin/cocoa
-Fu/Developer/lazarus/lcl/units/x86_64-darwin
-Fu/Developer/lazarus/components/lazutils/lib/x86_64-darwin
-Fu/Developer/lazarus/packager/units/x86_64-darwin
-Fu/Users/rorden/Desktop/cocoa/
-FU/Users/rorden/Desktop/cocoa/lib/x86_64-darwin/
-dLCL
-dLCLcocoa
project1.lpr
Hint: (11030) Start of reading config file /etc/fpc.cfg
Hint: (11031) End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.6.4 [2014/02/26] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
(1002) Target OS: Darwin for i386
(3104) Compiling project1.lpr
(3104) Compiling unit1.pas
/Users/rorden/Desktop/cocoa/unit1.pas(16,28) Hint: (5024) Parameter "Sender" not used
(9001) Assembling (pipe) /Users/rorden/Desktop/cocoa/lib/x86_64-darwin/unit1.s
(9001) Assembling (pipe) /Users/rorden/Desktop/cocoa/lib/x86_64-darwin/project1.s
(9022) Compiling resource /Users/rorden/Desktop/cocoa/lib/x86_64-darwin/project1.or
(9015) Linking project1
(1008) 72 lines compiled, 1.8 sec
(1022) 3 hint(s) issued
[TCompiler.Compile] end