[fpc-devel] Install fpc and Friends on a non-Debian ARM-Linux Device

Thomas Schatzl tom_at_work at gmx.at
Mon Jan 21 12:42:24 CET 2013


Hi,

On Mon, 2013-01-21 at 11:26 +0100, Michael Schnell wrote:
> Hi experts. (Beware: long explanation trying to help those ho try 
> something similar. A question is asked at the end.)
> 
> I am trying to install, test and run fpc programs on a QNAP 219 P II NAS.
> [...]
> But first I tried to install and use fpc.
>
> Here the initial problem is, that the device uses a mildly QNAP 
> propriety Linux distribution. Same comes with installation tools for 
> it's own package format (".qpkg") moreover you can install Optware 
> ".ipkg" packages, as there is a qpkg for Optware. .
> 
> But for fpc there is neither a qpkg not an ipkg package. AFAIK for ARM 
> there only is an Debian "apt-get" package for fpc and friends. Same is 

I already mentioned times that there is a .tar based installer provided
by the fpc team which can be downloaded from the fpc website. Or at
least the freepascal ftp.

> said to happily be useable on a "Raspberry Pi" with similar resources as 
> the QNAP 219 P II.

Use the tar installer of the fpc release you want. I.e. at
ftp://ftp.freepascal.org/pub/fpc/dist/2.6.0/arm-linux/ you can get an
official 2.6.0 installer for arm.

If you need a version from trunk (not sure if needed for e.g. lazarus),
use the installer from
ftp://ftp.freepascal.org/pub/fpc/snapshot/v27/arm-linux-armel/

Or ftp://ftp.freepascal.org/pub/fpc/snapshot/v26/arm-linux-armel/ for
the latest 2.6.1 snapshot.

The latter two are generated daily.

> So I tried to find the appropriate ".deb" files
> 
> I found the downloadable Debian package here:
> 
> http://packages.debian.org/squeeze/armel/fp-compiler/download -> 
> http://ftp.de.debian.org/debian/pool/main/f/fpc/fp-compiler_2.4.0-2_armel.deb

Don't use files from squeeze, squeeze is really outdated. It contains
the 2.4 compiler as you can see. Use the "wheezy" stuff (or the current
testing branch) if you need.

And, even easier, download the fpc installer from the fpc website.

> Now I can compile the project, but linking it does not work:
> ================================================================================
> [/share/Public/heizarm] # fpc heiz.lpr
> Free Pascal Compiler version 2.4.0-2 [2010/02/20] for arm
> Copyright (c) 1993-2009 by Florian Klaempfl
> Target OS: Linux for ARMEL
> Compiling heiz.lpr
> Compiling inifiles.pp
>[...]
> /usr/lib/fpc/2.4.0/units/arm-linux/rtl/cprt0.o: In function 
> `_haltproc_eabi':
> (.text+0x88): undefined reference to `_fini'
> /usr/lib/fpc/2.4.0/units/arm-linux/rtl/cprt0.o: In function 
> `_haltproc_eabi':
> (.text+0x90): undefined reference to `_init'
>
> I found, that _fini and _init *should* be provided by crti.o which is 
> not included in the packages I installed. And I don't know how to find 
> out which package might provide it.
> 

The crt* files providing the _init and _fini symbols are from libc.
Install libc-dev (iirc) using ipkg.

I.e. ipkg install libc-dev

You also want binutils (which you apparently already have installed). If
you want to compile fpc or lazarus, you also need the "make" package.
This should be everything needed to get started.

With that you can build lazarus yourselves. There may be unresolved
dependencies on some libraries still. Please ask in the Lazarus mailing
list/forum about compiling lazarus and particularly its dependencies.

Thomas




More information about the fpc-devel mailing list