Re: [PATCH] kbuild: rebuild GCC plugins when the compiler is upgraded

From: Kees Cook
Date: Thu Mar 04 2021 - 18:20:37 EST


On Thu, Mar 04, 2021 at 08:37:08PM +0900, Masahiro Yamada wrote:
> Linus reported a build error due to the GCC plugin incompatibility
> when the compiler is upgraded. [1]
>
> cc1: error: incompatible gcc/plugin versions
> cc1: error: failed to initialize plugin ./scripts/gcc-plugins/stackleak_plugin.so
>
> GCC plugins are tied to a particular GCC version. So, they must be
> rebuilt when the compiler is upgraded.
>
> This seems to be a long-standing flaw since the initial support of
> GCC plugins.
>
> Extend commit 8b59cd81dc5e ("kbuild: ensure full rebuild when the
> compiler is updated"), so that GCC plugins are covered by the
> compiler upgrade detection.
>
> [1]: https://lore.kernel.org/lkml/CAHk-=wieoN5ttOy7SnsGwZv+Fni3R6m-Ut=oxih6bbZ28G+4dw@xxxxxxxxxxxxxx/
>
> Reported-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>

This seems fine to me, but I want to make sure Josh has somewhere to
actually go with this. Josh, does this get you any closer? It sounds
like the plugins need to move to another location for packaged kernels?

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

--
Kees Cook