]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: test for 16-byte atomic support on mips also 44071/head
authorKefu Chai <tchaikov@gmail.com>
Tue, 23 Nov 2021 16:40:54 +0000 (00:40 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 23 Nov 2021 16:44:04 +0000 (00:44 +0800)
it's reported that a mips64el build host is able to pass the test of
CheckCxxAtomic without linking against libatomic, while librbd.so
fails to link due to failures like

/usr/bin/ld: ../../../lib/librbd.so.1.16.0: undefined reference to `__atomic_store_16'
/usr/bin/ld: ../../../lib/librbd.so.1.16.0: undefined reference to `__atomic_load_16'
/usr/bin/ld: ../../../lib/librbd.so.1.16.0: undefined reference to `__atomic_compare_exchange_16'

so we have to check the existence of __atomic_load_16 instruction on
mips architecture.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
cmake/modules/CheckCxxAtomic.cmake

index f2d89cf3e0beb44e8c664a8d20e4b828edf8b86c..da2be5206d634e2b5b42bd921b8cf8492e37491a 100644 (file)
@@ -11,7 +11,7 @@ function(check_cxx_atomics var)
 #include <atomic>
 #include <cstdint>
 
-#if __s390x__
+#if defined(__s390x__) || defined(__mips__)
 // Boost needs 16-byte atomics for tagged pointers.
 // These are implemented via inline instructions on the platform
 // if 16-byte alignment can be proven, and are delegated to libatomic