pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Sync patches with local copy



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Fri Oct 20 13:18:27 2017 +0200
Changeset:	29d0c013977d7fb42091d33f30aea15b7bac66db

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
Added Files:
	compiler-rt-netbsd/patches/patch-lib_msan_msan.h
	compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc
	compiler-rt-netbsd/patches/patch-lib_msan_msan__linux.cc
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
	compiler-rt-netbsd/patches/patch-test_msan_lit.cfg

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

Adds stub for msan.

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=29d0c013977d7fb42091d33f30aea15b7bac66db

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

diffstat:
 compiler-rt-netbsd/distinfo                        |   9 +-
 .../patches/patch-cmake_config-ix.cmake            |  13 +-
 compiler-rt-netbsd/patches/patch-lib_msan_msan.h   |  13 ++
 .../patches/patch-lib_msan_msan__interceptors.cc   | 175 +++++++++++++++++++++
 .../patches/patch-lib_msan_msan__linux.cc          |  24 +++
 ...zer__common_sanitizer__common__interceptors.inc |   2 +-
 ...__common_sanitizer__platform__limits__netbsd.cc |  13 ++
 compiler-rt-netbsd/patches/patch-test_msan_lit.cfg |  13 ++
 8 files changed, 256 insertions(+), 6 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index ff339f0ea8..8159bcc928 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -1,10 +1,14 @@
 $NetBSD: distinfo,v 1.35 2015/09/11 01:21:57 tnn Exp $
 
-SHA1 (patch-cmake_config-ix.cmake) = 5b1842f08cc8c2b96e0529b552b09c7adf2065dc
+SHA1 (patch-cmake_config-ix.cmake) = a1814db3e044ce3954655fea1e157a96bfa8df2f
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = eaffd9f8f2621ad465b5c734a764bdff0243af3d
-SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 297a3c995a3df644e515dda2856f0784e6e96a62
+SHA1 (patch-lib_msan_msan.h) = 5fefdf22e43c9c9a3cee8f9038bf21d8ba786da0
+SHA1 (patch-lib_msan_msan__interceptors.cc) = 57f1bc2f486aa346cf6ef12d5c4ca145f165df90
+SHA1 (patch-lib_msan_msan__linux.cc) = e38786bff9cde3de0a84614f757888f249fea905
+SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = f46dd7dcbe63fb39ed50696bf4bbb4eea1ef8f19
 SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = f5825b7081758e07e36dbd47a887f31a20912a83
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 25cba9ff9d61910bb74d500e515da083af4e6cb7
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = 46f00f0eee984ac395f4418eae0fa75efd4895b2
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = ce1a3cbb60b81ae67a3242eb96f8d277a1fad059
 SHA1 (patch-lib_sanitizer__common_sanitizer__thread__registry.cc) = ab0bccc862443c04ec0e7287bbf8e2632546bb90
 SHA1 (patch-lib_tsan_go_buildgo.sh) = fe64b3389bbf6ae2ddf187df3e0600b2f817f51d
@@ -14,6 +18,7 @@ SHA1 (patch-lib_tsan_rtl_tsan__platform__posix.cc) = ddf48d91100e681f09b7303a379
 SHA1 (patch-lib_tsan_rtl_tsan__rtl.cc) = 8d5938bb27f9d238ceeb09ac1e6e8090b196fdcc
 SHA1 (patch-lib_tsan_rtl_tsan__rtl__amd64.S) = 95591667c23372ceb72334b2ceae800d32574ac6
 SHA1 (patch-lib_tsan_tests_rtl_tsan__test__util__posix.cc) = 302c72dab4fe5a0c94d7de0d728033e616811e5e
+SHA1 (patch-test_msan_lit.cfg) = 29a3a41c4a0c0df72ddde6a4e0c66d73ca1022e0
 SHA1 (patch-test_tsan_lit.cfg) = 001a4025f0542998da209df933359cf929d7631e
 SHA1 (patch-test_tsan_map32bit.cc) = 08886c59b31fb1bc3574ce8c12d2a8194c0b64a1
 SHA1 (patch-test_tsan_strerror__r.cc) = 6f157012b8a3ca80f11380b76c433bddea16c86b
diff --git a/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake b/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
index 174ed54eeb..c914043161 100644
--- a/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
+++ b/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- cmake/config-ix.cmake.orig	2017-08-21 23:23:37.000000000 +0000
+--- cmake/config-ix.cmake.orig	2017-10-17 18:35:43.000000000 +0000
 +++ cmake/config-ix.cmake
-@@ -511,7 +511,7 @@ else()
+@@ -511,28 +511,28 @@ else()
  endif()
  
  if (COMPILER_RT_HAS_SANITIZER_COMMON AND LSAN_SUPPORTED_ARCH AND
@@ -11,7 +11,14 @@ $NetBSD$
    set(COMPILER_RT_HAS_LSAN TRUE)
  else()
    set(COMPILER_RT_HAS_LSAN FALSE)
-@@ -525,14 +525,14 @@ else()
+ endif()
+ 
+ if (COMPILER_RT_HAS_SANITIZER_COMMON AND MSAN_SUPPORTED_ARCH AND
+-    OS_NAME MATCHES "Linux")
++    OS_NAME MATCHES "Linux|NetBSD")
+   set(COMPILER_RT_HAS_MSAN TRUE)
+ else()
+   set(COMPILER_RT_HAS_MSAN FALSE)
  endif()
  
  if (PROFILE_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
diff --git a/compiler-rt-netbsd/patches/patch-lib_msan_msan.h b/compiler-rt-netbsd/patches/patch-lib_msan_msan.h
new file mode 100644
index 0000000000..f00903e1a8
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_msan_msan.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/msan/msan.h.orig	2017-10-20 10:50:29.258053447 +0000
++++ lib/msan/msan.h
+@@ -199,7 +199,7 @@ const MappingDesc kMemoryLayout[] = {
+ #define MEM_TO_SHADOW(mem) (LINEARIZE_MEM((mem)) + 0x100000000000ULL)
+ #define SHADOW_TO_ORIGIN(shadow) (((uptr)(shadow)) + 0x280000000000)
+ 
+-#elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
++#elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64 || SANITIZER_NETBSD
+ 
+ #ifdef MSAN_LINUX_X86_64_OLD_MAPPING
+ // Requries PIE binary and ASLR enabled.
diff --git a/compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc b/compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc
new file mode 100644
index 0000000000..9a357f1bd1
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_msan_msan__interceptors.cc
@@ -0,0 +1,175 @@
+$NetBSD$
+
+--- lib/msan/msan_interceptors.cc.orig	2017-10-20 10:50:46.737765048 +0000
++++ lib/msan/msan_interceptors.cc
+@@ -118,7 +118,7 @@ static void *AllocateFromLocalPool(uptr 
+ #define CHECK_UNPOISONED_STRING(x, n)                           \
+     CHECK_UNPOISONED_STRING_OF_LEN((x), internal_strlen(x), (n))
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(SIZE_T, fread_unlocked, void *ptr, SIZE_T size, SIZE_T nmemb,
+             void *file) {
+   ENSURE_MSAN_INITED();
+@@ -168,7 +168,7 @@ INTERCEPTOR(int, posix_memalign, void **
+   return res;
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(void *, memalign, SIZE_T alignment, SIZE_T size) {
+   GET_MALLOC_STACK_TRACE;
+   return msan_memalign(alignment, size, &stack);
+@@ -196,7 +196,7 @@ INTERCEPTOR(void *, valloc, SIZE_T size)
+   return msan_valloc(size, &stack);
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(void *, pvalloc, SIZE_T size) {
+   GET_MALLOC_STACK_TRACE;
+   return msan_pvalloc(size, &stack);
+@@ -212,7 +212,7 @@ INTERCEPTOR(void, free, void *ptr) {
+   MsanDeallocate(&stack, ptr);
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(void, cfree, void *ptr) {
+   GET_MALLOC_STACK_TRACE;
+   if (!ptr || UNLIKELY(IsInDlsymAllocPool(ptr))) return;
+@@ -227,7 +227,7 @@ INTERCEPTOR(uptr, malloc_usable_size, vo
+   return __sanitizer_get_allocated_size(ptr);
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ // This function actually returns a struct by value, but we can't unpoison a
+ // temporary! The following is equivalent on all supported platforms but
+ // aarch64 (which uses a different register for sret value).  We have a test
+@@ -246,7 +246,7 @@ INTERCEPTOR(void, mallinfo, __sanitizer_
+ #define MSAN_MAYBE_INTERCEPT_MALLINFO
+ #endif
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, mallopt, int cmd, int value) {
+   return -1;
+ }
+@@ -255,7 +255,7 @@ INTERCEPTOR(int, mallopt, int cmd, int v
+ #define MSAN_MAYBE_INTERCEPT_MALLOPT
+ #endif
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(void, malloc_stats, void) {
+   // FIXME: implement, but don't call REAL(malloc_stats)!
+ }
+@@ -308,7 +308,7 @@ INTERCEPTOR(char *, strdup, char *src) {
+   return res;
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(char *, __strdup, char *src) {
+   ENSURE_MSAN_INITED();
+   GET_STORE_STACK_TRACE;
+@@ -473,7 +473,7 @@ INTERCEPTOR(SIZE_T, strftime_l, char *s,
+   INTERCEPTOR_STRFTIME_BODY(char, SIZE_T, strftime_l, s, max, format, tm, loc);
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(SIZE_T, __strftime_l, char *s, SIZE_T max, const char *format,
+             __sanitizer_tm *tm, void *loc) {
+   INTERCEPTOR_STRFTIME_BODY(char, SIZE_T, __strftime_l, s, max, format, tm,
+@@ -495,7 +495,7 @@ INTERCEPTOR(SIZE_T, wcsftime_l, wchar_t 
+                             loc);
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(SIZE_T, __wcsftime_l, wchar_t *s, SIZE_T max, const wchar_t *format,
+             __sanitizer_tm *tm, void *loc) {
+   INTERCEPTOR_STRFTIME_BODY(wchar_t, SIZE_T, __wcsftime_l, s, max, format, tm,
+@@ -614,7 +614,7 @@ INTERCEPTOR(int, putenv, char *string) {
+   return res;
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, __fxstat, int magic, int fd, void *buf) {
+   ENSURE_MSAN_INITED();
+   int res = REAL(__fxstat)(magic, fd, buf);
+@@ -627,7 +627,7 @@ INTERCEPTOR(int, __fxstat, int magic, in
+ #define MSAN_MAYBE_INTERCEPT___FXSTAT
+ #endif
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, __fxstat64, int magic, int fd, void *buf) {
+   ENSURE_MSAN_INITED();
+   int res = REAL(__fxstat64)(magic, fd, buf);
+@@ -640,7 +640,7 @@ INTERCEPTOR(int, __fxstat64, int magic, 
+ #define MSAN_MAYBE_INTERCEPT___FXSTAT64
+ #endif
+ 
+-#if SANITIZER_FREEBSD
++#if SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, fstatat, int fd, char *pathname, void *buf, int flags) {
+   ENSURE_MSAN_INITED();
+   int res = REAL(fstatat)(fd, pathname, buf, flags);
+@@ -659,7 +659,7 @@ INTERCEPTOR(int, __fxstatat, int magic, 
+ # define MSAN_INTERCEPT_FSTATAT INTERCEPT_FUNCTION(__fxstatat)
+ #endif
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, __fxstatat64, int magic, int fd, char *pathname, void *buf,
+             int flags) {
+   ENSURE_MSAN_INITED();
+@@ -706,7 +706,7 @@ INTERCEPTOR(char *, fgets, char *s, int 
+   return res;
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(char *, fgets_unlocked, char *s, int size, void *stream) {
+   ENSURE_MSAN_INITED();
+   char *res = REAL(fgets_unlocked)(s, size, stream);
+@@ -729,7 +729,7 @@ INTERCEPTOR(int, getrlimit, int resource
+   return res;
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, getrlimit64, int resource, void *rlim) {
+   if (msan_init_is_running) return REAL(getrlimit64)(resource, rlim);
+   ENSURE_MSAN_INITED();
+@@ -805,7 +805,7 @@ INTERCEPTOR(int, gethostname, char *name
+   return res;
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, epoll_wait, int epfd, void *events, int maxevents,
+     int timeout) {
+   ENSURE_MSAN_INITED();
+@@ -820,7 +820,7 @@ INTERCEPTOR(int, epoll_wait, int epfd, v
+ #define MSAN_MAYBE_INTERCEPT_EPOLL_WAIT
+ #endif
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(int, epoll_pwait, int epfd, void *events, int maxevents,
+     int timeout, void *sigmask) {
+   ENSURE_MSAN_INITED();
+@@ -909,7 +909,7 @@ INTERCEPTOR(void *, mmap, void *addr, SI
+   return res;
+ }
+ 
+-#if !SANITIZER_FREEBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+ INTERCEPTOR(void *, mmap64, void *addr, SIZE_T length, int prot, int flags,
+             int fd, OFF64_T offset) {
+   ENSURE_MSAN_INITED();
diff --git a/compiler-rt-netbsd/patches/patch-lib_msan_msan__linux.cc b/compiler-rt-netbsd/patches/patch-lib_msan_msan__linux.cc
new file mode 100644
index 0000000000..c0c27831be
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_msan_msan__linux.cc
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- lib/msan/msan_linux.cc.orig	2017-10-20 10:51:37.065317095 +0000
++++ lib/msan/msan_linux.cc
+@@ -9,11 +9,11 @@
+ //
+ // This file is a part of MemorySanitizer.
+ //
+-// Linux- and FreeBSD-specific code.
++// Linux-, NetBSD- and FreeBSD-specific code.
+ //===----------------------------------------------------------------------===//
+ 
+ #include "sanitizer_common/sanitizer_platform.h"
+-#if SANITIZER_FREEBSD || SANITIZER_LINUX
++#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
+ 
+ #include "msan.h"
+ #include "msan_thread.h"
+@@ -213,4 +213,4 @@ void MsanTSDDtor(void *tsd) {
+ 
+ } // namespace __msan
+ 
+-#endif // SANITIZER_FREEBSD || SANITIZER_LINUX
++#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
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 06962803da..c1e75ed1c5 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
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- lib/sanitizer_common/sanitizer_common_interceptors.inc.orig	2017-10-19 13:16:09.802766688 +0000
+--- lib/sanitizer_common/sanitizer_common_interceptors.inc.orig	2017-10-17 18:35:46.000000000 +0000
 +++ lib/sanitizer_common/sanitizer_common_interceptors.inc
 @@ -3795,7 +3795,7 @@ INTERCEPTOR(void, _exit, int status) {
  #define INIT__EXIT
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
new file mode 100644
index 0000000000..2b2f51498c
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc.orig	2017-10-20 11:15:55.418787987 +0000
++++ lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc
+@@ -128,6 +128,8 @@ uptr __sanitizer_in_addr_sz(int af) {
+     return 0;
+ }
+ 
++unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
++
+ int glob_nomatch = GLOB_NOMATCH;
+ int glob_altdirfunc = GLOB_ALTDIRFUNC;
+ 
diff --git a/compiler-rt-netbsd/patches/patch-test_msan_lit.cfg b/compiler-rt-netbsd/patches/patch-test_msan_lit.cfg
new file mode 100644
index 0000000000..5faa6e68ac
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_msan_lit.cfg
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- test/msan/lit.cfg.orig	2017-10-20 11:16:38.634326328 +0000
++++ test/msan/lit.cfg
+@@ -30,7 +30,7 @@ config.substitutions.append( ("%clangxx_
+ config.suffixes = ['.c', '.cc', '.cpp']
+ 
+ # MemorySanitizer 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
+ 
+ # For mips64, mips64el we have forced store_context_size to 1 because these


Home | Main Index | Thread Index | Old Index