From: Harish Sadineni <[email protected]>

This change adds support for Rust-enabled kernel builds by:

-Extending do_kernel_configme dependencies to include rust-native,
 clang-native, and bindgen-cli-native.

-Invoking make rustavailable during do_kernel_configme() to prepare the
 kernel build environment for Rust.

Signed-off-by: Harish Sadineni <[email protected]>
---
 meta/classes-recipe/kernel-yocto.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/classes-recipe/kernel-yocto.bbclass 
b/meta/classes-recipe/kernel-yocto.bbclass
index e53bf15194..4323c4c80a 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -463,8 +463,14 @@ do_kernel_configme[depends] += 
"virtual/cross-binutils:do_populate_sysroot"
 do_kernel_configme[depends] += "virtual/cross-cc:do_populate_sysroot"
 do_kernel_configme[depends] += "bc-native:do_populate_sysroot 
bison-native:do_populate_sysroot"
 do_kernel_configme[depends] += "kern-tools-native:do_populate_sysroot"
+RUST_KERNEL_TASK_DEPENDS ?=  "${@bb.utils.contains('DISTRO_FEATURES', 
'rust-kernel', ' \
+                                  rust-native:do_populate_sysroot \
+                                  clang-native:do_populate_sysroot \
+                                  bindgen-cli-native:do_populate_sysroot', '', 
d)}"
+do_kernel_configme[depends] += "${RUST_KERNEL_TASK_DEPENDS}"
 do_kernel_configme[dirs] += "${S} ${B}"
 do_kernel_configme() {
+
        do_kernel_metadata config
 
        # translate the kconfig_mode into something that merge_config.sh
@@ -506,6 +512,10 @@ do_kernel_configme() {
                echo "# Global settings from linux recipe" >> ${B}/.config
                echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> 
${B}/.config
        fi
+        
+       if ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'true', 
'false', d)}; then
+               oe_runmake -C ${S} O=${B} rustavailable
+       fi
 }
 
 addtask kernel_configme before do_configure after do_patch
-- 
2.49.0

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

Reply via email to