#541 closed defect (fixed)
geos SVN fails to build php interface when php is compiled with threads
Reported by: | temptorsent | Owned by: | benmorel |
---|---|---|---|
Priority: | major | Milestone: | GEOS Fund Me |
Component: | PHP | Version: | main |
Severity: | Significant | Keywords: | TSRMLS_CC, PHP, threads, compile failure |
Cc: | benmorel |
Description
Building geos from SVN under funtoo (with applied patch from ticket #513 to support php5.4) against PHP 5.4.2 and apache 2.2.22 compiled with threads enabled results in:
Making all in php make[1]: Entering directory `/var/tmp/portage/sci-libs/geos-9999/work/geos-9999/php' Making all in . make[2]: Entering directory `/var/tmp/portage/sci-libs/geos-9999/work/geos-9999/php' /bin/sh ../libtool --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../include -I../include/geos `/usr/bin/php-config --includes` -DCOMPILE_DL_GEOS -I../capi -I../include -pedantic -Wall -ansi -Wno-long-long -ffloat-store -std=gnu99 -march=corei7 -O2 -pipe -c -o geos_la-geos.lo `test -f 'geos.c' || echo './'`geos.c libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../include -I../include/geos -I/usr/lib64/php5.4/include/php -I/usr/lib64/php5.4/include/php/main -I/usr/lib64/php5.4/include/php/TSRM -I/usr/lib64/php5.4/include/php/Zend -I/usr/lib64/php5.4/include/php/ext -I/usr/lib64/php5.4/include/php/ext/date/lib -DCOMPILE_DL_GEOS -I../capi -I../include -pedantic -Wall -ansi -Wno-long-long -ffloat-store -std=gnu99 -march=corei7 -O2 -pipe -c geos.c -fPIC -DPIC -o .libs/geos_la-geos.o geos.c: In function 'noticeHandler': geos.c:87:27: error: 'tsrm_ls' undeclared (first use in this function) geos.c:87:27: note: each undeclared identifier is reported only once for each function it appears in geos.c: In function 'errorHandler': geos.c:99:56: error: expected expression before ',' token geos.c:99:56: error: 'tsrm_ls' undeclared (first use in this function) geos.c:99:56: error: too many arguments to function 'zend_exception_get_default' /usr/lib64/php5.4/include/php/Zend/zend_exceptions.h:37:28: note: declared here geos.c: In function 'setRelay': geos.c:111:61: error: 'tsrm_ls' undeclared (first use in this function) geos.c: In function 'getRelay': geos.c:117:62: error: 'tsrm_ls' undeclared (first use in this function) geos.c: In function 'Gen_create_obj': geos.c:159:11: warning: unused variable 'tmp' [-Wunused-variable] geos.c: In function 'dumpGeometry': geos.c:435:9: error: 'tsrm_ls' undeclared (first use in this function) geos.c: In function 'Geometry_create_obj': geos.c:457:5: warning: passing argument 2 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'void ***' but argument is of type 'void (*)(void *, void ***)' geos.c:457:5: warning: passing argument 3 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'zend_objects_free_object_storage_t' but argument is of type 'struct zend_object_handlers *' geos.c:457:5: error: too few arguments to function 'Gen_create_obj' geos.c:156:1: note: declared here geos.c: In function 'WKTReader_create_obj': geos.c:1967:5: warning: passing argument 2 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'void ***' but argument is of type 'void (*)(void *, void ***)' geos.c:1967:5: warning: passing argument 3 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'zend_objects_free_object_storage_t' but argument is of type 'struct zend_object_handlers *' geos.c:1967:5: error: too few arguments to function 'Gen_create_obj' geos.c:156:1: note: declared here geos.c: In function 'WKTWriter_create_obj': geos.c:2054:5: warning: passing argument 2 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'void ***' but argument is of type 'void (*)(void *, void ***)' geos.c:2054:5: warning: passing argument 3 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'zend_objects_free_object_storage_t' but argument is of type 'struct zend_object_handlers *' geos.c:2054:5: error: too few arguments to function 'Gen_create_obj' geos.c:156:1: note: declared here geos.c: In function 'WKBWriter_create_obj': geos.c:2231:5: warning: passing argument 2 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'void ***' but argument is of type 'void (*)(void *, void ***)' geos.c:2231:5: warning: passing argument 3 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'zend_objects_free_object_storage_t' but argument is of type 'struct zend_object_handlers *' geos.c:2231:5: error: too few arguments to function 'Gen_create_obj' geos.c:156:1: note: declared here geos.c: In function 'WKBReader_create_obj': geos.c:2425:5: warning: passing argument 2 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'void ***' but argument is of type 'void (*)(void *, void ***)' geos.c:2425:5: warning: passing argument 3 of 'Gen_create_obj' from incompatible pointer type [enabled by default] geos.c:156:1: note: expected 'zend_objects_free_object_storage_t' but argument is of type 'struct zend_object_handlers *' geos.c:2425:5: error: too few arguments to function 'Gen_create_obj' geos.c:156:1: note: declared here geos.c:2426:1: warning: control reaches end of non-void function [-Wreturn-type] geos.c: In function 'WKBWriter_create_obj': geos.c:2232:1: warning: control reaches end of non-void function [-Wreturn-type] geos.c: In function 'Geometry_create_obj': geos.c:458:1: warning: control reaches end of non-void function [-Wreturn-type] geos.c: In function 'WKTWriter_create_obj': geos.c:2055:1: warning: control reaches end of non-void function [-Wreturn-type] geos.c: In function 'WKTReader_create_obj': geos.c:1968:1: warning: control reaches end of non-void function [-Wreturn-type] make[2]: *** [geos_la-geos.lo] Error 1 make[2]: Leaving directory `/var/tmp/portage/sci-libs/geos-9999/work/geos-9999/php' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/sci-libs/geos-9999/work/geos-9999/php' make: *** [all-recursive] Error 1
Disabling threading results in a successful compilation. The problem children appear to be the TSRMLS_CC macros scattered throughout. The variable tsrm_ls not defined anywhere in the scope, and I suspect that the macro may be misused in some places.
Change History (12)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Milestone: | 3.3.4 → GEOS Future |
---|
comment:3 by , 9 years ago
Cc: | added |
---|
Any update on this issue? Two years later, compilation is still failing on PHP 5.4, 5.5 and 5.6 threaded versions.
comment:4 by , 9 years ago
Nobody found the time to produce a patch, evidently. I haven't had this problem, personally. If you attach a patch I'm happy to apply it.
comment:5 by , 9 years ago
Thanks for the update! I don't have the knowledge to produce such a patch, unfortunately. Hopefully someone who does will come across this!
comment:6 by , 9 years ago
Owner: | changed from | to
---|
I think nailed that one after all. Please see this pull request:
comment:7 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patches welcome. Note that GEOS isn't thread safe in itself.