Skip to contentSkip to conversation

build/xen: fix assembler instruction tests

PATCH In review Roger Pau Monne 3 participants 3 messages Apr 27, 2016 – Apr 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build/xen: fix assembler instruction tests

The current test performed in order to check if the assembler supports certain instructions doesn't take into account the value of AFLAGS, which when using clang contains the option that disables the integrated assembler due to the lack of features.

As a result of this, the current instruction tests were performed against the integrated assembler, but then at build time the non-integrated assembler was used. If both have feature-parity, this is a non-issue, but we cannot assume this.

Fix this by passing AFLAGS in the instruction test, and including the arch Rules.mk makefile after AFLAGS is set.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 Config.mk    | 2 +-
 xen/Rules.mk | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Config.mk +1 -1
index 4a5ebed..9b097c9 100644
@@ -132,7 +132,7 @@ $(eval $(check-y))
 # as-insn: Check whether assembler supports an instruction.
 # Usage: cflags-y += $(call as-insn "insn",option-yes,option-no)
 as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
-                       | $(1) -c -x c -o /dev/null - 2>&1),$(4),$(3))
+                       | $(1) $(AFLAGS) -c -x c -o /dev/null - 2>&1),$(4),$(3))
 
 # as-insn-check: Add an option to compilation flags, but only if insn is
 #                supported by assembler.
xen/Rules.mk +2 -2
index 7183d69..961d533 100644
@@ -38,8 +38,6 @@ override TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
 
 TARGET := $(BASEDIR)/xen
 
-include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
-
 # Note that link order matters!
 ALL_OBJS-y               += $(BASEDIR)/common/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/drivers/built_in.o
@@ -92,6 +90,8 @@ LDFLAGS += $(LDFLAGS_DIRECT)
 
 LDFLAGS += $(LDFLAGS-y)
 
+include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
+
 include Makefile
 
 DEPS = .*.d
Signature · 7 lines
2.6.4 (Apple Git-63)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Roger Pau Monne

The current test performed in order to check if the assembler supports certain instructions doesn't take into account the value of AFLAGS, which when using clang contains the option that disables the integrated assembler due to the lack of features.

As a result of this, the current instruction tests were performed against the integrated assembler, but then at build time the non-integrated assembler was used. If both have feature-parity, this is a non-issue, but we cannot assume this.

Quoted 4 lines

Fix this by passing AFLAGS in the instruction test, and including the arch Rules.mk makefile after AFLAGS is set.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 27.04.16 at 16:42, <[email protected]> wrote:

The current test performed in order to check if the assembler supports certain instructions doesn't take into account the value of AFLAGS, which when using clang contains the option that disables the integrated assembler due to the lack of features.

As a result of this, the current instruction tests were performed against the
integrated assembler, but then at build time the non-integrated assembler was used. If both have feature-parity, this is a non-issue, but we cannot assume this.

Quoted 4 lines

Fix this by passing AFLAGS in the instruction test, and including the arch Rules.mk makefile after AFLAGS is set.

Feels a little fragile at first, but looks okay, so:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel