Operating System - HP-UX
1848163 Members
7905 Online
104022 Solutions
New Discussion

problems with dynamic linking

 
SOLVED
Go to solution
marko asplund
Frequent Advisor

problems with dynamic linking

i've installed the ActivePerl 5.6 build 627 on a HP-UX 11.00 system and now i'm trying to compile DBD::Oracle v1.12. the module compiles but 'make test' fails with the following error message:

> gmake test
PERL_DL_NONLAZY=1 /opt/perl/bin/perl -Iblib/arch -Iblib/lib
-I/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi -I/opt/perl/lib/5.6.1 -e 'use
Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/base............../usr/lib/dld.sl: Can't shl_load() a library containing
Thread Local Storage: /usr/lib/libcl.2
/usr/lib/dld.sl: Exec format error
Failed to load Oracle extension and/or shared libraries:
install_driver(Oracle) failed: Can't load 'blib/arch/auto/DBD/Oracle/Oracle.sl'
for module DBD::Oracle: Exec format error at
/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi/DynaLoader.pm line 206.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/base.t line 19
The remaining tests will probably also fail with the same error.
...


(full typescript attached). i had this same problem with the standard, manually built Perl 5.005_03 but linking Perl with pthread and cl libraries
(-Dlibs='-lpthread -lcl') solved it. has anyone managed to solve this problem with ActivePerl? i'm having problems understanding the dynamic linker in 11.00, why can't it load the libcl.sl unless the Perl binary has been linked with this library?

7 REPLIES 7
H.Merijn Brand (procura
Honored Contributor

Re: problems with dynamic linking

What's your SHLIB_PATH?
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: problems with dynamic linking

marko asplund
Frequent Advisor

Re: problems with dynamic linking

originally SHLIB_PATH was not set at all but i tried setting it to /usr/lib but that didn't help and enabled SHLIB_PATH in DBD::Oracle (chatr +s enable blib/arch/auto/DBD/Oracle/Oracle.sl).

i also tried changing the Makefile so that Oracle.sl would be linked with libcl.sl. after doing this 'chatr Oracle.sl' says:

[390] % chatr blib/arch/auto/DBD/Oracle/Oracle.sl
blib/arch/auto/DBD/Oracle/Oracle.sl:
shared library
shared library dynamic path search:
SHLIB_PATH enabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/lib/libcl.2
dynamic /opt/oracle/u01/app/oracle/product/8.1.7/lib//libclntsh.sl.8.0
dynamic /opt/oracle/u01/app/oracle/product/8.1.7/lib//libwtc8.sl
dynamic /usr/lib/librt.2
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libdld.2
dynamic /usr/lib/libm.2
...


but the same problems still remains.

i also read the ITRC thread reference but unfortunately i couldn't figure out the connection to my problem.
Steve Steel
Honored Contributor
Solution

Re: problems with dynamic linking

Hi


make sure you have the latest ld patch

PHSS_26262

Then use LD_PRELOAD funtionality.


The LD_PRELOAD environment variable allows you to load additional shared
libraries at program startup. LD_PRELOAD provides a colon- separated or
space-separated list of shared libraries that the dynamic loader can
interpret. The dynamic loader, dld.sl, loads the specified shared libraries
as if the program had been linked explicitly with the shared libraries in
LD_PRELOAD before any other dependents of the program.

see man dld.sl after the patch


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
H.Merijn Brand (procura
Honored Contributor

Re: problems with dynamic linking

I've set my SHLIB_PATH to include /opt/oracle/u01/app/oracle/product/8.1.7/lib/ and that helped a lot
Enjoy, Have FUN! H.Merijn
marko asplund
Frequent Advisor

Re: problems with dynamic linking

setting LD_PRELOAD to include
/usr/lib/libcl.2 solved the problem! thanks.

i only have PHSS_24303 installed but it has LD_PRELOAD support and seems to be working.
Adrian Turner_1
Occasional Advisor

Re: problems with dynamic linking

Thanks very much for a very useful thread. Perhaps you can help me a tad more.

Using the patch and setting LD_PRELOAD before installing DBD:Oracle worked fine, however, LD_PRELOAD needs to be set in the user environment before any perl calls to it. This conflicts with another 3rd party executable which core dumps when this is set.

As this is a production system and dont want to install compilers etc, ideally I am looking for a 5.6.1 binary distribution for HP which has been compiled with the Dlibs='-lpthread -lcl' option set.

Please can anyone point me to one?

Thanks in advance,
Adrian