pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Update to SVN r. 319967



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed Dec 6 23:03:17 2017 +0100
Changeset:	8741dd8d3bd67be21ef71fc8e699f3746d89a450

Modified Files:
	compiler-rt-netbsd/Makefile
	compiler-rt-netbsd/distinfo
Removed Files:
	compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc

Log Message:
compiler-rt-netbsd: Update to SVN r. 319967

Eliminate local patches for msan_interceptors.cc.
All merged upstream.

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=8741dd8d3bd67be21ef71fc8e699f3746d89a450

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

diffstat:
 compiler-rt-netbsd/Makefile                        |   2 +-
 compiler-rt-netbsd/distinfo                        |   1 -
 .../patches/patch-lib_msan_msan__interceptors.cc   | 151 ---------------------
 3 files changed, 1 insertion(+), 153 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/Makefile b/compiler-rt-netbsd/Makefile
index e79a7d1c00..e2d3c6d403 100644
--- a/compiler-rt-netbsd/Makefile
+++ b/compiler-rt-netbsd/Makefile
@@ -5,7 +5,7 @@ CATEGORIES=	lang devel
 
 SVN_REPOSITORIES=	compiler-rt
 SVN_REPO.compiler-rt=	http://llvm.org/svn/llvm-project/compiler-rt/trunk
-SVN_REVISION.compiler-rt=	319873
+SVN_REVISION.compiler-rt=	319967
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=	http://compiler-rt.llvm.org/
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 714c85577e..ac1cc22da7 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -3,7 +3,6 @@ $NetBSD: distinfo,v 1.35 2015/09/11 01:21:57 tnn Exp $
 SHA1 (patch-cmake_config-ix.cmake) = 5068232331d541c2786f01960a80e59252b1ad2c
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = 38ca750154dfc9843a56748078235824b772a147
 SHA1 (patch-lib_msan_msan.h) = 1ee0f86ccb410561d381afba526c85aa5dace912
-SHA1 (patch-lib_msan_msan__interceptors.cc) = 4de600de55a15b3c91fc0d0d284bdb27413110bd
 SHA1 (patch-lib_msan_msan__linux.cc) = d75d7587071a9e7a3f6a08a3008af55319e62cab
 SHA1 (patch-lib_scudo_scudo__platform.h) = b3c23678b264ec7568c800bc95e949f1a9b65399
 SHA1 (patch-test_lsan_lit.common.cfg) = 10dc251f80efb96d015a22c740dc20b1843b9a11
