pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Disable TLS initial-exec on NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Oct 5 18:24:28 2017 +0200
Changeset:	272f101acebf42ee077ec93bf94cabccd01df820

Modified Files:
	compiler-rt-netbsd/distinfo
Added Files:
	compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerTracePC.cpp
	compiler-rt-netbsd/patches/patch-lib_lsan_lsan__common__linux.cc
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__tls__get__addr.cc
	compiler-rt-netbsd/patches/patch-lib_scudo_scudo__tsd__exclusive.inc
	compiler-rt-netbsd/patches/patch-lib_tsan_dd_dd__interceptors.cc
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.cc
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.h

Log Message:
compiler-rt-netbsd: Disable TLS initial-exec on NetBSD

This functionality is not supported on NetBSD.

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=272f101acebf42ee077ec93bf94cabccd01df820

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

diffstat:
 compiler-rt-netbsd/distinfo                            |  8 ++++++++
 .../patches/patch-lib_fuzzer_FuzzerTracePC.cpp         | 16 ++++++++++++++++
 .../patches/patch-lib_lsan_lsan__common__linux.cc      | 14 ++++++++++++++
 ...h-lib_sanitizer__common_sanitizer__internal__defs.h | 13 +++++++++++++
 ...-lib_sanitizer__common_sanitizer__tls__get__addr.cc | 14 ++++++++++++++
 .../patches/patch-lib_scudo_scudo__tsd__exclusive.inc  | 12 ++++++++++++
 .../patches/patch-lib_tsan_dd_dd__interceptors.cc      | 18 ++++++++++++++++++
 .../patches/patch-lib_tsan_rtl_tsan__rtl.cc            | 13 +++++++++++++
 .../patches/patch-lib_tsan_rtl_tsan__rtl.h             | 13 +++++++++++++
 9 files changed, 121 insertions(+)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 48b73f2d9b..ec7622f25d 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -1,12 +1,20 @@
 $NetBSD: distinfo,v 1.35 2015/09/11 01:21:57 tnn Exp $
 
 SHA1 (patch-cmake_config-ix.cmake) = 5b1842f08cc8c2b96e0529b552b09c7adf2065dc
+SHA1 (patch-lib_fuzzer_FuzzerTracePC.cpp) = 0a8f7febb6ea2453cd63acd507b4d44836ebcb97
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = eaffd9f8f2621ad465b5c734a764bdff0243af3d
+SHA1 (patch-lib_lsan_lsan__common__linux.cc) = 62309120522b1529f4c3a8bcc95aaf6665a3cfe4
+SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 94493d638f19b0cd734b0d6b45aa7ca16d11ce39
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 25cba9ff9d61910bb74d500e515da083af4e6cb7
+SHA1 (patch-lib_sanitizer__common_sanitizer__tls__get__addr.cc) = adb2ac0baade162167907ba3b6f35a38471024e4
+SHA1 (patch-lib_scudo_scudo__tsd__exclusive.inc) = a1af1e691e5b929500c0f21cc4e7217a974cef08
+SHA1 (patch-lib_tsan_dd_dd__interceptors.cc) = 102071b748646433f51761820beb87f7e91d4440
 SHA1 (patch-lib_tsan_go_buildgo.sh) = fe64b3389bbf6ae2ddf187df3e0600b2f817f51d
 SHA1 (patch-lib_tsan_rtl_tsan__platform.h) = 9ba65b81bb95bdf3b949da801cb9b97bf94174c4
 SHA1 (patch-lib_tsan_rtl_tsan__platform__linux.cc) = 21424d5506d02887a15183285ecb564d9560f215
 SHA1 (patch-lib_tsan_rtl_tsan__platform__posix.cc) = ddf48d91100e681f09b7303a37936ac8cd7f775a
+SHA1 (patch-lib_tsan_rtl_tsan__rtl.cc) = 4161d9ee4c68315925eb2d1f2b401b23db85b369
+SHA1 (patch-lib_tsan_rtl_tsan__rtl.h) = 8256bc84978fe19ccb5ec8177e2f0309709db4ae
 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) = c849d08c3df59a3de45c6515e05c3d9fac5424e7
