On 14.04.2014 13:08, Jeff Trawick wrote:
> (not to say there aren't complications, like trying to keep system
> directories out of rpath)

Adding my current workarounds for 2.4 here for reference.

Here openssl_libs is either "-ldl -lz" (Linux) or "-lz -ldl -lsocket
-lnsl" (Solaris). The value of variables like mysql_path, oracle_path
etc. is always the path to the main installation directory of the component.

One caveat: When building against a non-platform OpenSSL one can run
into a runtime linker problem whenever some other library needed by
httpd has a dependency on the platform OpenSSL. An example is the ldap
library, which is often taken from the platform and is lined against
platform OpenSSL. In that case, both OpenSSL versions are loaded.

So which one is used? Whenever an object (module, library) references a
symbol from OpenSSL the runtime linker searches all loaded objects in
load order, so first the httpd binary, then the libs on which httpd
itself depends, then the modules and there dependencies. The first
symbol definition found will be used. So if there are multiple versions
being loaded, then it is quite possible, that although mod_ssl might
trigger loading of a non-platform OpenSSL lib, the code actually running
later is still the platform OpenSSL code. Let me state it again: a
symbol definition needed by a module will *not* be first searched in
that module or its dependencies, but instead in all loaded objects in
load order.

I personally use -Bsymbolic on the Solaris platform and that plus static
linking on Linux to work around this. But that's possibly to complex for
an average user.


A) apr-util (bundled or standalone):


1) Env Vars

    export LDADD_crypto_openssl="$openssl_libs -R${openssl_path}/lib"
    export LDADD_crypto_nss="-R${nss_path}/lib"
    export LDADD_dbd_mysql="-R${mysql_path}/lib"
    export LDADD_dbd_oracle="-R${oracle_path}/lib"

Only during configure run (bdb = Berkeley DB)

    export LD_LIBRARY_PATH=${bdb_path}/lib

Only during "make check" run (Oracle libclnt needs libnnz but has no
PATH set itself)

    export LD_LIBRARY_PATH=${oracle_path}/lib


2) configure script

For APU crypto support changing all lines of type

    LIBS="-lssl -lcrypto ...

to

    LIBS="-lssl -lcrypto $openssl_libs ...

(for $openssl_libs see above)



3) Makefile - only when building without dso support
   (--disable-util-dso)

Adding rpath, replace

    $(LINK) -rpath $(libdir) ...

by

    $(LINK) -rpath $(libdir) ${global_rpath} ...

where global_rpath contains - depending on configure flags -

    -R${openssl_path}/lib
    -R${sqlite_path}/lib
    -R${mysql_path}/lib
    -R${nss_path}/lib


4) test/Makefile - only when building without dso support
   (--disable-util-dso)

Adding rpath, replacing

    APRUTIL_LDFLAGS =...

by

    APRUTIL_LDFLAGS =... ${global_rpath}

(for global_rpath see 3))


B) HTTPD 2.4


1) Env Vars

Probably not all "-L" are currently needed:

   export MOD_SSL_LDADD="-L${openssl_path}/lib -R${openssl_path}/lib"
   export MOD_LUA_LDADD="-L${lua_path}/lib -R${lua_path}/lib"
   export MOD_XML2ENC_LDADD="-L${libxml2_path}/lib -R${libxml2_path}/lib"
   export MOD_PROXY_HTML_LDADD="-L${libxml2_path}/lib -R${libxml2_path}/lib"

   export LD_LIBRARY_PATH=${mysql_path}/lib:${oracle_path}/lib


2) configure

Add -lz (OpenSSL dependency), replacing

    LIBS="-lssl -lcrypto ...

by

    LIBS="-lssl -lcrypto -lz ...

and

    ap_openssl_libs=".*apr_config.*

by

    ap_openssl_libs=".*apr_config.* -lz


3) support/Makefile

Add -lz (OpenSSL dependency), replacing

    ab_LDADD ...

by

    ab_LDADD = ... -lz

and because of https support in ab also adding -R${openssl_path}/lib.


Regards,

Rainer

Reply via email to