summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.extrawarn
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2025-12-13 01:18:20 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2025-12-13 01:18:20 -0800
commita4a508df2aa34f8650afde54ea804321c618f45f (patch)
treef75f10e7c54f991d7d859f8cbdcc8bcaed5bbd6f /scripts/Makefile.extrawarn
parentc4b3133c6a2fc283cb3d34c64d40ed2fa254b608 (diff)
parent7d0a66e4bb9081d75c82ec4957c50034cb0ea449 (diff)
downloadlinux-a4a508df2aa34f8650afde54ea804321c618f45f.tar.gz
linux-a4a508df2aa34f8650afde54ea804321c618f45f.zip
Merge tag 'v6.18' into next
Sync up with the mainline to bring in the latest APIs.
Diffstat (limited to 'scripts/Makefile.extrawarn')
-rw-r--r--scripts/Makefile.extrawarn22
1 files changed, 16 insertions, 6 deletions
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index dca175fffcab..6af392f9cd02 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -25,8 +25,6 @@ ifneq ($(CONFIG_FRAME_WARN),0)
KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN)
endif
-KBUILD_CPPFLAGS-$(CONFIG_WERROR) += -Werror
-KBUILD_CPPFLAGS += $(KBUILD_CPPFLAGS-y)
KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
ifdef CONFIG_CC_IS_CLANG
@@ -214,10 +212,22 @@ KBUILD_CFLAGS += -Wno-unused-parameter
endif
#
-# W=e - error out on warnings
+# W=e and CONFIG_WERROR - error out on warnings
#
-ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),)
-
-KBUILD_CFLAGS += -Werror
+ifneq ($(findstring e, $(KBUILD_EXTRA_WARN))$(CONFIG_WERROR),)
+
+KBUILD_CPPFLAGS += -Werror
+KBUILD_AFLAGS += -Wa,--fatal-warnings
+KBUILD_LDFLAGS += --fatal-warnings
+KBUILD_USERCFLAGS += -Werror
+KBUILD_USERLDFLAGS += -Wl,--fatal-warnings
+KBUILD_RUSTFLAGS += -Dwarnings
+
+# While hostprog flags are used during build bootstrapping (thus should not
+# depend on CONFIG_ symbols), -Werror is disruptive and should be opted into.
+# Only apply -Werror to hostprogs built after the initial Kconfig stage.
+KBUILD_HOSTCFLAGS += -Werror
+KBUILD_HOSTLDFLAGS += -Wl,--fatal-warnings
+KBUILD_HOSTRUSTFLAGS += -Dwarnings
endif