diff options
| author | Antoni Boucher <bouanto@zoho.com> | 2023-09-14 20:47:14 -0400 |
|---|---|---|
| committer | Antoni Boucher <bouanto@zoho.com> | 2023-09-14 20:47:14 -0400 |
| commit | f096c19db502957ecc571654cc5c821368a42eec (patch) | |
| tree | 919dd040ec8ae71ba1cc0014479d248016940e91 /src | |
| parent | a9a2c687ff7ee755d92375d57b5c88a42f6acb66 (diff) | |
| download | rust-f096c19db502957ecc571654cc5c821368a42eec.tar.gz rust-f096c19db502957ecc571654cc5c821368a42eec.zip | |
Handle target-cpu=native
Diffstat (limited to 'src')
| -rw-r--r-- | src/gcc_util.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gcc_util.rs b/src/gcc_util.rs index 91a815c0771..fc992ec6d2a 100644 --- a/src/gcc_util.rs +++ b/src/gcc_util.rs @@ -1,3 +1,4 @@ +use gccjit::Context; use smallvec::{smallvec, SmallVec}; use rustc_codegen_ssa::target_features::{ @@ -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 { |
