Re: [fpc-devel] assumed bug in the RTL with ARM v5 regarding loadingdynamic libraries

2013-01-23 Thread Yury Sidorov

From: Michael Schnell mschn...@lumino.de

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.


It seems you have libdl statically linked to your executable. That's 
why you have such linker errors. Probably the linker is unable to find 
libdl.so but finds only libdl.a


Anyway static linking should work too, but you need to link with libc. 
If you get segfaults when linking to libc, then cprt0.as for arm-linux 
is buggy.


Yury Sidorov. 
___

fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] assumed bug in the RTL with ARM v5 regarding loadingdynamic libraries

2013-01-23 Thread Michael Schnell

On 01/23/2013 10:00 AM, Yury Sidorov wrote:
It seems you have libdl statically linked to your executable. 

Is this what
{$linklib c}
does ?

I just copied it from dl.pp in the svn.
That's why you have such linker errors. Probably the linker is unable 
to find libdl.so but finds only libdl.a
I can't believe that the linker should automatically search for 
potentially usable dynamic libraries: in fact it does not know on which 
machine the program is supposed to run.


Anyway static linking should work too, but you need to link with libc. 
If you get segfaults when linking to libc, then cprt0.as for arm-linux 
is buggy.


I installed the TAR distribution of fpc and the libraries, so I assume 
a compiled version of cprt0.as came from same.


the svc version of /linux/arm/cprt0.as contains this


.type   _init,%function
.type   _fini,%function
.weak   _init
.weak   _fini


So it does not seem to _require_ the symbols to be provided.

Anyway, there is nothing I can do about cprt0 :-( .

-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] assumed bug in the RTL with ARM v5 regarding loadingdynamic libraries

2013-01-23 Thread Sven Barth

Am 23.01.2013 10:50, schrieb Michael Schnell:


That's why you have such linker errors. Probably the linker is unable 
to find libdl.so but finds only libdl.a
I can't believe that the linker should automatically search for 
potentially usable dynamic libraries: in fact it does not know on 
which machine the program is supposed to run.
That's normal on ELF based systems: all libraries need to be known at 
link time (at least as long as you don't load them dynamically at runtime).


Regards,
Sven
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] assumed bug in the RTL with ARM v5 regarding loadingdynamic libraries

2013-01-23 Thread Michael Schnell

On 01/23/2013 11:12 AM, Sven Barth wrote:
That's normal on ELF based systems: all libraries need to be known at 
link time (at least as long as you don't load them dynamically at 
runtime).


I see. But automatically using a library statically when the dynamic 
version is not found does not seem to be appropriate.


-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel