From 85b760ebbd1978f5e52d8a70add1f76e8e86a263 Mon Sep 17 00:00:00 2001 From: rami3l Date: Wed, 1 May 2024 14:20:33 +0800 Subject: [PATCH] fix(dist/arm): don't assume `armv7` if `/proc/cpuinfo` is unavailable --- rustup-init.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rustup-init.sh b/rustup-init.sh index ce4b03cc1e..3219df7eca 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -539,8 +539,9 @@ get_architecture() { # and fall back to arm. # See https://github.com/rust-lang/rustup.rs/issues/587. if [ "$_ostype" = "unknown-linux-gnueabihf" ] && [ "$_cputype" = armv7 ]; then - if ensure grep '^Features' /proc/cpuinfo | grep -E -q -v 'neon|simd'; then - # At least one processor does not have NEON (which is asimd on armv8+). + if ! (ensure grep '^Features' /proc/cpuinfo | grep -E -q 'neon|simd') ; then + # Either `/proc/cpuinfo` is malformed or unavailable, or + # at least one processor does not have NEON (which is asimd on armv8+). _cputype=arm fi fi