compiler-rt-netbsd: Update to SVN r. 319873
authorKamil Rytarowski <n54@gmx.com>
Wed, 6 Dec 2017 02:13:15 +0000 (03:13 +0100)
committerKamil Rytarowski <n54@gmx.com>
Wed, 6 Dec 2017 02:14:47 +0000 (03:14 +0100)
Remove merged patches:

Disable absent functions in MSan/NetBSD interceptors
https://reviews.llvm.org/D40764

Support pthread_key_create symbol alias in MSan/NetBSD
https://reviews.llvm.org/D40767

Sponsored by <The NetBSD Foundation>

compiler-rt-netbsd/Makefile
compiler-rt-netbsd/distinfo
compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc
compiler-rt-netbsd/patches/patch-lib_scudo_scudo__platform.h
compiler-rt-netbsd/patches/patch-test_scudo_lit.cfg

index e3a02b1d3eec5b78c61c9b831038cd2c4d04fc06..e79a7d1c00f3d0a4a55feca2829965ba64277bb5 100644 (file)
@@ -5,7 +5,7 @@ CATEGORIES=     lang devel
 
 SVN_REPOSITORIES=      compiler-rt
 SVN_REPO.compiler-rt=  http://llvm.org/svn/llvm-project/compiler-rt/trunk
-SVN_REVISION.compiler-rt=      319670
+SVN_REVISION.compiler-rt=      319873
 
 MAINTAINER=    pkgsrc-users@NetBSD.org
 HOMEPAGE=      http://compiler-rt.llvm.org/
index a88863f0c5f23fe9f6cd5f046db62834502aaf4b..714c85577e920ef21bd4db562b61ac2f72040ef2 100644 (file)
@@ -3,8 +3,8 @@ $NetBSD: distinfo,v 1.35 2015/09/11 01:21:57 tnn Exp $
 SHA1 (patch-cmake_config-ix.cmake) = 5068232331d541c2786f01960a80e59252b1ad2c
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = 38ca750154dfc9843a56748078235824b772a147
 SHA1 (patch-lib_msan_msan.h) = 1ee0f86ccb410561d381afba526c85aa5dace912
-SHA1 (patch-lib_msan_msan__interceptors.cc) = e3b4faf858e124b3ba0810f1795c8c220e3ebc23
+SHA1 (patch-lib_msan_msan__interceptors.cc) = 4de600de55a15b3c91fc0d0d284bdb27413110bd
 SHA1 (patch-lib_msan_msan__linux.cc) = d75d7587071a9e7a3f6a08a3008af55319e62cab
-SHA1 (patch-lib_scudo_scudo__platform.h) = 8970c6225630737740affd97e68a5ca8c4ec5c11
+SHA1 (patch-lib_scudo_scudo__platform.h) = b3c23678b264ec7568c800bc95e949f1a9b65399
 SHA1 (patch-test_lsan_lit.common.cfg) = 10dc251f80efb96d015a22c740dc20b1843b9a11
-SHA1 (patch-test_scudo_lit.cfg) = 4e6ad680e81d3dcb6032eb367fea82eb1adfa0df
+SHA1 (patch-test_scudo_lit.cfg) = 171f340505f7c87f74a7814b9c4d12d7fcbc5690
index 414566fb5b100b3eea913e4b8a309a0226d321c0..45cda4cf500b47fc2204aa6f9674337df36413b2 100644 (file)
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- lib/msan/msan_interceptors.cc.orig 2017-12-04 19:21:18.823244713 +0000
+--- lib/msan/msan_interceptors.cc.orig 2017-12-06 02:12:26.140110473 +0000
 +++ lib/msan/msan_interceptors.cc
 @@ -32,11 +32,24 @@
  #include "sanitizer_common/sanitizer_libc.h"
@@ -27,133 +27,7 @@ $NetBSD$
  using namespace __msan;
  
  using __sanitizer::memory_order;
