 +#if SANITIZER_FREEBSD || (SANITIZER_LINUX && !SANITIZER_NONGNU) || SANITIZER_NETBSD
  
  #include "msan.h"
- #include "msan_thread.h"
+ #include "msan_report.h"
 diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc
-index fc4f7a75a..76cf4f769 100644
+index 6bfd5e5ee..048f6154f 100644
 --- a/lib/sanitizer_common/sanitizer_allocator.cc
 +++ b/lib/sanitizer_common/sanitizer_allocator.cc
-@@ -23,7 +23,7 @@ namespace __sanitizer {
+@@ -27,7 +27,7 @@ const char *SecondaryAllocatorName = "LargeMmapAllocator";
  
  // ThreadSanitizer for Go uses libc malloc/free.
  #if SANITIZER_GO || defined(SANITIZER_USE_MALLOC)

+# define SANITIZER_NONGNU 0
+#endif
+
 // By default we allow to use SizeClassAllocator64 on 64-bit platform.
 // But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64
 // does not work well and we need to fallback to SizeClassAllocator32.
diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
index b99ac4480..628d226a1 100644
--- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -38,7 +38,7 @@
 # include "sanitizer_platform_limits_solaris.h"
 #endif
 

From f7a253f8f85d0f49df6b73996737a3e84ac64236 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Mon, 24 Sep 2018 11:17:25 -0500
Subject: [PATCH] Ported to 7.0, taken from gentoo-musl project.

------
Ported to compiler-rt-sanitizers-5.0.0. Taken from
