Commit 63d0c6a3 authored by Mukund Sivaraman's avatar Mukund Sivaraman

Fix configure issue detecting stdatomic.h support (#46959)

parent 54c4adef
4871. [bug] Fix configure glitch in detecting stdatomic.h
support on systems with multiple compilers.
[RT #46959]
4870. [test] Update included ATF library to atf-0.21 preserving
the ATF tool. [RT #46967]
......
......@@ -451,9 +451,6 @@ int sigwait(const unsigned int *set, int *sig);
/* Define to 1 if you have the `setresuid' function. */
#undef HAVE_SETRESUID
/* Define to 1 if you have the <stdatomic.h> header file. */
#undef HAVE_STDATOMIC_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
......
......@@ -20200,22 +20200,36 @@ done
# Machine architecture dependent features
#
have_stdatomic=no
for ac_header in stdatomic.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default"
if test "x$ac_cv_header_stdatomic_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STDATOMIC_H 1
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable stdatomic.h" >&5
$as_echo_n "checking for usable stdatomic.h... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
#include <stdatomic.h>
int
main ()
{
atomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);
;
return 0;
}
_ACEOF
have_stdatomic=yes
ISC_PLATFORM_HAVESTDATOMIC="#define ISC_PLATFORM_HAVESTDATOMIC 1"
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
have_stdatomic=yes
ISC_PLATFORM_HAVESTDATOMIC="#define ISC_PLATFORM_HAVESTDATOMIC 1"
else
have_stdatomic=no
ISC_PLATFORM_HAVESTDATOMIC="#undef ISC_PLATFORM_HAVESTDATOMIC"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
have_stdatomic=no
ISC_PLATFORM_HAVESTDATOMIC="#undef ISC_PLATFORM_HAVESTDATOMIC"
fi
done
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Check whether --enable-atomic was given.
if test "${enable_atomic+set}" = set; then :
......
......@@ -4086,11 +4086,20 @@ AC_CHECK_FUNCS(nanosleep usleep explicit_bzero)
# Machine architecture dependent features
#
have_stdatomic=no
AC_CHECK_HEADERS(stdatomic.h,
[have_stdatomic=yes
ISC_PLATFORM_HAVESTDATOMIC="#define ISC_PLATFORM_HAVESTDATOMIC 1"],
[have_stdatomic=no
ISC_PLATFORM_HAVESTDATOMIC="#undef ISC_PLATFORM_HAVESTDATOMIC"])
AC_MSG_CHECKING(for usable stdatomic.h)
AC_TRY_COMPILE([
#include <stdio.h>
#include <stdatomic.h>
],
[
atomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);
],
[AC_MSG_RESULT(yes)
have_stdatomic=yes
ISC_PLATFORM_HAVESTDATOMIC="#define ISC_PLATFORM_HAVESTDATOMIC 1"],
[AC_MSG_RESULT(no)
have_stdatomic=no
ISC_PLATFORM_HAVESTDATOMIC="#undef ISC_PLATFORM_HAVESTDATOMIC"])
AC_ARG_ENABLE(atomic,
AS_HELP_STRING([--enable-atomic],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment