From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Bucksch Subject: Re: kvm userland: Build misses -I Date: Sat, 13 Sep 2008 15:07:37 +0200 Message-ID: <48CBBB19.4050306@bucksch.org> References: <48C73CBF.3070605@bucksch.org> <48CB4CC8.5050903@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from firespit.beonex.com ([216.127.68.92]:50127 "EHLO firespit.beonex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752671AbYIMNFE (ORCPT ); Sat, 13 Sep 2008 09:05:04 -0400 In-Reply-To: <48CB4CC8.5050903@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > Ben Bucksch wrote: > >> configure accepts the kernel source dir as input param, or >> automatically finds /lib/modules/2.6.27-rc5/build/ or similar. But the >> build only uses the dir to copy the latest kvm*.h into the local dir. >> The directory is not passed to gcc via -I . This results in a >> "linux/ioctl.h not found" and resulting errors, if /usr/include/linux/ >> does not exist. If I pass the kernel source explicitly, then please >> use it. >> >> 1. Please pass gcc -I/include/ > > What are you doing exactly? I've never had such issues. Well, I'd assume so, otherwise they'd be fixed I hope :). What I did: 1. Extract Linus kernel source in /usr/src/, resulting in /usr/src/linux-2.6.26/ 2. Build kernel (in source dir) 3. Install kernel to /boot/ and /lib/modules/ via make install; make modules_install etc. 4. Extract kvm git 5. KVM source dir: ./configure --with-patched-kernel --disable-sdl --disable-gfx-check ; make 6. Get lots of errors due to Version mismatch of kvm.h in kernel and libkvm.c in KVM, which actually turned out to be bogus (other bug, see other mail) 7. rm -rf /usr/include/linux/ 8. KVM source dir: ./configure --with-patched-kernel --disable-sdl --disable-gfx-check --kerneldir=/usr/src/linux-2.6.26/ ; make 9. Above error Reason is, as said, that the build assumes that /usr/include/linux/ioctl.h exists, i.e. it just #include , but does not pass the kernel dir *that I explicitly passed to configure* to gcc. If I explicitly pass the kernel dir to configure, I expect that to be used, and only that. So, just pass gcc -I/include/ iggy on IRC noted that kernel source and build dir may be separate. That's true - you probably need two configure flags --kernel-source-dir and --kernel-build-dir. The existing --kerneldir could stay and set both to the same value.