Commit 48326cfb authored by Austin Seipp's avatar Austin Seipp

Fix iOS build (fallout from 28b031c5)

As Luke Iannini reported, the Clang iOS cross compiler apparently
doesn't support __thread for some bizarre reason, so unfortunately they
too must fall back to pthread_{get,set}specific.
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 9f58ceca
......@@ -53,8 +53,11 @@ extern StgWord8 the_gc_thread[];
/* Now, llvm-gcc and some older Clang compilers do not support
__thread. So we have to fallback to the extremely slow case,
unfortunately. Note: clang_CC_FLAVOR implies llvm_CC_FLAVOR */
#if defined(llvm_CC_FLAVOR) && (CC_SUPPORTS_TLS == 0)
unfortunately. Note: clang_CC_FLAVOR implies llvm_CC_FLAVOR.
Also, the iOS Clang compiler doesn't support __thread either for
some bizarre reason, so there's not much we can do about that... */
#if (defined(llvm_CC_FLAVOR) && (CC_SUPPORTS_TLS == 0)) || defined(ios_HOST_OS)
#define gct ((gc_thread *)(pthread_getspecific(gctKey)))
#define SET_GCT(to) (pthread_setspecific(gctKey, to))
#define DECLARE_GCT ThreadLocalKey gctKey;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment