[fpc-pascal] Issue with Linking

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Aug 21 00:16:40 CEST 2015


Chris Moody wrote:
> To further add to the confusion, I found my Raspberry did not have
> locate installed, so I asked apt-get to get a copy and it obtained:
>
> Unpacking locate (from .../locate_4.4.2-4_armhf.deb) ...
>
> I did locate https://blogs.oracle.com/jtc/entry/is_it_armhf_or_armel and
> going by Jim's blog I'm running an armhf system.
>
> So I don't know what I have :(.

That indeed suggests you have an armhf system. I really don't get why 
it's installing an ARMEL compiler. Please file a bug with Raspbian about 
that.

You can bootstrap an armhf 3.0 compiler on an armel system, but it's a 
bit tricky:
1) install the armel compiler (you already did that
2) build FPC with OPT="-dFPC_ARMHF" FPCMAKEOPT="-dNO_THREADING"

This last parameter removes the libc dependency from fpmake, so it won't 
need the _init and _fini symbols. It does not remove threading support 
from the RTL itself, so that's fine.

This way, FPC 3.0 should build successfully, and you should end up with 
an FPC 3.0 ARMHF compiler. You can verify it by running 
"./fpcsrc/compiler/ppcarm -l nonexisting.pp" afterwards and checking 
that it says it targets ARMHF.

If that is the case, install it in a subdirectory of your home directory 
(make ... install INSTALL_PREFIX=$HOME/somedir), create a symbolic link 
from $HOME/somedir/bin/ppcarm to $HOME/somedir/lib/fpc/3.0/ppcarm, add 
$HOME/somedir/bin to the front of your path, and finally add the 
following lines to ~/.fpc.cfg

#ifdef VER3_0
-Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/home/pi/somedir/lib/fpc/$fpcversion/units/$fpctarget/rtl
#endif

That should enable you to use both "fpc" and "ppcarm" to compile 
programs using this newly built FPC 3.0.


Jonas



More information about the fpc-pascal mailing list