public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Bucksch <news@bucksch.org>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm@vger.kernel.org
Subject: Re: kvm userland: Build misses -I <kernel include dir>
Date: Sat, 13 Sep 2008 15:07:37 +0200	[thread overview]
Message-ID: <48CBBB19.4050306@bucksch.org> (raw)
In-Reply-To: <48CB4CC8.5050903@qumranet.com>

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<kernel source dir in configure>/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 <linux/ioctl.h> 
, 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<kernel source dir passed to configure>/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.

  reply	other threads:[~2008-09-13 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10  3:19 kvm userland: Build misses -I <kernel include dir> Ben Bucksch
2008-09-13  5:16 ` Avi Kivity
2008-09-13 13:07   ` Ben Bucksch [this message]
2008-09-14 10:28     ` Iain Paton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48CBBB19.4050306@bucksch.org \
    --to=news@bucksch.org \
    --cc=avi@qumranet.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox