diff mbox series

[meta,05/07] kernel-devsrc: ship tools/include for archscripts host tools

Message ID 20260902132305.3685228-6-bruce.ashfield@gmail.com
State New
Headers show
Series linux-yocto: consolidated pull request | expand

Commit Message

Bruce Ashfield Sept. 2, 2026, 1:23 p.m. UTC
From: Bruce Ashfield <bruce.ashfield@gmail.com>

Since 7.2, "make scripts prepare" builds arch/x86/tools/vdso2c as part of
the archscripts target. vdso2c is compiled with -I$(srctree)/tools/include
and resolves <linux/types.h> to tools/include/linux/types.h, which pulls
in <stdbool.h>. On target that header was only shipped inside the objtool
block, but objtool is built on x86-64 only (arch/x86/Kconfig: select
HAVE_OBJTOOL if X86_64). A 32-bit x86 kernel-devsrc build therefore lacked
tools/include, fell back to include/uapi/linux/types.h (which does not
define bool), and failed:

  arch/x86/tools/vdso2c.c:74:9: error: unknown type name 'bool'

Copy tools/include unconditionally so the archscripts host tools build
regardless of whether objtool is present.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index a38e4fed44..90bdbfc534 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -158,6 +158,11 @@  do_install() {
         # Remove as we else would ned to RDEPEND on make
         rm $kerneldir/build/scripts/package/debian/rules 2>/dev/null || :
 
+        # tools/include is needed by the archscripts host tools that
+        # 'make scripts prepare' rebuilds on target (e.g. x86 vdso2c) and
+	# not checked against objtool as it previously was.
+        cp -a --parents tools/include/* $kerneldir/build/
+
         # if our build dir had objtool, it will also be rebuilt on target, so
         # we copy what is required for that build
         if [ -f ${B}/tools/objtool/objtool ]; then
@@ -173,8 +178,6 @@  do_install() {
             cp -a --parents tools/lib/* $kerneldir/build/
             cp -a --parents tools/lib/subcmd/* $kerneldir/build/
 
-            cp -a --parents tools/include/* $kerneldir/build/
-
             cp -a --parents $(find tools/arch/${ARCH}/ -type f) $kerneldir/build/
         fi