Skip to content

Commit 443b45f

Browse files
committed
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
1 parent d4ea0b3 commit 443b45f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/rustc_target/src/spec/avr_gnu_base.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn target(target_cpu: String) -> Target {
1111
pointer_width: 16,
1212
options: TargetOptions {
1313
c_int_width: "16".to_string(),
14-
os: "unknown".to_string(),
1514
cpu: target_cpu.clone(),
1615
exe_suffix: ".elf".to_string(),
1716

compiler/rustc_target/src/spec/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@ pub struct TargetOptions {
713713
/// Width of c_int type. Defaults to "32".
714714
pub c_int_width: String,
715715
/// OS name to use for conditional compilation. Defaults to "none".
716+
/// "none" implies a bare metal target without `std` library.
717+
/// A couple of targets having `std` also use "unknown" as an `os` value,
718+
/// but they are exceptions.
716719
pub os: String,
717720
/// Environment name to use for conditional compilation. Defaults to "".
718721
pub env: String,

0 commit comments

Comments
 (0)