about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2020-11-11 20:10:15 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2020-11-11 20:24:14 +0300
commit443b45fa9fd87cf0939e80a64bead413530e375c (patch)
treebbd4f744a746b5c60e7bb09fa9a6bbf5a1f4493f
parentd4ea0b3e46a0303d5802b632e88ba1ba84d9d16f (diff)
downloadrust-443b45fa9fd87cf0939e80a64bead413530e375c.tar.gz
rust-443b45fa9fd87cf0939e80a64bead413530e375c.zip
rustc_target: Change os from "unknown" to "none" for bare metal targets
x86_64-fortanix-unknown-sgx and wasm32-unknown-unknown still have os == "unknown" because both have libstd
-rw-r--r--compiler/rustc_target/src/spec/avr_gnu_base.rs1
-rw-r--r--compiler/rustc_target/src/spec/mod.rs3
2 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/spec/avr_gnu_base.rs b/compiler/rustc_target/src/spec/avr_gnu_base.rs
index 9cc10032c71..67a7684da2c 100644
--- a/compiler/rustc_target/src/spec/avr_gnu_base.rs
+++ b/compiler/rustc_target/src/spec/avr_gnu_base.rs
@@ -11,7 +11,6 @@ pub fn target(target_cpu: String) -> Target {
         pointer_width: 16,
         options: TargetOptions {
             c_int_width: "16".to_string(),
-            os: "unknown".to_string(),
             cpu: target_cpu.clone(),
             exe_suffix: ".elf".to_string(),
 
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 2a4ae786fb7..dc8c41ecedc 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -713,6 +713,9 @@ pub struct TargetOptions {
     /// Width of c_int type. Defaults to "32".
     pub c_int_width: String,
     /// OS name to use for conditional compilation. Defaults to "none".
+    /// "none" implies a bare metal target without `std` library.
+    /// A couple of targets having `std` also use "unknown" as an `os` value,
+    /// but they are exceptions.
     pub os: String,
     /// Environment name to use for conditional compilation. Defaults to "".
     pub env: String,