[LLVM17] Adapt to ExplicitEmulatedTLS removal.

This commit is contained in:
Tim Neumann 2023-04-24 08:30:05 +00:00
parent f65615f02d
commit 047ed32148

View File

@ -410,10 +410,15 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
}
Options.RelaxELFRelocations = RelaxELFRelocations;
Options.UseInitArray = UseInitArray;
#if LLVM_VERSION_LT(17, 0)
if (ForceEmulatedTls) {
Options.ExplicitEmulatedTLS = true;
Options.EmulatedTLS = true;
}
#else
Options.EmulatedTLS = ForceEmulatedTls || Trip.hasDefaultEmulatedTLS();
#endif
if (TrapUnreachable) {
// Tell LLVM to codegen `unreachable` into an explicit trap instruction.