1
1

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 #1487

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
Nathan Hjelm 2016-04-12 10:00:22 -06:00
родитель 4135cdf2c5
Коммит 98ce659e0b

Просмотреть файл

@ -88,7 +88,9 @@ AC_DEFUN([OPAL_CHECK_SYNC_BUILTIN_CSWAP_INT128], [
AC_DEFUN([OPAL_CHECK_SYNC_BUILTINS], [
AC_MSG_CHECKING([for __sync builtin atomics])
AC_TRY_LINK([], [__sync_synchronize()],
AC_TRY_LINK([long tmp;], [__sync_synchronize();
__sync_bool_compare_and_swap(&tmp, 0, 1);
__sync_add_and_fetch(&tmp, 1);],
[AC_MSG_RESULT([yes])
$1],
[AC_MSG_RESULT([no])