php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50695 PHP uses system XML2 when custom xml2 is given
Submitted: 2010-01-08 18:07 UTC Modified: 2010-01-09 18:45 UTC
From: quanah at zimbra dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.2.12 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: quanah at zimbra dot com
New email:
PHP Version: OS:

 

 [2010-01-08 18:07 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-08 18:13 UTC] 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:17 UTC] quanah at zimbra dot com
As seen here:

s%@EXTRA_LDFLAGS@% -avoid-version -module -L/usr/lib <....>
 [2010-01-09 18:45 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

It's already fixed for next release.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 15:00:01 2026 UTC