Skip to content

Commit 6e8f9ab

Browse files
committed
[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.
1 parent c3c82dc commit 6e8f9ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ namespace __sanitizer {
218218

219219
unsigned ucontext_t_sz(void *ctx) {
220220
# if SANITIZER_GLIBC && SANITIZER_X64
221+
#ifndef FP_XSTATE_MAGIC1
222+
# define FP_XSTATE_MAGIC1 0x46505853U
223+
#endif
221224
// See kernel arch/x86/kernel/fpu/signal.c for details.
222225
const auto *fpregs = static_cast<ucontext_t *>(ctx)->uc_mcontext.fpregs;
223226
// The member names differ across header versions, but the actual layout

0 commit comments

Comments
 (0)