From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 27677 invoked from network); 7 Mar 1999 07:06:06 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 7 Mar 1999 07:06:06 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id CAA31943 for ; Sun, 7 Mar 1999 02:00:47 -0500 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.8/8.8.8) id AAA23959 for axp-list@redhat.com; Sun, 7 Mar 1999 00:00:42 -0700 From: Michal Jaegermann Message-Id: <199903070700.AAA23959@ellpspace.math.ualberta.ca> Subject: Re: libcmpl vs libffm !!!! To: axp-list@redhat.com Date: Sun, 7 Mar 1999 00:00:42 -0700 (MST) In-Reply-To: <19990306012353.A29909@twiddle.net> from "Richard Henderson" at Mar 6, 99 01:23:53 am Content-Type: text 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