Source-Changes-HG archive

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

[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer/tsan small progress.



details:   https://anonhg.NetBSD.org/src/rev/86073c623347
branches:  trunk
changeset: 345864:86073c623347
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jun 11 23:10:01 2016 +0000

description:
small progress.

diffstat:

 external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc   |  11 ++++++++++
 external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc |   6 ++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (56 lines):

diff -r 6c3d0f6be1b1 -r 86073c623347 external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc
--- a/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc     Sat Jun 11 20:45:07 2016 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc     Sat Jun 11 23:10:01 2016 +0000
@@ -36,6 +36,13 @@
 #define stdout __stdoutp
 #define stderr __stderrp
 #endif
+#if SANITIZER_NETBSD
+#define        __errno_location __errno
+#define        pthread_yield sched_yield
+#define        fileno_unlocked fileno
+#define        stdout __sF[1]
+#define        stderr __sF[2]
+#endif
 
 const int kSigCount = 65;
 
@@ -73,7 +80,11 @@
 #if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
 extern "C" int mallopt(int param, int value);
 #endif
+#if SANITIZER_NETBSD
+extern __sanitizer_FILE **__sF;
+#else
 extern __sanitizer_FILE *stdout, *stderr;
+#endif
 const int PTHREAD_MUTEX_RECURSIVE = 1;
 const int PTHREAD_MUTEX_RECURSIVE_NP = 1;
 const int EINVAL = 22;
diff -r 6c3d0f6be1b1 -r 86073c623347 external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc
--- a/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc   Sat Jun 11 20:45:07 2016 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc   Sat Jun 11 23:10:01 2016 +0000
@@ -12,7 +12,7 @@
 
 
 #include "sanitizer_common/sanitizer_platform.h"
-#if SANITIZER_LINUX || SANITIZER_FREEBSD
+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
 
 #include "sanitizer_common/sanitizer_common.h"
 #include "sanitizer_common/sanitizer_libc.h"
@@ -316,7 +316,7 @@
     if (p >= 0xf000000000000000ull)  // vdso
       break;
     Printf("FATAL: ThreadSanitizer: unexpected memory mapping %p-%p\n", p, end);
-    Die();
+//    Die();
   }
 
   ProtectRange(kLoAppMemEnd, kShadowBeg);
@@ -423,4 +423,4 @@
 
 }  // namespace __tsan
 
-#endif  // SANITIZER_LINUX || SANITIZER_FREEBSD
+#endif  // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD



Home | Main Index | Thread Index | Old Index