[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: libcmpl vs libffm !!!!



Richard Henderson wrote:
> 
> On Mon, Apr 11, 2135 at 08:23:48PM +0100, Jochen Kuepper wrote:
> > I just found a static lib yet :-( Is there a shared libcmpl ?
> 
> The one nice thing about defaulting to PICish code...
> 
>   ld -shared --whole-archive libcpml.a --no-whole-archive -lc -o libcpml.so
> 

There is a small fly in this ointment.  A conversion is indeed performed
but when I tried to link something with such shared library I got:

/usr/local/lib/libcpml.so: undefined reference to `_OtsMulX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsCvtXQ'
/usr/local/lib/libcpml.so: undefined reference to `_OtsCvtQX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsLssX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsDivide32Unsigned'
/usr/local/lib/libcpml.so: undefined reference to `_OtsDivX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsNeqX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsSubX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsLeqX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsDivide64Unsigned'
/usr/local/lib/libcpml.so: undefined reference to `_OtsDivide64'
/usr/local/lib/libcpml.so: undefined reference to `_OtsAddX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsDivide32'
/usr/local/lib/libcpml.so: undefined reference to `_fpdata'
/usr/local/lib/libcpml.so: undefined reference to `_OtsConvertFloatTX'
/usr/local/lib/libcpml.so: undefined reference to `_OtsGtrX'
collect2: ld returned 1 exit status

while linking with a static library was ok.

A short investigation revealed that libcpml.a indeed contains a bunch
of functions which reference those unresolved symbols above.  The catch
is that these are functions you are not likely to call and if you do
then you will see the same "undefined reference" - at least for now. :-)
In a shared library all these symbols end up in _GLOBAL_OFFSET_TABLE_
and this makes 'ld' very unhappy.

In other words - it seems that first you have to use 'ar' to remove
from libcpml.a all offending functions and only then you may convert.
I did not try that yet but it should work (the famous last words :-).

(Later - indeed "the famous".  I missed a presence of _fpdata
which you cannot delete that way and which is still 'U' in a working
program linked with libcpml.a.  Can somebody explain what is really
going on here? It does not seem to be resolved by other libraries
but maybe I miss something.)


  Michal



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []