On Wed, Aug 07, 2024 at 01:09:15AM +0200, Daniel Gomez via B4 Relay wrote:
> From: Nick Desaulniers <nick.desaulni...@gmail.com>
> 
> 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).
> 
> Utilize a negative lookahead regular expression to avoid matching arm64.
> 
> Add a separate expression to support for armv.* as per error reported by
> Nicolas Schier [1].
> 
> [1] https://lore.kernel.org/all/y3mrvtwdjiwmh...@bergen.fjasle.eu/#t
> 
> Signed-off-by: Nick Desaulniers <nick.desaulni...@gmail.com>
> Signed-off-by: Daniel Gomez <da.go...@samsung.com>
> ---
>  scripts/subarch.include | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/subarch.include b/scripts/subarch.include
> index 4bd327d0ae42..5d84ad8c0dee 100644
> --- a/scripts/subarch.include
> +++ b/scripts/subarch.include
> @@ -6,7 +6,8 @@
>  
>  SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
>                                 -e s/sun4u/sparc64/ \
> -                               -e s/arm.*/arm/ -e s/sa110/arm/ \
> +                               -e s/armv.*/arm/ \
> +                               -e s/arm\(?:\(?!64\).*\)/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/ \
> 

Reviewed-by: Nicolas Schier <nico...@fjasle.eu>

Reply via email to