OSDN Git Service

configure.ac: rework compiler builtin atomic tests
authorJonathan Gray <jsg@jsg.id.au>
Sat, 29 Aug 2015 07:32:50 +0000 (17:32 +1000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 16 Nov 2015 13:45:37 +0000 (13:45 +0000)
commitf4b83bff60838f677e8c3c448bcd969810346e35
treead5a3ee017e40af813585718a7002a57850bc4fd
parentc3deddd9c2bf54fa6bec3dbd9ec7eae5fa22e220
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>
configure.ac