1 AC_DEFUN([DISPATCH_C_ATOMIC_BUILTINS], [
3 # This is a bit subtle: on i386 systems without at least -march=i486 defined,
4 # certain built-in atomics fall back to depending on undefined symbols if
5 # their return values are used.
7 AC_CACHE_CHECK([for gcc atomic builtins],[dispatch_cv_atomic],
8 [AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[
10 i = __sync_add_and_fetch(&x,1);
11 return x;]])],[dispatch_cv_atomic=yes],
13 CFLAGS="$CFLAGS -march=i486"
14 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[
16 i = __sync_add_and_fetch(&x,1);
17 return x;]])],[CFLAGS="$saveCFLAGS"
18 dispatch_cv_atomic="-march=i486"