pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Sync with local patches



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Oct 11 12:43:07 2018 +0200
Changeset:	daf06ba804197654f8c0681ee57791a656558700

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
Added Files:
	compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__interface__test.cc
	compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__noinst__test.cc
	compiler-rt-netbsd/patches/patch-lib_msan_tests_msan__test.cc
	compiler-rt-netbsd/patches/patch-lib_scudo_scudo__platform.h
	compiler-rt-netbsd/patches/patch-test_asan_TestCases_intercept-rethrow-exception.cc
	compiler-rt-netbsd/patches/patch-test_msan_chained__origin__with__signals.cc
	compiler-rt-netbsd/patches/patch-test_msan_dtls__test.c
	compiler-rt-netbsd/patches/patch-test_msan_fork.cc
	compiler-rt-netbsd/patches/patch-test_msan_ioctl__custom.cc
	compiler-rt-netbsd/patches/patch-test_msan_signal__stress__test.cc

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

Various fixups and part of the code landed upstream.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=daf06ba804197654f8c0681ee57791a656558700

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

diffstat:
 compiler-rt-netbsd/distinfo                        |  14 +-
 .../patch-lib_asan_tests_asan__interface__test.cc  |  20 +++
 .../patch-lib_asan_tests_asan__noinst__test.cc     |  20 +++
 .../patches/patch-lib_msan_tests_msan__test.cc     |  33 ++++
 ...zer__common_sanitizer__common__interceptors.inc | 170 ++++++++++++++++++++-
 ...zer__common_sanitizer__platform__interceptors.h |  26 +++-
 .../patches/patch-lib_scudo_scudo__platform.h      |  22 +++
 ...t_asan_TestCases_intercept-rethrow-exception.cc |  14 ++
 ...tch-test_msan_chained__origin__with__signals.cc |  14 ++
 .../patches/patch-test_msan_dtls__test.c           |  14 ++
 compiler-rt-netbsd/patches/patch-test_msan_fork.cc |  14 ++
 .../patches/patch-test_msan_ioctl__custom.cc       |  14 ++
 .../patch-test_msan_signal__stress__test.cc        |  14 ++
 13 files changed, 378 insertions(+), 11 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 12c13be688..fa222b71f4 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -3,21 +3,31 @@ $NetBSD: distinfo,v 1.35 2015/09/11 01:21:57 tnn Exp $
 SHA1 (patch-CMakeLists.txt) = 43d2c38f405b7096775fdd3036c7ba6be82c3d07
 SHA1 (patch-cmake_Modules_HandleCompilerRT.cmake) = fde0a4b440a257dec40c4f106c2352d5efecceef
 SHA1 (patch-lib_asan_asan__posix.cc) = be7e47c252e30184639f7ed1c98c75a8667fd261
+SHA1 (patch-lib_asan_tests_asan__interface__test.cc) = ab691730804b1efd7ffaf7576e72144753cea726
+SHA1 (patch-lib_asan_tests_asan__noinst__test.cc) = 333f5c207320d5e3433895da461255a6967a0ae9
 SHA1 (patch-lib_fuzzer_FuzzerLoop.cpp) = b2e226a0d7b230cc8598a0591ae6f688527c6b2d
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = c3d8a78f96566e5b8d2d8a5cbaba60990bfd6efe
 SHA1 (patch-lib_msan_msan__interceptors.cc) = 7af07c88b0ddf650f3df5dea4f6664ff9393d963
 SHA1 (patch-lib_msan_msan__linux.cc) = b5df0f4f5930d7c1681b1ad867c893d01d6e5cf7
-SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = d48fd71509c2adfb5fc5aacfec1dc8fd07640414
+SHA1 (patch-lib_msan_tests_msan__test.cc) = 9ec9513826b59c2174e531b61dd1d7de1e882a5c
+SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 728815f7be77aa7a24f308b9c6bdc1478edb01d4
 SHA1 (patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc) = 8e31ef0974fd12505b2d61723181b852d66815ce
 SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 9475c8018dadbc4d865b52a03e43f9eae2011c3e
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc) = 8d156e4b51961bab6bae3ee30df8e18aea632b5d
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 87684ad05a8e3a5ab2f1c9cf00cbecab4823eeb3
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 48a0178377ff0610913487e1ee7032b198cd0437
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = b8125c783a773497436536b7f4deead8c36633c5
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = e8a0d9389f3ddd41f911e00f8ff62e214441296d
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc) = 7c16ba866352f3a695a544094ca46f0f561c43c5
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 9f535e84c3e1ab5704b11e388ac240439a9900d6
 SHA1 (patch-lib_sanitizer__common_sanitizer__unwind__linux__libcdep.cc) = 86d53010debaf2cc5c9793d83186db2db76b280f
