diff options
Diffstat (limited to 'rts/Task.h')
-rw-r--r-- | rts/Task.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rts/Task.h b/rts/Task.h index 424af607ea..4000a045d4 100644 --- a/rts/Task.h +++ b/rts/Task.h @@ -241,14 +241,21 @@ void interruptWorkerTask (Task *task); // A thread-local-storage key that we can use to get access to the // current thread's Task structure. #if defined(THREADED_RTS) -#if (defined(linux_HOST_OS) && \ +#if ((defined(linux_HOST_OS) && \ (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH))) || \ - (defined(mingw32_HOST_OS) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4) + (defined(mingw32_HOST_OS) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4)) && \ + (!defined(llvm_CC_FLAVOR)) #define MYTASK_USE_TLV extern __thread Task *my_task; #else extern ThreadLocalKey currentTaskKey; #endif +// LLVM-based compilers do not upport the __thread attribute, so we need +// to store the gct variable as a pthread local storage. We declare the +// key here to keep thread local storage initialization in the same place. +#if defined(llvm_CC_FLAVOR) +extern ThreadLocalKey gctKey; +#endif #else extern Task *my_task; #endif |