rust/hw/char/pl011/Cargo.toml | 3 --- rust/hw/timer/hpet/Cargo.toml | 3 --- 2 files changed, 6 deletions(-)
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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/hw/char/pl011/Cargo.toml | 3 ---
rust/hw/timer/hpet/Cargo.toml | 3 ---
2 files changed, 6 deletions(-)
diff --git a/rust/hw/char/pl011/Cargo.toml b/rust/hw/char/pl011/Cargo.toml
index 003ef9613d4..88ef110507d 100644
--- a/rust/hw/char/pl011/Cargo.toml
+++ b/rust/hw/char/pl011/Cargo.toml
@@ -12,9 +12,6 @@ license.workspace = true
repository.workspace = true
rust-version.workspace = true
-[lib]
-crate-type = ["staticlib"]
-
[dependencies]
bilge = { version = "0.2.0" }
bilge-impl = { version = "0.2.0" }
diff --git a/rust/hw/timer/hpet/Cargo.toml b/rust/hw/timer/hpet/Cargo.toml
index 6f075027843..ac5df23c1d0 100644
--- a/rust/hw/timer/hpet/Cargo.toml
+++ b/rust/hw/timer/hpet/Cargo.toml
@@ -10,9 +10,6 @@ license.workspace = true
repository.workspace = true
rust-version.workspace = true
-[lib]
-crate-type = ["staticlib"]
-
[dependencies]
qemu_api = { path = "../../../qemu-api" }
qemu_api_macros = { path = "../../../qemu-api-macros" }
--
2.50.1
On Mon, Jul 21, 2025 at 12:52:38PM +0200, Paolo Bonzini wrote: > Date: Mon, 21 Jul 2025 12:52:38 +0200 > From: Paolo Bonzini <pbonzini@redhat.com> > Subject: [PATCH] rust: devices are not staticlibs > X-Mailer: git-send-email 2.50.1 > > 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. > > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > --- > rust/hw/char/pl011/Cargo.toml | 3 --- > rust/hw/timer/hpet/Cargo.toml | 3 --- > 2 files changed, 6 deletions(-) Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Hi Paolo, On Mon, Jul 21, 2025 at 1:53 PM Paolo Bonzini <pbonzini@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? -- Manos Pitsidianakis Emulation and Virtualization Engineer at Linaro Ltd
On Mon, Jul 21, 2025 at 1:01 PM Manos Pitsidianakis <manos.pitsidianakis@linaro.org> wrote: > > Hi Paolo, > > On Mon, Jul 21, 2025 at 1:53 PM Paolo Bonzini <pbonzini@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
© 2016 - 2025 Red Hat, Inc.