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 fix a bunch of merge bot...



details:   https://anonhg.NetBSD.org/src/rev/d63d53a3b62f
branches:  trunk
changeset: 996409:d63d53a3b62f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jan 31 08:44:14 2019 +0000

description:
fix a bunch of merge botches.  libasan now builds.

diffstat:

 external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc                                |   1 +
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h               |   7 +-
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc                      |   2 +
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc              |   4 -
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h       |   1 +
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc      |   7 +-
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc |  31 +++++----
 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc           |   1 +
 external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h                                   |   2 +-
 9 files changed, 32 insertions(+), 24 deletions(-)

diffs (210 lines):

diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc
--- a/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc     Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc     Thu Jan 31 08:44:14 2019 +0000
@@ -699,6 +699,7 @@
 #endif
 
 #if ASAN_INTERCEPT___CXA_ATEXIT
+#if !SANITIZER_NETBSD
 static void AtCxaAtexit(void *unused) {
   (void)unused;
   StopInitOrderChecking();
diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h    Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h    Thu Jan 31 08:44:14 2019 +0000
@@ -50,6 +50,11 @@
 # define __has_feature(x) 0
 #endif
 
+// Outside of namespace below as we need <sys/types.h>
+#if SANITIZER_NETBSD
+#include <sys/types.h>
+#endif
+
 // For portability reasons we do not include stddef.h, stdint.h or any other
 // system header, but we do need some basic types that are not defined
 // in a portable way by the language itself.
@@ -102,7 +107,6 @@
 typedef u64  OFF64_T;
 
 #if SANITIZER_NETBSD
-#include <sys/types.h>
 typedef size_t operator_new_size_type;
 #else
 #if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC
@@ -116,7 +120,6 @@
 # endif
 #endif
 #endif
-}  // namespace __sanitizer
 
 
 // ----------- ATTENTION -------------
diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Thu Jan 31 08:44:14 2019 +0000
@@ -1370,6 +1370,8 @@
   static const uptr PF_WRITE = 1U << 1;
 #if SANITIZER_FREEBSD
   uptr err = ucontext->uc_mcontext.mc_err;
+#elif SANITIZER_NETBSD
+  uptr err = ucontext->uc_mcontext.__gregs[_REG_ERR];
 #else
   uptr err = ucontext->uc_mcontext.gregs[REG_ERR];
 #endif
diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc   Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc   Thu Jan 31 08:44:14 2019 +0000
@@ -159,9 +159,7 @@
 
 #if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_ANDROID && !SANITIZER_GO
 static uptr g_tls_size;
-#endif
 
-#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_ANDROID && !SANITIZER_GO
 #if defined(__mips__) || defined(__powerpc64__)
 // TlsPreTcbSize includes size of struct pthread_descr and size of tcb
 // head structure. It lies before the static tls blocks.
@@ -179,7 +177,6 @@
   return kTlsPreTcbSize;
 }
 #endif
-#endif // !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_ANDROID && !SANITIZER_GO
 
 void InitTlsSize() {
 // all current supported platforms have 16 bytes stack alignment
@@ -214,7 +211,6 @@
   if (tls_align < kStackAlign)
     tls_align = kStackAlign;
   g_tls_size = RoundUpTo(tls_size, tls_align);
-#endif  // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_NETBSD && !SANITIZER_GO
 }
 #else
 void InitTlsSize() { }
diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h    Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h    Thu Jan 31 08:44:14 2019 +0000
@@ -300,6 +300,7 @@
 #ifndef SANITIZER_INTERCEPT_DLOPEN_DLCLOSE
 #define SANITIZER_INTERCEPT_DLOPEN_DLCLOSE \
     SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC || SI_NETBSD
+#endif
 
 #define SANITIZER_INTERCEPT_GETPASS SI_LINUX_NOT_ANDROID || SI_MAC
 #define SANITIZER_INTERCEPT_TIMERFD SI_LINUX_NOT_ANDROID
diff -r 5f84925d0337 -r d63d53a3b62f 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   Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc   Thu Jan 31 08:44:14 2019 +0000
@@ -138,10 +138,9 @@
 # endif
 # ifdef __arm__
 typedef struct user_fpregs elf_fpregset_t;
-#   define ARM_VFPREGS_SIZE_ASAN (32 * 8 /*fpregs*/ + 4 /*fpscr*/)
-#   if !defined(ARM_VFPREGS_SIZE)
-#     define ARM_VFPREGS_SIZE ARM_VFPREGS_SIZE_ASAN
-#   endif
+#  define ARM_VFPREGS_SIZE_ASAN (32 * 8 /*fpregs*/ + 4 /*fpscr*/)
+#  if !defined(ARM_VFPREGS_SIZE)
+#   define ARM_VFPREGS_SIZE ARM_VFPREGS_SIZE_ASAN
 #  endif
 # endif
 #endif
diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc      Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc      Thu Jan 31 08:44:14 2019 +0000
@@ -40,12 +40,7 @@
 // GLIBC 2.20+ sys/user does not include asm/ptrace.h
 #  include <asm/ptrace.h>
 # endif
-# if !SANITIZER_NETBSD
-#  include <sys/user.h>  // for user_regs_struct
-#  if SANITIZER_ANDROID && SANITIZER_MIPS
-#    include <asm/reg.h>  // for mips SP register in sys/user.h
-#  endif
-# else
+# if SANITIZER_NETBSD
 #  define PTRACE_ATTACH PT_ATTACH
 #  define PTRACE_GETREGS PT_GETREGS
 #  define PTRACE_KILL PT_KILL
@@ -55,6 +50,11 @@
 #  include <machine/reg.h>
 typedef struct reg user_regs;
 typedef struct reg user_regs_struct;
+# else
+#  include <sys/user.h>  // for user_regs_struct
+#  if SANITIZER_ANDROID && SANITIZER_MIPS
+#   include <asm/reg.h>  // for mips SP register in sys/user.h
+#  endif
 # endif
 #endif
 #include <sys/wait.h> // for signal-related stuff
@@ -476,34 +476,39 @@
 typedef pt_regs regs_struct;
 #  define PTRACE_REG_SP(r) (r)->ARM_sp
 # endif
+
 #elif SANITIZER_LINUX
 # if defined(__arm__)
 typedef user_regs regs_struct;
 #  define PTRACE_REG_SP(r) (r)->uregs[13]
+
 # elif defined(__i386__)
 typedef user_regs_struct regs_struct;
 #  define PTRACE_REG_SP(r) (r)->esp
+
 # elif defined(__x86_64__)
 typedef user_regs_struct regs_struct;
 #  define PTRACE_REG_SP(r) (r)->rsp
+
 # elif defined(__powerpc__) || defined(__powerpc64__)
 typedef pt_regs regs_struct;
 #  define PTRACE_REG_SP(r) (r)->gpr[PT_R1]
 # elif defined(__mips__)
+
 typedef struct user regs_struct;
-# if SANITIZER_ANDROID
-#  define REG_SP regs[EF_R29]
-# else
-#  define REG_SP regs[EF_REG29]
-# endif
-#elif defined(__aarch64__)
+#  if SANITIZER_ANDROID
+#   define REG_SP regs[EF_R29]
+#  else
+#   define REG_SP regs[EF_REG29]
+#  endif
+# elif defined(__aarch64__)
+
 typedef struct user_pt_regs regs_struct;
 #  define PTRACE_REG_SP(r) (r)->sp
 #  define ARCH_IOVEC_FOR_GETREGSET
 # endif
 #elif SANITIZER_NETBSD 
 typedef reg regs_struct;
-#endif
 
 #elif defined(__s390__)
 typedef _user_regs_struct regs_struct;
diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc        Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc        Thu Jan 31 08:44:14 2019 +0000
@@ -18,6 +18,7 @@
 # define SYS_getdents SYS___getdents30
 # define SYS_sigaltstack SYS___sigaltstack14
 # define SYS_sigprocmask SYS___sigprocmask14
+# define SYS_nanosleep SYS___nanosleep50
 #endif
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_MAC
 # define SYSCALL(name) SYS_ ## name
diff -r 5f84925d0337 -r d63d53a3b62f external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h
--- a/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h        Thu Jan 31 08:42:03 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h        Thu Jan 31 08:44:14 2019 +0000
@@ -20,7 +20,7 @@
      defined(__powerpc__) || defined(__hppa__) || defined(__m68k__) || \
      defined(__mc68010__) || defined(__powerpc64__) || defined(__sparc__) || \
      defined(__alpha__) || defined(__vax__) || defined(__sh3__) || \
-     defined(__ia64__)) || \
+     defined(__ia64__) || \
      defined(__s390__))
 # define CAN_SANITIZE_UB 1
 #elif defined(_WIN32)



Home | Main Index | Thread Index | Old Index