Message ID | 1503132577-24423-1-git-send-email-yamada.masahiro@socionext.com |
---|---|
Headers | show |
Series | kbuild: generate intermediate C files instead of copying _shipped files | expand |
On Sat, Aug 19, 2017 at 1:49 AM, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > > Here is one question. Is it acceptable to use those rules all the time? > That is, generate those C files by flex, bison, gperf during the > kernel building. Yeah, I think we probably should do that. However, when I just tested, I noticed that we have issues with re-generating those files. With gperf 3.1 installed, I get In file included from scripts/kconfig/zconf.tab.c:213:0: scripts/kconfig/zconf.gperf:147:1: error: conflicting types for ‘kconf_id_lookup’ scripts/kconfig/zconf.gperf:12:31: note: previous declaration of ‘kconf_id_lookup’ was here static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); ^~~~~~~~~~~~~~~ because gperf now generates const struct kconf_id * -kconf_id_lookup (register const char *str, register unsigned int len) +kconf_id_lookup (register const char *str, register size_t len) and I'm not sure how to detect that automatically. It seems to be a gperf-3.1 change, and gperf doesn't seem to generate any version markers. Working around that, I hit: In file included from scripts/genksyms/lex.lex.c:1921:0: scripts/genksyms/keywords.gperf:54:1: error: conflicting types for ‘is_reserved_word’ static, STATIC_KEYW ^~~~~~~~~~~~~~~~ In file included from scripts/genksyms/lex.lex.c:1921:0: scripts/genksyms/keywords.gperf:6:30: note: previous declaration of ‘is_reserved_word’ was here static const struct resword *is_reserved_word(register const char *str, register unsigned int len); ^~~~~~~~~~~~~~~~ so we have at least two cases of this in the source tree. So one of the advantages of the pre-shipped files is that we can avoid that kind of crazy version issues with the tools. But if we can solve the versioning thing easily, I certainly don't mind getting rid of the pre-generated files. Having to have flex/bison/gperf isn't a huge onus on the kernel build system. Linus
On Thu, Sep 7, 2017 at 11:18 PM, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > > If CONFIG_MODVERSIONS is enabled, > I notice lots of error messages. > WARNING: EXPORT symbol "finish_open" [vmlinux] version generation > failed, symbol will not be versioned > > So, I think something was broken in scripts/genksyms/. > > Of course, it was a trivial conversion, so it should not be hard to fix... Indeed, hopefully it would be trivial, but I don't even see the error here. Of course, I only did a "make allmodconfig" to test the MODVERSIONS case, I didn't actually install the modules. Is that error perhaps only detected at install time? I did build and install a kernel with that patch, but that's my actual "real" config for the machine, and it didn't have MODVERSIONS enabled. Oh, how I hate modversions. But I'll take a look if I can see what I did wrong in the "Trivial and Obvious(tm)" conversion. Linus
On Fri, Sep 8, 2017 at 10:22 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote: > > Of course, I only did a "make allmodconfig" to test the MODVERSIONS > case, I didn't actually install the modules. Is that error perhaps > only detected at install time? Oh, I take that back. I just got a ton of warnings with my allmodconfig after doing a "git clean -dqfx". So I guess there is a dependency issue - my normal build test after the merge didn't show any issues, simply because the change in ksymoops didn't actually cause the version information to be re-generated. It doesn't seem to happen for every exported symbol, though. Odd. Looking at it, but not making sense of it yet. Linus
On Fri, Sep 8, 2017 at 11:39 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote: > > Strange. Does anybody see what the pattern to the failure is? Found it. Stupid special case for 'typeof()' that used is_reserved_word() in ways I hadn't realized. Fix committed. Linus
On Fri, Sep 08, 2017 at 02:38:23PM -0700, Linus Torvalds wrote: > On Fri, Sep 8, 2017 at 11:39 AM, Linus Torvalds > <torvalds@linux-foundation.org> wrote: > > > > Strange. Does anybody see what the pattern to the failure is? > > Found it. Stupid special case for 'typeof()' that used > is_reserved_word() in ways I hadn't realized. > > Fix committed. To get bonus points for this cleanup you should also remove the now unused gpref support in Makefile.lib Sam