Skip to content

Commit

Permalink
Fix outlier in uname -p on Darwin
Browse files Browse the repository at this point in the history
Darwin considers amd64 an i386 platform with a x86_64 processor architecture.
  • Loading branch information
Keve authored and bapt committed Nov 22, 2024
1 parent e012e03 commit 326a23e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/frontend/abi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ tests_init \
override

native_body() {
OS=$(uname -s)
thisarch=$(uname -p)
if [ "$thisarch" = "unknown" ]; then
if [ "$thisarch" = "unknown" -o "${OS}" = "Darwin" ]; then
thisarch=$(uname -m)
fi
OS=$(uname -s)
if [ "${OS}" = "Linux" ]; then
version=$(readelf -n /bin/uname | awk '/ABI: / { split($NF, a, "."); print a[1]"."a[2] }')
else
Expand Down Expand Up @@ -77,6 +77,7 @@ elfparse_body() {
}

machoparse_body() {
# Macho-O parsing now works across platforms
_expected="Darwin:24:aarch64\n"
atf_check \
-o inline:"${_expected}" \
Expand Down

0 comments on commit 326a23e

Please sign in to comment.