Skip to content

Commit b80db73

Browse files
vittyvkbonzini
authored andcommitted
KVM: selftests: Fix build with "make ARCH=x86_64"
Marcelo reports that kvm selftests fail to build with "make ARCH=x86_64": gcc -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 -fno-stack-protector -fno-PIE -I../../../../tools/include -I../../../../tools/arch/x86_64/include -I../../../../usr/include/ -Iinclude -Ilib -Iinclude/x86_64 -I.. -c lib/kvm_util.c -o /var/tmp/20200604202744-bin/lib/kvm_util.o In file included from lib/kvm_util.c:11: include/x86_64/processor.h:14:10: fatal error: asm/msr-index.h: No such file or directory #include <asm/msr-index.h> ^~~~~~~~~~~~~~~~~ compilation terminated. "make ARCH=x86", however, works. The problem is that arch specific headers for x86_64 live in 'tools/arch/x86/include', not in 'tools/arch/x86_64/include'. Fixes: 66d69e0 ("selftests: fix kvm relocatable native/cross builds and installs") Reported-by: Marcelo Bandeira Condotta <[email protected]> Signed-off-by: Vitaly Kuznetsov <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent ba4e627 commit b80db73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/testing/selftests/kvm/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ LIBKVM += $(LIBKVM_$(UNAME_M))
8383
INSTALL_HDR_PATH = $(top_srcdir)/usr
8484
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
8585
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
86+
ifeq ($(ARCH),x86_64)
87+
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/x86/include
88+
else
8689
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
90+
endif
8791
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
8892
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
8993
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \

0 commit comments

Comments
 (0)