From 092068cd7429659138d6779a3072298462ad3e9c 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 ca99c04b3..2d5118d7c 100644 --- a/lib/asan/asan_posix.cc +++ b/lib/asan/asan_posix.cc @@ -40,8 +40,8 @@ void AsanOnDeadlySignal(int signo, void *siginfo, void *context) { // ---------------------- TSD ---------------- {{{1 -#if SANITIZER_NETBSD || SANITIZER_FREEBSD -// Thread Static Data cannot be used in early init on NetBSD and FreeBSD. +#if (SANITIZER_NETBSD && !ASAN_DYNAMIC) || SANITIZER_FREEBSD +// 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