|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14616 Linking PHP with external static Libtool libraries fails.
Submitted: 2001-12-20 05:26 UTC Modified: 2002-02-04 04:03 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: adam at indexdata dot dk Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.1.0 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: adam at indexdata dot dk
New email:
PHP Version: OS:


 [2001-12-20 05:26 UTC] adam at indexdata dot dk
This bug exists when PHP is linked with external
static Libtool library and PHP itself is shared.

Compile external support library as static. YAZ in this
 cd yaz-1.8.3
 ./configure --prefix=/usr
 make install

 cd ../php-4.1.0:
 ./configure --with-apxs=... --with-yaz

and you'd get an output like this:

/bin/sh ../libtool --silent --mode=link gcc  -g -O2 -prefer-pic  -o  -ldl -lyaz -lcrypt -lresolv -lm -ldl -lnsl  -lresolv
-lcrypt  zend_language_parser.lo zend_language_scanner.lo zend_ini_parser.lo zend_ini_scanner.lo zend_alloc.lo zend_compile.lo zend_c
onstants.lo zend_dynamic_array.lo zend_execute.lo zend_execute_API.lo zend_highlight.lo zend_llist.lo zend_opcode.lo zend_operators.l
o zend_ptr_stack.lo zend_stack.lo zend_variables.lo zend.lo zend_API.lo zend_extensions.lo zend_hash.lo zend_list.lo zend_indent.lo z
end_builtin_functions.lo zend_sprintf.lo zend_ini.lo
make[1]: Leaving directory `/home/adam/proj/php-4.1.0/Zend'
/bin/sh /home/adam/proj/php-4.1.0/libtool --silent --mode=link gcc  -I. -I/home/adam/proj/php-4.1.0/ -I/home/adam/proj/php-4.1.0/main
 -I/home/adam/proj/php-4.1.0 -I/home/adam/proj/apache/include -I/home/adam/proj/php-4.1.0/Zend -I/home/adam/proj/php-4.1.0/ext/mysql/
libmysql -I/home/adam/proj/php-4.1.0/ext/xml/expat  -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT -I/home/adam/proj/php-4.1.0/TSRM -g -O2 -pre
fer-pic   -o -rpath /home/adam/proj/php-4.1.0/libs -avoid-version   stub.lo  Zend/ sapi/apache/ main/l regex/ ext/mysql/ ext/pcre/ ext/posix/ ext/session/ ext/standard/li ext/xml/ ext/yaz/ TSRM/ -ldl -lyaz -lcrypt -lresolv -lm -ldl -lnsl -lresolv -lcrypt
/usr/lib/libyaz.a(odr_bool.o): In function `odr_bool':
/home/adam/proj/yaz/odr/odr_bool.c(.text+0x0): multiple definition of `odr_bool'
Zend/.libs/ first defined here
/usr/lib/libyaz.a(ber_bool.o): In function `ber_boolean':
[many more multiple symbols]

The log indicates that all YAZ symbols are included twice.
Apparenly the Zend link step includes YAZ verbatim even
though no symbols should be needed to built that.


1) removing /usr/lib/ makes it work. Now the
   Zend link step doesn't include YAZ and it works.

2) removing the linkage of yaz from the Zend link step
   obviously makes it work too (and fixes the problem
   for all libraries).

3) build shared YAZ library is a fix too.
   (./configure --enabled-shared for YAZ).

The problem doesn't occur with PHP 4.0.6. It is a problem
with latest CVS (16 Dec 2001).

This problem persists for other libraries than YAZ.
Andrew Sitnikov reports he had trouble with linking of
'-lmm -lmhash' (had to remove them from Zend/Makefile).

If this is a libtool bug and there's no fix for that, my
suggestion would be that Zend doesn't link with
YAZ or other extension libraries. That is the value of
libZend_la_LDFLAGS in Zend/ 
should not include @EXTRA_LIBS@.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-04 04:03 UTC]
This bug has been fixed in CVS.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 29 04:03:53 2023 UTC