pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

compiler-rt-netbsd: Add local patches to disable broken code



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed Oct 18 02:44:59 2017 +0200
Changeset:	ae54bf759ddc25930ea8261af88ce38fcc9149dd

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.cc
Added Files:
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__thread__registry.cc
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc

Log Message:
compiler-rt-netbsd: Add local patches to disable broken code

Temporarily disable code that is broken.
This synces my local testing changes with pkgsrc-wip.

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=ae54bf759ddc25930ea8261af88ce38fcc9149dd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 compiler-rt-netbsd/distinfo                        |  4 +-
 ...anitizer__common_sanitizer__thread__registry.cc | 13 +++
 .../patch-lib_tsan_rtl_tsan__interceptors.cc       | 96 ++++++++++++++++++++++
 .../patches/patch-lib_tsan_rtl_tsan__rtl.cc        |  7 +-
 4 files changed, 116 insertions(+), 4 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 4d4c04c5c6..9d6a95aa2b 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -4,10 +4,12 @@ SHA1 (patch-cmake_config-ix.cmake) = 5b1842f08cc8c2b96e0529b552b09c7adf2065dc
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = eaffd9f8f2621ad465b5c734a764bdff0243af3d
 SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = f5825b7081758e07e36dbd47a887f31a20912a83
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 25cba9ff9d61910bb74d500e515da083af4e6cb7
+SHA1 (patch-lib_sanitizer__common_sanitizer__thread__registry.cc) = ab0bccc862443c04ec0e7287bbf8e2632546bb90
 SHA1 (patch-lib_tsan_go_buildgo.sh) = fe64b3389bbf6ae2ddf187df3e0600b2f817f51d
+SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 1d849dba05d9c8f70e3636fb65758e0971e8a2e3
 SHA1 (patch-lib_tsan_rtl_tsan__platform__linux.cc) = 23744bd656f0dcee425821491bcaa723f26130a3
 SHA1 (patch-lib_tsan_rtl_tsan__platform__posix.cc) = ddf48d91100e681f09b7303a37936ac8cd7f775a
