Skip to content

Commit 5c44610

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-15587: Autotools: fix configure check for aarch64 CRC32 API
2 parents cd6bac7 + 5947db6 commit 5c44610

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
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

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,25 @@ AC_FUNC_ALLOCA
753753
PHP_TIME_R_TYPE
754754
PHP_CHECK_IN_ADDR_T
755755

756-
AC_CACHE_CHECK([for aarch64 CRC32 API], ac_cv_func___crc32d,
757-
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <arm_acle.h>]],[[__crc32d(0, 0);]])],[ac_cv_func___crc32d=yes],[ac_cv_func___crc32d="no"])])
758-
if test "$ac_cv_func___crc32d" = "yes"; then
759-
AC_DEFINE([HAVE_AARCH64_CRC32], [1], [Define when aarch64 CRC32 API is available.])
760-
fi
756+
AC_CACHE_CHECK([for aarch64 CRC32 API], [ac_cv_func___crc32d],
757+
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
758+
#include <arm_acle.h>
759+
# if defined(__GNUC__)
760+
# if!defined(__clang__)
761+
# pragma GCC push_options
762+
# pragma GCC target ("+nothing+crc")
763+
# elif defined(__APPLE__)
764+
# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function)
765+
# else
766+
# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
767+
# endif
768+
# endif
769+
], [__crc32d(0, 0);])],
770+
[ac_cv_func___crc32d=yes],
771+
[ac_cv_func___crc32d=no])])
772+
AS_VAR_IF([ac_cv_func___crc32d], [yes],
773+
[AC_DEFINE([HAVE_AARCH64_CRC32], [1],
774+
[Define to 1 when aarch64 CRC32 API is available.])])
761775

762776
dnl Check for asm goto support.
763777
AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,

0 commit comments

Comments
 (0)