[fpc-devel] assumed bug in the RTL with ARM v5 regarding loading dynamic libraries
Michael Schnell
mschnell at lumino.de
Wed Jan 23 09:33:52 CET 2013
Hi fpc RTL experts.
My project uses Synapse but features link problems and crashes when I
resolve same.
Tracking this down:
Synapse uses the unit dynlibs
dynlibs uses the unit dl
dl does not have a "uses" clause, so the problem seems to be here.
When in a dedicated test project I just do "uses dl", I get the linker
message about _fini and _init, that I feature with any use of Synapse.
This can be resolved by
{$I crti.o}
and copying crti.o from /lib in my system to the project directory.
crti.o supposedly came with the libc-devel package that had been fetched
when installing gcc.
But now the compiled program results in a segfault before the first line
of user code (a writeln) is executed, and before a line of code in
Synapse had been executed. .
In fact I have neither any clue why Synapse wants to access a dynamic
library called "libiconv", (a converter between multiple ASCII and ANSI
codes) nor why the code that loads dynamic libraries needs any "CRT"
stuff. But Synapse is not easily modified avoiding the initialization of
dynamic library access. (Maybe I should try to do dummy a dl.pp. )
In /rtl/unix/dl.pp there is:
{$if defined(linux) and defined(cpuarm)}
{ arm-linux seems to require this }
{$linklib c}
{$endif}
So in may testing program, instead of
uses dl and
"{$I crti.o}
I do
{$linklib c}
This results in the linker message about _fini and _init
This can be cured by adding
{$I crti.o}
And I have the segfault again
It looks like a bug in the RTL file /rtl/unix/dl.pp
It would be great if anybody could fix this issue.
If anybody confirms that this might be a bug and not a result of my
silliness, I will do a Mantis entry.
-Michael
More information about the fpc-devel
mailing list