From: Bruce Ashfield <[email protected]>

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 <[email protected]>
---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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
 
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#244953): 
https://lists.openembedded.org/g/openembedded-core/message/244953
Mute This Topic: https://lists.openembedded.org/mt/121050983/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to