Skip to content

Commit 4a9bc7f

Browse files
nobuXrXr
authored andcommitted
configure: always check for atomic/sync builtins [Bug #17787]
Non-gcc compilers tend to have this intrinsic these days, e.g. xlc has `__sync` builtins.
1 parent 60c7cbc commit 4a9bc7f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

configure.ac

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,9 @@ AS_IF([test "$GCC" = yes], [
15581558
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
15591559
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
15601560
])
1561+
])
15611562

1563+
{
15621564
AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
15631565
AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned int atomic_var;]],
15641566
[[
@@ -1589,7 +1591,6 @@ AS_IF([test "$GCC" = yes], [
15891591
AS_IF([test "$rb_cv_gcc_sync_builtins" = yes], [
15901592
AC_DEFINE(HAVE_GCC_SYNC_BUILTINS)
15911593
])
1592-
])
15931594

15941595
AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
15951596
[RUBY_WERROR_FLAG(
@@ -1602,6 +1603,7 @@ AS_IF([test "$GCC" = yes], [
16021603
AS_IF([test "$rb_cv_func___builtin_unreachable" = yes], [
16031604
AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
16041605
])
1606+
}
16051607

16061608
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
16071609
rb_cv_func_exported=no

0 commit comments

Comments
 (0)