pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Implement dirfd(3) on NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sun Aug 20 14:13:21 2017 +0200
Changeset:	977313ab973047f32fbef0af185189a7895861d7

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_tsan_rtl_tsan__interceptors.cc

Log Message:
compiler-rt-netbsd: Implement dirfd(3) on NetBSD

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=977313ab973047f32fbef0af185189a7895861d7

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

diffstat:
 compiler-rt-netbsd/distinfo                        |  2 +-
 .../patch-lib_tsan_rtl_tsan__interceptors.cc       | 26 +++++++++++++---------
 2 files changed, 16 insertions(+), 12 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index f10051e207..e5385190d3 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -70,7 +70,7 @@ SHA1 (patch-lib_fuzzer_tests_FuzzerUnittest.cpp) = d2c25d452c1bdda4274196784e4fb
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc) = 36a89517584891a1a50536a681a5d42e99ef904d
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 89302e7b40901faaa471cdd76eefa222a0cc055d
 SHA1 (patch-lib_tsan_go_buildgo.sh) = fe64b3389bbf6ae2ddf187df3e0600b2f817f51d
-SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = d3643d5b3a787dba1b5585856449be6b1c02b607
+SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 557018c2dce673756215ebf9f1564866df555444
 SHA1 (patch-lib_tsan_rtl_tsan__platform__linux.cc) = 4269acd5ea1d1f448fb9a7a31def2f84a03b27da
 SHA1 (patch-lib_tsan_rtl_tsan__rtl__amd64.S) = 95591667c23372ceb72334b2ceae800d32574ac6
 SHA1 (patch-lib_tsan_tests_rtl_tsan__test__util__posix.cc) = 302c72dab4fe5a0c94d7de0d728033e616811e5e
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 bd10b9dae2..430e6f22ad 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
@@ -2,11 +2,12 @@ $NetBSD$
 
 --- lib/tsan/rtl/tsan_interceptors.cc.orig	2017-08-03 21:24:38.000000000 +0000
 +++ lib/tsan/rtl/tsan_interceptors.cc
-@@ -39,6 +39,12 @@ using namespace __tsan;  // NOLINT
+@@ -39,6 +39,13 @@ using namespace __tsan;  // NOLINT
  #define stderr __stderrp
  #endif
  
 +#if SANITIZER_NETBSD
++#define dirfd(dirp) (*(int*)(dirp))
 +#define fileno_unlocked fileno
 +#define stdout __sF[1]
 +#define stderr __sF[2]
@@ -15,11 +16,14 @@ $NetBSD$
  #if SANITIZER_ANDROID
  #define mallopt(a, b)
  #endif
-@@ -85,18 +91,22 @@ extern "C" void *pthread_self();
+@@ -84,19 +91,25 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free,
+ extern "C" void *pthread_self();
  extern "C" void _exit(int status);
  extern "C" int fileno_unlocked(void *stream);
++#if !SANITIZER_NETBSD
  extern "C" int dirfd(void *dirp);
 -#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID
++#endif
 +#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_NETBSD
  extern "C" int mallopt(int param, int value);
  #endif
@@ -41,7 +45,7 @@ $NetBSD$
  const int EPOLL_CTL_ADD = 1;
  #endif
  const int SIGILL = 4;
-@@ -105,7 +115,7 @@ const int SIGFPE = 8;
+@@ -105,7 +118,7 @@ const int SIGFPE = 8;
  const int SIGSEGV = 11;
  const int SIGPIPE = 13;
  const int SIGTERM = 15;
@@ -50,7 +54,7 @@ $NetBSD$
  const int SIGBUS = 10;
  const int SIGSYS = 12;
  #else
-@@ -113,7 +123,9 @@ const int SIGBUS = 7;
+@@ -113,7 +126,9 @@ const int SIGBUS = 7;
  const int SIGSYS = 31;
  #endif
  void *const MAP_FAILED = (void*)-1;
@@ -61,7 +65,7 @@ $NetBSD$
  const int PTHREAD_BARRIER_SERIAL_THREAD = -1;
  #endif
  const int MAP_FIXED = 0x10;
-@@ -138,6 +150,15 @@ struct sigaction_t {
+@@ -138,6 +153,15 @@ struct sigaction_t {
    __sanitizer_sigset_t sa_mask;
    void (*sa_restorer)();
  };
@@ -77,7 +81,7 @@ $NetBSD$
  #else
  struct sigaction_t {
  #ifdef __mips__
-@@ -166,7 +187,7 @@ struct sigaction_t {
+@@ -166,7 +190,7 @@ struct sigaction_t {
  const sighandler_t SIG_DFL = (sighandler_t)0;
  const sighandler_t SIG_IGN = (sighandler_t)1;
  const sighandler_t SIG_ERR = (sighandler_t)-1;
@@ -86,7 +90,7 @@ $NetBSD$
  const int SA_SIGINFO = 0x40;
  const int SIG_SETMASK = 3;
  #elif defined(__mips__)
-@@ -282,7 +303,7 @@ void ScopedInterceptor::DisableIgnores()
+@@ -282,7 +306,7 @@ void ScopedInterceptor::DisableIgnores()
  }
  
  #define TSAN_INTERCEPT(func) INTERCEPT_FUNCTION(func)
@@ -95,7 +99,7 @@ $NetBSD$
  # define TSAN_INTERCEPT_VER(func, ver) INTERCEPT_FUNCTION(func)
  #else
  # define TSAN_INTERCEPT_VER(func, ver) INTERCEPT_FUNCTION_VER(func, ver)
-@@ -459,7 +480,7 @@ static void SetJmp(ThreadState *thr, upt
+@@ -459,7 +483,7 @@ static void SetJmp(ThreadState *thr, upt
  static void LongJmp(ThreadState *thr, uptr *env) {
  #ifdef __powerpc__
    uptr mangled_sp = env[0];
@@ -104,7 +108,7 @@ $NetBSD$
    uptr mangled_sp = env[2];
  #elif SANITIZER_MAC
  # ifdef __aarch64__
-@@ -1345,7 +1366,7 @@ TSAN_INTERCEPTOR(int, __fxstat, int vers
+@@ -1345,7 +1369,7 @@ TSAN_INTERCEPTOR(int, __fxstat, int vers
  #endif
  
  TSAN_INTERCEPTOR(int, fstat, int fd, void *buf) {
@@ -113,7 +117,7 @@ $NetBSD$
    SCOPED_TSAN_INTERCEPTOR(fstat, fd, buf);
    if (fd > 0)
      FdAccess(thr, pc, fd);
-@@ -1926,7 +1947,7 @@ TSAN_INTERCEPTOR(int, sigaction, int sig
+@@ -1926,7 +1950,7 @@ TSAN_INTERCEPTOR(int, sigaction, int sig
    sigactions[sig].sa_flags = *(volatile int*)&act->sa_flags;
    internal_memcpy(&sigactions[sig].sa_mask, &act->sa_mask,
        sizeof(sigactions[sig].sa_mask));
@@ -122,7 +126,7 @@ $NetBSD$
    sigactions[sig].sa_restorer = act->sa_restorer;
  #endif
    sigaction_t newact;
-@@ -2288,7 +2309,7 @@ struct ScopedSyscall {
+@@ -2288,7 +2312,7 @@ struct ScopedSyscall {
    }
  };
  


Home | Main Index | Thread Index | Old Index