selftests/proc: search the kernel headers before the tools copies
Subsystems (3)
PATCH 1/1 selftests/proc: search the kernel headers before the tools copies
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.
---
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(-)
tools/testing/selftests/proc/Makefile +1 -1
@@ -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 :=
Signature · 1 line
2.53.0