From 3c8b33eaefb65c52ef744ce60e1656c9d46a819b Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 1 Dec 2021 20:41:53 -0800 Subject: [PATCH] don't check x86 features on non-x86 architectures --- perf/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/perf/src/lib.rs b/perf/src/lib.rs index e5352a6fd0..cc419def8d 100644 --- a/perf/src/lib.rs +++ b/perf/src/lib.rs @@ -54,7 +54,10 @@ pub fn report_target_features() { // when run on machines without AVX causing a non-obvious process abort. Instead detect // the mismatch and error cleanly. if !is_rosetta_emulated() { - #[cfg(build_target_feature_avx)] + #[cfg(all( + any(target_arch = "x86", target_arch = "x86_64"), + build_target_feature_avx + ))] { if is_x86_feature_detected!("avx") { info!("AVX detected"); @@ -66,7 +69,10 @@ pub fn report_target_features() { } } - #[cfg(build_target_feature_avx2)] + #[cfg(all( + any(target_arch = "x86", target_arch = "x86_64"), + build_target_feature_avx2 + ))] { if is_x86_feature_detected!("avx2") { info!("AVX2 detected");