diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-08 08:19:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-08 08:19:20 +0100 |
| commit | 0d235ef9a49a703eba2c6ee9693c30222ac5466b (patch) | |
| tree | 6a6fe7191fb9f5946b5444c4e283ce5b1b84eda1 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | d4d18d240b4c2f5c7b97a6eba05d686e003bf718 (diff) | |
| parent | ef626d772f7ee9ddba526b0693993f6479ee5c14 (diff) | |
| download | rust-0d235ef9a49a703eba2c6ee9693c30222ac5466b.tar.gz rust-0d235ef9a49a703eba2c6ee9693c30222ac5466b.zip | |
Rollup merge of #122143 - durin42:llvm-19-compression-options, r=workingjubilee
PassWrapper: update for llvm/llvm-project@a3319371970b ``@rustbot`` label: +llvm-main
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 1cdfc22431e..f6253068eaa 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -451,14 +451,30 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( Options.ObjectFilenameForDebug = OutputObjFile; } if (!strcmp("zlib", DebugInfoCompression) && llvm::compression::zlib::isAvailable()) { +#if LLVM_VERSION_GE(19, 0) + Options.MCOptions.CompressDebugSections = DebugCompressionType::Zlib; +#else Options.CompressDebugSections = DebugCompressionType::Zlib; +#endif } else if (!strcmp("zstd", DebugInfoCompression) && llvm::compression::zstd::isAvailable()) { +#if LLVM_VERSION_GE(19, 0) + Options.MCOptions.CompressDebugSections = DebugCompressionType::Zstd; +#else Options.CompressDebugSections = DebugCompressionType::Zstd; +#endif } else if (!strcmp("none", DebugInfoCompression)) { +#if LLVM_VERSION_GE(19, 0) + Options.MCOptions.CompressDebugSections = DebugCompressionType::None; +#else Options.CompressDebugSections = DebugCompressionType::None; +#endif } +#if LLVM_VERSION_GE(19, 0) + Options.MCOptions.X86RelaxRelocations = RelaxELFRelocations; +#else Options.RelaxELFRelocations = RelaxELFRelocations; +#endif Options.UseInitArray = UseInitArray; #if LLVM_VERSION_LT(17, 0) |
