From e0b35eef37679c719a15d115c95f6dbdb69d1607 Mon Sep 17 00:00:00 2001 From: Jeremie Courreges-Anglas Date: Tue, 25 Jul 2023 13:56:09 +0200 Subject: [PATCH] On riscv64 require libatomic if actually needed clang and newer gcc releases support byte-sized atomic accesses on riscv64 through inline builtins. In both cases the hard dependency on libatomic added by GH-11321 isn't useful. Stop using AC_CHECK_LIB() which is too naive to notice that libatomic isn't needed. Instead, PHP_CHECK_FUNC() will retry the check with -latomic if required. --- configure.ac | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 6cf6370fca3b8..3fc0790ea8ae2 100644 --- a/configure.ac +++ b/configure.ac @@ -369,11 +369,7 @@ AC_CHECK_LIB(m, sin) case $host_alias in riscv64*) - AC_CHECK_LIB(atomic, __atomic_exchange_1, [ - PHP_ADD_LIBRARY(atomic) - ], [ - AC_MSG_ERROR([Problem with enabling atomic. Please check config.log for details.]) - ]) + PHP_CHECK_FUNC(__atomic_exchange_1, atomic) ;; esac