* [PATCH v2 0/2] kbuild: Remove stale asm-generic wrappers @ 2016-01-19 13:37 James Hogan 2016-01-19 13:37 ` [PATCH v2 1/2] kbuild, x86: Track generated headers with generated-y James Hogan 2016-01-19 13:37 ` [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers James Hogan 0 siblings, 2 replies; 11+ messages in thread From: James Hogan @ 2016-01-19 13:37 UTC (permalink / raw) To: Michal Marek Cc: linux-kernel, Heinrich Schuchardt, James Hogan, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Jonathan Corbet, Arnd Bergmann, Ralf Baechle, Paul Burton, Florian Fainelli, linux-kbuild, x86, linux-doc, linux-arch, linux-mips This patchset attempts to fix kbuild to automatically remove stale asm-generic wrappers, i.e. when files are removed from generic-y and added directly into arch/*/include/uapi/asm/, but where the existing wrapper in arch/*/include/generated/asm/ continues to be used. MIPS was recently burned by this in v4.3 (see patch 2), with continuing reports of build failures when people upgrade their trees, which go away after arch/mips/include/generated is removed (or reportedly make mrproper/distclean). It is particularly irritating during bisection. Changes in v2: - New patch 1 to add tracking of generated headers that aren't generic-y wrappers, via generated-y, particularly for x86 (thanks to kbuild test robot). - Rewrite a bit, drawing inspiration from Makefile.headersinst. - Exclude genhdr-y and generated-y (thanks to kbuild test robot). James Hogan (2): kbuild, x86: Track generated headers with generated-y kbuild: Remove stale asm-generic wrappers Documentation/kbuild/makefiles.txt | 14 ++++++++++++++ arch/x86/include/asm/Kbuild | 6 ++++++ scripts/Makefile.asm-generic | 17 ++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) Cc: Michal Marek <mmarek@suse.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: linux-kbuild@vger.kernel.org Cc: x86@kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-mips@linux-mips.org -- 2.4.10 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/2] kbuild, x86: Track generated headers with generated-y 2016-01-19 13:37 [PATCH v2 0/2] kbuild: Remove stale asm-generic wrappers James Hogan @ 2016-01-19 13:37 ` James Hogan 2016-01-19 13:37 ` [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers James Hogan 1 sibling, 0 replies; 11+ messages in thread From: James Hogan @ 2016-01-19 13:37 UTC (permalink / raw) To: Michal Marek Cc: linux-kernel, Heinrich Schuchardt, James Hogan, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Jonathan Corbet, linux-kbuild, x86, linux-doc Track generated header files which aren't already in genhdr-y, alongside generic-y wrappers in the */include/generated/[uapi/]asm/ directories. Currently only x86 generates extra headers in these directories, for the purposes of enumerating system calls for different ABIs, and xen hypercalls. This will allow the asm-generic wrapper handling code to remove stale wrappers when files are removed from generic-y, without also removing these headers which are generated separately. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Michal Marek <mmarek@suse.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-kbuild@vger.kernel.org Cc: x86@kernel.org Cc: linux-doc@vger.kernel.org --- Changes in v2: - New patch (thanks to kbuild test robot). --- Documentation/kbuild/makefiles.txt | 14 ++++++++++++++ arch/x86/include/asm/Kbuild | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 13f888a02a3d..385a5ef41c17 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -47,6 +47,7 @@ This document describes the Linux kernel Makefiles. --- 7.2 genhdr-y --- 7.3 destination-y --- 7.4 generic-y + --- 7.5 generated-y === 8 Kbuild Variables === 9 Makefile language @@ -1319,6 +1320,19 @@ See subsequent chapter for the syntax of the Kbuild file. Example: termios.h #include <asm-generic/termios.h> + --- 7.5 generated-y + + If an architecture generates other header files alongside generic-y + wrappers, and not included in genhdr-y, then generated-y specifies + them. + + This prevents them being treated as stale asm-generic wrappers and + removed. + + Example: + #arch/x86/include/asm/Kbuild + generated-y += syscalls_32.h + === 8 Kbuild Variables The top Makefile exports the following variables: diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index aeac434c9feb..2cfed174e3c9 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -1,5 +1,11 @@ +generated-y += syscalls_32.h +generated-y += syscalls_64.h +generated-y += unistd_32_ia32.h +generated-y += unistd_64_x32.h +generated-y += xen-hypercalls.h + genhdr-y += unistd_32.h genhdr-y += unistd_64.h genhdr-y += unistd_x32.h -- 2.4.10 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-19 13:37 [PATCH v2 0/2] kbuild: Remove stale asm-generic wrappers James Hogan 2016-01-19 13:37 ` [PATCH v2 1/2] kbuild, x86: Track generated headers with generated-y James Hogan @ 2016-01-19 13:37 ` James Hogan 2016-01-19 14:09 ` Arnd Bergmann ` (2 more replies) 1 sibling, 3 replies; 11+ messages in thread From: James Hogan @ 2016-01-19 13:37 UTC (permalink / raw) To: Michal Marek Cc: linux-kernel, Heinrich Schuchardt, James Hogan, Arnd Bergmann, Ralf Baechle, Paul Burton, Florian Fainelli, linux-kbuild, linux-arch, linux-mips When a header file is removed from generic-y (often accompanied by the addition of an arch specific header), the generated wrapper file will persist, and in some cases may still take precedence over the new arch header. For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended context") removed ucontext.h from generic-y in arch/mips/include/asm/, and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of the wrapper when reusing a dirty build tree resulted in build failures in arch/mips/kernel/signal.c: arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ return &uc->uc_extcontext; ^ Fix by detecting and removing wrapper headers in generated header directories that do not correspond to a filename in generic-y, genhdr-y, or the newly introduced generated-y. Reported-by: Jacek Anaszewski <j.anaszewski@samsung.com> Reported-by: Hauke Mehrtens <hauke@hauke-m.de> Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Michal Marek <mmarek@suse.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-mips@linux-mips.org --- Changes in v2: - Rewrite a bit, drawing inspiration from Makefile.headersinst. - Exclude genhdr-y and generated-y (thanks to kbuild test robot). --- scripts/Makefile.asm-generic | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic index 045e0098e962..24c29f16f029 100644 --- a/scripts/Makefile.asm-generic +++ b/scripts/Makefile.asm-generic @@ -13,11 +13,26 @@ include scripts/Kbuild.include # Create output directory if not already present _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) +# Stale wrappers when the corresponding files are removed from generic-y +# need removing. +generated-y := $(generic-y) $(genhdr-y) $(generated-y) +all-files := $(patsubst %, $(obj)/%, $(generated-y)) +old-headers := $(wildcard $(obj)/*.h) +unwanted := $(filter-out $(all-files),$(old-headers)) + quiet_cmd_wrap = WRAP $@ cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ -all: $(patsubst %, $(obj)/%, $(generic-y)) +quiet_cmd_remove = REMOVE $(unwanted) +cmd_remove = rm -f $(unwanted) + +all: $(patsubst %, $(obj)/%, $(generic-y)) FORCE + $(if $(unwanted),$(call cmd,remove),) @: $(obj)/%.h: $(call cmd,wrap) + +.PHONY: $(PHONY) +PHONY += FORCE +FORCE: ; -- 2.4.10 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-19 13:37 ` [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers James Hogan @ 2016-01-19 14:09 ` Arnd Bergmann 2016-01-19 14:22 ` James Hogan 2016-01-20 18:55 ` Florian Fainelli 2016-01-21 0:03 ` Paul Burton 2 siblings, 1 reply; 11+ messages in thread From: Arnd Bergmann @ 2016-01-19 14:09 UTC (permalink / raw) To: James Hogan Cc: Michal Marek, linux-kernel, Heinrich Schuchardt, Ralf Baechle, Paul Burton, Florian Fainelli, linux-kbuild, linux-arch, linux-mips On Tuesday 19 January 2016 13:37:50 James Hogan wrote: > When a header file is removed from generic-y (often accompanied by the > addition of an arch specific header), the generated wrapper file will > persist, and in some cases may still take precedence over the new arch > header. > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > the wrapper when reusing a dirty build tree resulted in build failures > in arch/mips/kernel/signal.c: > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > return &uc->uc_extcontext; > ^ > > Fix by detecting and removing wrapper headers in generated header > directories that do not correspond to a filename in generic-y, genhdr-y, > or the newly introduced generated-y. Good idea. Acked-by: Arnd Bergmann <arnd@arndb.de> Can you merge this through the mips tree, or do you need me to pick it up through asm-generic? ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-19 14:09 ` Arnd Bergmann @ 2016-01-19 14:22 ` James Hogan 2016-01-19 14:27 ` Arnd Bergmann 0 siblings, 1 reply; 11+ messages in thread From: James Hogan @ 2016-01-19 14:22 UTC (permalink / raw) To: Arnd Bergmann Cc: Michal Marek, linux-kernel, Heinrich Schuchardt, Ralf Baechle, Paul Burton, Florian Fainelli, linux-kbuild, linux-arch, linux-mips [-- Attachment #1: Type: text/plain, Size: 1599 bytes --] On Tue, Jan 19, 2016 at 03:09:14PM +0100, Arnd Bergmann wrote: > On Tuesday 19 January 2016 13:37:50 James Hogan wrote: > > When a header file is removed from generic-y (often accompanied by the > > addition of an arch specific header), the generated wrapper file will > > persist, and in some cases may still take precedence over the new arch > > header. > > > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > > the wrapper when reusing a dirty build tree resulted in build failures > > in arch/mips/kernel/signal.c: > > > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > > return &uc->uc_extcontext; > > ^ > > > > Fix by detecting and removing wrapper headers in generated header > > directories that do not correspond to a filename in generic-y, genhdr-y, > > or the newly introduced generated-y. > > Good idea. > > Acked-by: Arnd Bergmann <arnd@arndb.de> Thanks Arnd > Can you merge this through the mips tree, or do you need me to pick it > up through asm-generic? I was envisaging the kbuild tree tbh, but I don't really mind how it gets merged. This patch depends on patch 1, which adds generated-y to x86 so we don't delete their other generated headers, but other than that it doesn't really have any dependencies. Cheers James [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-19 14:22 ` James Hogan @ 2016-01-19 14:27 ` Arnd Bergmann 2016-02-23 9:51 ` James Hogan 0 siblings, 1 reply; 11+ messages in thread From: Arnd Bergmann @ 2016-01-19 14:27 UTC (permalink / raw) To: James Hogan Cc: Michal Marek, linux-kernel, Heinrich Schuchardt, Ralf Baechle, Paul Burton, Florian Fainelli, linux-kbuild, linux-arch, linux-mips On Tuesday 19 January 2016 14:22:13 James Hogan wrote: > On Tue, Jan 19, 2016 at 03:09:14PM +0100, Arnd Bergmann wrote: > > On Tuesday 19 January 2016 13:37:50 James Hogan wrote: > > > When a header file is removed from generic-y (often accompanied by the > > > addition of an arch specific header), the generated wrapper file will > > > persist, and in some cases may still take precedence over the new arch > > > header. > > > > > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > > > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > > > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > > > the wrapper when reusing a dirty build tree resulted in build failures > > > in arch/mips/kernel/signal.c: > > > > > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > > > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > > > return &uc->uc_extcontext; > > > ^ > > > > > > Fix by detecting and removing wrapper headers in generated header > > > directories that do not correspond to a filename in generic-y, genhdr-y, > > > or the newly introduced generated-y. > > > > Good idea. > > > > Acked-by: Arnd Bergmann <arnd@arndb.de> > > Thanks Arnd > > > Can you merge this through the mips tree, or do you need me to pick it > > up through asm-generic? > > I was envisaging the kbuild tree tbh, but I don't really mind how it > gets merged. This patch depends on patch 1, which adds generated-y to > x86 so we don't delete their other generated headers, but other than > that it doesn't really have any dependencies. Ok, the kbuild tree works fine too, and I guess the x86 tree would also be fine if that helps avoid the dependency. Arnd ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-19 14:27 ` Arnd Bergmann @ 2016-02-23 9:51 ` James Hogan 2016-04-21 18:44 ` James Hogan 0 siblings, 1 reply; 11+ messages in thread From: James Hogan @ 2016-02-23 9:51 UTC (permalink / raw) To: Michal Marek Cc: Arnd Bergmann, linux-kernel, Heinrich Schuchardt, Ralf Baechle, Paul Burton, Florian Fainelli, linux-kbuild, linux-arch, linux-mips [-- Attachment #1: Type: text/plain, Size: 2089 bytes --] Hi Michal, On Tue, Jan 19, 2016 at 03:27:24PM +0100, Arnd Bergmann wrote: > On Tuesday 19 January 2016 14:22:13 James Hogan wrote: > > On Tue, Jan 19, 2016 at 03:09:14PM +0100, Arnd Bergmann wrote: > > > On Tuesday 19 January 2016 13:37:50 James Hogan wrote: > > > > When a header file is removed from generic-y (often accompanied by the > > > > addition of an arch specific header), the generated wrapper file will > > > > persist, and in some cases may still take precedence over the new arch > > > > header. > > > > > > > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > > > > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > > > > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > > > > the wrapper when reusing a dirty build tree resulted in build failures > > > > in arch/mips/kernel/signal.c: > > > > > > > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > > > > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > > > > return &uc->uc_extcontext; > > > > ^ > > > > > > > > Fix by detecting and removing wrapper headers in generated header > > > > directories that do not correspond to a filename in generic-y, genhdr-y, > > > > or the newly introduced generated-y. > > > > > > Good idea. > > > > > > Acked-by: Arnd Bergmann <arnd@arndb.de> > > > > Thanks Arnd > > > > > Can you merge this through the mips tree, or do you need me to pick it > > > up through asm-generic? > > > > I was envisaging the kbuild tree tbh, but I don't really mind how it > > gets merged. This patch depends on patch 1, which adds generated-y to > > x86 so we don't delete their other generated headers, but other than > > that it doesn't really have any dependencies. > > Ok, the kbuild tree works fine too, and I guess the x86 tree would > also be fine if that helps avoid the dependency. Were you okay to take these patches, or would you prefer they go via the MIPS tree? Thanks James [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-02-23 9:51 ` James Hogan @ 2016-04-21 18:44 ` James Hogan 0 siblings, 0 replies; 11+ messages in thread From: James Hogan @ 2016-04-21 18:44 UTC (permalink / raw) To: Michal Marek Cc: Arnd Bergmann, linux-kernel, Heinrich Schuchardt, Ralf Baechle, Paul Burton, Florian Fainelli, linux-kbuild, linux-arch, linux-mips [-- Attachment #1: Type: text/plain, Size: 2387 bytes --] On Tue, Feb 23, 2016 at 09:51:07AM +0000, James Hogan wrote: > Hi Michal, > > On Tue, Jan 19, 2016 at 03:27:24PM +0100, Arnd Bergmann wrote: > > On Tuesday 19 January 2016 14:22:13 James Hogan wrote: > > > On Tue, Jan 19, 2016 at 03:09:14PM +0100, Arnd Bergmann wrote: > > > > On Tuesday 19 January 2016 13:37:50 James Hogan wrote: > > > > > When a header file is removed from generic-y (often accompanied by the > > > > > addition of an arch specific header), the generated wrapper file will > > > > > persist, and in some cases may still take precedence over the new arch > > > > > header. > > > > > > > > > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > > > > > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > > > > > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > > > > > the wrapper when reusing a dirty build tree resulted in build failures > > > > > in arch/mips/kernel/signal.c: > > > > > > > > > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > > > > > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > > > > > return &uc->uc_extcontext; > > > > > ^ > > > > > > > > > > Fix by detecting and removing wrapper headers in generated header > > > > > directories that do not correspond to a filename in generic-y, genhdr-y, > > > > > or the newly introduced generated-y. > > > > > > > > Good idea. > > > > > > > > Acked-by: Arnd Bergmann <arnd@arndb.de> > > > > > > Thanks Arnd > > > > > > > Can you merge this through the mips tree, or do you need me to pick it > > > > up through asm-generic? > > > > > > I was envisaging the kbuild tree tbh, but I don't really mind how it > > > gets merged. This patch depends on patch 1, which adds generated-y to > > > x86 so we don't delete their other generated headers, but other than > > > that it doesn't really have any dependencies. > > > > Ok, the kbuild tree works fine too, and I guess the x86 tree would > > also be fine if that helps avoid the dependency. > > Were you okay to take these patches, or would you prefer they go via the > MIPS tree? I'm keen for these two patches to make their way upstream one way or another. Ralf: Since it affects MIPS, would you be able to take them? Cheers James [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-19 13:37 ` [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers James Hogan 2016-01-19 14:09 ` Arnd Bergmann @ 2016-01-20 18:55 ` Florian Fainelli 2016-01-21 0:03 ` Paul Burton 2 siblings, 0 replies; 11+ messages in thread From: Florian Fainelli @ 2016-01-20 18:55 UTC (permalink / raw) To: James Hogan, Michal Marek Cc: linux-kernel, Heinrich Schuchardt, Arnd Bergmann, Ralf Baechle, Paul Burton, linux-kbuild, linux-arch, linux-mips Le 19/01/2016 05:37, James Hogan a écrit : > When a header file is removed from generic-y (often accompanied by the > addition of an arch specific header), the generated wrapper file will > persist, and in some cases may still take precedence over the new arch > header. > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > the wrapper when reusing a dirty build tree resulted in build failures > in arch/mips/kernel/signal.c: > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > return &uc->uc_extcontext; > ^ > > Fix by detecting and removing wrapper headers in generated header > directories that do not correspond to a filename in generic-y, genhdr-y, > or the newly introduced generated-y. > > Reported-by: Jacek Anaszewski <j.anaszewski@samsung.com> > Reported-by: Hauke Mehrtens <hauke@hauke-m.de> > Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> > Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Thanks for looking into this James. > Cc: Michal Marek <mmarek@suse.com> > Cc: Arnd Bergmann <arnd@arndb.de> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Paul Burton <paul.burton@imgtec.com> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: linux-kbuild@vger.kernel.org > Cc: linux-arch@vger.kernel.org > Cc: linux-mips@linux-mips.org > --- > Changes in v2: > - Rewrite a bit, drawing inspiration from Makefile.headersinst. > - Exclude genhdr-y and generated-y (thanks to kbuild test robot). > --- > scripts/Makefile.asm-generic | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic > index 045e0098e962..24c29f16f029 100644 > --- a/scripts/Makefile.asm-generic > +++ b/scripts/Makefile.asm-generic > @@ -13,11 +13,26 @@ include scripts/Kbuild.include > # Create output directory if not already present > _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > > +# Stale wrappers when the corresponding files are removed from generic-y > +# need removing. > +generated-y := $(generic-y) $(genhdr-y) $(generated-y) > +all-files := $(patsubst %, $(obj)/%, $(generated-y)) > +old-headers := $(wildcard $(obj)/*.h) > +unwanted := $(filter-out $(all-files),$(old-headers)) > + > quiet_cmd_wrap = WRAP $@ > cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > > -all: $(patsubst %, $(obj)/%, $(generic-y)) > +quiet_cmd_remove = REMOVE $(unwanted) > +cmd_remove = rm -f $(unwanted) > + > +all: $(patsubst %, $(obj)/%, $(generic-y)) FORCE > + $(if $(unwanted),$(call cmd,remove),) > @: > > $(obj)/%.h: > $(call cmd,wrap) > + > +.PHONY: $(PHONY) > +PHONY += FORCE > +FORCE: ; > -- Florian ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-19 13:37 ` [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers James Hogan 2016-01-19 14:09 ` Arnd Bergmann 2016-01-20 18:55 ` Florian Fainelli @ 2016-01-21 0:03 ` Paul Burton 2016-01-21 10:19 ` James Hogan 2 siblings, 1 reply; 11+ messages in thread From: Paul Burton @ 2016-01-21 0:03 UTC (permalink / raw) To: James Hogan Cc: Michal Marek, linux-kernel, Heinrich Schuchardt, Arnd Bergmann, Ralf Baechle, Florian Fainelli, linux-kbuild, linux-arch, linux-mips On Tue, Jan 19, 2016 at 01:37:50PM +0000, James Hogan wrote: > When a header file is removed from generic-y (often accompanied by the > addition of an arch specific header), the generated wrapper file will > persist, and in some cases may still take precedence over the new arch > header. > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > the wrapper when reusing a dirty build tree resulted in build failures > in arch/mips/kernel/signal.c: > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > return &uc->uc_extcontext; > ^ > > Fix by detecting and removing wrapper headers in generated header > directories that do not correspond to a filename in generic-y, genhdr-y, > or the newly introduced generated-y. > > Reported-by: Jacek Anaszewski <j.anaszewski@samsung.com> > Reported-by: Hauke Mehrtens <hauke@hauke-m.de> > Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> > Signed-off-by: James Hogan <james.hogan@imgtec.com> > Cc: Michal Marek <mmarek@suse.com> > Cc: Arnd Bergmann <arnd@arndb.de> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Paul Burton <paul.burton@imgtec.com> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: linux-kbuild@vger.kernel.org > Cc: linux-arch@vger.kernel.org > Cc: linux-mips@linux-mips.org > --- > Changes in v2: > - Rewrite a bit, drawing inspiration from Makefile.headersinst. > - Exclude genhdr-y and generated-y (thanks to kbuild test robot). > --- > scripts/Makefile.asm-generic | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic > index 045e0098e962..24c29f16f029 100644 > --- a/scripts/Makefile.asm-generic > +++ b/scripts/Makefile.asm-generic > @@ -13,11 +13,26 @@ include scripts/Kbuild.include > # Create output directory if not already present > _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > > +# Stale wrappers when the corresponding files are removed from generic-y > +# need removing. > +generated-y := $(generic-y) $(genhdr-y) $(generated-y) > +all-files := $(patsubst %, $(obj)/%, $(generated-y)) > +old-headers := $(wildcard $(obj)/*.h) > +unwanted := $(filter-out $(all-files),$(old-headers)) Hi James, Thanks a bunch for fixing this! Though is it my sleepy self or are all-files & old-headers misnomers? That is, isn't all-files actually a list of headers to be kept, and old-headers actually the list of all (header) files? Thanks, Paul > + > quiet_cmd_wrap = WRAP $@ > cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > > -all: $(patsubst %, $(obj)/%, $(generic-y)) > +quiet_cmd_remove = REMOVE $(unwanted) > +cmd_remove = rm -f $(unwanted) > + > +all: $(patsubst %, $(obj)/%, $(generic-y)) FORCE > + $(if $(unwanted),$(call cmd,remove),) > @: > > $(obj)/%.h: > $(call cmd,wrap) > + > +.PHONY: $(PHONY) > +PHONY += FORCE > +FORCE: ; > -- > 2.4.10 > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers 2016-01-21 0:03 ` Paul Burton @ 2016-01-21 10:19 ` James Hogan 0 siblings, 0 replies; 11+ messages in thread From: James Hogan @ 2016-01-21 10:19 UTC (permalink / raw) To: Paul Burton Cc: Michal Marek, linux-kernel, Heinrich Schuchardt, Arnd Bergmann, Ralf Baechle, Florian Fainelli, linux-kbuild, linux-arch, linux-mips [-- Attachment #1: Type: text/plain, Size: 4522 bytes --] On Thu, Jan 21, 2016 at 12:03:42AM +0000, Paul Burton wrote: > On Tue, Jan 19, 2016 at 01:37:50PM +0000, James Hogan wrote: > > When a header file is removed from generic-y (often accompanied by the > > addition of an arch specific header), the generated wrapper file will > > persist, and in some cases may still take precedence over the new arch > > header. > > > > For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended > > context") removed ucontext.h from generic-y in arch/mips/include/asm/, > > and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of > > the wrapper when reusing a dirty build tree resulted in build failures > > in arch/mips/kernel/signal.c: > > > > arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: > > arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ > > return &uc->uc_extcontext; > > ^ > > > > Fix by detecting and removing wrapper headers in generated header > > directories that do not correspond to a filename in generic-y, genhdr-y, > > or the newly introduced generated-y. > > > > Reported-by: Jacek Anaszewski <j.anaszewski@samsung.com> > > Reported-by: Hauke Mehrtens <hauke@hauke-m.de> > > Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> > > Signed-off-by: James Hogan <james.hogan@imgtec.com> > > Cc: Michal Marek <mmarek@suse.com> > > Cc: Arnd Bergmann <arnd@arndb.de> > > Cc: Ralf Baechle <ralf@linux-mips.org> > > Cc: Paul Burton <paul.burton@imgtec.com> > > Cc: Florian Fainelli <f.fainelli@gmail.com> > > Cc: linux-kbuild@vger.kernel.org > > Cc: linux-arch@vger.kernel.org > > Cc: linux-mips@linux-mips.org > > --- > > Changes in v2: > > - Rewrite a bit, drawing inspiration from Makefile.headersinst. > > - Exclude genhdr-y and generated-y (thanks to kbuild test robot). > > --- > > scripts/Makefile.asm-generic | 17 ++++++++++++++++- > > 1 file changed, 16 insertions(+), 1 deletion(-) > > > > diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic > > index 045e0098e962..24c29f16f029 100644 > > --- a/scripts/Makefile.asm-generic > > +++ b/scripts/Makefile.asm-generic > > @@ -13,11 +13,26 @@ include scripts/Kbuild.include > > # Create output directory if not already present > > _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) > > > > +# Stale wrappers when the corresponding files are removed from generic-y > > +# need removing. > > +generated-y := $(generic-y) $(genhdr-y) $(generated-y) > > +all-files := $(patsubst %, $(obj)/%, $(generated-y)) > > +old-headers := $(wildcard $(obj)/*.h) > > +unwanted := $(filter-out $(all-files),$(old-headers)) > > Hi James, > > Thanks a bunch for fixing this! FTR, I noticed yesterday it fixes a similar case when switching v4.3 to v4.4 too: arch/mips/kernel/../../../fs/binfmt_elf.c In function ‘create_elf_tables’: ./arch/mips/include/asm/elf.h +425 :14: error: ‘AT_SYSINFO_EHDR’ undeclared (first use in this function) NEW_AUX_ENT(AT_SYSINFO_EHDR, \ ^ Due to commit ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") adding uapi/asm/auxvec.h and changing generic-y to header-y. Should ucontext.h be exported via header-y too? With these patches, it removes the stale file: REMOVE arch/mips/include/generated/uapi/asm/auxvec.h > > Though is it my sleepy self or are all-files & old-headers misnomers? > That is, isn't all-files actually a list of headers to be kept, and > old-headers actually the list of all (header) files? I've followed the naming in Makefile.headersinst. I read all-files as "all the files we care about" (i.e. its a combination of several sets of generated files, hence "all") and old-headers as in "existing headers" (since it won't include files which haven't been generated yet). all-files could perhaps be renamed new-headers, but that could be misleading too. Cheers James > > Thanks, > Paul > > > + > > quiet_cmd_wrap = WRAP $@ > > cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ > > > > -all: $(patsubst %, $(obj)/%, $(generic-y)) > > +quiet_cmd_remove = REMOVE $(unwanted) > > +cmd_remove = rm -f $(unwanted) > > + > > +all: $(patsubst %, $(obj)/%, $(generic-y)) FORCE > > + $(if $(unwanted),$(call cmd,remove),) > > @: > > > > $(obj)/%.h: > > $(call cmd,wrap) > > + > > +.PHONY: $(PHONY) > > +PHONY += FORCE > > +FORCE: ; > > -- > > 2.4.10 > > [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-04-21 18:44 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-01-19 13:37 [PATCH v2 0/2] kbuild: Remove stale asm-generic wrappers James Hogan 2016-01-19 13:37 ` [PATCH v2 1/2] kbuild, x86: Track generated headers with generated-y James Hogan 2016-01-19 13:37 ` [PATCH v2 2/2] kbuild: Remove stale asm-generic wrappers James Hogan 2016-01-19 14:09 ` Arnd Bergmann 2016-01-19 14:22 ` James Hogan 2016-01-19 14:27 ` Arnd Bergmann 2016-02-23 9:51 ` James Hogan 2016-04-21 18:44 ` James Hogan 2016-01-20 18:55 ` Florian Fainelli 2016-01-21 0:03 ` Paul Burton 2016-01-21 10:19 ` James Hogan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).