public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: remove duplicate -I flag in addtree
@ 2010-09-27  2:11 matt mooney
  2010-09-27  8:24 ` Américo Wang
  2010-10-04 15:10 ` Michal Marek
  0 siblings, 2 replies; 4+ messages in thread
From: matt mooney @ 2010-09-27  2:11 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel, kernel-janitors

When O= is used, any -I flag given that is not an absolute path gets
duplicated. The $(1) appended to the conditional clause covers the
absolute case, but due to being outside of the conditional statement
it gets added everytime.

Signed-off-by: matt mooney <mfm@muteddisk.com>
---
 scripts/Kbuild.include |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index ed2773e..08c74ed 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -158,7 +158,7 @@ modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
 # Prefix -I with $(srctree) if it is not an absolute path.
 # skip if -I has no parameter
 addtree = $(if $(patsubst -I%,%,$(1)), \
-$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
+$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)))
 
 # Find all -I options and call addtree
 flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
-- 
1.7.2.1


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

* Re: [PATCH] kbuild: remove duplicate -I flag in addtree
  2010-09-27  2:11 [PATCH] kbuild: remove duplicate -I flag in addtree matt mooney
@ 2010-09-27  8:24 ` Américo Wang
  2010-10-04 15:10 ` Michal Marek
  1 sibling, 0 replies; 4+ messages in thread
From: Américo Wang @ 2010-09-27  8:24 UTC (permalink / raw)
  To: matt mooney; +Cc: Michal Marek, linux-kbuild, linux-kernel, kernel-janitors

On Sun, Sep 26, 2010 at 07:11:12PM -0700, matt mooney wrote:
>When O= is used, any -I flag given that is not an absolute path gets
>duplicated. The $(1) appended to the conditional clause covers the
>absolute case, but due to being outside of the conditional statement
>it gets added everytime.
>
>Signed-off-by: matt mooney <mfm@muteddisk.com>

Acked-by: WANG Cong <xiyou.wangcong@gmail.com>

>---
> scripts/Kbuild.include |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
>index ed2773e..08c74ed 100644
>--- a/scripts/Kbuild.include
>+++ b/scripts/Kbuild.include
>@@ -158,7 +158,7 @@ modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
> # Prefix -I with $(srctree) if it is not an absolute path.
> # skip if -I has no parameter
> addtree = $(if $(patsubst -I%,%,$(1)), \
>-$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
>+$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)))
> 
> # Find all -I options and call addtree
> flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))


The original code also missed a comma, this patch fixes it.

Thanks!

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

* Re: [PATCH] kbuild: remove duplicate -I flag in addtree
  2010-09-27  2:11 [PATCH] kbuild: remove duplicate -I flag in addtree matt mooney
  2010-09-27  8:24 ` Américo Wang
@ 2010-10-04 15:10 ` Michal Marek
  2010-10-05  3:30   ` matt mooney
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Marek @ 2010-10-04 15:10 UTC (permalink / raw)
  To: matt mooney; +Cc: linux-kbuild, linux-kernel, kernel-janitors

On Sun, Sep 26, 2010 at 07:11:12PM -0700, matt mooney wrote:
> When O= is used, any -I flag given that is not an absolute path gets
> duplicated. The $(1) appended to the conditional clause covers the
> absolute case, but due to being outside of the conditional statement
> it gets added everytime.
> 
> Signed-off-by: matt mooney <mfm@muteddisk.com>
> ---
>  scripts/Kbuild.include |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index ed2773e..08c74ed 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -158,7 +158,7 @@ modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
>  # Prefix -I with $(srctree) if it is not an absolute path.
>  # skip if -I has no parameter
>  addtree = $(if $(patsubst -I%,%,$(1)), \
> -$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
> +$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)))

$ mkdir _build-new; make O=_build-new defconfig; make O=_build-new V=1 all
fails with

  perl /home/mmarek/linux-2.6/kernel/timeconst.pl 1000 > kernel/timeconst.h
  gcc -Wp,-MD,kernel/.time.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.5/include -I/home/mmarek/linux-2.6/arch/x86/include -Iinclude  -I/home/mmarek/linux-2.6/include -include include/generated/autoconf.h  -I/home/mmarek/linux-2.6/kernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(time)"  -D"KBUILD_MODNAME=KBUILD_STR(time)"  -c -o kernel/time.o /home/mmarek/linux-2.6/kernel/time.c
/home/mmarek/linux-2.6/kernel/time.c:44:23: fatal error: timeconst.h: No such file or directory

The correct gcc line without your patch is 
  gcc -Wp,-MD,kernel/.time.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.5/include -I/home/mmarek/linux-2.6/arch/x86/include -Iinclude  -I/home/mmarek/linux-2.6/include -include include/generated/autoconf.h  -I/home/mmarek/linux-2.6/kernel -Ikernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(time)"  -D"KBUILD_MODNAME=KBUILD_STR(time)"  -c -o kernel/time.o /home/mmarek/linux-2.6/kernel/time.c

The difference is that with your patch it is lacking the -Ikernel
include, so it does not search for generated header files in $(obj).

Michal

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

* Re: [PATCH] kbuild: remove duplicate -I flag in addtree
  2010-10-04 15:10 ` Michal Marek
@ 2010-10-05  3:30   ` matt mooney
  0 siblings, 0 replies; 4+ messages in thread
From: matt mooney @ 2010-10-05  3:30 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel, kernel-janitors

On 17:10 Mon 04 Oct     , Michal Marek wrote:
> On Sun, Sep 26, 2010 at 07:11:12PM -0700, matt mooney wrote:
> > When O= is used, any -I flag given that is not an absolute path gets
> > duplicated. The $(1) appended to the conditional clause covers the
> > absolute case, but due to being outside of the conditional statement
> > it gets added everytime.
> > 
> > Signed-off-by: matt mooney <mfm@muteddisk.com>
> > ---
> >  scripts/Kbuild.include |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> > index ed2773e..08c74ed 100644
> > --- a/scripts/Kbuild.include
> > +++ b/scripts/Kbuild.include
> > @@ -158,7 +158,7 @@ modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
> >  # Prefix -I with $(srctree) if it is not an absolute path.
> >  # skip if -I has no parameter
> >  addtree = $(if $(patsubst -I%,%,$(1)), \
> > -$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
> > +$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)))
> 
> $ mkdir _build-new; make O=_build-new defconfig; make O=_build-new V=1 all
> fails with
> 
>   perl /home/mmarek/linux-2.6/kernel/timeconst.pl 1000 > kernel/timeconst.h
>   gcc -Wp,-MD,kernel/.time.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.5/include -I/home/mmarek/linux-2.6/arch/x86/include -Iinclude  -I/home/mmarek/linux-2.6/include -include include/generated/autoconf.h  -I/home/mmarek/linux-2.6/kernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(time)"  -D"KBUILD_MODNAME=KBUILD_STR(time)"  -c -o kernel/time.o /home/mmarek
> /linux-2.6/kernel/time.c
> /home/mmarek/linux-2.6/kernel/time.c:44:23: fatal error: timeconst.h: No such file or directory
> 
> The correct gcc line without your patch is 
>   gcc -Wp,-MD,kernel/.time.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.5/include -I/home/mmarek/linux-2.6/arch/x86/include -Iinclude  -I/home/mmarek/linux-2.6/include -include include/generated/autoconf.h  -I/home/mmarek/linux-2.6/kernel -Ikernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(time)"  -D"KBUILD_MODNAME=KBUILD_STR(time)"  -c -o kernel/time.o /ho
> me/mmarek/linux-2.6/kernel/time.c
> 
> The difference is that with your patch it is lacking the -Ikernel
> include, so it does not search for generated header files in $(obj).

Ugh! I tested it for an external module and I built every driver under media/
thinking this covered all cases. I completely forgot about generated files.

Thanks,
mfm

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

end of thread, other threads:[~2010-10-05  3:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27  2:11 [PATCH] kbuild: remove duplicate -I flag in addtree matt mooney
2010-09-27  8:24 ` Américo Wang
2010-10-04 15:10 ` Michal Marek
2010-10-05  3:30   ` matt mooney

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