pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Update to SVN r. 346042



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Fri Nov 2 22:30:29 2018 +0100
Changeset:	e6f861c43e6444881300f90569701199d75dff01

Modified Files:
	compiler-rt-netbsd/Makefile
	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
	compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt
Added Files:
	compiler-rt-netbsd/patches/patch-lib_xray_xray__init.cc
	compiler-rt-netbsd/patches/patch-test_xray_TestCases_Posix_fork__basic__logging.cc

Log Message:
compiler-rt-netbsd: Update to SVN r. 346042

Merged upstream:
[PATCH] D54041: Split getpwent and fgetgrent functions in interceptors
[compiler-rt] r346042 - Try to unbreak the build of sanitizers on !NetBSD

Add patches to fix few xray issues.

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

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

diffstat:
 compiler-rt-netbsd/Makefile                        |   2 +-
 compiler-rt-netbsd/distinfo                        |   8 +-
 ...zer__common_sanitizer__common__interceptors.inc | 107 ++-------------------
 ...zer__common_sanitizer__platform__interceptors.h |  20 +---
 .../patches/patch-lib_xray_tests_CMakeLists.txt    |   2 +-
 .../patches/patch-lib_xray_xray__init.cc           |  16 +++
 ...st_xray_TestCases_Posix_fork__basic__logging.cc |  25 +++++
 7 files changed, 61 insertions(+), 119 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/Makefile b/compiler-rt-netbsd/Makefile
index 4abecfa382..43d728c667 100644
--- a/compiler-rt-netbsd/Makefile
+++ b/compiler-rt-netbsd/Makefile
@@ -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=	345774
+SVN_REVISION.compiler-rt=	346042
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=	http://compiler-rt.llvm.org/
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 03aea8c472..8c169145b2 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -7,13 +7,15 @@ SHA1 (patch-lib_fuzzer_FuzzerLoop.cpp) = b2e226a0d7b230cc8598a0591ae6f688527c6b2
 SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = ee809130e36a9157a9bd1c01d45e651b4f2ba26b
 SHA1 (patch-lib_msan_msan__interceptors.cc) = b12404d0dd3ac08c1c6cfeb51c6e28b23b82f770
 SHA1 (patch-lib_msan_msan__linux.cc) = b5df0f4f5930d7c1681b1ad867c893d01d6e5cf7
-SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = d8a3a0398e0fbc99a4d8ff0682aa7ec02a621c0a
+SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 736749f53ea6f51e2eb6650a5c0e336b773581b3
 SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 9475c8018dadbc4d865b52a03e43f9eae2011c3e
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc) = 58a1dea6a852a4de20f23cd90900c387fe555dce
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 48a0178377ff0610913487e1ee7032b198cd0437
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 834f7497726ff8d6cf974a07634e0073d07b5c55
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = 9e4e6625f756f248650f1f17d30b3e0bd6b7559e
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = eb112d60396d34a25ed4d150bf5282bc4265f738
 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_tsan_CMakeLists.txt) = 4d8f8081ff2a3249565df26e67a35b5b3509e0b0
-SHA1 (patch-lib_xray_tests_CMakeLists.txt) = bb52916184d8e829395dd40d6d1b8b7eac40da92
+SHA1 (patch-lib_xray_tests_CMakeLists.txt) = 2030111b5d6b02575544ad3f18cd3fe4c1277f98
+SHA1 (patch-lib_xray_xray__init.cc) = 734a67f9daef2a675a04e5fe3a5ace0b2d38c991
+SHA1 (patch-test_xray_TestCases_Posix_fork__basic__logging.cc) = fb1af8ec67bcd775614050f39e793020bcb280e4
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 64a525a4a5..d29c2e40ed 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	2018-10-30 08:42:09.000000000 +0000
+--- lib/sanitizer_common/sanitizer_common_interceptors.inc.orig	2018-11-02 21:28:35.000460171 +0000
 +++ lib/sanitizer_common/sanitizer_common_interceptors.inc
 @@ -77,6 +77,11 @@
  #define ctime __ctime50
@@ -23,85 +23,7 @@ $NetBSD$
  extern const unsigned short *_ctype_tab_;
  extern const short *_toupper_tab_;
  extern const short *_tolower_tab_;
-@@ -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
-@@ -3062,17 +3081,28 @@ INTERCEPTOR(int, sendmmsg, int fd, struc
+@@ -3077,17 +3084,28 @@ INTERCEPTOR(int, sendmmsg, int fd, struc
  #endif
  
  #if SANITIZER_INTERCEPT_GETPEERNAME
@@ -139,7 +61,7 @@ $NetBSD$
    return res;
  }
  #define INIT_GETPEERNAME COMMON_INTERCEPT_FUNCTION(getpeername);
-@@ -4242,7 +4272,7 @@ INTERCEPTOR(int, fstatfs64, int fd, void
+@@ -4257,7 +4275,7 @@ INTERCEPTOR(int, fstatfs64, int fd, void
  #endif
  
  #if SANITIZER_INTERCEPT_STATVFS
@@ -148,7 +70,7 @@ $NetBSD$
    void *ctx;
    COMMON_INTERCEPTOR_ENTER(ctx, statvfs, path, buf);
    if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
-@@ -4821,6 +4851,14 @@ INTERCEPTOR(float, remquof, float x, flo
+@@ -4836,6 +4854,14 @@ INTERCEPTOR(float, remquof, float x, flo
    if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo));
    return res;
  }
@@ -163,7 +85,7 @@ $NetBSD$
  INTERCEPTOR(long double, remquol, long double x, long double y, int *quo) {
    void *ctx;
    COMMON_INTERCEPTOR_ENTER(ctx, remquol, x, y, quo);
-@@ -4831,12 +4869,10 @@ INTERCEPTOR(long double, remquol, long d
+@@ -4846,12 +4872,10 @@ INTERCEPTOR(long double, remquol, long d
    if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo));
    return res;
  }
@@ -178,7 +100,7 @@ $NetBSD$
  #endif
  
  #if SANITIZER_INTERCEPT_LGAMMA
-@@ -4855,6 +4891,14 @@ INTERCEPTOR(float, lgammaf, float x) {
+@@ -4870,6 +4894,14 @@ INTERCEPTOR(float, lgammaf, float x) {
    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam));
    return res;
  }
@@ -193,7 +115,7 @@ $NetBSD$
  INTERCEPTOR(long double, lgammal, long double x) {
    void *ctx;
    COMMON_INTERCEPTOR_ENTER(ctx, lgammal, x);
-@@ -4862,12 +4906,10 @@ INTERCEPTOR(long double, lgammal, long d
+@@ -4877,12 +4909,10 @@ INTERCEPTOR(long double, lgammal, long d
    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam));
    return res;
  }
@@ -209,7 +131,7 @@ $NetBSD$
  #endif
  
  #if SANITIZER_INTERCEPT_LGAMMA_R
-@@ -7237,6 +7279,1602 @@ INTERCEPTOR(struct __sanitizer_netent *,
+@@ -7252,6 +7282,1602 @@ INTERCEPTOR(struct __sanitizer_netent *,
  #define INIT_NETENT
  #endif
  
@@ -1812,16 +1734,7 @@ $NetBSD$
  static void InitializeCommonInterceptors() {
    static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
    interceptor_metadata_map = new((void *)&metadata_mem) MetadataHashMap();
-@@ -7301,6 +8939,8 @@ static void InitializeCommonInterceptors
-   INIT_GETPWENT;
-   INIT_FGETPWENT;
-   INIT_GETPWENT_R;
-+  INIT_FGETPWENT_R;
-+  INIT_FGETGRENT_R;
-   INIT_SETPWENT;
-   INIT_CLOCK_GETTIME;
-   INIT_GETITIMER;
-@@ -7410,7 +9050,9 @@ static void InitializeCommonInterceptors
+@@ -7427,7 +9053,9 @@ static void InitializeCommonInterceptors
    INIT_PTHREAD_GETNAME_NP;
    INIT_SINCOS;
    INIT_REMQUO;
@@ -1831,7 +1744,7 @@ $NetBSD$
    INIT_LGAMMA_R;
    INIT_LGAMMAL_R;
    INIT_DRAND48_R;
-@@ -7486,6 +9128,30 @@ static void InitializeCommonInterceptors
+@@ -7503,6 +9131,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 547290b1fe..efc7abd8fa 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
@@ -1,22 +1,8 @@
 $NetBSD$
 
---- lib/sanitizer_common/sanitizer_platform_interceptors.h.orig	2018-08-21 21:25:40.000000000 +0000
+--- lib/sanitizer_common/sanitizer_platform_interceptors.h.orig	2018-11-02 21:28:35.000953061 +0000
 +++ lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -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 @@
+@@ -360,7 +360,9 @@
  #define SANITIZER_INTERCEPT_TEMPNAM SI_POSIX
  #define SANITIZER_INTERCEPT_SINCOS SI_LINUX || SI_SOLARIS
  #define SANITIZER_INTERCEPT_REMQUO SI_POSIX
@@ -26,7 +12,7 @@ $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 @@
+@@ -515,4 +517,29 @@
  #define SANITIZER_INTERCEPT_PROTOENT SI_NETBSD
  #define SANITIZER_INTERCEPT_NETENT SI_NETBSD
  
diff --git a/compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt b/compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt
index 236cad85e4..9d1155c570 100644
--- a/compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt
+++ b/compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- lib/xray/tests/CMakeLists.txt.orig	2018-10-01 21:40:24.000000000 +0000
+--- lib/xray/tests/CMakeLists.txt.orig	2018-11-02 21:28:34.413617931 +0000
 +++ lib/xray/tests/CMakeLists.txt
 @@ -70,6 +70,7 @@ if (NOT APPLE)
      list(APPEND XRAY_UNITTEST_LINK_FLAGS -lLLVMXRay -lLLVMSupport -lLLVMTestingSupport)
diff --git a/compiler-rt-netbsd/patches/patch-lib_xray_xray__init.cc b/compiler-rt-netbsd/patches/patch-lib_xray_xray__init.cc
new file mode 100644
index 0000000000..5c79423f77
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_xray_xray__init.cc
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- lib/xray/xray_init.cc.orig	2018-09-26 10:51:27.000000000 +0000
++++ lib/xray/xray_init.cc
+@@ -106,8 +106,8 @@ __attribute__((section(".preinit_array")
+ #else
+ // If we cannot use the .preinit_array section, we should instead use dynamic
+ // initialisation.
+-static bool UNUSED __local_xray_dyninit = [] {
++__attribute__ ((constructor (0)))
++static void __local_xray_dyninit() {
+   __xray_init();
+-  return true;
+-}();
++}
+ #endif
diff --git a/compiler-rt-netbsd/patches/patch-test_xray_TestCases_Posix_fork__basic__logging.cc b/compiler-rt-netbsd/patches/patch-test_xray_TestCases_Posix_fork__basic__logging.cc
new file mode 100644
index 0000000000..c2be325b88
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-test_xray_TestCases_Posix_fork__basic__logging.cc
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- test/xray/TestCases/Posix/fork_basic_logging.cc.orig	2018-08-21 21:25:31.000000000 +0000
++++ test/xray/TestCases/Posix/fork_basic_logging.cc
+@@ -15,14 +15,20 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdint.h>
++#if !defined(__NetBSD__)
+ #include <sys/syscall.h>
++#endif
+ 
+ //modified from sanitizer
+ 
+ static uintptr_t syscall_gettid() {
+   uint64_t retval;
++#if defined(__NetBSD__)
++  retval = getpid();
++#else
+   asm volatile("syscall" : "=a"(retval) : "a"(__NR_gettid) : "rcx", "r11",
+                "memory", "cc");
++#endif
+   return retval;
+ }
+ 


Home | Main Index | Thread Index | Old Index