Re: [PATCH v4] kconfig: add kconfig-sym-check static checker

From: Sergey Senozhatsky

Date: Tue Jun 23 2026 - 03:49:26 EST


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