From 53698ace07b01647836da7046f93c3182a9701ec Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Wed, 7 Aug 2019 21:56:43 +0000 Subject: [PATCH 3/3] 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368219 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/asan/asan_posix.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/asan/asan_posix.cc b/lib/asan/asan_posix.cc index f3fbda07a..cb2dab2ec 100644 --- a/lib/asan/asan_posix.cc +++ b/lib/asan/asan_posix.cc @@ -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. -- 2.22.0