public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Randy MacLeod <randy.macleod@windriver.com>
To: SunilKumar.Dora@windriver.com, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] rust: Enable dynamic linking with llvm
Date: Tue, 17 Feb 2026 09:24:36 -0500	[thread overview]
Message-ID: <5f3097df-5e24-41f8-9293-db01248e383c@windriver.com> (raw)
In-Reply-To: <675892.1771012298240808740@lists.openembedded.org>

[-- Attachment #1: Type: text/plain, Size: 3168 bytes --]

On 2026-02-13 2:51 p.m., Dora, Sunil Kumar via lists.openembedded.org wrote:
> On Thu, Feb 12, 2026 at 10:36 PM, Ross Burton wrote:
>
>     What’s the impact on the native sysroot and target packages when
>     we link rust against all of libLLVM.so dynamically vs statically
>     linking the pieces that are used?
>
> Hi Ross,
>
> Below are the observed impacts when linking Rust against shared 
> libLLVM.so versus
> statically linking LLVM components.
>
> On Native:
> **********
> All required LLVM-related libraries were already present in 
> recipe-sysroot-native before switching
> Rust to dynamic LLVM. Dynamic linking does not introduce any new 
> native dependencies.
> Existing llvm-native artifacts are reused.
>
> Static:
> -rw-r--r-- 1 xxx users 213M Feb 13 00:29 
> librustc_driver-4b6f2c2478f9ef2c.so
> Dynamic:
> -rw-r--r-- 1 xxx users 132M Feb 13 00:52 
> librustc_driver-4b6f2c2478f9ef2c.so
>
> So on native we see ~81 MB reduction in librustc_driver, with no 
> additional sysroot growth.
>
> On Target:
> **********
> librustc_driver shrinks from 144.8 MB to 84.2 MB (~60 MB reduction).
> However, dynamic linking introduces shared libLLVM.so plus a few 
> runtime dependencies.
>
> Static:
> root@qemux86-64:~# ls -lh /usr/lib/librustc_driver-*.so
> -rw-r--r--    1 root     root      144.8M Apr  5  2011 
> /usr/lib/librustc_driver-151eed90355bbdac.so
>
> Dynamic:
> root@qemux86-64:~# ls -lh /usr/lib/librustc_driver-*.so
> -rw-r--r--    1 root     root       84.2M Apr  5  2011 
> /usr/lib/librustc_driver-151eed90355bbdac.so
>
> New dynamic dependencies:
> root@qemux86-64:~# ldd /usr/lib/librustc_driver-*.so
>         libLLVM.so.21.1 libffi.so.8 libxml2.so.16
>
> Size contribution on target:
>  - libLLVM.so.21.1 ≈ 75.5 MB
>  - libxml2.so.16 ≈ 1.2 MB
>  - libffi.so.8 ≈ 42.5 KB
>
> When LLVM is only used by Rust, this results in a net image increase 
> of approximately 15–16 MB.


Good, that's annoying but acceptable increase: ~7% to work-around this bug.

I'm still a bit uncomfortable with changing the way that target Rust is 
built to deal with
a Rust-native problem. Also there's the question about dynamic linking 
increasing runtime
by a small amount. Finally, I worry that few people/distros change the 
default linking to by dynamic.

So I won't object to this work-around especially if we can easily limit 
it to -native. Have you tried that?
In a few years, we won't have this mix of toolchain versions and can 
drop this change

so if this gets merged please open a tracking bug so that we don't forget.

../Randy



>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#231138):https://lists.openembedded.org/g/openembedded-core/message/231138
> Mute This Topic:https://lists.openembedded.org/mt/117777483/3616765
> Group Owner:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [randy.macleod@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

-- 
# Randy MacLeod
# Wind River Linux

[-- Attachment #2: Type: text/html, Size: 5369 bytes --]

  reply	other threads:[~2026-02-17 14:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Randy MacLeod [this message]
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=5f3097df-5e24-41f8-9293-db01248e383c@windriver.com \
    --to=randy.macleod@windriver.com \
    --cc=SunilKumar.Dora@windriver.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