Re: [PATCH v3] scripts/gcc-plugins: suppress recorded GCC switches for extmod builds

From: Kees Cook

Date: Tue Sep 01 2026 - 17:13:04 EST


On Thu, Aug 20, 2026 at 11:31:16AM +0530, Jaihind Yadav wrote:
> With GCC plugins enabled, external module builds can record
> -fplugin=... paths in DWARF producer metadata via
> -grecord-gcc-switches, leaking host/build specific paths and
> triggering QA checks.
>
> Handle this in scripts/Makefile.gcc-plugins for KBUILD_EXTMOD
> builds by adding -gno-record-gcc-switches to plugin cflags.
>
> This keeps plugin behavior unchanged while avoiding absolute
> plugin path leakage in external module debug metadata.
>
> Suggested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> Link: https://lore.kernel.org/all/20260817185146.GC1249844@ax162/
> Signed-off-by: Jaihind Yadav <jaihindy@xxxxxxxxxxxxxxxx>

Acked-by: Kees Cook <kees@xxxxxxxxxx>

I'm fine with this going via the kbuild tree. :)

-Kees

--
Kees Cook