Operating System - HP-UX
1757227 Members
3637 Online
108859 Solutions
New Discussion юеВ

Shared Libraries question

 
Aruna Prabakar
New Member

Shared Libraries question

I work in the CIFS Server Group. CIFS Server is based on open source product Samba. What we do is we take this code do some enhancements/changes/customize it to HP-UX & ship it.
The problem I'm having is I compile our product with LDAP libraries. When I do a chatr on my daemon I can see that the daemon is expecting this library at run time. So if the library is not there the daemon won't even start. I want to customize this such that irrespective of the libraries present the daemon should start.
One solution is to use shl_load,dl_open & dl_sym to get the address & call the library functions ourselves.
What I'm looking for is for hp-ux to be doing all this instead of us controlling how the library functions are called. May be like a compile time/run time option.
2 REPLIES 2
Mike Stroyan
Honored Contributor

Re: Shared Libraries question

If you want to use a shared library that is not always present, one option is to provide a stub
version of that library. Link your executable with ld's +b option so it has a shared library search path that looks first in the system directory and then in your own stub library's directory. If the system library is not there, then the stub library of the same name will be loaded instead.
ranganath ramachandra
Esteemed Contributor

Re: Shared Libraries question

with the latest linker / loader patches PHSS_28869 (11.00) / PHSS_28871 (11.11) you can use the linker option "+lazyload" to build the binary so that it wont complain until the application encounters at run-time a reference to a symbol that has to be resolved by the non-existent library.

i'm sorry for the late response but the patch was not released till now :)
 
--
ranga
[i work for hpe]

Accept or Kudo