Skip to contentSkip to conversation

package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers

PATCH Applied Maxime Chevallier via buildroot 1 participant 3 messages Oct 4 – Oct 16

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers

Since v6.7 [1], the KHDR_DIR variable isn't used anymore by the kernel selftest Makefiles to locate the kernel headers. Instead, KHDR_INCLUDES is used to specify their location. It was only available between v6.5 and v6.7.

Keep KHDR_DIR for compatibility with v6.5 to v6.7 kernels, while KHDR_INCLUDES is used by both pre 6.5 and post 6.7 kernels.

Let's pass it with the "-isystem" flag, as is done in the default values used in the selftest makefiles.

[1]: 43e8832fed08 ("Revert "selftests: error out if kernel header files are not yet built"")

---
 package/linux-tools/linux-tool-selftests.mk.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/linux-tools/linux-tool-selftests.mk.in +2 -1
index db7e4fa1a3..032a71e320 100644
@@ -24,7 +24,8 @@ SELFTESTS_DEPENDENCIES = \
 SELFTESTS_MAKE_FLAGS = \
 	$(LINUX_MAKE_FLAGS) \
 	ARCH=$(SELFTESTS_ARCH) \
-	KHDR_DIR=$(LINUX_DIR)/usr/include
+	KHDR_DIR=$(LINUX_DIR)/usr/include \
+	KHDR_INCLUDES="-isystem $(LINUX_DIR)/usr/include"
 
 LINUX_TOOLS_BIN_ARCH_EXCLUDE += \
 	/usr/lib/kselftests/tc-testing/
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 8 lines · Maxime Chevallier via buildroot

Since v6.7 [1], the KHDR_DIR variable isn't used anymore by the kernel selftest Makefiles to locate the kernel headers. Instead, KHDR_INCLUDES is used to specify their location. It was only available between v6.5 and v6.7.

Keep KHDR_DIR for compatibility with v6.5 to v6.7 kernels, while KHDR_INCLUDES is used by both pre 6.5 and post 6.7 kernels.

Quoted 6 lines

Let's pass it with the "-isystem" flag, as is done in the default values used in the selftest makefiles.

[1]: 43e8832fed08 ("Revert "selftests: error out if kernel header files are not yet built"")

Applied to master, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Maxime Chevallier via buildroot

In reply of:

Quoted 8 lines

Since v6.7 [1], the KHDR_DIR variable isn't used anymore by the kernel selftest Makefiles to locate the kernel headers. Instead, KHDR_INCLUDES is used to specify their location. It was only available between v6.5 and v6.7.

Keep KHDR_DIR for compatibility with v6.5 to v6.7 kernels, while KHDR_INCLUDES is used by both pre 6.5 and post 6.7 kernels.

Quoted 6 lines

Let's pass it with the "-isystem" flag, as is done in the default values used in the selftest makefiles.

[1]: 43e8832fed08 ("Revert "selftests: error out if kernel header files are not yet built"")

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 9 lines
---
 package/linux-tools/linux-tool-selftests.mk.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/linux-tools/linux-tool-selftests.mk.in +0 -0
index db7e4fa1a3..032a71e320 100644

package/linux-tools/linux-tool-selftests.mk.in SELFTESTS_DEPENDENCIES = \ · line 31

Quoted 9 lines
package/linux-tools/linux-tool-selftests.mk.in +2 -1
@@ -24,7 +24,8 @@ SELFTESTS_DEPENDENCIES = \
 SELFTESTS_MAKE_FLAGS = \
 	$(LINUX_MAKE_FLAGS) \
 	ARCH=$(SELFTESTS_ARCH) \
-	KHDR_DIR=$(LINUX_DIR)/usr/include
+	KHDR_DIR=$(LINUX_DIR)/usr/include \
+	KHDR_INCLUDES="-isystem $(LINUX_DIR)/usr/include"
 
 LINUX_TOOLS_BIN_ARCH_EXCLUDE += \
 	/usr/lib/kselftests/tc-testing/

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot