From: Bart Van Assche Date: Thu, 26 Jun 2008 08:43:12 +0000 (+0000) Subject: Added configure test for the gcc/icc built-in functions for atomic memory access... X-Git-Tag: svn/VALGRIND_3_4_0~431 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15b27d8ff0ccd332aff54d7abdf80b7ac4243c65;p=thirdparty%2Fvalgrind.git Added configure test for the gcc/icc built-in functions for atomic memory access (__sync_bool_compare_and_swap() a.o.). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8283 --- diff --git a/configure.in b/configure.in index 3e5e233678..52857e6eab 100644 --- a/configure.in +++ b/configure.in @@ -1109,6 +1109,23 @@ if test x$ac_have_builtin_expect = xyes ; then fi +# does this compiler have built-in functions for atomic memory access ? +AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap]) + +AC_TRY_LINK(, +[ + int variable = 1; + return __sync_bool_compare_and_swap(&variable, 1, 2) ? 1 : 0 +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.]) +], +[ + AC_MSG_RESULT([no]) +]) + + # does the ppc assembler support "mtocrf" et al? AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])