[Lazarus] Unable to cross-compile Lazarus applications in Linux from x86_64 to arm target (Raspberry pi 3)
Giuliano Colla
giuliano.colla at fastwebnet.it
Mon Jul 11 14:36:23 CEST 2016
Hi all,
I'm trying to set up my Lazarus in a Linux x86_64 platform to cross
compile for an ARMV7 target (Raspberry pi 3), but I'm unable to make it
work.
The environment is CentOs 6, Linux x86_64, fpc 2.6.4. Both Lazarus 1.4.4
and Lazarus 1.7 (from trunk) give identical results. The target should
be arm-linux.
I believe that my custom fpc.cfg is properly set, because I can
cross-compile a simple console app:
> fpc -Tlinux -Parm -XParm-linux- TestArm.pas
works just fine and generates an arm object file and an arm executable,
which runs on the target.
But up to now, any attempt to cross-compile on Lazarus has failed.
I assume that I should set Target OS = Linux, Target CPU family = arm,
Target processor = ARMV7
But with those parameters the compilation aborts immediately with
"Illegal parameter -CpARMV7"
If I set Target processor = Default, I must add a lot of extra paths to
make it find the sources (why?), but finally it compiles everything, and
properly puts the generated .o and .ppu files in the arm-linux
directories. But the generated .o files are of type ELF x86-64, and then
ld aborts, telling (correctly) that it supports only the arm formats.
With this setup the compiler options are:
>
> -Tlinux -Parm -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Filib/arm-linux
> -Fi/usr/lib64/lazarus/lcl/include
> -Fu../fpc/2.6.4/packages/fcl-process/src
> -Fu/usr/lib64/lazarus/components/lazutils -Fu/usr/lib64/lazarus/lcl
> -Fu/usr/lib64/lazarus/lcl/widgetset
> -Fu/usr/lib64/lazarus/lcl/interfaces/gtk2
> -Fu../lazarus/lcl/units/arm-linux/gtk2
> -Fu../lazarus/lcl/units/arm-linux
> -Fu../lazarus/components/lazutils/lib/arm-linux
> -Fu../lazarus/packager/units/arm-linux -Fu. -FUlib/arm-linux -dLCL
> -dLCLgtk2 -XParm-linux-
>
What I'm doing wrong? What I'm missing?
Any help is greatly appreciated.
Thanks in advance,
Giuliano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160711/a296805d/attachment.html>
More information about the Lazarus
mailing list