From: Ulrich Weigand Date: Sun, 29 Sep 2019 14:22:52 +0000 (+0200) Subject: cmake: Test for 16-byte atomic support on IBM Z X-Git-Tag: v15.1.0~1377^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30638%2Fhead;p=ceph.git cmake: Test for 16-byte atomic support on IBM Z On IBM Z the Boost tagged pointer implementation cannot use "pointer compression" as there are no unused bits in an address; the whole 64-bit address space is available to user space code. Instead, Boost uses 16-byte atomics. This is always supported on IBM Z, but depending on the particular compiler (version) it may require linking against libatomic. The existing checks in CheckCxxAtomic.cmake do not catch this, however, as they only test for (up to) 8-byte atomic support. Fixed by adding a test for 16-byte atomic support on IBM Z. Signed-off-by: Ulrich Weigand --- diff --git a/cmake/modules/CheckCxxAtomic.cmake b/cmake/modules/CheckCxxAtomic.cmake index 074e4db891a2..68efa15314b9 100644 --- a/cmake/modules/CheckCxxAtomic.cmake +++ b/cmake/modules/CheckCxxAtomic.cmake @@ -15,7 +15,13 @@ int main() { std::atomic w2; std::atomic w4; std::atomic w8; - return w1 + w2 + w4 + w8; +#ifdef __s390x__ + // Boost needs 16-byte atomics for tagged pointers. + std::atomic w16; +#else + #define w16 0 +#endif + return w1 + w2 + w4 + w8 + w16; } " ${var}) endfunction(check_cxx_atomics)