PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "W dot Phillip Moore" <wpm at ms dot com>
Subject: perl (not DB_File.so) linked with -ldb on IRIX 6.5, breaking sybperl
Date: May 24 1999 4:45PM

The following is true for any perl release after 5.00404 (and probably
some before -- its an issue with Configure that's been around a
while).

On IRIX 6.5, SGI has chosen to provide Berkeley DB 1.85 in the base
OS, and the headers and libraries live in /usr/include and
/usr/lib (or /usr/lib32, for the -n32 version).

Sounds great, eh?  

Not if you want to compile perl *and* the Sybase::* extentions.  Since
libdb is found in the "standard" library locations, Configure scans it
for symbols, and adds -ldb to the list of libraries that perl needs.

    Extracting names from the following files for later perusal:
	    /usr/lib32/libc.so
	    /usr/lib32/libdb.so
	    /usr/lib32/libm.so
	    /usr/lib32/libmalloc.so
    This may take a while....done
    Computing filename position in cpp output for #include directives...
     NOT found.
    dlopen() found.

The resulting perl binary is linked (needlessly, as the linker even
warns) with -ldb.

    cc -n32 -mips4  -L/usr/local/lib -L/usr/lib32 -L/lib32 -L/usr/gnu/lib -o miniperl miniperlmain.o libperl.a -ldb -lm -lc 
    ld32: WARNING 84: /usr/lib32/libdb.so is not used for resolving any symbol.

    cc -n32 -mips4  -L/usr/local/lib -L/usr/lib32 -L/lib32 -L/usr/gnu/lib  -o perl perlmain.o lib/auto/DynaLoader/DynaLoader.a  libperl.a `cat ext.libs` -ldb -lm -lc 
    ld32: WARNING 84: /usr/lib32/libdb.so is not used for resolving any symbol.

Everything seems fine; the test suite all passes.  Then, when you
build the Sybase::DBlib extensions you are screwed.

Both libdb.so and the Sybase libsybdb.so have a function called
dbopen(), and because perl was linked with libdb.so, the
Sybase::DBlib extension can't get at its own copy.

For unrelated reasons, I maintain DB_File outside of the core perl
distribution, so I build with Configure -Ui_db.  This correctly skips
the compilation of DB_File, but there is code all over Configure to
support DB_File, and this pulls in libdb regardless of the i_db value,
if it is found in a standard system library (but *NOT* if it is found
in the "loclibpth" used by Configure.

What's worse is that perl itself gets linked with -ldb, which is
completely unnecessary, whether or not you build DB_File (only
DB_File.so needs this, not perl).

I don't know the right way of fixing this.  Short term, I've hacked
the hints file to strip the 'db' from libswanted, but this isn't the
Right Thing To Do.  In general, perl and miniperl should *NOT* be
linked with -ldb.  That is *only* necessary for the DB_File.so
extension.