From: sunilkumar.dora@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Randy.MacLeod@windriver.com, Sundeep.Kokkonda@windriver.com,
alex@linutronix.de
Subject: [PATCH] rust: Enable dynamic linking with llvm
Date: Thu, 12 Feb 2026 08:50:35 -0800 [thread overview]
Message-ID: <20260212165035.1806068-1-sunilkumar.dora@windriver.com> (raw)
From: Sunil Dora <sunilkumar.dora@windriver.com>
YOCTO #16058
When llvm-native is built with a newer toolchain (e.g. GCC 15) and
reused on a system with an older linker, rustc emit segfault at runtime.
This issue occurs because rustc, which is statically linked with LLVM libraries,
was built on one machine using a newer toolchain and then executed on another machine
that has an older linker. To prevent crash, LLVM now linked with rustc dynamically.
Added llvm as dependency to provide libllvm.so at runtime.
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
---
meta/lib/oeqa/selftest/cases/rust.py | 2 +-
meta/recipes-devtools/rust/rust_1.93.0.bb | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index 3ae1946e43..7614941661 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -47,7 +47,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
bitbake("{} -c test_compile".format(recipe))
builddir = get_bb_var("RUSTSRC", "rust")
# build core-image-minimal with required packages
- default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd", "openssl"]
+ default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd", "llvm", "openssl"]
features = []
features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
diff --git a/meta/recipes-devtools/rust/rust_1.93.0.bb b/meta/recipes-devtools/rust/rust_1.93.0.bb
index a25f65f674..cfee48ec78 100644
--- a/meta/recipes-devtools/rust/rust_1.93.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.93.0.bb
@@ -124,6 +124,7 @@ python do_configure() {
# [llvm]
config.add_section("llvm")
+ config.set("llvm", "link-shared", e(True))
config.set("llvm", "static-libstdcpp", e(False))
config.set("llvm", "download-ci-llvm", e(False))
if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
--
2.49.0
next reply other threads:[~2026-02-12 16:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 16:50 sunilkumar.dora [this message]
2026-02-12 17:05 ` [OE-core] [PATCH] rust: Enable dynamic linking with llvm Ross Burton
2026-02-13 19:51 ` Dora, Sunil Kumar
2026-02-17 14:24 ` [OE-core] " Randy MacLeod
2026-02-18 17:26 ` Dora, Sunil Kumar
2026-02-12 17:52 ` [OE-core] " Alexander Kanavin
2026-02-13 19:53 ` Dora, Sunil Kumar
2026-02-15 16:35 ` [OE-core] " Mathieu Dubois-Briand
2026-02-16 12:47 ` Dora, Sunil Kumar
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=20260212165035.1806068-1-sunilkumar.dora@windriver.com \
--to=sunilkumar.dora@windriver.com \
--cc=Randy.MacLeod@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=alex@linutronix.de \
--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