From: Wei Liu Date: Mon, 25 Sep 2017 10:46:36 +0000 (+0100) Subject: x86emul/test: generate non-pie executable for 64bit builds X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~73^2~1333 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e90188b9817e6064584e8ad22b52e01f2e5deb35;p=xen.git x86emul/test: generate non-pie executable for 64bit builds 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 Signed-off-by: Jan Beulich Signed-off-by: Wei Liu Acked-by: Jan Beulich --- diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile index fd13ab53b1..fbe02cd2f9 100644 --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -76,7 +76,7 @@ $(addsuffix .c,$(SIMD)) $(addsuffix -avx.c,$(filter sse%,$(SIMD))): ln -sf simd.c $@ $(TARGET): x86_emulate.o test_x86_emulator.o - $(HOSTCC) -o $@ $^ + $(HOSTCC) $(HOSTCFLAGS) -o $@ $^ .PHONY: clean clean: @@ -98,7 +98,9 @@ asm: 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)