From ced351c483bb80ec9bc3d6110026ea8560fcc7a4 Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Sun, 25 Aug 2024 15:56:37 +0200 Subject: [PATCH] Autotools: fix configure check for aarch64 CRC32 API On arm32 bit the check succeeds leading to a build error later on: /home/autobuild/autobuild/instance-3/output-1/build/php-8.3.10/ext/standard/crc32.c:70:12: error: 'armv8-a' does not support feature 'nothing' 70 | # pragma GCC target ("+nothing+crc") Co-authored-by: Thomas Petazzoni [http://lists.busybox.net/pipermail/buildroot/2024-August/761151.html] Signed-off-by: Bernd Kuhls --- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 491963daae227..2693ba09f4af9 100644 --- a/configure.ac +++ b/configure.ac @@ -696,7 +696,19 @@ AC_FUNC_ALLOCA PHP_TIME_R_TYPE AC_CACHE_CHECK([for aarch64 CRC32 API], [php_cv_func___crc32d], -[AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [__crc32d(0, 0);])], +[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);])], [php_cv_func___crc32d=yes], [php_cv_func___crc32d=no])]) AS_VAR_IF([php_cv_func___crc32d], [yes],