CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Fri Oct 2 14:36:54 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux_libcdep.cc Log Message: Do not assume that _lwp_getprivate() returns unbiased private pointer Cherry-pick and adapt: >From 2a9ce60de98e53198047daaeeec3cf09ece4e693 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Fri, 2 Oct 2020 16:13:09 +0200 Subject: [PATCH] [compiler-rt] [netbsd] Improve the portability of ThreadSelfTlsTcb Use __lwp_gettcb_fast() and __lwp_getprivate_fast(), as _lwp_getprivate() can be a biased pointer and invalid for use in this function on all CPUs. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc 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_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.16 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.17 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.16 Thu Sep 10 12:53:05 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Fri Oct 2 14:36:54 2020 @@ -25,6 +25,10 @@ #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" +#if SANITIZER_NETBSD +#define _RTLD_SOURCE // for __lwp_gettcb_fast() / __lwp_getprivate_fast() +#endif + #include // for dlsym() #include #include @@ -418,7 +422,13 @@ uptr ThreadSelf() { #if SANITIZER_NETBSD static struct tls_tcb * ThreadSelfTlsTcb() { - return (struct tls_tcb *)_lwp_getprivate(); + struct tls_tcb *tcb = nullptr; +#ifdef __HAVE___LWP_GETTCB_FAST + tcb = (struct tls_tcb *)__lwp_gettcb_fast(); +#elif defined(__HAVE___LWP_GETPRIVATE_FAST) + tcb = (struct tls_tcb *)__lwp_getprivate_fast(); +#endif + return tcb; } uptr ThreadSelf() {
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Thu Sep 17 15:43:24 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_stoptheworld_netbsd_libcdep.cc Log Message: Use internal_ptrace() instead of ptrace() Cherry-pick: commit 0008fb343704bafc3469703be930b8a65d7c47fa Author: Kamil Rytarowski Date: Mon Sep 14 10:10:49 2020 +0200 [compiler-rt] [netbsd] Use internal_ptrace() instead of ptrace() To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc 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_stoptheworld_netbsd_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.5 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4 Thu Sep 17 15:42:17 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc Thu Sep 17 15:43:24 2020 @@ -131,7 +131,7 @@ bool ThreadSuspender::SuspendAllThreads( pl.pl_lwpid = 0; int val; - while ((val = ptrace(op, pid_, (void *)&pl, sizeof(pl))) != -1 && + while ((val = internal_ptrace(op, pid_, (void *)&pl, sizeof(pl))) != -1 && pl.pl_lwpid != 0) { suspended_threads_list_.Append(pl.pl_lwpid); VReport(2, "Appended thread %d in process %d.\n", pl.pl_lwpid, pid_);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Thu Sep 17 15:42:17 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_stoptheworld_netbsd_libcdep.cc Log Message: Undo setting _KERNTYPES The sparc ptrace(2) headers were fixed to work without defined _KERNTYPES. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc 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_stoptheworld_netbsd_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3 Sun Sep 13 08:51:58 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc Thu Sep 17 15:42:17 2020 @@ -18,7 +18,6 @@ #if SANITIZER_NETBSD -#define _KERNTYPES /* we want register_t for some ptrace functions */ #include "sanitizer_stoptheworld.h" #include "sanitizer_atomic.h"
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: martin Date: Sun Sep 13 08:51:59 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_netbsd.cc sanitizer_stoptheworld_netbsd_libcdep.cc Log Message: Add missing dkbad.h include and define _KERNTYPES so we get all internal types (like register_t) that we need for ptrace. Fixes the build on sparc64. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc 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_platform_limits_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.6 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.5 Sat Sep 12 15:01:38 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc Sun Sep 13 08:51:58 2020 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2 Fri Sep 11 01:07:00 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc Sun Sep 13 08:51:58 2020 @@ -18,6 +18,7 @@ #if SANITIZER_NETBSD +#define _KERNTYPES /* we want register_t for some ptrace functions */ #include "sanitizer_stoptheworld.h" #include "sanitizer_atomic.h"
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Sat Sep 12 22:52:24 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_posix_libcdep.cc Log Message: Disable GetNamedMappingFd for NetBSD Analogous logic is in LLVM rev. 74760bb00fb9b78a2fe122. Removes undefined symbol linkage to shm_unlink and shm_open. To generate a diff of this commit: cvs rdiff -u -r1.1.1.7 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc 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_posix_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.1.1.7 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.1.1.7 Sat Sep 5 07:52:57 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc Sat Sep 12 22:52:24 2020 @@ -304,7 +304,7 @@ void PlatformPrepareForSandboxing(__sani MemoryMappingLayout::CacheMemoryMappings(); } -#if SANITIZER_ANDROID || SANITIZER_GO +#if SANITIZER_ANDROID || SANITIZER_GO || SANITIZER_NETBSD int GetNamedMappingFd(const char *name, uptr size) { return -1; }
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Fri Sep 11 01:45:53 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.h Log Message: Add prototypes of internal_sigdelset() and internal_clone() Cherry-pick the missing change from: commit 983d7ddd0b278b45d815cbac9197205b39c4860a Author: Kamil Rytarowski Date: Thu Jul 11 06:22:35 2019 + Add NetBSD LSan support Summary: Combine few relatively small changes into one: - implement internal_ptrace() and internal_clone() for NetBSD - add support for stoptheworld based on the ptrace(2) API - define COMPILER_RT_HAS_LSAN for NetBSD - enable tests for NetBSD/amd64 Inspired by the original implementation by Christos Zoulas in netbsd/src for GCC. The implementation is in theory CPU independent through well defined macros across all NetBSD ports, however only the x86_64 version was tested. Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb Reviewed By: vitalybuka Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos Tags: #llvm Differential Revision: https://reviews.llvm.org/D64057 llvm-svn: 365735 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.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.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.11 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10 Sat Sep 5 13:35:55 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h Fri Sep 11 01:45:53 2020 @@ -74,12 +74,8 @@ uptr internal_prctl(int option, uptr arg #endif // SANITIZER_LINUX #ifdef SANITIZER_NETBSD -int internal_sigaction_norestorer(int signum, const void *act, void *oldact); -#define internal_sigdelset(set, signum) \ -__sigdelset(set, signum) -#define internal_clone(fn, child_stack, flags, arg, \ -parent_tidptr, newtls, child_tidptr) \ -__clone(fn, child_stack, flags, arg) +void internal_sigdelset(__sanitizer_sigset_t *set, int signum); +uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg); #endif // This class reads thread IDs from /proc//task using only syscalls.
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Fri Sep 11 01:08:36 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_getauxval.h Log Message: Add getauxval() compat for NetBSD Cherry-pick and adapt: commit 02519fc7a6f8c528f67975a9f78ce64dabf402b4 Author: Kamil Rytarowski Date: Thu Sep 12 18:57:58 2019 + Add getauxval() compat for NetBSD Summary: getauxval() is not available on NetBSD and there is no a direct equivalent. Add a function that implements the same semantics with NetBSD internals. Reorder the GetPageSize() functions to prefer the sysctl approach for NetBSD. It no longer makes a difference which approach is better. Avoid changing conditional code path. Reviewers: vitalybuka, dvyukov, mgorny, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67329 llvm-svn: 371758 To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.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_getauxval.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.1.1.1 Sat Sep 5 07:52:57 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h Fri Sep 11 01:08:36 2020 @@ -8,6 +8,7 @@ // Common getauxval() guards and definitions. // getauxval() is not defined until glibc version 2.16, or until API level 21 // for Android. +// Implement the getauxval() compat function for NetBSD. // //===--===// @@ -41,6 +42,23 @@ extern "C" SANITIZER_WEAK_ATTRIBUTE unsigned long getauxval(unsigned long type); // NOLINT # endif -#endif // SANITIZER_LINUX || SANITIZER_FUCHSIA +#elif SANITIZER_NETBSD + +#define SANITIZER_USE_GETAUXVAL 1 + +#include +#include + +static inline decltype(AuxInfo::a_v) getauxval(decltype(AuxInfo::a_type) type) { + for (const AuxInfo *aux = (const AuxInfo *)_dlauxinfo(); + aux->a_type != AT_NULL; ++aux) { +if (type == aux->a_type) + return aux->a_v; + } + + return 0; +} + +#endif #endif // SANITIZER_GETAUXVAL_H
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Fri Sep 11 01:07:53 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: Use sysctl to implement GetPageSize() Cherry-pick code chunk from newer LLVM compiler-rt. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.36 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.37 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36 Mon Sep 7 00:22:51 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Fri Sep 11 01:07:53 2020 @@ -1139,6 +1139,14 @@ uptr GetPageSize() { // Android post-M sysconf(_SC_PAGESIZE) crashes if called from .preinit_array. #if SANITIZER_ANDROID return 4096; +#elif SANITIZER_FREEBSD || SANITIZER_NETBSD +// Use sysctl as sysconf can trigger interceptors internally. + int pz = 0; + uptr pzl = sizeof(pz); + int mib[2] = {CTL_HW, HW_PAGESIZE}; + int rv = internal_sysctl(mib, 2, &pz, &pzl, nullptr, 0); + CHECK_EQ(rv, 0); + return (uptr)pz; #elif SANITIZER_LINUX && (defined(__x86_64__) || defined(__i386__)) return EXEC_PAGESIZE; #elif SANITIZER_USE_GETAUXVAL
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Fri Sep 11 01:07:27 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_internal_defs.h Log Message: Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD Cherry-pick: commit 3a189bac9bb111c9a59339015ab0d4e2fed735f4 Author: Kamil Rytarowski Date: Thu Dec 19 03:21:46 2019 +0100 [compiler-rt] Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD .preinit_array is supported since 9.0. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.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_internal_defs.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.12 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.13 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.12 Sat Sep 5 09:12:32 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h Fri Sep 11 01:07:27 2020 @@ -104,7 +104,7 @@ // FIXME: do we have anything like this on Mac? #ifndef SANITIZER_CAN_USE_PREINIT_ARRAY #if ((SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_OPENBSD || \ - SANITIZER_FUCHSIA) && !defined(PIC) + SANITIZER_FUCHSIA || SANITIZER_NETBSD) && !defined(PIC) #define SANITIZER_CAN_USE_PREINIT_ARRAY 1 // Before Solaris 11.4, .preinit_array is fully supported only with GNU ld. // FIXME: Check for those conditions.
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Fri Sep 11 01:07:00 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_stoptheworld_netbsd_libcdep.cc Log Message: Adapt stop-the-world for ptrace changes in NetBSD-9.99.30 Cherry-pick and adapt: commit fc356dcc11c10003ff22acff667b0a9f5e6c1e0f Author: Kamil Rytarowski Date: Tue Dec 24 20:33:54 2019 +0100 [compiler-rt] Adapt stop-the-world for ptrace changes in NetBSD-9.99.30 Handle PT_LWPNEXT for newer kernels and keep PT_LWPINFO for older ones. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc 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_stoptheworld_netbsd_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.1 Fri Sep 11 01:05:28 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc Fri Sep 11 01:07:00 2020 @@ -120,10 +120,18 @@ bool ThreadSuspender::SuspendAllThreads( VReport(2, "Attached to process %d.\n", pid_); +#ifdef PT_LWPNEXT + struct ptrace_lwpstatus pl; + int op = PT_LWPNEXT; +#else struct ptrace_lwpinfo pl; - int val; + int op = PT_LWPINFO; +#endif + pl.pl_lwpid = 0; - while ((val = ptrace(PT_LWPINFO, pid_, (void *)&pl, sizeof(pl))) != -1 && + + int val; + while ((val = ptrace(op, pid_, (void *)&pl, sizeof(pl))) != -1 && pl.pl_lwpid != 0) { suspended_threads_list_.Append(pl.pl_lwpid); VReport(2, "Appended thread %d in process %d.\n", pl.pl_lwpid, pid_);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Fri Sep 11 01:01:14 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_stoptheworld_linux_libcdep.cc Log Message: Disable sanitizer_stoptheworld_linux_libcdep.cc for NetBSD To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc 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_stoptheworld_linux_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.11 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.12 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.11 Sat Sep 5 09:12:32 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc Fri Sep 11 01:01:14 2020 @@ -12,7 +12,7 @@ #include "sanitizer_platform.h" -#if (SANITIZER_LINUX || SANITIZER_NETBSD) && \ +#if SANITIZER_LINUX && \ (defined(__x86_64__) || defined(__mips__) || \ defined(__aarch64__) || defined(__powerpc64__) || \ defined(__s390__) || defined(__i386__) || \
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Mon Sep 7 07:10:43 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux_libcdep.cc Log Message: avoid returning stack garbage on platforms that don't have either __lwp_gettcb_fast() or __lwp_getprivate_fast(). To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc 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_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.15 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14 Sun Sep 6 05:30:17 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Mon Sep 7 07:10:43 2020 @@ -417,7 +417,7 @@ uptr ThreadSelf() { #if SANITIZER_NETBSD static struct tls_tcb * ThreadSelfTlsTcb() { - struct tls_tcb * tcb; + struct tls_tcb * tcb = NULL; # ifdef __HAVE___LWP_GETTCB_FAST tcb = (struct tls_tcb *)__lwp_gettcb_fast(); # elif defined(__HAVE___LWP_GETPRIVATE_FAST)
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Mon Sep 7 00:22:51 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: fix for netbsd/mips. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.35 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35 Sun Sep 6 10:55:16 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Mon Sep 7 00:22:51 2020 @@ -33,6 +33,7 @@ // format. Struct kernel_stat is defined as 'struct stat' in asm/stat.h. To // access stat from asm/stat.h, without conflicting with definition in // sys/stat.h, we use this trick. +#if SANITIZER_LINUX #if defined(__mips64) #include #include @@ -40,6 +41,7 @@ #include #undef stat #endif +#endif #if SANITIZER_NETBSD #include @@ -1848,7 +1850,12 @@ SignalContext::WriteFlag SignalContext:: uint32_t faulty_instruction; uint32_t op_code; +#if SANITIZER_NETBSD + ucontext_t *nucontext = (ucontext_t *)ucontext; + exception_source = (uint32_t *)_UC_MACHINE_PC(nucontext); +#else exception_source = (uint32_t *)ucontext->uc_mcontext.pc; +#endif faulty_instruction = (uint32_t)(*exception_source); op_code = (faulty_instruction >> 26) & 0x3f;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Sun Sep 6 17:15:09 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_netbsd.cc Log Message: comment out ioctl that is only defined for the kernel To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc 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_platform_limits_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.4 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3 Sun Sep 6 06:55:16 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc Sun Sep 6 13:15:09 2020 @@ -1774,8 +1774,10 @@ unsigned IOCTL_MTIOCSLOCATE = MTIOCSLOCA unsigned IOCTL_MTIOCHLOCATE = MTIOCHLOCATE; unsigned IOCTL_POWER_EVENT_RECVDICT = POWER_EVENT_RECVDICT; unsigned IOCTL_POWER_IOC_GET_TYPE = POWER_IOC_GET_TYPE; +#if 0 unsigned IOCTL_POWER_IOC_GET_TYPE_WITH_LOSSAGE = POWER_IOC_GET_TYPE_WITH_LOSSAGE; +#endif unsigned IOCTL_RIOCGINFO = RIOCGINFO; unsigned IOCTL_RIOCSINFO = RIOCSINFO; unsigned IOCTL_RIOCSSRCH = RIOCSSRCH;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Sun Sep 6 10:55:16 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc sanitizer_platform_limits_netbsd.cc Log Message: re-port to netbsd/sparc* fix build on non-constant pagesize platforms and for dkbad. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc 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.34 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34 Sat Sep 5 13:35:55 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sun Sep 6 10:55:16 2020 @@ -1908,8 +1908,10 @@ SignalContext::WriteFlag SignalContext:: uptr pc = ucontext->uc_mcontext.gregs[REG_PC]; # else // Historical BSDism here. - struct sigcontext *scontext = (struct sigcontext *)context; -# if defined(__arch64__) + struct sigcontext *scontext = (struct sigcontext *)ucontext; +# if SANITIZER_NETBSD + uptr pc = scontext->sc_pc; +# elif defined(__arch64__) uptr pc = scontext->sigc_regs.tpc; # else uptr pc = scontext->si_regs.pc; Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2 Sat Sep 5 13:35:55 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc Sun Sep 6 10:55:16 2020 @@ -83,6 +83,7 @@ #include #include #include +#include #include #define RAY_DO_SIGLEV #include @@ -103,7 +104,10 @@ #include #include #include +/* XXX relies upon NBPG which is not always constant, or provided. */ +#ifdef NBPG #include +#endif #include #include #include @@ -620,7 +624,9 @@ unsigned struct_sppplcpcfg_sz = sizeof(s unsigned struct_spppstatus_sz = sizeof(spppstatus); unsigned struct_spppstatusncp_sz = sizeof(spppstatusncp); unsigned struct_srt_rt_sz = sizeof(srt_rt); +#ifdef NBPG unsigned struct_stic_xinfo_sz = sizeof(stic_xinfo); +#endif unsigned struct_sun_dkctlr_sz = sizeof(sun_dkctlr); unsigned struct_sun_dkgeom_sz = sizeof(sun_dkgeom); unsigned struct_sun_dkpart_sz = sizeof(sun_dkpart); @@ -1183,10 +1189,12 @@ unsigned IOCTL_KIOCGLED = KIOCGLED; unsigned IOCTL_KIOCLAYOUT = KIOCLAYOUT; unsigned IOCTL_VUIDSFORMAT = VUIDSFORMAT; unsigned IOCTL_VUIDGFORMAT = VUIDGFORMAT; +#ifdef NBPG unsigned IOCTL_STICIO_GXINFO = STICIO_GXINFO; unsigned IOCTL_STICIO_RESET = STICIO_RESET; unsigned IOCTL_STICIO_STARTQ = STICIO_STARTQ; unsigned IOCTL_STICIO_STOPQ = STICIO_STOPQ; +#endif unsigned IOCTL_UKYOPON_IDENTIFY = UKYOPON_IDENTIFY; unsigned IOCTL_USB_REQUEST = USB_REQUEST; unsigned IOCTL_USB_SETDEBUG = USB_SETDEBUG;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Sun Sep 6 05:30:17 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux_libcdep.cc Log Message: fix merge botch: netbsd doesn't want any of this. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc 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_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13 Sat Sep 5 13:35:55 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Sun Sep 6 05:30:17 2020 @@ -543,13 +543,15 @@ void GetThreadStackAndTls(bool main, upt #endif } -#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD +#if !SANITIZER_NETBSD +#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD typedef ElfW(Phdr) Elf_Phdr; #elif SANITIZER_WORDSIZE == 32 && __FreeBSD_version <= 902001 // v9.2 #define Elf_Phdr XElf32_Phdr #define dl_phdr_info xdl_phdr_info #define dl_iterate_phdr(c, b) xdl_iterate_phdr((c), (b)) #endif // !SANITIZER_FREEBSD && !SANITIZER_OPENBSD +#endif // !SANITIZER_NETBSD struct DlIteratePhdrData { InternalMmapVectorNoCtor *modules;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Sat Sep 5 13:35:55 UTC 2020 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc sanitizer_linux.h sanitizer_linux_libcdep.cc sanitizer_platform_limits_netbsd.cc sanitizer_syscall_generic.inc Log Message: fix various merge botches; we may need to re-port the ThreadLister code. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc cvs rdiff -u -r1.9 -r1.10 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h cvs rdiff -u -r1.12 -r1.13 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc cvs rdiff -u -r1.8 -r1.9 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc 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.33 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33 Sat Sep 5 09:12:32 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sat Sep 5 13:35:55 2020 @@ -41,8 +41,6 @@ #undef stat #endif -#endif // SANITIZER_LINUX - #if SANITIZER_NETBSD #include #endif @@ -980,7 +978,6 @@ ThreadLister::ThreadLister(pid_t pid) : if (internal_iserror(descriptor_)) { Report("Can't open /proc/%d/task for reading.\n", pid); } -#endif } ThreadLister::Result ThreadLister::ListThreads( @@ -1055,10 +1052,8 @@ bool ThreadLister::IsAlive(int tid) { } ThreadLister::~ThreadLister() { -#ifndef SANITIZER_NETBSD if (!internal_iserror(descriptor_)) internal_close(descriptor_); -#endif } #endif Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9 Sat Sep 5 09:12:32 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h Sat Sep 5 13:35:55 2020 @@ -69,6 +69,8 @@ uptr internal_clone(int (*fn)(void *), v #endif #elif SANITIZER_FREEBSD void internal_sigdelset(__sanitizer_sigset_t *set, int signum); +#elif SANITIZER_NETBSD +uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5); #endif // SANITIZER_LINUX #ifdef SANITIZER_NETBSD 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.12 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12 Sat Sep 5 09:12:32 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Sat Sep 5 13:35:55 2020 @@ -72,6 +72,10 @@ struct __sanitizer::linux_dirent { #include #endif +#if SANITIZER_NETBSD +#include +#endif + namespace __sanitizer { SANITIZER_WEAK_ATTRIBUTE int Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2 Sat Sep 5 07:52:57 2020 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc Sat Sep 5 13:35:55 2020 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -48,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -73,6 +71,7 @@ #include #include #include +#undef INLINE #include #include #include @@ -106,7 +105,6 @@ #include #include #include -#include #include #include #include @@ -114,7 +112,6 @@ #include #include #include -#include #include #include #include @@ -122,6 +119,7 @@ #include #include #include +#include #include #include #include @@ -130,8 +128,6 @@ #include #include #include -#include -#include #include #include #include @@ -347,8 +343,6 @@ unsigned struct_apm_power_info_sz = size unsigned struct_atabusiodetach_args_sz = size
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Sat Apr 27 00:23:18 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: Backport improvements into GCC's sanitizer_linux.cc from more recent LLVM Backport fixups for syscall()/__syscall() routines from LLVM compiler-rt dated October 1st 2018. The commit beffore switching LLVM compiler-rt sycall calls to libc calls for NetBSD. GCC8 will get part of these changes from upstream and GCC9 will operate on libc calls directly for the NetBSD port. This is intended to correct misuse of parameters of syscall()/__syscall() that could break !x86 ports in UBSan. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.29 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29 Tue Apr 16 07:34:54 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sat Apr 27 00:23:17 2019 @@ -42,6 +42,10 @@ #endif // !SANITIZER_FREEBSD && !SANITIZER_NETBSD +#if SANITIZER_NETBSD +#include +#endif + #include #include #include @@ -74,6 +78,8 @@ extern char **environ; // provided by c #if SANITIZER_NETBSD #include // For NAME_MAX #include +#include +extern struct ps_strings *__ps_strings; extern char **environ; // provided by crt1 #endif // SANITIZER_NETBSD @@ -147,11 +153,11 @@ uptr internal_mmap(void *addr, uptr leng #endif // !SANITIZER_S390 uptr internal_munmap(void *addr, uptr length) { - return internal_syscall(SYSCALL(munmap), (uptr)addr, length); + return internal_syscall_ptr(SYSCALL(munmap), (uptr)addr, length); } int internal_mprotect(void *addr, uptr length, int prot) { - return internal_syscall(SYSCALL(mprotect), (uptr)addr, length, prot); + return internal_syscall_ptr(SYSCALL(mprotect), (uptr)addr, length, prot); } uptr internal_close(fd_t fd) { @@ -162,7 +168,7 @@ uptr internal_open(const char *filename, #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags); #else - return internal_syscall(SYSCALL(open), (uptr)filename, flags); + return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags); #endif } @@ -171,7 +177,7 @@ uptr internal_open(const char *filename, return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags, mode); #else - return internal_syscall(SYSCALL(open), (uptr)filename, flags, mode); + return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags, mode); #endif } @@ -200,7 +206,7 @@ uptr internal_write(fd_t fd, const void uptr internal_ftruncate(fd_t fd, uptr size) { sptr res; #ifdef SANITIZER_NETBSD - HANDLE_EINTR(res, internal_syscall(SYSCALL(ftruncate), fd, 0, (s64)size)); + HANDLE_EINTR(res, internal_syscall64(SYSCALL(ftruncate), fd, 0, (s64)size)); #else HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd, (OFF_T)size)); @@ -250,7 +256,7 @@ static void kernel_stat_to_stat(struct k uptr internal_stat(const char *path, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_NETBSD - return internal_syscall(SYSCALL(stat), path, buf); + return internal_syscall_ptr(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); @@ -274,7 +280,7 @@ uptr internal_stat(const char *path, voi uptr internal_lstat(const char *path, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_NETBSD - return internal_syscall(SYSCALL(lstat), path, buf); + return internal_syscall_ptr(SYSCALL(lstat), path, buf); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); @@ -298,7 +304,7 @@ uptr internal_lstat(const char *path, vo uptr internal_fstat(fd_t fd, void *buf) { #if SANITIZER_FREEBSD || SANITIZER_NETBSD - return internal_syscall(SYSCALL(fstat), fd, (uptr)buf); + return internal_syscall_ptr(SYSCALL(fstat), fd, (uptr)buf); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return = internal_syscall(SYSCALL(fstat), fd, &kbuf); #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS @@ -336,7 +342,7 @@ uptr internal_dup2(int oldfd, int newfd) uptr internal_readlink(const char *path, char *buf, uptr bufsize) { #if SANITIZER_NETBSD - return internal_syscall_ptr(SYSCALL(readlink), path, buf, bu
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Tue Apr 16 07:34:54 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: no clone() on netbsd. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.28 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28 Tue Apr 16 01:40:16 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Tue Apr 16 07:34:54 2019 @@ -1182,7 +1182,7 @@ uptr internal_clone(int (*fn)(void *), v : "x30", "memory"); return res; } -#elif defined(__powerpc64__) +#elif defined(__powerpc64__) && SANITIZER_LINUX uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Tue Apr 16 01:40:16 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: Sync GetPcSpBp() with GCC9 (and recent LLVM) Unify all NetBSD ports in a single ifdef. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.27 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27 Mon Apr 15 15:58:23 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Tue Apr 16 01:40:16 2019 @@ -1402,51 +1402,39 @@ SignalContext::WriteFlag SignalContext:: } void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { -#if defined(__arm__) - ucontext_t *ucontext = (ucontext_t*)context; -# if SANITIZER_NETBSD +#if SANITIZER_NETBSD + // This covers all NetBSD architectures + ucontext_t *ucontext = (ucontext_t *)context; *pc = _UC_MACHINE_PC(ucontext); + *bp = _UC_MACHINE_FP(ucontext); *sp = _UC_MACHINE_SP(ucontext); - *bp = ucontext->uc_mcontext.__gregs[_REG_R11]; -# else +#elif defined(__arm__) + ucontext_t *ucontext = (ucontext_t*)context; *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; -# if SANITIZER_NETBSD - *pc = _UC_MACHINE_PC(ucontext); - *sp = _UC_MACHINE_SP(ucontext); - *bp = ucontext->uc_mcontext.__gregs[29]; /* XXX */ -# else *pc = ucontext->uc_mcontext.pc; *bp = ucontext->uc_mcontext.regs[29]; *sp = ucontext->uc_mcontext.sp; -# endif #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; *pc = ucontext->uc_mcontext.mc_rip; *bp = ucontext->uc_mcontext.mc_rbp; *sp = ucontext->uc_mcontext.mc_rsp; -# elif SANITIZER_NETBSD - ucontext_t *ucontext = (ucontext_t*)context; - *pc = ucontext->uc_mcontext.__gregs[_REG_RIP]; - *bp = ucontext->uc_mcontext.__gregs[_REG_RBP]; - *sp = ucontext->uc_mcontext.__gregs[_REG_RSP]; +#elif SANITIZER_OPENBSD + sigcontext *ucontext = (sigcontext *)context; + *pc = ucontext->sc_rip; + *bp = ucontext->sc_rbp; + *sp = ucontext->sc_rsp; # else ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.gregs[REG_RIP]; @@ -1459,94 +1447,64 @@ void GetPcSpBp(void *context, uptr *pc, *pc = ucontext->uc_mcontext.mc_eip; *bp = ucontext->uc_mcontext.mc_ebp; *sp = ucontext->uc_mcontext.mc_esp; -# elif SANITIZER_NETBSD - ucontext_t *ucontext = (ucontext_t*)context; - *pc = ucontext->uc_mcontext.__gregs[_REG_EIP]; - *bp = ucontext->uc_mcontext.__gregs[_REG_EBP]; - *sp = ucontext->uc_mcontext.__gregs[_REG_ESP]; -# else - ucontext_t *ucontext = (ucontext_t*)context; +#elif SANITIZER_OPENBSD + sigcontext *ucontext = (sigcontext *)context; + *pc = ucontext->sc_eip; + *bp = ucontext->sc_ebp; + *sp = ucontext->sc_esp; +# else + ucontext_t *ucontext = (ucontext_t*)context; +# if SANITIZER_SOLARIS + /* Use the numeric values: the symbolic ones are undefined by llvm + include/llvm/Support/Solaris.h. */ +# ifndef REG_EIP +# define REG_EIP 14 // REG_PC +# endif +# ifndef REG_EBP +# define REG_EBP 6 // REG_FP +# endif +# ifndef REG_ESP +# define REG_ESP 17 // REG_SP +# endif +# endif *pc = ucontext->uc_mcontext.gregs[REG_EIP]; *bp = ucontext->uc_mcontext.gregs[REG_EBP]; *sp = ucontext->uc_mcontext.gregs[REG_ESP]; # 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__) +# if defined(__arch64__) || defined(__sparcv9) +# define STACK_BIAS 2047
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: maya Date: Mon Apr 15 15:58:23 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: Provide riscv implementation. XXX this is MI, why not use it for everyone? To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.26 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.26 Tue Feb 5 12:56:43 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Mon Apr 15 15:58:23 2019 @@ -1542,6 +1542,11 @@ void GetPcSpBp(void *context, uptr *pc, *pc = _UC_MACHINE_PC(ucontext); *sp = _UC_MACHINE_SP(ucontext); *bp = ucontext->uc_mcontext.__gregs[1]; /* XXX */ +#elif defined(__riscv) && SANITIZER_NETBSD + ucontext_t *ucontext = (ucontext_t*)context; + *pc = _UC_MACHINE_PC(ucontext); + *sp = _UC_MACHINE_SP(ucontext); + *bp = _UC_MACHINE_FP(ucontext); #elif defined(__s390__) ucontext_t *ucontext = (ucontext_t*)context; # if defined(__s390x__)
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Wed Feb 6 03:59:09 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: Makefile.am Makefile.in Log Message: add sanitizer_procmaps_netbsd.cc To generate a diff of this commit: cvs rdiff -u -r1.1.1.4 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in 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/Makefile.am diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.1.1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.1.1.4 Sat Jan 19 10:14:03 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am Wed Feb 6 03:59:09 2019 @@ -42,6 +42,7 @@ sanitizer_common_files = \ sanitizer_printf.cc \ sanitizer_procmaps_common.cc \ sanitizer_procmaps_freebsd.cc \ + sanitizer_procmaps_netbsd.cc \ sanitizer_procmaps_linux.cc \ sanitizer_procmaps_mac.cc \ sanitizer_stackdepot.cc \ Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.1.1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.1.1.4 Sat Jan 19 10:14:03 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in Wed Feb 6 03:59:09 2019 @@ -93,6 +93,7 @@ am__objects_1 = sanitizer_allocator.lo s sanitizer_platform_limits_posix.lo sanitizer_posix.lo \ sanitizer_posix_libcdep.lo sanitizer_printf.lo \ sanitizer_procmaps_common.lo sanitizer_procmaps_freebsd.lo \ + sanitizer_procmaps_netbsd.lo \ sanitizer_procmaps_linux.lo sanitizer_procmaps_mac.lo \ sanitizer_stackdepot.lo sanitizer_stacktrace.lo \ sanitizer_stacktrace_libcdep.lo sanitizer_symbolizer_mac.lo \ @@ -323,6 +324,7 @@ sanitizer_common_files = \ sanitizer_printf.cc \ sanitizer_procmaps_common.cc \ sanitizer_procmaps_freebsd.cc \ + sanitizer_procmaps_netbsd.cc \ sanitizer_procmaps_linux.cc \ sanitizer_procmaps_mac.cc \ sanitizer_stackdepot.cc \ @@ -464,6 +466,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_printf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_freebsd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_netbsd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_linux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_mac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stackdepot.Plo@am__quote@
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Tue Feb 5 12:56:43 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: provide empty version of Aarch64GetESR() for non-linux arm64. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.25 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.26 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.25 Mon Feb 4 03:00:11 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Tue Feb 5 12:56:43 2019 @@ -1346,6 +1346,7 @@ void internal_join_thread(void *th) {} #endif #if defined(__aarch64__) +#if SANITIZER_LINUX // Android headers in the older NDK releases miss this definition. struct __sanitizer_esr_context { struct _aarch64_ctx head; @@ -1366,6 +1367,11 @@ static bool Aarch64GetESR(ucontext_t *uc } return false; } +#else +static bool Aarch64GetESR(ucontext_t *ucontext, u64 *esr) { + return false; +} +#endif #endif SignalContext::WriteFlag SignalContext::GetWriteFlag(void *context) {
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Mon Feb 4 03:00:11 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: make the internal_fstat() for netbsd be like the others. fixes powerpc (at least) builds. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.24 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.25 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.24 Sun Feb 3 11:12:01 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Mon Feb 4 03:00:11 2019 @@ -297,7 +297,11 @@ uptr internal_lstat(const char *path, vo } uptr internal_fstat(fd_t fd, void *buf) { -#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS +#if SANITIZER_FREEBSD || SANITIZER_NETBSD + return internal_syscall(SYSCALL(fstat), fd, (uptr)buf); +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS + return = internal_syscall(SYSCALL(fstat), fd, &kbuf); +#elif SANITIZER_LINUX_USES_64BIT_SYSCALLS # if SANITIZER_MIPS64 // For mips64, fstat syscall fills buffer in the format of kernel_stat struct kernel_stat kbuf;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Sun Feb 3 11:12:01 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: disable SignalContext::GetWriteFlag() for netbsd/arm (for now). To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.23 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.24 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.23 Thu Jan 31 08:44:14 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sun Feb 3 11:12:01 2019 @@ -1376,7 +1376,7 @@ SignalContext::WriteFlag SignalContext:: uptr err = ucontext->uc_mcontext.gregs[REG_ERR]; #endif return err & PF_WRITE ? WRITE : READ; -#elif defined(__arm__) +#elif defined(__arm__) && !SANITIZER_NETBSD static const uptr FSR_WRITE = 1U << 11; uptr fsr = ucontext->uc_mcontext.error_code; return fsr & FSR_WRITE ? WRITE : READ;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Sun Feb 3 11:10:59 UTC 2019 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_allocator_primary64.h Log Message: make structure that demands alignment be that alignment. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.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_allocator_primary64.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:1.2 Sat Jan 19 12:10:12 2019 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h Sun Feb 3 11:10:58 2019 @@ -325,7 +325,7 @@ class SizeClassAllocator64 { uptr num_releases; }; - struct RegionInfo { + struct ALIGNED(kCacheLineSize) RegionInfo { BlockingMutex mutex; uptr num_freed_chunks; // Number of elements in the freearray. uptr mapped_free_array; // Bytes mapped for freearray.
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Sun Jul 15 00:32:40 UTC 2018 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc sanitizer_stoptheworld_linux_libcdep.cc Log Message: aarch64 sanitizer bits To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc 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.19 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.20 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.19 Tue Jun 26 16:55:38 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sat Jul 14 20:32:40 2018 @@ -1018,7 +1018,7 @@ uptr internal_clone(int (*fn)(void *), v : "memory", "$29" ); return res; } -#elif defined(__aarch64__) +#elif defined(__aarch64__) && SANITIZER_LINUX uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res; @@ -1171,9 +1171,15 @@ void GetPcSpBp(void *context, uptr *pc, # endif #elif defined(__aarch64__) ucontext_t *ucontext = (ucontext_t*)context; +# if SANITIZER_NETBSD + *pc = _UC_MACHINE_PC(ucontext); + *sp = _UC_MACHINE_SP(ucontext); + *bp = ucontext->uc_mcontext.__gregs[29]; /* XXX */ +# else *pc = ucontext->uc_mcontext.pc; *bp = ucontext->uc_mcontext.regs[29]; *sp = ucontext->uc_mcontext.sp; +# endif #elif defined(__hppa__) ucontext_t *ucontext = (ucontext_t*)context; # if SANITIZER_NETBSD 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.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.2 Tue Jun 26 16:55:38 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc Sat Jul 14 20:32:40 2018 @@ -34,7 +34,7 @@ #if SANITIZER_ANDROID && defined(__arm__) # include // for pt_regs #else -# ifdef __aarch64__ +# if SANITIZER_LINUX && defined( __aarch64__) // GLIBC 2.20+ sys/user does not include asm/ptrace.h # include # endif
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Sun Jul 1 14:20:23 UTC 2018 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_allocator.h Log Message: disable one more size check for _LP32 to make pcc build. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.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_allocator.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.2 Wed Jun 27 11:57:20 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h Sun Jul 1 10:20:23 2018 @@ -497,7 +497,9 @@ class SizeClassAllocator64 { uptr mapped_meta; // Bytes mapped for metadata. uptr n_allocated, n_freed; // Just stats. }; +#if _LP64 COMPILER_CHECK(sizeof(RegionInfo) >= kCacheLineSize); +#endif RegionInfo *GetRegionInfo(uptr class_id) { CHECK_LT(class_id, kNumClasses);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: martin Date: Mon Jun 4 13:12:54 UTC 2018 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: Quick hack to fix 32bit big endian platforms: the return value from __syscall() needs to be shifted into the lower 32bits to form a proper pointer. Temporarily steal __SYSCALL_TO_UINTPTR_T from the syscall/__syscall test program, Kamil is working on a proper solution. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.17 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.18 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.17 Wed May 23 11:14:49 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Mon Jun 4 13:12:54 2018 @@ -113,8 +113,16 @@ namespace __sanitizer { uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd, OFF_T offset) { #if SANITIZER_NETBSD - return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd, - (long)0, offset); + +#if !defined(_LP64) && BYTE_ORDER == _BIG_ENDIAN +#define __SYSCALL_TO_UINTPTR_T(V) ((uintptr_t)((V)>>32)) +#else +#define __SYSCALL_TO_UINTPTR_T(V) ((uintptr_t)(V)) +#endif + + return __SYSCALL_TO_UINTPTR_T( + internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd, + (long)0, offset)); #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd, offset, 0);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Wed May 23 11:14:49 UTC 2018 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: Cherry-pick upstream patch for internal_mmap() in GCC sanitizers Fix internal_mmap() on 32-bit NetBSD platforms There is need to use internal_syscall64() instead of internal_syscall_ptr(). The offset argument of type off_t is always 64-bit. http://llvm.org/viewvc/llvm-project?view=revision&revision=333075 PR kern/53261 by Martin Husemann To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.16 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.17 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.16 Fri Feb 16 07:59:05 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Wed May 23 11:14:49 2018 @@ -113,7 +113,7 @@ namespace __sanitizer { uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd, OFF_T offset) { #if SANITIZER_NETBSD - return internal_syscall_ptr(SYSCALL(mmap), addr, length, prot, flags, fd, + return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd, (long)0, offset); #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Sun Feb 25 01:05:09 UTC 2018 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_unwind_linux_libcdep.cc Log Message: fix some types of netbsd arm builds. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc 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_unwind_linux_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.2 Wed Feb 14 02:10:06 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc Sun Feb 25 01:05:09 2018 @@ -80,7 +80,7 @@ void SanitizerInitializeUnwinder() { #endif uptr Unwind_GetIP(struct _Unwind_Context *ctx) { -#if defined(__arm__) && !SANITIZER_MAC +#if defined(__arm__) && !SANITIZER_MAC && !SANITIZER_NETBSD uptr val; _Unwind_VRS_Result res = _Unwind_VRS_Get(ctx, _UVRSC_CORE, 15 /* r15 = PC */, _UVRSD_UINT32, &val);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Feb 14 02:10:32 UTC 2018 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_flags.inc Log Message: enable addr2line To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc 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_flags.inc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.1.1.1 Thu Feb 1 20:58:46 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc Tue Feb 13 21:10:32 2018 @@ -27,7 +27,7 @@ COMMON_FLAG( "Path to external symbolizer. If empty, the tool will search $PATH for " "the symbolizer.") COMMON_FLAG( -bool, allow_addr2line, false, +bool, allow_addr2line, true, "If set, allows online symbolizer to run addr2line binary to symbolize " "stack traces (addr2line will only be used if llvm-symbolizer binary is " "unavailable.")
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Feb 14 02:10:06 UTC 2018 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_unwind_linux_libcdep.cc Log Message: - enable netbsd - add cast to (uptr) for _Unwind_GetIP To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc 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_unwind_linux_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.1.1.1 Thu Feb 1 20:58:46 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc Tue Feb 13 21:10:06 2018 @@ -10,7 +10,7 @@ //===--===// #include "sanitizer_platform.h" -#if SANITIZER_FREEBSD || SANITIZER_LINUX +#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD #include "sanitizer_common.h" #include "sanitizer_stacktrace.h" @@ -88,7 +88,7 @@ uptr Unwind_GetIP(struct _Unwind_Context // Clear the Thumb bit. return val & ~(uptr)1; #else - return _Unwind_GetIP(ctx); + return (uptr)_Unwind_GetIP(ctx); #endif }
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Wed Jun 14 12:16:27 UTC 2017 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_procmaps_netbsd.cc Log Message: Detach from sanitizer_procmaps_netbsd.cc (GCC) This header in this context is freebsdism. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc 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_procmaps_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.2 Wed Jun 1 04:06:15 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc Wed Jun 14 12:16:27 2017 @@ -15,7 +15,6 @@ #include #include -#include namespace __sanitizer {
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Dec 1 18:20:25 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_flags.cc Log Message: on NetBSD we don't have llvm_symbolizer, so try addr2line... To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc 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_flags.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc:1.1.1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc:1.1.1.2 Sun Jan 24 01:05:41 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc Thu Dec 1 13:20:25 2016 @@ -35,7 +35,11 @@ IntrusiveList flag_desc void SetCommonFlagsDefaults(CommonFlags *f) { f->symbolize = true; f->external_symbolizer_path = 0; +#if SANITIZER_NETBSD + f->allow_addr2line = true; +#else f->allow_addr2line = false; +#endif f->strip_path_prefix = ""; f->fast_unwind_on_check = false; f->fast_unwind_on_fatal = false;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Dec 1 18:19:19 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: use the right sysctl to find the main binary name. We don't really need this since our dl_iterate_phdr DTRT's for objmain, but... To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.7 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.8 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.7 Sat Jun 11 16:45:07 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Thu Dec 1 13:19:19 2016 @@ -751,7 +751,11 @@ uptr ReadBinaryName(/*out*/char *buf, up return module_name_len; } #if SANITIZER_FREEBSD || SANITIZER_NETBSD +# if SANITIZER_FREEBSD const int Mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; +# else + const int Mib[4] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME }; +# endif size_t Size = buf_len; bool IsErr = (sysctl(Mib, 4, buf, &Size, NULL, 0) != 0); int readlink_error = IsErr ? errno : 0;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Sep 22 13:13:09 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_posix.h Log Message: __NetBSD__ -> SANITIZER_NETBSD To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.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_platform_limits_posix.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.9 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8 Wed Sep 21 23:43:07 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h Thu Sep 22 09:13:09 2016 @@ -13,7 +13,7 @@ #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H #define SANITIZER_PLATFORM_LIMITS_POSIX_H -#ifdef __NetBSD__ +#if SANITIZER_NETBSD #define _SYS_SIGNAL_H_ #include #undef _SYS_SIGNAL_H_ @@ -343,7 +343,7 @@ namespace __sanitizer { # endif void *ifa_dstaddr; // (struct sockaddr *) void *ifa_data; -# ifdef __NetBSD__ +# if SANITIZER_NETBSD # if __NetBSD_Prereq__(7, 99, 39) unsigned int ifa_addrflags; # endif
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Sep 22 03:43:08 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_posix.h Log Message: Avoid definining a prototype for signal(3) from because the INTERCEPTOR macro cannot handle function returns easily. TODO: fix to avoid this kind of name pollution. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.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_platform_limits_posix.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.7 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.7 Wed Sep 21 19:18:42 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h Wed Sep 21 23:43:07 2016 @@ -14,7 +14,9 @@ #define SANITIZER_PLATFORM_LIMITS_POSIX_H #ifdef __NetBSD__ +#define _SYS_SIGNAL_H_ #include +#undef _SYS_SIGNAL_H_ #endif #include "sanitizer_internal_defs.h" #include "sanitizer_platform.h"
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Sep 21 23:18:42 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_posix.h Log Message: need To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.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_platform_limits_posix.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.6 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.7 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.6 Wed Sep 21 17:30:56 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h Wed Sep 21 19:18:42 2016 @@ -13,6 +13,9 @@ #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H #define SANITIZER_PLATFORM_LIMITS_POSIX_H +#ifdef __NetBSD__ +#include +#endif #include "sanitizer_internal_defs.h" #include "sanitizer_platform.h"
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Sep 21 21:30:56 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_posix.h Log Message: Check the NetBSD version To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.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_platform_limits_posix.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.6 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.5 Wed Sep 21 15:18:01 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h Wed Sep 21 17:30:56 2016 @@ -338,9 +338,11 @@ namespace __sanitizer { # endif void *ifa_dstaddr; // (struct sockaddr *) void *ifa_data; -#ifdef __NetBSD__ +# ifdef __NetBSD__ +# if __NetBSD_Prereq__(7, 99, 39) unsigned int ifa_addrflags; -#endif +# endif +# endif }; #endif // !SANITIZER_ANDROID
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Sep 21 19:18:01 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_posix.h Log Message: add new field To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.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_platform_limits_posix.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.5 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.4 Thu Jun 9 03:38:45 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h Wed Sep 21 15:18:01 2016 @@ -338,6 +338,9 @@ namespace __sanitizer { # endif void *ifa_dstaddr; // (struct sockaddr *) void *ifa_data; +#ifdef __NetBSD__ +unsigned int ifa_addrflags; +#endif }; #endif // !SANITIZER_ANDROID
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Sat Jun 11 20:45:07 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: fix compilation and getdents. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.6 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.7 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.6 Sat Jun 11 09:39:26 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sat Jun 11 16:45:07 2016 @@ -538,7 +538,7 @@ uptr internal_ptrace(int request, int pi } uptr internal_waitpid(int pid, int *status, int options) { -+#if SANITIZER_NETBSD +#if SANITIZER_NETBSD return internal_syscall(SYSCALL(wait4), pid, status, options, NULL /* rusage */); #else @@ -556,7 +556,9 @@ uptr internal_getppid() { } uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) { -#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_NETBSD + return internal_syscall(SYSCALL(getdents), fd, dirp, (uptr)count); +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count); #else return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Sat Jun 11 13:39:26 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc sanitizer_syscall_generic.inc Log Message: More fixed from Rin Okuyama fix waitpid, getdents, explain ptrace, cleanup redefinitions To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc 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.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.6 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.5 Thu Jun 9 10:37:06 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Sat Jun 11 09:39:26 2016 @@ -56,6 +56,7 @@ extern "C" { extern char **environ; // provided by crt1 #endif // SANITIZER_FREEBSD #if SANITIZER_NETBSD +#include // For NAME_MAX #include extern char **environ; // provided by crt1 #endif // SANITIZER_NETBSD @@ -494,6 +495,17 @@ void BlockingMutex::CheckLocked() { // The actual size of this structure is specified by d_reclen. // Note that getdents64 uses a different structure format. We only provide the // 32-bit syscall here. +#if SANITIZER_NETBSD +// struct dirent is different for Linux and us. At this moment, we use only +// d_fileno (Linux call this d_ino), d_reclen, and d_name. +struct linux_dirent { + u64 d_ino; // d_fileno + u16 d_reclen; + u16 d_namlen; // not used + u8 d_type;// not used + char d_name[NAME_MAX + 1]; +}; +#else struct linux_dirent { #if SANITIZER_X32 u64 d_ino; @@ -505,10 +517,18 @@ struct linux_dirent { unsigned short d_reclen; char d_name[256]; }; +#endif // Syscall wrappers. uptr internal_ptrace(int request, int pid, void *addr, void *data) { #if SANITIZER_NETBSD +// XXX We need additional work for ptrace: +// - for request, we use PT_FOO whereas Linux uses PTRACE_FOO +// - data is int for us, but void * for Linux +// - Linux sometimes uses data in the case where we use addr instead +// At this moment, this function is used only within +// "#if SANITIZER_LINUX && defined(__x86_64__)" block in +// sanitizer_stoptheworld_linux_libcdep.cc. return internal_syscall_ptr(SYSCALL(ptrace), request, pid, (uptr)addr, (uptr)data); #else @@ -518,8 +538,13 @@ uptr internal_ptrace(int request, int pi } uptr internal_waitpid(int pid, int *status, int options) { ++#if SANITIZER_NETBSD + return internal_syscall(SYSCALL(wait4), pid, status, options, + NULL /* rusage */); +#else return internal_syscall(SYSCALL(wait4), pid, (uptr)status, options, 0 /* rusage */); +#endif } uptr internal_getpid() { 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.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc:1.4 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc:1.3 Thu Jun 9 10:37:06 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc Sat Jun 11 09:39:26 2016 @@ -38,9 +38,7 @@ # else # define internal_syscall_ptr syscall # endif -#endif - -#if (SANITIZER_FREEBSD && defined(__x86_64__)) +#elif (SANITIZER_FREEBSD && defined(__x86_64__)) # define internal_syscall __syscall # else # define internal_syscall syscall
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Jun 9 14:37:06 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc sanitizer_syscall_generic.inc Log Message: Fix syscall argument passing from Ryn Okuyama (with minor changes; hope I did not make it worse :-) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc 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.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.5 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.4 Tue May 31 21:54:06 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Thu Jun 9 10:37:06 2016 @@ -101,7 +101,10 @@ namespace __sanitizer { // --- sanitizer_libc.h uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd, u64 offset) { -#if SANITIZER_NETBSD || SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS +#if SANITIZER_NETBSD + return internal_syscall_ptr(SYSCALL(mmap), addr, length, prot, flags, fd, + (long)0, offset); +#elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd, offset, 0); #else @@ -142,21 +145,33 @@ uptr OpenFile(const char *filename, bool uptr internal_read(fd_t fd, void *buf, uptr count) { sptr res; +#ifdef SANITIZER_NETBSD + HANDLE_EINTR(res, internal_syscall_ptr(SYSCALL(read), fd, buf, count)); +#else HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(read), fd, (uptr)buf, count)); +#endif return res; } uptr internal_write(fd_t fd, const void *buf, uptr count) { sptr res; +#ifdef SANITIZER_NETBSD + HANDLE_EINTR(res, internal_syscall_ptr(SYSCALL(write), fd, buf, count)); +#else HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(write), fd, (uptr)buf, count)); +#endif return res; } uptr internal_ftruncate(fd_t fd, uptr size) { sptr res; +#ifdef SANITIZER_NETBSD + HANDLE_EINTR(res, internal_syscall(SYSCALL(ftruncate), fd, 0, (s64)size)); +#else HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd, size)); +#endif return res; } @@ -239,7 +254,9 @@ uptr internal_dup2(int oldfd, int newfd) } uptr internal_readlink(const char *path, char *buf, uptr bufsize) { -#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_NETBSD + return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize); +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(readlinkat), AT_FDCWD, (uptr)path, (uptr)buf, bufsize); #else @@ -311,7 +328,11 @@ u64 NanoTime() { kernel_timeval tv; #endif internal_memset(&tv, 0, sizeof(tv)); +#if SANITIZER_NETBSD + internal_syscall(SYSCALL(gettimeofday), &tv, NULL); +#else internal_syscall(SYSCALL(gettimeofday), (uptr)&tv, 0); +#endif return (u64)tv.tv_sec * 1000*1000*1000 + tv.tv_usec * 1000; } @@ -487,8 +508,13 @@ struct linux_dirent { // Syscall wrappers. uptr internal_ptrace(int request, int pid, void *addr, void *data) { +#if SANITIZER_NETBSD + return internal_syscall_ptr(SYSCALL(ptrace), request, pid, (uptr)addr, + (uptr)data); +#else return internal_syscall(SYSCALL(ptrace), request, pid, (uptr)addr, (uptr)data); +#endif } uptr internal_waitpid(int pid, int *status, int options) { @@ -513,7 +539,11 @@ uptr internal_getdents(fd_t fd, struct l } uptr internal_lseek(fd_t fd, OFF_T offset, int whence) { +#if SANITIZER_NETBSD + return internal_syscall64(SYSCALL(lseek), fd, 0, offset, whence); +#else return internal_syscall(SYSCALL(lseek), fd, offset, whence); +#endif } #if SANITIZER_LINUX 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.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc:1.2 Tue May 31 16:47:25 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc Thu Jun 9 10:37:06 2016 @@ -25,7 +25,22 @@ # define SYSCALL(name) __NR_ ## name #endif -#if (SANITIZER_FREEBSD && defined(__x86_64__)) || SANITIZER_NETBSD +#if SANITIZER_NETBSD +// We use 3 kinds of
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: mrg Date: Thu Jun 9 07:38:45 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_platform_limits_posix.h Log Message: add netbsd padding to 'struct addrinfo' copy. eeew, this is really horrible To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.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_platform_limits_posix.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.4 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.3 Thu Jun 2 19:54:38 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h Thu Jun 9 07:38:45 2016 @@ -668,7 +668,13 @@ namespace __sanitizer { int ai_socktype; int ai_protocol; #if SANITIZER_ANDROID || SANITIZER_MAC || SANITIZER_FREEBSD || SANITIZER_NETBSD +#if SANITIZER_NETBSD && defined(__sparc__) && defined(_LP64) +int __ai_pad0; +#endif unsigned ai_addrlen; +#if SANITIZER_NETBSD && defined(__alpha__) || (defined(__i386__) && defined(_LP64)) +int __ai_pad0; +#endif char *ai_canonname; void *ai_addr; #else // LINUX
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: martin Date: Mon Jun 6 21:06:33 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_unwind_posix_libcdep.cc Log Message: Build fix for big endian arm, from Rin Okuyama. Still not working, but other details still under discussion. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_posix_libcdep.cc 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_unwind_posix_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_posix_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_posix_libcdep.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_posix_libcdep.cc:1.2 Tue May 31 20:47:25 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_posix_libcdep.cc Mon Jun 6 21:06:33 2016 @@ -71,7 +71,8 @@ void SanitizerInitializeUnwinder() { } #endif -#ifdef __arm__ +#if defined(__arm__) && !SANITIZER_NETBSD +// NetBSD uses dwarf EH #define UNWIND_STOP _URC_END_OF_STACK #define UNWIND_CONTINUE _URC_NO_REASON #else @@ -80,7 +81,7 @@ void SanitizerInitializeUnwinder() { #endif uptr Unwind_GetIP(struct _Unwind_Context *ctx) { -#ifdef __arm__ +#if defined(__arm__) && !SANITIZER_NETBSD uptr val; _Unwind_VRS_Result res = _Unwind_VRS_Get(ctx, _UVRSC_CORE, 15 /* r15 = PC */, _UVRSD_UINT32, &val);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Sun Jun 5 16:43:10 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_internal_defs.h Log Message: Don't play type games with size_t for NetBSD. It is either 32 bits for ILP32 or 64 bits for LP64. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.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_internal_defs.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.6 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.5 Thu Jun 2 15:54:38 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h Sun Jun 5 12:43:10 2016 @@ -88,11 +88,16 @@ typedef uptr OFF_T; #endif typedef u64 OFF64_T; +#if SANITIZER_NETBSD +#include +typedef size_t operator_new_size_type; +#else #if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC typedef uptr operator_new_size_type; #else typedef u32 operator_new_size_type; #endif +#endif } // namespace __sanitizer extern "C" {
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Fri Jun 3 15:53:18 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux_libcdep.cc Log Message: Fix compilation on non-x86 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc 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_libcdep.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.2 Tue May 31 16:47:25 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Fri Jun 3 11:53:18 2016 @@ -236,7 +236,7 @@ uptr ThreadSelf() { } #endif // (defined(__x86_64__) || defined(__i386__)) && SANITIZER_LINUX -#if SANITIZER_FREEBSD || SANITIZER_NETBSD +#if SANITIZER_FREEBSD static void **ThreadSelfSegbase() { void **segbase = 0; # if defined(__i386__) @@ -254,7 +254,13 @@ static void **ThreadSelfSegbase() { uptr ThreadSelf() { return (uptr)ThreadSelfSegbase()[2]; } -#endif // SANITIZER_FREEBSD || SANITIZER_NETBSD +#endif // SANITIZER_FREEBSD + +#if SANITIZER_NETBSD +uptr ThreadSelf() { + return (uptr)pthread_self(); +} +#endif // SANITIZER_NETBSD static void GetTls(uptr *addr, uptr *size) { #if SANITIZER_LINUX @@ -267,7 +273,7 @@ static void GetTls(uptr *addr, uptr *siz *addr = 0; *size = 0; # endif -#elif SANITIZER_FREEBSD || SANITIZER_NETBSD +#elif SANITIZER_FREEBSD void** segbase = ThreadSelfSegbase(); *addr = 0; *size = 0; @@ -280,6 +286,10 @@ static void GetTls(uptr *addr, uptr *siz *addr = (uptr) dtv[2]; *size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]); } +#elif SANITIZER_NETBSD + // XXX: for now + *addr = 0; + *size = 0; #else # error "Unknown OS" #endif
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Jun 2 19:54:38 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_internal_defs.h sanitizer_platform_limits_posix.h Log Message: Fix ILP32 build. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.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_internal_defs.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.5 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.4 Tue May 31 16:47:25 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h Thu Jun 2 15:54:38 2016 @@ -80,7 +80,8 @@ typedef int fd_t; // _FILE_OFFSET_BITS. This definition of OFF_T matches the ABI of system calls // like pread and mmap, as opposed to pread64 and mmap64. // Mac and Linux/x86-64 are special. -#if SANITIZER_MAC || (SANITIZER_LINUX && defined(__x86_64__)) +#if SANITIZER_MAC || (SANITIZER_LINUX && defined(__x86_64__)) || SANITIZER_NETBSD +// XXX: It is signed! typedef u64 OFF_T; #else typedef uptr OFF_T; Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.2 Tue May 31 16:47:25 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h Thu Jun 2 15:54:38 2016 @@ -398,7 +398,7 @@ namespace __sanitizer { char **gr_mem; }; -#if defined(__x86_64__) && !defined(_LP64) +#if (defined(__x86_64__) && !defined(_LP64)) || SANITIZER_NETBSD typedef long long __sanitizer_time_t; #else typedef long __sanitizer_time_t;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Jun 1 04:06:15 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_procmaps_netbsd.cc Log Message: use the correct array size. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc 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_procmaps_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.1 Tue May 31 17:35:11 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc Wed Jun 1 00:06:15 2016 @@ -30,7 +30,7 @@ void ReadProcMaps(ProcSelfMapsBuff *proc size_t MmapedSize = Size * 4 / 3; void *VmMap = MmapOrDie(MmapedSize, "ReadProcMaps()"); Size = MmapedSize; - Err = sysctl(Mib, 4, VmMap, &Size, NULL, 0); + Err = sysctl(Mib, __arraycount(Mib), VmMap, &Size, NULL, 0); CHECK_EQ(Err, 0); proc_maps->data = (char*)VmMap;
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Jun 1 01:54:06 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Log Message: zero pad syscall. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 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.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.4 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.3 Tue May 31 17:35:11 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Tue May 31 21:54:06 2016 @@ -103,7 +103,7 @@ uptr internal_mmap(void *addr, uptr leng int fd, u64 offset) { #if SANITIZER_NETBSD || SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd, - offset); + offset, 0); #else return internal_syscall(SYSCALL(mmap2), addr, length, prot, flags, fd, offset);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Tue May 31 21:35:11 UTC 2016 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_linux.cc Added Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_procmaps_netbsd.cc Removed Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_netbsd.cc Log Message: - hack BlockingMutex - add NetBSD procmaps - remove old unused source To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc cvs rdiff -u -r1.4 -r0 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc cvs rdiff -u -r0 -r1.1 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc 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.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.2 Tue May 31 16:47:25 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc Tue May 31 17:35:11 2016 @@ -420,7 +420,6 @@ void GetThreadStackAndTls(bool main, upt } #endif // SANITIZER_GO -#if !SANITIZER_NETBSD enum MutexState { MtxUnlocked = 0, MtxLocked = 1, @@ -442,6 +441,8 @@ void BlockingMutex::Lock() { while (atomic_exchange(m, MtxSleeping, memory_order_acquire) != MtxUnlocked) { #if SANITIZER_FREEBSD _umtx_op(m, UMTX_OP_WAIT_UINT, MtxSleeping, 0, 0); +#elif SANITIZER_NETBSD +sched_yield(); // XXX: #else internal_syscall(SYSCALL(futex), (uptr)m, FUTEX_WAIT, MtxSleeping, 0, 0, 0); #endif @@ -455,6 +456,8 @@ void BlockingMutex::Unlock() { if (v == MtxSleeping) { #if SANITIZER_FREEBSD _umtx_op(m, UMTX_OP_WAKE, 1, 0, 0); +#elif SANITIZER_NETBSD +// XXX: #else internal_syscall(SYSCALL(futex), (uptr)m, FUTEX_WAKE, 1, 0, 0, 0); #endif @@ -465,7 +468,6 @@ void BlockingMutex::CheckLocked() { atomic_uint32_t *m = reinterpret_cast(&opaque_storage_); CHECK_NE(MtxUnlocked, atomic_load(m, memory_order_relaxed)); } -#endif // !SANITIZER_NETBSD // - sanitizer_linux.h // The actual size of this structure is specified by d_reclen. Added files: Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc diff -u /dev/null src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.1 --- /dev/null Tue May 31 17:35:12 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc Tue May 31 17:35:11 2016 @@ -0,0 +1,78 @@ +//===-- sanitizer_procmaps_freebsd.cc -===// +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// +// +// Information about the process mappings (FreeBSD-specific parts). +//===--===// + +#include "sanitizer_platform.h" +#if SANITIZER_NETBSD +#include "sanitizer_common.h" +#include "sanitizer_procmaps.h" + +#include +#include +#include + +namespace __sanitizer { + +void ReadProcMaps(ProcSelfMapsBuff *proc_maps) { + struct kinfo_vmentry *kiv; + const int Mib[] = { CTL_VM, VM_PROC, VM_PROC_MAP, getpid(), sizeof(*kiv) }; + size_t Size = 0; + int Err = sysctl(Mib, __arraycount(Mib), NULL, &Size, NULL, 0); + CHECK_EQ(Err, 0); + CHECK_GT(Size, 0); + + size_t MmapedSize = Size * 4 / 3; + void *VmMap = MmapOrDie(MmapedSize, "ReadProcMaps()"); + Size = MmapedSize; + Err = sysctl(Mib, 4, VmMap, &Size, NULL, 0); + CHECK_EQ(Err, 0); + + proc_maps->data = (char*)VmMap; + proc_maps->mmaped_size = MmapedSize; + proc_maps->len = Size; +} + +bool MemoryMappingLayout::Next(uptr *start, uptr *end, uptr *offset, + char filename[], uptr filename_size, + uptr *protection) { + char *last = proc_self_maps_.data + proc_self_maps_.len; + if (current_ >= last) return false; + uptr dummy; + if (!start) start = &dummy; + if (!end) end = &dummy; + if (!offset) offset = &dummy; + if (!protection) protection = &dummy; + struct kinfo_vmentry *VmEntry = (struct kinfo_vmentry*)current_; + + *start = (uptr)VmEntry->kve_start; + *end = (uptr)VmEntry->kve_end; + *offset = (uptr)VmEntry->kve_offset; + + *protection = 0; + if ((VmEntry->kve_protection & KVME_PROT_READ) != 0) +*protection |= kProtectionRead; + if ((VmEntry->kve_protection & KVME_PROT_WRITE) != 0) +*protec
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: matt Date: Tue Mar 31 17:18:35 UTC 2015 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_netbsd.cc Log Message: Deal with NetBSD using dwarf EH To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc 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_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.4 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.3 Thu Oct 23 17:50:24 2014 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc Tue Mar 31 17:18:35 2015 @@ -390,7 +390,7 @@ bool SanitizerGetThreadName(char *name, #ifndef SANITIZER_GO //- SlowUnwindStack --- -#ifdef __arm__ +#if defined(__arm__) && defined(__ARM_EABI__) && !defined(__ARM_DWARF_EH__) #include "unwind-arm-common.h" #define UNWIND_STOP _URC_END_OF_STACK #define UNWIND_CONTINUE _URC_NO_REASON @@ -401,7 +401,7 @@ bool SanitizerGetThreadName(char *name, #endif uptr Unwind_GetIP(struct _Unwind_Context *ctx) { -#ifdef __arm__ +#if defined(__arm__) && defined(__ARM_EABI__) && !defined(__ARM_DWARF_EH__) uptr val; _Unwind_VRS_Result res = _Unwind_VRS_Get(ctx, _UVRSC_CORE, 15 /* r15 = PC */, _UVRSD_UINT32, &val);
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Oct 23 17:50:08 UTC 2014 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_placement_new.h Log Message: stop playing type games, and use the proper type for the placement new operator To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_placement_new.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_placement_new.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_placement_new.h:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_placement_new.h:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_placement_new.h:1.1.1.1 Sat Mar 1 03:41:18 2014 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_placement_new.h Thu Oct 23 13:50:08 2014 @@ -15,6 +15,7 @@ #define SANITIZER_PLACEMENT_NEW_H #include "sanitizer_internal_defs.h" +#include namespace __sanitizer { #if (SANITIZER_WORDSIZE == 64) || defined(__APPLE__) @@ -24,7 +25,7 @@ typedef u32 operator_new_ptr_type; #endif } // namespace __sanitizer -inline void *operator new(__sanitizer::operator_new_ptr_type sz, void *p) { +inline void *operator new(std::size_t sz, void *p) { return p; }
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Thu Oct 23 17:50:24 UTC 2014 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_netbsd.cc Log Message: use the appropriate unwind.h header To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc 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_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.2 Wed Oct 22 12:29:47 2014 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc Thu Oct 23 13:50:24 2014 @@ -29,7 +29,6 @@ #include #include #include -#include #include namespace __sanitizer { @@ -392,9 +391,11 @@ bool SanitizerGetThreadName(char *name, #ifndef SANITIZER_GO //- SlowUnwindStack --- #ifdef __arm__ +#include "unwind-arm-common.h" #define UNWIND_STOP _URC_END_OF_STACK #define UNWIND_CONTINUE _URC_NO_REASON #else +#include #define UNWIND_STOP _URC_NORMAL_STOP #define UNWIND_CONTINUE _URC_NO_REASON #endif
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: christos Date: Wed Oct 22 16:29:47 UTC 2014 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_netbsd.cc Log Message: reduce diffs with upstream. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc 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_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc:1.1 Fri Oct 17 17:44:47 2014 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_netbsd.cc Wed Oct 22 12:29:47 2014 @@ -395,10 +395,6 @@ bool SanitizerGetThreadName(char *name, #define UNWIND_STOP _URC_END_OF_STACK #define UNWIND_CONTINUE _URC_NO_REASON #else -#ifndef _URC_NORMAL_STOP -#define _URC_NORMAL_STOP 0 -#define _URC_NO_REASON 1 -#endif #define UNWIND_STOP _URC_NORMAL_STOP #define UNWIND_CONTINUE _URC_NO_REASON #endif