+SHA1 (patch-lib_scudo_scudo__platform.h) = 68f33b18d913984c3a459597ef62f63d36184ca9
 SHA1 (patch-lib_tsan_CMakeLists.txt) = 4d8f8081ff2a3249565df26e67a35b5b3509e0b0
 SHA1 (patch-lib_xray_tests_CMakeLists.txt) = bb52916184d8e829395dd40d6d1b8b7eac40da92
+SHA1 (patch-test_asan_TestCases_intercept-rethrow-exception.cc) = 48a6168e423a33a2474b9a76990d67f61430617b
 SHA1 (patch-test_asan_TestCases_interception__failure__test.cc) = 0a359141e3c30b672842904b32d1542170b03ab1
+SHA1 (patch-test_msan_chained__origin__with__signals.cc) = b091a0275144627d735114c45b383655e7a560e3
+SHA1 (patch-test_msan_dtls__test.c) = da24b1a7b65c64b618b38fb4e7042c56c125b8f1
+SHA1 (patch-test_msan_fork.cc) = c8055621693ed2baf7063b0bff7179d912707ec7
+SHA1 (patch-test_msan_ioctl__custom.cc) = 2bbfb73cb4fe35545d05be7950157bef8f6efd7a
+SHA1 (patch-test_msan_signal__stress__test.cc) = 35c598e02e931fce6d413d91932594315814f681
 SHA1 (patch-utils_generate__netbsd__ioctls.awk) = 56c92131aa95b64765af3e9b60fd7d7cc55facbc
