pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
compiler-rt-git: Sync local patches with upstream review
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Tue Oct 24 18:18:43 2017 +0200
Changeset: 162f585b1b76cfe0141ed3479916b10d3914ab1c
Modified Files:
compiler-rt-git/distinfo
compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
Removed Files:
compiler-rt-git/patches/patch-lib_asan_asan__interceptors.cc
compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__platform__posix.cc
Log Message:
compiler-rt-git: Sync local patches with upstream review
https://reviews.llvm.org/D39124
Sponsored by <The NetBSD Foundation>
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=162f585b1b76cfe0141ed3479916b10d3914ab1c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
compiler-rt-git/distinfo | 8 +-
.../patches/patch-lib_asan_asan__interceptors.cc | 20 -----
...zer__common_sanitizer__common__interceptors.inc | 6 +-
...patch-lib_sanitizer__common_sanitizer__linux.cc | 93 +++++++++++++++-------
.../patch-lib_tsan_rtl_tsan__interceptors.cc | 18 -----
.../patch-lib_tsan_rtl_tsan__platform__posix.cc | 15 ----
6 files changed, 72 insertions(+), 88 deletions(-)
diffs:
diff --git a/compiler-rt-git/distinfo b/compiler-rt-git/distinfo
index 20080e1051..f96d1569c7 100644
--- a/compiler-rt-git/distinfo
+++ b/compiler-rt-git/distinfo
@@ -12,20 +12,18 @@ Size (libcxx-3.6.2.src.tar.xz) = 944020 bytes
SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
-SHA1 (patch-lib_asan_asan__interceptors.cc) = 74abe6eb1c37b13699f50f9fce646e8090ec8835
SHA1 (patch-lib_msan_msan__interceptors.cc) = 4d653c4cfd3ac4a2e9b2e24c7cdbd5e1e4d40297
SHA1 (patch-lib_msan_msan__linux.cc) = 74929d9901d33384d6cb71454e2dbeb4f1832509
-SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 11be5158b04de14ea62b4d81f74631258cf13589
+SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 914c2e110f25bafeb3a7abf64d2cf7ad91454c9d
SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = ac1a5c5e3f4114d9b7a6825381f0e224a662a40f
-SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 220c4d42c8094ff9f1ddf54086010686a669832f
+SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 041d449a1f43568c184e5bdaf0ac069a025c9e09
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = ee9e13a10ec519528e34730da7661c6fbc990465
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = 3c707fada208894a66b4f3f40ad69ec5c4b55ded
SHA1 (patch-lib_sanitizer__common_sanitizer__syscall__generic.inc) = eec3a26027ca2baca69cb2b6f5507951ba1fee2a
SHA1 (patch-lib_tsan_go_buildgo.sh) = 9bb9aefcae996401348eaafe7dd7979a52f18bc3
-SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = be7dc3faa774a318bf89aef6b8ad77ac282ff474
+SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 1b1bf96c50e31cf076dcb9a4f8fa27fc1409a937
SHA1 (patch-lib_tsan_rtl_tsan__platform.h) = efb840bec628ea0653f52eeefdf00750e5e3109d
SHA1 (patch-lib_tsan_rtl_tsan__platform__linux.cc) = 1c043283951b20c5d6abdbd940b4cb8e527177f2
-SHA1 (patch-lib_tsan_rtl_tsan__platform__posix.cc) = e99a94bd7a925a38cac04b09376d5d0de6648f1b
SHA1 (patch-lib_tsan_tests_rtl_tsan__test__util__posix.cc) = ec3993dfa325106c8e39b706527f8230253851dc
SHA1 (patch-test_msan_lit.cfg) = e92693d7e713b657f46c855125411550fca5af6a
SHA1 (patch-test_tsan_lit.cfg) = c7507f246b35d3179a2476fde5bb941c256894fa
diff --git a/compiler-rt-git/patches/patch-lib_asan_asan__interceptors.cc b/compiler-rt-git/patches/patch-lib_asan_asan__interceptors.cc
deleted file mode 100644
index 0a6e112331..0000000000
--- a/compiler-rt-git/patches/patch-lib_asan_asan__interceptors.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD$
-
---- lib/asan/asan_interceptors.cc.orig 2017-10-23 14:29:58.177998728 +0000
-+++ lib/asan/asan_interceptors.cc
-@@ -118,9 +118,15 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free,
- // But asan does not remember UserId's for threads (pthread_t);
- // and remembers all ever existed threads, so the linear search by UserId
- // can be slow.
-+#if !SANITIZER_NETBSD
- #define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \
- do { \
- } while (false)
-+#else
-+#define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name, arg) \
-+ do { \
-+ } while (false)
-+#endif
- #define COMMON_INTERCEPTOR_BLOCK_REAL(name) REAL(name)
- // Strict init-order checking is dlopen-hostile:
- // https://github.com/google/sanitizers/issues/178
diff --git a/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc b/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
index 2d3867a290..9e5fbffb01 100644
--- a/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
+++ b/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
@@ -11,16 +11,18 @@ $NetBSD$
INTERCEPTOR(int, pthread_setname_np, uptr thread, const char *name) {
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, pthread_setname_np, thread, name);
-@@ -4414,6 +4414,15 @@ INTERCEPTOR(int, pthread_setname_np, upt
+@@ -4414,6 +4414,17 @@ INTERCEPTOR(int, pthread_setname_np, upt
return REAL(pthread_setname_np)(thread, name);
}
#define INIT_PTHREAD_SETNAME_NP COMMON_INTERCEPT_FUNCTION(pthread_setname_np);
+#elif SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP && SANITIZER_NETBSD
+INTERCEPTOR(int, pthread_setname_np, uptr thread, const char *name, void *arg) {
+ void *ctx;
++ char newname[32]; // PTHREAD_MAX_NAMELEN_NP=32
+ COMMON_INTERCEPTOR_ENTER(ctx, pthread_setname_np, thread, name, arg);
+ COMMON_INTERCEPTOR_READ_STRING(ctx, name, 0);
-+ COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name, arg);
++ internal_snprintf(newname, sizeof(newname), name, arg);
++ COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, newname);
+ return REAL(pthread_setname_np)(thread, name, arg);
+}
+#define INIT_PTHREAD_SETNAME_NP COMMON_INTERCEPT_FUNCTION(pthread_setname_np);
diff --git a/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__linux.cc b/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
index d7e26b9258..1abbfd6b0e 100644
--- a/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
+++ b/compiler-rt-git/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
@@ -114,7 +114,23 @@ $NetBSD$
# endif
#else
struct stat64 buf64;
-@@ -403,7 +397,7 @@ uptr internal_unlink(const char *path) {
+@@ -389,13 +383,11 @@ 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, bufsize);
+-#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
++#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
+ return internal_syscall(SYSCALL(readlinkat), AT_FDCWD,
+ (uptr)path, (uptr)buf, bufsize);
+ #else
+- return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize);
++ return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
+ #endif
+ }
+
+@@ -403,7 +395,7 @@ uptr internal_unlink(const char *path) {
#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
return internal_syscall(SYSCALL(unlinkat), AT_FDCWD, (uptr)path, 0);
#else
@@ -123,7 +139,7 @@ $NetBSD$
#endif
}
-@@ -412,7 +406,7 @@ uptr internal_rename(const char *oldpath
+@@ -412,7 +404,7 @@ uptr internal_rename(const char *oldpath
return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD,
(uptr)newpath);
#else
@@ -132,7 +148,7 @@ $NetBSD$
#endif
}
-@@ -433,14 +427,14 @@ unsigned int internal_sleep(unsigned int
+@@ -433,14 +425,14 @@ unsigned int internal_sleep(unsigned int
struct timespec ts;
ts.tv_sec = 1;
ts.tv_nsec = 0;
@@ -149,7 +165,20 @@ $NetBSD$
(uptr)envp);
}
-@@ -524,13 +518,13 @@ const char *GetEnv(const char *name) {
+@@ -474,11 +466,7 @@ u64 NanoTime() {
+ kernel_timeval tv;
+ #endif
+ internal_memset(&tv, 0, sizeof(tv));
+-#if SANITIZER_NETBSD
+- internal_syscall_ptr(SYSCALL(gettimeofday), &tv, NULL);
+-#else
+- internal_syscall(SYSCALL(gettimeofday), (uptr)&tv, 0);
+-#endif
++ internal_syscall_ptr(SYSCALL(gettimeofday), &tv, 0);
+ return (u64)tv.tv_sec * 1000*1000*1000 + tv.tv_usec * 1000;
+ }
+
+@@ -524,13 +512,13 @@ const char *GetEnv(const char *name) {
#endif
}
@@ -165,7 +194,7 @@ $NetBSD$
static void ReadNullSepFileToArray(const char *path, char ***arr,
int arr_size) {
char *buff;
-@@ -556,7 +550,22 @@ static void ReadNullSepFileToArray(const
+@@ -556,7 +544,22 @@ static void ReadNullSepFileToArray(const
#endif
static void GetArgsAndEnv(char ***argv, char ***envp) {
@@ -189,7 +218,7 @@ $NetBSD$
#if !SANITIZER_GO
if (&__libc_stack_end) {
#endif
-@@ -571,18 +580,6 @@ static void GetArgsAndEnv(char ***argv,
+@@ -571,18 +574,6 @@ static void GetArgsAndEnv(char ***argv,
ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp);
}
#endif
@@ -208,7 +237,7 @@ $NetBSD$
#endif
}
-@@ -594,8 +591,22 @@ char **GetArgv() {
+@@ -594,8 +585,22 @@ char **GetArgv() {
void ReExec() {
char **argv, **envp;
@@ -232,44 +261,52 @@ $NetBSD$
int rverrno;
CHECK_EQ(internal_iserror(rv, &rverrno), true);
Printf("execve failed, errno %d\n", rverrno);
-@@ -699,7 +710,7 @@ uptr internal_ptrace(int request, int pi
+@@ -698,13 +703,8 @@ 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,
-+ return internal_syscall_ptr(SYSCALL(wait4), pid, status, options,
- NULL /* rusage */);
- #else
- return internal_syscall(SYSCALL(wait4), pid, (uptr)status, options,
-@@ -717,7 +728,7 @@ uptr internal_getppid() {
+- NULL /* rusage */);
+-#else
+- return internal_syscall(SYSCALL(wait4), pid, (uptr)status, options,
++ return internal_syscall_ptr(SYSCALL(wait4), pid, (uptr)status, options,
+ 0 /* rusage */);
+-#endif
+ }
+
+ uptr internal_getpid() {
+@@ -716,14 +716,12 @@ uptr internal_getppid() {
+ }
uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {
- #if SANITIZER_NETBSD
+-#if SANITIZER_NETBSD
- return internal_syscall(SYSCALL(getdents), fd, dirp, (uptr)count);
-+ return internal_syscall64(SYSCALL(getdents), fd, dirp, (uptr)count);
- #elif SANITIZER_FREEBSD
+-#elif SANITIZER_FREEBSD
++#if SANITIZER_FREEBSD
return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL);
#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
-@@ -742,7 +753,11 @@ uptr internal_prctl(int option, uptr arg
+ return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count);
+ #else
+- return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);
++ return internal_syscall_ptr(SYSCALL(getdents), fd, (uptr)dirp, count);
+ #endif
+ }
+
+@@ -742,7 +740,7 @@ uptr internal_prctl(int option, uptr arg
#endif
uptr internal_sigaltstack(const void *ss, void *oss) {
-+#if SANITIZER_NETBSD
+- return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
+ return internal_syscall_ptr(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
-+#else
- return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
-+#endif
}
int internal_fork() {
-@@ -823,8 +838,10 @@ int internal_sigaction_syscall(int signu
-
+@@ -824,7 +822,7 @@ int internal_sigaction_syscall(int signu
uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
__sanitizer_sigset_t *oldset) {
--#if SANITIZER_FREEBSD || SANITIZER_NETBSD
-+#if SANITIZER_FREEBSD
- return internal_syscall(SYSCALL(sigprocmask), how, set, oldset);
-+#elif SANITIZER_NETBSD
+ #if SANITIZER_FREEBSD || SANITIZER_NETBSD
+- return internal_syscall(SYSCALL(sigprocmask), how, set, oldset);
+ return internal_syscall_ptr(SYSCALL(sigprocmask), how, set, oldset);
#else
__sanitizer_kernel_sigset_t *k_set = (__sanitizer_kernel_sigset_t *)set;
diff --git a/compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__interceptors.cc b/compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
index f586e88174..3f7ce475cc 100644
--- a/compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
+++ b/compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
@@ -30,21 +30,3 @@ $NetBSD$
#else
extern __sanitizer_FILE *stdout, *stderr;
#endif
-@@ -2248,8 +2256,17 @@ static void HandleRecvmsg(ThreadState *t
- #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \
- ThreadSetName(((TsanInterceptorContext *) ctx)->thr, name)
-
-+#if !SANITIZER_NETBSD
- #define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \
- __tsan::ctx->thread_registry->SetThreadNameByUserId(thread, name)
-+#else
-+#define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name, arg) \
-+ do { \
-+ char newname[32]; \
-+ internal_snprintf(newname, sizeof(newname), name, arg); \
-+ __tsan::ctx->thread_registry->SetThreadNameByUserId(thread, newname); \
-+ } while(0)
-+#endif
-
- #define COMMON_INTERCEPTOR_BLOCK_REAL(name) BLOCK_REAL(name)
-
diff --git a/compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__platform__posix.cc b/compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__platform__posix.cc
deleted file mode 100644
index 189e50c2dc..0000000000
--- a/compiler-rt-git/patches/patch-lib_tsan_rtl_tsan__platform__posix.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
---- lib/tsan/rtl/tsan_platform_posix.cc.orig 2017-08-05 14:29:08.000000000 +0000
-+++ lib/tsan/rtl/tsan_platform_posix.cc
-@@ -124,8 +124,10 @@ void CheckAndProtect() {
- if (segment.start >= HeapMemEnd() && segment.start < HeapEnd()) continue;
- if (segment.protection == 0) // Zero page or mprotected.
- continue;
-+#if !SANITIZER_NETBSD
- if (segment.start >= VdsoBeg()) // vdso
- break;
-+#endif
- Printf("FATAL: ThreadSanitizer: unexpected memory mapping %p-%p\n",
- segment.start, segment.end);
- Die();
Home |
Main Index |
Thread Index |
Old Index