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 > mod_deflate.so 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/mod_deflate.so > into server: ld.so.1: httpd: fatal: relocation error: file > /export/home/trawick/apacheinst/modules/mod_deflate.so: symbol > deflateInit2_: referenced symbol not found
What is the output of: $ ldd /export/home/trawick/apacheinst/modules/mod_deflate.so $ elfdump -d /export/home/trawick/apacheinst/modules/mod_deflate.so |\ grep RPATH > I would guess that the problem is that mod_deflate.so 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/libz.so and it has deflateInit2_: $ nm /usr/lib/libz.so | 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 mod_deflate.so > instead of statically linked with httpd.) > > How do other folks deal with this? Always use a shared object libz? > Statically linking it with mod_deflate.so 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 ([EMAIL PROTECTED])
