public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: mark.yang@lge.com
To: openembedded-core@lists.openembedded.org
Cc: "mark.yang" <mark.yang@lge.com>
Subject: [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so
Date: Wed, 25 Mar 2026 08:27:34 +0900	[thread overview]
Message-ID: <20260324232734.2081279-1-mark.yang@lge.com> (raw)

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"


             reply	other threads:[~2026-03-24 23:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 23:27 mark.yang [this message]
2026-03-24 23:57 ` [PATCH] llvm: add binutils-plugin PACKAGECONFIG for LLVMgold.so mark.yang
2026-04-29  0:16 ` mark.yang

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=20260324232734.2081279-1-mark.yang@lge.com \
    --to=mark.yang@lge.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