[PATCH] xen/arm: use BSD sed compatible regexp in SRCARCH

Roger Pau Monne posted 1 patch 1 day, 15 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260205145913.99032-1-roger.pau@citrix.com
xen/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] xen/arm: use BSD sed compatible regexp in SRCARCH
Posted by Roger Pau Monne 1 day, 15 hours ago
Convert the ARM SRCARCH variable setting to use the more common 'arm.*'
expression rather 'arm\(32\|64\)', as the later doesn't work with BSD sed
for not being a basic regular expression.  The usage of | alternations is
not part of basic regexp support.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 13e336ba5484..31352d4cd260 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -242,7 +242,7 @@ include $(XEN_ROOT)/Config.mk
 
 ARCH := $(XEN_TARGET_ARCH)
 SRCARCH := $(shell echo $(ARCH) | \
-    sed -e 's/x86.*/x86/' -e 's/arm\(32\|64\)/arm/g' \
+    sed -e 's/x86.*/x86/' -e 's/arm.*/arm/g' \
         -e 's/riscv.*/riscv/g' -e 's/ppc.*/ppc/g')
 export ARCH SRCARCH
 
-- 
2.51.0


Re: [PATCH] xen/arm: use BSD sed compatible regexp in SRCARCH
Posted by Jan Beulich 1 day, 15 hours ago
On 05.02.2026 15:59, Roger Pau Monne wrote:
> Convert the ARM SRCARCH variable setting to use the more common 'arm.*'
> expression rather 'arm\(32\|64\)', as the later doesn't work with BSD sed
> for not being a basic regular expression.  The usage of | alternations is
> not part of basic regexp support.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/Makefile b/xen/Makefile
> index 13e336ba5484..31352d4cd260 100644
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -242,7 +242,7 @@ include $(XEN_ROOT)/Config.mk
>  
>  ARCH := $(XEN_TARGET_ARCH)
>  SRCARCH := $(shell echo $(ARCH) | \
> -    sed -e 's/x86.*/x86/' -e 's/arm\(32\|64\)/arm/g' \
> +    sed -e 's/x86.*/x86/' -e 's/arm.*/arm/g' \

Perhaps to guard against something like armv7, use arm[36][24] ?

Jan

Re: [PATCH] xen/arm: use BSD sed compatible regexp in SRCARCH
Posted by Bertrand Marquis 1 day, 15 hours ago
Hi Jan and Roger

> On 5 Feb 2026, at 16:10, Jan Beulich <jbeulich@suse.com> wrote:
> 
> On 05.02.2026 15:59, Roger Pau Monne wrote:
>> Convert the ARM SRCARCH variable setting to use the more common 'arm.*'
>> expression rather 'arm\(32\|64\)', as the later doesn't work with BSD sed
>> for not being a basic regular expression.  The usage of | alternations is
>> not part of basic regexp support.
>> 
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Tested on mac os with mac sed and works :-)

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

>> ---
>> xen/Makefile | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/xen/Makefile b/xen/Makefile
>> index 13e336ba5484..31352d4cd260 100644
>> --- a/xen/Makefile
>> +++ b/xen/Makefile
>> @@ -242,7 +242,7 @@ include $(XEN_ROOT)/Config.mk
>> 
>> ARCH := $(XEN_TARGET_ARCH)
>> SRCARCH := $(shell echo $(ARCH) | \
>> -    sed -e 's/x86.*/x86/' -e 's/arm\(32\|64\)/arm/g' \
>> +    sed -e 's/x86.*/x86/' -e 's/arm.*/arm/g' \
> 
> Perhaps to guard against something like armv7, use arm[36][24] ?

This is the target ARCH in xen so we only support arm32 and arm64 so
this is probably not needed here.
At then we just want to get the main arch, so whatever is after arm still
means it is arm so i think Roger's fix is good.

Cheers
Bertrand

> 
> Jan


Re: [PATCH] xen/arm: use BSD sed compatible regexp in SRCARCH
Posted by Andrew Cooper 1 day, 15 hours ago
On 05/02/2026 2:59 pm, Roger Pau Monne wrote:
> Convert the ARM SRCARCH variable setting to use the more common 'arm.*'
> expression rather 'arm\(32\|64\)', as the later doesn't work with BSD sed
> for not being a basic regular expression.  The usage of | alternations is
> not part of basic regexp support.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>