Mailing List Archive

[xen staging] x86emul: avoid assembler warning about .type not taking effect in test harness
commit 9909532113692020c1b50eb974cac47d4ea10e69
Author: Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:27:22 2020 +0200
Commit: Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:27:22 2020 +0200

x86emul: avoid assembler warning about .type not taking effect in test harness

gcc re-orders top level blocks by default when optimizing. This
re-ordering results in all our .type directives to get emitted to the
assembly file first, followed by gcc's. The assembler warns about
attempts to change the type of a symbol when it was already set (and
when there's no intervening setting to "notype").

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
tools/tests/x86_emulator/Makefile | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 48b3e6dce1..7b07c31bbd 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -295,4 +295,9 @@ x86-emulate.o cpuid.o test_x86_emulator.o evex-disp8.o predicates.o wrappers.o:
x86-emulate.o: x86_emulate/x86_emulate.c
x86-emulate.o: HOSTCFLAGS += -D__XEN_TOOLS__

+# In order for our custom .type assembler directives to reliably land after
+# gcc's, we need to keep it from re-ordering top-level constructs.
+$(call cc-option-add,HOSTCFLAGS-toplevel,HOSTCC,-fno-toplevel-reorder)
+test_x86_emulator.o: HOSTCFLAGS += $(HOSTCFLAGS-toplevel)
+
test_x86_emulator.o: $(addsuffix .h,$(TESTCASES)) $(addsuffix -opmask.h,$(OPMASK))
--
generated by git-patchbot for /home/xen/git/xen.git#staging