Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: uapi: move some compiler arguments out of the command definition

Simplify the definition of cmd_hdrtest by moving some of it to a new
variable. This will both enable the upcoming reuse of those flags
and also the extension of cmd_hdrtest.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260316-kbuild-uapi-c-v2-1-35d6d0ed863f@weissschuh.net
Signed-off-by: Nicolas Schier <nsc@kernel.org>

authored by

Thomas Weißschuh and committed by
Nicolas Schier
55d68ec5 bb25b563

+4 -2
+4 -2
usr/include/Makefile
··· 140 140 target-libc = $(filter $(uses-libc), $*.h) 141 141 target-can-compile = $(filter-out $(no-header-test), $*.h) 142 142 143 + hdrtest-flags = -fsyntax-only -Werror \ 144 + -nostdinc $(if $(target-libc), -I $(srctree)/usr/dummy-include) 145 + 143 146 # Include the header twice to detect missing include guard. 144 147 quiet_cmd_hdrtest = HDRTEST $< 145 148 cmd_hdrtest = \ 146 - $(CC) $(c_flags) -fsyntax-only -Werror -x c /dev/null \ 147 - -nostdinc $(if $(target-libc), -I $(srctree)/usr/dummy-include) \ 149 + $(CC) $(c_flags) $(hdrtest-flags) -x c /dev/null \ 148 150 $(if $(target-can-compile), -include $< -include $<); \ 149 151 $(PERL) $(src)/headers_check.pl $(obj) $<; \ 150 152 touch $@