public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* kvm userland: Build misses -I <kernel include dir>
@ 2008-09-10  3:19 Ben Bucksch
  2008-09-13  5:16 ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Bucksch @ 2008-09-10  3:19 UTC (permalink / raw)
  To: kvm

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/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kvm userland: Build misses -I <kernel include dir>
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2008-09-13  5:16 UTC (permalink / raw)
  To: Ben Bucksch; +Cc: kvm

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.


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kvm userland: Build misses -I <kernel include dir>
  2008-09-13  5:16 ` Avi Kivity
@ 2008-09-13 13:07   ` Ben Bucksch
  2008-09-14 10:28     ` Iain Paton
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Bucksch @ 2008-09-13 13:07 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kvm userland: Build misses -I <kernel include dir>
  2008-09-13 13:07   ` Ben Bucksch
@ 2008-09-14 10:28     ` Iain Paton
  0 siblings, 0 replies; 4+ messages in thread
From: Iain Paton @ 2008-09-14 10:28 UTC (permalink / raw)
  To: Ben Bucksch; +Cc: Avi Kivity, kvm

Ben Bucksch wrote:

> Reason is, as said, that the build assumes that 
> /usr/include/linux/ioctl.h exists, i.e. it just #include <linux/ioctl.h> 

Oh, that's not nice. Certainly for me /usr/include/linux will never point to the kernel I'm building against so that's just a 
problem waiting to happen.

> , 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.

Seconded.
Especially when building external modules the only path being used should be the one passed in as the KERNELDIR I want to build 
against. Using /usr/include/linux or something under /lib/modules/$(uname -r)/build is fraught with problems.


> 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.

That's the issue I found with kvm-74, building the kernel with O= to have seperate source and build dirs fails as the makefile for 
the external kvm modules assumes that isn't an option.

There's a very minimal patch to get that working in this post:
<http://article.gmane.org/gmane.comp.emulators.kvm.devel/21172>

Iain


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-14 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-09-14 10:28     ` Iain Paton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox