diff mbox series

[RFC,v3,02/11] linux-yocto: add clang-native,rust-native and bindgen-cli-native to DEPENDS

Message ID 20251119164804.256364-3-Harish.Sadineni@windriver.com
State New
Headers show
Series Enable rust support for linux kernel | expand

Commit Message

Harish Sadineni Nov. 19, 2025, 4:47 p.m. UTC
From: Harish Sadineni <Harish.Sadineni@windriver.com>

Add `clang-native`, `rust-native'  and `bindgen-cli-native` to `DEPENDS` to support
Rust-based kernel modules or features that require generating Rust FFI bindings using
bindgen during the kernel build process

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
 meta/recipes-kernel/linux/linux-yocto.inc | 2 ++
 1 file changed, 2 insertions(+)

Comments

Randy MacLeod Nov. 19, 2025, 7:48 p.m. UTC | #1
On 2025-11-19 11:47 a.m., Harish.Sadineni@windriver.com wrote:
> From: Harish Sadineni<Harish.Sadineni@windriver.com>
>
> Add `clang-native`, `rust-native'  and `bindgen-cli-native` to `DEPENDS` to support
> Rust-based kernel modules or features that require generating Rust FFI bindings using
> bindgen during the kernel build process

I'd like to see either a change the shortlog from:

    linux-yocto: add clang-native,rust-native and bindgen-cli-native to 
DEPENDS

to:
    linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS

or for you to introduce the rust-kernel DF in the body or ideally both.

../Randy


>
> Signed-off-by: Harish Sadineni<Harish.Sadineni@windriver.com>
> ---
>   meta/recipes-kernel/linux/linux-yocto.inc | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> index 4d0a726bb6..41b12b6f14 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> @@ -81,6 +81,8 @@ KERNEL_DEBUG ?= ""
>   DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}'
>   DEPENDS += "openssl-native util-linux-native"
>   DEPENDS += "gmp-native libmpc-native"
> +RUST_KERNEL_DEPENDS ?="${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'clang-native 
> rust-native bindgen-cli-native', '', d)}"
> +DEPENDS += "${RUST_KERNEL_DEPENDS}"
>   
>   # Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme
>   do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}'
Harish Sadineni Nov. 20, 2025, 1:44 p.m. UTC | #2
On 11/20/2025 1:18 AM, Randy MacLeod wrote:
> On 2025-11-19 11:47 a.m., Harish.Sadineni@windriver.com wrote:
>> From: Harish Sadineni<Harish.Sadineni@windriver.com>
>>
>> Add `clang-native`, `rust-native'  and `bindgen-cli-native` to `DEPENDS` to support
>> Rust-based kernel modules or features that require generating Rust FFI bindings using
>> bindgen during the kernel build process
>
> I'd like to see either a change the shortlog from:
>
>    linux-yocto: add clang-native,rust-native and bindgen-cli-native to 
> DEPENDS
>
> to:
>    linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS
>
> or for you to introduce the rust-kernel DF in the body or ideally both.
>
> ../Randy
>
Sure Randy.
I will address all the other minor review comments with RFC v4.

Thanks,
Harish
>
>> Signed-off-by: Harish Sadineni<Harish.Sadineni@windriver.com>
>> ---
>>   meta/recipes-kernel/linux/linux-yocto.inc | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
>> index 4d0a726bb6..41b12b6f14 100644
>> --- a/meta/recipes-kernel/linux/linux-yocto.inc
>> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
>> @@ -81,6 +81,8 @@ KERNEL_DEBUG ?= ""
>>   DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}'
>>   DEPENDS += "openssl-native util-linux-native"
>>   DEPENDS += "gmp-native libmpc-native"
>> +RUST_KERNEL_DEPENDS ?="${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'clang-native 
>> rust-native bindgen-cli-native', '', d)}"
>> +DEPENDS += "${RUST_KERNEL_DEPENDS}"
>>   
>>   # Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme
>>   do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}'
>
>
> -- 
> # Randy MacLeod
> # Wind River Linux
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 4d0a726bb6..41b12b6f14 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -81,6 +81,8 @@  KERNEL_DEBUG ?= ""
 DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}'
 DEPENDS += "openssl-native util-linux-native"
 DEPENDS += "gmp-native libmpc-native"
+RUST_KERNEL_DEPENDS ?= "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'clang-native rust-native bindgen-cli-native', '', d)}"
+DEPENDS += "${RUST_KERNEL_DEPENDS}"
 
 # Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme
 do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}'