[fpc-pascal] Issue with Linking

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Aug 20 16:11:27 CEST 2015


On 20/08/15 16:03, Chris Moody wrote:
> 
> Assembling dentist
> Linking Dentist
> /usr/bin/ld: warning: link.res contains output sections; did you forget -T?
> /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In
> function `_haltproc_eabi':
> (.text+0x88): undefined reference to `_fini'
> /home/pi/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In
> function `_haltproc_eabi':
> (.text+0x90): undefined reference to `_init'
> Dentist.pas(106) Error: Error while linking
> Dentist.pas(106) Fatal: There were 1 errors compiling module, stopping
> Fatal: Compilation aborted
> Error: /usr/bin/ppcarm returned an error exitcode

Does the compiler also say "Target OS: Linux for ARMHF"?

> That is the result of: fpc Dentist.pas -Fusource/lib
> -Fu/usr/lib/fpc/2.6.4/units/arm-linux

If you need -Fu/usr/lib/fpc/2.6.4/units/arm-linux, that means the
configuration file (/etc/fpc.cfg) has not been generated properly. It
should have been generated when you installed fpc.

Secondly, do you have a file called /usr/lib/arm-linux-gnueabihf/crti.o
? That is the file containing the _init and _fini symbols. FPC for ARMHF
will automatically search /usr/lib/arm-linux-gnueabihf/ for that file if
libc is linked and add it to the linker script.

If you don't have that file, install the libc6-dev package (sudo apt-get
install libc6-dev). I would expect the fpc package to depend on that though.


Jonas



More information about the fpc-pascal mailing list