php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26655 module is not linked against -lbz2
Submitted: 2003-12-17 14:35 UTC Modified: 2004-01-18 21:26 UTC
From: mmokrejs at natur dot cuni dot cz Assigned: sniper (profile)
Status: Not a bug Package: Compile Failure
PHP Version: 4CVS-2003-12-17 (stable) OS: solaris 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mmokrejs at natur dot cuni dot cz
New email:
PHP Version: OS:

 

 [2003-12-17 14:35 UTC] mmokrejs at natur dot cuni dot cz
Description:
------------
Hi,
  I can compile current snapshot, but the module is not linked dynamically against libbz2:

ldd /usr/local/apache2/modules/libphp4.so
        libhistory.so =>         /usr/local/lib/libhistory.so
        libreadline.so.4 =>      /usr/local/lib/libreadline.so.4
        libmysqlclient.so.12 =>  /usr/local/mysql/lib/mysql/libmysqlclient.so.12
        libintl.so.2 =>  /usr/lib/libintl.so.2
        libz.so =>       /usr/lib/libz.so
        libdb-4.1.so =>  /usr/local/BerkeleyDB-4.1.25/lib/libdb-4.1.so
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libm.so.1 =>     /usr/lib/libm.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libxml2.so.2 =>  /usr/local/lib/libxml2.so.2
        libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libposix4.so.1 =>        /usr/lib/libposix4.so.1
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libaio.so.1 =>   /usr/lib/libaio.so.1
        /usr/platform/SUNW,Ultra-30/lib/libc_psr.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1



Reproduce code:
---------------
# /usr/local/apache2/bin/apachectl startssl
Syntax error on line 231 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp4.so into server: ld.so.1: /usr/local/apache2/bin/httpd: fatal: relocation error: file /usr/local/apache2/modules/libphp4.so: symbol BZ2_bzerror: referenced symbol not found
#



Expected result:
----------------
sapi/cli/php is properly linked against libbz2, so it's not a problem with configure detection but possibly some macro missing in so of the Makefile.in files(I guess).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-18 03:30 UTC] sniper@php.net
And what might have been the configure line?
And do you have shared or static bz2 lib?

 [2003-12-18 17:08 UTC] mmokrejs at natur dot cuni dot cz
CXX=gcc CFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa -felide-constructors -fno-exceptions -fno-rtti" CXXFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa -felide-constructors -fno-exceptions -fno-rtti" CC=gcc ./configure --with-openssl=/usr/local/openssl-0.9.6l --with-zlib --with-bz2 --enable-dba --with-db4=/usr/local/BerkeleyDB-4.1 --with-inifile --with-flatfile --enable-dio --with-dom --with-gettext --with-iconv --with-java=/usr/j2se --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-ncurses --with-readline --enable-sockets --enable-force-cgi-redirect --with-apxs2=/usr/local/apache2/bin/apxs


I have only static libbz2.a.
But the problem is I think not in my library, but that on the linker line "-lbz2" was missing. If it wouldn't, linker would pick-up the static library anyway.
 [2003-12-18 17:55 UTC] sniper@php.net
Send me the generated Makefile to sniper@php.net.

 [2003-12-19 07:47 UTC] sniper@php.net
You have static bz2 lib -> of course it doesn't show up in the ldd output. Secondly, the -lbz2 sure is in EXTRA_LIBS in your Makefile. 

Now, what version of BZ2 do you have installed?
And try this configure line instead:
(don't try outsmart the configure with your CFLAGS etc)

# rm config.cache ; CC=gcc ./configure --disable-all --with-bz2 --with-apxs2=/usr/local/apache2/bin/apxs


 [2004-01-11 06:46 UTC] mmokrejs at natur dot cuni dot cz
Hi, I tested with php4-STABLE-200401102230 and the problem with libz2 symbols unresolved is caused by using --with-mysql=/usr/local/mysql .
 [2004-01-11 06:52 UTC] mmokrejs at natur dot cuni dot cz
To be clear, the mysql I use is a binary distribution from www.mysql.com for solaris, version 4.0.16.

root@pf-i400# ls  /usr/local/mysql/lib/mysql/libmysqlclient*
libmysqlclient.a            libmysqlclient.so.12        libmysqlclient_r.la         libmysqlclient_r.so.12.0.0
libmysqlclient.la           libmysqlclient.so.12.0.0    libmysqlclient_r.so         
libmysqlclient.so           libmysqlclient_r.a          libmysqlclient_r.so.12      
root@pf-i400# ldd /usr/local/mysql/lib/mysql/libmysqlclient.so
        libposix4.so.1 =>        /usr/lib/libposix4.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Ultra-30/lib/libc_psr.so.1
root@pf-i400#
 [2004-01-11 11:20 UTC] sniper@php.net
So using the configure line I gave above works?

 [2004-01-11 14:36 UTC] mmokrejs at natur dot cuni dot cz
Yes, the line in comment 19 Dec 2003 7:47am EST works.

# rm config.cache ; CC=gcc ./configure --disable-all --with-bz2
--with-apxs2=/usr/local/apache2/bin/apxs


I tested my configure line with special CFLAGS and many configure options removing one after one and came to a point, that removing the mysql option fixes the problem. Using the full configure line as in the original report except the --with-mysql=.... option works too.

But I desperately need mysql support. ;)
 [2004-01-11 19:16 UTC] sniper@php.net
