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 port to hppa, m68k, m680...
details: https://anonhg.NetBSD.org/src/rev/0352b2b33212
branches: trunk
changeset: 359317:0352b2b33212
user: mrg <mrg%NetBSD.org@localhost>
date: Wed Feb 07 02:32:01 2018 +0000
description:
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.
diffstat:
external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc | 23 +++++++++-
external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h | 4 +-
2 files changed, 25 insertions(+), 2 deletions(-)
diffs (65 lines):
diff -r 38d39a6c5a58 -r 0352b2b33212 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Wed Feb 07 02:30:39 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Wed Feb 07 02:32:01 2018 +0000
@@ -1158,10 +1158,16 @@
*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 @@
// 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 @@
*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
diff -r 38d39a6c5a58 -r 0352b2b33212 external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h
--- a/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h Wed Feb 07 02:30:39 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h Wed Feb 07 02:32:01 2018 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index