summaryrefslogtreecommitdiff
path: root/rts/sm/GC.c
diff options
context:
space:
mode:
authorDavid M Peixotto <dmp@rice.edu>2011-06-28 15:31:42 -0500
committerDavid M Peixotto <dmp@rice.edu>2011-10-07 16:48:34 -0500
commitdba7254566b121408e7167200d0223a531b66e8b (patch)
tree0a3bfcb739b35123822cb644db93081b46c54fca /rts/sm/GC.c
parent29a97fded4010bd01aa0a17945c84258e285d421 (diff)
downloadhaskell-dba7254566b121408e7167200d0223a531b66e8b.tar.gz
Enable pthread_getspecific() tls for LLVM compiler
LLVM does not support the __thread attribute for thread local storage and may generate incorrect code for global register variables. We want to allow building the runtime with LLVM-based compilers such as llvm-gcc and clang, particularly for MacOS. This patch changes the gct variable used by the garbage collector to use pthread_getspecific() for thread local storage when an llvm based compiler is used to build the runtime.
Diffstat (limited to 'rts/sm/GC.c')
-rw-r--r--rts/sm/GC.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 2252cfcd63..17d048c1fa 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -1026,7 +1026,7 @@ gcWorkerThread (Capability *cap)
// necessary if we stole a callee-saves register for gct:
saved_gct = gct;
- gct = gc_threads[cap->no];
+ SET_GCT(gc_threads[cap->no]);
gct->id = osThreadId();
stat_gcWorkerThreadStart(gct);