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 May 1, 2024
1 parent a36226b commit 3043a95
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 @@ -540,8 +540,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 3043a95

Please sign in to comment.