[Lazarus] Unable to cross-compile Lazarus applications in Linux from x86_64 to arm target (Raspberry pi 3)

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Jul 14 00:37:51 CEST 2016


On Wed, 13 Jul 2016 19:36:23 +0200
Giuliano Colla <giuliano.colla at fastwebnet.it> wrote:

> Il 13/07/2016 14:06, Mattias Gaertner ha scritto:
>[...]
> fpc->ppcarm 2.6.4
>[...]
> Assembler /home/colla/Applicazioni/lazarus/fpc/binutils/as not found?
>[...]
> Copying and pasting all the compiler options from Lazarus "View options" again works just fine: fpc  -Tlinux -Parm -CpARMV7 -MObjFPC -Scghi -O1 -g -gl -Xg  -k-L/home/colla/Applicazioni/lazarus/fpc/libcross -l -vabq -Fi/home/colla/Applicazioni/Raspberry/Cross/lib/arm-linux -Fu/home/colla/Applicazioni/lazarus/lcl/units/arm-linux/gtk2 -Fu/home/colla/Applicazioni/lazarus/lcl/units/arm-linux -Fu/home/colla/Applicazioni/lazarus/components/lazutils/lib/arm-linux -Fu/home/colla/Applicazioni/lazarus/packager/units/arm-linux -Fu/home/colla/Applicazioni/Raspberry/Cross/ -FU/home/colla/Applicazioni/Raspberry/Cross/lib/arm-linux/ -dLCL -dLCLgtk2 -XParm-linux- fcllaz.pas >out3.txt
> When the compile or build is launched from within Lazarus (1.4.4 and 1.7 behave the same), it fails with "Assembler not found".

Check that the IDE uses the same PATH variable as your terminal.
Instead of "fpc" try using "ppcarm" with full path in the IDE.
Instead of "View Options", right click in Messages window on the red
header line / About. This gives you the actual parameters of the
TProcess instance.

> If I move in the proper place .o's and .ppu's obtained with manual compilation I can proceed one step further, but next compilation fails for the same reason.

Also make sure you have enough memory. Compiling in the IDE needs more
memory.


> My wild guess has been that Lazarus doesn't pass all the required options to the compiler, or maybe not in the proper order.
> Unfortunately, even setting -va, when compiling from lazarus the resulting messages (even Save All) are much more concise than the raw compiler output, and it's rather hard to understand what goes wrong.

Probably stdout vs stderr.


> I resorted to launching lazarus from command line and redirecting the output to a file.
> One can see something but is it the full story? I enclose the lazout.txt file where it would appear that the options passed to FPC aren't as complete as desirable (-CpARMV7 has disappeared, and so -XParm-linux- which are both required by FPC). Is that the reason?

I'm not an arm expert.

Mattias


More information about the Lazarus mailing list