From patchwork Thu Jul 24 18:38:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 67418 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09C57C83F26 for ; Thu, 24 Jul 2025 18:38:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1342.1753382337509403637 for ; Thu, 24 Jul 2025 11:38:58 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 820C0176C for ; Thu, 24 Jul 2025 11:38:50 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 99C3D3F66E for ; Thu, 24 Jul 2025 11:38:56 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/2] clang: move get_clang_arch() functions to the common inc file Date: Thu, 24 Jul 2025 19:38:48 +0100 Message-ID: <20250724183849.3546823-1-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 24 Jul 2025 18:38:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220857 These functions are useful outside of just the clang recipe, so move them to a common .inc file so they can be used by other clang-related recipes. Also make the function fail if it doesn't recognise the architecture, instead of returning the empty string and causing mysterious fails later. Signed-off-by: Ross Burton --- meta/recipes-devtools/clang/clang_git.bb | 23 -------------------- meta/recipes-devtools/clang/common-clang.inc | 23 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index 60eb256e1ad..ad070b5a3e0 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -30,29 +30,6 @@ inherit cmake pkgconfig python3native python3targetconfig multilib_header OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" -def get_clang_arch(bb, d, arch_var): - import re - a = d.getVar(arch_var) - if re.match('(i.86|athlon|x86.64)$', a): return 'X86' - elif re.match('arm$', a): return 'ARM' - elif re.match('armeb$', a): return 'ARM' - elif re.match('aarch64$', a): return 'AArch64' - elif re.match('aarch64_be$', a): return 'AArch64' - elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' - elif re.match('riscv32$', a): return 'RISCV' - elif re.match('riscv64$', a): return 'RISCV' - elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' - elif re.match('loongarch64$', a): return 'LoongArch' - else: - bb.note("'%s' is not a primary llvm architecture" % a) - return "" - -def get_clang_host_arch(bb, d): - return get_clang_arch(bb, d, 'HOST_ARCH') - -def get_clang_target_arch(bb, d): - return get_clang_arch(bb, d, 'TARGET_ARCH') - PACKAGECONFIG_CLANG_COMMON = "build-id eh libedit rtti shared-libs libclang-python \ ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'lld', '', d)} \ ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus libomp unwindlib', '', d)} \ diff --git a/meta/recipes-devtools/clang/common-clang.inc b/meta/recipes-devtools/clang/common-clang.inc index b8f37daea24..6ac53125f09 100644 --- a/meta/recipes-devtools/clang/common-clang.inc +++ b/meta/recipes-devtools/clang/common-clang.inc @@ -21,4 +21,27 @@ LLVM_LIBDIR_SUFFIX = "${@d.getVar('baselib').replace('lib', '')}" # set the default pigz thread export PIGZ = "-p ${@oe.utils.cpu_count(at_least=2)}" +def get_clang_arch(bb, d, arch_var): + import re + a = d.getVar(arch_var) + if re.match('(i.86|athlon|x86.64)$', a): return 'X86' + elif re.match('arm$', a): return 'ARM' + elif re.match('armeb$', a): return 'ARM' + elif re.match('aarch64$', a): return 'AArch64' + elif re.match('aarch64_be$', a): return 'AArch64' + elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' + elif re.match('riscv32$', a): return 'RISCV' + elif re.match('riscv64$', a): return 'RISCV' + elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' + elif re.match('loongarch64$', a): return 'LoongArch' + else: + bb.fatal("Unhandled architecture %s" % arch_val) + return "" + +def get_clang_host_arch(bb, d): + return get_clang_arch(bb, d, 'HOST_ARCH') + +def get_clang_target_arch(bb, d): + return get_clang_arch(bb, d, 'TARGET_ARCH') + require common.inc From patchwork Thu Jul 24 18:38:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 67417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BD10C87FCA for ; Thu, 24 Jul 2025 18:38:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1343.1753382337952516997 for ; Thu, 24 Jul 2025 11:38:58 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2FC41266C for ; Thu, 24 Jul 2025 11:38:51 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 41B8E3F66E for ; Thu, 24 Jul 2025 11:38:57 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/2] spirv-llvm-translator: depend on llvm, not clang Date: Thu, 24 Jul 2025 19:38:49 +0100 Message-ID: <20250724183849.3546823-2-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250724183849.3546823-1-ross.burton@arm.com> References: <20250724183849.3546823-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 24 Jul 2025 18:38:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220858 At the moment the clang recipe provides llvm, but they could be split in the future and this makes it clear that the translator just needs libllvm and not the clang tools. Signed-off-by: Ross Burton --- meta/recipes-graphics/spir/spirv-llvm-translator_20.1.4.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-graphics/spir/spirv-llvm-translator_20.1.4.bb b/meta/recipes-graphics/spir/spirv-llvm-translator_20.1.4.bb index 14e4bb74ace..64a73ce55aa 100644 --- a/meta/recipes-graphics/spir/spirv-llvm-translator_20.1.4.bb +++ b/meta/recipes-graphics/spir/spirv-llvm-translator_20.1.4.bb @@ -13,7 +13,7 @@ SRC_URI = " \ UPSTREAM_CHECK_GITTAGREGEX = "v(?P\d+(\.\d+)+)" -DEPENDS = "clang spirv-tools spirv-headers" +DEPENDS = "llvm spirv-tools spirv-headers" inherit cmake pkgconfig python3native