kbuild: rust: move `-Dwarnings` handling to `Makefile.extrawarn`
authorMiguel Ojeda <ojeda@kernel.org>
Thu, 14 Aug 2025 10:14:43 +0000 (12:14 +0200)
committerNathan Chancellor <nathan@kernel.org>
Thu, 14 Aug 2025 18:21:12 +0000 (11:21 -0700)
Following commit e88ca24319e4 ("kbuild: consolidate warning flags
in scripts/Makefile.extrawarn"), move `-Dwarnings` handling into
`Makefile.extrawarn` like C's `-Werror`.

No functional change intended.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://lore.kernel.org/r/20250814-kbuild-werror-v2-3-c01e596309d2@linutronix.de
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Makefile
scripts/Makefile.extrawarn

index 6bfe776..6630a66 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -901,9 +901,6 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG)      := -fstack-protector-strong
 
 KBUILD_CFLAGS += $(stackp-flags-y)
 
-KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings
-KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y)
-
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS  += -fno-omit-frame-pointer -fno-optimize-sibling-calls
 KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
index 1ffc7be..b04b306 100644 (file)
@@ -217,5 +217,6 @@ endif
 ifneq ($(findstring e, $(KBUILD_EXTRA_WARN))$(CONFIG_WERROR),)
 
 KBUILD_CPPFLAGS                += -Werror
+KBUILD_RUSTFLAGS       += -Dwarnings
 
 endif