From: Sasha Levin <sashal@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] selftests/proc: search the kernel headers before the tools copies
Date: Tue, 3 Nov 2026 09:23:04 -0500 [thread overview]
Message-ID: <20261103142304.122564-1-sashal@kernel.org> (raw)
The proc tests are the only selftests that add $(TOOLS_INCLUDES)
without $(KHDR_INCLUDES) in front of it. The <linux/types.h> in
tools/include/uapi then replaces the real one, and unlike the real one
it does not include <asm/types.h>. On powerpc and s390, <signal.h> pulls
in the kernel's asm/sigcontext.h, which needs __vector128 from
asm/types.h, so eight proc tests fail to build on powerpc and six on
s390:
/usr/lib/linux/uapi/s390/asm/sigcontext.h:73:9: error: unknown type name '__vector128'
Put $(KHDR_INCLUDES) before $(TOOLS_INCLUDES), as the other selftests
that use TOOLS_INCLUDES do, so that <linux/types.h> comes from the
headers of the kernel under test.
Fixes: 81510a0eaa69 ("selftests/proc: add PROCMAP_QUERY ioctl tests")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
KernelCI's powerpc and s390 kselftest builds hit this. I reproduced the
error with s390x-linux-gnu-gcc by including asm/sigcontext.h with
tools/include/uapi in front of the system headers, and it builds with
the kernel headers searched first. The proc tests for x86_64 build the
same 26 programs without warnings before and after, with O= and without
installed headers.
tools/testing/selftests/proc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile
index a7de2bb6d8be1..30cce563d9a33 100644
--- a/tools/testing/selftests/proc/Makefile
+++ b/tools/testing/selftests/proc/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
CFLAGS += -Wall -O2 -Wno-unused-function
-CFLAGS += $(TOOLS_INCLUDES)
+CFLAGS += $(KHDR_INCLUDES) $(TOOLS_INCLUDES)
LDFLAGS += -pthread
TEST_GEN_PROGS :=
--
2.53.0
reply other threads:[~2026-11-03 14:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261103142304.122564-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
/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®