Skip to content

Commit bf3fb4e

Browse files
jcourregespetk
authored andcommitted
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. Closes GH-11790
1 parent c8f6ee8 commit bf3fb4e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PHP NEWS
44

55
- Core:
66
. Fixed bug GH-11937 (Constant ASTs containing objects). (ilutov)
7+
. Fixed bug GH-11790 (On riscv64 require libatomic if actually needed).
8+
(Jeremie Courreges-Anglas)
79

810
- DOM:
911
. Fix memory leak when setting an invalid DOMDocument encoding. (nielsdos)

configure.ac

+1-5
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,7 @@ AC_CHECK_LIB(m, sin)
369369

370370
case $host_alias in
371371
riscv64*)
372-
AC_CHECK_LIB(atomic, __atomic_exchange_1, [
373-
PHP_ADD_LIBRARY(atomic)
374-
], [
375-
AC_MSG_ERROR([Problem with enabling atomic. Please check config.log for details.])
376-
])
372+
PHP_CHECK_FUNC(__atomic_exchange_1, atomic)
377373
;;
378374
esac
379375

0 commit comments

Comments
 (0)