-SHA1 (patch-lib_tsan_rtl_tsan__rtl.cc) = f21a7acad2b84c1a32d83ddad336369b016a4990
+SHA1 (patch-lib_tsan_rtl_tsan__rtl.cc) = 8d5938bb27f9d238ceeb09ac1e6e8090b196fdcc
 SHA1 (patch-lib_tsan_rtl_tsan__rtl__amd64.S) = 95591667c23372ceb72334b2ceae800d32574ac6
 SHA1 (patch-lib_tsan_tests_rtl_tsan__test__util__posix.cc) = 302c72dab4fe5a0c94d7de0d728033e616811e5e
 SHA1 (patch-test_tsan_lit.cfg) = 001a4025f0542998da209df933359cf929d7631e
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__thread__registry.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__thread__registry.cc
new file mode 100644
index 0000000000..76ede97a1e
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__thread__registry.cc
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_thread_registry.cc.orig	2017-10-17 18:35:46.000000000 +0000
++++ lib/sanitizer_common/sanitizer_thread_registry.cc
+@@ -47,7 +47,7 @@ void ThreadContextBase::SetDead() {
+ void ThreadContextBase::SetJoined(void *arg) {
+   // FIXME(dvyukov): print message and continue (it's user error).
+   CHECK_EQ(false, detached);
+-  CHECK_EQ(ThreadStatusFinished, status);
++//  CHECK_EQ(ThreadStatusFinished, status);
+   status = ThreadStatusDead;
+   user_id = 0;
+   OnJoined(arg);
diff --git a/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
new file mode 100644
index 0000000000..451f6b7ba2
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
@@ -0,0 +1,96 @@
+$NetBSD$
+
+--- lib/tsan/rtl/tsan_interceptors.cc.orig	2017-10-17 18:35:44.000000000 +0000
++++ lib/tsan/rtl/tsan_interceptors.cc
+@@ -257,7 +257,7 @@ static ThreadSignalContext *SigCtx(Threa
+   return ctx;
+ }
+ 
+-#if !SANITIZER_MAC
++#if !SANITIZER_MAC && !SANITIZER_NETBSD
+ static unsigned g_thread_finalize_key;
+ #endif
+ 
+@@ -387,9 +387,9 @@ static void at_exit_wrapper(void *arg) {
+   ThreadState *thr = cur_thread();
+   uptr pc = 0;
+   Acquire(thr, pc, (uptr)arg);
+-  AtExitCtx *ctx = (AtExitCtx*)arg;
+-  ((void(*)(void *arg))ctx->f)(ctx->arg);
+-  InternalFree(ctx);
++//  AtExitCtx *ctx = (AtExitCtx*)arg;
++//  ((void(*)(void *arg))ctx->f)(ctx->arg);
++//  InternalFree(ctx);
+ }
+ 
+ static int setup_at_exit_wrapper(ThreadState *thr, uptr pc, void(*f)(),
+@@ -858,7 +858,7 @@ void DestroyThreadState() {
+ }
+ }  // namespace __tsan
+ 
+-#if !SANITIZER_MAC
++#if !SANITIZER_MAC && !SANITIZER_NETBSD
+ static void thread_finalize(void *v) {
+   uptr iter = (uptr)v;
+   if (iter > 1) {
+@@ -888,7 +888,7 @@ extern "C" void *__tsan_thread_start_fun
+     ThreadState *thr = cur_thread();
+     // Thread-local state is not initialized yet.
+     ScopedIgnoreInterceptors ignore;
+-#if !SANITIZER_MAC
++#if !SANITIZER_MAC && !SANITIZER_NETBSD
+     ThreadIgnoreBegin(thr, 0);
+     if (pthread_setspecific(g_thread_finalize_key,
+                             (void *)GetPthreadDestructorIterations())) {
+@@ -1670,8 +1670,8 @@ TSAN_INTERCEPTOR(void*, tmpfile64, int f
+ static void FlushStreams() {
+   // Flushing all the streams here may freeze the process if a child thread is
+   // performing file stream operations at the same time.
+-  REAL(fflush)(stdout);
+-  REAL(fflush)(stderr);
++//  REAL(fflush)(stdout);
++//  REAL(fflush)(stderr);
+ }
+ 
+ TSAN_INTERCEPTOR(void, abort, int fake) {
+@@ -2439,6 +2439,7 @@ TSAN_INTERCEPTOR(void *, __tls_get_addr,
+ 
+ namespace __tsan {
+ 
++#if 0
+ static void finalize(void *arg) {
+   ThreadState *thr = cur_thread();
+   int status = Finalize(thr);
+@@ -2447,6 +2448,7 @@ static void finalize(void *arg) {
+   if (status)
+     Die();
+ }
++#endif
+ 
+ #if !SANITIZER_MAC && !SANITIZER_ANDROID
+ static void unreachable() {
+@@ -2611,16 +2613,16 @@ void InitializeInterceptors() {
+   REAL(atexit) = (int(*)(void(*)()))unreachable;
+ #endif
+ 
+-  if (REAL(__cxa_atexit)(&finalize, 0, 0)) {
+-    Printf("ThreadSanitizer: failed to setup atexit callback\n");
+-    Die();
+-  }
++//  if (REAL(__cxa_atexit)(&finalize, 0, 0)) {
++//    Printf("ThreadSanitizer: failed to setup atexit callback\n");
++//    Die();
++//  }
+ 
+ #if !SANITIZER_MAC
+-  if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) {
+-    Printf("ThreadSanitizer: failed to create thread key\n");
+-    Die();
+-  }
++//  if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) {
++//    Printf("ThreadSanitizer: failed to create thread key\n");
++//    Die();
++//  }
+ #endif
+ 
+   FdInit();
diff --git a/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.cc b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.cc
index 3ec8ab03b6..08d7afcb18 100644
--- a/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.cc
+++ b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.cc
@@ -1,13 +1,14 @@
 $NetBSD$
 
---- lib/tsan/rtl/tsan_rtl.cc.orig	2017-07-24 13:39:38.000000000 +0000
+--- lib/tsan/rtl/tsan_rtl.cc.orig	2017-10-17 18:35:43.000000000 +0000
 +++ lib/tsan/rtl/tsan_rtl.cc
-@@ -371,7 +371,7 @@ void Initialize(ThreadState *thr) {
+@@ -371,7 +371,8 @@ void Initialize(ThreadState *thr) {
    // On MIPS, TSan initialization is run before
    // __pthread_initialize_minimal_internal() is finished, so we can not spawn
    // new threads.
 -#ifndef __mips__
-+#if !defined(__mips__) && !SANITIZER_NETBSD /* XXX: fix it in future, not crucial now */
++#if !defined(__mips__) && !SANITIZER_NETBSD
++  // XXX: fix it in future, not crucial now
    StartBackgroundThread();
    SetSandboxingCallback(StopBackgroundThread);
  #endif


Home | Main Index | Thread Index | Old Index