From patchwork Mon Jul 21 13:24:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 67200 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 90DB7C83F25 for ; Mon, 21 Jul 2025 13:24:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.40626.1753104273130286212 for ; Mon, 21 Jul 2025 06:24:33 -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 AF67D153B for ; Mon, 21 Jul 2025 06:24:26 -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 26D1E3F6A8 for ; Mon, 21 Jul 2025 06:24:32 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH v3 1/5] cmake: remove CMAKE_SYSTEM_* from the native toolchain Date: Mon, 21 Jul 2025 14:24:22 +0100 Message-ID: <20250721132426.3321928-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 ; Mon, 21 Jul 2025 13:24:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220687 If these variables are set explictly then CMake assumes that it is cross-compiling[1]. We don't need to set them as the default values as detected by CMake are correct for native. [1] https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING.html Signed-off-by: Ross Burton --- meta/classes-recipe/cmake.bbclass | 2 -- 1 file changed, 2 deletions(-) diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass index 449fe2bb443..0bb0f33a9ec 100644 --- a/meta/classes-recipe/cmake.bbclass +++ b/meta/classes-recipe/cmake.bbclass @@ -180,8 +180,6 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${includedir}) EOF cat > ${WORKDIR}/toolchain-native.cmake < X-Patchwork-Id: 67203 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 A5E10C87FC8 for ; Mon, 21 Jul 2025 13:24:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.40627.1753104273800014302 for ; Mon, 21 Jul 2025 06:24:33 -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 584C51595 for ; Mon, 21 Jul 2025 06:24:27 -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 CC5EC3F6A8 for ; Mon, 21 Jul 2025 06:24:32 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH v3 2/5] libclc: split out of clang Date: Mon, 21 Jul 2025 14:24:23 +0100 Message-ID: <20250721132426.3321928-2-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250721132426.3321928-1-ross.burton@arm.com> References: <20250721132426.3321928-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 ; Mon, 21 Jul 2025 13:24:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220688 Split the libclc subproject out of the clang recipe and into a dedicated libclc recipe. This is useful because libclc is the OpenCL runtime library and as such isn't target-specific and needs a native clang to build, not a target libllvm. Verified that nothing is dropped by adding clang and libclc to an image and verifying that the file list is the same before and after this change. We need to patch the libclc CMakeLists to allow it to use an out-of-tree prepare_builtins binary, discussion is ongoing with upstream to resolve this properly. Signed-off-by: Ross Burton --- meta/conf/distro/include/maintainers.inc | 1 + ...sting-prepare-builtins-in-standalone.patch | 57 +++++++++++++++++++ meta/recipes-devtools/clang/clang_git.bb | 17 ++---- meta/recipes-devtools/clang/common.inc | 1 + meta/recipes-devtools/clang/libclc_git.bb | 43 ++++++++++++++ 5 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch create mode 100644 meta/recipes-devtools/clang/libclc_git.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 6bfc2efb162..927aac16d6d 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -328,6 +328,7 @@ RECIPE_MAINTAINER:pn-libcap-ng = "Yi Zhao " RECIPE_MAINTAINER:pn-libcap-ng-python = "Yi Zhao " RECIPE_MAINTAINER:pn-libcgroup = "Unassigned " RECIPE_MAINTAINER:pn-libcheck = "Yi Zhao " +RECIPE_MAINTAINER:pn-libclc = "Khem Raj " RECIPE_MAINTAINER:pn-libcomps = "Unassigned " RECIPE_MAINTAINER:pn-libconvert-asn1-perl = "Tim Orling " RECIPE_MAINTAINER:pn-libcxx = "Khem Raj " diff --git a/meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch b/meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch new file mode 100644 index 00000000000..46929798adb --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0001-libclc-allow-existing-prepare-builtins-in-standalone.patch @@ -0,0 +1,57 @@ +From 348f846b206780646430d6477c04b7793b669f34 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Wed, 16 Jul 2025 23:24:21 +0100 +Subject: [PATCH] allow external prepare_builtins + +In standalone cross builds, libclc can't build a native prepare_builtins. + +Hack the CMake to allow it to use an existing binary, which we build in the recipe. + +Upstream-Status: Inappropriate [discussion for a proper fix in https://github.com/llvm/llvm-project/issues/149814] +Signed-off-by: Ross Burton +--- + libclc/CMakeLists.txt | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt +index 43e213b385f5..d4a6d096169e 100644 +--- a/libclc/CMakeLists.txt ++++ b/libclc/CMakeLists.txt +@@ -181,17 +181,28 @@ set(LLVM_LINK_COMPONENTS + IRReader + Support + ) ++ + if( LIBCLC_STANDALONE_BUILD ) +- add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp ) +- set( prepare_builtins_exe prepare_builtins ) +- set( prepare_builtins_target prepare_builtins ) ++ message("cross ${CMAKE_CROSSCOMPILING}") ++ if(CMAKE_CROSSCOMPILING) ++ find_program(PREPARE_BUILTINS prepare_builtins REQUIRED) ++ message("found ${PREPARE_BUILTINS}") ++ set( prepare_builtins_exe ${PREPARE_BUILTINS} ) ++ else() ++ add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp ) ++ set( prepare_builtins_exe prepare_builtins ) ++ set( prepare_builtins_target prepare_builtins ) ++ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) ++ # These were not properly reported in early LLVM and we don't need them ++ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) ++ endif() + else() + add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp ) + setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target ) ++ target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) ++ # These were not properly reported in early LLVM and we don't need them ++ target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) + endif() +-target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) +-# These were not properly reported in early LLVM and we don't need them +-target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) + + # Setup arch devices + set( r600--_devices cedar cypress barts cayman ) +-- +2.43.0 + diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index ed6e2d7da7f..884398dcaa3 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -130,7 +130,7 @@ HF[vardepvalue] = "${HF}" # Ensure that LLVM_PROJECTS does not contain compiler runtime components e.g. libcxx etc # they are enabled via LLVM_ENABLE_RUNTIMES -LLVM_PROJECTS ?= "clang;clang-tools-extra;libclc;lld" +LLVM_PROJECTS ?= "clang;clang-tools-extra;lld" # linux hosts (.so) on Windows .pyd SOLIBSDEV:mingw32 = ".pyd" @@ -191,7 +191,7 @@ EXTRA_OECMAKE:append:class-target = "\ DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native spirv-tools-native llvm-tblgen-native" DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} virtual/nativesdk-cross-binutils nativesdk-python3" -DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)} spirv-llvm-translator-native" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)}" RRECOMMENDS:${PN} = "binutils" RRECOMMENDS:${PN}:append:class-target = "${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', ' libcxx-dev', '', d)}" @@ -258,7 +258,6 @@ do_install:append:class-native () { install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer fi install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen - install -Dm 0755 ${B}${BINPATHPREFIX}/bin/prepare_builtins ${D}${bindir}/prepare_builtins for f in `find ${D}${bindir} -executable -type f -not -type l`; do test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f @@ -294,11 +293,11 @@ do_install:append:class-nativesdk () { fi } -PROVIDES:append:class-native = " llvm-native libclc-native" -PROVIDES:append:class-target = " llvm libclc" -PROVIDES:append:class-nativesdk = " nativesdk-llvm nativesdk-libclc" +PROVIDES:append:class-native = " llvm-native" +PROVIDES:append:class-target = " llvm" +PROVIDES:append:class-nativesdk = " nativesdk-llvm" -PACKAGES =+ "${PN}-libllvm ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ +PACKAGES =+ "${PN}-libllvm ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ libclang llvm-linker-tools" BBCLASSEXTEND = "native nativesdk" @@ -315,8 +314,6 @@ RDEPENDS:${PN}-tools += "\ perl-module-term-ansicolor \ " -RPROVIDES:${PN}-clc = "${MLPREFIX}libclc" - RRECOMMENDS:${PN}-tidy += "${PN}-tools" FILES:llvm-linker-tools = "${libdir}/LLVMgold* ${libdir}/libLTO.so.* ${libdir}/LLVMPolly*" @@ -383,8 +380,6 @@ FILES:${PN} += "\ ${nonarch_libdir}/${BPN}/*/include/ \ " -FILES:${PN}-clc += "${datadir}/clc" - FILES:${PN}-libllvm =+ "\ ${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \ ${libdir}/libLLVM-${MAJOR_VER}.so \ diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc index d66f9059b2e..d6280c2fbe3 100644 --- a/meta/recipes-devtools/clang/common.inc +++ b/meta/recipes-devtools/clang/common.inc @@ -59,6 +59,7 @@ SRC_URI = "\ file://0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch \ file://0037-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch \ file://0038-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch \ + file://0001-libclc-allow-existing-prepare-builtins-in-standalone.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" diff --git a/meta/recipes-devtools/clang/libclc_git.bb b/meta/recipes-devtools/clang/libclc_git.bb new file mode 100644 index 00000000000..ed31de503ae --- /dev/null +++ b/meta/recipes-devtools/clang/libclc_git.bb @@ -0,0 +1,43 @@ +SUMMARY = "Implementation of the library requirements of the OpenCL C programming language." +HOMEPAGE = "https://libclc.llvm.org" +SECTION = "devel" + +require common-clang.inc +require common-source.inc + +LIC_FILES_CHKSUM = "file://libclc/LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db" + +inherit cmake pkgconfig + +# Depend explicitly on clang-native instead of using TOOLCHAIN as the build +# objects from this recipe are build explicitly using clang for GPU targets. +# We could INHIBIT_DEFAULT_DEPS to avoid any other toolchain but then we need +# to wrestle CMake to configure without a toolchain. +DEPENDS += "clang-native spirv-llvm-translator-native" + +OECMAKE_SOURCEPATH = "${S}/libclc" +B_NATIVE = "${B}-native" + +# Semicolon-separated list of targets to build +LIBCLC_TARGETS ?= "all" + +EXTRA_OECMAKE = "-DLIBCLC_TARGETS_TO_BUILD=${LIBCLC_TARGETS} \ + -DPREPARE_BUILTINS=${B_NATIVE}/prepare_builtins" + +# Need to build a native prepare_builtins binary in target builds. The easiest +# way to do this is with a second native cmake build tree. +do_build_prepare_builtins() { + cmake --fresh -G Ninja \ + -S ${OECMAKE_SOURCEPATH} -B ${B_NATIVE} \ + -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${WORKDIR}/toolchain-native.cmake \ + -DLIBCLC_TARGETS_TO_BUILD= + cmake --build ${B_NATIVE} --target prepare_builtins +} +do_build_prepare_builtins:class-native() { + : +} +do_configure[prefuncs] += "do_build_prepare_builtins" + +FILES:${PN} += "${datadir}/clc" + +BBCLASSEXTEND = "native nativesdk" From patchwork Mon Jul 21 13:24:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 67202 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 9DFA4C87FC5 for ; Mon, 21 Jul 2025 13:24:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.40628.1753104274218339655 for ; Mon, 21 Jul 2025 06:24:34 -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 04968153B for ; Mon, 21 Jul 2025 06:24:28 -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 743D93F6A8 for ; Mon, 21 Jul 2025 06:24:33 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH v3 3/5] clang: improve LLVM target selection logic Date: Mon, 21 Jul 2025 14:24:24 +0100 Message-ID: <20250721132426.3321928-3-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250721132426.3321928-1-ross.burton@arm.com> References: <20250721132426.3321928-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 ; Mon, 21 Jul 2025 13:24:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220689 The GPU targets are incredibly slow to build, so if the DISTRO_FEATURES doesn't include opengl or vulkan assume that the user will not be using a GPU and disable them. Alternatively, a distribution could state that they'll only be using one of the backends, and set LLVM_TARGETS_GPU explicitly. On my build machine, disabling the GPU targets reduces the build time of clang-native from 21m to 16m. Signed-off-by: Ross Burton --- meta/recipes-devtools/clang/clang_git.bb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index 884398dcaa3..5a3893c0474 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -111,16 +111,18 @@ CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_UNWINDLIB;\ CLANG_DEFAULT_OPENMP_RUNTIME;LLVM_ENABLE_PER_TARGET_RUNTIME_DIR;\ LLVM_BUILD_TOOLS;LLVM_USE_HOST_TOOLS;LLVM_CONFIG_PATH;LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR;\ " -# -# Default to build all OE-Core supported target arches (user overridable). -# Gennerally setting LLVM_TARGETS_TO_BUILD = "" in local.conf is ok in most simple situations -# where only one target architecture is needed along with just one build arch (usually X86) -# Core tier targets: -# AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;LoongArch;Mips;MSP430;NVPTX;PowerPC;RISCV;Sparc;SPIRV;SystemZ;VE;WebAssembly;X86;XCore -# Known experimental targets: ARC;CSKY;DirectX;M68k;Xtensa -LLVM_TARGETS_TO_BUILD ?= "AMDGPU;AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch;NVPTX;SPIRV" -LLVM_TARGETS_TO_BUILD:class-target ?= "${@get_clang_host_arch(bb, d)};AMDGPU;BPF;NVPTX;SPIRV" +# By default we build all the supported CPU architectures, and the GPU targets +# if the opengl or vulkan DISTRO_FEATURES are enabled. +# +# For target builds we default to building that specific architecture, BPF, and the GPU targets if required. +# +# The available target list can be seen in the source code +# in the LLVM_ALL_TARGETS assignment: +# https://github.com/llvm/llvm-project/blob/main/llvm/CMakeLists.txt +LLVM_TARGETS_GPU ?= "${@bb.utils.contains_any('DISTRO_FEATURES', 'opengl vulkan', 'AMDGPU;NVPTX;SPIRV', '', d)}" +LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86;LoongArch;${LLVM_TARGETS_GPU}" +LLVM_TARGETS_TO_BUILD:class-target ?= "${@get_clang_host_arch(bb, d)};BPF;${LLVM_TARGETS_GPU}" LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" From patchwork Mon Jul 21 13:24:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 67201 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 8E93CC83F1A for ; Mon, 21 Jul 2025 13:24:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.40562.1753104274864999893 for ; Mon, 21 Jul 2025 06:24:34 -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 ABD77153B for ; Mon, 21 Jul 2025 06:24:28 -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 1BDE43F6A8 for ; Mon, 21 Jul 2025 06:24:33 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH v3 4/5] clang: remove PYTHON_EXECUTABLE assignments Date: Mon, 21 Jul 2025 14:24:25 +0100 Message-ID: <20250721132426.3321928-4-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250721132426.3321928-1-ross.burton@arm.com> References: <20250721132426.3321928-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 ; Mon, 21 Jul 2025 13:24:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220690 The cmake.bbclass already does this. Signed-off-by: Ross Burton --- meta/recipes-devtools/clang/clang_git.bb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index 5a3893c0474..d551be72e63 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -161,9 +161,6 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ " -EXTRA_OECMAKE:append:class-native = "\ - -DPYTHON_EXECUTABLE='${PYTHON}' \ -" EXTRA_OECMAKE:append:class-nativesdk = "\ -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ @@ -174,7 +171,6 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ - -DPYTHON_EXECUTABLE='${PYTHON}' \ " EXTRA_OECMAKE:append:class-target = "\ -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \ From patchwork Mon Jul 21 13:24:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 67199 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 8FBFFC83F26 for ; Mon, 21 Jul 2025 13:24:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.40564.1753104275544556083 for ; Mon, 21 Jul 2025 06:24:35 -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 43968153B for ; Mon, 21 Jul 2025 06:24:29 -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 B7E9C3F6A8 for ; Mon, 21 Jul 2025 06:24:34 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH v3 5/5] clang: ensure the native-built tblgen binaries are used Date: Mon, 21 Jul 2025 14:24:26 +0100 Message-ID: <20250721132426.3321928-5-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250721132426.3321928-1-ross.burton@arm.com> References: <20250721132426.3321928-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 ; Mon, 21 Jul 2025 13:24:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/220691 Set LLVM_HEADERS_TBLGEN so that we don't build another copy of tblgen. Also remove LLVM_OPTIMIZED_TABLEGEN, this is redundant as we're not building a tablegen binary in this recipe anymore. Signed-off-by: Ross Burton --- meta/recipes-devtools/clang/clang_git.bb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index d551be72e63..e15f4a632e1 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -149,7 +149,6 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_FFI=ON \ -DLLVM_ENABLE_ZSTD=ON \ -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ - -DLLVM_OPTIMIZED_TABLEGEN=ON \ -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_BUILD_TYPE=Release \ @@ -159,6 +158,8 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ + -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \ + -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \ " EXTRA_OECMAKE:append:class-nativesdk = "\ @@ -167,14 +168,10 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \ - -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \ - -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ " EXTRA_OECMAKE:append:class-target = "\ - -DLLVM_NATIVE_TOOL_DIR=${STAGING_BINDIR_NATIVE} \ - -DLLVM_HEADERS_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-min-tblgen \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \