From 72c940417aa56bbdc08d6f731b22dfa85d32b630 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Wed, 7 Aug 2019 21:56:43 +0000 Subject: [PATCH] Restrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC The fallback to the alternative implementation of TSD with TLS is only needed for the static version of ASan for NetBSD. The same code cannot be reused for the dynamic version of ASan as TLS breaks and TSD code works. llvm-svn: 368219 --- compiler-rt/lib/asan/asan_posix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/asan/asan_posix.cpp b/compiler-rt/lib/asan/asan_posix.cpp index fab8905b317b..920d216624a3 100644 --- a/compiler-rt/lib/asan/asan_posix.cpp +++ b/compiler-rt/lib/asan/asan_posix.cpp @@ -39,8 +39,8 @@ void AsanOnDeadlySignal(int signo, void *siginfo, void *context) { // ---------------------- TSD ---------------- {{{1 -#if SANITIZER_NETBSD -// Thread Static Data cannot be used in early init on NetBSD. +#if SANITIZER_NETBSD && !ASAN_DYNAMIC +// Thread Static Data cannot be used in early static ASan init on NetBSD. // Reuse the Asan TSD API for compatibility with existing code // with an alternative implementation.