Skip to content

Commit 5947db6

Browse files
bkuhlstpetazzoni
authored andcommitted
Fix GH-15587: 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 <[email protected]> [http://lists.busybox.net/pipermail/buildroot/2024-August/761151.html] Signed-off-by: Bernd Kuhls <[email protected]>
1 parent 4b6575a commit 5947db6

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PHP NEWS
99
. Fixed bug GH-15514 (Configure error: genif.sh: syntax error). (Peter Kokot)
1010
. Fixed bug GH-15565 (--disable-ipv6 during compilation produces error
1111
EAI_SYSTEM not found). (nielsdos)
12+
. Fixed bug GH-15587 (CRC32 API build error on arm 32-bit).
13+
(Bernd Kuhls, Thomas Petazzoni)
1214

1315
- DOM:
1416
. Fixed bug GH-15551 (Segmentation fault (access null pointer) in

configure.ac

+19-5
Original file line numberDiff line numberDiff line change
@@ -738,11 +738,25 @@ AC_FUNC_ALLOCA
738738
PHP_TIME_R_TYPE
739739
PHP_CHECK_IN_ADDR_T
740740

741-
AC_CACHE_CHECK([for aarch64 CRC32 API], ac_cv_func___crc32d,
742-
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <arm_acle.h>]],[[__crc32d(0, 0);]])],[ac_cv_func___crc32d=yes],[ac_cv_func___crc32d="no"])])
743-
if test "$ac_cv_func___crc32d" = "yes"; then
744-
AC_DEFINE([HAVE_AARCH64_CRC32], [1], [Define when aarch64 CRC32 API is available.])
745-
fi
741+
AC_CACHE_CHECK([for aarch64 CRC32 API], [ac_cv_func___crc32d],
742+
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
743+
#include <arm_acle.h>
744+
# if defined(__GNUC__)
745+
# if!defined(__clang__)
746+
# pragma GCC push_options
747+
# pragma GCC target ("+nothing+crc")
748+
# elif defined(__APPLE__)
749+
# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function)
750+
# else
751+
# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
752+
# endif
753+
# endif
754+
], [__crc32d(0, 0);])],
755+
[ac_cv_func___crc32d=yes],
756+
[ac_cv_func___crc32d=no])])
757+
AS_VAR_IF([ac_cv_func___crc32d], [yes],
758+
[AC_DEFINE([HAVE_AARCH64_CRC32], [1],
759+
[Define to 1 when aarch64 CRC32 API is available.])])
746760

747761
dnl Check for asm goto support.
748762
AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,

0 commit comments

Comments
 (0)