Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d1395ab

Browse files
authoredFeb 14, 2024··
Unrolled build for rust-lang#118738
Rollup merge of rust-lang#118738 - devnexen:netbsd10_update, r=cuviper Netbsd10 update
2 parents 81b757c + 114b0c7 commit d1395ab

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed
 

‎library/std/build.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ fn main() {
77
let target_vendor =
88
env::var("CARGO_CFG_TARGET_VENDOR").expect("CARGO_CFG_TARGET_VENDOR was not set");
99
let target_env = env::var("CARGO_CFG_TARGET_ENV").expect("CARGO_CFG_TARGET_ENV was not set");
10-
10+
if target_os == "netbsd" && env::var("RUSTC_STD_NETBSD10").is_ok() {
11+
println!("cargo:rustc-cfg=netbsd10");
12+
}
1113
if target_os == "linux"
1214
|| target_os == "android"
1315
|| target_os == "netbsd"

‎library/std/src/sys/pal/unix/rand.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ mod imp {
6262
unsafe { getrandom(buf.as_mut_ptr().cast(), buf.len(), libc::GRND_NONBLOCK) }
6363
}
6464

65-
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "freebsd"))]
65+
#[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "freebsd", netbsd10))]
6666
fn getrandom(buf: &mut [u8]) -> libc::ssize_t {
6767
unsafe { libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0) }
6868
}
@@ -72,7 +72,8 @@ mod imp {
7272
target_os = "android",
7373
target_os = "espidf",
7474
target_os = "horizon",
75-
target_os = "freebsd"
75+
target_os = "freebsd",
76+
netbsd10
7677
)))]
7778
fn getrandom_fill_bytes(_buf: &mut [u8]) -> bool {
7879
false
@@ -83,7 +84,8 @@ mod imp {
8384
target_os = "android",
8485
target_os = "espidf",
8586
target_os = "horizon",
86-
target_os = "freebsd"
87+
target_os = "freebsd",
88+
netbsd10
8789
))]
8890
fn getrandom_fill_bytes(v: &mut [u8]) -> bool {
8991
use crate::sync::atomic::{AtomicBool, Ordering};
@@ -230,7 +232,7 @@ mod imp {
230232
}
231233

232234
// FIXME: once the 10.x release becomes the minimum, this can be dropped for simplification.
233-
#[cfg(target_os = "netbsd")]
235+
#[cfg(all(target_os = "netbsd", not(netbsd10)))]
234236
mod imp {
235237
use crate::ptr;
236238

‎src/bootstrap/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
8686
(Some(Mode::Std), "no_global_oom_handling", None),
8787
(Some(Mode::Std), "no_rc", None),
8888
(Some(Mode::Std), "no_sync", None),
89+
(Some(Mode::Std), "netbsd10", None),
8990
(Some(Mode::Std), "backtrace_in_libstd", None),
9091
/* Extra values not defined in the built-in targets yet, but used in std */
9192
(Some(Mode::Std), "target_env", Some(&["libnx"])),

0 commit comments

Comments
 (0)
Please sign in to comment.