[Buildroot] [PATCH] package/linux-tools: selftests: Use KHDR_INCLUDES to locate the headers

Thomas Petazzoni thomas.petazzoni at bootlin.com
Mon Sep 7 08:12:39 UTC 2026


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


More information about the buildroot mailing list