Skip to content

Commit 85b760e

Browse files
committed
fix(dist/arm): don't assume armv7 if /proc/cpuinfo is unavailable
1 parent 5d72c7e commit 85b760e

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
@@ -539,8 +539,9 @@ get_architecture() {
539539
# and fall back to arm.
540540
# See https://github.com/rust-lang/rustup.rs/issues/587.
541541
if [ "$_ostype" = "unknown-linux-gnueabihf" ] && [ "$_cputype" = armv7 ]; then
542-
if ensure grep '^Features' /proc/cpuinfo | grep -E -q -v 'neon|simd'; then
543-
# At least one processor does not have NEON (which is asimd on armv8+).
542+
if ! (ensure grep '^Features' /proc/cpuinfo | grep -E -q 'neon|simd') ; then
543+
# Either `/proc/cpuinfo` is malformed or unavailable, or
544+
# at least one processor does not have NEON (which is asimd on armv8+).
544545
_cputype=arm
545546
fi
546547
fi

0 commit comments

Comments
 (0)