Skip to content

Commit

Permalink
Fix iOS build (fallout from 28b031c)
Browse files Browse the repository at this point in the history
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: Austin Seipp <austin@well-typed.com>
  • Loading branch information
Austin Seipp committed Jan 30, 2014
1 parent 9f58cec commit 48326cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rts/sm/GCTDecl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 48326cf

Please sign in to comment.