php-src/TSRM
Fabrice Fontaine e6bbc00964 Fix pthreads detection when cross-compiling
pthreads are not working when cross-compiling, indeed configure
sets pthreads_working to no if cross_compiling is detected.
This behavior is implemented in PTHREADS_CHECK. This function call
AC_CACHE_CHECK twice to retrieve ac_cv_pthreads_cflags and
ac_cv_pthreads_lib.
In these calls, the function PTHREADS_CHECK_COMPILE will call AC_TRY_RUN
function which will update the global pthreads_working variable.
This is not compliant with autoconf AC_CACHE_CHECK rules which specify
that "The commands-to-set-it must have no side effects except for
setting the variable cache-id".

So, this patch replaces pthread_working assignments with assignments on
a new local pthread_checked variable. Value of ptreads_working is
computed outside AC_CACHE_CHECK function depending on value of
ac_cv_pthreads_cflags and ac_cv_pthreads_lib.

Moreover, AC_TRY_RUN call is replaced by AC_TRY_LINK which will work
when cross-compiling.

Without this modification, thread safety option (--enable-maintainer-zts)
can not be enabled on embedded buildsystems such as buildroot.

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
2016-10-11 15:16:26 +02:00
..
m4 fix #71609: Segmentation fault on ZTS with gethostbyname 2016-03-31 12:39:01 +01:00
acinclude.m4 MFB_4_3: Quote macro names in AC_DEFUN() 2004-12-30 07:08:39 +00:00
build.mk Get rid of autoconf warnings 2011-05-16 00:14:47 +00:00
buildconf
config.w32 moved most of the core to use static tsrm ls cache pointer 2014-10-15 16:33:40 +02:00
configure.in reworked the patch, less new stuff but worky 2014-09-25 18:48:27 +02:00
LICENSE - Update to 2006 2006-01-04 23:55:42 +00:00
Makefile.am initial move on renaming files and fixing includes 2013-10-17 09:43:52 +02:00
readdir.h fix warnings 2008-07-30 17:45:18 +00:00
threads.m4 Fix pthreads detection when cross-compiling 2016-10-11 15:16:26 +02:00
TODO
TSRM.c don't pass zero to malloc() 2015-03-10 09:10:23 +01:00
TSRM.h Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE 2016-03-03 16:50:01 +01:00
tsrm.m4 fix #71609: Segmentation fault on ZTS with gethostbyname 2016-03-31 12:39:01 +01:00
tsrm_config.w32.h Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012 2014-01-04 01:41:27 +01:00
tsrm_config_common.h Fixed the UTF-8 and long path support in the streams on Windows. 2016-06-20 12:45:39 +02:00
tsrm_nw.c bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
tsrm_nw.h bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
tsrm_strtok_r.c trailing whitespace removal 2015-01-10 15:07:38 -08:00
tsrm_strtok_r.h properly export tsrm_strtok_r() 2014-10-05 13:20:27 +02:00
tsrm_win32.c Merge branch 'PHP-7.1' 2016-08-29 21:49:28 +02:00
tsrm_win32.h sync shm* implementation signatures with POSIX 2016-08-23 00:27:17 +02:00