Skip to contentSkip to conversation

xen/arm: use BSD sed compatible regexp in SRCARCH

PATCH In review Roger Pau Monne 4 participants 4 messages Feb 5

lore
Share & tools
lore
#0 lore raw

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

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.

---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/Makefile +1 -1
index 13e336ba5484..31352d4cd260 100644
@@ -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
 
Signature · 1 line
2.51.0
#2 lore raw
In reply to Roger Pau Monne
Quoted 15 lines · Roger Pau Monne

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.

---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/Makefile +0 -0
index 13e336ba5484..31352d4cd260 100644

xen/Makefile include $(XEN_ROOT)/Config.mk · line 245

Quoted 5 lines
xen/Makefile +1 -1
@@ -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

Reviewed-by
#3 lore raw

Hi Jan and Roger

Quoted 9 lines · Jan Beulich
Quoted 6 lines · Roger Pau Monne

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.

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

Quoted 10 lines
Quoted 10 lines

---
xen/Makefile | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
xen/Makefile +0 -0
index 13e336ba5484..31352d4cd260 100644
@@ -242,7 +242,7 @@ include $(XEN_ROOT)/Config.mk
 
Quoted 6 lines

xen/Makefile include $(XEN_ROOT)/Config.mk · line 245

Quoted 4 lines
xen/Makefile +1 -1
 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

Quoted 2 lines

Jan