* [PATCH] selftests/proc: search the kernel headers before the tools copies
@ 2026-11-03 14:23 Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-11-03 14:23 UTC (permalink / raw)
To: Andrew Morton
Cc: Shuah Khan, Andrii Nakryiko, Suren Baghdasaryan, linux-fsdevel,
linux-kselftest, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-03 14:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 14:23 [PATCH] selftests/proc: search the kernel headers before the tools copies Sasha Levin
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®