Skip to content

Commit

Permalink
Band-aid fix to stop race conditions in llvm errors
Browse files Browse the repository at this point in the history
This is a big hammer, but should be effective at completely removing a
few issues, including inconsistent error messages and segfaults when
LLVM workers race to report results

LLVM_THREAD_LOCAL has been present in LLVM since 8 months before 3.7
(the earliest supported LLVM version that Rust can use)

Maybe fixes #43402 (third time lucky?)
  • Loading branch information
aidanhs committed Oct 10, 2017
1 parent 911d95b commit 8628d51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rustllvm/RustWrapper.cpp
Expand Up @@ -57,7 +57,7 @@ static AtomicOrdering fromRust(LLVMAtomicOrdering Ordering) {
llvm_unreachable("Invalid LLVMAtomicOrdering value!");
}

static char *LastError;
static LLVM_THREAD_LOCAL char *LastError;

extern "C" LLVMMemoryBufferRef
LLVMRustCreateMemoryBufferWithContentsOfFile(const char *Path) {
Expand Down

0 comments on commit 8628d51

Please sign in to comment.