Pass target_cpu to LinkerInfo::new instead of link_binary

This is one step towards separating the linking code from codegen backends
This commit is contained in:
bjorn3 2021-03-28 22:14:09 +02:00
parent 07968a001d
commit 55dbf17bb5
2 changed files with 1 additions and 3 deletions

View File

@ -295,7 +295,7 @@ pub(super) fn run_aot(
metadata_module, metadata_module,
metadata, metadata,
windows_subsystem, windows_subsystem,
linker_info: LinkerInfo::new(tcx), linker_info: LinkerInfo::new(tcx, crate::target_triple(tcx.sess).to_string()),
crate_info: CrateInfo::new(tcx), crate_info: CrateInfo::new(tcx),
}, },
work_products, work_products,

View File

@ -267,13 +267,11 @@ fn link(
) -> Result<(), ErrorReported> { ) -> Result<(), ErrorReported> {
use rustc_codegen_ssa::back::link::link_binary; use rustc_codegen_ssa::back::link::link_binary;
let target_cpu = crate::target_triple(sess).to_string();
link_binary::<crate::archive::ArArchiveBuilder<'_>>( link_binary::<crate::archive::ArArchiveBuilder<'_>>(
sess, sess,
&codegen_results, &codegen_results,
outputs, outputs,
&codegen_results.crate_name.as_str(), &codegen_results.crate_name.as_str(),
&target_cpu,
); );
Ok(()) Ok(())