diff options
author | Jonathan Gray <jsg@jsg.id.au> | 2015-08-29 17:32:50 +1000 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-11-16 13:45:37 +0000 |
commit | f4b83bff60838f677e8c3c448bcd969810346e35 (patch) | |
tree | ad5a3ee017e40af813585718a7002a57850bc4fd | |
parent | c3deddd9c2bf54fa6bec3dbd9ec7eae5fa22e220 (diff) |
configure.ac: rework compiler builtin atomic tests
The libdrm autoconf test for atomics uses __sync_val_compare_and_swap with
the address of a function argument which triggers a gcc ICE on sparc64
with the OpenBSD system compiler.
Mark Kettenis pointed out that while other architectures probably spill the
argument onto the stack this is likely not the case on register window
architectures like SPARC and suggested passing a pointer as an argument
instead which avoids the ICE and allows the drm libraries requiring
atomics to build on sparc64 with the autoconf build.
Reported-by: Christian Weisgerber <naddy@openbsd.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@openbsd.org>
-rw-r--r-- | configure.ac | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index cf10ef25..89a3a468 100644 --- a/configure.ac +++ b/configure.ac @@ -210,8 +210,8 @@ AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives, [ drm_cv_atomic_primitives="none" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); } - int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); } + int atomic_add(int *i) { return __sync_fetch_and_add (i, 1); } + int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); } ]],[[]])], [drm_cv_atomic_primitives="Intel"],[]) if test "x$drm_cv_atomic_primitives" = "xnone"; then |