On Tue, Jul 28, 2026 at 10:44 PM wangmy via lists.openembedded.org
<[email protected]> wrote:
>
> From: Wang Mingyu <[email protected]>
>
> When CONFIG_DEBUG_INFO_BTF is enabled in the kernel, building external
> modules that use BPF requires the 'resolve_btfids' host tool. This tool
> and its dependencies live in tools/bpf/ and tools/lib/, but were not
> included in the kernel-devsrc package.
>
> This caused a build failure in the SDK when running 'make scripts prepare':
>
>   make[4]: *** No rule to make target '.../tools/bpf/resolve_btfids/main.o'
>
> Copy tools/bpf/ and tools/lib/ into the devsrc build directory when
> CONFIG_DEBUG_INFO_BTF=y is detected in the kernel config, matching the
> existing pattern for the 'rust' directory and for objtool.
>
> Signed-off-by: Wang Mingyu <[email protected]>
> ---
>  meta/recipes-kernel/linux/kernel-devsrc.bb | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb 
> b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index 237dec6b12..23779ed107 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -176,6 +176,19 @@ do_install() {
>              cp -a --parents $(find tools/arch/${ARCH}/ -type f) 
> $kerneldir/build/
>          fi
>
> +        # In sdk, when CONFIG_DEBUG_INFO_BTF is enabled, building external 
> modules
> +        # that use BPF may require the 'resolve_btfids' host tool. This tool
> +        # and others require sources from tools/bpf/ and tools/lib/ to be 
> built
> +        # within the SDK environment.
> +        if grep -q "CONFIG_DEBUG_INFO_BTF=y" ${B}/.config; then

You need to find another way to make this conditional, or if the files are
small, just copy them over.

kernel devsrc cannot grep and be coupled to specific CONFIG_
symbols.

> +            echo "NOTE: CONFIG_DEBUG_INFO_BTF is enabled, including BPF host 
> tools sources in kernel-devsrc."
> +            # The 'rust' example copies the whole dir. We do the same for 
> consistency.
> +            # This includes resolve_btfids and other potential BPF tools.
> +            cp -r tools/bpf ${kerneldir}/build/tools/
> +            # This also requires the shared tools/lib directory.
> +            cp -r tools/lib ${kerneldir}/build/tools/

What does it actually use from those directories? We avoid complete
copies whenever possible. Rarely are all the files needed.

Bruce

> +        fi
> +
>          if [ "${ARCH}" = "arm64" ]; then
>              # arch/arm64/include/asm/xen references arch/arm
>              cp -a --parents arch/arm/include/asm/xen $kerneldir/build/
> --
> 2.43.0
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#242225): 
https://lists.openembedded.org/g/openembedded-core/message/242225
Mute This Topic: https://lists.openembedded.org/mt/120497655/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to