Skip to content

Commit

Permalink
Port std library to RTEMS
Browse files Browse the repository at this point in the history
  • Loading branch information
thesummer committed Sep 3, 2024
1 parent 9b3c3fe commit ae90e45
Show file tree
Hide file tree
Showing 20 changed files with 485 additions and 12 deletions.
2 changes: 2 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ check-cfg = [
'cfg(bootstrap)',
'cfg(no_fp_fmt_parse)',
'cfg(stdarch_intel_sde)',
# #[cfg(bootstrap)] rtems
'cfg(target_os, values("rtems"))',
# core use #[path] imports to portable-simd `core_simd` crate
# and to stdarch `core_arch` crate which messes-up with Cargo list
# of declared features, we therefor expect any feature cfg
Expand Down
2 changes: 1 addition & 1 deletion core/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ mod c_char_definition {
all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
all(target_os = "l4re", target_arch = "x86_64"),
all(
any(target_os = "freebsd", target_os = "openbsd"),
any(target_os = "freebsd", target_os = "openbsd", target_os = "rtems"),
any(
target_arch = "aarch64",
target_arch = "arm",
Expand Down
7 changes: 7 additions & 0 deletions panic_unwind/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2", default-features = false }

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
# #[cfg(bootstrap)] rtems
'cfg(target_os, values("rtems"))',
]
2 changes: 1 addition & 1 deletion panic_unwind/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cfg_if::cfg_if! {
target_os = "psp",
target_os = "xous",
target_os = "solid_asp3",
all(target_family = "unix", not(target_os = "espidf")),
all(target_family = "unix", not(any(target_os = "espidf", target_os = "rtems"))),
all(target_vendor = "fortanix", target_env = "sgx"),
target_family = "wasm",
))] {
Expand Down
2 changes: 2 additions & 0 deletions std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,6 @@ check-cfg = [
# and to the `backtrace` crate which messes-up with Cargo list
# of declared features, we therefor expect any feature cfg
'cfg(feature, values(any()))',
# #[cfg(bootstrap)] rtems
'cfg(target_os, values("rtems"))',
]
1 change: 1 addition & 0 deletions std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ fn main() {
|| target_os == "uefi"
|| target_os == "teeos"
|| target_os == "zkvm"
|| target_os == "rtems"

// See src/bootstrap/src/core/build_steps/synthetic_targets.rs
|| env::var("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET").is_ok()
Expand Down
2 changes: 2 additions & 0 deletions std/src/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ pub mod nto;
pub mod openbsd;
#[cfg(target_os = "redox")]
pub mod redox;
#[cfg(target_os = "rtems")]
pub mod rtems;
#[cfg(target_os = "solaris")]
pub mod solaris;
#[cfg(target_os = "solid_asp3")]
Expand Down
Loading

0 comments on commit ae90e45

Please sign in to comment.