Skip to content

Commit 9ec1f65

Browse files
committed
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 c21909a.
1 parent 83bb731 commit 9ec1f65

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ void InitTlsSize() {
237237
((void (*)(size_t *, size_t *))get_tls_static_info)(&g_tls_size, &tls_align);
238238
# endif
239239
}
240+
# else
241+
void InitTlsSize() {}
242+
# endif // SANITIZER_GLIBC && !SANITIZER_GO
240243

241244
// On glibc x86_64, ThreadDescriptorSize() needs to be precise due to the usage
242245
// of g_tls_size. On other targets, ThreadDescriptorSize() is only used by lsan
243246
// to get the pointer to thread-specific data keys in the thread control block.
247+
# if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_SOLARIS) && \
248+
!SANITIZER_ANDROID && !SANITIZER_GO
244249
// sizeof(struct pthread) from glibc.
245250
static atomic_uintptr_t thread_descriptor_size;
246251

@@ -458,9 +463,8 @@ __attribute__((unused)) static void GetStaticTlsBoundary(uptr *addr, uptr *size,
458463
*addr = ranges[l].begin;
459464
*size = ranges[r - 1].end - ranges[l].begin;
460465
}
461-
# else
462-
void InitTlsSize() {}
463-
# endif // SANITIZER_GLIBC && !SANITIZER_GO
466+
# endif // (x86_64 || i386 || mips || ...) && (SANITIZER_FREEBSD ||
467+
// SANITIZER_LINUX) && !SANITIZER_ANDROID && !SANITIZER_GO
464468

465469
# if SANITIZER_NETBSD
466470
static struct tls_tcb *ThreadSelfTlsTcb() {

0 commit comments

Comments
 (0)