Skip to content

Commit df4aed1

Browse files
authored
Rollup merge of #122143 - durin42:llvm-19-compression-options, r=workingjubilee
PassWrapper: update for llvm/llvm-project@a3319371970b `@rustbot` label: +llvm-main
2 parents e2283aa + ef626d7 commit df4aed1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,30 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
451451
Options.ObjectFilenameForDebug = OutputObjFile;
452452
}
453453
if (!strcmp("zlib", DebugInfoCompression) && llvm::compression::zlib::isAvailable()) {
454+
#if LLVM_VERSION_GE(19, 0)
455+
Options.MCOptions.CompressDebugSections = DebugCompressionType::Zlib;
456+
#else
454457
Options.CompressDebugSections = DebugCompressionType::Zlib;
458+
#endif
455459
} else if (!strcmp("zstd", DebugInfoCompression) && llvm::compression::zstd::isAvailable()) {
460+
#if LLVM_VERSION_GE(19, 0)
461+
Options.MCOptions.CompressDebugSections = DebugCompressionType::Zstd;
462+
#else
456463
Options.CompressDebugSections = DebugCompressionType::Zstd;
464+
#endif
457465
} else if (!strcmp("none", DebugInfoCompression)) {
466+
#if LLVM_VERSION_GE(19, 0)
467+
Options.MCOptions.CompressDebugSections = DebugCompressionType::None;
468+
#else
458469
Options.CompressDebugSections = DebugCompressionType::None;
470+
#endif
459471
}
460472

473+
#if LLVM_VERSION_GE(19, 0)
474+
Options.MCOptions.X86RelaxRelocations = RelaxELFRelocations;
475+
#else
461476
Options.RelaxELFRelocations = RelaxELFRelocations;
477+
#endif
462478
Options.UseInitArray = UseInitArray;
463479

464480
#if LLVM_VERSION_LT(17, 0)

0 commit comments

Comments
 (0)