pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Sync patches with my local copy



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Nov 28 15:10:10 2017 +0100
Changeset:	9c9216098d37a82c3d9b4b6a93015f5f2baf7d98

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc
Added Files:
	compiler-rt-netbsd/patches/patch-lib_scudo_scudo__platform.h
	compiler-rt-netbsd/patches/patch-test_lsan_lit.common.cfg
	compiler-rt-netbsd/patches/patch-test_scudo_lit.cfg

Log Message:
compiler-rt-netbsd: Sync patches with my local copy

Add initial scudo support.

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=9c9216098d37a82c3d9b4b6a93015f5f2baf7d98

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

diffstat:
 compiler-rt-netbsd/distinfo                        |  7 +++++--
 .../patches/patch-cmake_config-ix.cmake            | 11 +++++++++-
 .../patches/patch-lib_scudo_scudo__platform.h      | 22 ++++++++++++++++++++
 .../patch-lib_tsan_rtl_tsan__interceptors.cc       | 21 ++++++-------------
 .../patches/patch-test_lsan_lit.common.cfg         | 17 +++++++++++++++
 .../patches/patch-test_scudo_lit.cfg               | 24 ++++++++++++++++++++++
 6 files changed, 84 insertions(+), 18 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index b2d40f8529..9b30c42710 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -1,8 +1,11 @@
 $NetBSD: distinfo,v 1.35 2015/09/11 01:21:57 tnn Exp $
 
-SHA1 (patch-cmake_config-ix.cmake) = ed4b2f8aea3e0e62c552bebcd766ece3e574c99e
+SHA1 (patch-cmake_config-ix.cmake) = b22fbae114557b1fb99e0683bd0a8804bdadcda5
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = 38ca750154dfc9843a56748078235824b772a147
 SHA1 (patch-lib_msan_msan.h) = 1ee0f86ccb410561d381afba526c85aa5dace912
-SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 0bb8bfd5f0286796541bd630a69d430ea293049d
+SHA1 (patch-lib_scudo_scudo__platform.h) = 5dfd8f903c840e9ba81f2a8e502a380d296d4d5a
+SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 3ae41067c820a01caaa1e8764ea2536e8e1e6c52
 SHA1 (patch-lib_tsan_rtl_tsan__rtl.cc) = a2485075212f150ee2ce33616e887be2b3f41822
 SHA1 (patch-lib_tsan_rtl_tsan__rtl__amd64.S) = 5a0bed4cf2c1f63affeed8886983a53b4376ab5b
+SHA1 (patch-test_lsan_lit.common.cfg) = 10dc251f80efb96d015a22c740dc20b1843b9a11
+SHA1 (patch-test_scudo_lit.cfg) = 5821288b2a385d0da45a9af25f16a92b1316f962
diff --git a/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake b/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
index 18ed44bb16..23eff40226 100644
--- a/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
+++ b/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- cmake/config-ix.cmake.orig	2017-11-28 08:25:28.951362549 +0000
+--- cmake/config-ix.cmake.orig	2017-11-28 08:25:28.000000000 +0000
 +++ cmake/config-ix.cmake
 @@ -525,7 +525,7 @@ else()
  endif()
@@ -11,3 +11,12 @@ $NetBSD$
    set(COMPILER_RT_HAS_PROFILE TRUE)
  else()
    set(COMPILER_RT_HAS_PROFILE FALSE)
+@@ -573,7 +573,7 @@ else()
+ endif()
+ 
+ if (COMPILER_RT_HAS_SANITIZER_COMMON AND SCUDO_SUPPORTED_ARCH AND
+-    OS_NAME MATCHES "Linux|Android")
++    OS_NAME MATCHES "Linux|Android|NetBSD")
+   set(COMPILER_RT_HAS_SCUDO TRUE)
+ else()
+   set(COMPILER_RT_HAS_SCUDO FALSE)
diff --git a/compiler-rt-netbsd/patches/patch-lib_scudo_scudo__platform.h b/compiler-rt-netbsd/patches/patch-lib_scudo_scudo__platform.h
new file mode 100644
index 0000000000..e4336512e7
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_scudo_scudo__platform.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- lib/scudo/scudo_platform.h.orig	2017-11-06 03:58:05.000000000 +0000
++++ lib/scudo/scudo_platform.h
+@@ -16,7 +16,7 @@
+ 
+ #include "sanitizer_common/sanitizer_allocator.h"
+ 
+-#if !SANITIZER_LINUX && !SANITIZER_FUCHSIA
++#if !SANITIZER_LINUX && !SANITIZER_FUCHSIA && !SANITIZER_NETBSD
+ # error "The Scudo hardened allocator is not supported on this platform."
+ #endif
+ 
+@@ -27,7 +27,7 @@
+ # if SANITIZER_ANDROID || SANITIZER_FUCHSIA
+ // Android and Fuchsia use a pool of TSDs shared between threads.
+ #  define SCUDO_TSD_EXCLUSIVE 0
+-# elif SANITIZER_LINUX && !SANITIZER_ANDROID
++# elif SANITIZER_NETBSD || (SANITIZER_LINUX && !SANITIZER_ANDROID)
+ // Non-Android Linux use an exclusive TSD per thread.
+ #  define SCUDO_TSD_EXCLUSIVE 1
+ # else
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 e0c22f2df4..4f188f9ea3 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-28 14:09:06.655354421 +0000
 +++ lib/tsan/rtl/tsan_interceptors.cc
-@@ -548,7 +550,37 @@ extern "C" void __tsan_setjmp(uptr sp, u
+@@ -550,7 +550,37 @@ extern "C" void __tsan_setjmp(uptr sp, u
    SetJmp(cur_thread(), sp, mangled_sp);
  }
  
@@ -41,7 +41,7 @@ $NetBSD$
  TSAN_INTERCEPTOR(int, setjmp, void *env);
  TSAN_INTERCEPTOR(int, _setjmp, void *env);
  TSAN_INTERCEPTOR(int, sigsetjmp, void *env);
-@@ -593,6 +625,38 @@ DEFINE_REAL(int, sigsetjmp, void *env)
+@@ -595,6 +625,38 @@ DEFINE_REAL(int, sigsetjmp, void *env)
  DEFINE_REAL(int, __sigsetjmp, void *env)
  #endif  // SANITIZER_MAC
  
@@ -80,7 +80,7 @@ $NetBSD$
  TSAN_INTERCEPTOR(void, longjmp, uptr *env, int val) {
    // Note: if we call REAL(longjmp) in the context of ScopedInterceptor,
    // bad things will happen. We will jump over ScopedInterceptor dtor and can
-@@ -611,6 +675,7 @@ TSAN_INTERCEPTOR(void, siglongjmp, uptr 
+@@ -613,6 +675,7 @@ TSAN_INTERCEPTOR(void, siglongjmp, uptr 
    LongJmp(cur_thread(), env);
    REAL(siglongjmp)(env, val);
  }
@@ -88,16 +88,7 @@ $NetBSD$
  
  #if !SANITIZER_MAC
  TSAN_INTERCEPTOR(void*, malloc, uptr size) {
-@@ -2332,7 +2400,7 @@ static __sanitizer_sighandler_ptr signal
-   internal_memset(&act.sa_mask, -1, sizeof(act.sa_mask));
-   act.sa_flags = 0;
-   __sanitizer_sigaction old;
--  int res = sigaction(sig, &act, &old);
-+  int res = sigaction_symname(sig, &act, &old);
-   if (res) return (__sanitizer_sighandler_ptr)sig_err;
-   return old.handler;
- }
-@@ -2540,6 +2608,17 @@ void InitializeInterceptors() {
+@@ -2547,6 +2610,17 @@ void InitializeInterceptors() {
    InitializeCommonInterceptors();
    InitializeSignalInterceptors();
  
@@ -115,7 +106,7 @@ $NetBSD$
  #if !SANITIZER_MAC
    // We can not use TSAN_INTERCEPT to get setjmp addr,
    // because it does &setjmp and setjmp is not present in some versions of libc.
-@@ -2552,6 +2631,7 @@ void InitializeInterceptors() {
+@@ -2559,6 +2633,7 @@ void InitializeInterceptors() {
  
    TSAN_INTERCEPT(longjmp);
    TSAN_INTERCEPT(siglongjmp);
diff --git a/compiler-rt-netbsd/patches/patch-test_lsan_lit.common.cfg b/compiler-rt-netbsd/patches/patch-test_lsan_lit.common.cfg
new file mode 100644
index 0000000000..346f97f9df
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_lsan_lit.common.cfg
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- test/lsan/lit.common.cfg.orig	2017-11-06 03:58:05.000000000 +0000
++++ test/lsan/lit.common.cfg
+@@ -67,10 +67,10 @@ config.substitutions.append( ("%clangxx 
+ config.substitutions.append( ("%clang_lsan ", build_invocation(clang_lsan_cflags)) )
+ config.substitutions.append( ("%clangxx_lsan ", build_invocation(clang_lsan_cxxflags)) )
+ 
+-# LeakSanitizer tests are currently supported on x86-64 Linux, PowerPC64 Linux, arm Linux, mips64 Linux, and x86_64 Darwin.
+ supported_linux = config.host_os is 'Linux' and config.host_arch in ['x86_64', 'ppc64', 'ppc64le', 'mips64', 'arm', 'armhf', 'armv7l']
+ supported_darwin = config.host_os is 'Darwin' and config.target_arch is 'x86_64'
+-if not (supported_linux or supported_darwin):
++supported_netbsd = config.host_os is 'NetBSD' and config.host_arch is 'x86_64'
++if not (supported_linux or supported_darwin or supported_netbsd):
+   config.unsupported = True
+ 
+ # Don't support Thumb due to broken fast unwinder
diff --git a/compiler-rt-netbsd/patches/patch-test_scudo_lit.cfg b/compiler-rt-netbsd/patches/patch-test_scudo_lit.cfg
new file mode 100644
index 0000000000..1168d232d5
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_scudo_lit.cfg
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- test/scudo/lit.cfg.orig	2017-11-06 03:58:06.000000000 +0000
++++ test/scudo/lit.cfg
+@@ -26,9 +26,11 @@ c_flags = ([config.target_cflags] +
+            "-pie",
+            "-O0",
+            "-UNDEBUG",
+-           "-ldl",
+            "-Wl,--gc-sections"])
+ 
++if config.host_os not in ['NetBSD']:
++  c_flags += ["-ldl"]
++
+ # Android doesn't want -lrt.
+ if not config.android:
+   c_flags += ["-lrt"]
+@@ -57,5 +59,5 @@ config.substitutions.append(('%env_scudo
+                              'env SCUDO_OPTIONS=' + default_scudo_opts))
+ 
+ # Hardened Allocator tests are currently supported on Linux only.
+-if config.host_os not in ['Linux']:
++if config.host_os not in ['Linux', 'NetBSD']:
+    config.unsupported = True


Home | Main Index | Thread Index | Old Index