Setup Cross Compile For ARM

From Free Pascal wiki
Jump to navigationJump to search

Cross Compile with FPC for ARM (e.g. Zaurus)

  • first, setup a cross compilation environment; you can get more information about this can be found here [1], here [2] and here [3].
  • install the lastest native fpc
  • download FPC 1.9.x ARM snapshot to somedir
  • the archive contains a lib tree which should be extracted to /usr/local

cd /usr/local; tar -xvzf <path to archive>/arm-linux-fpc.i386-linux.tar.gz

  • set a soft link to the ppcarm:

ln -s /usr/locl/lib/fpc/1.9.7/ppcarm /usr/local/bin/ppcarm

tar zxvf binutils.tar.gz

  • tar contains arm-linux-as arm-linux-ld

cp arm-linux-* /usr/bin
echo "program hello; begin writeln('Hello World'); end." > hello.pas
ppcarm -XParm-linux- hello.pas

  • my output was:
Free Pascal Compiler version 1.9.3 [2004/04/05] for arm
Copyright (c) 1993-2004 by Florian Klaempfl
Target OS: Linux for ARM
Compiling hello.pas
Assembling hello
Linking hello
1 Lines compiled, 0.1 sec

  • copy it to your zaurus. I have ssh setup so just scp hello zaurus:
  • install terminal program on your Zaurus. For a Zaurus SL6000: see manual on CD.
  • run terminal program

su
chmod +x hello
(I did not need to do this)
./hello

  • my output was:
Hello World