[xen master] build: do not hardcode AFLAGS for as-insn tests

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[xen master] build: do not hardcode AFLAGS for as-insn tests

commit e82c185e4ca8940ca18a9aa01024e3e8609e546c
Author:     Roger Pau Monne <[hidden email]>
AuthorDate: Tue Feb 20 14:10:11 2018 +0000
Commit:     Andrew Cooper <[hidden email]>
CommitDate: Wed Feb 21 17:17:39 2018 +0000

    build: do not hardcode AFLAGS for as-insn tests
    Hardcoding as-insn to use AFLAGS is not correct. For once the test is
    performed using a C file with inline assembly, and secondly the flags
    used can be passed by the caller together with the CC.
    Fix as-insn-check to pass the flags given as parameter to the test.
    Signed-off-by: Roger Pau Monné <[hidden email]>
    Acked-by: Andrew Cooper <[hidden email]>
    [Fix usage comments as they are changing]
    Signed-off-by: Andrew Cooper <[hidden email]>
 Config.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index 51adc27..037e516 100644
--- a/Config.mk
+++ b/Config.mk
@@ -157,17 +157,17 @@ ifndef XEN_HAS_CHECKPOLICY
 # as-insn: Check whether assembler supports an instruction.
-# Usage: cflags-y += $(call as-insn "insn",option-yes,option-no)
+# Usage: cflags-y += $(call as-insn,CC FLAGS,"insn",option-yes,option-no)
 as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
-                       | $(1) $(filter-out -M% %.d -include %/include/xen/config.h,$(AFLAGS)) \
+                       | $(filter-out -M% %.d -include %/include/xen/config.h,$(1)) \
                               -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.
-# Usage: $(call as-insn-check CFLAGS,CC,"nop",-DHAVE_GAS_NOP)
+# Usage: $(call as-insn-check,CFLAGS,CC,"nop",-DHAVE_GAS_NOP)
 as-insn-check = $(eval $(call as-insn-check-closure,$(1),$(2),$(3),$(4)))
 define as-insn-check-closure
-    ifeq ($$(call as-insn,$$($(2)),$(3),y,n),y)
+    ifeq ($$(call as-insn,$$($(2)) $$($(1)),$(3),y,n),y)
         $(1) += $(4)
generated by git-patchbot for /home/xen/git/xen.git#master

Xen-changelog mailing list
[hidden email]