Module Name: src
Committed By: mrg
Date: Thu Jan 31 08:44:14 UTC 2019
Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_interceptors.cc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_internal_defs.h sanitizer_linux.cc
sanitizer_linux_libcdep.cc sanitizer_platform_interceptors.h
sanitizer_platform_limits_posix.cc
sanitizer_stoptheworld_linux_libcdep.cc
sanitizer_syscall_generic.inc
src/external/gpl3/gcc/dist/libsanitizer/ubsan: ubsan_platform.h
Log Message:
fix a bunch of merge botches. libasan now builds.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
cvs rdiff -u -r1.22 -r1.23 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
\
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
\
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
cvs rdiff -u -r1.8 -r1.9 \
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/asan/asan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.5 Sat Jan 19 12:10:11 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc Thu Jan 31 08:44:14 2019
@@ -699,6 +699,7 @@ static void Atexit(void) {
#endif
#if ASAN_INTERCEPT___CXA_ATEXIT
+#if !SANITIZER_NETBSD
static void AtCxaAtexit(void *unused) {
(void)unused;
StopInitOrderChecking();
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.9 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.9 Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h Thu Jan 31 08:44:14 2019
@@ -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 uptr OFF_T;
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 @@ typedef u32 operator_new_size_type;
# endif
#endif
#endif
-} // namespace __sanitizer
// ----------- ATTENTION -------------
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.22 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.23
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.22 Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Thu Jan 31 08:44:14 2019
@@ -1370,6 +1370,8 @@ SignalContext::WriteFlag SignalContext::
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
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.8 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.8 Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Thu Jan 31 08:44:14 2019
@@ -159,9 +159,7 @@ bool SanitizerGetThreadName(char *name,
#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 @@ static uptr TlsPreTcbSize() {
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 @@ void InitTlsSize() {
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() { }
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h:1.5 Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h Thu Jan 31 08:44:14 2019
@@ -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
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.5 Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc Thu Jan 31 08:44:14 2019
@@ -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 @@ void StopTheWorld(StopTheWorldCallback c
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;
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc:1.5 Fri Feb 2 03:41:11 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc Thu Jan 31 08:44:14 2019
@@ -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
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:1.10 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:1.11
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:1.10 Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc Thu Jan 31 08:44:14 2019
@@ -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
Index: src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h:1.8 src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h:1.8 Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_platform.h Thu Jan 31 08:44:14 2019
@@ -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)