From: Xinchen Hui Date: Thu, 1 Mar 2018 10:34:39 +0000 (+0800) Subject: Attempt to fix build with gcc-4.8 X-Git-Tag: php-7.3.0alpha1~276 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12ee810960cf949e034eb70be948e9c54864b717;p=php Attempt to fix build with gcc-4.8 --- diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 02286da37b..4bbe023bdf 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -538,7 +538,12 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */ # define PHP_HAVE_SSE4_2 # endif -# if PHP_HAVE_AVX2_INSTRUCTIONS && defined(HAVE_IMMINTRIN_H) +/* + * AVX2 support was added in gcc 4.7, but AVX2 intrinsics don't work in + * __attribute__((target("avx2"))) functions until gcc 4.9. + */ +# if PHP_HAVE_AVX2_INSTRUCTIONS && defined(HAVE_IMMINTRIN_H) && \ + (defined(__llvm__) || defined(__clang__) || (defined(__GNUC__) && ZEND_GCC_VERSION >= 4009)) # define PHP_HAVE_AVX2 # endif #endif