[fpc-pascal] FPC fixes 3 0 fails to build on linux arm

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Dec 1 22:08:34 CET 2015


On 01/12/15 21:35, Anthony Walter wrote:
> I am attempting to configure Free Pascal 3.0 and Lazarus packages for
> Raspberry Pi and am running into a failure when making fpc.
>
> Here are the steps leading to the failure:
>
> I am starting with a working copy of fpc 2.6.4 linux arm on my Raspberry Pi.

There are
a) the official FPC 2.6.4 for Linux ARM, which is for the ARMEL EABI 
while the Raspberry Pi uses ARMHF EABI (it can run ARMEL EABI binaries 
too, but you quickly get into trouble when you have to link against 
libraries, unless you install ARMEL EABI versions of all libraries too)
b) the FPC 2.6.4 + Debian patches for the ARMHF EABI, which is broken 
and which cannot be used to compile FPC 3.0.0 without disabling the 
optimiser (otherwise you get a crash while compiling the system unit 
with ppc1)

Which version of FPC 2.6.4 are you using?

> I check out fpc branch fixes_3_0 from the free pascal subversion server
>   on my Raspberry Pi.
>
> I change to the fpc folder (containing branch fixes_3_0)and type "make
> all" on my Raspberry Pi.

I guess this means you are using the official FPC 2.6.4, otherwise you 
wouldn't get as far as the errors below. In that case, you must add 
OPT=-dFPC_ARMHF to your make invocation to compile FPC for the ARMHF EABI.

> After about five minutes of build time, the make process stops with the
> following output:
>
> fpmake.pp(49) Warning: "crtend.o" not found, this will probably cause a
> linking failure
> fpmake.pp(49) Warning: "crtn.o" not found, this will probably cause a
> linking failure

That's probably because the compiler is looking for the ARMEL EABI 
versions of these files, which are most likely not installed on your 
system. Make sure to install the "libc-dev" package to get the ARMHF 
versions of these object files.

> /usr/bin/ld: warning: link.res contains output sections; did you forget -T?
> /home/pi/Development/Base/fpc/rtl/units/arm-linux/cprt0.o: In function
> `_haltproc_eabi':
> (.text+0x88): undefined reference to `_fini'
> /home/pi/Development/Base/fpc/rtl/units/arm-linux/cprt0.o: In function
> `_haltproc_eabi':
> (.text+0x90): undefined reference to `_init'

That's as predicted by the warnings above.


Jonas



More information about the fpc-pascal mailing list