diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0c2feb7..79dba1d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,6 +94,7 @@ jobs: x86_64-wrs-vxworks, x86_64-unknown-dragonfly, x86_64-unknown-haiku, + x86_64-unknown-linux-none, # TODO: once libc support for cygwin is released # https://github.com/rust-lang/libc/pull/4308 # x86_64-pc-cygwin, diff --git a/CHANGELOG.md b/CHANGELOG.md index b53ccd03..05489ada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `.cargo/config.toml` example in the crate-level docs [#591] - `getrandom_test_linux_without_fallback` configuration flag to test that file fallback is not triggered in the `linux_android_with_fallback` backend [#605] +- Built-in support for `*-linux-none` targets [#618] - Cygwin support [#626] ### Changed @@ -38,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#605]: https://github.com/rust-random/getrandom/pull/605 [#610]: https://github.com/rust-random/getrandom/pull/610 [#614]: https://github.com/rust-random/getrandom/pull/614 +[#618]: https://github.com/rust-random/getrandom/pull/618 [#626]: https://github.com/rust-random/getrandom/pull/626 [#627]: https://github.com/rust-random/getrandom/pull/627 [`raw-dylib`]: https://doc.rust-lang.org/reference/items/external-blocks.html?highlight=link#dylib-versus-raw-dylib diff --git a/Cargo.toml b/Cargo.toml index e55cbb89..19fbc31c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ compiler_builtins = { version = "0.1", optional = true } core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" } # getrandom / linux_android_with_fallback -[target.'cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "linux_raw", getrandom_backend = "rdrand", getrandom_backend = "rndr"))))'.dependencies] +[target.'cfg(all(any(target_os = "linux", target_os = "android"), not(any(all(target_os = "linux", target_env = ""), getrandom_backend = "custom", getrandom_backend = "linux_raw", getrandom_backend = "rdrand", getrandom_backend = "rndr"))))'.dependencies] libc = { version = "0.2.154", default-features = false } # apple-other diff --git a/src/backends.rs b/src/backends.rs index adf8a0d0..a07cea2a 100644 --- a/src/backends.rs +++ b/src/backends.rs @@ -38,6 +38,9 @@ cfg_if! { ); } } + } else if #[cfg(all(target_os = "linux", target_env = ""))] { + mod linux_raw; + pub use linux_raw::*; } else if #[cfg(target_os = "espidf")] { mod esp_idf; pub use esp_idf::*;