Rollup merge of #97969 - inglorion:prelinkpasses, r=nikic

Make -Cpasses= only apply to pre-link optimization

This change causes passes specified in -Cpasses= to be applied
only during pre-link optimization, not during LTO. This avoids
such passes running multiple times, which they may not be
designed for.

Fixes https://github.com/rust-lang/rust/issues/97713
This commit is contained in:
Matthias Krüger 2022-06-11 18:05:34 +02:00 committed by GitHub
commit b3d8e71cf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -463,7 +463,7 @@ pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(
let llvm_selfprofiler =
llvm_profiler.as_mut().map(|s| s as *mut _ as *mut c_void).unwrap_or(std::ptr::null_mut());
let extra_passes = config.passes.join(",");
let extra_passes = if !is_lto { config.passes.join(",") } else { "".to_string() };
let llvm_plugins = config.llvm_plugins.join(",");