pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Add more NetBSD suggar in asan



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Jun 26 17:20:30 2017 +0200
Changeset:	1dbf75604355fa19fce2ffdd86119fc58a37d705

Modified Files:
	compiler-rt-netbsd/distinfo
Added Files:
	compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.cc
	compiler-rt-netbsd/patches/patch-lib_asan_asan__malloc__linux.cc
	compiler-rt-netbsd/patches/patch-lib_asan_asan__stack.h
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h

Log Message:
compiler-rt-netbsd: Add more NetBSD suggar in asan

Partly suggested by gcc/libsanitizer.

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=1dbf75604355fa19fce2ffdd86119fc58a37d705

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 ++++
 .../patches/patch-lib_asan_asan__interceptors.cc      | 16 ++++++++++++++++
 .../patches/patch-lib_asan_asan__malloc__linux.cc     | 19 +++++++++++++++++++
 .../patches/patch-lib_asan_asan__stack.h              | 13 +++++++++++++
 ...-lib_sanitizer__common_sanitizer__internal__defs.h | 13 +++++++++++++
 5 files changed, 65 insertions(+)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 400756ac8b..f456131a0a 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -13,8 +13,11 @@ SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
 SHA1 (patch-cmake_config-ix.cmake) = f60bb22deec40689c96d27cbe9db7c643e46f5cc
+SHA1 (patch-lib_asan_asan__interceptors.cc) = 8711f7919ad676a2a9d323caf7f152afe8b0e545
 SHA1 (patch-lib_asan_asan__interceptors.h) = cca1e74041e37d366c512d23547063d6a4dee008
 SHA1 (patch-lib_asan_asan__linux.cc) = fcbf780af6bcd3b43c86d9e5e2c8a92e3a8885da
+SHA1 (patch-lib_asan_asan__malloc__linux.cc) = 3e971de691b1939ef1b2fe864cfa38a64e159cec
+SHA1 (patch-lib_asan_asan__stack.h) = a3dd10b42713265f6a54a2b86e33420b052f431f
 SHA1 (patch-lib_asan_scripts_asan__symbolize.py) = d6c079e7092b22b5379293dbb8d1e2445e077932
 SHA1 (patch-lib_builtins_gcc__personality__v0.c) = 66c36733afc7043f662328303de2573fd9005bf3
 SHA1 (patch-lib_interception_interception.h) = f18c140feec3c88fec57ac7ba1fbedb03db2bac6
@@ -22,6 +25,7 @@ SHA1 (patch-lib_interception_interception__linux.h) = 2f37344082e935a99fc0420345
 SHA1 (patch-lib_safestack_safestack.cc) = 6ccd97d3253eb3e284fc8375e651f2527317d88a
 SHA1 (patch-lib_sanitizer__common_CMakeLists.txt) = 45b18179c5d1d9f284ccfe4670a989ac30d05e92
 SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = b0815e88864b3f8f9c577811fb56bc8f9791a64c
+SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = b0cd6dd321ad5a9e0461806a2c44be7edad18c46
 SHA1 (patch-lib_sanitizer__common_sanitizer__libignore.cc) = 4b711c72fb64752eb17cc8e0b810526f33d64023
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = ec71e0189426780d32d83e25b1713040a8407e4f
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux.h) = 88b1ebffc90f47b1dfd4e21e1ec3980a4ab9f4c3
diff --git a/compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.cc b/compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.cc
new file mode 100644
index 0000000000..23c14c5a3f
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- lib/asan/asan_interceptors.cc.orig	2017-06-12 15:01:29.000000000 +0000
++++ lib/asan/asan_interceptors.cc
+@@ -424,6 +424,11 @@ INTERCEPTOR(int, swapcontext, struct uco
+ }
+ #endif  // ASAN_INTERCEPT_SWAPCONTEXT
+ 
++#if SANITIZER_NETBSD
++#define longjmp __longjmp14
++#define siglongjmp __siglongjmp14
++#endif
++
+ INTERCEPTOR(void, longjmp, void *env, int val) {
+   __asan_handle_no_return();
+   REAL(longjmp)(env, val);
diff --git a/compiler-rt-netbsd/patches/patch-lib_asan_asan__malloc__linux.cc b/compiler-rt-netbsd/patches/patch-lib_asan_asan__malloc__linux.cc
new file mode 100644
index 0000000000..6825c1e344
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_asan_asan__malloc__linux.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- lib/asan/asan_malloc_linux.cc.orig	2017-06-12 15:01:29.000000000 +0000
++++ lib/asan/asan_malloc_linux.cc
+@@ -15,7 +15,7 @@
+ //===----------------------------------------------------------------------===//
+ 
+ #include "sanitizer_common/sanitizer_platform.h"
+-#if SANITIZER_FREEBSD || SANITIZER_LINUX
++#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
+ 
+ #include "sanitizer_common/sanitizer_tls_get_addr.h"
+ #include "asan_allocator.h"
+@@ -226,4 +226,4 @@ void ReplaceSystemMalloc() {
+ }  // namespace __asan
+ #endif  // SANITIZER_ANDROID
+ 
+-#endif  // SANITIZER_FREEBSD || SANITIZER_LINUX
++#endif  // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
diff --git a/compiler-rt-netbsd/patches/patch-lib_asan_asan__stack.h b/compiler-rt-netbsd/patches/patch-lib_asan_asan__stack.h
new file mode 100644
index 0000000000..e1a7255615
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_asan_asan__stack.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/asan/asan_stack.h.orig	2017-06-03 23:53:58.000000000 +0000
++++ lib/asan/asan_stack.h
+@@ -44,7 +44,7 @@ void GetStackTraceWithPcBpAndContext(Buf
+       // On FreeBSD the slow unwinding that leverages _Unwind_Backtrace()
+       // yields the call stack of the signal's handler and not of the code
+       // that raised the signal (as it does on Linux).
+-      if (SANITIZER_FREEBSD && t->isInDeadlySignal()) fast = true;
++      if ((SANITIZER_FREEBSD || SANITIZER_NETBSD) && t->isInDeadlySignal()) fast = true;
+       uptr stack_top = t->stack_top();
+       uptr stack_bottom = t->stack_bottom();
+       ScopedUnwinding unwind_scope(t);
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..d11ae81221
--- /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-06-03 23:53:57.000000000 +0000
++++ lib/sanitizer_common/sanitizer_internal_defs.h
+@@ -133,7 +133,7 @@ typedef int pid_t;
+ // _FILE_OFFSET_BITS. This definition of OFF_T matches the ABI of system calls
+ // like pread and mmap, as opposed to pread64 and mmap64.
+ // FreeBSD, Mac and Linux/x86-64 are special.
+-#if SANITIZER_FREEBSD || SANITIZER_MAC || \
++#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_MAC || \
+   (SANITIZER_LINUX && defined(__x86_64__))
+ typedef u64 OFF_T;
+ #else


Home | Main Index | Thread Index | Old Index