com php-src: Fixed bug #71006 (symbol referencing errors on Sparc/Solaris): NEWS Zend/zend_alloc.c Zend/zend_hash.c acinclude .m4 configure.in

From: Date: Thu, 03 Dec 2015 10:28:41 +0000
Subject: com php-src: Fixed bug #71006 (symbol referencing errors on Sparc/Solaris): NEWS Zend/zend_alloc.c Zend/zend_hash.c acinclude .m4 configure.in
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90079@lists.php.net to get a copy of this message
Commit: 59424bb7bd2a5206dddb8575d8f081610be7bf50 Author: Dmitry Stogov <dmitry@zend.com> Thu, 3 Dec 2015 13:28:41 +0300 Parents: 2fabcbfedbd895bcb437298bb94655bcb9556468 Branches: PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=59424bb7bd2a5206dddb8575d8f081610be7bf50 Log: Fixed bug #71006 (symbol referencing errors on Sparc/Solaris) Bugs: https://bugs.php.net/71006 Changed paths: M NEWS M Zend/zend_alloc.c M Zend/zend_hash.c M acinclude.m4 M configure.in Diff: diff --git a/NEWS b/NEWS index e6cf644..e17978c 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2015, PHP 7.0.1 - Core: + . Fixed bug #71006 (symbol referencing errors on Sparc/Solaris). (Dmitry) . Fixed bug #70997 (When using parentClass:: instead of parent::, static context changed). (Dmitry) . Fixed bug #70970 (Segfault when combining error handler with output diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index c9d4de4..6b335d2 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -506,9 +506,9 @@ static void zend_mm_munmap(void *addr, size_t size) /* number of trailing set (1) bits */ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset) { -#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG +#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL) return __builtin_ctzl(~bitset); -#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll) +#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL) return __builtin_ctzll(~bitset); #elif defined(_WIN32) unsigned long index; @@ -545,9 +545,9 @@ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset) /* number of trailing zero bits (0x01 -> 1; 0x40 -> 6; 0x00 -> LEN) */ static zend_always_inline int zend_mm_bitset_ntz(zend_mm_bitset bitset) { -#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG +#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL) return __builtin_ctzl(bitset); -#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll) +#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL) return __builtin_ctzll(bitset); #elif defined(_WIN32) unsigned long index; @@ -1161,7 +1161,7 @@ static zend_always_inline void zend_mm_free_large(zend_mm_heap *heap, zend_mm_ch /* higher set bit number (0->N/A, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 etc) */ static zend_always_inline int zend_mm_small_size_to_bit(int size) { -#if defined(__GNUC__) || __has_builtin(__builtin_clz) +#if (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ) return (__builtin_clz(size) ^ 0x1f) + 1; #elif defined(_WIN32) unsigned long index; diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 283ceb8..ecfee33 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -112,7 +112,7 @@ static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize) rather than using an undefined bis scan result. */ return nSize; } -#elif defined(__GNUC__) || __has_builtin(__builtin_clz) +#elif (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ) return 0x2 << (__builtin_clz(nSize - 1) ^ 0x1f); #else nSize -= 1; diff --git a/acinclude.m4 b/acinclude.m4 index ff2fad6..e828de1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -3050,3 +3050,57 @@ AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_EXPECT], [$have_builtin_expect], [Whether the compiler supports __builtin_expect]) ]) + +dnl PHP_CHECK_BUILTIN_CLZ +AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [ + AC_MSG_CHECKING([for __builtin_clz]) + + AC_TRY_LINK(, [ + return __builtin_clz(1) ? 1 : 0; + ], [ + have_builtin_clz=1 + AC_MSG_RESULT([yes]) + ], [ + have_builtin_clz=0 + AC_MSG_RESULT([no]) + ]) + + AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CLZ], [$have_builtin_clz], [Whether the compiler supports __builtin_clz]) + +]) + +dnl PHP_CHECK_BUILTIN_CTZL +AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [ + AC_MSG_CHECKING([for __builtin_ctzl]) + + AC_TRY_LINK(, [ + return __builtin_ctzl(2L) ? 1 : 0; + ], [ + have_builtin_ctzl=1 + AC_MSG_RESULT([yes]) + ], [ + have_builtin_ctzl=0 + AC_MSG_RESULT([no]) + ]) + + AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZL], [$have_builtin_ctzl], [Whether the compiler supports __builtin_ctzl]) + +]) + +dnl PHP_CHECK_BUILTIN_CTZLL +AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [ + AC_MSG_CHECKING([for __builtin_ctzll]) + + AC_TRY_LINK(, [ + return __builtin_ctzll(2LL) ? 1 : 0; + ], [ + have_builtin_ctzll=1 + AC_MSG_RESULT([yes]) + ], [ + have_builtin_ctzll=0 + AC_MSG_RESULT([no]) + ]) + + AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll]) + +]) diff --git a/configure.in b/configure.in index 859574f..4c0a442 100644 --- a/configure.in +++ b/configure.in @@ -577,6 +577,12 @@ PHP_CHECK_STDINT_TYPES dnl Check __builtin_expect PHP_CHECK_BUILTIN_EXPECT +dnl Check __builtin_clz +PHP_CHECK_BUILTIN_CLZ +dnl Check __builtin_ctzl +PHP_CHECK_BUILTIN_CTZL +dnl Check __builtin_ctzll +PHP_CHECK_BUILTIN_CTZLL dnl Check for members of the stat structure AC_STRUCT_ST_BLKSIZE

« previous php.cvs (#90079) next »