Openembedded Core Discussions
 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 v2 1/3] kernel-arch: fall back to GNU ld unless ld-is-lld is in DISTRO_FEATURES
Date: Tue, 14 Jul 2026 22:26:40 +0900	[thread overview]
Message-ID: <20260714132642.2225115-2-mark.yang@lge.com> (raw)
In-Reply-To: <20260714132642.2225115-1-mark.yang@lge.com>

From: "mark.yang" <mark.yang@lge.com>

Nothing stages a bare ld.lld unless ld-is-lld is in DISTRO_FEATURES,
so a clang kernel fails its first linker check on any other setup.
Use GNU ld.bfd from binutils-cross instead.

Signed-off-by: mark.yang <mark.yang@lge.com>
---
v2: new patch; the merged clang support uses a bare ld.lld which
    nothing stages without ld-is-lld

 meta/classes-recipe/kernel-arch.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass
index 6ebc0f13ea..321c9ed577 100644
--- a/meta/classes-recipe/kernel-arch.bbclass
+++ b/meta/classes-recipe/kernel-arch.bbclass
@@ -88,7 +88,7 @@ KERNEL_CC:toolchain-clang = "${CCACHE}clang ${HOST_CC_KERNEL_ARCH} \
  -ffile-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} \
  -ffile-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH} \
 "
-KERNEL_LD:toolchain-clang = "ld.lld ${HOST_LD_KERNEL_ARCH}"
+KERNEL_LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'ld.lld', '${HOST_PREFIX}ld.bfd', d)} ${HOST_LD_KERNEL_ARCH}"
 KERNEL_AR:toolchain-clang = "llvm-ar ${HOST_AR_KERNEL_ARCH}"
 KERNEL_OBJCOPY:toolchain-clang = "llvm-objcopy ${HOST_OBJCOPY_KERNEL_ARCH}"
 KERNEL_STRIP:toolchain-clang = "llvm-strip"


  reply	other threads:[~2026-07-14 13:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 13:26 [PATCH v2 0/3] kernel: make the kernel toolchain switchable to clang mark.yang
2026-07-14 13:26 ` mark.yang [this message]
2026-07-14 13:26 ` [PATCH v2 2/3] module.bbclass/make-mod-scripts: inhibit default dependencies mark.yang
2026-07-15 11:34   ` [OE-core] " Mathieu Dubois-Briand
2026-07-15 13:48     ` Mathieu Dubois-Briand
2026-07-16  6:40       ` mark.yang
2026-07-14 13:26 ` [PATCH v2 3/3] kernel-arch: add KERNEL_TOOLCHAIN to switch the whole kernel toolchain 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=20260714132642.2225115-2-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