]> www.infradead.org Git - users/hch/misc.git/commitdiff
kbuild: enable -Werror for hostprogs
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Thu, 14 Aug 2025 10:14:46 +0000 (12:14 +0200)
committerNathan Chancellor <nathan@kernel.org>
Mon, 18 Aug 2025 17:02:57 +0000 (10:02 -0700)
The hostprog compilers and linkers do not share the regular compiler flags,
so they are not affected by CONFIG_WERROR or W=e. As hostprogs are used
during the bootstrap of the build, they can't depend on kconfig options.

Enable -Werror unconditionally.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://lore.kernel.org/rust-for-linux/CANiq72k-PdSH2BNgbq=X+FhpyEErifSCKfO5ObXz6bu9_J8+fA@mail.gmail.com/
Link: https://lore.kernel.org/r/20250814-kbuild-werror-v2-6-c01e596309d2@linutronix.de
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
scripts/Makefile.extrawarn

index 96ff3f5582d651f0016c8ccd49d46022cc6fe070..1434cb6208cb82f20aeb29cc8c059220d1a1f6d2 100644 (file)
@@ -224,3 +224,8 @@ KBUILD_USERLDFLAGS  += -Wl,--fatal-warnings
 KBUILD_RUSTFLAGS       += -Dwarnings
 
 endif
+
+# Hostprog flags are used during build bootstrapping and can not rely on CONFIG_ symbols.
+KBUILD_HOSTCFLAGS      += -Werror
+KBUILD_HOSTLDFLAGS     += -Wl,--fatal-warnings
+KBUILD_HOSTRUSTFLAGS   += -Dwarnings