mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 23:23:03 +00:00
8a62d44588
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>
14 lines
658 B
Plaintext
14 lines
658 B
Plaintext
# SUBARCH tells the usermode build what the underlying arch is. That is set
|
|
# first, and if a usermode build is happening, the "ARCH=um" on the command
|
|
# line overrides the setting of ARCH below. If a native build is happening,
|
|
# then ARCH is assigned, getting whatever value it gets normally, and
|
|
# SUBARCH is subsequently ignored.
|
|
|
|
SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
|
|
-e s/sun4u/sparc64/ \
|
|
-e /^arm64$$/!s/arm.*/arm/ -e s/sa110/arm/ \
|
|
-e s/s390x/s390/ \
|
|
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
|
|
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
|
|
-e s/riscv.*/riscv/ -e s/loongarch.*/loongarch/)
|