From: Brian Jackson Subject: Re: [PATCH] Make KVM compile on split source/object kernel configurations Date: Mon, 29 Sep 2008 16:50:41 -0500 Message-ID: <200809291650.41467.iggy@theiggy.com> References: <48CE6F0E.6020601@suse.de> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_x2U4ItT5vWq7yhW" Cc: "kvm@vger.kernel.org list" To: Alexander Graf Return-path: Received: from theiggy.com ([66.220.1.110]:42299 "EHLO mail.theiggy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbYI2Vun (ORCPT ); Mon, 29 Sep 2008 17:50:43 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: --Boundary-00=_x2U4ItT5vWq7yhW Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline With your patch, I still can't build with a split kernel source/object dir. Don't know if it's a difference of configure options or what. Here's mine just in case: ./configure --disable-gfx-check --disable-sdl --with-patched-kernel --prefix=/usr I needed the attached patch as well. On Monday 29 September 2008 1:13:52 pm Alexander Graf wrote: > Any further comments on this? I would really like to see KVM build out- > of-the-box on SUSE kernels (and kernels built with O= at the same time). > > Alex > > On 15.09.2008, at 16:19, Alexander Graf wrote: > > KVM as is assumes that the kernel obj dir and the kernel source dir > > are at the same location. This is true for most self-built vanilla > > kernels, but some distributions split these up (e.g. SUSE). > > To keep compatible and have users have a good experience on building > > KVM on any distribution, this patch attempts to rebuild the logic > > from the kernel Makefile as closely as possible. With it I > > successfully built KVM on a current SUSE system. > > > > Signed-off-by: Alexander Graf > > > > Please check and see if it breaks the build process for anyone else. > > Building with IA64 on SUSE-kernels is still broken due to similar > > but separate problems. > > > > > > diff --git a/configure b/configure > > index 3bb10ce..5e9cbab 100755 > > --- a/configure > > +++ b/configure > > @@ -1,6 +1,7 @@ > > #!/bin/bash > > > > prefix=/usr/local > > +kernelsourcedir= > > kerneldir=/lib/modules/$(uname -r)/build > > cc=gcc > > ld=ld > > @@ -102,6 +103,11 @@ if [ "$arch" = "powerpc" ]; then > > qemu_ldflags="$qemu_ldflags -L $PWD/libfdt" > > fi > > > > +# see if we have split build and source directories > > +if [ -d "$kerneldir/include2" ]; then > > + kernelsourcedir=${kerneldir%/*}/source > > +fi > > + > > #configure user dir > > (cd user; ./configure --prefix="$prefix" -- > > kerneldir="$libkvm_kerneldir" \ > > --arch="$arch" \ > > @@ -124,6 +130,7 @@ cat < config.mak > > ARCH=$arch > > PREFIX=$prefix > > KERNELDIR=$kerneldir > > +KERNELSOURCEDIR=$kernelsourcedir > > LIBKVM_KERNELDIR=$libkvm_kerneldir > > WANT_MODULE=$want_module > > CROSS_COMPILE=$cross_prefix > > diff --git a/kernel/Makefile b/kernel/Makefile > > index 3f5f6da..d2cf89c 100644 > > --- a/kernel/Makefile > > +++ b/kernel/Makefile > > @@ -36,7 +36,9 @@ hack-files = $(hack-files-$(ARCH_DIR)) > > all:: header-link prerequisite > > # include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat > > $(MAKE) -C $(KERNELDIR) M=`pwd` \ > > - LINUXINCLUDE="-I`pwd`/include -Iinclude -Iarch/${ARCH_DIR}/ > > include -I`pwd`/include-compat \ > > + LINUXINCLUDE="-I`pwd`/include -Iinclude \ > > + $(if $(KERNELSOURCEDIR),-Iinclude2 -I$(KERNELSOURCEDIR)/include) \ > > + -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \ > > -include include/linux/autoconf.h \ > > -include `pwd`/$(ARCH_DIR)/external-module-compat.h" > > "$$@" > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --Boundary-00=_x2U4ItT5vWq7yhW Content-Type: text/x-diff; charset="iso 8859-15"; name="split-kerneldir.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="split-kerneldir.patch" diff --git a/kernel/Makefile b/kernel/Makefile index f2a71fa..46948cc 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -58,8 +58,8 @@ T = $(subst -sync,,$@)-tmp header-sync: rm -rf $T rsync -R \ - "$(LINUX)"/./include/linux/kvm*.h \ - "$(LINUX)"/./include/asm-*/kvm*.h \ + "$(subst build,source,$(LINUX))"/./include/linux/kvm*.h \ + "$(subst build,source,$(LINUX))"/./include/asm-*/kvm*.h \ $T/ -rsync -R \ "$(LINUX)"/arch/$(ARCH_DIR)/include/asm/./kvm*.h \ --Boundary-00=_x2U4ItT5vWq7yhW--