Skip to content

Commit c4cb34a

Browse files
t-8chNicolas Schier
authored andcommitted
kbuild: uapi: reuse KBUILD_USERCFLAGS
The toplevel Makefile already provides the compiler flags necessary to build userspace applications for the target. Make use of them instead of duplicating the logic. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20251014-kbuild-uapi-usercflags-v1-1-c162f9059c47@linutronix.de Signed-off-by: Nicolas Schier <nsc@kernel.org>
1 parent bfb046f commit c4cb34a

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

usr/include/Makefile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@
66
#
77
# -std=c90 (equivalent to -ansi) catches the violation of those.
88
# We cannot go as far as adding -Wpedantic since it emits too many warnings.
9-
UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration
9+
UAPI_CFLAGS := -std=c90 -Werror=implicit-function-declaration
1010

11-
# In theory, we do not care -m32 or -m64 for header compile tests.
12-
# It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64.
13-
UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
14-
15-
# USERCFLAGS might contain sysroot location for CC.
16-
UAPI_CFLAGS += $(USERCFLAGS)
17-
18-
override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include
11+
override c_flags = $(KBUILD_USERCFLAGS) $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include
1912

2013
# The following are excluded for now because they fail to build.
2114
#

0 commit comments

Comments
 (0)