Skip to content

Commit 8628d51

Browse files
committed
Band-aid fix to stop race conditions in llvm errors
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?)
1 parent 911d95b commit 8628d51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rustllvm/RustWrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static AtomicOrdering fromRust(LLVMAtomicOrdering Ordering) {
5757
llvm_unreachable("Invalid LLVMAtomicOrdering value!");
5858
}
5959

60-
static char *LastError;
60+
static LLVM_THREAD_LOCAL char *LastError;
6161

6262
extern "C" LLVMMemoryBufferRef
6363
LLVMRustCreateMemoryBufferWithContentsOfFile(const char *Path) {

0 commit comments

Comments
 (0)