Error Observed during Apache HTTPD compilation
root/httpd-2.4.4/srclib/apr/libtool --silent --mode=link gcc -std=gnu99 -g -O2 -pthread -o mod_deflate.la -rpath /usr/local/apache/modules -module -avoid-version mod_deflate.lo -L/usr/local/lib -lz
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [mod_deflate.la] Error 1
make[4]: Leaving directory `/root/httpd-2.4.4/modules/filters'
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/root/httpd-2.4.4/modules/filters'
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/root/httpd-2.4.4/modules'
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/root/httpd-2.4.4'
make: *** [all-recursive] Error 1
APACHE INSTALLATION FAILED
Root Cause
libz.a was not compiled in the main build with PIC (Position Independant Code) support & hence need to be recompiled again with PIC support. More info on PIC at below link
https://web.archive.org/web/20150319085301/http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3
Solution
Download latest zlib package - preferably a tar archive
- tar -zxvf zlib-1.2.11.tar.gz
- cd zlib-1.2.11
- CFLAGS="-O3 -fPIC"
- ./configure
- make
- make install
Above steps will overwrite existing libz libraries . Run Apache HTTPD make post executing above steps. This solution was found working in our labs . Hope it helps.