diff --git a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerTracePC.cpp b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerTracePC.cpp
new file mode 100644
index 0000000000..b8f49f8e42
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerTracePC.cpp
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- lib/fuzzer/FuzzerTracePC.cpp.orig	2017-08-30 19:37:28.000000000 +0000
++++ lib/fuzzer/FuzzerTracePC.cpp
+@@ -32,7 +32,10 @@ ATTRIBUTE_INTERFACE
+ uintptr_t __sancov_trace_pc_pcs[fuzzer::TracePC::kNumPCs];
+ 
+ // Used by -fsanitize-coverage=stack-depth to track stack depth
+-ATTRIBUTE_INTERFACE __attribute__((tls_model("initial-exec")))
++ATTRIBUTE_INTERFACE
++#if !SANITIZER_NETBSD
++__attribute__((tls_model("initial-exec")))
++#endif
+ thread_local uintptr_t __sancov_lowest_stack;
+ 
+ namespace fuzzer {
diff --git a/compiler-rt-netbsd/patches/patch-lib_lsan_lsan__common__linux.cc b/compiler-rt-netbsd/patches/patch-lib_lsan_lsan__common__linux.cc
new file mode 100644
index 0000000000..38072a5e80
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_lsan_lsan__common__linux.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- lib/lsan/lsan_common_linux.cc.orig	2017-07-20 14:23:42.000000000 +0000
++++ lib/lsan/lsan_common_linux.cc
+@@ -34,7 +34,9 @@ static bool IsLinker(const char* full_na
+   return LibraryNameIs(full_name, kLinkerName);
+ }
+ 
++#if !SANITIZER_NETBSD
+ __attribute__((tls_model("initial-exec")))
++#endif
+ THREADLOCAL int disable_counter;
+ bool DisabledInThisThread() { return disable_counter > 0; }
+ void DisableInThisThread() { disable_counter++; }
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h
new file mode 100644
index 0000000000..8a8bae724e
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_internal_defs.h.orig	2017-10-02 13:17:03.000000000 +0000
++++ lib/sanitizer_common/sanitizer_internal_defs.h
+@@ -39,6 +39,8 @@
+ #if SANITIZER_LINUX
+ # define SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE \
+     __attribute__((tls_model("initial-exec"))) thread_local
++#elif SANITIZER_NETBSD
++# define SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE thread_local
+ #else
+ # define SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE
+ #endif
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__tls__get__addr.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__tls__get__addr.cc
new file mode 100644
index 0000000000..bfa45cbc45
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__tls__get__addr.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_tls_get_addr.cc.orig	2017-07-20 14:23:41.000000000 +0000
++++ lib/sanitizer_common/sanitizer_tls_get_addr.cc
+@@ -34,7 +34,9 @@ struct Glibc_2_19_tls_header {
+ };
+ 
+ // This must be static TLS
++#if !SANITIZER_NETBSD
+ __attribute__((tls_model("initial-exec")))
++#endif
+ static __thread DTLS dtls;
+ 
+ // Make sure we properly destroy the DTLS objects:
diff --git a/compiler-rt-netbsd/patches/patch-lib_scudo_scudo__tsd__exclusive.inc b/compiler-rt-netbsd/patches/patch-lib_scudo_scudo__tsd__exclusive.inc
new file mode 100644
index 0000000000..7d03875941
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_scudo_scudo__tsd__exclusive.inc
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- lib/scudo/scudo_tsd_exclusive.inc.orig	2017-10-02 13:17:02.000000000 +0000
++++ lib/scudo/scudo_tsd_exclusive.inc
+@@ -22,6 +22,7 @@ enum ThreadState : u8 {
+   ThreadInitialized,
+   ThreadTornDown,
+ };
++
+ __attribute__((tls_model("initial-exec")))
+ extern THREADLOCAL ThreadState ScudoThreadState;
+ __attribute__((tls_model("initial-exec")))
diff --git a/compiler-rt-netbsd/patches/patch-lib_tsan_dd_dd__interceptors.cc b/compiler-rt-netbsd/patches/patch-lib_tsan_dd_dd__interceptors.cc
new file mode 100644
index 0000000000..4873f7cd07
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_tsan_dd_dd__interceptors.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+--- lib/tsan/dd/dd_interceptors.cc.orig	2017-07-16 22:40:10.000000000 +0000
++++ lib/tsan/dd/dd_interceptors.cc
+@@ -15,9 +15,13 @@
+ 
+ using namespace __dsan;
+ 
++#if SANITIZER_NETBSD
+ __attribute__((tls_model("initial-exec")))
++#endif
+ static __thread Thread *thr;
++#if SANITIZER_NETBSD
+ __attribute__((tls_model("initial-exec")))
++#endif
+ static __thread volatile int initing;
+ static bool inited;
+ static uptr g_data_start;
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
new file mode 100644
index 0000000000..82510d529a
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.cc
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/tsan/rtl/tsan_rtl.cc.orig	2017-07-24 13:39:38.000000000 +0000
++++ lib/tsan/rtl/tsan_rtl.cc
+@@ -45,7 +45,7 @@ extern "C" void __tsan_resume() {
+ 
+ namespace __tsan {
+ 
+-#if !SANITIZER_GO && !SANITIZER_MAC
++#if !SANITIZER_GO && !SANITIZER_MAC && !SANITIZER_NETBSD
+ __attribute__((tls_model("initial-exec")))
+ THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64);
+ #endif
diff --git a/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.h b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.h
new file mode 100644
index 0000000000..4329b2ab6f
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/tsan/rtl/tsan_rtl.h.orig	2017-08-28 21:09:44.000000000 +0000
++++ lib/tsan/rtl/tsan_rtl.h
+@@ -457,7 +457,7 @@ struct ThreadState {
+ };
+ 
+ #if !SANITIZER_GO
+-#if SANITIZER_MAC || SANITIZER_ANDROID
++#if SANITIZER_MAC || SANITIZER_ANDROID || SANITIZER_NETBSD
+ ThreadState *cur_thread();
+ void cur_thread_finalize();
+ #else


Home | Main Index | Thread Index | Old Index