Skip to content

Commit 047ed32

Browse files
committed
[LLVM17] Adapt to ExplicitEmulatedTLS removal.
1 parent f65615f commit 047ed32

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,15 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
410410
}
411411
Options.RelaxELFRelocations = RelaxELFRelocations;
412412
Options.UseInitArray = UseInitArray;
413+
414+
#if LLVM_VERSION_LT(17, 0)
413415
if (ForceEmulatedTls) {
414416
Options.ExplicitEmulatedTLS = true;
415417
Options.EmulatedTLS = true;
416418
}
419+
#else
420+
Options.EmulatedTLS = ForceEmulatedTls || Trip.hasDefaultEmulatedTLS();
421+
#endif
417422

418423
if (TrapUnreachable) {
419424
// Tell LLVM to codegen `unreachable` into an explicit trap instruction.

0 commit comments

Comments
 (0)