Operating System - HP-UX
1752307 Members
5262 Online
108786 Solutions
New Discussion юеВ

problems with shared library

 
SOLVED
Go to solution
albino_1
Occasional Advisor

problems with shared library

Hi,
I'm trying to distruite a my application but i have problem with shared libraries.

I can move only some libraries in my SHLIB_PATH.. but others give me error

this is error with ldd ..




ldd -s /usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh
=>

find library=/usr/lib/libc.2; required by /usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh
search path=/usr/local/lib (RPATH)
trying path=/usr/local/lib/libc.2
search path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib (SHLIB_PATH)
trying path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib/libc.2
trying path=/usr/lib/libc.2 (absolute)
/usr/lib/libc.2 => /usr/lib/libc.2

find library=/usr/lib/libdld.2; required by /usr/lib/libc.2
search path=/usr/local/lib (RPATH)
trying path=/usr/local/lib/libdld.2
search path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib (SHLIB_PATH)
trying path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib/libdld.2
trying path=/usr/lib/libdld.2 (absolute)
/usr/lib/libdld.2 => /usr/lib/libdld.2

find library=/usr/lib/libc.2; required by implicit load
search path=/usr/local/lib (RPATH)
trying path=/usr/local/lib/libc.2
search path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib (SHLIB_PATH)
trying path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib/libc.2
trying path=/usr/lib/libc.2 (absolute)
/usr/lib/libc.2 => /usr/lib/libc.2

find library=/usr/local/lib/libiconv.sl; required by /usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh
/usr/local/lib/libiconv.sl => /usr/local/lib/libiconv.sl

find library=/usr/lib/libc.2; required by /usr/local/lib/libiconv.sl
search path=/usr/local/lib (RPATH)
trying path=/usr/local/lib/libc.2
search path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib (SHLIB_PATH)
trying path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib/libc.2
search path=/usr/local/lib (RPATH)
trying path=/usr/local/lib/libc.2
trying path=/usr/lib/libc.2 (absolute)
/usr/lib/libc.2 => /usr/lib/libc.2

find library=/usr/lib/libpthread.1; required by /usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh
search path=/usr/local/lib (RPATH)
trying path=/usr/local/lib/libpthread.1
search path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib (SHLIB_PATH)
trying path=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib/libpthread.1
trying path=/usr/lib/libpthread.1 (absolute)
/usr/lib/libpthread.1 => /usr/lib/libpthread.1

find library=/usr/local/lib/libxml2.sl; required by /usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh
/usr/lib/dld.sl: Can't open shared library: /usr/local/lib/libxml2.sl
/usr/lib/dld.sl: No such file or directory

I have moved libxml2.sl under SHLIB_PATH=/usr/Systems/EML_1-9.1.0/ZICAccessManager/scripts/../lib

but i don't understand why he don't try to find it.


clould you help me pls?

regars
Al
6 REPLIES 6
Dennis Handly
Acclaimed Contributor
Solution

Re: problems with shared library

What does "chatr /usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh" show?

Is SHLIB_PATH enabled?

Any reason you don't simplify the path to:
SHLIB_PATH=/usr/Systems/EML_1-9.1.0/ZICAccessManager/lib

What does "file /usr/Systems/EML_1-9.1.0/ZICAccessManager/lib/libxml2.sl" show?
albino_1
Occasional Advisor

Re: problems with shared library

thx for your fast answer ...

file /usr/Systems/EML_1-9.1.0/ZICAccessManager/lib/libxml2.sl
/usr/Systems/EML_1-9.1.0/ZICAccessManager/lib/libxml2.sl: PA-RISC2.0 shared library -not stripped

>>Any reason you don't simplify the path to:
SHLIB_PATH=/usr/Systems/EML_1-9.1.0/ZICAccessManager/lib

I cannot !

chatr /usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh
/usr/Systems/EML_1-9.1.0/ZICAccessManager/modules/php-cgi_zicam_enh:
shared executable
shared library dynamic path search:
SHLIB_PATH enabled second
embedded path enabled first /usr/local/lib
shared library list:
dynamic /usr/local/lib/libz.sl
dynamic /usr/lib/libm.2
dynamic /usr/lib/libnsl.1
static /usr/local/lib/libxml2.sl
dynamic /usr/lib/libpthread.1
static /usr/local/lib/libiconv.sl
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
explicit unloading enabled
runtime checks disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
third quadrant global data space disabled
data page size: D (default)
instruction page size: D (default)
nulptr references enabled
shared library private mapping disabled
shared library text merging disabled


I think that the problem is that libxml2.sl is linked shared static :((

Dennis Handly
Acclaimed Contributor

Re: problems with shared library

>static /usr/local/lib/libxml2.sl
>static /usr/local/lib/libiconv.sl

>I think that the problem is that libxml2.sl is linked shared static

Well, linked with an absolute path, not subject to run-time path lookup:
... /usr/local/lib/libxml2.sl
Instead of: -lxml2

You can fix this with:
chatr -l /usr/local/lib/libxml2.sl
albino_1
Occasional Advisor

Re: problems with shared library

>>Well, linked with an absolute path, not subject to run-time path lookup:

so why for default it try to make this lookup?

by the way .. thx a lot you solved my problem !!!

Al
Dennis Handly
Acclaimed Contributor

Re: problems with shared library

>so why for default it try to make this lookup?

It depends on the link line.

You probably have the whole path:
/usr/local/lib/libxml2.sl

Instead of:
-L/usr/local/lib -lxml2
albino_1
Occasional Advisor

Re: problems with shared library

Yes .. you are right .. sorry :)


by the way ... all is right now!!


thanks a lot

Al