From 808090eb073d8b2d56479045b6ef0fe67872a077 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 28 Mar 2021 22:14:09 +0200 Subject: Pass target_cpu to LinkerInfo::new instead of link_binary This is one step towards separating the linking code from codegen backends --- compiler/rustc_codegen_llvm/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler/rustc_codegen_llvm/src') diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 5ca4b226c38..4707d17f18e 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -270,6 +270,7 @@ impl CodegenBackend for LlvmCodegenBackend { Box::new(rustc_codegen_ssa::base::codegen_crate( LlvmCodegenBackend(()), tcx, + crate::llvm_util::target_cpu(tcx.sess).to_string(), metadata, need_metadata_module, )) @@ -305,13 +306,11 @@ impl CodegenBackend for LlvmCodegenBackend { // Run the linker on any artifacts that resulted from the LLVM run. // This should produce either a finished executable or library. - let target_cpu = crate::llvm_util::target_cpu(sess); link_binary::>( sess, &codegen_results, outputs, &codegen_results.crate_name.as_str(), - target_cpu, ); Ok(()) -- cgit 1.4.1-3-g733a5