From 8254ea8c8b4cd0b45f3b242e033c753cd63c2f35 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 15 Jul 2018 00:32:40 +0000 Subject: [PATCH] aarch64 sanitizer bits --- .../dist/libsanitizer/sanitizer_common/sanitizer_linux.cc | 8 +++++++- .../sanitizer_stoptheworld_linux_libcdep.cc | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc index 6a998f088b31..b67a38d187ec 100644 --- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc +++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc @@ -1018,7 +1018,7 @@ uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, : "memory", "$29" ); return res; } -#elif defined(__aarch64__) +#elif defined(__aarch64__) && SANITIZER_LINUX uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res; @@ -1171,9 +1171,15 @@ void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { # endif #elif defined(__aarch64__) ucontext_t *ucontext = (ucontext_t*)context; +# if SANITIZER_NETBSD + *pc = _UC_MACHINE_PC(ucontext); + *sp = _UC_MACHINE_SP(ucontext); + *bp = ucontext->uc_mcontext.__gregs[29]; /* XXX */ +# else *pc = ucontext->uc_mcontext.pc; *bp = ucontext->uc_mcontext.regs[29]; *sp = ucontext->uc_mcontext.sp; +# endif #elif defined(__hppa__) ucontext_t *ucontext = (ucontext_t*)context; # if SANITIZER_NETBSD diff --git a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc index f93ed6ac0339..5f9fcb7bb2d4 100644 --- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -34,7 +34,7 @@ #if SANITIZER_ANDROID && defined(__arm__) # include // for pt_regs #else -# ifdef __aarch64__ +# if SANITIZER_LINUX && defined( __aarch64__) // GLIBC 2.20+ sys/user does not include asm/ptrace.h # include # endif