diff --git a/compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__interface__test.cc b/compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__interface__test.cc
new file mode 100644
index 0000000000..b1f7ca6aae
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__interface__test.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+--- lib/asan/tests/asan_interface_test.cc.orig	2018-08-21 21:25:41.000000000 +0000
++++ lib/asan/tests/asan_interface_test.cc
+@@ -102,6 +102,7 @@ TEST(AddressSanitizerInterface, GetHeapS
+   }
+ }
+ 
++#if !defined(__NetBSD__)
+ static const size_t kManyThreadsMallocSizes[] = {5, 1UL<<10, 1UL<<14, 357};
+ static const size_t kManyThreadsIterations = 250;
+ static const size_t kManyThreadsNumThreads =
+@@ -135,6 +136,7 @@ TEST(AddressSanitizerInterface, ManyThre
+   // so we can't check for equality here.
+   EXPECT_LT(after_test, before_test + (1UL<<20));
+ }
++#endif
+ 
+ static void DoDoubleFree() {
+   int *x = Ident(new int);
diff --git a/compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__noinst__test.cc b/compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__noinst__test.cc
new file mode 100644
index 0000000000..66901c11e1
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_asan_tests_asan__noinst__test.cc
@@ -0,0 +1,20 @@
+$NetBSD$
+
+--- lib/asan/tests/asan_noinst_test.cc.orig	2018-08-21 21:25:41.000000000 +0000
++++ lib/asan/tests/asan_noinst_test.cc
+@@ -153,6 +153,7 @@ TEST(AddressSanitizer, QuarantineTest) {
+   EXPECT_LT(i, max_i);
+ }
+ 
++#if !defined(__NetBSD__)
+ void *ThreadedQuarantineTestWorker(void *unused) {
+   (void)unused;
+   u32 seed = my_rand();
+@@ -187,6 +188,7 @@ TEST(AddressSanitizer, ThreadedQuarantin
+     EXPECT_LT(mmaped2 - mmaped1, 320U * (1 << 20));
+   }
+ }
++#endif
+ 
+ void *ThreadedOneSizeMallocStress(void *unused) {
+   (void)unused;
diff --git a/compiler-rt-netbsd/patches/patch-lib_msan_tests_msan__test.cc b/compiler-rt-netbsd/patches/patch-lib_msan_tests_msan__test.cc
new file mode 100644
index 0000000000..1cd5480862
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_msan_tests_msan__test.cc
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- lib/msan/tests/msan_test.cc.orig	2018-08-21 21:25:44.000000000 +0000
++++ lib/msan/tests/msan_test.cc
+@@ -1934,12 +1934,14 @@ TEST(MemorySanitizer, remquof) {
+   EXPECT_NOT_POISONED(quo);
+ }
+ 
++#if !defined(__NetBSD__)
+ TEST(MemorySanitizer, remquol) {
+   int quo;
+   long double res = remquof(29.0, 3.0, &quo);
+   ASSERT_NE(0.0, res);
+   EXPECT_NOT_POISONED(quo);
+ }
++#endif
+ 
+ TEST(MemorySanitizer, lgamma) {
+   double res = lgamma(1.1);
+@@ -1953,11 +1955,13 @@ TEST(MemorySanitizer, lgammaf) {
+   EXPECT_NOT_POISONED(signgam);
+ }
+ 
++#if !defined(__NetBSD__)
+ TEST(MemorySanitizer, lgammal) {
+   long double res = lgammal(1.1);
+   ASSERT_NE(0.0, res);
+   EXPECT_NOT_POISONED(signgam);
+ }
++#endif
+ 
+ TEST(MemorySanitizer, lgamma_r) {
+   int sgn;
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
index 91119eddc3..73af32acae 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
@@ -23,7 +23,85 @@ $NetBSD$
  extern const unsigned short *_ctype_tab_;
  extern const short *_toupper_tab_;
  extern const short *_tolower_tab_;
-@@ -3060,17 +3067,28 @@ INTERCEPTOR(int, sendmmsg, int fd, struc
+@@ -2034,36 +2041,51 @@ INTERCEPTOR(int, getpwent_r, __sanitizer
+   if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp));
+   return res;
+ }
+-INTERCEPTOR(int, fgetpwent_r, void *fp, __sanitizer_passwd *pwbuf, char *buf,
+-            SIZE_T buflen, __sanitizer_passwd **pwbufp) {
++INTERCEPTOR(int, getgrent_r, __sanitizer_group *pwbuf, char *buf, SIZE_T buflen,
++            __sanitizer_group **pwbufp) {
+   void *ctx;
+-  COMMON_INTERCEPTOR_ENTER(ctx, fgetpwent_r, fp, pwbuf, buf, buflen, pwbufp);
++  COMMON_INTERCEPTOR_ENTER(ctx, getgrent_r, pwbuf, buf, buflen, pwbufp);
+   // FIXME: under ASan the call below may write to freed memory and corrupt
+   // its metadata. See
+   // https://github.com/google/sanitizers/issues/321.
+-  int res = REAL(fgetpwent_r)(fp, pwbuf, buf, buflen, pwbufp);
++  int res = REAL(getgrent_r)(pwbuf, buf, buflen, pwbufp);
+   if (!res) {
+-    if (pwbufp && *pwbufp) unpoison_passwd(ctx, *pwbufp);
++    if (pwbufp && *pwbufp) unpoison_group(ctx, *pwbufp);
+     COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen);
+   }
+   if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp));
+   return res;
+ }
+-INTERCEPTOR(int, getgrent_r, __sanitizer_group *pwbuf, char *buf, SIZE_T buflen,
+-            __sanitizer_group **pwbufp) {
++#define INIT_GETPWENT_R                   \
++  COMMON_INTERCEPT_FUNCTION(getpwent_r);  \
++  COMMON_INTERCEPT_FUNCTION(getgrent_r);
++#else
++#define INIT_GETPWENT_R
++#endif
++
++#if SANITIZER_INTERCEPT_FGETPWENT_R
++INTERCEPTOR(int, fgetpwent_r, void *fp, __sanitizer_passwd *pwbuf, char *buf,
++            SIZE_T buflen, __sanitizer_passwd **pwbufp) {
+   void *ctx;
+-  COMMON_INTERCEPTOR_ENTER(ctx, getgrent_r, pwbuf, buf, buflen, pwbufp);
++  COMMON_INTERCEPTOR_ENTER(ctx, fgetpwent_r, fp, pwbuf, buf, buflen, pwbufp);
+   // FIXME: under ASan the call below may write to freed memory and corrupt
+   // its metadata. See
+   // https://github.com/google/sanitizers/issues/321.
+-  int res = REAL(getgrent_r)(pwbuf, buf, buflen, pwbufp);
++  int res = REAL(fgetpwent_r)(fp, pwbuf, buf, buflen, pwbufp);
+   if (!res) {
+-    if (pwbufp && *pwbufp) unpoison_group(ctx, *pwbufp);
++    if (pwbufp && *pwbufp) unpoison_passwd(ctx, *pwbufp);
+     COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, buflen);
+   }
+   if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp));
+   return res;
+ }
++#define INIT_FGETPWENT_R                  \
++  COMMON_INTERCEPT_FUNCTION(fgetpwent_r);
++#else
++#define INIT_FGETPWENT_R
++#endif
++
++#if SANITIZER_INTERCEPT_FGETGRENT_R
+ INTERCEPTOR(int, fgetgrent_r, void *fp, __sanitizer_group *pwbuf, char *buf,
+             SIZE_T buflen, __sanitizer_group **pwbufp) {
+   void *ctx;
+@@ -2079,13 +2101,10 @@ INTERCEPTOR(int, fgetgrent_r, void *fp, 
+   if (pwbufp) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, pwbufp, sizeof(*pwbufp));
+   return res;
+ }
+-#define INIT_GETPWENT_R                   \
+-  COMMON_INTERCEPT_FUNCTION(getpwent_r);  \
+-  COMMON_INTERCEPT_FUNCTION(fgetpwent_r); \
+-  COMMON_INTERCEPT_FUNCTION(getgrent_r);  \
++#define INIT_FGETGRENT_R                  \
+   COMMON_INTERCEPT_FUNCTION(fgetgrent_r);
+ #else
+-#define INIT_GETPWENT_R
++#define INIT_FGETGRENT_R
+ #endif
+ 
+ #if SANITIZER_INTERCEPT_SETPWENT
+@@ -3060,17 +3079,28 @@ INTERCEPTOR(int, sendmmsg, int fd, struc
  #endif
  
  #if SANITIZER_INTERCEPT_GETPEERNAME
@@ -61,7 +139,7 @@ $NetBSD$
    return res;
  }
  #define INIT_GETPEERNAME COMMON_INTERCEPT_FUNCTION(getpeername);
