Skip to content

Commit

Permalink
Do not fallback to "arm" in rustup-init.sh on aarch64 with 32-bit use…
Browse files Browse the repository at this point in the history
…rland

On aarch64, neon will not be present in /proc/cpuinfo, instead asimd is there. Previously, we'd fall back to arm when running with a 32-bit userland, even though armv7 is perfectly appropriate in this case.

This would then run into the issue described in rust-lang/rust#58414 with "CP15 barrier emulation".

This PR fixes that.
  • Loading branch information
alex authored and rami3l committed Oct 5, 2023
1 parent de7b1a5 commit 303c6f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ 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 -q -v neon; then
# At least one processor does not have NEON.
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+).
_cputype=arm
fi
fi
Expand Down

0 comments on commit 303c6f9

Please sign in to comment.