Difference between revisions of "Setup Cross Compile For ARM"

From Free Pascal wiki
Jump to navigationJump to search
(updated for 1.9.7 snapshot)
Line 2: Line 2:
 
   
 
   
 
* first, setup a cross compilation environment; you can get more information about this can be found here [http://www.cartel-securite.fr/pbiondi/zaurus/crosscompile.html], here [http://www.nautilus6.org/operation/doc/wide-memo-nautilus6-zaurus-ccenv-setup-00.txt] and here [http://projects.buici.com/arm/cross/].
 
* first, setup a cross compilation environment; you can get more information about this can be found here [http://www.cartel-securite.fr/pbiondi/zaurus/crosscompile.html], here [http://www.nautilus6.org/operation/doc/wide-memo-nautilus6-zaurus-ccenv-setup-00.txt] and here [http://projects.buici.com/arm/cross/].
 +
* install the lastest native fpc
 
* download [ftp://ftp.freepascal.org/pub/fpc/snapshot/v19/arm-linux/arm-linux-fpc.i386-linux.tar.gz FPC 1.9.x ARM] snapshot to somedir
 
* download [ftp://ftp.freepascal.org/pub/fpc/snapshot/v19/arm-linux/arm-linux-fpc.i386-linux.tar.gz FPC 1.9.x ARM] snapshot to somedir
 +
* the archive contains a lib tree which should be extracted to /usr/local
 
<tt>
 
<tt>
cd somedir<br>
+
cd /usr/local; tar -xvzf <path to archive>/arm-linux-fpc.i386-linux.tar.gz
arm-linux-fpc.i386-linux.tar.gz<br>
 
 
</tt>
 
</tt>
* tar contains binary.tar and install.sh
+
* set a soft link to the ppcarm:
 
<tt>
 
<tt>
chmod +x install.sh </tt>(I did not need to do this)
+
ln -s /usr/locl/lib/fpc/1.9.7/ppcarm /usr/local/bin/ppcarm
 
 
* I was root when I did this (may not be necessary)
 
<tt>
 
./install.sh
 
 
</tt>
 
</tt>
* It proposed correctly /usr in my Mandrake 10.0 Official
 
* I answered yes to every question
 
 
* download [ftp://ftp.freepascal.org/pub/fpc/snapshot/v19/arm-linux/binutils.tar.gz FPC 1.9.x ARM binutils] to somedir
 
* download [ftp://ftp.freepascal.org/pub/fpc/snapshot/v19/arm-linux/binutils.tar.gz FPC 1.9.x ARM binutils] to somedir
 
<tt>
 
<tt>

Revision as of 18:31, 6 January 2005

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