Skip to content

Commit

Permalink
fix(dist/arm): don't assume armv7 if /proc/cpuinfo is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Jun 10, 2024
1 parent 5d72c7e commit 85b760e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85b760e

Please sign in to comment.