From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
"David Howells" <dhowells@redhat.com>,
"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH RFC 3/5] kbuild: uapi: handle UML in architecture-specific exclusion lists
Date: Sun, 08 Mar 2026 22:24:03 +0100 [thread overview]
Message-ID: <20260308-kbuild-uapi-c-v1-3-86aae09a7f1d@weissschuh.net> (raw)
In-Reply-To: <20260308-kbuild-uapi-c-v1-0-86aae09a7f1d@weissschuh.net>
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>
---
usr/include/Makefile | 11 ++++++-----
1 file 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
--
2.53.0
next prev parent reply other threads:[~2026-03-08 21:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 21:24 [PATCH RFC 0/5] kbuild: uapi: also test UAPI headers against C++ compilers Thomas Weißschuh
2026-03-08 21:24 ` [PATCH RFC 1/5] kbuild: uapi: move some compiler arguments out of the command definition Thomas Weißschuh
2026-03-08 21:24 ` [PATCH RFC 2/5] kbuild: uapi: move all include path flags together Thomas Weißschuh
2026-03-08 21:24 ` Thomas Weißschuh [this message]
2026-03-08 21:24 ` [PATCH RFC 4/5] kbuild: uapi: provide a C++ compatible dummy definition of NULL Thomas Weißschuh
2026-03-08 21:24 ` [PATCH RFC 5/5] kbuild: uapi: also test UAPI headers against C++ compilers Thomas Weißschuh
2026-03-12 8:15 ` Nathan Chancellor
2026-03-12 8:16 ` [PATCH RFC 0/5] " Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260308-kbuild-uapi-c-v1-3-86aae09a7f1d@weissschuh.net \
--to=linux@weissschuh.net \
--cc=arnd@arndb.de \
--cc=dhowells@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®