[compiler-rt] 9ec1f65 - Revert "[NFC][sanitizer] Simplify ifdef"

Rainer Orth via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 11:16:51 PDT 2024


Author: Rainer Orth
Date: 2024-09-16T20:14:54+02:00
New Revision: 9ec1f658144afb8b4117a62a593561a46a64d469

URL: https://github.com/llvm/llvm-project/commit/9ec1f658144afb8b4117a62a593561a46a64d469
DIFF: https://github.com/llvm/llvm-project/commit/9ec1f658144afb8b4117a62a593561a46a64d469.diff

LOG: Revert "[NFC][sanitizer] Simplify ifdef"

Breaks the [Solaris/sparcv9](https://lab.llvm.org/buildbot/#/builders/13/builds/2219) and [Solaris/amd64](https://lab.llvm.org/staging/#/builders/120/builds/1770) builds.

This reverts commit c21909a530f438bcc942c11e6d7b875bb28a028a.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index c6d62a156dec47..92ac1072aaf673 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -237,10 +237,15 @@ void InitTlsSize() {
   ((void (*)(size_t *, size_t *))get_tls_static_info)(&g_tls_size, &tls_align);
 #    endif
 }
+#  else
+void InitTlsSize() {}
+#  endif  // SANITIZER_GLIBC && !SANITIZER_GO
 
 // On glibc x86_64, ThreadDescriptorSize() needs to be precise due to the usage
 // of g_tls_size. On other targets, ThreadDescriptorSize() is only used by lsan
 // to get the pointer to thread-specific data keys in the thread control block.
+#  if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_SOLARIS) && \
+      !SANITIZER_ANDROID && !SANITIZER_GO
 // sizeof(struct pthread) from glibc.
 static atomic_uintptr_t thread_descriptor_size;
 
@@ -458,9 +463,8 @@ __attribute__((unused)) static void GetStaticTlsBoundary(uptr *addr, uptr *size,
   *addr = ranges[l].begin;
   *size = ranges[r - 1].end - ranges[l].begin;
 }
-#  else
-void InitTlsSize() {}
-#  endif  // SANITIZER_GLIBC && !SANITIZER_GO
+#  endif  // (x86_64 || i386 || mips || ...) && (SANITIZER_FREEBSD ||
+          // SANITIZER_LINUX) && !SANITIZER_ANDROID && !SANITIZER_GO
 
 #  if SANITIZER_NETBSD
 static struct tls_tcb *ThreadSelfTlsTcb() {


        


More information about the llvm-commits mailing list