 -    SANITIZER_LINUX && !SANITIZER_ANDROID
 +    SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
  // sizeof(struct pthread) from glibc.
- static atomic_uintptr_t kThreadDescriptorSize;
- 
-@@ -402,7 +402,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) {
+ static atomic_uintptr_t thread_descriptor_size;
+ 
+@@ -398,7 +398,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) {
  
  #if !SANITIZER_GO
  static void GetTls(uptr *addr, uptr *size) {

+#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD && !SANITIZER_NONGNU
 
 #include "msan.h"
 #include "msan_thread.h"
@@ -26,7 +26,6 @@
 #include <signal.h>
 #include <unistd.h>
 #include <unwind.h>

 
 #if SANITIZER_LINUX && (!defined(__ANDROID__) || __ANDROID_API__ >= 21)
 CHECK_TYPE_SIZE(mmsghdr);
@@ -1144,7 +1148,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
 
 CHECK_TYPE_SIZE(ether_addr);
 
