FPC program can't load a FPC shared library on armhf-linux (RPi)
Original Reporter info from Mantis: papelhigienico
-
Reporter name: Fabio Luis Girardi
Original Reporter info from Mantis: papelhigienico
- Reporter name: Fabio Luis Girardi
Description:
A program built in FPC can't load a shared library built in FPC, both built to armhf for Raspberry Pi. Tested trying to load the shared library dynamically and statically. When tried to load the shared library dynamically, I tried two ways, one using dynlibs unit and other using dl unit, both resulting the same error.
Tested with various FPC versions:
- FPC 2.6.0 from Raspbian wheezy 2014-06-20 repository
- FPC 2.7.1 from http://freepascal.thaddy.co.uk/raspberrypi.html on Raspbian Wheezy 2014-06-20
- FPC 2.7.1 trunk on Raspbian wheezy 2014-06-20 built using the FPC 2.7.1 from item 2.
-> On both Raspbian settings, dlerror() says that can't load the shared library.
- FPC 2.7.1 from http://freepascal.thaddy.co.uk/raspberrypi.html on latest ArchLinux
-> On ArchLinux, dlerror() says that a Internal Error happened.
On Raspbian, using configurations 1, 2 and 3, a program built in FPC can load a shared library built in GCC without errors.
On Raspbian 2013-05-29-wheezy-ARMEL, program and shared library works fine.
Steps to reproduce:
Compile the attached file on a armhf and run the program "program1".
The gcc library was built with this command line:
gcc -c -Wall -Werror -fpic teste.c
gcc -shared -o libteste.so teste.o
FPC Program and shared library was built with this:
fpc teste.fpr
fpc program1.fpr
Additional information:
On a x86_64-linux and i386-linux, the attached example compile and works fine.
Mantis conversion info:
- Mantis ID: 26454
- OS: linux
- OS Build: latest
- Build: 2.7.1
- Platform: armhf
- Version: 2.6.4
- Fixed in version: 3.3.1
- Fixed in revision: 43162 (#29bdbdba)