aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2019-03-13 19:19:30 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-28 12:29:07 -0400
commit0a3f29b5a77d6c27796d7a7adabafd199dc066d5 (patch)
tree6c2132e1f8957fdaa9f8bcb3e15ad78518b74b25
parent8df98ae0ab2ead9a02228756eec26f8d7b17f499 (diff)
KVM: selftests: explicitly disable PIE for tests
KVM selftests embed the guest "image" as a function in the test itself and extract the guest code at runtime by manually parsing the elf headers. The parsing is very simple and doesn't supporting fancy things like position independent executables. Recent versions of gcc enable pie by default, which results in triple fault shutdowns in the guest due to the virtual address in the headers not matching up with the virtual address retrieved from the function pointer. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--tools/testing/selftests/kvm/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 3c1f4bdf9000..73d59c9d94a3 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -29,7 +29,7 @@ LIBKVM += $(LIBKVM_$(UNAME_M))
29INSTALL_HDR_PATH = $(top_srcdir)/usr 29INSTALL_HDR_PATH = $(top_srcdir)/usr
30LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ 30LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
31LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include 31LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
32CFLAGS += -O2 -g -std=gnu99 -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I.. 32CFLAGS += -O2 -g -std=gnu99 -no-pie -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I..
33LDFLAGS += -pthread 33LDFLAGS += -pthread
34 34
35# After inclusion, $(OUTPUT) is defined and 35# After inclusion, $(OUTPUT) is defined and