From 945f53909f2015e3c29c69f70ec355957a0da72d Mon Sep 17 00:00:00 2001 From: kay-lambdadelta Date: Tue, 11 Aug 2026 00:05:31 -0700 Subject: [PATCH 1/3] Add Apache NuttX support --- Cargo.toml | 18 +++++++++--------- src/backends.rs | 1 + src/utils/get_errno.rs | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0e488c4d2..05740be1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,11 +42,11 @@ rand_core = { version = "0.10.0", optional = true } # getrandom / linux_android_with_fallback [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 } +libc = { version = "0.2.176", default-features = false } # apple-other [target.'cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos"))'.dependencies] -libc = { version = "0.2.154", default-features = false } +libc = { version = "0.2.176", default-features = false } # efi_rng [target.'cfg(all(target_os = "uefi", getrandom_backend = "efi_rng"))'.dependencies] @@ -54,27 +54,27 @@ r-efi = { version = "6", default-features = false } # getentropy [target.'cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten"))'.dependencies] -libc = { version = "0.2.154", default-features = false } +libc = { version = "0.2.176", default-features = false } # getrandom -[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", target_os = "cygwin", all(target_os = "horizon", target_arch = "arm")))'.dependencies] -libc = { version = "0.2.154", default-features = false } +[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", target_os = "cygwin", target_os = "nuttx", all(target_os = "horizon", target_arch = "arm")))'.dependencies] +libc = { version = "0.2.176", default-features = false } # netbsd [target.'cfg(target_os = "netbsd")'.dependencies] -libc = { version = "0.2.154", default-features = false } +libc = { version = "0.2.176", default-features = false } # solaris [target.'cfg(target_os = "solaris")'.dependencies] -libc = { version = "0.2.154", default-features = false } +libc = { version = "0.2.176", default-features = false } # use_file [target.'cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix"))'.dependencies] -libc = { version = "0.2.154", default-features = false } +libc = { version = "0.2.176", default-features = false } # vxworks [target.'cfg(target_os = "vxworks")'.dependencies] -libc = { version = "0.2.154", default-features = false } +libc = { version = "0.2.176", default-features = false } # wasm_js [target.'cfg(all(target_family = "wasm", any(target_os = "unknown", target_os = "none")))'.dependencies] diff --git a/src/backends.rs b/src/backends.rs index 86ffd7579..ef40894d3 100644 --- a/src/backends.rs +++ b/src/backends.rs @@ -113,6 +113,7 @@ cfg_if! { target_os = "hurd", target_os = "illumos", target_os = "cygwin", + target_os = "nuttx", // Check for target_arch = "arm" to only include the 3DS. Does not // include the Nintendo Switch (which is target_arch = "aarch64"). all(target_os = "horizon", target_arch = "arm"), diff --git a/src/utils/get_errno.rs b/src/utils/get_errno.rs index 1895fc05e..2c68ef9e6 100644 --- a/src/utils/get_errno.rs +++ b/src/utils/get_errno.rs @@ -1,5 +1,5 @@ cfg_if! { - if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android", target_os = "cygwin"))] { + if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android", target_os = "cygwin", target_os = "nuttx"))] { use libc::__errno as errno_location; } else if #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "hurd", target_os = "redox", target_os = "dragonfly"))] { use libc::__errno_location as errno_location; From 74b97301d291dc9dfcabc2dd5ac0e3f8e483d1f4 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Tue, 11 Aug 2026 10:54:13 +0300 Subject: [PATCH 2/3] Add changelog entry --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 000d9493a..7d5503052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.4.4] - UNRELEASED +### Added +- Apache NuttX support ([#861]) + +[0.4.4]: https://github.com/rust-random/getrandom/compare/v0.4.3...master +[#861]: https://github.com/rust-random/getrandom/pull/861 + ## [0.4.3] - 2026-06-17 ### Added - `wasm64-unknown-unknown` target support for `wasm_js` backend [#848] From 916e6d682f94921857dc227c3db9c607fb54861d Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Tue, 11 Aug 2026 11:21:17 +0300 Subject: [PATCH 3/3] Add build-only test --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fbe613d1..37c40cb21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,6 +86,7 @@ jobs: target: [ aarch64-kmc-solid_asp3, aarch64-unknown-nto-qnx710, + aarch64-unknown-nuttx, armv6k-nintendo-3ds, armv7-sony-vita-newlibeabihf, i686-unknown-hurd-gnu,