]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
rust: Enable dynamic linking with llvm master
authorSunil Dora <sunilkumar.dora@windriver.com>
Thu, 19 Feb 2026 12:59:18 +0000 (04:59 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Feb 2026 16:39:25 +0000 (16:39 +0000)
commit74ba238ff1ba1e9b612aece1989b828f3a8f8770
tree8ee8ba2d5b1fedc71a171175a7541820d1ca0f59
parent4f79b45b7ae78eaa945cd2e82fab05a5e939b770
rust: Enable dynamic linking with llvm

Fixes [Yocto #16058]

A segmentation fault occurs in rustc (e.g. in
llvm::X86ReadAdvanceTable) when reusing sstate artifacts built with
different host toolchain versions.

Issue sequence:
1. llvm-native is built with a newer toolchain
   (e.g. GCC 15/Binutils 2.45).
2. rust-native is later built with an older linker.
   (e.g. GCC 12/Binutils 2.40).
3. The older linker statically links parts of llvm-native into
   librustc_driver.
4. The resulting binary crashes at runtime inside the statically
   linked LLVM code.

The corruption happens at link time when mixing static native objects
produced by different toolchain generations.

Enable dynamic LLVM linking (link-shared = true) for rust-native so rustc
links against libLLVM.so instead of static archives, avoiding host linker
incompatibilities when reusing sstate artifacts.

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Suggested-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rust/rust_1.93.0.bb