Re: [PATCH v4] kconfig: add kconfig-sym-check static checker
From: Andrew Jones
Date: Tue Jun 23 2026 - 11:18:34 EST
On Tue, Jun 23, 2026 at 04:49:13PM +0900, Sergey Senozhatsky wrote:
> Hi,
>
> Wasn't on the Cc list, hopefully I didn't mess up the headers.
> Just saw this on LWN:
>
> [..]
> > + @echo ' kconfig-sym-check - Check for dangling Kconfig symbol references'
> >
> > +kconfig-sym-check:
> > + $(Q)$(PERL) $(srctree)/scripts/kconfig/kconfig-sym-check.pl $(srctree) $(KCONFIG_SYM_CHECK_EXCLUDES)
>
> I wonder if you have seen KCONFIG_WARN_UNKNOWN_SYMBOLS which seem
> to be addressing the same (or very similar) problem (unless I'm missing
> something).
>
> Basically, what I have in my build script is
>
> # perform kconfig symbol lookups: handles renamed, removed, etc. symbols
> export KCONFIG_WARN_UNKNOWN_SYMBOLS=1
> # make kconfig symbol lookup warnings fatal
> export KCONFIG_WERROR=1
>
> And then make fails whenever .config has something that is not
> supposed to be there anymore. E.g.
>
> .config:1606:warning: unknown symbol: SENSORS_APDS990X
> .config:2498:warning: unknown symbol: APPLICOM
> make[3]: *** [scripts/kconfig/Makefile:85: syncconfig] Error 1
> make[2]: *** [Makefile:760: syncconfig] Error 2
Thanks, Sergey. I wasn't aware of this. Is there a way to combine that
with some "make all" type target in order to find all the dangling
symbols that the static checker finds?
Thanks,
drew