All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix include paths when the kernel source and build directory are different
@ 2009-06-03 12:58 James Pike
  2009-06-08  8:31 ` Jan Kiszka
  2009-06-08  8:42 ` Avi Kivity
  0 siblings, 2 replies; 6+ messages in thread
From: James Pike @ 2009-06-03 12:58 UTC (permalink / raw)
  To: kvm

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

Use correct architecture includes when kernel source and build directory
are different.
Signed-off-by: James Pike <james@chilon.net>

[-- Attachment #2: kvm-kmod-86-build.patch --]
[-- Type: text/plain, Size: 708 bytes --]

diff --git a/Makefile b/Makefile
index 95e4c81..ad08c45 100644
--- a/Makefile
+++ b/Makefile
@@ -27,8 +27,9 @@ all:: prerequisite
 #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
 	$(MAKE) -C $(KERNELDIR) M=`pwd` \
 		LINUXINCLUDE="-I`pwd`/include -Iinclude \
-		$(if $(KERNELSOURCEDIR),-Iinclude2 -I$(KERNELSOURCEDIR)/include) \
-		-Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
+		$(if $(KERNELSOURCEDIR),\
+			-Iinclude2 -I$(KERNELSOURCEDIR)/include -I$(KERNELSOURCEDIR)/arch/${ARCH_DIR}/include, \
+			-Iarch/${ARCH_DIR}/include) -I`pwd`/include-compat \
 		-include include/linux/autoconf.h \
 		-include `pwd`/$(ARCH_DIR)/external-module-compat.h $(module_defines)" \
 		"$$@"

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

* Re: [PATCH] fix include paths when the kernel source and build   directory are different
  2009-06-03 12:58 [PATCH] fix include paths when the kernel source and build directory are different James Pike
@ 2009-06-08  8:31 ` Jan Kiszka
  2009-06-08  8:42 ` Avi Kivity
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2009-06-08  8:31 UTC (permalink / raw)
  To: James Pike; +Cc: kvm, Avi Kivity

James Pike wrote:
> Use correct architecture includes when kernel source and build directory
> are different.
> Signed-off-by: James Pike <james@chilon.net>
> 
> diff --git a/Makefile b/Makefile
> index 95e4c81..ad08c45 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -27,8 +27,9 @@ all:: prerequisite
>  #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
>  	$(MAKE) -C $(KERNELDIR) M=`pwd` \
>  		LINUXINCLUDE="-I`pwd`/include -Iinclude \
> -		$(if $(KERNELSOURCEDIR),-Iinclude2 -I$(KERNELSOURCEDIR)/include) \
> -		-Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
> +		$(if $(KERNELSOURCEDIR),\
> +			-Iinclude2 -I$(KERNELSOURCEDIR)/include -I$(KERNELSOURCEDIR)/arch/${ARCH_DIR}/include, \
> +			-Iarch/${ARCH_DIR}/include) -I`pwd`/include-compat \
>  		-include include/linux/autoconf.h \
>  		-include `pwd`/$(ARCH_DIR)/external-module-compat.h $(module_defines)" \
>  		"$$@"

Just confirmed: Required when building against home-brewed kernels with
split source/binaries. Avi, please merge.

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>

Jan

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

* Re: [PATCH] fix include paths when the kernel source and build directory are different
  2009-06-03 12:58 [PATCH] fix include paths when the kernel source and build directory are different James Pike
  2009-06-08  8:31 ` Jan Kiszka
@ 2009-06-08  8:42 ` Avi Kivity
  2009-06-08  9:04   ` Jan Kiszka
  2009-08-15 22:33   ` James Pike
  1 sibling, 2 replies; 6+ messages in thread
From: Avi Kivity @ 2009-06-08  8:42 UTC (permalink / raw)
  To: James Pike; +Cc: kvm

James Pike wrote:
> Use correct architecture includes when kernel source and build directory
> are different.
> Signed-off-by: James Pike <james@chilon.net>
>   
> --- a/Makefile
> +++ b/Makefile
> @@ -27,8 +27,9 @@ all:: prerequisite
>  #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
>  	$(MAKE) -C $(KERNELDIR) M=`pwd` \
>  		LINUXINCLUDE="-I`pwd`/include -Iinclude \
> -		$(if $(KERNELSOURCEDIR),-Iinclude2 -I$(KERNELSOURCEDIR)/include) \
> -		-Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
> +		$(if $(KERNELSOURCEDIR),\
> +			-Iinclude2 -I$(KERNELSOURCEDIR)/include -I$(KERNELSOURCEDIR)/arch/${ARCH_DIR}/include, \
> +			-Iarch/${ARCH_DIR}/include) -I`pwd`/include-compat \
>  		-include include/linux/autoconf.h \
>  		-include `pwd`/$(ARCH_DIR)/external-module-compat.h $(module_defines)" \
>  		"$$@"
>   

This removes -Iarch/${ARCH_DIR}/include when KERNELSOURCEDIR is not 
defined.  What is the reason for this change?

-- 
error compiling committee.c: too many arguments to function


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

* Re: [PATCH] fix include paths when the kernel source and build directory are different
  2009-06-08  8:42 ` Avi Kivity
@ 2009-06-08  9:04   ` Jan Kiszka
  2009-06-08  9:33     ` Avi Kivity
  2009-08-15 22:33   ` James Pike
  1 sibling, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2009-06-08  9:04 UTC (permalink / raw)
  To: Avi Kivity; +Cc: James Pike, kvm

Avi Kivity wrote:
> James Pike wrote:
>> Use correct architecture includes when kernel source and build directory
>> are different.
>> Signed-off-by: James Pike <james@chilon.net>
>>   --- a/Makefile
>> +++ b/Makefile
>> @@ -27,8 +27,9 @@ all:: prerequisite
>>  #    include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
>>      $(MAKE) -C $(KERNELDIR) M=`pwd` \
>>          LINUXINCLUDE="-I`pwd`/include -Iinclude \
>> -        $(if $(KERNELSOURCEDIR),-Iinclude2
>> -I$(KERNELSOURCEDIR)/include) \
>> -        -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
>> +        $(if $(KERNELSOURCEDIR),\
>> +            -Iinclude2 -I$(KERNELSOURCEDIR)/include
>> -I$(KERNELSOURCEDIR)/arch/${ARCH_DIR}/include, \
>> +            -Iarch/${ARCH_DIR}/include) -I`pwd`/include-compat \
>>          -include include/linux/autoconf.h \
>>          -include `pwd`/$(ARCH_DIR)/external-module-compat.h
>> $(module_defines)" \
>>          "$$@"
>>   
> 
> This removes -Iarch/${ARCH_DIR}/include when KERNELSOURCEDIR is not
> defined.  What is the reason for this change?
> 

As far as I can see (I do wear my glasses today...),
-Iarch/${ARCH_DIR}/include is present in the else part of $(if).

The reason for this change is the missing arch include from the source
directory in case it's separate from the build dir (yeah, the changelog
has room for improvements).

I ran into the same issue after building and installing a recent kernel
tree with O=. The split trees SUSE leaves behind do not suffer from
this, but they also still work after the change. Same for classic
unified trees.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

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

* Re: [PATCH] fix include paths when the kernel source and build directory are different
  2009-06-08  9:04   ` Jan Kiszka
@ 2009-06-08  9:33     ` Avi Kivity
  0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2009-06-08  9:33 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: James Pike, kvm

Jan Kiszka wrote:
> Avi Kivity wrote:
>   
>> James Pike wrote:
>>     
>>> Use correct architecture includes when kernel source and build directory
>>> are different.
>>> Signed-off-by: James Pike <james@chilon.net>
>>>   --- a/Makefile
>>> +++ b/Makefile
>>> @@ -27,8 +27,9 @@ all:: prerequisite
>>>  #    include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
>>>      $(MAKE) -C $(KERNELDIR) M=`pwd` \
>>>          LINUXINCLUDE="-I`pwd`/include -Iinclude \
>>> -        $(if $(KERNELSOURCEDIR),-Iinclude2
>>> -I$(KERNELSOURCEDIR)/include) \
>>> -        -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
>>> +        $(if $(KERNELSOURCEDIR),\
>>> +            -Iinclude2 -I$(KERNELSOURCEDIR)/include
>>> -I$(KERNELSOURCEDIR)/arch/${ARCH_DIR}/include, \
>>> +            -Iarch/${ARCH_DIR}/include) -I`pwd`/include-compat \
>>>          -include include/linux/autoconf.h \
>>>          -include `pwd`/$(ARCH_DIR)/external-module-compat.h
>>> $(module_defines)" \
>>>          "$$@"
>>>   
>>>       
>> This removes -Iarch/${ARCH_DIR}/include when KERNELSOURCEDIR is not
>> defined.  What is the reason for this change?
>>
>>     
>
> As far as I can see (I do wear my glasses today...),
> -Iarch/${ARCH_DIR}/include is present in the else part of $(if).
>   

Yeah, I missed the comma.  Maybe I need to visit your optometrist.

> The reason for this change is the missing arch include from the source
> directory in case it's separate from the build dir (yeah, the changelog
> has room for improvements).
>
> I ran into the same issue after building and installing a recent kernel
> tree with O=. The split trees SUSE leaves behind do not suffer from
> this, but they also still work after the change. Same for classic
> unified trees.
>   

Okay, will apply the patch.

-- 
error compiling committee.c: too many arguments to function


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

* Re: [PATCH] fix include paths when the kernel source and build directory are different
  2009-06-08  8:42 ` Avi Kivity
  2009-06-08  9:04   ` Jan Kiszka
@ 2009-08-15 22:33   ` James Pike
  1 sibling, 0 replies; 6+ messages in thread
From: James Pike @ 2009-08-15 22:33 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

> This removes -Iarch/${ARCH_DIR}/include when KERNELSOURCEDIR is not 
> defined.  What is the reason for this change?

No you've interpreted the change wrong. The "else" part of the if clause
ensures this is not removed.

Here is how the make if call works:

$(if <string>,<string for true clase>,<string for else clause>)

What my patch does do is *add* this define in for the case when
KERNELSOURCEDIR is defined, but at the correct source location.

I'd like to ask again if anybody is testing this builds properly against
an out of place kernel build, as I've needed these patches across
several different machines running different distributions at work, so
I'm very sceptical that it can work for many people, doesn't mean I'm
right though..

Thanks, James

On Mon, Jun 08, 2009 at 11:42:05AM +0300, Avi Kivity wrote:
> James Pike wrote:
> > Use correct architecture includes when kernel source and build directory
> > are different.
> > Signed-off-by: James Pike <james@chilon.net>
> >   
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -27,8 +27,9 @@ all:: prerequisite
> >  #	include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
> >  	$(MAKE) -C $(KERNELDIR) M=`pwd` \
> >  		LINUXINCLUDE="-I`pwd`/include -Iinclude \
> > -		$(if $(KERNELSOURCEDIR),-Iinclude2 -I$(KERNELSOURCEDIR)/include) \
> > -		-Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
> > +		$(if $(KERNELSOURCEDIR),\
> > +			-Iinclude2 -I$(KERNELSOURCEDIR)/include -I$(KERNELSOURCEDIR)/arch/${ARCH_DIR}/include, \
> > +			-Iarch/${ARCH_DIR}/include) -I`pwd`/include-compat \
> >  		-include include/linux/autoconf.h \
> >  		-include `pwd`/$(ARCH_DIR)/external-module-compat.h $(module_defines)" \
> >  		"$$@"
> >   
> 
> 
> -- 
> error compiling committee.c: too many arguments to function
> 

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

end of thread, other threads:[~2009-08-15 22:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03 12:58 [PATCH] fix include paths when the kernel source and build directory are different James Pike
2009-06-08  8:31 ` Jan Kiszka
2009-06-08  8:42 ` Avi Kivity
2009-06-08  9:04   ` Jan Kiszka
2009-06-08  9:33     ` Avi Kivity
2009-08-15 22:33   ` James Pike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.