Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1311147 > unrolled thread
| Started by | Heinrich Schuchardt <xypron.glpk@gmx.de> |
|---|---|
| First post | 2016-01-17 15:00 +0100 |
| Last post | 2016-01-19 11:50 +0100 |
| Articles | 7 — 5 participants |
Back to article view | Back to linux.kernel
cannot build Linux 4.4: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-01-17 15:00 +0100
Re: cannot build Linux 4.4: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-01-17 15:50 +0100
Re: cannot build Linux 4.4: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ Florian Fainelli <f.fainelli@gmail.com> - 2016-01-19 03:30 +0100
Re: cannot build Linux 4.4: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ Ralf Baechle <ralf@linux-mips.org> - 2016-01-19 10:10 +0100
Re: cannot build Linux 4.4: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ James Hogan <james.hogan@imgtec.com> - 2016-01-19 11:10 +0100
[PATCH] kbuild: Remove stale asm-generic wrappers James Hogan <james.hogan@imgtec.com> - 2016-01-19 11:40 +0100
Re: [PATCH] kbuild: Remove stale asm-generic wrappers kbuild test robot <lkp@intel.com> - 2016-01-19 11:50 +0100
| From | Heinrich Schuchardt <xypron.glpk@gmx.de> |
|---|---|
| Date | 2016-01-17 15:00 +0100 |
| Subject | cannot build Linux 4.4: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ |
| Message-ID | <qRW25-3aR-9@gated-at.bofh.it> |
HEAD is now at afd2ff9... Linux 4.4
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;
^
In file included from include/linux/poll.h:11:0,
from include/linux/ring_buffer.h:7,
from include/linux/trace_events.h:5,
from include/trace/syscall.h:6,
from include/linux/syscalls.h:81,
from arch/mips/kernel/signal.c:26:
arch/mips/kernel/signal.c: In function ‘save_msa_extcontext’:
arch/mips/kernel/signal.c:170:40: error: dereferencing pointer to
incomplete type
Best regards
Heinrich Schuchardt
[toc] | [next] | [standalone]
| From | Heinrich Schuchardt <xypron.glpk@gmx.de> |
|---|---|
| Date | 2016-01-17 15:50 +0100 |
| Message-ID | <qRWOt-3Ia-1@gated-at.bofh.it> |
| In reply to | #1311147 |
On 01/17/2016 02:54 PM, Heinrich Schuchardt wrote: > > HEAD is now at afd2ff9... Linux 4.4 > 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; > ^ > In file included from include/linux/poll.h:11:0, > from include/linux/ring_buffer.h:7, > from include/linux/trace_events.h:5, > from include/trace/syscall.h:6, > from include/linux/syscalls.h:81, > from arch/mips/kernel/signal.c:26: > arch/mips/kernel/signal.c: In function ‘save_msa_extcontext’: > arch/mips/kernel/signal.c:170:40: error: dereferencing pointer to > incomplete type > The problem stemmed from make not recognizing that this file was outdated: Oct 16 2014 arch/mips/include/generated/asm/ucontext.h Shouldn't make automatically regenerate outdated files? Best regards Heinrich Schuchardt
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2016-01-19 03:30 +0100 |
| Message-ID | <qSuds-1cG-3@gated-at.bofh.it> |
| In reply to | #1311155 |
Le 17/01/2016 06:48, Heinrich Schuchardt a écrit : > On 01/17/2016 02:54 PM, Heinrich Schuchardt wrote: >> >> HEAD is now at afd2ff9... Linux 4.4 >> 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; >> ^ >> In file included from include/linux/poll.h:11:0, >> from include/linux/ring_buffer.h:7, >> from include/linux/trace_events.h:5, >> from include/trace/syscall.h:6, >> from include/linux/syscalls.h:81, >> from arch/mips/kernel/signal.c:26: >> arch/mips/kernel/signal.c: In function ‘save_msa_extcontext’: >> arch/mips/kernel/signal.c:170:40: error: dereferencing pointer to >> incomplete type >> > > The problem stemmed from make not recognizing that this file was outdated: > > Oct 16 2014 arch/mips/include/generated/asm/ucontext.h > > Shouldn't make automatically regenerate outdated files? The reduced test case can be simplified to these steps: git co f1fe2d21f4e1aca8644cea888dc618f0183ad671\^1 configure your kernel ARCH=mips make arch/mips/kernel/signal.o git co f1fe2d21f4e1aca8644cea888dc618f0183ad671 ARCH=mips make arch/mips/kernel/signal.o The problem seems to be that if there was a previous build which resulted in creating an asm-generic wrapper for a file (arch/mips/include/generated/asm/ucontext.h in that case), but this file was later moved into an arch-specific, non asm-generic header file, then we are just not going to automatically remove this auto-generated wrapper, and generate the new one. This seems to be aggravated by the fact that commit f1fe2d21f4e1aca8644cea888dc618f0183ad671 does not add ucontext.h to arch/mips/include/uapi/Kbuild, Paul, James is that intentional? After trying to mess a bit with a clean solution, I just gave up and decided that this was not worth fixing since it is a very infrequent problem. -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Ralf Baechle <ralf@linux-mips.org> |
|---|---|
| Date | 2016-01-19 10:10 +0100 |
| Message-ID | <qSAsy-5F1-15@gated-at.bofh.it> |
| In reply to | #1311898 |
On Mon, Jan 18, 2016 at 06:22:21PM -0800, Florian Fainelli wrote: > Le 17/01/2016 06:48, Heinrich Schuchardt a écrit : > > On 01/17/2016 02:54 PM, Heinrich Schuchardt wrote: > >> > >> HEAD is now at afd2ff9... Linux 4.4 > >> 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; > >> ^ > >> In file included from include/linux/poll.h:11:0, > >> from include/linux/ring_buffer.h:7, > >> from include/linux/trace_events.h:5, > >> from include/trace/syscall.h:6, > >> from include/linux/syscalls.h:81, > >> from arch/mips/kernel/signal.c:26: > >> arch/mips/kernel/signal.c: In function ‘save_msa_extcontext’: > >> arch/mips/kernel/signal.c:170:40: error: dereferencing pointer to > >> incomplete type > >> > > > > The problem stemmed from make not recognizing that this file was outdated: > > > > Oct 16 2014 arch/mips/include/generated/asm/ucontext.h > > > > Shouldn't make automatically regenerate outdated files? > > The reduced test case can be simplified to these steps: > > git co f1fe2d21f4e1aca8644cea888dc618f0183ad671\^1 > configure your kernel > ARCH=mips make arch/mips/kernel/signal.o > git co f1fe2d21f4e1aca8644cea888dc618f0183ad671 > ARCH=mips make arch/mips/kernel/signal.o > > The problem seems to be that if there was a previous build which > resulted in creating an asm-generic wrapper for a file > (arch/mips/include/generated/asm/ucontext.h in that case), but this file > was later moved into an arch-specific, non asm-generic header file, then > we are just not going to automatically remove this auto-generated > wrapper, and generate the new one. > > This seems to be aggravated by the fact that commit > f1fe2d21f4e1aca8644cea888dc618f0183ad671 does not add ucontext.h to > arch/mips/include/uapi/Kbuild, Paul, James is that intentional? > > After trying to mess a bit with a clean solution, I just gave up and > decided that this was not worth fixing since it is a very infrequent > problem. We lately had about five people reporting similar issues that all could be resolved with make distclean. Ralf
[toc] | [prev] | [next] | [standalone]
| From | James Hogan <james.hogan@imgtec.com> |
|---|---|
| Date | 2016-01-19 11:10 +0100 |
| Message-ID | <qSBoC-6hJ-31@gated-at.bofh.it> |
| In reply to | #1311898 |
[Multipart message — attachments visible in raw view] — view raw
Hi Florian, On Mon, Jan 18, 2016 at 06:22:21PM -0800, Florian Fainelli wrote: > Le 17/01/2016 06:48, Heinrich Schuchardt a écrit : > > On 01/17/2016 02:54 PM, Heinrich Schuchardt wrote: > >> > >> HEAD is now at afd2ff9... Linux 4.4 > >> 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; > >> ^ > >> In file included from include/linux/poll.h:11:0, > >> from include/linux/ring_buffer.h:7, > >> from include/linux/trace_events.h:5, > >> from include/trace/syscall.h:6, > >> from include/linux/syscalls.h:81, > >> from arch/mips/kernel/signal.c:26: > >> arch/mips/kernel/signal.c: In function ‘save_msa_extcontext’: > >> arch/mips/kernel/signal.c:170:40: error: dereferencing pointer to > >> incomplete type > >> > > > > The problem stemmed from make not recognizing that this file was outdated: > > > > Oct 16 2014 arch/mips/include/generated/asm/ucontext.h > > > > Shouldn't make automatically regenerate outdated files? > > The reduced test case can be simplified to these steps: > > git co f1fe2d21f4e1aca8644cea888dc618f0183ad671\^1 > configure your kernel > ARCH=mips make arch/mips/kernel/signal.o > git co f1fe2d21f4e1aca8644cea888dc618f0183ad671 > ARCH=mips make arch/mips/kernel/signal.o > > The problem seems to be that if there was a previous build which > resulted in creating an asm-generic wrapper for a file > (arch/mips/include/generated/asm/ucontext.h in that case), but this file > was later moved into an arch-specific, non asm-generic header file, then > we are just not going to automatically remove this auto-generated > wrapper, and generate the new one. > > This seems to be aggravated by the fact that commit > f1fe2d21f4e1aca8644cea888dc618f0183ad671 does not add ucontext.h to > arch/mips/include/uapi/Kbuild, Paul, James is that intentional? I suspect it was intended to be exported in kernel headers, for libc/signal handlers to use, although it isn't referenced by other headers. Paul? > > After trying to mess a bit with a clean solution, I just gave up and > decided that this was not worth fixing since it is a very infrequent > problem. Thing is it isn't that uncommon. I've lost count of the number of times I've hit this specific case (especially during bisection), and as Ralf says, several others have mentioned it on the list, but rm -fr arch/mips/include/generated always seemed so much easier than fixing the actual problem. Anyway, after a bit of fiddling around I think i've fixed this properly now. I'll submit the patch asap. Cheers James
[toc] | [prev] | [next] | [standalone]
| From | James Hogan <james.hogan@imgtec.com> |
|---|---|
| Date | 2016-01-19 11:40 +0100 |
| Subject | [PATCH] kbuild: Remove stale asm-generic wrappers |
| Message-ID | <qSBRE-6uw-7@gated-at.bofh.it> |
| In reply to | #1312070 |
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 wrapper headers in generated header directories that do
not correspond to a filename in generic-y, and removing them.
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
---
scripts/Makefile.asm-generic | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic
index 045e0098e962..7422f6476a8a 100644
--- a/scripts/Makefile.asm-generic
+++ b/scripts/Makefile.asm-generic
@@ -21,3 +21,19 @@ all: $(patsubst %, $(obj)/%, $(generic-y))
$(obj)/%.h:
$(call cmd,wrap)
+
+# Remove stale wrappers when the corresponding files are removed from
+# generic-y
+
+quiet_cmd_rmwrap = REMOVE $(patsubst %.rm,%,$@)
+cmd_rmwrap = rm -f $(patsubst %.rm, %, $@)
+
+all: $(filter-out $(patsubst %, $(obj)/%.rm, $(generic-y)), \
+ $(patsubst %, %.rm, $(wildcard $(obj)/*.h)))
+
+$(obj)/%.h.rm: FORCE
+ $(call cmd,rmwrap)
+
+.PHONY: $(PHONY)
+PHONY += FORCE
+FORCE: ;
--
2.4.10
[toc] | [prev] | [next] | [standalone]
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Date | 2016-01-19 11:50 +0100 |
| Subject | Re: [PATCH] kbuild: Remove stale asm-generic wrappers |
| Message-ID | <qSC1l-6y1-21@gated-at.bofh.it> |
| In reply to | #1312084 |
[Multipart message — attachments visible in raw view] — view raw
Hi James,
[auto build test ERROR on kbuild/for-next]
[also build test ERROR on v4.4 next-20160119]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/James-Hogan/kbuild-Remove-stale-asm-generic-wrappers/20160119-183642
base: https://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild.git for-next
config: i386-tinyconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
In file included from arch/x86/kernel/asm-offsets.c:25:0:
>> arch/x86/kernel/asm-offsets_32.c:12:29: fatal error: asm/syscalls_32.h: No such file or directory
compilation terminated.
make[2]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [sub-make] Error 2
vim +12 arch/x86/kernel/asm-offsets_32.c
5de2b61a6 arch/x86/kernel/asm-offsets_32.c Borislav Petkov 2014-12-09 1 #ifndef __LINUX_KBUILD_H
5de2b61a6 arch/x86/kernel/asm-offsets_32.c Borislav Petkov 2014-12-09 2 # error "Please do not build this file directly, build asm-offsets.c instead"
5de2b61a6 arch/x86/kernel/asm-offsets_32.c Borislav Petkov 2014-12-09 3 #endif
5de2b61a6 arch/x86/kernel/asm-offsets_32.c Borislav Petkov 2014-12-09 4
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 5 #include <asm/ucontext.h>
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 6
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 7 #include <linux/lguest.h>
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 8 #include "../../../drivers/lguest/lg.h"
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 9
303395ac3 arch/x86/kernel/asm-offsets_32.c H. Peter Anvin 2011-11-11 10 #define __SYSCALL_I386(nr, sym, compat) [nr] = 1,
303395ac3 arch/x86/kernel/asm-offsets_32.c H. Peter Anvin 2011-11-11 11 static char syscalls[] = {
303395ac3 arch/x86/kernel/asm-offsets_32.c H. Peter Anvin 2011-11-11 @12 #include <asm/syscalls_32.h>
303395ac3 arch/x86/kernel/asm-offsets_32.c H. Peter Anvin 2011-11-11 13 };
303395ac3 arch/x86/kernel/asm-offsets_32.c H. Peter Anvin 2011-11-11 14
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 15 /* workaround for a warning with -Wmissing-prototypes */
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 16 void foo(void);
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 17
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 18 void foo(void)
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 19 {
8d0d37cfb arch/i386/kernel/asm-offsets_32.c Thomas Gleixner 2007-10-11 20 OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
:::::: The code at line 12 was first introduced by commit
:::::: 303395ac3bf3e2cb488435537d416bc840438fcb x86: Generate system call tables and unistd_*.h from tables
:::::: TO: H. Peter Anvin <hpa@linux.intel.com>
:::::: CC: H. Peter Anvin <hpa@linux.intel.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web