From: Kefu Chai Date: Tue, 23 Nov 2021 16:40:54 +0000 (+0800) Subject: cmake: test for 16-byte atomic support on mips also X-Git-Tag: v17.1.0~328^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=709a77f22010f03aee4a4c0ab930588944cb4a58;p=ceph.git cmake: test for 16-byte atomic support on mips also 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 --- diff --git a/cmake/modules/CheckCxxAtomic.cmake b/cmake/modules/CheckCxxAtomic.cmake index f2d89cf3e0b..da2be5206d6 100644 --- a/cmake/modules/CheckCxxAtomic.cmake +++ b/cmake/modules/CheckCxxAtomic.cmake @@ -11,7 +11,7 @@ function(check_cxx_atomics var) #include #include -#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