Skip to content

Commit f096c19

Browse files
committed
Handle target-cpu=native
1 parent a9a2c68 commit f096c19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/gcc_util.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use gccjit::Context;
12
use smallvec::{smallvec, SmallVec};
23

34
use rustc_codegen_ssa::target_features::{
@@ -204,7 +205,11 @@ fn handle_native(name: &str) -> &str {
204205
return name;
205206
}
206207

207-
unimplemented!();
208+
// Get the native arch.
209+
let context = Context::default();
210+
context.get_target_info().arch().unwrap()
211+
.to_str()
212+
.unwrap()
208213
}
209214

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

0 commit comments

Comments
 (0)