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 find here: [[1]] and here: [[2]].
  • download FPC 1.9.3 ARM snapshot to somedir

cd somedir
tar xvf fpc-1.9.3.arm.tar

  • tar contains binary.tar and install.sh

chmod +x install.sh (I did not need to do this)

  • I was root when I did this (may not be necessary)

./install.sh

  • It proposed correctly /usr in my Mandrake 10.0 Official
  • I answered yes to every question
  • download FPC 1.9.3 ARM binutils to somedir

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