From 6e8f9ab632d12271355d10d34c9835a7ba14e4b9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 2 Feb 2022 15:49:15 +0100 Subject: [PATCH] [rust] Define FP_XSTATE_MAGIC1 if not defined It looks like on old linux versions (like our dist-x86_64-linux builder) FP_XSTATE_MAGIC1 is defined only by asm/sigcontext.h, but not by bits/sigcontext.h. We can't actually include asm/sigcontext.h, because that would clash with types defined in bits/sigcontext.h, which gets pulled in via signal.h. Instead we just replicate the value from the header here. --- .../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp index 32b8f47ed6338e..177263473da75d 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp @@ -218,6 +218,9 @@ namespace __sanitizer { unsigned ucontext_t_sz(void *ctx) { # if SANITIZER_GLIBC && SANITIZER_X64 +#ifndef FP_XSTATE_MAGIC1 +# define FP_XSTATE_MAGIC1 0x46505853U +#endif // See kernel arch/x86/kernel/fpu/signal.c for details. const auto *fpregs = static_cast(ctx)->uc_mcontext.fpregs; // The member names differ across header versions, but the actual layout