On 10/15/06, William A. Rowe, Jr. <[EMAIL PROTECTED]> wrote:
Eric Covener wrote:
> On 10/14/06, William A. Rowe, Jr. <[EMAIL PROTECTED]> 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.
Patches attached for preferring shl_load only on 32-bit and
HPUX11/10/9 and for adding DYNAMIC_PATH to shl_load calls based on
discussion above.
Appeared to do the right thing on 32-bit 11.11PARISC and 64-bit IA64,
--
Eric Covener
[EMAIL PROTECTED]
Index: srclib/apr/configure.in
===================================================================
--- srclib/apr/configure.in (revision 464573)
+++ srclib/apr/configure.in (working copy)
@@ -1488,9 +1488,17 @@
if test "$dsotype" = "any"; then
# Darwin:
AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld])
+
+ # Prefer shl_* on 32-bit HPUX before HPUX12
if test "$dsotype" = "any"; then
- # Original HP-UX:
- AC_CHECK_LIB(dld, shl_load, [dsotype=shl; APR_ADDTO(LIBS,-ldld)])
+ case $host in
+ *hpux11*|*hpux10*|*hpux9*)
+ AC_CHECK_SIZEOF(void*)
+ if test "x$ac_cv_sizeof_voidp" = "x4"; then
+ AC_CHECK_LIB(dld, shl_load, [dsotype=shl; APR_ADDTO(LIBS,-ldld)])
+ fi
+ ;;
+ esac
fi
# Normal POSIX:
if test "$dsotype" = "any"; then
Index: srclib/apr/dso/unix/dso.c
===================================================================
--- srclib/apr/dso/unix/dso.c (revision 464573)
+++ srclib/apr/dso/unix/dso.c (working copy)
@@ -81,7 +81,7 @@
const char *path, apr_pool_t *pool)
{
#if defined(DSO_USE_SHL)
- shl_t os_handle = shl_load(path, BIND_IMMEDIATE, 0L);
+ shl_t os_handle = shl_load(path, BIND_IMMEDIATE | DYNAMIC_PATH, 0L);
#elif defined(DSO_USE_DYLD)
NSObjectFileImage image;