All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Sam Ravnborg <sam@ravnborg.org>, Michal Marek <mmarek@suse.com>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Rob Herring <robh@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Richard Purdie <richard.purdie@linuxfoundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Markus Heiser <markus.heiser@darmarit.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	SeongJae Park <sj38.park@gmail.com>,
	"Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of copying _shipped files
Date: Sat, 19 Aug 2017 10:03:51 -0700	[thread overview]
Message-ID: <CA+55aFzQ4shyD=bqdSMreU33iLVkEsSgnMXegL5wcu5ug0fOUg@mail.gmail.com> (raw)
In-Reply-To: <1503132577-24423-1-git-send-email-yamada.masahiro@socionext.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Sam Ravnborg <sam@ravnborg.org>, Michal Marek <mmarek@suse.com>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Rob Herring <robh@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Richard Purdie <richard.purdie@linuxfoundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Markus Heiser <markus.heiser@darmarit.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	SeongJae Park <sj38.park@gmail.com>,
	"Yann E. MORIN" <yann.morin.1>
Subject: Re: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of copying _shipped files
Date: Sat, 19 Aug 2017 10:03:51 -0700	[thread overview]
Message-ID: <CA+55aFzQ4shyD=bqdSMreU33iLVkEsSgnMXegL5wcu5ug0fOUg@mail.gmail.com> (raw)
In-Reply-To: <1503132577-24423-1-git-send-email-yamada.masahiro@socionext.com>

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

  parent reply	other threads:[~2017-08-19 17:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-19  8:49 [RFC PATCH 0/3] kbuild: generate intermediate C files instead of copying _shipped files Masahiro Yamada
2017-08-19  8:49 ` Masahiro Yamada
2017-08-19  8:49 ` [RFC PATCH 1/3] kbuild: generate *.hash.c during build Masahiro Yamada
2017-08-19  8:49 ` [RFC PATCH 2/3] kbuild: generate *.lex.c " Masahiro Yamada
2017-08-19  8:49 ` [RFC PATCH 3/3] kbuild: generate *.tab.c and *.tab.h " Masahiro Yamada
2017-08-21 17:12   ` Rob Herring
2017-08-21 17:12     ` Rob Herring
2017-08-19 11:31 ` [RFC PATCH 0/3] kbuild: generate intermediate C files instead of copying _shipped files Cao jin
2017-08-19 11:31   ` Cao jin
2017-08-19 11:31   ` Cao jin
2017-08-19 17:03 ` Linus Torvalds [this message]
2017-08-19 17:03   ` Linus Torvalds
2017-08-19 17:14   ` Linus Torvalds
2017-08-19 17:14     ` Linus Torvalds
2017-08-19 18:12     ` Linus Torvalds
2017-08-19 18:12       ` Linus Torvalds
2017-09-08  6:18     ` Masahiro Yamada
2017-09-08  6:18       ` Masahiro Yamada
2017-09-08 17:22       ` Linus Torvalds
2017-09-08 17:22         ` Linus Torvalds
2017-09-08 18:01         ` Linus Torvalds
2017-09-08 18:01           ` Linus Torvalds
2017-09-08 18:39           ` Linus Torvalds
2017-09-08 18:39             ` Linus Torvalds
2017-09-08 21:38             ` Linus Torvalds
2017-09-08 21:38               ` Linus Torvalds
2017-09-09  6:39               ` Sam Ravnborg
2017-09-09  6:39                 ` Sam Ravnborg
2017-09-10 13:59                 ` Masahiro Yamada
2017-09-10 13:59                   ` Masahiro Yamada
2017-09-10 13:58               ` Masahiro Yamada
2017-09-10 13:58                 ` Masahiro Yamada
2017-09-10 16:27                 ` Linus Torvalds
2017-09-10 16:27                   ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+55aFzQ4shyD=bqdSMreU33iLVkEsSgnMXegL5wcu5ug0fOUg@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.heiser@darmarit.de \
    --cc=mchehab@kernel.org \
    --cc=mmarek@suse.com \
    --cc=npiggin@gmail.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sj38.park@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.