diff options
| author | Tim Neumann <timnn@google.com> | 2023-04-24 08:30:05 +0000 |
|---|---|---|
| committer | Tim Neumann <timnn@google.com> | 2023-04-24 08:45:15 +0000 |
| commit | 047ed32148a39bc38ad18363ded9ab845dd313ee (patch) | |
| tree | 35ac61b3e74dea28077572d71d9a3a8086c4d184 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | f65615f02d22b85e9205f2716ab36182d34bab2b (diff) | |
| download | rust-047ed32148a39bc38ad18363ded9ab845dd313ee.tar.gz rust-047ed32148a39bc38ad18363ded9ab845dd313ee.zip | |
[LLVM17] Adapt to `ExplicitEmulatedTLS` removal.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 90cce9a8650..1acdc95ca8d 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -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. |