-@@ -140,9 +153,14 @@ INTERCEPTOR(SSIZE_T, readlink, const cha
-   return res;
- }
-+#if !SANITIZER_NETBSD
- INTERCEPTOR(void *, mempcpy, void *dest, const void *src, SIZE_T n) {
-   return (char *)__msan_memcpy(dest, src, n) + n;
- }
-+#define MSAN_MAYBE_INTERCEPT_MEMPCPY INTERCEPT_FUNCTION(mempcpy)
-+#else
-+#define MSAN_MAYBE_INTERCEPT_MEMPCPY
-+#endif
- INTERCEPTOR(void *, memccpy, void *dest, const void *src, int c, SIZE_T n) {
-   ENSURE_MSAN_INITED();
-@@ -182,6 +200,7 @@ INTERCEPTOR(void *, aligned_alloc, SIZE_
-   return msan_aligned_alloc(alignment, size, &stack);
- }
-+#if !SANITIZER_NETBSD
- INTERCEPTOR(void *, __libc_memalign, SIZE_T alignment, SIZE_T size) {
-   GET_MALLOC_STACK_TRACE;
-   void *ptr = msan_memalign(alignment, size, &stack);
-@@ -189,6 +208,10 @@ INTERCEPTOR(void *, __libc_memalign, SIZ
-     DTLS_on_libc_memalign(ptr, size);
-   return ptr;
- }
-+#define MSAN_MAYBE_INTERCEPT___LIBC_MEMALIGN INTERCEPT_FUNCTION(__libc_memalign)
-+#else
-+#define MSAN_MAYBE_INTERCEPT___LIBC_MEMALIGN
-+#endif
- INTERCEPTOR(void *, valloc, SIZE_T size) {
-   GET_MALLOC_STACK_TRACE;
-@@ -222,9 +245,15 @@ INTERCEPTOR(void, cfree, void *ptr) {
- #define MSAN_MAYBE_INTERCEPT_CFREE
- #endif
-+#if !SANITIZER_NETBSD
- INTERCEPTOR(uptr, malloc_usable_size, void *ptr) {
-   return __sanitizer_get_allocated_size(ptr);
- }
-+#define MSAN_MAYBE_INTERCEPT_MALLOC_USABLE_SIZE \
-+  INTERCEPT_FUNCTION(malloc_usable_size)
-+#else
-+#define MSAN_MAYBE_INTERCEPT_MALLOC_USABLE_SIZE
-+#endif
- #if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
- // This function actually returns a struct by value, but we can't unpoison a
-@@ -285,6 +314,7 @@ INTERCEPTOR(char *, strncpy, char *dest,
-   return res;
- }
-+#if !SANITIZER_NETBSD
- INTERCEPTOR(char *, stpcpy, char *dest, const char *src) {  // NOLINT
-   ENSURE_MSAN_INITED();
-   GET_STORE_STACK_TRACE;
-@@ -294,6 +324,10 @@ INTERCEPTOR(char *, stpcpy, char *dest, 
-   CopyShadowAndOrigin(dest, src, n + 1, &stack);
-   return res;
- }
-+#define MSAN_MAYBE_INTERCEPT_STPCPY INTERCEPT_FUNCTION(stpcpy)
-+#else
-+#define MSAN_MAYBE_INTERCEPT_STPCPY
-+#endif
- INTERCEPTOR(char *, strdup, char *src) {
-   ENSURE_MSAN_INITED();
-@@ -322,6 +356,7 @@ INTERCEPTOR(char *, __strdup, char *src)
- #define MSAN_MAYBE_INTERCEPT___STRDUP
- #endif
-+#if !SANITIZER_NETBSD
- INTERCEPTOR(char *, gcvt, double number, SIZE_T ndigit, char *buf) {
-   ENSURE_MSAN_INITED();
-   char *res = REAL(gcvt)(number, ndigit, buf);
-@@ -329,6 +364,10 @@ INTERCEPTOR(char *, gcvt, double number,
-   __msan_unpoison(buf, n + 1);
-   return res;
- }
-+#define MSAN_MAYBE_INTERCEPT_GCVT INTERCEPT_FUNCTION(gcvr)
-+#else
-+#define MSAN_MAYBE_INTERCEPT_GCVT
-+#endif
- INTERCEPTOR(char *, strcat, char *dest, const char *src) {  // NOLINT
-   ENSURE_MSAN_INITED();
-@@ -543,6 +582,7 @@ INTERCEPTOR(wchar_t *, wmemcpy, wchar_t 
-   return res;
- }
-+#if !SANITIZER_NETBSD
- INTERCEPTOR(wchar_t *, wmempcpy, wchar_t *dest, const wchar_t *src, SIZE_T n) {
-   ENSURE_MSAN_INITED();
-   GET_STORE_STACK_TRACE;
-@@ -550,6 +590,10 @@ INTERCEPTOR(wchar_t *, wmempcpy, wchar_t
-   CopyShadowAndOrigin(dest, src, n * sizeof(wchar_t), &stack);
-   return res;
- }
-+#define MSAN_MAYBE_INTERCEPT_WMEMPCPY INTERCEPT_FUNCTION(wmempcpy)
-+#else
-+#define MSAN_MAYBE_INTERCEPT_WMEMPCPY
-+#endif
- INTERCEPTOR(wchar_t *, wmemset, wchar_t *s, wchar_t c, SIZE_T n) {
-   CHECK(MEM_IS_APP(s));
-@@ -583,6 +627,7 @@ INTERCEPTOR(int, gettimeofday, void *tv,
-   return res;
- }
-+#if !SANITIZER_NETBSD
- INTERCEPTOR(char *, fcvt, double x, int a, int *b, int *c) {
-   ENSURE_MSAN_INITED();
-   char *res = REAL(fcvt)(x, a, b, c);
-@@ -591,6 +636,10 @@ INTERCEPTOR(char *, fcvt, double x, int 
-   if (res) __msan_unpoison(res, REAL(strlen)(res) + 1);
-   return res;
- }
-+#define MSAN_MAYBE_INTERCEPT_FCVT INTERCEPT_FUNCTION(fcvr)
-+#else
-+#define MSAN_MAYBE_INTERCEPT_FCVT
-+#endif
- INTERCEPTOR(char *, getenv, char *name) {
-   if (msan_init_is_running)
-@@ -1073,23 +1122,82 @@ struct MSanAtExitRecord {
+@@ -1115,23 +1128,82 @@ struct MSanAtExitRecord {
    void *arg;
  };
  
@@ -239,7 +113,7 @@ $NetBSD$
  }
  
  DECLARE_REAL(int, shmctl, int shmid, int cmd, void *buf)
-@@ -1298,7 +1406,7 @@ static int sigaction_impl(int signo, con
+@@ -1340,7 +1412,7 @@ static int sigaction_impl(int signo, con
          pnew_act->sigaction = (decltype(pnew_act->sigaction))new_cb;
        }
      }
@@ -248,7 +122,7 @@ $NetBSD$
      if (res == 0 && oldact) {
        uptr cb = (uptr)oldact->sigaction;
        if (cb == (uptr)SignalAction || cb == (uptr)SignalHandler) {
-@@ -1306,7 +1414,7 @@ static int sigaction_impl(int signo, con
+@@ -1348,7 +1420,7 @@ static int sigaction_impl(int signo, con
        }
      }
    } else {
@@ -257,17 +131,7 @@ $NetBSD$
    }
  
    if (res == 0 && oldact) {
-@@ -1484,11 +1592,19 @@ void __msan_unpoison_string(const char* 
-   __msan_unpoison(s, REAL(strlen)(s) + 1);
- }
-+#if SANITIZER_NETBSD
-+INTERCEPTOR(void, __libc_thr_keycreate, void *m, void (*dtor)(void *value)) \
-+  ALIAS(WRAPPER_NAME(pthread_key_create));
-+#endif
-+
- namespace __msan {
+@@ -1531,6 +1603,9 @@ namespace __msan {
  void InitializeInterceptors() {
    static int inited = 0;
    CHECK_EQ(inited, 0);
@@ -277,71 +141,11 @@ $NetBSD$
    InitializeCommonInterceptors();
    InitializeSignalInterceptors();
  
-@@ -1496,7 +1612,7 @@ void InitializeInterceptors() {
-   MSAN_MAYBE_INTERCEPT_MMAP64;
-   INTERCEPT_FUNCTION(posix_memalign);
-   MSAN_MAYBE_INTERCEPT_MEMALIGN;
--  INTERCEPT_FUNCTION(__libc_memalign);
-+  MSAN_MAYBE_INTERCEPT___LIBC_MEMALIGN;
-   INTERCEPT_FUNCTION(valloc);
-   MSAN_MAYBE_INTERCEPT_PVALLOC;
-   INTERCEPT_FUNCTION(malloc);
-@@ -1504,7 +1620,7 @@ void InitializeInterceptors() {
-   INTERCEPT_FUNCTION(realloc);
-   INTERCEPT_FUNCTION(free);
-   MSAN_MAYBE_INTERCEPT_CFREE;
--  INTERCEPT_FUNCTION(malloc_usable_size);
-+  MSAN_MAYBE_INTERCEPT_MALLOC_USABLE_SIZE;
-   MSAN_MAYBE_INTERCEPT_MALLINFO;
-   MSAN_MAYBE_INTERCEPT_MALLOPT;
-   MSAN_MAYBE_INTERCEPT_MALLOC_STATS;
-@@ -1512,18 +1628,18 @@ void InitializeInterceptors() {
-   MSAN_MAYBE_INTERCEPT_FREAD_UNLOCKED;
-   INTERCEPT_FUNCTION(readlink);
-   INTERCEPT_FUNCTION(memccpy);
--  INTERCEPT_FUNCTION(mempcpy);
-+  MSAN_MAYBE_INTERCEPT_MEMPCPY;
-   INTERCEPT_FUNCTION(bcopy);
-   INTERCEPT_FUNCTION(wmemset);
-   INTERCEPT_FUNCTION(wmemcpy);
--  INTERCEPT_FUNCTION(wmempcpy);
-+  MSAN_MAYBE_INTERCEPT_WMEMPCPY;
-   INTERCEPT_FUNCTION(wmemmove);
-   INTERCEPT_FUNCTION(strcpy);  // NOLINT
--  INTERCEPT_FUNCTION(stpcpy);  // NOLINT
-+  MSAN_MAYBE_INTERCEPT_STPCPY;  // NOLINT
-   INTERCEPT_FUNCTION(strdup);
-   MSAN_MAYBE_INTERCEPT___STRDUP;
-   INTERCEPT_FUNCTION(strncpy);  // NOLINT
--  INTERCEPT_FUNCTION(gcvt);
-+  MSAN_MAYBE_INTERCEPT_GCVT;
-   INTERCEPT_FUNCTION(strcat);  // NOLINT
-   INTERCEPT_FUNCTION(strncat);  // NOLINT
-   INTERCEPT_STRTO(strtod);
-@@ -1568,7 +1684,7 @@ void InitializeInterceptors() {
-   INTERCEPT_FUNCTION(setenv);
-   INTERCEPT_FUNCTION(putenv);
-   INTERCEPT_FUNCTION(gettimeofday);
--  INTERCEPT_FUNCTION(fcvt);
-+  MSAN_MAYBE_INTERCEPT_FCVT;
-   MSAN_MAYBE_INTERCEPT___FXSTAT;
-   MSAN_INTERCEPT_FSTATAT;
-   MSAN_MAYBE_INTERCEPT___FXSTAT64;
-@@ -1598,12 +1714,17 @@ void InitializeInterceptors() {
-   INTERCEPT_FUNCTION(pthread_key_create);
+@@ -1646,6 +1721,7 @@ void InitializeInterceptors() {
    INTERCEPT_FUNCTION(pthread_join);
    INTERCEPT_FUNCTION(tzset);
 +  INTERCEPT_FUNCTION(atexit);
    INTERCEPT_FUNCTION(__cxa_atexit);
    INTERCEPT_FUNCTION(shmat);
    INTERCEPT_FUNCTION(fork);
-   INTERCEPT_FUNCTION(openpty);
-   INTERCEPT_FUNCTION(forkpty);
-+#if SANITIZER_NETBSD
-+  INTERCEPT_FUNCTION(__libc_thr_keycreate);
-+#endif
-+
-   inited = 1;
- }
- } // namespace __msan
index 005932a442a8bcdace224556d4dbae7853ff4e97..6114cf5a6ff48003baf00bbbd0eeae9a867ae01b 100644 (file)
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- lib/scudo/scudo_platform.h.orig    2017-12-04 19:21:19.000545599 +0000
+--- lib/scudo/scudo_platform.h.orig    2017-12-04 19:21:19.000000000 +0000
 +++ lib/scudo/scudo_platform.h
 @@ -16,7 +16,7 @@
  
index a19138781150429b1357759231425cf152259cdd..bee3a4975789b4273deda0fc7ab4e4139ee65d06 100644 (file)
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- test/scudo/lit.cfg.orig    2017-12-04 19:21:18.810731391 +0000
+--- test/scudo/lit.cfg.orig    2017-12-04 19:21:18.000000000 +0000
 +++ test/scudo/lit.cfg
 @@ -26,9 +26,11 @@ c_flags = ([config.target_cflags] +
             "-pie",