public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Yoann Congal" <yoann.congal@smile.fr>
To: "Yoann Congal" <yoann.congal@smile.fr>,
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core][scarthgap 16/16] rust: Enable dynamic linking with llvm
Date: Mon, 30 Mar 2026 00:43:40 +0200	[thread overview]
Message-ID: <DHFMOF1U1YKZ.37REF3IE5WWLM@smile.fr> (raw)
In-Reply-To: <cb0608195e2c2893b4915f4d0f62679afbc1f2b5.1774823430.git.yoann.congal@smile.fr>

On Mon Mar 30, 2026 at 12:37 AM CEST, Yoann Congal wrote:
> From: Sunil Dora <sunilkumar.dora@windriver.com>
>
> 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>
> (cherry picked from commit 74ba238ff1ba1e9b612aece1989b828f3a8f8770)
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---

I did not wanted to send that patch, please ignore.

>  meta/recipes-devtools/rust/rust_1.75.0.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-devtools/rust/rust_1.75.0.bb b/meta/recipes-devtools/rust/rust_1.75.0.bb
> index b9348bf0507..f037bb33715 100644
> --- a/meta/recipes-devtools/rust/rust_1.75.0.bb
> +++ b/meta/recipes-devtools/rust/rust_1.75.0.bb
> @@ -128,6 +128,8 @@ python do_configure() {
>  
>      # [llvm]
>      config.add_section("llvm")
> +    if d.getVar('PN') == "rust-native":
> +        config.set("llvm", "link-shared", e(True))
>      config.set("llvm", "static-libstdcpp", e(False))
>      if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
>          config.set("llvm", "use-libcxx", e(True))


-- 
Yoann Congal
Smile ECS



  reply	other threads:[~2026-03-29 22:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-29 22:37 [OE-core][scarthgap 00/16] Patch review Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 01/16] tzdata,tzcode-native: Upgrade 2025b -> 2025c Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 02/16] python3-cryptography: Fix CVE-2026-26007 Yoann Congal
2026-03-29 22:46   ` Patchtest results for " patchtest
2026-03-29 22:37 ` [OE-core][scarthgap 03/16] spdx: add option to include only compiled sources Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 04/16] dtc: backport fix for build with glibc-2.43 Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 05/16] pseudo: Add fix for glibc 2.43 Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 06/16] yocto-uninative: Update to 5.0 for needed patchelf updates Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 07/16] yocto-uninative: Update to 5.1 for glibc 2.43 Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 08/16] elfutils: don't add -Werror to avoid discarded-qualifiers Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 09/16] binutils: backport patch to fix build with glibc-2.43 on host Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 10/16] python3-pyopenssl: Fix CVE-2026-27448 Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 11/16] python3-pyopenssl: Fix CVE-2026-27459 Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 12/16] gnutls: Fix CVE-2025-14831 Yoann Congal
2026-03-29 22:42   ` Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 13/16] systemd: backport patch to fix journal-file issue Yoann Congal
2026-03-29 22:42   ` Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 14/16] libxml-parser-perl: fix for CVE-2006-10003 Yoann Congal
2026-03-29 22:43   ` Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 15/16] busybox: fix for CVE-2026-26157, CVE-2026-26158 Yoann Congal
2026-03-29 22:43   ` Yoann Congal
2026-03-29 22:37 ` [OE-core][scarthgap 16/16] rust: Enable dynamic linking with llvm Yoann Congal
2026-03-29 22:43   ` Yoann Congal [this message]
2026-03-29 22:41 ` [OE-core][scarthgap 00/16] Patch review Yoann Congal

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=DHFMOF1U1YKZ.37REF3IE5WWLM@smile.fr \
    --to=yoann.congal@smile.fr \
    --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