summaryrefslogtreecommitdiff
path: root/usr/include
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2026-03-16 17:52:00 +0100
committerNicolas Schier <nsc@kernel.org>2026-03-25 13:24:41 +0100
commitb4ec38cb739e9419ddb7310f6c49fb6d7bc39c1d (patch)
tree3a16563cfab2f000bdb446f33384dea50944df36 /usr/include
parentcf822413093e4fdf17ce12f10f3983b1d5f8b659 (diff)
downloadlwn-b4ec38cb739e9419ddb7310f6c49fb6d7bc39c1d.tar.gz
lwn-b4ec38cb739e9419ddb7310f6c49fb6d7bc39c1d.zip
kbuild: uapi: handle UML in architecture-specific exclusion lists
When building User Mode Linux SRCARCH is set to 'um', while the actual underlying architecture is provided in HEADER_ARCH. Allow the exclusion lists to work on UML by comparing against HEADER_ARCH when that is available. 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-3-35d6d0ed863f@weissschuh.net Signed-off-by: Nicolas Schier <nsc@kernel.org>
Diffstat (limited to 'usr/include')
-rw-r--r--usr/include/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 74f5ba24bb29..edeaf9d778c4 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -7,6 +7,7 @@
# -std=c90 (equivalent to -ansi) catches the violation of those.
# We cannot go as far as adding -Wpedantic since it emits too many warnings.
UAPI_CFLAGS := -std=c90 -Werror=implicit-function-declaration
+UAPI_ARCH := $(or $(HEADER_ARCH),$(SRCARCH))
override c_flags = $(KBUILD_USERCFLAGS) $(UAPI_CFLAGS) -Wp,-MMD,$(depfile)
@@ -48,11 +49,11 @@ no-header-test += xen/privcmd.h
# More headers are broken in some architectures
-ifneq ($(filter arc openrisc xtensa nios2, $(SRCARCH)),)
+ifneq ($(filter arc openrisc xtensa nios2, $(UAPI_ARCH)),)
no-header-test += linux/bpf_perf_event.h
endif
-ifeq ($(SRCARCH),sparc)
+ifeq ($(UAPI_ARCH),sparc)
no-header-test += asm/uctx.h
no-header-test += asm/fbio.h
endif
@@ -122,15 +123,15 @@ uses-libc += linux/wireless.h
uses-libc += regulator/regulator.h
uses-libc += scsi/fc/fc_els.h
-ifeq ($(SRCARCH),hexagon)
+ifeq ($(UAPI_ARCH),hexagon)
uses-libc += asm/sigcontext.h
endif
-ifeq ($(SRCARCH),nios2)
+ifeq ($(UAPI_ARCH),nios2)
uses-libc += asm/ptrace.h
endif
-ifeq ($(SRCARCH),s390)
+ifeq ($(UAPI_ARCH),s390)
uses-libc += asm/chpid.h
uses-libc += asm/chsc.h
endif