You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Eric Covener <co...@gmail.com> on 2006/10/14 07:03:52 UTC

apr_dso_load(): DYNAMIC_PATH flag for shl_load()?

Would it be appropriate for apr_dso_load to set the DYNAMIC_PATH flag
when using  shl_load() on HPUX?

http://docs.hp.com/en/B2355-90654/ch05s03.html#dynamic-path

It seems to bring the behavior closer dlopen() , searching SHLIB_PATH
so you can  ask for "libfoo.so" and not rely on absolute names or
paths.

shl_load() appears to be selected by default by autoconf on HPUX, when
--enable-dso=dlfcn is passed in SHLIB_PATH is consulted (by dlopen).

--
Eric Covener
covener@gmail.com

Re: apr_dso_load(): DYNAMIC_PATH flag for shl_load()?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Eric Covener wrote:
> On 10/14/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
> 
> It doesn't appear that the +s flag alone lets explicit calls to
> shl_load search SHLIB_PATH to find libraries.

If your assertion(s) are correct, that dlopen does search the
LD_LIBRARY_PATH, and shl_load does not, I agree with adding the
flag then (provided that it will always pick up a full path to binary
before it will ever use the search logic, explicit needs to override
any path list.)

> typescript-like testcase at http://misers.org/apache/shl_load.txt
> (similiar results for ia64 in same dir)

Thanks for that pointer.

> It might also be wise to (instead?)  test for SHL after DLFCN as SHL
> is deprecated (swapping of two stanzas in srclib/apr/configure.in):

It's not.  On 32bit / 11.any - it's important to continue to use the solid
shl in place of dlfcn, because the original dlfcn is not a solution, you won't
find compatibility from 11.x to 11.x box.  It's a shame HP didn't have the
foresight to entirely and robustly implement dlfcn with the introduction of
11.00.00 :(  OTOH with 11.any - it's important we pick up and use dlfcn for
64 bit compiled code.  Simply put, it's a mess, and I'd be happy to champion
a patch which carefully deploys shl consistently on 11 or prior w/32bit,
and dlfcn on 11 or later w/64bit and 12 or later w/32 bit.

I'm the one who reversed those stanzas several years ago based on the poor
implementation, so you are welcome to trawl the archives for my comments and
the threads on this.  Although it's deprecated, there's no way HP can break
shl during the lifetime of 11.x.

(FYI - I'm playing with 64 bit parisc2.0w builds these coming weeks, and will
probably have the patch I suggested above, shortly.)


subject.

Re: apr_dso_load(): DYNAMIC_PATH flag for shl_load()?

Posted by Eric Covener <co...@gmail.com>.
On 10/14/06, William A. Rowe, Jr. <wr...@rowe-clan.net> wrote:
> Eric Covener wrote:
> > Would it be appropriate for apr_dso_load to set the DYNAMIC_PATH flag
> > when using  shl_load() on HPUX?
> IMHO, no.  The behavior AIUI is dynamic for applications built +b +s.
>
> But if my understanding of the default behavior is wrong, I agree with
> your suggestion.
>

It doesn't appear that the +s flag alone lets explicit calls to
shl_load search SHLIB_PATH to find libraries.

typescript-like testcase at http://misers.org/apache/shl_load.txt
(similiar results for ia64 in same dir)

It might also be wise to (instead?)  test for SHL after DLFCN as SHL
is deprecated (swapping of two stanzas in srclib/apr/configure.in):

shl_load(3x)
      Future HP-UX environments may not support these routines and flags or
      may only support a subset of them.  Instead, they will use the SVR4
      dynamic loading API.  Users are encouraged to migrate to the dl*
      family of dynamic linking routines.


-- 
Eric Covener
covener@gmail.com

Re: apr_dso_load(): DYNAMIC_PATH flag for shl_load()?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Eric Covener wrote:
> Would it be appropriate for apr_dso_load to set the DYNAMIC_PATH flag
> when using  shl_load() on HPUX?
> 
> http://docs.hp.com/en/B2355-90654/ch05s03.html#dynamic-path
> 
> It seems to bring the behavior closer dlopen() , searching SHLIB_PATH
> so you can  ask for "libfoo.so" and not rely on absolute names or
> paths.
> 
> shl_load() appears to be selected by default by autoconf on HPUX, when
> --enable-dso=dlfcn is passed in SHLIB_PATH is consulted (by dlopen).

IMHO, no.  The behavior AIUI is dynamic for applications built +b +s.

But if my understanding of the default behavior is wrong, I agree with
your suggestion.