[PATCH 03/12] kbuild: userprogs: respect CONFIG_WERROR
From: Thomas Weißschuh
Date: Mon Feb 17 2025 - 06:03:31 EST
Reuse the general CONFIG_WERROR to also apply to userprogs.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
---
scripts/Makefile.userprogs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/Makefile.userprogs b/scripts/Makefile.userprogs
index f3a7e1ef3753b54303718fae97f4b3c9d4eac07c..debbf083bcfa01c89c204a322a1b17e2bdbe95a1 100644
--- a/scripts/Makefile.userprogs
+++ b/scripts/Makefile.userprogs
@@ -21,6 +21,10 @@ user_ccflags = -Wp,-MMD,$(depfile) $(KBUILD_USERCFLAGS) $(userccflags) \
user_ldflags = $(KBUILD_USERLDFLAGS) $(userldflags) $($(target-stem)-userldflags)
user_ldlibs = $(userldlibs) $($(target-stem)-userldlibs)
+ifdef CONFIG_WERROR
+KBUILD_USERCFLAGS += -Werror
+endif
+
# Create an executable from a single .c file
quiet_cmd_user_cc_c = CC [U] $@
cmd_user_cc_c = $(CC) $(user_ccflags) $(user_ldflags) -o $@ $< \
--
2.48.1