[fpc-pascal] Linking error with unit initc on arm

Martin Schreiber mse00000 at gmail.com
Fri Aug 21 12:47:08 CEST 2015


On Friday 21 August 2015 11:55:49 Jonas Maebe wrote:
[...]
> As mentioned in the "Issue with linking" thread, you will have to
> separately tell FPC where to find crtbegin.o and crtend.o, as their
> location depends on the GCC version used. Since the sysroot path (-XR
> parameter) should be prepended to any search paths specified after the
> -XR parameter, make sure this path is relative to the sysroot. Use
> FPC's -va parameter to see which search paths get added exactly in
> case of problems (and possibly use -Cn and inspect the generated
> ppas.sh and link.res).
>
Thanks.
The missing "_fini" and "_init" symbols from rtl/linux/arm/cprt0.as which 
cause the linking error are defined in one of the crt*.o files? The linker 
does not try to load crt*.o files:
"
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/bin/ld: warning: 
link.res contains output sections; did you forget -T?
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/cprt0.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/cprt0.o
attempt to open rpiconsole.o succeeded
rpiconsole.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/system.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/system.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/lineinfo.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/lineinfo.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/exeinfo.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/exeinfo.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/strings.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/strings.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/objpas.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/objpas.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/initc.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/initc.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/ctypes.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/ctypes.o
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/unixtype.o 
succeeded
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/unixtype.o
attempt to open ./libc.so failed
attempt to open ./libc.a failed
attempt to open /usr/local/arm-linux-gnueabihf/lib/libc.so failed
attempt to open /usr/local/arm-linux-gnueabihf/lib/libc.a failed
attempt to 
open /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib//libc.so 
succeeded
-lc (/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib//libc.so)
ld-linux-armhf.so.3 needed 
by /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib//libc.so
found ld-linux-armhf.so.3 
at /home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib//ld-linux-armhf.so.3
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/cprt0.o: 
In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/home/mse/packs/standard/svn/fp/arm/install_3_0//eabihf/lib/fpc/3.0.1/units/arm-linux/rtl/cprt0.o: 
In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
"
Interesting is that adding "xlib" to uses is enough to build working eabihf 
applications by cross compiling to Raspberry Py.

Martin



More information about the fpc-pascal mailing list