On Mon, Jul 21, 2025 at 1:01 PM Manos Pitsidianakis
<manos.pitsidiana...@linaro.org> wrote:
>
> Hi Paolo,
>
> On Mon, Jul 21, 2025 at 1:53 PM Paolo Bonzini <pbonz...@redhat.com> wrote:
> >
> > This is only cosmetic for now, but hopefully later on Meson will parse more
> > of Cargo.toml.  Devices are linked into a staticlib but are not staticlibs
> > themselves.
>
> Does meson compile them as rlibs instead of staticlibs?

Yes, see "rust_abi: 'rust'". I think you can't even do "extern crate"
with a staticlib - the only staticlib is the per-target one that is
put together via scripts/rust/rust_root_crate.sh.

In theory https://github.com/mesonbuild/meson/pull/14818 should allow
removing the staticlib as well, using rustc instead of gcc to create
the final executable even if it has system/main.c listed as one of its
sources. Executables should than be smaller or they can use dynamic
libstd. I haven't tested that yet though...

Paolo


Reply via email to