Up Prev Next
From: Christopher Jobson <jobson at sybase dot com>
Subject: static / dynamic linking of sybperl and relationship to other packages
Date: Nov 27 1995 5:47PM
I am no great expert on the usage of packages, and hope someone else has bumped
into this problem and has a solution !
My platform is Sun4 / SunOS 4.1.3. I am using perl5.001e and sybperl-2b3.
Basically, I am trying to build a package that will sit alongside sybperl
and also provide an API for accessing DBlib calls (in much the same way that
Sybase::DBlib provides an API for accessing DBlib). I want to be able to
use BOTH my package (which is called 'Sybase::review') AND 'Sybase::DBlib'.
My motivation for doing this is that I need to access a library (libreview.so)
that is also used elsewhere (ie. NOT from perl).
So, from perl I will have calls to routines with names like review_open(),
review_close() etc. I have a 'use Sybase::review;' call in the relevant place.
I have built the necessary review.pm, review.xs etc. files and installed them
I will thus be accessing two sharable libs : libsybdb.so and libreview.so.
Of course, I also have the XS-related sharable objects that REFER to these
two libs. These have the names review.so and DBlib.so. Note also that the
libreview.so library ALSO refers to libsybdb.so.
However, I run into problems with respect to the Dynamic loader, which
about problems with a message along the lines of :
Can't load '/remote/cpetools/dse/lib/perl5/sun4-sunos/auto/review/review.so'
module review: ld.so: conflicting usage of dlopen'ed dependents at
ools/dse/lib/perl5/DynaLoader.pm line 128.
It seems that this happens when the loader (via dlopen()) tries to pull in
a second sharable library (in this case ../review/review.so) which refers to
an underlying sharable library (libsybdb.so) which is ALSO referenced via an
earlier dlopen(). Ie. if we do
then, if both packages use libsybdb, we get the above warning. Interestingly
enough, this problem does NOT happen if I build and link on HP.
Can someone suggest a workaround ?
Also, I have tried linking the various extensions statically into the perl
binary - but got confused here, as I couldn't work out how to stop the dynamic
loader from trying to pick up the sharable object (review.so) even though it
has been statically linked into the perl binary. I think I mist be doing
something wrong here ...
Any clues ? There may be a useful FAQ on the subject ...
Chris Jobson Email: firstname.lastname@example.org
Sybase Europe BV,
Sybase Court, Voice: +44-(0)1628-597263
Crown Lane, Switchboard:+44-(0)1628-597100
Maidenhead, Fax: +44-(0)1628-597112
Berkshire SL6 8QZ