public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Dora, Sunil Kumar" <SunilKumar.Dora@windriver.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] rust: Enable dynamic linking with llvm
Date: Fri, 13 Feb 2026 11:51:38 -0800	[thread overview]
Message-ID: <675892.1771012298240808740@lists.openembedded.org> (raw)
In-Reply-To: <D0F37E52-3E1F-4477-932A-02BEDB07AE2A@arm.com>

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

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.

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

  reply	other threads:[~2026-02-13 19:51 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 [this message]
2026-02-17 14:24     ` 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=675892.1771012298240808740@lists.openembedded.org \
    --to=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