diff mbox series

[1/4] packagegroup-core-buildessential-rust: add new packagegroup

Message ID 20260717121849.2163115-1-Harish.Sadineni@windriver.com
State New
Headers show
Series [1/4] packagegroup-core-buildessential-rust: add new packagegroup | expand

Commit Message

Harish Sadineni July 17, 2026, 12:18 p.m. UTC
From: Harish Sadineni <Harish.Sadineni@windriver.com>

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>
---
 .../packagegroup-core-buildessential-rust.bb  | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 meta/recipes-core/packagegroups/packagegroup-core-buildessential-rust.bb

Comments

Harish Sadineni July 17, 2026, 12:29 p.m. UTC | #1
Hi all,

Please ignore this thread.
I used the wrong packagegroup name in this commit header.
It should be nativesdk-packagegroup-sdk-host-clang (not 
nativesdk-packagegroup-sdk-clang).

i will send a v2.

Thanks,
Harish

On 17-07-2026 05:48 pm, Sadineni, Harish via lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
>
> Add a new nativesdk packagegroup providing the clang, lld, and
> llvm-bin dependencies needed to build external/out-of-tree
> modules in the SDK using the LLVM/Clang toolchain.
>
> Rust support in the kernel on riscv64 requires the LLVM/Clang
> toolchain rather than gcc, so this packagegroup is intended to
> be added alongside nativesdk-packagegroup-sdk-rust when the SDK
> targets riscv64.
>
> Add this to TOOLCHAIN_HOST_TASK to include it in the SDK.
>
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
>   .../nativesdk-packagegroup-sdk-host-clang.bb       | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>   create mode 100644 meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host-clang.bb
>
> diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host-clang.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host-clang.bb
> new file mode 100644
> index 0000000000..d6ee2120cf
> --- /dev/null
> +++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host-clang.bb
> @@ -0,0 +1,14 @@
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +SUMMARY = "Dependent packages for building external kernel modules using clang"
> +
> +inherit packagegroup
> +inherit_defer nativesdk
> +
> +RDEPENDS:${PN} = "\
> +    nativesdk-clang \
> +    nativesdk-lld \
> +    nativesdk-llvm-bin \
> +"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#241166): https://lists.openembedded.org/g/openembedded-core/message/241166
> Mute This Topic: https://lists.openembedded.org/mt/120313589/8054390
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Harish.Sadineni@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-core/packagegroups/packagegroup-core-buildessential-rust.bb b/meta/recipes-core/packagegroups/packagegroup-core-buildessential-rust.bb
new file mode 100644
index 0000000000..c1993af9aa
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-buildessential-rust.bb
@@ -0,0 +1,23 @@ 
+#
+# 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 \
+"