* [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific
@ 2025-07-29 12:24 Ross Burton
2025-07-29 12:24 ` [PATCH v2 2/3] clang-cross: trim the recipe Ross Burton
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ross Burton @ 2025-07-29 12:24 UTC (permalink / raw)
To: openembedded-core
This file can be used for nativesdk builds, which if they are using the
clang toolchain will also need compiler-rt and libcxx.
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta/classes/toolchain/clang.bbclass | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/meta/classes/toolchain/clang.bbclass b/meta/classes/toolchain/clang.bbclass
index b6ba1fde6fc..f422a01988f 100644
--- a/meta/classes/toolchain/clang.bbclass
+++ b/meta/classes/toolchain/clang.bbclass
@@ -26,8 +26,7 @@ PREFERRED_PROVIDER_virtual/nativesdk-cross-c++:class-crosssdk = "clang-crosssdk-
PREFERRED_PROVIDER_virtual/nativesdk-cross-cc:class-cross-canadian = "clang-crosssdk-${SDK_SYS}"
PREFERRED_PROVIDER_virtual/nativesdk-cross-c++:class-cross-canadian = "clang-crosssdk-${SDK_SYS}"
-
-BASE_DEFAULT_DEPS:append:class-target = " compiler-rt libcxx"
+BASE_DEFAULT_DEPS:append = " compiler-rt libcxx"
TUNE_CCARGS += "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}"
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 2/3] clang-cross: trim the recipe 2025-07-29 12:24 [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific Ross Burton @ 2025-07-29 12:24 ` Ross Burton 2025-07-29 12:32 ` Patchtest results for " patchtest 2025-07-29 12:24 ` [PATCH v2 3/3] clang: split lld into a separate lld recipe Ross Burton 2025-07-30 7:05 ` [OE-core] [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific Mathieu Dubois-Briand 2 siblings, 1 reply; 6+ messages in thread From: Ross Burton @ 2025-07-29 12:24 UTC (permalink / raw) To: openembedded-core As a single clang-native build is a cross-compiler for all targets, this recipe should simply create target-prefixed symlinks. As such, it doesn't need to pull in the common clang include files, or set TOOLCHAIN. Unsetting PACKAGES isn't needed as cross inherits nopackages. The sysroot preprocessing is used to stage bindir, but cross recipes already stage this directory. There doesn't appear to be a need to copy clang, so these are now linked too. Signed-off-by: Ross Burton <ross.burton@arm.com> --- .../recipes-devtools/clang/clang-cross_git.bb | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/meta/recipes-devtools/clang/clang-cross_git.bb b/meta/recipes-devtools/clang/clang-cross_git.bb index 99e48522a0b..7b12e450091 100644 --- a/meta/recipes-devtools/clang/clang-cross_git.bb +++ b/meta/recipes-devtools/clang/clang-cross_git.bb @@ -3,39 +3,22 @@ SUMMARY = "Cross compiler wrappers for LLVM based C/C++ compiler" HOMEPAGE = "http://clang.llvm.org/" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SECTION = "devel" PN = "clang-cross-${TARGET_ARCH}" -BPN = "clang" -require common-clang.inc -require common-source.inc inherit cross -TOOLCHAIN = "clang" + DEPENDS += "clang-native virtual/cross-binutils" -#INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_SYSROOT_STRIP = "1" do_install() { install -d ${D}${bindir} - for tool in clang-tidy lld ld.lld llvm-profdata \ + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov do ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool done - install -m 0755 ${STAGING_BINDIR_NATIVE}/clang ${D}${bindir}/${TARGET_PREFIX}clang - install -m 0755 ${STAGING_BINDIR_NATIVE}/clang ${D}${bindir}/${TARGET_PREFIX}clang++ } -SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \ - *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \ - *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ - *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" - -SYSROOT_PREPROCESS_FUNCS += "clangcross_sysroot_preprocess" - -clangcross_sysroot_preprocess () { - sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} -} -PACKAGES = "" -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Patchtest results for [PATCH v2 2/3] clang-cross: trim the recipe 2025-07-29 12:24 ` [PATCH v2 2/3] clang-cross: trim the recipe Ross Burton @ 2025-07-29 12:32 ` patchtest 0 siblings, 0 replies; 6+ messages in thread From: patchtest @ 2025-07-29 12:32 UTC (permalink / raw) To: Ross Burton; +Cc: openembedded-core [-- Attachment #1: Type: text/plain, Size: 3014 bytes --] Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information: --- Testing patch /home/patchtest/share/mboxes/v2-2-3-clang-cross-trim-the-recipe.patch FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned) PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files) PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore) PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence) PASS: test author valid (test_mbox.TestMbox.test_author_valid) PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence) PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags) PASS: test max line length (test_metadata.TestMetadata.test_max_line_length) PASS: test mbox format (test_mbox.TestMbox.test_mbox_format) PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade) PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format) PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length) PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files) PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list) SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint) SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format) SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence) SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format) SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format) SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence) SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence) SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint) SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head) SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence) --- Please address the issues identified and submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you! ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] clang: split lld into a separate lld recipe 2025-07-29 12:24 [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific Ross Burton 2025-07-29 12:24 ` [PATCH v2 2/3] clang-cross: trim the recipe Ross Burton @ 2025-07-29 12:24 ` Ross Burton 2025-07-29 12:32 ` Patchtest results for " patchtest 2025-07-30 7:05 ` [OE-core] [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific Mathieu Dubois-Briand 2 siblings, 1 reply; 6+ messages in thread From: Ross Burton @ 2025-07-29 12:24 UTC (permalink / raw) To: openembedded-core The lld linker is a standalone project under the LLVM umbrella that just depends on libLLVM and nothing else, such as clang. To reduce the build time of clang if lld is not being used, split it out into a separate recipe. To ensure that lld is present if needed, the clang-cross recipe will depend on lld-native if ld-is-lld is enable. Signed-off-by: Ross Burton <ross.burton@arm.com> --- meta/conf/distro/include/maintainers.inc | 1 + .../recipes-devtools/clang/clang-cross_git.bb | 2 +- meta/recipes-devtools/clang/clang_git.bb | 8 +++----- meta/recipes-devtools/clang/lld_git.bb | 20 +++++++++++++++++++ 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 meta/recipes-devtools/clang/lld_git.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 927aac16d6d..5260bde36bc 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -480,6 +480,7 @@ RECIPE_MAINTAINER:pn-linux-yocto = "Bruce Ashfield <bruce.ashfield@gmail.com>" RECIPE_MAINTAINER:pn-linux-yocto-dev = "Bruce Ashfield <bruce.ashfield@gmail.com>" RECIPE_MAINTAINER:pn-linux-yocto-rt = "Bruce Ashfield <bruce.ashfield@gmail.com>" RECIPE_MAINTAINER:pn-linux-yocto-tiny = "Bruce Ashfield <bruce.ashfield@gmail.com>" +RECIPE_MAINTAINER:pn-lld = "Khem Raj <raj.khem@gmail.com>" RECIPE_MAINTAINER:pn-lldb = "Khem Raj <raj.khem@gmail.com>" RECIPE_MAINTAINER:pn-llvm-project-source-20.1.8 = "Khem Raj <raj.khem@gmail.com>" RECIPE_MAINTAINER:pn-llvm-tblgen-native = "Khem Raj <raj.khem@gmail.com>" diff --git a/meta/recipes-devtools/clang/clang-cross_git.bb b/meta/recipes-devtools/clang/clang-cross_git.bb index 7b12e450091..e240a1bb6de 100644 --- a/meta/recipes-devtools/clang/clang-cross_git.bb +++ b/meta/recipes-devtools/clang/clang-cross_git.bb @@ -11,7 +11,7 @@ PN = "clang-cross-${TARGET_ARCH}" inherit cross -DEPENDS += "clang-native virtual/cross-binutils" +DEPENDS += "clang-native virtual/cross-binutils ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'lld-native', '', d)}" do_install() { install -d ${D}${bindir} diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index 35b40d0ed18..ad070b5a3e0 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -60,7 +60,7 @@ PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," PACKAGECONFIG[libedit] = "-DLLVM_ENABLE_LIBEDIT=ON,-DLLVM_ENABLE_LIBEDIT=OFF,libedit libedit-native" PACKAGECONFIG[libomp] = "-DCLANG_DEFAULT_OPENMP_RUNTIME=libomp,," -PACKAGECONFIG[lld] = "-DCLANG_DEFAULT_LINKER=lld,," +PACKAGECONFIG[lld] = "-DCLANG_DEFAULT_LINKER=lld,,,lld" PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," PACKAGECONFIG[pfm] = "-DLLVM_ENABLE_LIBPFM=ON,-DLLVM_ENABLE_LIBPFM=OFF,libpfm," PACKAGECONFIG[rtti] = "-DLLVM_ENABLE_RTTI=ON,-DLLVM_ENABLE_RTTI=OFF,," @@ -110,7 +110,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;lld" +LLVM_PROJECTS ?= "clang;clang-tools-extra" # linux hosts (.so) on Windows .pyd SOLIBSDEV:mingw32 = ".pyd" @@ -396,10 +396,8 @@ clang_sysroot_preprocess() { install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ install -m 0755 ${S}/llvm/tools/llvm-config/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} - # LLDTargets.cmake references the lld executable(!) that some modules/plugins link to - install -d ${SYSROOT_DESTDIR}${bindir} - binaries="lld diagtool clang-${MAJOR_VER} clang-format clang-offload-packager + binaries="diagtool clang-${MAJOR_VER} clang-format clang-offload-packager clang-offload-bundler clang-scan-deps clang-repl clang-refactor clang-check clang-extdef-mapping clang-apply-replacements clang-reorder-fields clang-tidy clang-change-namespace clang-doc clang-include-fixer diff --git a/meta/recipes-devtools/clang/lld_git.bb b/meta/recipes-devtools/clang/lld_git.bb new file mode 100644 index 00000000000..6c8ba03c052 --- /dev/null +++ b/meta/recipes-devtools/clang/lld_git.bb @@ -0,0 +1,20 @@ +SUMMARY = "LLD - the LLVM Linker" +DESCRIPTION = "LLD is a linker from the LLVM project that is a drop-in replacement for system linkers and runs much faster than them." +HOMEPAGE = "https://lld.llvm.org" +SECTION = "devel" + +require common-clang.inc +require common-source.inc + +LIC_FILES_CHKSUM = "file://lld/LICENSE.TXT;md5=ae7dc7c027b1fa89b5b013d391d3ee2b" + +inherit cmake pkgconfig + +DEPENDS = "llvm-tblgen-native llvm" + +OECMAKE_SOURCEPATH = "${S}/lld" + +EXTRA_OECMAKE = "-DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen" + +BBCLASSEXTEND = "native nativesdk" -- 2.43.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Patchtest results for [PATCH v2 3/3] clang: split lld into a separate lld recipe 2025-07-29 12:24 ` [PATCH v2 3/3] clang: split lld into a separate lld recipe Ross Burton @ 2025-07-29 12:32 ` patchtest 0 siblings, 0 replies; 6+ messages in thread From: patchtest @ 2025-07-29 12:32 UTC (permalink / raw) To: Ross Burton; +Cc: openembedded-core [-- Attachment #1: Type: text/plain, Size: 3029 bytes --] Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information: --- Testing patch /home/patchtest/share/mboxes/v2-3-3-clang-split-lld-into-a-separate-lld-recipe.patch FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned) PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files) PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore) PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence) PASS: test author valid (test_mbox.TestMbox.test_author_valid) PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence) PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags) PASS: test max line length (test_metadata.TestMetadata.test_max_line_length) PASS: test mbox format (test_mbox.TestMbox.test_mbox_format) PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade) PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format) PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length) PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files) PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list) SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint) SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format) SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence) SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format) SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format) SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence) SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence) SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint) SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head) SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence) --- Please address the issues identified and submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you! ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific 2025-07-29 12:24 [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific Ross Burton 2025-07-29 12:24 ` [PATCH v2 2/3] clang-cross: trim the recipe Ross Burton 2025-07-29 12:24 ` [PATCH v2 3/3] clang: split lld into a separate lld recipe Ross Burton @ 2025-07-30 7:05 ` Mathieu Dubois-Briand 2 siblings, 0 replies; 6+ messages in thread From: Mathieu Dubois-Briand @ 2025-07-30 7:05 UTC (permalink / raw) To: ross.burton, openembedded-core On Tue Jul 29, 2025 at 2:24 PM CEST, Ross Burton via lists.openembedded.org wrote: > This file can be used for nativesdk builds, which if they are using the > clang toolchain will also need compiler-rt and libcxx. > > Signed-off-by: Ross Burton <ross.burton@arm.com> > --- Hi Ross, Looks better now, but we do have a reproducibility issue: AssertionError: The following deb packages are different and not in exclusion list: /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/libllvmspirvlib-dbg_20.1.4-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/libllvmspirvlib20.1_20.1.4-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/lld-dbg_20.1.8-r0_amd64.deb /srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./core2-64/lld_20.1.8-r0_amd64.deb https://autobuilder.yoctoproject.org/valkyrie/#/builders/37/builds/2184 https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20250729-g9mmstqt/packages/diff-html/ -- Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-07-30 7:05 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-07-29 12:24 [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific Ross Burton 2025-07-29 12:24 ` [PATCH v2 2/3] clang-cross: trim the recipe Ross Burton 2025-07-29 12:32 ` Patchtest results for " patchtest 2025-07-29 12:24 ` [PATCH v2 3/3] clang: split lld into a separate lld recipe Ross Burton 2025-07-29 12:32 ` Patchtest results for " patchtest 2025-07-30 7:05 ` [OE-core] [PATCH v2 1/3] classes/toolchain/clang: compiler-rt and libcxx are not target-specific Mathieu Dubois-Briand
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox