com php-src: Work around compiler flag dependent ABI: Zend/zend_portability.h configure.ac
| From: | Nikita Popov | Date: | Thu, 14 Feb 2019 08:59:10 +0000 |
| Subject: | com php-src: Work around compiler flag dependent ABI: Zend/zend_portability.h configure.ac | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104624@lists.php.net to get a copy of this message | ||
Commit: 7bc162f928fe8144eddf95ca4bda5377787c8720
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 13 Feb 2019 16:52:46 +0100
Parents: a89948320b7f835fa1dfe8dc3fc3f369304e5893
Branches: PHP-7.3 PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7bc162f928fe8144eddf95ca4bda5377787c8720
Log:
Work around compiler flag dependent ABI
Changed paths:
M Zend/zend_portability.h
M configure.ac
Diff:
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index 108eb7e..12e99b7 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -577,7 +577,7 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */
# define ZEND_INTRIN_SSSE3_FUNC_DECL(func)
#endif
-#ifdef __SSE4_2__
+#if defined(HAVE_SSE4_2_DEF) || (defined(ZEND_WIN32) && defined(__SSE4_2__))
/* Instructions compiled directly. */
# define ZEND_INTRIN_SSE4_2_NATIVE 1
#elif (defined(HAVE_FUNC_ATTRIBUTE_TARGET) && defined(PHP_HAVE_SSE4_2)) ||
defined(ZEND_WIN32)
diff --git a/configure.ac b/configure.ac
index 809f783...c1a9b9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -565,6 +565,24 @@ PHP_CHECK_CPU_SUPPORTS([sse4.2])
PHP_CHECK_CPU_SUPPORTS([avx])
PHP_CHECK_CPU_SUPPORTS([avx2])
+dnl The ABI of php_addslashes in PHP 7.3 is dependent on __SSE4_2__,
+dnl which depends on target attributes. Use this check to make sure that
+dnl SSE 4.2 availability during the PHP compilation is used, independently
+dnl of whether extensions are compiled with SSE 4.2 support.
+AC_MSG_CHECKING([whether __SSE4_2__ is defined])
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+int main() {
+#if defined(__SSE4_2__)
+ return 0;
+#else
+ return 1;
+#endif
+}
+]])], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_SSE4_2_DEF, 1, [Define if __SSE4_2__ has been defined])
+], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([no])])
+
dnl Check for members of the stat structure
AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exist