Does this work:

# rm config.cache ; CC=gcc ./configure --disable-all --disable-cgi --with-bz2 --with-mysql=/usr/local/mysql

(sapi/cli/php is compiled only)

 [2004-01-11 19:52 UTC] mmokrejs at natur dot cuni dot cz
Yes, that works too, strange.
 [2004-01-12 06:40 UTC] sniper@php.net
Now, if you add the --with-apxs2 in it, it won't work?
How is apache2 configured? (what MPM is used)

 [2004-01-12 07:15 UTC] mmokrejs at natur dot cuni dot cz
Yes, using 

rm config.cache ; CC=gcc ./configure --disable-all --disable-cgi --with-bz2 --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs

breaks the installation again.


I compiled apache 2.0.48 as:

CXX=gcc CFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa -felide-constructors -fno-exceptions -fno-rtti" CXXFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa -felide-constructors -fno-exceptions -fno-rtti" CC=gcc ./configure --with-ssl=/usr/local/openssl-0.9.6l --enable-rewrite --enable-speling --enable-vhost-alias --enable-cgid --enable-cgi --enable-suexec --enable-info 
--enable-http --enable-ssl --enable-usertrack --enable-headers --enable-expires --enable-mime-magic --enable-logio --enable-deflate --enable-ext-filter --enable-cache --enable-disk-cache --enable-charset-lite --enable-auth-dbm --enable-so --enable-nonportable-atomics --with-modules="mod_access mod_actions mod_alias mod_asis mod_auth_anon mod_auth_dbm mod_cache mod_cern_meta mod_cgi mod_cgid mod_charset_lite mod_deflate mod_dir mod_disk_cache mod_env mod_expires mod_ext_filter mod_headers mod_imap mod_include mod_info mod_log_config mod_mime mod_mem_cache mod_mime_magic mod_negotiation mod_rewrite mod_setenvif mod_so mod_speling mod_ssl mod_status mod_userdir mod_usertrack mod_vhost_alias"

# /usr/local/apache2/bin/httpd -l
Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_auth_dbm.c
  mod_charset_lite.c
  mod_cache.c
  mod_disk_cache.c
  mod_ext_filter.c
  mod_include.c
  mod_deflate.c
  mod_log_config.c
  mod_logio.c
  mod_env.c
  mod_mime_magic.c
  mod_expires.c
  mod_headers.c
  mod_usertrack.c
  mod_setenvif.c
  mod_ssl.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_info.c
  mod_suexec.c
  mod_cgi.c
  mod_cgid.c
  mod_vhost_alias.c
  mod_negotiation.c
  mod_dir.c
  mod_imap.c
  mod_actions.c
  mod_speling.c
  mod_userdir.c
  mod_alias.c
  mod_rewrite.c
  mod_so.c
#
 [2004-01-13 05:32 UTC] sniper@php.net
To get this problem solved for real, you need to provide me access to this machine in question. (I suspect this is not any bug in PHP btw)

You may email me directly: sniper@php.net

 [2004-01-18 21:26 UTC] sniper@php.net
Doing this before running configure 'fixed' the problem:

# unset CFLAGS CPPFLAGS CXXFLAGS LIBS

(having LIBS set was the problem, only set library paths in LD_LIBRARY_PATH!)

Conclusion: NEVER EVER try outsmart the configure unless you REALLY know what you're doing. :)




 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 22:01:29 2024 UTC