diff --git a/0019-cmake-modules-CheckCxxAtomic.cmake.patch b/0019-cmake-modules-CheckCxxAtomic.cmake.patch index e443f1e..c6c02dc 100644 --- a/0019-cmake-modules-CheckCxxAtomic.cmake.patch +++ b/0019-cmake-modules-CheckCxxAtomic.cmake.patch @@ -1,39 +1,10 @@ --- ceph-17.2.0-359-gb2fe9ec8/cmake/modules/CheckCxxAtomic.cmake.orig 2022-06-03 08:45:32.341075140 -0400 +++ ceph-17.2.0-359-gb2fe9ec8/cmake/modules/CheckCxxAtomic.cmake 2022-06-03 08:46:47.195775813 -0400 -@@ -10,6 +10,7 @@ - check_cxx_source_compiles(" - #include - #include -+#include - - #if __s390x__ - // Boost needs 16-byte atomics for tagged pointers. -@@ -21,13 +22,27 @@ +@@ -21,6 +21,7 @@ // We specifically test access via an otherwise unknown pointer here // to ensure we get the most complex case. If this access can be // done without libatomic, then all accesses can be done. -+struct tagged_ptr { -+ int* ptr; -+ std::size_t tag; -+}; -+ -+void atomic16(std::atomic *ptr) __attribute__ ((used)); ++bool atomic16(std::atomic *ptr) __attribute__ ((used)); bool atomic16(std::atomic *ptr) { -- return *ptr != 0; -+ tagged_ptr p{nullptr, 1}; -+ ptr->store(p); -+ tagged_ptr f = ptr->load(); -+ tagged_ptr new_tag{nullptr, 0}; -+ ptr->compare_exchange_strong(f, new_tag); - } - #endif - - int main() { -+#if __s390x__ -+ std::atomic ptr; -+ atomic16(&ptr); -+#endif - std::atomic w1; - std::atomic w2; - std::atomic w4; + return *ptr != 0;