1
0
mirror of https://github.com/ceph/ceph synced 2024-12-28 06:23:08 +00:00
Commit Graph

3 Commits

Author SHA1 Message Date
Ulrich Weigand
c58fc258a2 cmake: Improve test for 16-byte atomic support on IBM Z
Commit d1b9d14324 added a check for
16-byte atomics without library support on IBM Z.  Unfortunately
it turns out this test only works correctly when the test case
is built without optimization.  (This is normally true, but it
may not be the case when passing explicit CXXFLAGS to cmake.)

The underlying reason is that GCC may choose to use either an
inline implementation of the 16-byte atomics or library calls,
depending on whether or not it is able to prove the atomic
variable is properly aligned.  At -O0 it is never able to prove
that, but at higher optimization levels it depends on the complexity
of the expression (in particular, whether GCC can track down the
definition of the underlying object).

As the test case uses a very simple expression, it may happen that
this test can be built without requiring library support, but some
of the "real" uses of atomics in Ceph code cannot.   This defeats
the whole purpose of the test at configure time.

Fixed by making the access pattern in the test more complex, so
that the test fails even at high optimization levels.

Fixes: https://tracker.ceph.com/issues/43747

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2020-01-23 13:13:58 +01:00
Ulrich Weigand
d1b9d14324 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 <ulrich.weigand@de.ibm.com>
2019-09-29 16:22:52 +02:00
Kefu Chai
16976bd42a cmake: should link against libatomic if libcxx/libstdc++ does not offer atomic ops
for instance,  GCC-8 on riscv64 does not offer atomic ops like
__atomic_fetch_or_1, so we need to link against libatomic to get access
to these symbols.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-10 01:37:00 +08:00