pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Add NetBSD code for tsan tests



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sun Aug 20 02:29:49 2017 +0200
Changeset:	f270c44863a11850efed3dc994c7a9fbb9d11afd

Modified Files:
	compiler-rt-netbsd/distinfo
Added Files:
	compiler-rt-netbsd/patches/patch-test_tsan_lit.cfg
	compiler-rt-netbsd/patches/patch-test_tsan_thread__name.cc
	compiler-rt-netbsd/patches/patch-test_tsan_thread__name2.cc
	compiler-rt-netbsd/patches/patch-test_tsan_tls__race.cc
	compiler-rt-netbsd/patches/patch-test_tsan_tls__race2.cc

Log Message:
compiler-rt-netbsd: Add NetBSD code for tsan tests

Not tested...

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

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

diffstat:
 compiler-rt-netbsd/distinfo                        |  5 ++++
 compiler-rt-netbsd/patches/patch-test_tsan_lit.cfg | 14 +++++++++
 .../patches/patch-test_tsan_thread__name.cc        | 29 ++++++++++++++++++
 .../patches/patch-test_tsan_thread__name2.cc       | 35 ++++++++++++++++++++++
 .../patches/patch-test_tsan_tls__race.cc           |  9 ++++++
 .../patches/patch-test_tsan_tls__race2.cc          |  9 ++++++
 6 files changed, 101 insertions(+)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index d49d5a0f68..df7d2c7644 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -220,3 +220,8 @@ SHA1 (patch-test_fuzzer_value-profile-set.test) = 7559e580d9c06624844fd772cca5d2
 SHA1 (patch-test_fuzzer_value-profile-strcmp.test) = 376152eec4743126f51057748cc054a370b16ff3
 SHA1 (patch-test_fuzzer_value-profile-strncmp.test) = 8402e55ee6bd65a956ff6fac40e31eda2568983f
 SHA1 (patch-test_fuzzer_value-profile-switch.test) = 1ac9a42ed690e96155aa94311fe08c06da6e0709
+SHA1 (patch-test_tsan_lit.cfg) = c849d08c3df59a3de45c6515e05c3d9fac5424e7
+SHA1 (patch-test_tsan_thread__name.cc) = 0f6a51b98adeabdea82cc8874f9a3ddc68a34b54
+SHA1 (patch-test_tsan_thread__name2.cc) = b12bac7de9c8307972a3ee3dbadb41563e8658f5
+SHA1 (patch-test_tsan_tls__race.cc) = 7447ee161c27deb7196151f56ea739904bec8c1c
+SHA1 (patch-test_tsan_tls__race2.cc) = da9b3298b8e882db111b01ac10a5ae6dbeaa88dc
diff --git a/compiler-rt-netbsd/patches/patch-test_tsan_lit.cfg b/compiler-rt-netbsd/patches/patch-test_tsan_lit.cfg
new file mode 100644
index 0000000000..12fba5f62f
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_tsan_lit.cfg
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- test/tsan/lit.cfg.orig	2017-07-16 22:40:10.000000000 +0000
++++ test/tsan/lit.cfg
+@@ -79,8 +79,7 @@ config.substitutions.append( ("%deflake 
+ # Default test suffixes.
+ config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm']
+ 
+-# ThreadSanitizer tests are currently supported on FreeBSD, Linux and Darwin.
+-if config.host_os not in ['FreeBSD', 'Linux', 'Darwin']:
++if config.host_os not in ['FreeBSD', 'Linux', 'Darwin', 'NetBSD']:
+   config.unsupported = True
+ 
+ # Allow tests to use REQUIRES=stable-runtime.  For use when you cannot use XFAIL
diff --git a/compiler-rt-netbsd/patches/patch-test_tsan_thread__name.cc b/compiler-rt-netbsd/patches/patch-test_tsan_thread__name.cc
new file mode 100644
index 0000000000..a4275a5537
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_tsan_thread__name.cc
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- test/tsan/thread_name.cc.orig	2017-07-04 05:53:07.000000000 +0000
++++ test/tsan/thread_name.cc
+@@ -3,10 +3,14 @@
+ 
+ #if defined(__linux__)
+ #define USE_PTHREAD_SETNAME_NP __GLIBC_PREREQ(2, 12)
++#define tsan_pthread_setname_np pthread_setname_np
+ #elif defined(__FreeBSD__)
+ #include <pthread_np.h>
+ #define USE_PTHREAD_SETNAME_NP 1
+-#define pthread_setname_np pthread_set_name_np
++#define tasn_pthread_setname_np pthread_set_name_np
++#elif defined(__NetBSD__)
++#define USE_PTHREAD_SETNAME_NP 1
++#define tsan_pthread_setname_np(a,b) pthread_setname_np((a),"%s",(void*)(b))
+ #else
+ #define USE_PTHREAD_SETNAME_NP 0
+ #endif
+@@ -24,7 +28,7 @@ void *Thread1(void *x) {
+ 
+ void *Thread2(void *x) {
+ #if USE_PTHREAD_SETNAME_NP
+-  pthread_setname_np(pthread_self(), "Thread2");
++  tsan_pthread_setname_np(pthread_self(), "Thread2");
+ #else
+   AnnotateThreadName(__FILE__, __LINE__, "Thread2");
+ #endif
diff --git a/compiler-rt-netbsd/patches/patch-test_tsan_thread__name2.cc b/compiler-rt-netbsd/patches/patch-test_tsan_thread__name2.cc
new file mode 100644
index 0000000000..735778bb04
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_tsan_thread__name2.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+--- test/tsan/thread_name2.cc.orig	2017-07-04 05:53:06.000000000 +0000
++++ test/tsan/thread_name2.cc
+@@ -6,7 +6,11 @@
+ 
+ #if defined(__FreeBSD__)
+ #include <pthread_np.h>
+-#define pthread_setname_np pthread_set_name_np
++#define tsan_pthread_setname_np pthread_set_name_np
++#elif defined(__NetBSD__)
++#define tsan_pthread_setname_np(a,b) pthread_setname_np((a),"%s",(void*)(b))
++#else
++#define tsan_pthread_setname_np pthread_setname_np
+ #endif
+ 
+ long long Global;
+@@ -18,7 +22,7 @@ void *Thread1(void *x) {
+ }
+ 
+ void *Thread2(void *x) {
+-  pthread_setname_np(pthread_self(), "foobar2");
++  tsan_pthread_setname_np(pthread_self(), "foobar2");
+   Global--;
+   barrier_wait(&barrier);
+   return 0;
+@@ -29,7 +33,7 @@ int main() {
+   pthread_t t[2];
+   pthread_create(&t[0], 0, Thread1, 0);
+   pthread_create(&t[1], 0, Thread2, 0);
+-  pthread_setname_np(t[0], "foobar1");
++  tsan_pthread_setname_np(t[0], "foobar1");
+   barrier_wait(&barrier);
+   pthread_join(t[0], NULL);
+   pthread_join(t[1], NULL);
diff --git a/compiler-rt-netbsd/patches/patch-test_tsan_tls__race.cc b/compiler-rt-netbsd/patches/patch-test_tsan_tls__race.cc
new file mode 100644
index 0000000000..7d247f9017
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_tsan_tls__race.cc
@@ -0,0 +1,9 @@
+$NetBSD$
+
+--- test/tsan/tls_race.cc.orig	2017-07-04 05:53:07.000000000 +0000
++++ test/tsan/tls_race.cc
+@@ -21,3 +21,4 @@ int main() {
+ // CHECK-Linux:   Location is TLS of main thread.
+ // CHECK-FreeBSD:   Location is TLS of main thread.
+ // CHECK-Darwin:   Location is heap block of size 4
++// CHECK-NetBSD:   Location is TLS of main thread.
diff --git a/compiler-rt-netbsd/patches/patch-test_tsan_tls__race2.cc b/compiler-rt-netbsd/patches/patch-test_tsan_tls__race2.cc
new file mode 100644
index 0000000000..7283497b66
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_tsan_tls__race2.cc
@@ -0,0 +1,9 @@
+$NetBSD$
+
+--- test/tsan/tls_race2.cc.orig	2017-07-04 05:53:07.000000000 +0000
++++ test/tsan/tls_race2.cc
+@@ -28,3 +28,4 @@ int main() {
+ // CHECK-Linux:   Location is TLS of thread T1.
+ // CHECK-FreeBSD:   Location is TLS of thread T1.
+ // CHECK-Darwin:   Location is heap block of size 4
++// CHECK-NetBSD:   Location is TLS of thread T1.


Home | Main Index | Thread Index | Old Index