PIE may (and commonly will) result in the binary being loaded above
the 4Gb boundary, which can't work with at least the VZEROUPPER compat
mode test.
Add -fno-PIE and -no-pie when appropriate so that gcc won't generate a
PIE executable.
Reported-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
ln -sf simd.c $@
$(TARGET): x86_emulate.o test_x86_emulator.o
- $(HOSTCC) -o $@ $^
+ $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
.PHONY: clean
clean:
asm/%: asm ;
-HOSTCFLAGS += $(CFLAGS_xeninclude) -I.
+HOSTCFLAGS-x86_64 := -fno-PIE
+$(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-pie)
+HOSTCFLAGS += $(CFLAGS_xeninclude) -I. $(HOSTCFLAGS-$(XEN_COMPILE_ARCH))
x86.h := asm/x86-vendors.h asm/x86-defns.h asm/msr-index.h
x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h $(x86.h)