-@@ -4240,7 +4258,7 @@ INTERCEPTOR(int, fstatfs64, int fd, void
+@@ -4240,7 +4270,7 @@ INTERCEPTOR(int, fstatfs64, int fd, void
  #endif
  
  #if SANITIZER_INTERCEPT_STATVFS
@@ -70,7 +148,68 @@ $NetBSD$
    void *ctx;
    COMMON_INTERCEPTOR_ENTER(ctx, statvfs, path, buf);
    if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
-@@ -7235,6 +7253,1606 @@ INTERCEPTOR(struct __sanitizer_netent *,
+@@ -4819,6 +4849,14 @@ INTERCEPTOR(float, remquof, float x, flo
+   if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo));
+   return res;
+ }
++#define INIT_REMQUO                   \
++  COMMON_INTERCEPT_FUNCTION(remquo);  \
++  COMMON_INTERCEPT_FUNCTION(remquof);
++#else
++#define INIT_REMQUO
++#endif
++
++#if SANITIZER_INTERCEPT_REMQUOL
+ INTERCEPTOR(long double, remquol, long double x, long double y, int *quo) {
+   void *ctx;
+   COMMON_INTERCEPTOR_ENTER(ctx, remquol, x, y, quo);
+@@ -4829,12 +4867,10 @@ INTERCEPTOR(long double, remquol, long d
+   if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo));
+   return res;
+ }
+-#define INIT_REMQUO                   \
+-  COMMON_INTERCEPT_FUNCTION(remquo);  \
+-  COMMON_INTERCEPT_FUNCTION(remquof); \
++#define INIT_REMQUOL                   \
+   COMMON_INTERCEPT_FUNCTION_LDBL(remquol);
+ #else
+-#define INIT_REMQUO
++#define INIT_REMQUOL
+ #endif
+ 
+ #if SANITIZER_INTERCEPT_LGAMMA
+@@ -4853,6 +4889,14 @@ INTERCEPTOR(float, lgammaf, float x) {
+   COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam));
+   return res;
+ }
++#define INIT_LGAMMA                   \
++  COMMON_INTERCEPT_FUNCTION(lgamma);  \
++  COMMON_INTERCEPT_FUNCTION(lgammaf);
++#else
++#define INIT_LGAMMA
++#endif
++
++#if SANITIZER_INTERCEPT_LGAMMAL
+ INTERCEPTOR(long double, lgammal, long double x) {
+   void *ctx;
+   COMMON_INTERCEPTOR_ENTER(ctx, lgammal, x);
+@@ -4860,12 +4904,10 @@ INTERCEPTOR(long double, lgammal, long d
+   COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam));
+   return res;
+ }
+-#define INIT_LGAMMA                   \
+-  COMMON_INTERCEPT_FUNCTION(lgamma);  \
+-  COMMON_INTERCEPT_FUNCTION(lgammaf); \
+-  COMMON_INTERCEPT_FUNCTION_LDBL(lgammal);
++#define INIT_LGAMMAL                   \
++  COMMON_INTERCEPT_FUNCTION(lgammal);
+ #else
+-#define INIT_LGAMMA
++#define INIT_LGAMMAL
+ #endif
+ 
+ #if SANITIZER_INTERCEPT_LGAMMA_R
+@@ -7235,6 +7277,1602 @@ INTERCEPTOR(struct __sanitizer_netent *,
  #define INIT_NETENT
  #endif
  
@@ -1541,7 +1680,6 @@ $NetBSD$
 +#define INIT_SHA2 \
 +  COMMON_INTERCEPT_FUNCTION(SHA224_Init); \
 +  COMMON_INTERCEPT_FUNCTION(SHA224_Update); \
-+  COMMON_INTERCEPT_FUNCTION(SHA224_Pad); \
 +  COMMON_INTERCEPT_FUNCTION(SHA224_Final); \
 +  COMMON_INTERCEPT_FUNCTION(SHA224_Transform); \
 +  COMMON_INTERCEPT_FUNCTION(SHA224_End); \
@@ -1550,7 +1688,6 @@ $NetBSD$
 +  COMMON_INTERCEPT_FUNCTION(SHA224_Data); \
 +  COMMON_INTERCEPT_FUNCTION(SHA256_Init); \
 +  COMMON_INTERCEPT_FUNCTION(SHA256_Update); \
-+  COMMON_INTERCEPT_FUNCTION(SHA256_Pad); \
 +  COMMON_INTERCEPT_FUNCTION(SHA256_Final); \
 +  COMMON_INTERCEPT_FUNCTION(SHA256_Transform); \
 +  COMMON_INTERCEPT_FUNCTION(SHA256_End); \
@@ -1559,7 +1696,6 @@ $NetBSD$
 +  COMMON_INTERCEPT_FUNCTION(SHA256_Data); \
 +  COMMON_INTERCEPT_FUNCTION(SHA384_Init); \
 +  COMMON_INTERCEPT_FUNCTION(SHA384_Update); \
-+  COMMON_INTERCEPT_FUNCTION(SHA384_Pad); \
 +  COMMON_INTERCEPT_FUNCTION(SHA384_Final); \
 +  COMMON_INTERCEPT_FUNCTION(SHA384_Transform); \
 +  COMMON_INTERCEPT_FUNCTION(SHA384_End); \
@@ -1568,7 +1704,6 @@ $NetBSD$
 +  COMMON_INTERCEPT_FUNCTION(SHA384_Data); \
 +  COMMON_INTERCEPT_FUNCTION(SHA512_Init); \
 +  COMMON_INTERCEPT_FUNCTION(SHA512_Update); \
-+  COMMON_INTERCEPT_FUNCTION(SHA512_Pad); \
 +  COMMON_INTERCEPT_FUNCTION(SHA512_Final); \
 +  COMMON_INTERCEPT_FUNCTION(SHA512_Transform); \
 +  COMMON_INTERCEPT_FUNCTION(SHA512_End); \
@@ -1677,7 +1812,26 @@ $NetBSD$
  static void InitializeCommonInterceptors() {
    static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
    interceptor_metadata_map = new((void *)&metadata_mem) MetadataHashMap();
-@@ -7484,6 +9102,30 @@ static void InitializeCommonInterceptors
+@@ -7299,6 +8937,8 @@ static void InitializeCommonInterceptors
+   INIT_GETPWENT;
+   INIT_FGETPWENT;
+   INIT_GETPWENT_R;
++  INIT_FGETPWENT_R;
++  INIT_FGETGRENT_R;
+   INIT_SETPWENT;
+   INIT_CLOCK_GETTIME;
+   INIT_GETITIMER;
+@@ -7408,7 +9048,9 @@ static void InitializeCommonInterceptors
+   INIT_PTHREAD_GETNAME_NP;
+   INIT_SINCOS;
+   INIT_REMQUO;
++  INIT_REMQUOL;
+   INIT_LGAMMA;
++  INIT_LGAMMAL;
+   INIT_LGAMMA_R;
+   INIT_LGAMMAL_R;
+   INIT_DRAND48_R;
+@@ -7484,6 +9126,30 @@ static void InitializeCommonInterceptors
    INIT_TTYENT;
    INIT_PROTOENT;
    INIT_NETENT;
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
index baca0bc1ed..547290b1fe 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
@@ -2,7 +2,31 @@ $NetBSD$
 
 --- lib/sanitizer_common/sanitizer_platform_interceptors.h.orig	2018-08-21 21:25:40.000000000 +0000
 +++ lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -511,4 +511,29 @@
+@@ -207,9 +207,13 @@
+ #define SANITIZER_INTERCEPT_GETPWENT                                          \
+   (SI_FREEBSD || SI_NETBSD || SI_OPENBSD || SI_MAC || SI_LINUX_NOT_ANDROID || \
+   SI_SOLARIS)
++#define SANITIZER_INTERCEPT_FGETGRENT_R                                       \
++  (SI_FREEBSD || SI_OPENBSD || SI_MAC || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
+ #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID || SI_SOLARIS
+ #define SANITIZER_INTERCEPT_GETPWENT_R \
+   (SI_FREEBSD || SI_NETBSD || SI_OPENBSD || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
++#define SANITIZER_INTERCEPT_FGETPWENT_R \
++  (SI_FREEBSD || SI_OPENBSD || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
+ #define SANITIZER_INTERCEPT_SETPWENT \
+   (SI_MAC || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
+ #define SANITIZER_INTERCEPT_CLOCK_GETTIME \
+@@ -356,7 +360,9 @@
+ #define SANITIZER_INTERCEPT_TEMPNAM SI_POSIX
+ #define SANITIZER_INTERCEPT_SINCOS SI_LINUX || SI_SOLARIS
+ #define SANITIZER_INTERCEPT_REMQUO SI_POSIX
++#define SANITIZER_INTERCEPT_REMQUOL (SI_POSIX && !SI_NETBSD)
+ #define SANITIZER_INTERCEPT_LGAMMA SI_POSIX
++#define SANITIZER_INTERCEPT_LGAMMAL (SI_POSIX && !SI_NETBSD)
+ #define SANITIZER_INTERCEPT_LGAMMA_R (SI_FREEBSD || SI_LINUX || SI_SOLARIS)
+ #define SANITIZER_INTERCEPT_LGAMMAL_R SI_LINUX_NOT_ANDROID || SI_SOLARIS
+ #define SANITIZER_INTERCEPT_DRAND48_R SI_LINUX_NOT_ANDROID
+@@ -511,4 +517,29 @@
  #define SANITIZER_INTERCEPT_PROTOENT SI_NETBSD
  #define SANITIZER_INTERCEPT_NETENT SI_NETBSD
  
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..4cabee2f3d
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_scudo_scudo__platform.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- lib/scudo/scudo_platform.h.orig	2018-08-21 21:25:38.000000000 +0000
++++ lib/scudo/scudo_platform.h
+@@ -17,7 +17,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
+ 
+@@ -28,7 +28,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-test_asan_TestCases_intercept-rethrow-exception.cc b/compiler-rt-netbsd/patches/patch-test_asan_TestCases_intercept-rethrow-exception.cc
new file mode 100644
index 0000000000..56709e1bcd
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_asan_TestCases_intercept-rethrow-exception.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- test/asan/TestCases/intercept-rethrow-exception.cc.orig	2018-08-21 21:25:30.000000000 +0000
++++ test/asan/TestCases/intercept-rethrow-exception.cc
+@@ -4,6 +4,9 @@
+ // RUN: %clangxx_asan -fexceptions -O0 %s -o %t
+ // RUN: %run %t
+ 
++// Not ported to NetBSD
++// XFAIL: netbsd
++
+ #include <assert.h>
+ #include <exception>
+ #include <sanitizer/asan_interface.h>
diff --git a/compiler-rt-netbsd/patches/patch-test_msan_chained__origin__with__signals.cc b/compiler-rt-netbsd/patches/patch-test_msan_chained__origin__with__signals.cc
new file mode 100644
index 0000000000..75f09c721b
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_msan_chained__origin__with__signals.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- test/msan/chained_origin_with_signals.cc.orig	2018-08-21 21:25:23.000000000 +0000
++++ test/msan/chained_origin_with_signals.cc
+@@ -10,6 +10,9 @@
+ // RUN:     not %run %t >%t.out 2>&1
+ // RUN: FileCheck %s < %t.out
+ 
++// Reported deadly signal due to stack-overflow
++// XFAIL: netbsd
++
+ #include <signal.h>
+ #include <stdio.h>
+ #include <sys/types.h>
diff --git a/compiler-rt-netbsd/patches/patch-test_msan_dtls__test.c b/compiler-rt-netbsd/patches/patch-test_msan_dtls__test.c
new file mode 100644
index 0000000000..be956f779a
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_msan_dtls__test.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- test/msan/dtls_test.c.orig	2018-08-21 21:25:23.000000000 +0000
++++ test/msan/dtls_test.c
+@@ -8,6 +8,9 @@
+ 
+    XFAIL: FreeBSD
+    UNSUPPORTED: powerpc
++
++   // Reports use-of-uninitialized-value, not analyzed
++   XFAIL: netbsd
+ */
+ 
+ #ifndef BUILD_SO
diff --git a/compiler-rt-netbsd/patches/patch-test_msan_fork.cc b/compiler-rt-netbsd/patches/patch-test_msan_fork.cc
new file mode 100644
index 0000000000..5d4879c859
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_msan_fork.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- test/msan/fork.cc.orig	2018-08-21 21:25:23.000000000 +0000
++++ test/msan/fork.cc
+@@ -14,6 +14,9 @@
+ // UNSUPPORTED: powerpc64-target-arch
+ // UNSUPPORTED: powerpc64le-target-arch
+ 
++// Somtimes hangs
++// UNSUPPORTED: netbsd
++
+ #include <pthread.h>
+ #include <unistd.h>
+ #include <stdio.h>
diff --git a/compiler-rt-netbsd/patches/patch-test_msan_ioctl__custom.cc b/compiler-rt-netbsd/patches/patch-test_msan_ioctl__custom.cc
new file mode 100644
index 0000000000..b8926190da
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_msan_ioctl__custom.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- test/msan/ioctl_custom.cc.orig	2018-08-21 21:25:23.000000000 +0000
++++ test/msan/ioctl_custom.cc
+@@ -4,6 +4,9 @@
+ // RUN: %clangxx_msan -DPOSITIVE -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s
+ // RUN: %clangxx_msan -DPOSITIVE -O3 -g %s -o %t && not %run %t 2>&1 | FileCheck %s
+ 
++// Reports different report (not analyzed)
++// XFAIL: netbsd
++
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <net/if.h>
diff --git a/compiler-rt-netbsd/patches/patch-test_msan_signal__stress__test.cc b/compiler-rt-netbsd/patches/patch-test_msan_signal__stress__test.cc
new file mode 100644
index 0000000000..2b6d7f51a2
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_msan_signal__stress__test.cc
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- test/msan/signal_stress_test.cc.orig	2018-08-21 21:25:23.000000000 +0000
++++ test/msan/signal_stress_test.cc
+@@ -2,6 +2,9 @@
+ //
+ // Test that va_arg shadow from a signal handler does not leak outside.
+ 
++// Reported deadly signal due to stack-overflow
++// XFAIL: netbsd
++
+ #include <signal.h>
+ #include <stdarg.h>
+ #include <sanitizer/msan_interface.h>


Home | Main Index | Thread Index | Old Index