From: Harish Sadineni <[email protected]>

Kernel Rust support on riscv64 requires Clang. Wrynose doesn't
provide a Clang toolchain for kernel builds, but downstream layers
may add this support via a linux-yocto_%.bbappend. Rather than
unconditionally skipping riscv64, check whether a Clang toolchain
is available and only error out with a clear message when it isn't,
so that users with Clang-enabled downstream configurations aren't broken.

Signed-off-by: Harish Sadineni <[email protected]>
Signed-off-by: Yoann Congal <[email protected]>
[YC: fixed a typo in message. This matches master commit 2b228490b7ef]
---
 meta/classes-recipe/kernel-yocto-rust.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/classes-recipe/kernel-yocto-rust.bbclass 
b/meta/classes-recipe/kernel-yocto-rust.bbclass
index 49f2bfc1ae8..4c0b7231e6a 100644
--- a/meta/classes-recipe/kernel-yocto-rust.bbclass
+++ b/meta/classes-recipe/kernel-yocto-rust.bbclass
@@ -25,3 +25,13 @@ do_kernel_configme:append () {
 # More details in: 
https://lists.openembedded.org/g/openembedded-core/message/229336
 # Disable ccache for kernel build if kernel rust support is enabled to 
workaround this.
 CCACHE_DISABLE ?= "1"
+
+python () {
+    if d.getVar('TARGET_ARCH') == 'riscv64' and d.getVar('TOOLCHAIN') != 
'clang':
+        raise bb.parse.SkipRecipe(
+            "Rust support in the kernel on riscv64 requires kernel to be build 
with clang "
+            "toolchain, but the kernel is built with toolchain '%s'. See "
+            "https://docs.kernel.org/rust/arch-support.html for details."
+            % d.getVar('TOOLCHAIN')
+        )
+}
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#246101): 
https://lists.openembedded.org/g/openembedded-core/message/246101
Mute This Topic: https://lists.openembedded.org/mt/121305579/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to