Sign in Join
Wiki copytemporary

Cross Compile with FPC for ARM: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Overview
22
3-These instructions cover cross compiling to Linux on ARM. See [[arm-wince]] for instructions on cross-compiling to Windows CE on ARM.
3+These instructions cover cross compiling to Linux on ARM. See [[arm-wince]] for instructions on cross-compiling to Windows CE on ARM.
44
55## Cross compile with FPC for ARM (e.g. Zaurus)
66
7- * First, setup a cross compilation environment; you can get more information about this here [[1]](<http://www.cartel-securite.fr/pbiondi/zaurus/crosscompile.html>), here [[2]](<http://www.nautilus6.org/operation/doc/wide-memo-nautilus6-zaurus-ccenv-setup-00.txt>) and here [[3]](<http://projects.buici.com/arm/cross/>).
8- * Install the lastest native FPC [from sourceforge](<http://sourceforge.net/project/showfiles.php?group_id=89339>)
9- * get an ARM FPC snapshot from the downloads page of [FPC Qt Binding for Zaurus](<http://users.pandora.be/Jan.Van.hijfte/qtforfpc/qtedemo.html>)
10- * Download it to somedir. The name of the tar file may be different of course:
7+- First, setup a cross compilation environment; you can get more information about this here [1](http://www.cartel-securite.fr/pbiondi/zaurus/crosscompile.html), here [2](http://www.nautilus6.org/operation/doc/wide-memo-nautilus6-zaurus-ccenv-setup-00.txt) and here [3](http://projects.buici.com/arm/cross/).
8+- Install the lastest native FPC [from sourceforge](http://sourceforge.net/project/showfiles.php?group_id=89339)
9+- get an ARM FPC snapshot from the downloads page of [FPC Qt Binding for Zaurus](http://users.pandora.be/Jan.Van.hijfte/qtforfpc/qtedemo.html)
10+- Download it to somedir. The name of the tar file may be different of course:
1111
12-```
12+``` bash
1313cd somedir
14- tar zxvf arm-linux-fpc.i386-linux-20050217.tar.gz
14+tar zxvf arm-linux-fpc.i386-linux-20050217.tar.gz
1515```
1616
17- * you will find a 'lib/fpc/1.9.7/units/arm-linux/...' dir. The version may be '1.9.8' or higher.
18- * create FPC library directory structure for FPC in a lib directory on your system
19- * most systems use '/usr/local/lib', some use '/usr'
17+- you will find a 'lib/fpc/1.9.7/units/arm-linux/...' dir. The version may be '1.9.8' or higher.
18+- create FPC library directory structure for FPC in a lib directory on your system
19+- most systems use '/usr/local/lib', some use '/usr'
2020
21-```
21+``` bash
2222mkdir -p /usr/local/lib/fpc/1.9.7/units
23- cp -fr lib/fpc/1.9.7/units/arm-linux /usr/local/lib/fpc/1.9.7/units/
23+cp -fr lib/fpc/1.9.7/units/arm-linux /usr/local/lib/fpc/1.9.7/units/
2424```
2525
26- * copy the FPC cross compiler to its default place
26+- copy the FPC cross compiler to its default place
2727
28-```
28+``` bash
2929cp lib/fpc/1.9.7/ppcarm /usr/local/lib/fpc/1.9.7
3030```
3131
32- * set a soft link to it in a bin dir in your path
33- * most distributions use '/usr/local/bin', some '/usr/bin'
32+- set a soft link to it in a bin dir in your path
33+- most distributions use '/usr/local/bin', some '/usr/bin'
3434
35-```
35+``` bash
3636ln -sf /usr/local/lib/fpc/1.9.7/ppcarm /usr/local/bin/ppcarm
3737```
3838
39- * verify you can call ppcarm; it should return something like '1.9.7' and not 'command not found'
39+- verify you can call ppcarm; it should return something like '1.9.7' and not 'command not found'
4040
41-```
41+``` bash
4242ppcarm -iV
4343```
4444
45- * download [FPC 1.9.x ARM binutils](<ftp://ftp.freepascal.org/pub/fpc/snapshot/v19/arm-linux/binutils.tar.gz>) to somedir
45+- download [FPC 1.9.x ARM binutils](ftp://ftp.freepascal.org/pub/fpc/snapshot/v19/arm-linux/binutils.tar.gz) to somedir
4646
47-```
47+``` bash
4848cd somedir
49- tar zxvf binutils.tar.gz
49+tar zxvf binutils.tar.gz
5050```
5151
52- * copy the 2 programs in the tar to a bin dir in your path
52+- copy the 2 programs in the tar to a bin dir in your path
5353
54-```
54+``` bash
5555cp arm-linux-* /usr/local/bin
5656```
5757
58- * create a 'Hello World' program and compile it
58+- create a 'Hello World' program and compile it
5959
60-```
60+``` bash
6161echo "program hello; begin writeln('Hello World'); end." > hello.pas
62- ppcarm -XParm-linux- hello.pas
62+ppcarm -XParm-linux- hello.pas
6363```
6464
65- * output should be something like this:
65+- output should be something like this:
6666
67-```
68-# ppcarm -XParm-linux- hello.pas
67+ # ppcarm -XParm-linux- hello.pas
6968 Free Pascal Compiler version 1.9.7 [2005/02/17] for arm
7069 Copyright (c) 1993-2005 by Florian Klaempfl
7170 Target OS: Linux for ARM
7271 Compiling hello.pas
7372 Assembling hello
7473 Linking hello
7574 1 Lines compiled, 0.2 sec
76-```
7775
78- * Copy it to the home directory of the user 'zaurus' on your zaurus device.
79- * With an SSH setup this could be as simple as:
76+- Copy it to the home directory of the user 'zaurus' on your zaurus device.
77+- With an SSH setup this could be as simple as:
8078
81-```
79+``` bash
8280scp hello zaurus:/home/zaurus
8381```
8482
85- * Install terminal program on your Zaurus. For a Zaurus SL6000: see manual on CD.
86- * Run the terminal program. On a SL6000 the console will default to user 'zaurus' in its home dir /home/zaurus
87- * Run the program
83+- Install terminal program on your Zaurus. For a Zaurus SL6000: see manual on CD.
84+- Run the terminal program. On a SL6000 the console will default to user 'zaurus' in its home dir /home/zaurus
85+- Run the program
8886
89-```
87+``` bash
9088./hello
9189```
9290
93- * Output should be something like:
91+- Output should be something like:
9492
95-```
96-Hello World
97-```
93+ Hello World
9894
9995---
100-*From the Free Pascal wiki, page "Cross Compile with FPC for ARM", as the Internet Archive kept it on 2022-08-07. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
96+*From the Free Pascal wiki, page "Cross Compile with FPC for ARM", as it stood on 2015-07-14 after a change by FTurtle, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
97+Category: ARM
98+Category: Cross compilation
99+Category: Linux

Back to history