[commit: ghc] master: Fix iOS build (fallout from 28b031c506) (48326cf)

git at git.haskell.org git at git.haskell.org
Thu Jan 30 13:25:11 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/48326cfb1ef4b455f81fbbece7a17dab17f7c932/ghc

>---------------------------------------------------------------

commit 48326cfb1ef4b455f81fbbece7a17dab17f7c932
Author: Austin Seipp <austin at well-typed.com>
Date:   Thu Jan 30 07:03:29 2014 -0600

    Fix iOS build (fallout from 28b031c506)
    
    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 at well-typed.com>


>---------------------------------------------------------------

48326cfb1ef4b455f81fbbece7a17dab17f7c932
 rts/sm/GCTDecl.h |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/rts/sm/GCTDecl.h b/rts/sm/GCTDecl.h
index affb852..2489430 100644
--- a/rts/sm/GCTDecl.h
+++ b/rts/sm/GCTDecl.h
@@ -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;



More information about the ghc-commits mailing list