* [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so
@ 2026-03-24 23:27 mark.yang
2026-03-24 23:57 ` mark.yang
2026-04-29 0:16 ` mark.yang
0 siblings, 2 replies; 3+ messages in thread
From: mark.yang @ 2026-03-24 23:27 UTC (permalink / raw)
To: openembedded-core; +Cc: mark.yang
From: "mark.yang" <mark.yang@lge.com>
Add a 'binutils-plugin' PACKAGECONFIG option to selectively build
LLVMgold.so by passing -DLLVM_BINUTILS_INCDIR and adding binutils
to DEPENDS only when enabled.
LLVMgold.so is the LLVM LTO plugin for GNU ld BFD.
When using lld as the linker, this plugin is not needed since lld has
built-in LTO support. However, for toolchains that rely on BFD
this plugin is required to enable LTO.
binutils-plugin is named after Gentoo's USE flag convention for similar
functionality.
Signed-off-by: mark.yang <mark.yang@lge.com>
---
meta/recipes-devtools/clang/llvm_git.bb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/recipes-devtools/clang/llvm_git.bb b/meta/recipes-devtools/clang/llvm_git.bb
index 96ea383731..e12ac11853 100644
--- a/meta/recipes-devtools/clang/llvm_git.bb
+++ b/meta/recipes-devtools/clang/llvm_git.bb
@@ -79,6 +79,7 @@ PACKAGECONFIG[opt-viewer] = "-DLLVM_TOOL_OPT_VIEWER_BUILD=ON,-DLLVM_TOOL_OPT_VIE
python3-pyyaml python3-pygments,"
PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils,"
PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils,"
+PACKAGECONFIG[binutils-plugin] = "-DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils,"
# LLVM debug symbols are very large (several gigabytes), reduce the debug level
# so they're just hundreds of megabytes.
@@ -126,6 +127,10 @@ llvm_sysroot_preprocess() {
install -m 0755 ${S}/llvm/tools/llvm-config/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
}
+PACKAGES =+ "llvm-linker-tools"
+
+FILES:llvm-linker-tools = "${libdir}/LLVMgold* ${libdir}/libLTO.so.*"
+
FILES:${PN}-dev += "${libdir}/llvm-config"
BBCLASSEXTEND = "native nativesdk"
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so
2026-03-24 23:27 [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so mark.yang
@ 2026-03-24 23:57 ` mark.yang
2026-04-29 0:16 ` mark.yang
1 sibling, 0 replies; 3+ messages in thread
From: mark.yang @ 2026-03-24 23:57 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
This patch is an update to following patches.
https://lists.openembedded.org/g/openembedded-core/topic/117252728 [PATCH] llvm: enable LLVMgold.so build by adding binutils dependency
https://lists.openembedded.org/g/openembedded-core/topic/patch_v2_llvm_enable/117274480 [PATCH v2] llvm: enable LLVMgold.so build by adding binutils dependency
When build component using clang that utilize lto, and when the LLD linker connot be used (Use bfd), the LLVMgold.so plugin is required in the native sysroot.
LLVMgold.so plugin is generated when binutils-plugin is enabled.
libLTO.so.21.1 is generated on the target even if it is not enabled.
The reason they were bundled in to the same package is to distribute them via the nativesdk package.
As Deepesh suggested, I mae it possible to enable this via the binutils-plugin rather than having it always built into LLVM.
The name "binutils-plugin" was inspired by gentoo's name convention. https://packages.gentoo.org/useflags/binutils-plugin
[-- Attachment #2: Type: text/html, Size: 1236 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so
2026-03-24 23:27 [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so mark.yang
2026-03-24 23:57 ` mark.yang
@ 2026-04-29 0:16 ` mark.yang
1 sibling, 0 replies; 3+ messages in thread
From: mark.yang @ 2026-04-29 0:16 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
Hello!
Gentle ping.
This has been in mathieu/master-next for a while but hasn't made it
to master yet. Anything blocking it on my side?
[-- Attachment #2: Type: text/html, Size: 217 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-29 0:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 23:27 [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so mark.yang
2026-03-24 23:57 ` mark.yang
2026-04-29 0:16 ` mark.yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox