Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer - enable powerpc and arm...



details:   https://anonhg.NetBSD.org/src/rev/06b74a69df97
branches:  trunk
changeset: 359253:06b74a69df97
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Feb 05 22:04:54 2018 +0000

description:
- enable powerpc and arm support.
- port GetPcSpBp() to netbsd/powerpc* and netbsd/arm.

diffstat:

 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc                 |  12 ++++++++++
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc |   9 +++++--
 external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h                              |   4 +-
 3 files changed, 20 insertions(+), 5 deletions(-)

diffs (74 lines):

diff -r cd04659c0056 -r 06b74a69df97 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Mon Feb 05 21:12:14 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Mon Feb 05 22:04:54 2018 +0000
@@ -1141,9 +1141,15 @@
 void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
 #if defined(__arm__)
   ucontext_t *ucontext = (ucontext_t*)context;
+# if SANITIZER_NETBSD
+  *pc = _UC_MACHINE_PC(ucontext);
+  *sp = _UC_MACHINE_SP(ucontext);
+  *bp = ucontext->uc_mcontext.__gregs[_REG_R11];
+# else
   *pc = ucontext->uc_mcontext.arm_pc;
   *bp = ucontext->uc_mcontext.arm_fp;
   *sp = ucontext->uc_mcontext.arm_sp;
+# endif
 #elif defined(__aarch64__)
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.pc;
@@ -1191,11 +1197,17 @@
 # endif
 #elif defined(__powerpc__) || defined(__powerpc64__)
   ucontext_t *ucontext = (ucontext_t*)context;
+# if SANITIZER_NETBSD
+  *pc = _UC_MACHINE_PC(ucontext);
+  *sp = _UC_MACHINE_SP(ucontext);
+  *bp = ucontext->uc_mcontext.__gregs[_REG_R31];
+#  else
   *pc = ucontext->uc_mcontext.regs->nip;
   *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
   // The powerpc{,64}-linux ABIs do not specify r31 as the frame
   // pointer, but GCC always uses r31 when we need a frame pointer.
   *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
+#endif
 #elif defined(__sparc__)
   ucontext_t *ucontext = (ucontext_t*)context;
   uptr *stk_ptr;
diff -r cd04659c0056 -r 06b74a69df97 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc   Mon Feb 05 21:12:14 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc   Mon Feb 05 22:04:54 2018 +0000
@@ -129,13 +129,16 @@
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
 # include <utime.h>
 # include <sys/ptrace.h>
+# include <semaphore.h>
+#endif
+
+#if SANITIZER_LINUX 
 # if defined(__mips64) || defined(__aarch64__) || defined(__arm__)
 #  include <asm/ptrace.h>
-#  ifdef __arm__
+# endif
+# ifdef __arm__
 typedef struct user_fpregs elf_fpregset_t;
-#  endif
 # endif
-# include <semaphore.h>
 #endif
 
 #if !SANITIZER_ANDROID
diff -r cd04659c0056 -r 06b74a69df97 external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h
--- a/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h        Mon Feb 05 21:12:14 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h        Mon Feb 05 22:04:54 2018 +0000
@@ -16,8 +16,8 @@
 #if (defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
      defined(__APPLE__)) && \
     (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \
-     defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__) || \
-     defined(__sparc__))
+     defined(__aarch64__) || defined(__mips__) || defined(__powerpc__) || \
+     defined(__powerpc64__) || defined(__sparc__))
 # define CAN_SANITIZE_UB 1
 #elif defined(_WIN32)
 # define CAN_SANITIZE_UB 1



Home | Main Index | Thread Index | Old Index