xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-4.7] build/xen: fix assembler instruction tests
@ 2016-04-27 14:42 Roger Pau Monne
  2016-04-27 15:20 ` Wei Liu
  2016-04-28 10:38 ` Jan Beulich
  0 siblings, 2 replies; 3+ messages in thread
From: Roger Pau Monne @ 2016-04-27 14:42 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, 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.

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

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 Config.mk    | 2 +-
 xen/Rules.mk | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 4a5ebed..9b097c9 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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.
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 7183d69..961d533 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -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
-- 
2.6.4 (Apple Git-63)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for-4.7] build/xen: fix assembler instruction tests
  2016-04-27 14:42 [PATCH for-4.7] build/xen: fix assembler instruction tests Roger Pau Monne
@ 2016-04-27 15:20 ` Wei Liu
  2016-04-28 10:38 ` Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Wei Liu @ 2016-04-27 15:20 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Wed, Apr 27, 2016 at 04:42:27PM +0200, Roger Pau Monne 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.
> 
> Fix this by passing AFLAGS in the instruction test, and including the arch
> Rules.mk makefile after AFLAGS is set.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for-4.7] build/xen: fix assembler instruction tests
  2016-04-27 14:42 [PATCH for-4.7] build/xen: fix assembler instruction tests Roger Pau Monne
  2016-04-27 15:20 ` Wei Liu
@ 2016-04-28 10:38 ` Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2016-04-28 10:38 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, xen-devel

>>> On 27.04.16 at 16:42, <roger.pau@citrix.com> 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.
> 
> Fix this by passing AFLAGS in the instruction test, and including the arch
> Rules.mk makefile after AFLAGS is set.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Feels a little fragile at first, but looks okay, so:
Reviewed-by: Jan Beulich <jbeulich@suse.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-28 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-27 14:42 [PATCH for-4.7] build/xen: fix assembler instruction tests Roger Pau Monne
2016-04-27 15:20 ` Wei Liu
2016-04-28 10:38 ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).