sys_siglist is deprecated with glibc 2.32. A new thread-safe and
async-signal safe sigdescr_np() function is provided, so use it if
available.
Fixes: https://tracker.ceph.com/issues/47187
Signed-off-by: David Disseldorp <ddiss@suse.de>
We'll update the cmake files in order to be able to build ceph
components for Windows targets.
Cross compiling using MINGW is the easiest approach for now.
Subsequently, we'll add support for Clang and MSVC.
This patch provides the following changes:
* include winsock2.h, which provides ntohl on Windows
* avoid unsupported compiler flags when using msvc
* add a custom toolchain file for mingw
* update install command for ceph-common in order to work with mingw
* avoid running test sample when cross compiling
* link against the ws_32 lib
* set argeted Windows version
* skip yasm checks when targeting Windows
* allow multiple redefinitions when using mingw, picking the first one.
this is a workaround for a mingw TLS bug:
https://sourceforge.net/p/mingw-w64/bugs/816/
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
per clock_gettime(3),
> On POSIX systems on which these functions are available, the symbol
> _POSIX_TIMERS is defined in <unistd.h> to a value greater than 0.
and
> Most systems require the program be linked with the librt library to
> use these functions.
so, we should detect this symbol and link against librt for using these
functions.
in this change, librt is linked for checking the existence of
clock_gettime(), if it exists. RT_LIBRARY is defined.
Signed-off-by: Kefu Chai <kchai@redhat.com>
check the linker support of `--version-script` and `--exclude-libs`
flags. and use them only if they are supported.
llvm-ld does not support `--version-script` at this moment. and it's
reported that old versions of llvm-ld do not support `--exclude-libs`
as well.
Signed-off-by: Kefu Chai <kchai@redhat.com>
These types should no longer be used; use ceph_le16/32/64 instead.
Also removes the cmake check whether those types are provided by
kernel headers (likewise for the __be types, which already were
not used anywhere).
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
On big-endian systems, ntohl is a no-op, so "good" never does
any conversion. Fix this by keeping the test constants in
big-endian (network) order and using ntohl to convert them
to native (host) byte order.
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
C and C++ allow us to cast a pointer with an alignment requirement to
one with a different alignment requirement. but if the destination
type's alignment is greater/stricter than the source type, the behavior
is undefined. on amd64, it's allowed. and on aarch64, GCC offers an
option named `-munaligned-access` to enable this behavior. so we cannot
take this as guaranteed.
in denc.h and messenger implementations, we just cast the pointers to
the type we want to access without memcpy(), which is, strictly
speaking, not quite standard compliant.
so, to be on the safe side, we detect the support of unaligned access at
compile time.
please note, this would fail the cross-compile. as the target platform
might not support unaligned access, and the produced executable does not
run on the build platform. so this test is skipped if the building
host's architecture is different than that of target host.
Signed-off-by: Kefu Chai <kchai@redhat.com>