From: Fangrui Song Date: Sun, 18 Apr 2021 17:42:43 +0000 (-0700) Subject: [sanitizer] Don't call __tls_get_addr on s390x after D98926 X-Git-Tag: llvmorg-14-init~9264 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d1d7156e9a9a794ba649b79e27fe448274fd558;p=platform%2Fupstream%2Fllvm.git [sanitizer] Don't call __tls_get_addr on s390x after D98926 glibc s390x doesn't define __tls_get_addr. Fix PR50017 --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp index d5f61e1..f1a0f89 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp @@ -322,11 +322,13 @@ static int CollectStaticTlsBlocks(struct dl_phdr_info *info, size_t size, if (!info->dlpi_tls_modid) return 0; uptr begin = (uptr)info->dlpi_tls_data; +#ifndef __s390__ if (!g_use_dlpi_tls_data) { // Call __tls_get_addr as a fallback. This forces TLS allocation on glibc // and FreeBSD. size_t mod_and_off[2] = {info->dlpi_tls_modid, 0}; begin = (uptr)__tls_get_addr(mod_and_off); +#endif } for (unsigned i = 0; i != info->dlpi_phnum; ++i) if (info->dlpi_phdr[i].p_type == PT_TLS) {