]> www.infradead.org Git - users/hch/misc.git/commitdiff
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 6bfe776bf3c5ff0cf187dc6719dd5817cd4af2ca..6630a66659c6d1ca7e72448b04d16c3fdd1fbe24 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 1ffc7beca43bc9e373064194dc8975182815a872..b04b3062e0e49c3ae7471973251017e8738cd244 100644 (file)
@@ -217,5 +217,6 @@ endif
 ifneq ($(findstring e, $(KBUILD_EXTRA_WARN))$(CONFIG_WERROR),)
 
 KBUILD_CPPFLAGS                += -Werror
+KBUILD_RUSTFLAGS       += -Dwarnings
 
 endif