php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31256 PHP_EVAL_LIBLINE doesn't handle -pthread
Submitted: 2004-12-22 20:10 UTC Modified: 2005-06-13 10:44 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: caelian at gmail dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5CVS, 4CVS OS: *
Private report: No CVE-ID: None
 [2004-12-22 20:10 UTC] caelian at gmail dot com
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-13 10:44 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC