pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Update local patches



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Nov 23 06:11:32 2017 +0100
Changeset:	39e57c7534d3ee69aed00dd49133222d17a29c2e

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl__amd64.S
Added Files:
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__signal__interceptors.inc

Log Message:
compiler-rt-netbsd: Update local patches

Sync local patches with this package.

D40341 Handle symbol renaming of sigaction for NetBSD
https://reviews.llvm.org/D40341

D40337 Support the setjmp(3) family of functions in TSan/NetBSD
https://reviews.llvm.org/D40337

D40294 Prevent Thread Exited/Joined events race
https://reviews.llvm.org/D40294

********************
Testing Time: 63.41s
********************
Failing Tests (6):
    ThreadSanitizer-x86_64 :: deadlock_detector_stress_test.cc
    ThreadSanitizer-x86_64 :: dtls.c
    ThreadSanitizer-x86_64 :: ignore_lib5.cc
    ThreadSanitizer-x86_64 :: ignored-interceptors-mmap.cc
    ThreadSanitizer-x86_64 :: mutex_lock_destroyed.cc
    ThreadSanitizer-x86_64 :: vfork.cc

  Expected Passes    : 289
  Expected Failures  : 1
  Unsupported Tests  : 83
  Unexpected Failures: 6

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=39e57c7534d3ee69aed00dd49133222d17a29c2e

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 +-
 ...zer__common_sanitizer__signal__interceptors.inc |  31 ++++++
 .../patch-lib_tsan_rtl_tsan__interceptors.cc       |   8 +-
 .../patches/patch-lib_tsan_rtl_tsan__rtl__amd64.S  | 114 +++++++++++++++++++--
 4 files changed, 141 insertions(+), 17 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 231b469f34..672dc14462 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -6,10 +6,11 @@ SHA1 (patch-lib_lsan_lsan__interceptors.cc) = 996b0d8634bba7c3eca69c5eb175284e5f
 SHA1 (patch-lib_lsan_lsan__thread.cc) = 5cfc982f13ad8171fcd2859f2e37edef2f0e41b2
 SHA1 (patch-lib_lsan_lsan__thread.h) = 5fbcc7fe73e619d88912413d99af2f4878ffeae6
 SHA1 (patch-lib_msan_msan.h) = ce3f544490aebc1db73be9e3388f0a9d31d5b369
+SHA1 (patch-lib_sanitizer__common_sanitizer__signal__interceptors.inc) = 30b8f64a9cb4362032d2d8fa936aef49c1c747de
 SHA1 (patch-lib_sanitizer__common_sanitizer__thread__registry.cc) = 38be2aa0785c5a17e682f36717fae45cf8596fbe
 SHA1 (patch-lib_sanitizer__common_sanitizer__thread__registry.h) = 8b6ab550a34b4e8526a18e45ef6fc05af64e4c2a
-SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 89c53c5ce07400a0854cf09e8cc42956826563df
+SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 6a17ddeb59952b4f15cbe2613b76a129659f52cc
 SHA1 (patch-lib_tsan_rtl_tsan__rtl.cc) = bc3d6aa81515ac4a4fc5b504e93b3ac8de355371
 SHA1 (patch-lib_tsan_rtl_tsan__rtl.h) = fbab7ceae96a0a2bf9ec7449dd29a8c0e1613943
-SHA1 (patch-lib_tsan_rtl_tsan__rtl__amd64.S) = 6df0f2af44ebfec76d3b237c984eff63ee93b30f
+SHA1 (patch-lib_tsan_rtl_tsan__rtl__amd64.S) = 5a0bed4cf2c1f63affeed8886983a53b4376ab5b
 SHA1 (patch-lib_tsan_rtl_tsan__rtl__thread.cc) = 80538a9300eb81a1eec353c51fa420d6dcf012b2
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__signal__interceptors.inc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__signal__interceptors.inc
new file mode 100644
index 0000000000..040650919e
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__signal__interceptors.inc
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_signal_interceptors.inc.orig	2017-11-16 17:55:37.000000000 +0000
++++ lib/sanitizer_common/sanitizer_signal_interceptors.inc
+@@ -46,16 +46,22 @@ INTERCEPTOR(uptr, signal, int signum, up
+ }
+ #define INIT_SIGNAL COMMON_INTERCEPT_FUNCTION(signal)
+ 
+-INTERCEPTOR(int, sigaction, int signum, const __sanitizer_sigaction *act,
+-            __sanitizer_sigaction *oldact) {
++#if SANITIZER_NETBSD
++#define sigaction_symname __sigaction14
++#else
++#define sigaction_symname sigaction
++#endif
++
++INTERCEPTOR(int, sigaction_symname, int signum,
++            const __sanitizer_sigaction *act, __sanitizer_sigaction *oldact) {
+   if (GetHandleSignalMode(signum) == kHandleSignalExclusive) return 0;
+   SIGNAL_INTERCEPTOR_SIGACTION_IMPL(signum, act, oldact);
+ }
+-#define INIT_SIGACTION COMMON_INTERCEPT_FUNCTION(sigaction)
++#define INIT_SIGACTION COMMON_INTERCEPT_FUNCTION(sigaction_symname)
+ 
+ namespace __sanitizer {
+ int real_sigaction(int signum, const void *act, void *oldact) {
+-  return REAL(sigaction)(signum, (const __sanitizer_sigaction *)act,
++  return REAL(sigaction_symname)(signum, (const __sanitizer_sigaction *)act,
+                          (__sanitizer_sigaction *)oldact);
+ }
+ }  // namespace __sanitizer
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
index 31ca496831..34a08169cf 100644
--- a/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
+++ b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- lib/tsan/rtl/tsan_interceptors.cc.orig	2017-11-21 09:38:56.000000000 +0000
+--- lib/tsan/rtl/tsan_interceptors.cc.orig	2017-11-23 05:14:46.406806399 +0000
 +++ lib/tsan/rtl/tsan_interceptors.cc
-@@ -868,6 +868,7 @@ void DestroyThreadState() {
+@@ -932,6 +932,7 @@ void DestroyThreadState() {
    }
    DTLS_Destroy();
    cur_thread_finalize();
@@ -10,7 +10,7 @@ $NetBSD$
  }
  }  // namespace __tsan
  
-@@ -982,12 +983,14 @@ TSAN_INTERCEPTOR(int, pthread_create,
+@@ -1046,12 +1047,14 @@ TSAN_INTERCEPTOR(int, pthread_create,
  
  TSAN_INTERCEPTOR(int, pthread_join, void *th, void **ret) {
    SCOPED_INTERCEPTOR_RAW(pthread_join, th, ret);
@@ -27,7 +27,7 @@ $NetBSD$
    }
    return res;
  }
-@@ -996,10 +999,10 @@ DEFINE_REAL_PTHREAD_FUNCTIONS
+@@ -1060,10 +1063,10 @@ DEFINE_REAL_PTHREAD_FUNCTIONS
  
  TSAN_INTERCEPTOR(int, pthread_detach, void *th) {
    SCOPED_TSAN_INTERCEPTOR(pthread_detach, th);
diff --git a/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl__amd64.S b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl__amd64.S
index 15cb878568..c6a98d80dd 100644
--- a/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl__amd64.S
+++ b/compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__rtl__amd64.S
@@ -2,7 +2,28 @@ $NetBSD$
 
 --- lib/tsan/rtl/tsan_rtl_amd64.S.orig	2017-10-17 18:35:43.000000000 +0000
 +++ lib/tsan/rtl/tsan_rtl_amd64.S
-@@ -182,7 +182,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp):
+@@ -170,19 +170,27 @@ ASM_TSAN_SYMBOL(__tsan_report_race_thunk
+   CFI_ENDPROC
+ 
+ ASM_HIDDEN(__tsan_setjmp)
+-#if !defined(__APPLE__)
++#if defined(__NetBSD__)
++.comm _ZN14__interception15real___setjmp14E,8,8
++#elif !defined(__APPLE__)
+ .comm _ZN14__interception11real_setjmpE,8,8
+ #endif
++#if defined(__NetBSD__)
++.globl ASM_TSAN_SYMBOL_INTERCEPTOR(__setjmp14)
++ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(__setjmp14))
++ASM_TSAN_SYMBOL_INTERCEPTOR(__setjmp14):
++#else
+ .globl ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp)
+ ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp))
+ ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp):
++#endif
+   CFI_STARTPROC
+   // save env parameter
+   push %rdi
    CFI_ADJUST_CFA_OFFSET(8)
    CFI_REL_OFFSET(%rdi, 0)
    // obtain %rsp
@@ -11,7 +32,30 @@ $NetBSD$
    lea 8(%rsp), %rdi
    mov %rdi, %rsi
  #elif defined(__APPLE__)
-@@ -223,7 +223,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp):
+@@ -204,14 +212,21 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp):
+   CFI_RESTORE(%rdi)
+   // tail jump to libc setjmp
+   movl $0, %eax
+-#if !defined(__APPLE__)
++#if defined(__NetBSD__)
++  movq _ZN14__interception15real___setjmp14E@GOTPCREL(%rip), %rdx
++  jmp *(%rdx)
++#elif !defined(__APPLE__)
+   movq _ZN14__interception11real_setjmpE@GOTPCREL(%rip), %rdx
+   jmp *(%rdx)
+ #else
+   jmp ASM_TSAN_SYMBOL(setjmp)
+ #endif
+   CFI_ENDPROC
++#if defined(__NetBSD__)
++ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(__setjmp14))
++#else
+ ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp))
++#endif
+ 
+ .comm _ZN14__interception12real__setjmpE,8,8
+ .globl ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp)
+@@ -223,7 +238,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp):
    CFI_ADJUST_CFA_OFFSET(8)
    CFI_REL_OFFSET(%rdi, 0)
    // obtain %rsp
@@ -20,7 +64,25 @@ $NetBSD$
    lea 8(%rsp), %rdi
    mov %rdi, %rsi
  #elif defined(__APPLE__)
-@@ -271,7 +271,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp):
+@@ -254,10 +269,17 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp):
+   CFI_ENDPROC
+ ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp))
+ 
++#if defined(__NetBSD__)
++.comm _ZN14__interception18real___sigsetjmp14E,8,8
++.globl ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp14)
++ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp14))
++ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp14):
++#else
+ .comm _ZN14__interception14real_sigsetjmpE,8,8
+ .globl ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp)
+ ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp))
+ ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp):
++#endif
+   CFI_STARTPROC
+   // save env parameter
+   push %rdi
+@@ -271,7 +293,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp):
    sub $8, %rsp
    CFI_ADJUST_CFA_OFFSET(8)
    // obtain %rsp
@@ -29,12 +91,42 @@ $NetBSD$
    lea 24(%rsp), %rdi
    mov %rdi, %rsi
  #elif defined(__APPLE__)
-@@ -327,7 +327,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp)
-   sub $8, %rsp
-   CFI_ADJUST_CFA_OFFSET(8)
-   // obtain %rsp
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
-   lea 24(%rsp), %rdi
-   mov %rdi, %rsi
+@@ -300,16 +322,23 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp):
+   CFI_RESTORE(%rdi)
+   // tail jump to libc sigsetjmp
+   movl $0, %eax
+-#if !defined(__APPLE__)
++#if defined(__NetBSD__)
++  movq _ZN14__interception18real___sigsetjmp14E@GOTPCREL(%rip), %rdx
++  jmp *(%rdx)
++#elif !defined(__APPLE__)
+   movq _ZN14__interception14real_sigsetjmpE@GOTPCREL(%rip), %rdx
+   jmp *(%rdx)
  #else
+   jmp ASM_TSAN_SYMBOL(sigsetjmp)
+ #endif
+   CFI_ENDPROC
++#if defined(__NetBSD__)
++ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp14))
++#else
+ ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp))
++#endif
+ 
+-#if !defined(__APPLE__)
++#if !defined(__APPLE__) && !defined(__NetBSD__)
+ .comm _ZN14__interception16real___sigsetjmpE,8,8
+ .globl ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp)
+ ASM_TYPE_FUNCTION(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp))
+@@ -355,10 +384,11 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp)
+   jmp *(%rdx)
+   CFI_ENDPROC
+ ASM_SIZE(ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp))
+-#endif  // !defined(__APPLE__)
++#endif  // !defined(__APPLE__) && !defined(__NetBSD__)
+ 
+ #if defined(__FreeBSD__) || defined(__linux__)
+ /* We do not need executable stack.  */
++/* This note is not needed on NetBSD. */
+ .section        .note.GNU-stack,"",@progbits
+ #endif
+ 


Home | Main Index | Thread Index | Old Index