@@ -226,16 +226,29 @@ cfg_if! {
226226 } else if #[ cfg( all(
227227 not( feature = "disable_urandom_fallback" ) ,
228228 any(
229- // Rust supports Android API level 19 (KitKat) [0], while `getrandom(2)`
230- // was added only in level 23 (Marshmallow).
229+ // Rust supports Android API level 19 (KitKat) [0] and the next upgrade targets
230+ // level 21 (Lollipop) [1], while `getrandom(2)` was added only in
231+ // level 23 (Marshmallow). Note that it applies only to the "old" `target_arch`es,
232+ // RISC-V Android targets sufficiently new API level, same will apply for potential
233+ // new Android `target_arch`es.
231234 // [0]: https://blog.rust-lang.org/2023/01/09/android-ndk-update-r25.html
232- target_os = "android" ,
235+ // [1]: https://github.com/rust-lang/rust/pull/120593
236+ all(
237+ target_os = "android" ,
238+ any(
239+ target_arch = "aarch64" ,
240+ target_arch = "arm" ,
241+ target_arch = "x86" ,
242+ target_arch = "x86_64" ,
243+ ) ,
244+ ) ,
245+ // Only on these `target_arch`es Rust supports Linux kernel versions (3.2+)
246+ // that precede the version (3.17) in which `getrandom(2)` was added:
247+ // https://doc.rust-lang.org/stable/rustc/platform-support.html
233248 all(
234249 target_os = "linux" ,
235- // Only on these `target_arch`es Rust supports Linux kernel versions (3.2+)
236- // that precede the version (3.17) in which `getrandom(2)` was added:
237- // https://doc.rust-lang.org/stable/rustc/platform-support.html
238250 any(
251+ target_arch = "aarch64" ,
239252 target_arch = "arm" ,
240253 target_arch = "powerpc" ,
241254 target_arch = "powerpc64" ,
0 commit comments