diff --git a/compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc b/compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc
deleted file mode 100644
index 45cda4cf50..0000000000
--- a/compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-$NetBSD$
-
---- lib/msan/msan_interceptors.cc.orig	2017-12-06 02:12:26.140110473 +0000
-+++ lib/msan/msan_interceptors.cc
-@@ -32,11 +32,24 @@
- #include "sanitizer_common/sanitizer_libc.h"
- #include "sanitizer_common/sanitizer_linux.h"
- #include "sanitizer_common/sanitizer_tls_get_addr.h"
-+#include "sanitizer_common/sanitizer_vector.h"
- 
- #include <stdarg.h>
- // ACHTUNG! No other system header includes in this file.
- // Ideally, we should get rid of stdarg.h as well.
- 
-+#if SANITIZER_NETBSD
-+#define gettimeofday __gettimeofday50
-+#define getrusage __getrusage50
-+#define shmctl __shmctl50
-+#endif
-+
-+#if SANITIZER_NETBSD
-+#define sigaction_symname __sigaction14
-+#else
-+#define sigaction_symname sigaction
-+#endif
-+
- using namespace __msan;
- 
- using __sanitizer::memory_order;
-@@ -1115,23 +1128,82 @@ struct MSanAtExitRecord {
-   void *arg;
- };
- 
--void MSanAtExitWrapper(void *arg) {
-+struct InterceptorContext {
-+  BlockingMutex atexit_mu;
-+  Vector<struct MSanAtExitRecord *> AtExitStack;
-+
-+  InterceptorContext()
-+      : AtExitStack() {
-+  }
-+};
-+
-+static ALIGNED(64) char interceptor_placeholder[sizeof(InterceptorContext)];
-+InterceptorContext *interceptor_ctx() {
-+  return reinterpret_cast<InterceptorContext*>(&interceptor_placeholder[0]);
-+}
-+
-+void MSanAtExitWrapper() {
-+  MSanAtExitRecord *r;
-+  {
-+    // Ensure thread-safety.
-+    BlockingMutexLock l(&interceptor_ctx()->atexit_mu);
-+
-+    // Pop AtExitCtx from the top of the stack of callback functions
-+    uptr element = interceptor_ctx()->AtExitStack.Size() - 1;
-+    r = interceptor_ctx()->AtExitStack[element];
-+    interceptor_ctx()->AtExitStack.PopBack();
-+  }
-+
-+  UnpoisonParam(1);
-+  ((void(*)())r->func)();
-+  InternalFree(r);
-+}
-+
-+void MSanCxaAtExitWrapper(void *arg) {
-   UnpoisonParam(1);
-   MSanAtExitRecord *r = (MSanAtExitRecord *)arg;
-   r->func(r->arg);
-   InternalFree(r);
- }
- 
-+static int setup_at_exit_wrapper(void(*f)(), void *arg, void *dso);
-+
-+// Unpoison argument shadow for C++ module destructors.
-+INTERCEPTOR(int, atexit, void (*func)()) {
-+  if (msan_init_is_running) return REAL(atexit)(func);
-+  return setup_at_exit_wrapper((void(*)())func, 0, 0);
-+}
-+
- // Unpoison argument shadow for C++ module destructors.
- INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg,
-             void *dso_handle) {
-   if (msan_init_is_running) return REAL(__cxa_atexit)(func, arg, dso_handle);
-+  return setup_at_exit_wrapper((void(*)())func, arg, dso_handle);
-+}
-+
-+static int setup_at_exit_wrapper(void(*f)(), void *arg, void *dso) {
-   ENSURE_MSAN_INITED();
-   MSanAtExitRecord *r =
-       (MSanAtExitRecord *)InternalAlloc(sizeof(MSanAtExitRecord));
--  r->func = func;
-+  r->func = (void(*)(void *a))f;
-   r->arg = arg;
--  return REAL(__cxa_atexit)(MSanAtExitWrapper, r, dso_handle);
-+  int res;
-+  if (!dso) {
-+    // NetBSD does not preserve the 2nd argument if dso is equal to 0
-+    // Store ctx in a local stack-like structure
-+
-+    // Ensure thread-safety.
-+    BlockingMutexLock l(&interceptor_ctx()->atexit_mu);
-+
-+    res = REAL(__cxa_atexit)((void (*)(void *a))MSanAtExitWrapper, 0, 0);
-+    // Push AtExitCtx on the top of the stack of callback functions
-+    if (!res) {
-+      interceptor_ctx()->AtExitStack.PushBack(r);
-+    }
-+  } else {
-+    res = REAL(__cxa_atexit)(MSanCxaAtExitWrapper, r, dso);
-+  }
-+  return res;
- }
- 
- DECLARE_REAL(int, shmctl, int shmid, int cmd, void *buf)
-@@ -1340,7 +1412,7 @@ static int sigaction_impl(int signo, con
-         pnew_act->sigaction = (decltype(pnew_act->sigaction))new_cb;
-       }
-     }
--    res = REAL(sigaction)(signo, pnew_act, oldact);
-+    res = REAL(sigaction_symname)(signo, pnew_act, oldact);
-     if (res == 0 && oldact) {
-       uptr cb = (uptr)oldact->sigaction;
-       if (cb == (uptr)SignalAction || cb == (uptr)SignalHandler) {
-@@ -1348,7 +1420,7 @@ static int sigaction_impl(int signo, con
-       }
-     }
-   } else {
--    res = REAL(sigaction)(signo, act, oldact);
-+    res = REAL(sigaction_symname)(signo, act, oldact);
-   }
- 
-   if (res == 0 && oldact) {
-@@ -1531,6 +1603,9 @@ namespace __msan {
- void InitializeInterceptors() {
-   static int inited = 0;
-   CHECK_EQ(inited, 0);
-+
-+  new(interceptor_ctx()) InterceptorContext();
-+
-   InitializeCommonInterceptors();
-   InitializeSignalInterceptors();
- 
-@@ -1646,6 +1721,7 @@ void InitializeInterceptors() {
- 
-   INTERCEPT_FUNCTION(pthread_join);
-   INTERCEPT_FUNCTION(tzset);
-+  INTERCEPT_FUNCTION(atexit);
-   INTERCEPT_FUNCTION(__cxa_atexit);
-   INTERCEPT_FUNCTION(shmat);
-   INTERCEPT_FUNCTION(fork);


Home | Main Index | Thread Index | Old Index