Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 16/19] sdks: Add clang toolchain to SDKs
Date: Tue,  5 Nov 2024 10:45:35 -0800	[thread overview]
Message-ID: <20241105184540.3450302-16-raj.khem@gmail.com> (raw)
In-Reply-To: <20241105184540.3450302-1-raj.khem@gmail.com>

Use SDK_TOOLCHAINS_LANGS to tether clang toolchain into SDKs

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 documentation/ref-manual/variables.rst         |  2 +-
 meta/classes-recipe/populate_sdk_base.bbclass  |  2 ++
 .../packagegroup-clang-cross-canadian.bb       | 18 ++++++++++++++++++
 .../packagegroup-clang-sdk-target.bb           | 15 +++++++++++++++
 .../packagegroup-core-buildessential.bb        |  5 +++++
 .../packagegroups/packagegroup-core-sdk.bb     |  1 +
 6 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb
 create mode 100644 meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb

diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index 07ed143ac56..77dbe2814cb 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -7715,7 +7715,7 @@ system and gives an overview of their function and contents.
 
    :term:`SDK_TOOLCHAIN_LANGS`
       Specifies programming languages to support in the SDK, as a
-      space-separated list. Currently supported items are ``rust`` and ``go``.
+      space-separated list. Currently supported items are ``clang``, ``rust`` and ``go``.
 
    :term:`SDK_UPDATE_URL`
       An optional URL for an update server for the extensible SDK. If set,
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
index 031c65f05f3..68a772c3bd2 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -64,12 +64,14 @@ SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
 TOOLCHAIN_HOST_TASK ?= " \
     nativesdk-packagegroup-sdk-host \
     packagegroup-cross-canadian-${MACHINE} \
+    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'clang', 'packagegroup-clang-cross-canadian-${MACHINE}', '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-cross-canadian-${MACHINE}', '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-cross-canadian-${MACHINE}', '', d)} \
 "
 TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
 TOOLCHAIN_TARGET_TASK ?= " \
     ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
+    ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'clang', multilib_pkg_extend(d, 'packagegroup-clang-sdk-target'), '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', multilib_pkg_extend(d, 'packagegroup-go-sdk-target'), '', d)} \
     ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', multilib_pkg_extend(d, 'libstd-rs'), '', d)} \
     target-sdk-provides-dummy \
diff --git a/meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb
new file mode 100644
index 00000000000..2a6303cc824
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-clang-cross-canadian.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Host SDK package for Clang cross canadian toolchain"
+PN = "packagegroup-clang-cross-canadian-${MACHINE}"
+
+inherit cross-canadian packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+CLANG="clang-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+RDEPENDS:${PN} = " \
+    ${@all_multilib_tune_values(d, 'CLANG')} \
+    nativesdk-binutils \
+    nativesdk-clang \
+    nativesdk-glibc-dev \
+    nativesdk-libgcc-dev \
+    nativesdk-compiler-rt-dev \
+    nativesdk-libcxx-dev \
+"
diff --git a/meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb
new file mode 100644
index 00000000000..2b30642427c
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-clang-sdk-target.bb
@@ -0,0 +1,15 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+SUMMARY = "Target packages for the Clang SDK"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = " \
+    clang \
+    libcxx \
+    compiler-rt \
+"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
index 2cd67ad05f8..d140f1f54af 100644
--- a/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
@@ -29,3 +29,8 @@ RDEPENDS:packagegroup-core-buildessential = "\
     pkgconfig \
     "
 
+RDEPENDS:packagegroup-core-buildessential:append:toolchain-clang = "\
+    clang \
+    libcxx \
+    compiler-rt \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
index 84e1a41d9a0..c2385a97b44 100644
--- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -30,6 +30,7 @@ RDEPENDS:packagegroup-core-sdk = "\
     tcl \
     ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
     ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
+    ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'clang', 'packagegroup-clang-sdk-target', '', d)} \
 "
 
 SANITIZERS = "libasan-dev libubsan-dev"


  parent reply	other threads:[~2024-11-05 18:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 18:45 [PATCH 01/19] clang.inc: Global settings for clang toolchain Khem Raj
2024-11-05 18:45 ` [PATCH 02/19] nonclangable.inc: Add recipe which can not be built with clang Khem Raj
2025-01-07 13:52   ` [OE-core] " Richard Purdie
2024-11-05 18:45 ` [PATCH 03/19] nonscanable.inc: Includes recipes which can not be used with clang-scan Khem Raj
2024-11-05 18:45 ` [PATCH 04/19] scan-build.bbclass: Add class to enable clang static analyser Khem Raj
2025-01-07 13:50   ` [OE-core] " Richard Purdie
2024-11-05 18:45 ` [PATCH 05/19] clang-native.bbclass: Abstraction to enable clang as native compiler Khem Raj
2024-11-05 18:45 ` [PATCH 06/19] cmake-native.bbclass: Abstraction to use cmake with native toolchains Khem Raj
2024-11-05 18:45 ` [PATCH 07/19] clang: Migrate clang and related recipes from meta-clang Khem Raj
2025-01-07 13:54   ` [OE-core] " Richard Purdie
2024-11-05 18:45 ` [PATCH 08/19] clang/recipes: Add missing SUMMARY field Khem Raj
2025-01-07 13:55   ` [OE-core] " Richard Purdie
2024-11-05 18:45 ` [PATCH 09/19] llvm: Delete Khem Raj
2024-11-05 18:45 ` [PATCH 10/19] spirv-llvm-translator: Add recipe Khem Raj
2024-11-05 18:45 ` [PATCH 11/19] multilib.conf: Add llvm-project-source recipe to NON_MULTILIB_RECIPES Khem Raj
2024-11-05 18:45 ` [PATCH 12/19] distro/defaultsetup: Inherit clang, nonclangable, and nonscanable Khem Raj
2024-11-05 18:45 ` [PATCH 13/19] maintainers.inc: Add myself as maintainer for clang family of recipes Khem Raj
2024-11-05 18:45 ` [PATCH 14/19] clang: PROVIDE llvm-native and llvm Khem Raj
2024-11-05 18:45 ` [PATCH 15/19] rpm: Use gcc to compile always Khem Raj
2024-11-05 18:45 ` Khem Raj [this message]
2024-11-06 10:38   ` [OE-core] [PATCH 16/19] sdks: Add clang toolchain to SDKs Mathieu Dubois-Briand
2024-11-06 14:54     ` Khem Raj
2024-11-05 18:45 ` [PATCH 17/19] toolchain-scripts.bbclass: Add env variables in SDK to use clang/clang++ Khem Raj
2024-11-05 18:45 ` [PATCH 18/19] mesa: update 24.0.7 -> 24.2.2 Khem Raj
2024-11-06 11:30   ` [OE-core] " Alexander Kanavin
2024-11-06 14:53     ` Khem Raj
2024-11-05 18:45 ` [PATCH 19/19] mesa: add support for rusticl Khem Raj
2024-11-06 11:27   ` [OE-core] " Alexander Kanavin
2024-11-06 15:54 ` [OE-core] [PATCH 01/19] clang.inc: Global settings for clang toolchain Richard Purdie
2024-11-06 16:14   ` Khem Raj
2025-01-07 13:50 ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241105184540.3450302-16-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox