Difference between revisions of "Setup Cross Compile For ARM/id"

From Free Pascal wiki
Jump to navigationJump to search
(New page: == Kompilasi Silang dengan FPC untuk ARM (misalnya Zaurus) == * Pertama, siapkan lingkungan kompilasi silang; anda bisa memperoleh informasi mengenai ini di sini [http://www.cartel-secur...)
(No difference)

Revision as of 20:22, 27 September 2007

Kompilasi Silang dengan FPC untuk ARM (misalnya Zaurus)

  • Pertama, siapkan lingkungan kompilasi silang; anda bisa memperoleh informasi mengenai ini di sini [1], di sini [2] dan di sini [3].
  • Instalasi fpc asli terbaru dari sourceforge
  • dapatkan arm fpc snapshot dari halaman download pada FPC Qt Binding untuk Zaurus
  • Download ke somedir. Nama file tar bisa berbeda tentunya

cd somedir
tar zxvf arm-linux-fpc.i386-linux-20050217.tar.gz

  • you will find a 'lib/fpc/1.9.7/units/arm-linux/...' dir. The version may be '1.9.8' or higher.
  • create FPC library directory structure for fpc in a lib dir on your system
  • most systems use '/usr/local/lib', some use '/usr'

mkdir -p /usr/local/lib/fpc/1.9.7/units
cp -fr lib/fpc/1.9.7/units/arm-linux /usr/local/lib/fpc/1.9.7/units/

  • copy the fpc cross compiler to its default place

cp lib/fpc/1.9.7/ppcarm /usr/local/lib/fpc/1.9.7

  • set a soft link to it in a bin dir in your path
  • most distributions use '/usr/local/bin', some '/usr/bin'

ln -sf /usr/local/lib/fpc/1.9.7/ppcarm /usr/local/bin/ppcarm

  • verify you can call ppcarm, it should return something like '1.9.7' and not 'command not found'

ppcarm -iV

cd somedir
tar zxvf binutils.tar.gz

  • copy the 2 programs in the tar to a bin dir in your path

cp arm-linux-* /usr/local/bin

  • create a 'Hello World' program and compile it

echo "program hello; begin writeln('Hello World'); end." > hello.pas
ppcarm -XParm-linux- hello.pas

  • output should be something like this:
 # ppcarm -XParm-linux- hello.pas
 Free Pascal Compiler version 1.9.7 [2005/02/17] for arm
 Copyright (c) 1993-2005 by Florian Klaempfl
 Target OS: Linux for ARM
 Compiling hello.pas
 Assembling hello
 Linking hello
 1 Lines compiled, 0.2 sec

  • Copy it to the home directory of the user 'zaurus' on your zaurus device.
  • With a ssh setup this could be as simple as:

scp hello zaurus:/home/zaurus

  • Install terminal program on your Zaurus. For a Zaurus SL6000: see manual on CD.
  • Run the terminal program. On a SL6000 the console will default to user 'zaurus' in its home dir /home/zaurus
  • Run the program

./hello

  • Output should be something like:
Hello World