[PATCH v2 0/6] kbuild: enable CONFIG_WERROR for more build steps

Thomas Weißschuh posted 6 patches 1 month, 3 weeks ago
Makefile                   |  3 ---
scripts/Makefile.extrawarn | 18 +++++++++++++-----
2 files changed, 13 insertions(+), 8 deletions(-)
[PATCH v2 0/6] kbuild: enable CONFIG_WERROR for more build steps
Posted by Thomas Weißschuh 1 month, 3 weeks ago
CONFIG_WERROR is useful for all build steps, not only compilation of C and
Rust sources linked into the kernel.

Also enable it for assembler and linker invocations and userprogs.

In addition unify the implementations of CONFIG_WERROR and W=e.

This partially implements features of Miguel's Rust -Werror series [0].
The changes to $(common_rust_flags) are not incorporated as it also modifies
Rust hostprog flags.

[0] https://lore.kernel.org/rust-for-linux/20240519211235.589325-2-ojeda@kernel.org

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Changes in v2:
- Unify CONFIG_WERROR with W=e
- Unconditionally enable -Werror for C and Rust hostprogs
- Link to v1: https://lore.kernel.org/r/20250812-kbuild-werror-v1-0-36c9ff653700@linutronix.de

---
Miguel Ojeda (1):
      kbuild: rust: move `-Dwarnings` handling to `Makefile.extrawarn`

Thomas Weißschuh (5):
      kbuild: align W=e with CONFIG_WERROR
      kbuild: unify W=e and CONFIG_WERROR
      kbuild: respect CONFIG_WERROR for linker and assembler
      kbuild: respect CONFIG_WERROR for userprogs
      kbuild: enable -Werror for hostprogs

 Makefile                   |  3 ---
 scripts/Makefile.extrawarn | 18 +++++++++++++-----
 2 files changed, 13 insertions(+), 8 deletions(-)
---
base-commit: e8ee794a1f7705edd64b9eb9837e7baa4421c084
change-id: 20250801-kbuild-werror-081f72fee1de

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Re: [PATCH v2 0/6] kbuild: enable CONFIG_WERROR for more build steps
Posted by Nathan Chancellor 1 month, 2 weeks ago
On Thu, 14 Aug 2025 12:14:40 +0200, Thomas Weißschuh wrote:
> CONFIG_WERROR is useful for all build steps, not only compilation of C and
> Rust sources linked into the kernel.
> 
> Also enable it for assembler and linker invocations and userprogs.
> 
> In addition unify the implementations of CONFIG_WERROR and W=e.
> 
> [...]

Applied, thanks!

[1/6] kbuild: align W=e with CONFIG_WERROR
      https://git.kernel.org/kbuild/c/f852ce052a8b7
[2/6] kbuild: unify W=e and CONFIG_WERROR
      https://git.kernel.org/kbuild/c/e7a10929c574c
[3/6] kbuild: rust: move `-Dwarnings` handling to `Makefile.extrawarn`
      https://git.kernel.org/kbuild/c/592b571f20c5b
[4/6] kbuild: respect CONFIG_WERROR for linker and assembler
      https://git.kernel.org/kbuild/c/ec4a3992bc0b5
[5/6] kbuild: respect CONFIG_WERROR for userprogs
      https://git.kernel.org/kbuild/c/3f0ff4cc6ffb4
[6/6] kbuild: enable -Werror for hostprogs
      https://git.kernel.org/kbuild/c/a646e96080cd5

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>