| author | |
| committer | |
| log | bd9c629c4c306c9159a5e6ad16fe5637d2bc6dbf |
| tree | f7f07bc1a38c20e4ebb77a4e4445b3c73213ff33 |
| parent | 8cda4fd73a91e7bd678e69dbfbc0b46d15d116d4 |
| signature |
Previously if you had, for example:
extern "c" threadlocal var errno: c_int;
This would turn errno into a normal variable for --single-threaded
builds. However for variables with external linkage, there is an ABI
to uphold.
This is needed to make errno work for DragonFly BSD. See #2381.1 files changed, 1 insertions(+), 1 deletions(-)
src/codegen.cpp+1-1| ... | ... | @@ -6639,7 +6639,7 @@ static void validate_inline_fns(CodeGen *g) { |
| 6639 | 6639 | } |
| 6640 | 6640 | |
| 6641 | 6641 | static void set_global_tls(CodeGen *g, ZigVar *var, LLVMValueRef global_value) { |
| 6642 | if (var->is_thread_local && !g->is_single_threaded) { | |
| 6642 | if (var->is_thread_local && (!g->is_single_threaded || var->linkage != VarLinkageInternal)) { | |
| 6643 | 6643 | LLVMSetThreadLocalMode(global_value, LLVMGeneralDynamicTLSModel); |
| 6644 | 6644 | } |
| 6645 | 6645 | } |