public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] rust: Enable dynamic linking with llvm
@ 2026-02-12 16:50 sunilkumar.dora
  2026-02-12 17:05 ` [OE-core] " Ross Burton
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: sunilkumar.dora @ 2026-02-12 16:50 UTC (permalink / raw)
  To: openembedded-core; +Cc: Randy.MacLeod, Sundeep.Kokkonda, alex

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



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-02-18 17:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 16:50 [PATCH] rust: Enable dynamic linking with llvm sunilkumar.dora
2026-02-12 17:05 ` [OE-core] " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox