Skip to content

Commit a13ad84

Browse files
authored
Add built-in support for *-linux-none targets (#618)
1 parent 526aff1 commit a13ad84

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
x86_64-wrs-vxworks,
9595
x86_64-unknown-dragonfly,
9696
x86_64-unknown-haiku,
97+
x86_64-unknown-linux-none,
9798
# TODO: once libc support for cygwin is released
9899
# https://github.com/rust-lang/libc/pull/4308
99100
# x86_64-pc-cygwin,

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- `.cargo/config.toml` example in the crate-level docs [#591]
1313
- `getrandom_test_linux_without_fallback` configuration flag to test that file fallback
1414
is not triggered in the `linux_android_with_fallback` backend [#605]
15+
- Built-in support for `*-linux-none` targets [#618]
1516
- Cygwin support [#626]
1617

1718
### Changed
@@ -38,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3839
[#605]: https://github.com/rust-random/getrandom/pull/605
3940
[#610]: https://github.com/rust-random/getrandom/pull/610
4041
[#614]: https://github.com/rust-random/getrandom/pull/614
42+
[#618]: https://github.com/rust-random/getrandom/pull/618
4143
[#626]: https://github.com/rust-random/getrandom/pull/626
4244
[#627]: https://github.com/rust-random/getrandom/pull/627
4345
[`raw-dylib`]: https://doc.rust-lang.org/reference/items/external-blocks.html?highlight=link#dylib-versus-raw-dylib

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ compiler_builtins = { version = "0.1", optional = true }
3131
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
3232

3333
# getrandom / linux_android_with_fallback
34-
[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]
34+
[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]
3535
libc = { version = "0.2.154", default-features = false }
3636

3737
# apple-other

src/backends.rs

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ cfg_if! {
3838
);
3939
}
4040
}
41+
} else if #[cfg(all(target_os = "linux", target_env = ""))] {
42+
mod linux_raw;
43+
pub use linux_raw::*;
4144
} else if #[cfg(target_os = "espidf")] {
4245
mod esp_idf;
4346
pub use esp_idf::*;

0 commit comments

Comments
 (0)