]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kbuild: uapi: only use dummy-include for headers which use libc
authorThomas Weißschuh <linux@weissschuh.net>
Fri, 27 Feb 2026 06:38:03 +0000 (07:38 +0100)
committerNicolas Schier <nsc@kernel.org>
Thu, 12 Mar 2026 11:48:08 +0000 (12:48 +0100)
The headers which do not rely on libc are using built using -nostdinc.
For them the dummy headers are pointless.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Tested-by: Nicolas Schier <nsc@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260227-kbuild-uapi-libc-v1-5-c17de0d19776@weissschuh.net
Signed-off-by: Nicolas Schier <nsc@kernel.org>
usr/include/Makefile

index a8619aa85c873f32d319c3d3249dd15eb831c7a5..fdc79cffcc9774f36bac204508237d284d320f3f 100644 (file)
@@ -8,7 +8,7 @@
 # We cannot go as far as adding -Wpedantic since it emits too many warnings.
 UAPI_CFLAGS := -std=c90 -Werror=implicit-function-declaration
 
-override c_flags = $(KBUILD_USERCFLAGS) $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include
+override c_flags = $(KBUILD_USERCFLAGS) $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj)
 
 # The following are excluded for now because they fail to build.
 #
@@ -145,7 +145,7 @@ target-can-compile = $(and $(filter-out $(no-header-test), $*.h), \
 quiet_cmd_hdrtest = HDRTEST $<
       cmd_hdrtest = \
                $(CC) $(c_flags) -fsyntax-only -Werror -x c /dev/null \
-                       $(if $(target-no-libc), -nostdinc) \
+                       $(if $(target-no-libc), -nostdinc, -I $(srctree)/usr/dummy-include) \
                        $(if $(target-can-compile), -include $< -include $<); \
                $(PERL) $(src)/headers_check.pl $(obj) $<; \
                touch $@