From daf68ae10c71d767cf14209afb280506c69fe039 Mon Sep 17 00:00:00 2001 From: Prasad Joshi Date: Mon, 4 Apr 2011 16:03:21 +0100 Subject: [PATCH] kvm tools: Fix KVM problem on SuSe 2.6.37 kernel Got following errors while compiling the native kvm tool on my supervisor's machine. oswaldo@sir61a:~/linux-kvm/tools/kvm> make In file included from /usr/include/asm/types.h:4, from /usr/include/asm/kvm.h:9, from ../../include/linux/kvm.h:13, from include/kvm/kvm.h:6, from mmio.c:1: ../../include/asm-generic/int-ll64.h:11:29: error: asm/bitsperlong.h: No such file or directory In file included from /usr/include/asm/types.h:4, from /usr/include/asm/kvm.h:9, from ../../include/linux/kvm.h:13, from include/kvm/kvm.h:6, from main.c:1: [snip] ../../include/asm-generic/int-ll64.h:11:29: error: asm/bitsperlong.h: No such file or directory make: *** No rule to make target `8250-serial.d', needed by `kvm'. Stop. Following patch adds architecture specific include path to resolve this error. Signed-off-by: Prasad Joshi Signed-off-by: Pekka Enberg --- tools/kvm/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index 11306813b6d7..ac2342fea625 100644 --- a/tools/kvm/Makefile +++ b/tools/kvm/Makefile @@ -33,18 +33,26 @@ OBJS += bios/bios.o LIBS += -lrt +# Additional ARCH settings for x86 +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ + -e s/arm.*/arm/ -e s/sa110/arm/ \ + -e s/s390x/s390/ -e s/parisc64/parisc/ \ + -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ + -e s/sh[234].*/sh/ ) + uname_M := $(shell uname -m | sed -e s/i.86/i386/) ifeq ($(uname_M),i386) DEFINES += -DCONFIG_X86_32 endif ifeq ($(uname_M),x86_64) + ARCH := x86 DEFINES += -DCONFIG_X86_64 endif DEFINES += -D_FILE_OFFSET_BITS=64 DEFINES += -D_GNU_SOURCE -CFLAGS += $(CPPFLAGS) $(DEFINES) -Iinclude -I../../include -Os -g +CFLAGS += $(CPPFLAGS) $(DEFINES) -Iinclude -I../../include -I../../arch/$(ARCH)/include/ -Os -g WARNINGS += -Werror WARNINGS += -Wall -- 2.39.5