Skip to content

Commit

Permalink
Handle target-cpu=native
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Sep 15, 2023
1 parent a9a2c68 commit f096c19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gcc_util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use gccjit::Context;
use smallvec::{smallvec, SmallVec};

use rustc_codegen_ssa::target_features::{
Expand Down Expand Up @@ -204,7 +205,11 @@ fn handle_native(name: &str) -> &str {
return name;
}

unimplemented!();
// Get the native arch.
let context = Context::default();
context.get_target_info().arch().unwrap()
.to_str()
.unwrap()
}

pub fn target_cpu(sess: &Session) -> &str {
Expand Down

0 comments on commit f096c19

Please sign in to comment.