diff --git a/NEWS b/NEWS index 5c61d900352..64ee19b61ba 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ PHP NEWS . Fixed bug GH-15514 (Configure error: genif.sh: syntax error). (Peter Kokot) . Fixed bug GH-15565 (--disable-ipv6 during compilation produces error EAI_SYSTEM not found). (nielsdos) + . Fixed bug GH-15587 (CRC32 API build error on arm 32-bit). + (Bernd Kuhls, Thomas Petazzoni) - DOM: . Fixed bug GH-15551 (Segmentation fault (access null pointer) in diff --git a/configure.ac b/configure.ac index 54a4d037f78..d86aa0e4852 100644 --- a/configure.ac +++ b/configure.ac @@ -753,11 +753,25 @@ AC_FUNC_ALLOCA PHP_TIME_R_TYPE PHP_CHECK_IN_ADDR_T -AC_CACHE_CHECK([for aarch64 CRC32 API], ac_cv_func___crc32d, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[__crc32d(0, 0);]])],[ac_cv_func___crc32d=yes],[ac_cv_func___crc32d="no"])]) -if test "$ac_cv_func___crc32d" = "yes"; then - AC_DEFINE([HAVE_AARCH64_CRC32], [1], [Define when aarch64 CRC32 API is available.]) -fi +AC_CACHE_CHECK([for aarch64 CRC32 API], [ac_cv_func___crc32d], +[AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include +# if defined(__GNUC__) +# if!defined(__clang__) +# pragma GCC push_options +# pragma GCC target ("+nothing+crc") +# elif defined(__APPLE__) +# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function) +# else +# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function) +# endif +# endif +], [__crc32d(0, 0);])], +[ac_cv_func___crc32d=yes], +[ac_cv_func___crc32d=no])]) +AS_VAR_IF([ac_cv_func___crc32d], [yes], + [AC_DEFINE([HAVE_AARCH64_CRC32], [1], + [Define to 1 when aarch64 CRC32 API is available.])]) dnl Check for asm goto support. AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,