From f97ca48b1cbbf5da065e94271cb3af4f1c907dd4 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 19 Oct 2020 22:44:34 -0700 Subject: [PATCH] [sanitizer] Fix compilation on older systems Fixes https://bugs.llvm.org/show_bug.cgi?id=47896 --- .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp index 6a3c00458efb4..eb89f1fddc5be 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp @@ -486,6 +486,10 @@ typedef user_regs_struct regs_struct; #define REG_SP rsp #endif #define ARCH_IOVEC_FOR_GETREGSET +// Support ptrace extensions even when compiled without required kernel support +#ifndef NT_X86_XSTATE +#define NT_X86_XSTATE 0x202 +#endif // Compiler may use FP registers to store pointers. static constexpr uptr kExtraRegs[] = {NT_X86_XSTATE, NT_FPREGSET};