native: wipe stale subsystem .o files on config change + verify drv syms
Smoking-gun diagnosis from G7 logs: canary check passed (CONFIG_PINCTRL_
JASPERLAKE=y made it into .config) yet the built kernel had zero JSL
pinctrl driver symbols, only gpiochip0 registered, MAX98360A amp bound
but never got its SD_MODE GPIO → silent speakers.
Cause: kbuild's incremental-build dependency tracker doesn't fully
rebuild when a `obj-\$(CONFIG_FOO) += bar.o` toggles from =n to =y IF
bar.o never existed in the prior persistent build tree. It sees the
config line change via include/generated/autoconf.h but the dead-code
elimination path stays elided. Plain `make clean` would fix it but
negates the Phase 1 speedup.
Two-layer fix:
1. Config-hash sentinel — hash the critical audio/GPIO/pinctrl config
lines each build. On change, wipe specifically
drivers/{pinctrl/intel,i2c/busses,mtd/spi-nor,mmc/host,spi,
net/wireless/realtek,gpio} + sound/soc/{intel,sof,codecs}
object files + force vmlinux relink. Untouched subsystems keep
their ccache wins.
2. Post-build symbol verification — `nm vmlinux | grep` for one
canonical symbol from each critical driver (jsl_pinctrl_acpi_match,
max98357a_sdmode_event, rt5682_i2c_probe, dw_i2c_dev_init). Fail
the build with a specific remediation message if any are missing.
This catches the "config says =y but driver isn't linked" class
of regression that silently shipped the last three builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>