diff --git a/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc b/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc index 45c9d44d96c8..63bae2bd2e5a 100644 --- a/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc +++ b/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc @@ -36,6 +36,13 @@ using namespace __tsan; // NOLINT #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 @@ extern "C" void __libc_free(void *ptr); #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 --git a/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc b/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc index 32591316ea22..d7841d784b31 100644 --- a/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc +++ b/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cc @@ -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 @@ static void CheckAndProtect() { 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 @@ int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m, } // namespace __tsan -#endif // SANITIZER_LINUX || SANITIZER_FREEBSD +#endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD