* KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice.
@ 2008-10-28 13:36 Ian Campbell
2008-10-29 19:07 ` Sam Ravnborg
0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2008-10-28 13:36 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kbuild
Architectures which have moved their includes to arch/<ARCH>/include
now list the headers twice in the source listing used by "make
cscope" and friends, causing those tools to list symbols twice.
Skipping these files in the ALLSOURCE_ARCHS pass rather than removing
the ALLINCLUDE_ARCHS pass preserves the semantics of the later.
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: linux-kbuild@vger.kernel.org
diff -r a613b893f5b5 Makefile
--- a/Makefile Mon Oct 27 10:29:49 2008 +0000
+++ b/Makefile Tue Oct 28 13:33:04 2008 +0000
@@ -1435,7 +1435,8 @@
define find-sources
( for arch in $(ALLSOURCE_ARCHS) ; do \
find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
- -name $1 -print; \
+ -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
+ -o -name $1 -print; \
done ; \
find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
-name $1 -print; \
--
Ian Campbell
Current Noise: Exodus - The Garden Of Bleeding
Whatever you want to do, you have to do something else first.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice.
2008-10-28 13:36 KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice Ian Campbell
@ 2008-10-29 19:07 ` Sam Ravnborg
2008-10-29 19:51 ` Ian Campbell
2008-10-30 11:02 ` Ian Campbell
0 siblings, 2 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-10-29 19:07 UTC (permalink / raw)
To: Ian Campbell; +Cc: linux-kbuild
On Tue, Oct 28, 2008 at 01:36:25PM +0000, Ian Campbell wrote:
> Architectures which have moved their includes to arch/<ARCH>/include
> now list the headers twice in the source listing used by "make
> cscope" and friends, causing those tools to list symbols twice.
>
> Skipping these files in the ALLSOURCE_ARCHS pass rather than removing
> the ALLINCLUDE_ARCHS pass preserves the semantics of the later.
>
> Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: linux-kbuild@vger.kernel.org
>
> diff -r a613b893f5b5 Makefile
> --- a/Makefile Mon Oct 27 10:29:49 2008 +0000
> +++ b/Makefile Tue Oct 28 13:33:04 2008 +0000
> @@ -1435,7 +1435,8 @@
> define find-sources
> ( for arch in $(ALLSOURCE_ARCHS) ; do \
> find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
> - -name $1 -print; \
> + -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
> + -o -name $1 -print; \
> done ; \
> find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
> -name $1 -print; \
>
Hi Ian.
I would much rather prefer to see a patch that
- support the platforms of arm and others
- uses the fact that all arch have their header files moved
to arch/$ARCH/include
[Ignore the archs that are lacking behind]
And if we could simplify this "find file" list on top of that it would be extra bonus.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice.
2008-10-29 19:07 ` Sam Ravnborg
@ 2008-10-29 19:51 ` Ian Campbell
2008-10-29 21:29 ` Sam Ravnborg
2008-10-30 11:02 ` Ian Campbell
1 sibling, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2008-10-29 19:51 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kbuild
On Wed, 2008-10-29 at 20:07 +0100, Sam Ravnborg wrote:
> On Tue, Oct 28, 2008 at 01:36:25PM +0000, Ian Campbell wrote:
> > Architectures which have moved their includes to arch/<ARCH>/include
> > now list the headers twice in the source listing used by "make
> > cscope" and friends, causing those tools to list symbols twice.
> >
> > Skipping these files in the ALLSOURCE_ARCHS pass rather than removing
> > the ALLINCLUDE_ARCHS pass preserves the semantics of the later.
> >
> > Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > Cc: linux-kbuild@vger.kernel.org
> >
> > diff -r a613b893f5b5 Makefile
> > --- a/Makefile Mon Oct 27 10:29:49 2008 +0000
> > +++ b/Makefile Tue Oct 28 13:33:04 2008 +0000
> > @@ -1435,7 +1435,8 @@
> > define find-sources
> > ( for arch in $(ALLSOURCE_ARCHS) ; do \
> > find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
> > - -name $1 -print; \
> > + -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
> > + -o -name $1 -print; \
> > done ; \
> > find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
> > -name $1 -print; \
> >
>
> Hi Ian.
>
> I would much rather prefer to see a patch that
> - support the platforms of arm and others
How do you mean?
$ ls arch/arm/include/
asm/
so it'll work as well for arm as it does for any other architecture.
All this patch does is stop the ALLSOURCE_ARCH loop from covering files
which are also picked up by the ALLINCLUDE_ARCH loop. Including those
files twice is a regression from before the headers got moved.
> - uses the fact that all arch have their header files moved
> to arch/$ARCH/include
> [Ignore the archs that are lacking behind]
in that case you would simply also remove the :
test -e $(__srctree)include/asm-$${arch} && \
find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
-name $1 -print; \
from the ALLINCLUDE_ARCHS loop.
> And if we could simplify this "find file" list on top of that it would be extra bonus.
Unless you want to get rid of the distinction between ALLINCLUDE_ARCHS
and ALLSOURCE_ARCHS I don't think it can get any simpler. If you did
want to get rid of that distinction then it would simply be a case of
removing the ALLINCLUDE_ARCHS loop and ignoring this patch.
Ian.
--
Ian Campbell
Perhaps they will have to outlaw sending random lists of words. fee fie
foe foo [sic]
-- Larry Wall in <199710311916.LAA19760@wall.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice.
2008-10-29 19:51 ` Ian Campbell
@ 2008-10-29 21:29 ` Sam Ravnborg
0 siblings, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-10-29 21:29 UTC (permalink / raw)
To: Ian Campbell; +Cc: linux-kbuild
On Wed, Oct 29, 2008 at 07:51:13PM +0000, Ian Campbell wrote:
> On Wed, 2008-10-29 at 20:07 +0100, Sam Ravnborg wrote:
> > On Tue, Oct 28, 2008 at 01:36:25PM +0000, Ian Campbell wrote:
> > > Architectures which have moved their includes to arch/<ARCH>/include
> > > now list the headers twice in the source listing used by "make
> > > cscope" and friends, causing those tools to list symbols twice.
> > >
> > > Skipping these files in the ALLSOURCE_ARCHS pass rather than removing
> > > the ALLINCLUDE_ARCHS pass preserves the semantics of the later.
> > >
> > > Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> > > Cc: Sam Ravnborg <sam@ravnborg.org>
> > > Cc: linux-kbuild@vger.kernel.org
> > >
> > > diff -r a613b893f5b5 Makefile
> > > --- a/Makefile Mon Oct 27 10:29:49 2008 +0000
> > > +++ b/Makefile Tue Oct 28 13:33:04 2008 +0000
> > > @@ -1435,7 +1435,8 @@
> > > define find-sources
> > > ( for arch in $(ALLSOURCE_ARCHS) ; do \
> > > find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
> > > - -name $1 -print; \
> > > + -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
> > > + -o -name $1 -print; \
> > > done ; \
> > > find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
> > > -name $1 -print; \
> > >
> >
> > Hi Ian.
> >
> > I would much rather prefer to see a patch that
> > - support the platforms of arm and others
>
> How do you mean?
>
> $ ls arch/arm/include/
> asm/
>
> so it'll work as well for arm as it does for any other architecture.
fyi - I have applied your patch to kbuild-fixes.
I hope this stuff can be simplified one day.
I continue to see a steady stream of patches dealing with tags and cscope.
Maybe the right thing to do is to just move it all out in a shell
script so we do not clutter the makefile with all this.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice.
2008-10-29 19:07 ` Sam Ravnborg
2008-10-29 19:51 ` Ian Campbell
@ 2008-10-30 11:02 ` Ian Campbell
2008-10-30 11:09 ` Ian Campbell
1 sibling, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2008-10-30 11:02 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kbuild
On Wed, 2008-10-29 at 20:07 +0100, Sam Ravnborg wrote:
> - uses the fact that all arch have their header files moved
> to arch/$ARCH/include
> [Ignore the archs that are lacking behind]
>
> And if we could simplify this "find file" list on top of that it would
> be extra bonus.
Assuming all headers have been moved (which isn't true yet so currently
you'd get all kinds of extra headers in the list) then this patch on top
of the one I sent yesterday simplifies things a bit. It basically
includes a revert of the first one and instead only considers those
members of ALLINCLUDE_ARCHS which are not in ALLSOURCE_ARCHS, IOW it
removes the other duplicate entry compared with the previous patch.
It also stops special casing include/asm-* at all and removes a bunch of
other legacy include/asm-* handling.
I can see one further simplifications which is to make the final
find $(__srctree) $(RCS_FIND_IGNORE) \
\( -name include
into
find $(__srctree) $(RCS_FIND_IGNORE) \
\( -wholename $(__srctree)/include/config
which then allows
find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
-name $1 -print; \
find $(__srctree)include $(RCS_FIND_IGNORE) \
-name config -prune -o -name $1 -print; \
to be removed. However it also adds a bunch of new files such as
include/acpi include/scsi etc. Arguably they should be included anyway.
I don't really understand um but I think the
ifeq ($(ARCH),um)
ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH)
might be wrong since SUBARCH is i386 or x86_64 and they no longer exist.
Should it be SRCARCH?
Subject: kbuild: simplify find-sources by assuming all arch headers are under arch/*/include
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
diff -r 35ad5038b666 Makefile
--- a/Makefile Wed Oct 29 15:28:48 2008 +0000
+++ b/Makefile Thu Oct 30 10:51:57 2008 +0000
@@ -1432,27 +1432,22 @@
ALLSOURCE_ARCHS := $(SRCARCH)
+EXTRAINCLUDE_ARCHS := $(filter-out $(ALLSOURCE_ARCHS),$(ALLINCLUDE_ARCHS))
+
define find-sources
( for arch in $(ALLSOURCE_ARCHS) ; do \
find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
- -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
- -o -name $1 -print; \
+ -name $1 -print; \
done ; \
find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
-name $1 -print; \
find $(__srctree)include $(RCS_FIND_IGNORE) \
- \( -name config -o -name 'asm-*' \) -prune \
- -o -name $1 -print; \
- for arch in $(ALLINCLUDE_ARCHS) ; do \
- test -e $(__srctree)include/asm-$${arch} && \
- find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
- -name $1 -print; \
+ -name config -prune -o -name $1 -print; \
+ for arch in $(EXTRAINCLUDE_ARCHS) ; do \
test -e $(__srctree)arch/$${arch}/include/asm && \
find $(__srctree)arch/$${arch}/include/asm $(RCS_FIND_IGNORE) \
-name $1 -print; \
done ; \
- find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
- -name $1 -print; \
find $(__srctree) $(RCS_FIND_IGNORE) \
\( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
-name $1 -print; \
--
Ian Campbell
Current Noise: Motörhead - The Road Crew
QOTD:
"Unlucky? If I bought a pumpkin farm, they'd cancel Halloween."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice.
2008-10-30 11:02 ` Ian Campbell
@ 2008-10-30 11:09 ` Ian Campbell
0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2008-10-30 11:09 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kbuild
On Thu, 2008-10-30 at 11:02 +0000, Ian Campbell wrote:
>
> I can see one further simplifications which is to make the final
> find $(__srctree) $(RCS_FIND_IGNORE) \
> \( -name include
> into
> find $(__srctree) $(RCS_FIND_IGNORE) \
> \( -wholename $(__srctree)/include/config
> which then allows
> find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE)
> \
> -name $1 -print; \
> find $(__srctree)include $(RCS_FIND_IGNORE) \
> -name config -prune -o -name $1 -print; \
> to be removed. However it also adds a bunch of new files such as
> include/acpi include/scsi etc. Arguably they should be included
> anyway.
In patch form that looks like (on top of the patch just now). And
include/scsi aren't new, they were included by the find
$(__srctree)/include previously.
diff -r f113cec1a44e Makefile
--- a/Makefile Thu Oct 30 11:06:22 2008 +0000
+++ b/Makefile Thu Oct 30 11:07:37 2008 +0000
@@ -1439,17 +1439,13 @@
find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
-name $1 -print; \
done ; \
- find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
- -name $1 -print; \
- find $(__srctree)include $(RCS_FIND_IGNORE) \
- -name config -prune -o -name $1 -print; \
for arch in $(EXTRAINCLUDE_ARCHS) ; do \
test -e $(__srctree)arch/$${arch}/include/asm && \
find $(__srctree)arch/$${arch}/include/asm $(RCS_FIND_IGNORE) \
-name $1 -print; \
done ; \
find $(__srctree) $(RCS_FIND_IGNORE) \
- \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
+ \( -wholename $(__srctree)include/config -o -name arch -o -name '.tmp_*' \) -prune -o \
-name $1 -print; \
)
endef
>
--
Ian Campbell
Current Noise: Venom - Witching Hour
Hitchcock's Staple Principle:
The stapler runs out of staples only while you are trying to
staple something.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-10-30 11:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28 13:36 KBUILD: do not include arch/<ARCH>/include/asm in find-sources twice Ian Campbell
2008-10-29 19:07 ` Sam Ravnborg
2008-10-29 19:51 ` Ian Campbell
2008-10-29 21:29 ` Sam Ravnborg
2008-10-30 11:02 ` Ian Campbell
2008-10-30 11:09 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox