From 912199a21c38c637c3fbe725df028e95996e8a6b Mon Sep 17 00:00:00 2001 From: "G. Endignoux" Date: Wed, 9 Nov 2022 00:59:03 +0100 Subject: [PATCH 1/2] Detect CPU features with Linux methods on Android for non-Intel CPUs. --- crates/std_detect/src/detect/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/std_detect/src/detect/mod.rs b/crates/std_detect/src/detect/mod.rs index 2bca84ca12..664dd33c15 100644 --- a/crates/std_detect/src/detect/mod.rs +++ b/crates/std_detect/src/detect/mod.rs @@ -47,7 +47,7 @@ cfg_if! { // On x86/x86_64 no OS specific functionality is required. #[path = "os/x86.rs"] mod os; - } else if #[cfg(all(target_os = "linux", feature = "libc"))] { + } else if #[cfg(any(all(target_os = "linux", feature = "libc"), target_os = "android"))] { #[path = "os/linux/mod.rs"] mod os; } else if #[cfg(all(target_os = "freebsd", feature = "libc"))] { From abf384a9fb4fe20df65bd0bb7e7b366294dbdd9f Mon Sep 17 00:00:00 2001 From: gendx Date: Wed, 9 Nov 2022 17:20:40 +0000 Subject: [PATCH 2/2] Update crates/std_detect/src/detect/mod.rs Applied suggestion to require `feature = "libc"` on Android targets. Co-authored-by: Amanieu d'Antras --- crates/std_detect/src/detect/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/std_detect/src/detect/mod.rs b/crates/std_detect/src/detect/mod.rs index 664dd33c15..9a135c90a3 100644 --- a/crates/std_detect/src/detect/mod.rs +++ b/crates/std_detect/src/detect/mod.rs @@ -47,7 +47,7 @@ cfg_if! { // On x86/x86_64 no OS specific functionality is required. #[path = "os/x86.rs"] mod os; - } else if #[cfg(any(all(target_os = "linux", feature = "libc"), target_os = "android"))] { + } else if #[cfg(all(any(target_os = "linux", target_os = "android"), feature = "libc"))] { #[path = "os/linux/mod.rs"] mod os; } else if #[cfg(all(target_os = "freebsd", feature = "libc"))] {