Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts: subarch.include: fix SUBARCH on macOS hosts

When building the Linux kernel on an aarch64 macOS based host, if we don't
specify a value for ARCH when invoking make, we default to arm and thus
multi_v7_defconfig rather than the expected arm64 and arm64's defconfig.

This is because subarch.include invokes `uname -m` which on MacOS hosts
evaluates to `arm64` but on Linux hosts evaluates to `aarch64`,

This allows us to build ARCH=arm64 natively on macOS (as in ARCH need
not be specified on an aarch64-based system).

Avoid matching arm64 by excluding it from the arm.* sed expression.

Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Suggested-by: Nicolas Schier <nicolas@fjasle.eu>
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Nick Desaulniers and committed by
Masahiro Yamada
8a62d445 16ff3f60

+1 -1
+1 -1
scripts/subarch.include
··· 6 6 7 7 SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ 8 8 -e s/sun4u/sparc64/ \ 9 - -e s/arm.*/arm/ -e s/sa110/arm/ \ 9 + -e /^arm64$$/!s/arm.*/arm/ -e s/sa110/arm/ \ 10 10 -e s/s390x/s390/ \ 11 11 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ 12 12 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \