Skip to content

Commit c4b3ca9

Browse files
hjelmnbosilca
authored andcommitted
config: check for more __sync builtins
This commit updates the check for __sync builtin atomics to see if the compiler supports both __sync_bool_compare_and_swap and __sync_add_and_fetch. If either of these functions are not available then we can't use the __sync builtins. Fixes open-mpi#1487 Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 39dade8 commit c4b3ca9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

config/opal_config_asm.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ AC_DEFUN([OPAL_CHECK_SYNC_BUILTIN_CSWAP_INT128], [
8888
AC_DEFUN([OPAL_CHECK_SYNC_BUILTINS], [
8989
AC_MSG_CHECKING([for __sync builtin atomics])
9090
91-
AC_TRY_LINK([], [__sync_synchronize()],
91+
AC_TRY_LINK([long tmp;], [__sync_synchronize();
92+
__sync_bool_compare_and_swap(&tmp, 0, 1);
93+
__sync_add_and_fetch(&tmp, 1);],
9294
[AC_MSG_RESULT([yes])
9395
$1],
9496
[AC_MSG_RESULT([no])

0 commit comments

Comments
 (0)