* [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers
@ 2026-09-05 9:39 Maxime Chevallier via buildroot
2026-09-07 6:23 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Maxime Chevallier via buildroot @ 2026-09-05 9:39 UTC (permalink / raw)
To: buildroot; +Cc: Maxime Chevallier, thomas.petazzoni
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.
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"")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
package/linux-tools/linux-tool-selftests.mk.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/linux-tools/linux-tool-selftests.mk.in b/package/linux-tools/linux-tool-selftests.mk.in
index db7e4fa1a3..f2f329c05f 100644
--- a/package/linux-tools/linux-tool-selftests.mk.in
+++ b/package/linux-tools/linux-tool-selftests.mk.in
@@ -24,7 +24,7 @@ SELFTESTS_DEPENDENCIES = \
SELFTESTS_MAKE_FLAGS = \
$(LINUX_MAKE_FLAGS) \
ARCH=$(SELFTESTS_ARCH) \
- KHDR_DIR=$(LINUX_DIR)/usr/include
+ KHDR_INCLUDES="-isystem $(LINUX_DIR)/usr/include"
LINUX_TOOLS_BIN_ARCH_EXCLUDE += \
/usr/lib/kselftests/tc-testing/
--
2.55.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers
2026-09-05 9:39 [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers Maxime Chevallier via buildroot
@ 2026-09-07 6:23 ` Thomas Petazzoni via buildroot
2026-09-07 6:54 ` Maxime Chevallier via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-09-07 6:23 UTC (permalink / raw)
To: Maxime Chevallier; +Cc: buildroot
Hello Maxime,
On Sat, Sep 05, 2026 at 11:39:51AM +0200, Maxime Chevallier via buildroot wrote:
> 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.
But then doesn't that mean that the build would be broken for people
who build Linux < 6.7 ? Keep in mind that the Linux kernel version in
Buildroot is configurable, so not everyone is building the latest and
greatest.
If that's the case, then maybe we need to keep both?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers
2026-09-07 6:23 ` Thomas Petazzoni via buildroot
@ 2026-09-07 6:54 ` Maxime Chevallier via buildroot
2026-09-07 8:12 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Maxime Chevallier via buildroot @ 2026-09-07 6:54 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
Hi Thomas,
On 9/7/26 08:23, Thomas Petazzoni wrote:
> Hello Maxime,
>
> On Sat, Sep 05, 2026 at 11:39:51AM +0200, Maxime Chevallier via buildroot wrote:
>> 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.
>
> But then doesn't that mean that the build would be broken for people
> who build Linux < 6.7 ? Keep in mind that the Linux kernel version in
> Buildroot is configurable, so not everyone is building the latest and
> greatest.
Looking at the kernel history, the KHDR_DIR only existed between v6.4 and v6.7 :
Added in v6.4 :
9fc96c7c19df ("selftests: error out if kernel header files are not yet built")
Reverted in v6.7 :
43e8832fed08 ("Revert "selftests: error out if kernel header files are not yet built"")
And it looks like even between that v6.4 and v6.7 window, KHDR_DIR is just used to
populate KHDR_INCLUDES :
tools/testing/selftests/lib.mk
[...]
KHDR_INCLUDES := -isystem $(KHDR_DIR)
So I think this should work even on kernels older than v6.7, I haven't
tried though ;(
I can add these details in the commit log in a resend if you want,
Maxime
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers
2026-09-07 6:54 ` Maxime Chevallier via buildroot
@ 2026-09-07 8:12 ` Thomas Petazzoni via buildroot
2026-10-03 16:31 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-09-07 8:12 UTC (permalink / raw)
To: Maxime Chevallier; +Cc: buildroot
Hello,
On Mon, Sep 07, 2026 at 08:54:33AM +0200, Maxime Chevallier wrote:
> Looking at the kernel history, the KHDR_DIR only existed between v6.4 and v6.7 :
>
> Added in v6.4 :
>
> 9fc96c7c19df ("selftests: error out if kernel header files are not yet built")
>
> Reverted in v6.7 :
>
> 43e8832fed08 ("Revert "selftests: error out if kernel header files are not yet built"")
>
> And it looks like even between that v6.4 and v6.7 window, KHDR_DIR is just used to
> populate KHDR_INCLUDES :
>
>
> tools/testing/selftests/lib.mk
>
> [...]
>
> KHDR_INCLUDES := -isystem $(KHDR_DIR)
Ah good, so your change would potentially work across all kernel
versions?
> So I think this should work even on kernels older than v6.7, I haven't
> tried though ;(
Can we give it a quick try, just to make sure?
> I can add these details in the commit log in a resend if you want,
That would be awesome, thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers
2026-09-07 8:12 ` Thomas Petazzoni via buildroot
@ 2026-10-03 16:31 ` Thomas Petazzoni via buildroot
2026-10-03 21:29 ` Maxime Chevallier via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-03 16:31 UTC (permalink / raw)
To: Maxime Chevallier, buildroot
On Mon, Sep 07, 2026 at 10:12:39AM +0200, Thomas Petazzoni via buildroot wrote:
> > So I think this should work even on kernels older than v6.7, I haven't
> > tried though ;(
>
> Can we give it a quick try, just to make sure?
Gentle ping :-)
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers
2026-10-03 16:31 ` Thomas Petazzoni via buildroot
@ 2026-10-03 21:29 ` Maxime Chevallier via buildroot
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Chevallier via buildroot @ 2026-10-03 21:29 UTC (permalink / raw)
To: Thomas Petazzoni, buildroot
Hi,
On 10/3/26 18:31, Thomas Petazzoni wrote:
> On Mon, Sep 07, 2026 at 10:12:39AM +0200, Thomas Petazzoni via buildroot wrote:
>
>>> So I think this should work even on kernels older than v6.7, I haven't
>>> tried though ;(
>>
>> Can we give it a quick try, just to make sure?
>
> Gentle ping :-)
Sorry for the delay :/
So I tried and unfortunately I was wrong, the KHDR_DIR variable has another
use site, and without it the kselftests build fails on 6.6 :(
So we do need to keep both KHDR_IR and KHDR_INCLUDES, I've tested that and it
works for at least 6.1, 6.6, 6.12 and upstream.
I'll spin another round somewhere on my way to OSS/LPC.
Thanks,
Maxime
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-03 21:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-05 9:39 [Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers Maxime Chevallier via buildroot
2026-09-07 6:23 ` Thomas Petazzoni via buildroot
2026-09-07 6:54 ` Maxime Chevallier via buildroot
2026-09-07 8:12 ` Thomas Petazzoni via buildroot
2026-10-03 16:31 ` Thomas Petazzoni via buildroot
2026-10-03 21:29 ` Maxime Chevallier via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox