Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

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 (
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.xs etc. files and installed them
in lib/auto/Sybase/review.

I will thus be accessing two sharable libs : and
Of course, I also have the XS-related sharable objects that REFER to these
two libs. These have the names and Note also that the library ALSO refers to

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/' 
 module review: conflicting usage of dlopen'ed dependents at 
ools/dse/lib/perl5/ line 128.

It seems that this happens when the loader (via dlopen()) tries to pull in
a second sharable library (in this case ../review/ which refers to
an underlying sharable library ( which is ALSO referenced via an
earlier dlopen(). Ie. if we do

use Sybase::DBlib
use Sybase::review

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 ( 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


 Chris Jobson                                    Email:
 European DSE,
 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
 United Kingdom.