about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/driver/aot.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/driver/aot.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/driver/aot.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/driver/aot.rs b/compiler/rustc_codegen_cranelift/src/driver/aot.rs
index 50fd53481f7..a8b802f4494 100644
--- a/compiler/rustc_codegen_cranelift/src/driver/aot.rs
+++ b/compiler/rustc_codegen_cranelift/src/driver/aot.rs
@@ -289,13 +289,16 @@ pub(crate) fn run_aot(
         None
     };
 
+    // FIXME handle `-Ctarget-cpu=native`
+    let target_cpu =
+        tcx.sess.opts.cg.target_cpu.as_ref().unwrap_or(&tcx.sess.target.cpu).to_owned();
     Box::new((
         CodegenResults {
             modules,
             allocator_module,
             metadata_module,
             metadata,
-            crate_info: CrateInfo::new(tcx, crate::target_triple(tcx.sess).to_string()),
+            crate_info: CrateInfo::new(tcx, target_cpu),
         },
         work_products,
     ))