From 5a78776cad04ed8b102c9bc513693fc726df1bf1 Mon Sep 17 00:00:00 2001 From: Adeel Date: Thu, 5 Mar 2020 20:41:58 +0200 Subject: [PATCH] Use uname -m for arch detection on Darwin family --- eng/native/init-os-and-arch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh index 0f633064bb7948..23cda3d67d63bf 100644 --- a/eng/native/init-os-and-arch.sh +++ b/eng/native/init-os-and-arch.sh @@ -16,7 +16,8 @@ esac CPUName=$(uname -p) # Some Linux platforms report unknown for platform, but the arch for machine. -if [[ "$CPUName" == "unknown" ]]; then +# On macOS, -p prints the generic processor type, which is i386 and -m prints the machine hardware name. +if [[ "$CPUName" == "unknown" || "$OSName" == "Darwin" ]]; then CPUName=$(uname -m) fi