Stephen Schiffli
2012-Aug-08 19:04 UTC
[LLVMdev] clang thread-local compilation error on windows
Hello, I am trying to compile some code to LLVM IR with a simple "__thread int x" but hitting this error: test.cpp:1:1: error: thread-local storage is unsupported for the current target I'm using both the -S and -emit-llvm options on clang, and was expecting to see "@x = thread_local global i32 0" come out of clang. I am curious why clang even cares about this since its my understanding it woud just attach thread_local to the declaration and then allow me to handle it later on in llc to do the actual traget specific implementation. Can someone help clear where the thread-local implementation should go? Thanks, -Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120808/2f811fe2/attachment.html>
Michael Spencer
2012-Aug-08 20:02 UTC
[LLVMdev] clang thread-local compilation error on windows
On Wed, Aug 8, 2012 at 12:04 PM, Stephen Schiffli <sschiffli at gmail.com> wrote:> Hello, I am trying to compile some code to LLVM IR with a simple "__thread > int x" but hitting this error: > test.cpp:1:1: error: thread-local storage is unsupported for the current > target > > I'm using both the -S and -emit-llvm options on clang, and was expecting to > see "@x = thread_local global i32 0" come out of clang. > > I am curious why clang even cares about this since its my understanding it > woud just attach thread_local to the declaration and then allow me to handle > it later on in llc to do the actual traget specific implementation. Can > someone help clear where the thread-local implementation should go? > > Thanks, > -StephenIt's saying this because it knows that LLVM doesn't support thread local storage on Windows. Although I believe this has changed recently. The reason clang is reporting it is because in general it is nicer for a user to get a nice diagnostic from clang instead of an assert from inside codegen. - Michael Spencer