[LLVMbugs] [Bug 19232] New: Thread-local storage is unsupported for the current target (iOS)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Mar 23 16:50:10 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19232

            Bug ID: 19232
           Summary: Thread-local storage is unsupported for the current
                    target (iOS)
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: engineering at wukix.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Hello,

When targeting iOS with clang using the _Thread_local or __thread declarations
I get the error "Thread-local storage is unsupported for the current target".
It works fine when targeting OS X.

Example code:
(in foo.c)
#include <stdio.h>

__thread int foo;

Having this would be very valuable for mocl (https://wukix.com/mocl) and I
suspect other languages targeting iOS as well. e.g.
http://forum.dlang.org/thread/m2d2k79zsl.fsf@comcast.net?page=3
"D (also the runtime) relies fairly heavily on thread-local storage
support. LLVM provides an easy way of creating TLS variables via the
thread_local attribute, but support for that is not available on all
target platforms – and it seems that Darwin/ARM is one of them (they
work on Linux resp. glibc)."

I could go down the road of using the pthread functions for TLS, but this would
involve a lot of re-engineering. Having a simple declaration like __thread
allows me to port global variables designed for a single thread into a
multi-threaded context without causing a lot of breakage.

Curious what can be done to get this working on iOS? Willing to put in some
(limited) effort if you can point me in the right direction.

Wes Henderson
Wukix, Inc.
https://wukix.com

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140323/8a6ccfad/attachment.html>


More information about the llvm-bugs mailing list