Introduce packagegroup-core-buildessential-rust to provide the
on-target dependencies required for building Rust-based kernel
modules, including the Rust toolchain, bindgen, and libclang.
Set PACKAGE_ARCH to TUNE_PKGARCH instead of the packagegroup
default of "all", since libclang is dynamically renamed per
build (e.g. libclang22.1), which is incompatible with an
allarch packagegroup.
On riscv64, also pull in clang, lld, and llvm-bin, since rust
support in the kernel on riscv64 requires the LLVM/Clang
toolchain rather than gcc.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
--- /dev/null
+#
+# SPDX-License-Identifier: MIT
+#
+
+SUMMARY = "Essential build dependencies for building rust kernel modules in image"
+
+PACKAGE_ARCH = "${TUNE_PKGARCH}"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = "\
+ bindgen-cli \
+ libclang \
+ rust \
+ rust-src-lib \
+ rust-tools-rustfmt \
+"
+
+RDEPENDS:${PN}:append:riscv64 = "\
+ clang \
+ lld \
+ llvm-bin \
+"