kbuild: uapi: use custom stub headers instead of libc ones

Now that custom stub headers are provided for all libc headers used from
the UAPI headers, the dependency on the toolchain libc can be dropped.

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-7-c17de0d19776@weissschuh.net
Signed-off-by: Nicolas Schier <nsc@kernel.org>
master
Thomas Weißschuh 2026-02-27 07:38:05 +01:00 committed by Nicolas Schier
parent aad94ba683
commit 579f103fb9
No known key found for this signature in database
GPG Key ID: 07520A7016261269
1 changed files with 2 additions and 3 deletions

View File

@ -138,14 +138,13 @@ endif
always-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null))
target-no-libc = $(filter-out $(uses-libc), $*.h)
target-can-compile = $(and $(filter-out $(no-header-test), $*.h), \
$(or $(CONFIG_CC_CAN_LINK), $(target-no-libc)))
target-can-compile = $(filter-out $(no-header-test), $*.h)
# Include the header twice to detect missing include guard.
quiet_cmd_hdrtest = HDRTEST $<
cmd_hdrtest = \
$(CC) $(c_flags) -fsyntax-only -Werror -x c /dev/null \
$(if $(target-no-libc), -nostdinc, -I $(srctree)/usr/dummy-include) \
-nostdinc $(if $(target-no-libc), , -I $(srctree)/usr/dummy-include) \
$(if $(target-can-compile), -include $< -include $<); \
$(PERL) $(src)/headers_check.pl $(obj) $<; \
touch $@