Re: [PATCH 01/12] scripts: subarch.include: fix SUBARCH on MacOS hosts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 7, 2024 at 8:10 AM Daniel Gomez via B4 Relay
<devnull+da.gomez.samsung.com@xxxxxxxxxx> wrote:
>
> From: Nick Desaulniers <nick.desaulniers@xxxxxxxxx>
>
> 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.


Does sed support "negative lookahead regular expression"?

>
> Add a separate expression to support for armv.* as per error reported by
> Nicolas Schier [1].
>
> [1] https://lore.kernel.org/all/Y3MRvtwdjIwMHvRo@xxxxxxxxxxxxxxxx/#t
>
> Signed-off-by: Nick Desaulniers <nick.desaulniers@xxxxxxxxx>
> Signed-off-by: Daniel Gomez <da.gomez@xxxxxxxxxxx>
> ---
>  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/ \


s/arm\(?:\(?!64\).*\)/arm/

In sed, this expression does not seem to match anything.

(or please give me some matching examples if I miss something)





Nocolas already provided correct code:

> [1] https://lore.kernel.org/all/Y3MRvtwdjIwMHvRo@xxxxxxxxxxxxxxxx/#t






>                                   -e s/s390x/s390/ \
>                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
>                                   -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
>
> --
> Git-146)
>
>


--
Best Regards


Masahiro Yamada





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux