[PATCH] D55596: Reimplement Thread Static Data ASan routines with TLS

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 01:10:35 PST 2018


krytarowski marked an inline comment as done.
krytarowski added a comment.

In D55596#1335345 <https://reviews.llvm.org/D55596#1335345>, @devnexen wrote:

> >>> Please test Linux and Darwin too.
> >> 
> >> Ok throwing a Linux's test but Darwin will have to wait couple of hours unless another Apple's folk is faster :-)
>
>
>
> > Hmm, maybe c++ abi handling difference. Keeping there just NetBSD and FreeBSD is fine too.
>
> Sorry I redid a full build and finally there is an issue 
>  `thread-local storage is not supported for the current target` changing to THREADLOCAL won t fix it.


THREADLOCAL evaluates to __thread and it does not support TLS destructors.

It must use C++11 thread_local.

> `thread-local storage is not supported for the current target`

C++11 thread_local not supported for FreeBSD?



================
Comment at: lib/asan/asan_posix.cc:49
+static bool tsd_key_inited = false;
+static void (*tsd_destructor)(void *tsd) = nullptr;
+
----------------
vitalybuka wrote:
> tsd_key_inited is redundant here?
It serves just as an additional assert, I can drop it.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55596/new/

https://reviews.llvm.org/D55596





More information about the llvm-commits mailing list