Recent

Author Topic: How to crosscompile for ARM  (Read 9314 times)

gromot

  • Newbie
  • Posts: 5
How to crosscompile for ARM
« on: August 03, 2007, 04:03:43 pm »
Hi all,
I am trying to compile simple text mode program and run it on the ARM platform with linux.

I have both - Win2000 and linux Fedora installed on my PC and Lazarus installed for both systems. Under Fedora, when I select gnome, Linux, ARM it still compiles for the PC, not for ARM. What am I doing wrong?

Under Windows when I select the same as above I get message "don't find unit system".

Can anybody help me to run the cross compilation from any of those two systems?

Best regards

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: How to crosscompile for ARM
« Reply #1 on: August 03, 2007, 04:21:01 pm »
I don't think you installed a good cross compiler on windows, that is why you get the message about the missing system unit.

How do you know you are compiling for PC and not for arm?

gromot

  • Newbie
  • Posts: 5
RE: How to crosscompile for ARM
« Reply #2 on: August 03, 2007, 04:27:09 pm »
I can run the executable file under linux on the PC (and it does not work on the target platform).

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: How to crosscompile for ARM
« Reply #3 on: August 03, 2007, 04:30:00 pm »
Can you paste the comand line parameters?

Did you read the buildfaq.pdf. It contains valuable background information.

gromot

  • Newbie
  • Posts: 5
RE: How to crosscompile for ARM
« Reply #4 on: August 03, 2007, 04:43:35 pm »
Here it is:
 -S2cgi -OG1 -TLinux -Parm -gl -vewnhi -l -Fu. -oTestText

There is the button "Test" under the Compiler Options / Code. When I press it the following message appears:'/tmp/testcompileroptions5.pas(1,1) Fata: Syntax error, "BEGIN" expected but "end of file" found'.
At the same time the new tab with the program code appears - named 'testcompileroptions5.pas' and there is no single line of code; it is empty.

I will try to find the buildfaq.pdf now.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: How to crosscompile for ARM
« Reply #5 on: August 03, 2007, 04:54:59 pm »
I am not sure, but the -P parameter is interpreted by the fpc frontend executable, not by the cpu-specific ppcxxx executables.

Either select fpc or ppccrossarm (the arm cross compiler) in envrionment options -> compiler path.

gromot

  • Newbie
  • Posts: 5
RE: How to crosscompile for ARM
« Reply #6 on: August 07, 2007, 12:18:46 pm »
I was trying to select ppc386.exe, ppcrossarm.exe and fpc.exe in the environment options -> compiler path. None of it works.
1. When fpc.exe selected then I get message "Please check the compiler name" when trying to accept the settings in the environment options.
2. ppc386.exe -> compilation fails with message: "can't find unit System" and the line "program Project1" is selected. (see below).
3. ppcrossarm.exe -> compilation fails with message: "can't find unit system used by Project 1" and the line "uses" is selected. Compiling without the section uses returns the same message but the line "begin" is selected.

What can I do with it? I still can not compile anything for the arm processor ;(


program Project1;

{$mode objfpc}{$H+}

uses
  Classes
  { add your units here };

begin
 //
end.

gromot

  • Newbie
  • Posts: 5
RE: How to crosscompile for ARM
« Reply #7 on: August 07, 2007, 05:56:05 pm »
I have finally assembled the pascal file using the ppcarm in the command line. This ppcarm is for linux, I wonder where I can find the same for windows.
But how to compile the normal Lazarus project with GUI? The one I have said about uses only text mode.

 

TinyPortal © 2005-2018