php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50517 EXTRA_LDFLAGS polluted by wrong entries
Submitted: 2009-12-18 14:02 UTC Modified: 2009-12-22 09:57 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Bjorn dot Wiberg at its dot uu dot se Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.*, 6 OS: IBM AIX 5.3 5300-08-01-0819
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: Bjorn dot Wiberg at its dot uu dot se
New email:
PHP Version: OS:

 

 [2009-12-18 14:02 UTC] Bjorn dot Wiberg at its dot uu dot se
Description:
------------
As of PHP 5.2.12, the EXTRA_LDFLAGS line in the Makefile (after running configure) contains the directory pointed to by --with-libxml-dir=/usr/local too late, i.e. after -L/usr/lib, causing the IBM bundled /usr/lib/libxml2.a(libxml2.shr.o) to also be included during linking instead of only /usr/local/lib/libxml2.a(libxml2.so.2).

This despite no changes on the configure line since PHP 5.2.11.

I just wanted to alert you that this may cause problems (unnecessary dependency problems and probably a version collision between the two XML libraries) for those on IBM AIX.

A possible workaround is to specify EXTRA_LDFLAGS=/usr/local/lib ./configure ... so that configure will pick it up and specify it first among the EXTRA_LDFLAGS.

Reproduce code:
---------------
#! /bin/sh
#
# Created by configure

'./configure' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-cli' \
'--enable-dba' \
'--enable-dbase' \
'--enable-debug' \
'--enable-exif' \
'--enable-embedded-mysqli' \
'--enable-flatfile' \
'--enable-ftp' \
'--enable-gd-jis-conv' \
'--enable-gd-native-ttf' \
'--enable-inifile' \
'--enable-mbstring' \
'--enable-shmop' \
'--enable-soap' \
'--enable-sockets' \
'--enable-sqlite-utf8' \
'--enable-sysvmsg' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-zip' \
'--enable-zend-multibyte' \
'--prefix=/apache/php' \
'--with-apxs2=/apache/bin/apxs' \
'--with-bz2' \
'--with-cdb' \
'--with-curl' \
'--with-freetype-dir' \
'--with-gd' \
'--with-gdbm' \
'--with-gettext' \
'--with-jpeg-dir' \
'--with-ldap' \
'--with-libxml-dir=/usr/local' \
'--with-mime-magic' \
'--with-mysql=/usr/local/mysql' \
'--with-openssl=/opt/freeware' \
'--with-png-dir' \
'--with-ttf' \
'--with-xmlrpc' \
'--with-xpm-dir' \
'--with-xsl' \
'--with-zlib' \
'--with-zlib-dir' \
"$@"


bwiberg@melody-lp04:~$ /usr/local/bin/xml2-config --libs
-L/usr/local/lib -lxml2 -lz -lpthread -liconv -lm


Expected result:
----------------
No change in EXTRA_LDFLAGS between the versions.

Actual result:
--------------
PHP 5.2.12:

EXTRA_LDFLAGS = -Wl,-brtl -Wl,-bI:$(INSTALL_ROOT)/apache/modules/httpd.exp -avoid-version -module -L/usr/lib -L/usr/local/lib -L/usr/local/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/usr/X11R6/lib -L/usr/X11R6
/lib -L/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/local/lib -L/opt/freeware/lib -L/usr/X11R6/lib -L/usr/local/mysql/lib

(Notice -L/usr/lib popping up before -L/usr/local/lib. Also notice the X11R6 and MySQL stuff popping up here.)


PHP 5.2.11:

EXTRA_LDFLAGS = -Wl,-brtl -Wl,-bI:$(INSTALL_ROOT)/apache/modules/httpd.exp -avoid-version -module -L/usr/local/lib -L/opt/freeware/lib -L/usr/X11R6/lib -L/usr/local/mysql/lib


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-18 14:03 UTC] Bjorn dot Wiberg at its dot uu dot se
By the way, no such "anomalies" in PHP 5.3.1 (i.e. everything still works with PHP 5.3.1).
 [2009-12-18 16:25 UTC] Bjorn dot Wiberg at its dot uu dot se
Correction:

EXTRA_LDFLAGS="-L/usr/local/lib" ./configure ...

...should be used as a workaround.
 [2009-12-18 18:07 UTC] jani@php.net
Do you have LDFLAGS set to something there?
 [2009-12-18 21:22 UTC] Bjorn dot Wiberg at its dot uu dot se
No, LDFLAGS is not set at all. (I guess LDFLAGS could be used instead of EXTRA_LDFLAGS for the workaround.)
 [2009-12-21 15:11 UTC] jani@php.net
Does PHP_5_3 cause same thing? (not 5.3.1 since I think the bug was introduced later..)
 [2009-12-21 16:02 UTC] Bjorn dot Wiberg at its dot uu dot se
Tried with PHP 5.3dev200912211530 (latest snapshot) which yields:

EXTRA_LDFLAGS = -Wl,-brtl -Wl,-bI:$(INSTALL_ROOT)/apache/modules/httpd.exp -avoid-version -module -liconv -L/usr/lib -Wl,-bbigtoc -L/usr/local/lib -L/usr/local/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/usr/X
11R6/lib -L/usr/X11R6/lib -L/usr -L/usr -L/usr/local/lib -L/opt/freeware/lib -L/usr/X11R6/lib -L/usr

So, yes, it appears that this was introduced some time after the PHP 5.3.1 release.
 [2009-12-22 09:57 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=292470
Log: - Fixed bug #50517 (EXTRA_LDFLAGS polluted by wrong entries)

# Until someone shows me use case for LDFLAGS, this is gone.
# This was wrong place to import it anyway.
 [2009-12-22 09:57 UTC] jani@php.net
Fixed now. 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 05:01:38 2025 UTC