Skip to Content.
Sympa Menu

freetds - [freetds] Sybase.so RPATH for DBD::Sybase

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <james.k.lowden AT alliancebernstein.com>
  • To: "TDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Sybase.so RPATH for DBD::Sybase
  • Date: Mon, 30 Oct 2006 17:14:49 -0500

I want to add /usr/local to the Sybase.so RPATH.

I always dread upgrading DBD::Sybase because this always happens:

$ ldd $(find . -name Sybase.so)
./blib/arch/auto/DBD/Sybase/Sybase.so:
-lct.4 => not found
-lintl.0 => /usr/lib/libintl.so.0
-ltds.5 => not found
-lm.0 => /usr/lib/libm387.so.0
-lm.0 => /usr/lib/libm.so.0

I can get around that by setting LD_RUN_PATH or by copying libct where
the run-time linker will find it. But I'd really, really like not to do
that anymore. I'd really like to set the RPATH in the ELF binary. In
short, I want to pass:

-R/usr/local/lib

or maybe

-Wl,-R/usr/local/lib

or perhaps

-Wl,-rpath/usr/local/lib

to the Makefile.PL, such that it will pass the arguments to the linker
when it builds the .so.

Things I've tried:

1. Setting LDFLAGS before starting cpan.
2. Reading perlmodinstall, perldoc cpan, perldoc CPAN, perdoc Config
3. Reading the README and README.freetds in the DBD::Sybase
distribution
4. Googling for various combinations of perl, module, rpath, linker,
flags

For the record, I'm using gcc on NetBSD with Perl installed from pkgsrc
(www.pkgsrc.org). pkgsrc puts packages in (and links to) /usr/pkg and
ignores /usr/local. This is reflected here:

$ perl -e'use Config qw(config_sh); print config_sh()' | grep ldd
lddlflags=' -Wl,-R/usr/pkg/lib -pthread --whole-archive -shared
-L/usr/pkg/lib'

When cpan links Sybase.so, it passes these arguments to gcc, as can be
seen from what's already installed:

$ readelf -d $(find /usr/pkg/lib -name Sybase.so | head -1) | grep rpath
0x0000000f (RPATH) Library rpath:
[/usr/pkg/lib:/usr/pkg/lib/perl5/5.8.4/i386-netbsd/CORE]

Like I said, I want to add /usr/local to the RPATH.

I've dodged and worked around this for too long. Surely someone here
knows the answer or knows someone who does.

Many thanks for your kind sage advice.

--jkl


-----------------------------------------
The information contained in this transmission may be privileged and
confidential and is intended only for the use of the person(s) named
above. If you are not the intended recipient, or an employee or agent
responsible
for delivering this message to the intended recipient, any review,
dissemination,
distribution or duplication of this communication is strictly prohibited. If
you are
not the intended recipient, please contact the sender immediately by reply
e-mail
and destroy all copies of the original message. Please note that we do not
accept
account orders and/or instructions by e-mail, and therefore will not be
responsible
for carrying out such orders and/or instructions. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.




Archive powered by MHonArc 2.6.24.

Top of Page