diff options
author | Xinchen Hui <laruence@gmail.com> | 2018-03-01 18:34:39 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2018-03-01 18:34:39 +0800 |
commit | 12ee810960cf949e034eb70be948e9c54864b717 (patch) | |
tree | 7e5b719cb1dbf91fd443e110403dd196575381f5 | |
parent | 966923f4be3b50a5a89d15bea9ca9bc874d231db (diff) | |
download | php-git-12ee810960cf949e034eb70be948e9c54864b717.tar.gz |
Attempt to fix build with gcc-4.8
-rw-r--r-- | Zend/zend_portability.h | 7 |
1 files changed, 6 insertions, 1 deletions
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 |