]> git.proxmox.com Git - mirror_spl.git/commitdiff
Correctly detect atomic64_cmpxchg support
authorNed Bass <bass6@llnl.gov>
Fri, 6 Aug 2010 21:04:00 +0000 (14:04 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 8 Aug 2010 20:48:03 +0000 (13:48 -0700)
The RHEL5 2.6.18-194.7.1.el5 kernel added atomic64_cmpxchg to
asm-x86_64/atomic.h.  That macro is defined in terms of cmpxchg which
is provided by asm/system.h. However, asm/system.h is not #included by
atomic.h in this kernel nor by the autoconf test for atomic64_cmpxchg, so
the test failed with "implicit declaration of function 'cmpxchg'". This
leads the build system to erroneously conclude that the kernel does not
define atomic64_cmpxchg and enable the built-in definition.  This in
turn produces a '"atomic64_cmpxchg" redefined' build warning which is fatal
when building with --enable-debug.  This commit fixes this by including
asm/system.h in the autoconf test.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
config/spl-build.m4
configure

index a11d8866d2c986885321bd2bce98abdf6e4a6750..facaf7404c73961bded44ca7db65ea16d07eb973 100644 (file)
@@ -639,6 +639,7 @@ AC_DEFUN([SPL_AC_TYPE_ATOMIC64_CMPXCHG],
        [AC_MSG_CHECKING([whether kernel defines atomic64_cmpxchg])
        SPL_LINUX_TRY_COMPILE([
                #include <asm/atomic.h>
+               #include <asm/system.h>
        ],[
                atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
        ],[
index 4a24a41f5fea58ecc09c91819058c728c912951c..bcef31e4744e8c8092413359bca1e9d4d24bcbd9 100755 (executable)
--- a/configure
+++ b/configure
@@ -11988,6 +11988,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <asm/atomic.h>
+               #include <asm/system.h>
 
 int
 main (void)
@@ -15499,6 +15500,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <asm/atomic.h>
+               #include <asm/system.h>
 
 int
 main (void)