public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: sun jian <sun.jian.kdev@gmail.com>
Cc: Nicolas Schier <nsc@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	Florian Westphal <fw@strlen.de>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] genksyms: Fix parsing a declarator with a preceding attribute
Date: Thu, 26 Feb 2026 13:26:48 -0700	[thread overview]
Message-ID: <20260226202648.GA3196155@ax162> (raw)
In-Reply-To: <CABFUUZGgnKF+C7f7yPkXybFq1KBOJNj3s73R41ru1+aGUGYUQw@mail.gmail.com>

On Thu, Feb 26, 2026 at 12:36:00PM +0800, sun jian wrote:
> On Thu, Feb 26, 2026 at 6:07 AM Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > After commit 07919126ecfc ("netfilter: annotate NAT helper hook pointers
> > with __rcu"), genksyms fails to parse the __rcu annotation when building
> > with CONFIG_DEBUG_INFO_BTF=y, CONFIG_PAHOLE_HAS_BTF_TAG=y, and a version
> > of clang that supports btf_type_tag.
> 
> Hi Nathan,
> 
> Thanks for tracking this down and for the minimal reproducer.
> 
> I've noticed the same thing while building on my laptop during MODPOST
> Module.symvers:
> 
> WARNING: modpost: EXPORT symbol "nf_nat_ftp_hook" [vmlinux] version
> generation failed, symbol will not be versioned.
> Is "nf_nat_ftp_hook" prototyped in <asm/asm-prototypes.h>?
> WARNING: modpost: EXPORT symbol "nf_nat_irc_hook" [vmlinux] version
> generation failed, symbol will not be versioned.
> Is "nf_nat_irc_hook" prototyped in <asm/asm-prototypes.h>?
> 
> >
> > diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
> > index efdcf07c4eb6..cabcd146f3aa 100644
> > --- a/scripts/genksyms/parse.y
> > +++ b/scripts/genksyms/parse.y
> > @@ -325,8 +325,8 @@ direct_declarator:
> >                 { $$ = $4; }
> >         | direct_declarator BRACKET_PHRASE
> >                 { $$ = $2; }
> > -       | '(' declarator ')'
> > -               { $$ = $3; }
> > +       | '(' attribute_opt declarator ')'
> > +               { $$ = $4; }
> >         ;
> >
> 
> Your grammar tweak to allow an optional attribute before the nested
> declarator looks correct to me.

Thanks a lot for taking a look!

Cheers,
Nathan

  reply	other threads:[~2026-02-26 20:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 22:07 [PATCH] genksyms: Fix parsing a declarator with a preceding attribute Nathan Chancellor
2026-02-26  4:36 ` sun jian
2026-02-26 20:26   ` Nathan Chancellor [this message]
2026-02-27  7:54 ` Nicolas Schier
2026-03-05  0:36 ` Nathan Chancellor

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=20260226202648.GA3196155@ax162 \
    --to=nathan@kernel.org \
    --cc=fw@strlen.de \
    --cc=justinstitt@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=nsc@kernel.org \
    --cc=sun.jian.kdev@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox