#50695 [Opn]: PHP uses system XML2 when custom xml2 is given

From: Date: Fri, 08 Jan 2010 18:17:47 +0000
Subject: #50695 [Opn]: PHP uses system XML2 when custom xml2 is given
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-146441@lists.php.net to get a copy of this message
 ID:               50695
 User updated by:  quanah at zimbra dot com
 Reported By:      quanah at zimbra dot com
 Status:           Open
 Bug Type:         Compile Failure
 Operating System: Linux
 PHP Version:      5.2.12
 New Comment:

As seen here:

s%@EXTRA_LDFLAGS@% -avoid-version -module -L/usr/lib <....>


Previous Comments:
------------------------------------------------------------------------

[2010-01-08 18:13:38] quanah at zimbra dot com

I'm only seeing this on 32-bit linux systems, and I see why.  For some
reason, a very bad decision was made to force linking against /usr/lib:

configure:2846: gcc -o conftest -g -O2   conftest.c -R /usr/lib  1>&5
/usr/lib: file not recognized: Is a directory
configure:2879: gcc -o conftest -g -O2   conftest.c -Wl,-rpath,/usr/lib
 1>&5
configure:46629: gcc -o conftest -I/usr/include -g -O2  -L/usr/lib 
-Wl,-rpath,/opt/zimbra/libxml2-2.6.32.1/lib
-L/opt/zimbra/libxml2-2.6.32.1/lib conftest.c -lrt -lresolv -lm -ldl
-lnsl  -
lxml2 -lz -lm -lxml2 -lz -lm 1>&5
configure:46901: gcc -o conftest -I/usr/include -g -O2  -L/usr/lib 
-Wl,-rpath,/opt/zimbra/libxml2-2.6.32.1/lib
-L/opt/zimbra/libxml2-2.6.32.1/lib conftest.c -lrt -lresolv -lm -ldl
-lnsl  -
lxml2 -lz -lm -lxml2 -lz -lm 1>&5


Which of course overrides custom locations.  SEe how -L/usr/lib is used
all over the place.  The reason I don't see it as an issue on 64 bit
RHEL systems is because the libs are in /usr/lib64.

------------------------------------------------------------------------

[2010-01-08 18:07:28] quanah at zimbra dot com

Description:
------------
I build PHP against my own build of libxml2.  However, starting with
PHP 5.2.12, it now links against the system xml2 in addition to my xml2,
causing symbol failures:

# Libraries that this one depends upon.
dependency_libs=' -lcrypt -lcrypt -lrt -lrt -lm -lz -lm -lz -lm -lz -lm
-lcrypt -lz -lm -lz -lm -lz -lm -lcrypt -L/usr/lib
-L/opt/zimbra/libxml2-2.6.32.1/lib -L/opt/zimbra/aspell-0.60.6/lib
-lcrypt -lcrypt /opt/zimbra/aspell-0.60.6/lib/libpspell.la
/opt/zimbra/aspell-0.60.6/lib/libaspell.la -lrt -lrt -lresolv -lm -ldl
-lnsl -lz -lm -lz -lm -lz -lm -lcrypt -lz -lm -lz -lm
/usr/lib/libxml2.la -lpthread -lz -lm -lz -lm -lcrypt'

[build@build01 .libs]$ ldd libphp5.so
<snip>
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00157000)
</snip>

Note my libxml2 is a static library.

Reproduce code:
---------------
Configure against a custom libxml2 build:

./configure --with-libxml-dir=/opt/zimbra/libxml2-2.6.32.1

Expected result:
----------------
Only my libxml2 is used

Actual result:
--------------
System xml2 is linked in


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50695&edit=1



Thread (4 messages)

« previous php.bugs (#146441) next »