Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-12

FPC fixes 3 0 fails to build on linux arm

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

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.

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.

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
/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'
fpmake.pp(49) Error: Error while linking
fpmake.pp(49) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Makefile:1658: recipe for target 'fpmake' failed
make[2]: *** [fpmake] Error 1
make[2]: Leaving directory '/home/pi/Development/Base/fpc/packages' Makefile:2616: recipe for target 'packages_smart' failed make[1]: *** [packages_smart] Error 2
make[1]: Leaving directory '/home/pi/Development/Base/fpc' Makefile:2812: recipe for target 'build-stamp.arm-linux' failed make: *** [build-stamp.arm-linux] Error 2

Jonas Maebe
to Anthony Walter: I am attempting to configure Free Pascal 3.0 and Lazarus packages for Raspberry Pi and am…
Anthony Walter wrote 6 lines
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?

Show quoted text 5 lines
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.

Show quoted text 7 lines
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.

Show quoted text 7 lines
/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

Jonas Maebe
to Anthony Walter: Okay, this issue was related to: http://lists.freepascal.org/fpc-devel/2014-October/034592…
Anthony Walter wrote 8 lines
Okay, this issue was related to: http://lists.freepascal.org/fpc-devel/2014-October/034592.html The solution was: make all OPT="-dNO_THREADING -Fl/usr/lib/arm-linux-gnueabihf -Fl/usr/lib/gcc/arm-linux-gnueabihf/4.6"

1) you don't need -dNO_THREADING
2) those -Fl paths are detected automatically by fpmake if your system is set up properly (in particular, a C compiler is installed) and if you are building the correct EABI variant of the compiler

The above is a hack that papers over the real problems, and should not be used to just hide them.

Jonas

Mark Morgan Lloyd
to Jonas Maebe: 1) you don't need -dNO_THREADING 2) those -Fl paths are detected automatically by fpmake…
Jonas Maebe wrote 14 lines
On 01/12/15 22:08, Anthony Walter wrote: > Okay, this issue was related to: > > http://lists.freepascal.org/fpc-devel/2014-October/034592.html > > The solution was: > > make all OPT="-dNO_THREADING -Fl/usr/lib/arm-linux-gnueabihf > -Fl/usr/lib/gcc/arm-linux-gnueabihf/4.6" 1) you don't need -dNO_THREADING 2) those -Fl paths are detected automatically by fpmake if your system is set up properly (in particular, a C compiler is installed) and if you are building the correct EABI variant of the compiler

The -Fl might be needed for older versions of Raspbian. They aren't needed for the current release, as I noted here a couple of days ago when I reported a successful build.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]