Skip to content

Commit 3043a95

Browse files
committed
fix(dist/arm): don't assume armv7 if /proc/cpuinfo is unavailable
1 parent a36226b commit 3043a95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rustup-init.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,9 @@ get_architecture() {
540540
# and fall back to arm.
541541
# See https://github.com/rust-lang/rustup.rs/issues/587.
542542
if [ "$_ostype" = "unknown-linux-gnueabihf" ] && [ "$_cputype" = armv7 ]; then
543-
if ensure grep '^Features' /proc/cpuinfo | grep -E -q -v 'neon|simd'; then
544-
# At least one processor does not have NEON (which is asimd on armv8+).
543+
if ! (ensure grep '^Features' /proc/cpuinfo | grep -E -q 'neon|simd') ; then
544+
# Either `/proc/cpuinfo` is malformed or unavailable, or
545+
# at least one processor does not have NEON (which is asimd on armv8+).
545546
_cputype=arm
546547
fi
547548
fi

0 commit comments

Comments
 (0)