Module Name: src Committed By: mrg Date: Wed Feb 7 02:32:01 UTC 2018
Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc src/external/gpl3/gcc/dist/libsanitizer/ubsan: ubsan_platform.h Log Message: port to hppa, m68k, m68000, vax, and sh3. this should complete our list of ports. it's only about obtaining some pointers in this code, really. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc cvs rdiff -u -r1.5 -r1.6 \ src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.14 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.15 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.14 Tue Feb 6 09:31:56 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Wed Feb 7 02:32:01 2018 @@ -1158,10 +1158,16 @@ void GetPcSpBp(void *context, uptr *pc, *sp = ucontext->uc_mcontext.sp; #elif defined(__hppa__) ucontext_t *ucontext = (ucontext_t*)context; +# if SANITIZER_NETBSD + *pc = _UC_MACHINE_PC(ucontext); + *sp = _UC_MACHINE_SP(ucontext); + *bp = ucontext->uc_mcontext.__gregs[3]; /* XXX */ +#else *pc = ucontext->uc_mcontext.sc_iaoq[0]; /* GCC uses %r3 whenever a frame pointer is needed. */ *bp = ucontext->uc_mcontext.sc_gr[3]; *sp = ucontext->uc_mcontext.sc_gr[30]; +# endif #elif defined(__x86_64__) # if SANITIZER_FREEBSD ucontext_t *ucontext = (ucontext_t*)context; @@ -1208,7 +1214,7 @@ void GetPcSpBp(void *context, uptr *pc, // 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 +# endif #elif defined(__sparc__) ucontext_t *ucontext = (ucontext_t*)context; uptr *stk_ptr; @@ -1248,6 +1254,21 @@ void GetPcSpBp(void *context, uptr *pc, *pc = _UC_MACHINE_PC(ucontext); *sp = _UC_MACHINE_SP(ucontext); *bp = ucontext->uc_mcontext.__gregs[_REG_S6]; +#elif (defined(__m68k__) || defined(__mc68010__)) && SANITIZER_NETBSD + ucontext_t *ucontext = (ucontext_t*)context; + *pc = _UC_MACHINE_PC(ucontext); + *sp = _UC_MACHINE_SP(ucontext); + *bp = ucontext->uc_mcontext.__gregs[_REG_A6]; +#elif defined(__vax__) && SANITIZER_NETBSD + ucontext_t *ucontext = (ucontext_t*)context; + *pc = _UC_MACHINE_PC(ucontext); + *sp = _UC_MACHINE_SP(ucontext); + *bp = ucontext->uc_mcontext.__gregs[_REG_FP]; +#elif defined(__sh3__) && SANITIZER_NETBSD + ucontext_t *ucontext = (ucontext_t*)context; + *pc = _UC_MACHINE_PC(ucontext); + *sp = _UC_MACHINE_SP(ucontext); + *bp = ucontext->uc_mcontext.__gregs[_REG_R14]; #else # error "Unsupported arch" #endif Index: src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h diff -u src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h:1.5 src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h:1.6 --- src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h:1.5 Tue Feb 6 09:31:56 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h Wed Feb 7 02:32:01 2018 @@ -17,7 +17,9 @@ defined(__APPLE__)) && \ (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \ defined(__aarch64__) || defined(__mips__) || defined(__powerpc__) || \ - defined(__powerpc64__) || defined(__sparc__) || defined(__alpha__)) + defined(__hppa__) || defined(__m68k__) || defined(__mc68010__) || \ + defined(__powerpc64__) || defined(__sparc__) || defined(__alpha__) || \ + defined(__vax__) || defined(__sh3__)) # define CAN_SANITIZE_UB 1 #elif defined(_WIN32) # define CAN_SANITIZE_UB 1