From: caelian at gmail dot com
Operating system: FreeBSD
PHP version: 5.0.3
PHP Bug Type: Compile Failure
Bug description: PHP_EVAL_LIBLINE doesn't handle -pthread
Description:
------------
It looks like FreeBSD uses gcc's -pthread switch to specify whether or not
something should be linked against a POSIX Threading Library
(libpthread|libthr|libc_r) ...
This is apparent e.g. when building libxml2 the generated xml2-config
utility (which is used by PHPs build system) gives the following outputfor
the --libs target
-L/usr/local/lib -lxml2 -lz -pthread -L/usr/local/lib -liconv -lm
As far as i can tell this data is processed in the PHP_EVAL_LIBLINE
m4-macro contained in PHP's acinclude.m4 (passed from ext/xml/config.m4)
And as far as i can tell from the generated configure script it seems to
only handle the -l* and -L* entries.
This causes the configure phase for every php-extension that uses -pthread
in its library definitions to fail because of missing pthread_* symbols.
Reproduce code:
---------------
Simply try to build any php5-extension module that depends on libxml2
where libxml2 is build with threads-support.
Expected result:
----------------
I expect the configure phase to complete successfully.
Actual result:
--------------
configure:2643: checking whether libxml build works
configure:2672: cc -o conftest -O2 -fno-strict-aliasing -pipe
-march=pentium2
conftest.c
-R/usr/local/lib -L/usr/local/lib -R/usr/local/lib
-L/usr/local/lib -lxml2 -lz -liconv -lm
>&5
/usr/local/lib/libxml2.so: undefined reference to `pthread_equal'
configure:2675: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 2660 "configure"
#include "confdefs.h"
char xmlInitParser();
int main() {
xmlInitParser();
return 0;
}
configure:2696: result: no
configure:2698: error: build test failed. Please check the config.log for
details.
--
Edit bug report at http://bugs.php.net/?id=31256&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31256&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31256&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31256&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31256&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31256&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31256&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31256&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31256&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31256&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31256&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31256&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31256&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31256&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31256&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31256&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31256&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31256&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31256&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31256&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31256&r=mysqlcfg