Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix architecture detection when using 32bit mode on ARM64 and i486 #4462

Merged
merged 4 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ New option/command/subcommand are prefixed with ◈.

## Var
* Add `opamfile-loc` as a package variable, containing the location of installed package opam file [#4402 @rjbou]
* Fix `arch` detection when using 32bit mode on ARM64 [#4462 @kit-ty-kate]
* Fix `arch` detection of i486 [#4462 @kit-ty-kate]

## Option

Expand Down
4 changes: 2 additions & 2 deletions shell/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ case "$ARCH" in
x86|i?86) ARCH="i686";;
x86_64|amd64) ARCH="x86_64";;
ppc|powerpc|ppcle) ARCH="ppc";;
aarch64_be|aarch64|armv8b|armv8l) ARCH="arm64";;
armv5*|armv6*|earmv6*|armv7*|earmv7*) ARCH="armhf";;
aarch64_be|aarch64) ARCH="arm64";;
armv5*|armv6*|earmv6*|armv7*|earmv7*|armv8b|armv8l) ARCH="armhf";;
*) ARCH=$(echo "$ARCH" | awk '{print tolower($0)}')
esac

Expand Down
6 changes: 3 additions & 3 deletions src/state/opamSysPoll.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ let norm s = if s = "" then None else Some (String.lowercase_ascii s)

let normalise_arch raw =
match String.lowercase_ascii raw with
| "x86" | "i386" | "i586" | "i686" -> "x86_32"
| "x86" | "i386" | "i486" | "i586" | "i686" -> "x86_32"
| "x86_64" | "amd64" -> "x86_64"
| "powerpc" | "ppc" | "ppcle" -> "ppc32"
| "ppc64" | "ppc64le" -> "ppc64"
| "aarch64_be" | "aarch64" | "armv8b" | "armv8l" -> "arm64"
| a when List.exists (fun prefix -> OpamStd.String.starts_with ~prefix a)
| "aarch64_be" | "aarch64" -> "arm64"
| a when a = "armv8b" || a = "armv8l" || List.exists (fun prefix -> OpamStd.String.starts_with ~prefix a)
["armv5"; "armv6"; "earmv6"; "armv7"; "earmv7"] -> "arm32"
| s -> s

Expand Down