_tls_index

I'm doing some experimentation with Clang and LLVM. I can JIT pretty much any C++ code, except code that uses any standard streams library. If I try to compile such code, I get the error
LLVM ERROR: Program used external function '_tls_index' which could not be resolved!
Thing is, I can't seem to find any information on what this symbol is or where it's defined. It doesn't seem to be defined in any of the DLLs in my System32.
Any idea how I can fix this error?
tls stands for thread local storage. I would guess that you need additionally the thread library.
Apparently it's defined in MSVCRT, in tlssup.c, but even including this file directly doesn't seem to satisfy the compiler.
Hm, is it possibly caused by name mangling? I.e. it is expected as c but is compiled as c++ nonetheless (or vice versa)?
Nice catch. I forgot to add the extern "C" around the #include. Thanks.

That works, but now I'm getting an error about _Init_threaded_header, and I can't find that one in the sources or online.
Topic archived. No new replies allowed.