httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Chin <>
Subject Re: mod_deflate as a DSO on Solaris (perhaps generic?)
Date Sat, 05 Jan 2002 11:35:27 GMT
On Fri, Jan 04, 2002 at 07:38:02PM -0500, Jeff Trawick wrote:
> On my Solaris systems (Solaris 8 for i86 and Sparc), configure finds
> /usr/local/lib/libz.a and /usr/local/include/whatever, but
> won't load because of an unresolved reference to
> deflateInit2_.
> checking whether to enable mod_deflate... checking dependencies
> checking for zlib location... /usr/local
>   adding "-I/usr/local/include" to INCLUDES
>   setting LDFLAGS to "-L/usr/local/lib"
>   adding "-R/lib" to LDFLAGS
>   adding "-lz" to LIBS
> checking for zlib library... found
> checking for zutil.h... no
> checking whether to enable mod_deflate... shared
> Cannot load /export/home/trawick/apacheinst/modules/ 
> into server: httpd: fatal: relocation error: file 
> /export/home/trawick/apacheinst/modules/ symbol 
> deflateInit2_: referenced symbol not found

What is the output of:
  $ ldd /export/home/trawick/apacheinst/modules/
  $ elfdump -d /export/home/trawick/apacheinst/modules/ |\
  grep RPATH

> I would guess that the problem is that wasn't
> statically linked with this libz.a, but I HAVEN'T TRIED IT YET.
> Perhaps Solaris ld discarded the libz stuff because it wasn't used by
> httpd.

Solaris 8 has /usr/lib/ and it has deflateInit2_:
  $ nm /usr/lib/ | grep deflateInit
  [212]   |     11328|     668|FUNC |GLOB |0    |9      |deflateInit2_
  [203]   |     11280|      48|FUNC |GLOB |0    |9      |deflateInit_

> (I hit the same problem on AIX but [erroneously] guessed at the time
> that only AIX would need libz.a statically linked with
> instead of statically linked with httpd.)
> How do other folks deal with this?  Always use a shared object libz?
> Statically linking it with seems less error-prone
> (assuming the build is correct), particularly if you want to run a
> build on multiple machines.

Not all systems allow you to link a static library into a shared one
(HP-UX for example). If httpd doesn't link in libz, you'll have to
either include the source to libz and make it a libtool convenience
library that gets linked to mod_deflate or link the "system" libz as a
shared library.

albert chin (

View raw message