From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: "open list:Rust-related patc..." <qemu-rust@nongnu.org>
Subject: Re: [PATCH 9/9] rust: only link the Rust part of the code into devices
Date: Wed, 3 Dec 2025 10:32:41 +0100 [thread overview]
Message-ID: <CABgObfaQouR4Jc20XM+LT0m0O7agBGtWU_WVuAcO-bQt-hpezA@mail.gmail.com> (raw)
In-Reply-To: <20251127132036.84384-10-pbonzini@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]
Turns out these last two patches only work with unreleased Meson. I will
put everything into a testable series once 1.10 is out (should be soon,
it's already at rc2).
Paolo
Il gio 27 nov 2025, 14:20 Paolo Bonzini <pbonzini@redhat.com> ha scritto:
> Do not include libqemuutil in the device crates for the same
> reason as in the previous commit. Static libraries like qemuutil
> are sensitive to their position on the command line and rustc does not
> always get it right.
>
> If rustc places the library too early on the command line, the stubs
> are included in the final link product, which results in duplicate
> symbols.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/meson.build | 18 ++++++++++--------
> rust/hw/timer/hpet/meson.build | 16 ++++++++--------
> 2 files changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/rust/hw/char/pl011/meson.build
> b/rust/hw/char/pl011/meson.build
> index 33b91f21911..9c0e8290e9a 100644
> --- a/rust/hw/char/pl011/meson.build
> +++ b/rust/hw/char/pl011/meson.build
> @@ -28,20 +28,22 @@ _libpl011_rs = static_library(
> ),
> override_options: ['rust_std=2021', 'build.rust_std=2021'],
> rust_abi: 'rust',
> + link_with: [
> + _util_rs,
> + _migration_rs,
> + _bql_rs,
> + _qom_rs,
> + _chardev_rs,
> + _system_rs,
> + _hwcore_rs,
> + _trace_rs
> + ],
> dependencies: [
> bilge_rs,
> bilge_impl_rs,
> bits_rs,
> common_rs,
> glib_sys_rs,
> - util_rs,
> - migration_rs,
> - bql_rs,
> - qom_rs,
> - chardev_rs,
> - system_rs,
> - hwcore_rs,
> - trace_rs
> ],
> )
>
> diff --git a/rust/hw/timer/hpet/meson.build
> b/rust/hw/timer/hpet/meson.build
> index bb64b96672e..7eb758ae347 100644
> --- a/rust/hw/timer/hpet/meson.build
> +++ b/rust/hw/timer/hpet/meson.build
> @@ -3,15 +3,15 @@ _libhpet_rs = static_library(
> files('src/lib.rs'),
> override_options: ['rust_std=2021', 'build.rust_std=2021'],
> rust_abi: 'rust',
> - dependencies: [
> - common_rs,
> - util_rs,
> - migration_rs,
> - bql_rs,
> - qom_rs,
> - system_rs,
> - hwcore_rs,
> + link_with: [
> + _util_rs,
> + _migration_rs,
> + _bql_rs,
> + _qom_rs,
> + _system_rs,
> + _hwcore_rs,
> ],
> + dependencies: [common_rs],
> )
>
> rust_devices_ss.add(when: 'CONFIG_X_HPET_RUST', if_true:
> [declare_dependency(
> --
> 2.51.1
>
[-- Attachment #2: Type: text/html, Size: 3335 bytes --]
prev parent reply other threads:[~2025-12-03 9:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 13:20 [PATCH 0/9] rust: build system and other cleanups Paolo Bonzini
2025-11-27 13:20 ` [PATCH 1/9] rust: remove leftover bindings/ Paolo Bonzini
2025-12-03 9:11 ` Zhao Liu
2025-11-27 13:20 ` [PATCH 2/9] rust: remove unused --cfg arguments Paolo Bonzini
2025-12-03 10:25 ` Zhao Liu
2025-11-27 13:20 ` [PATCH 3/9] rust: remove unnecessary repetitive options Paolo Bonzini
2025-12-03 10:37 ` Zhao Liu
2025-11-27 13:20 ` [PATCH 4/9] rust/bql: make bindings public Paolo Bonzini
2025-12-03 10:58 ` Zhao Liu
2025-11-27 13:20 ` [PATCH 5/9] rust: do not copy the SysBusDevice Paolo Bonzini
2025-12-03 10:59 ` Zhao Liu
2025-11-27 13:20 ` [PATCH 6/9] rust: fix reference to MemoryRegion Paolo Bonzini
2025-12-03 11:00 ` Zhao Liu
2025-11-27 13:20 ` [PATCH 7/9] rust: move strict lints handling to meson.build Paolo Bonzini
2025-12-03 15:29 ` Zhao Liu
2025-11-27 13:20 ` [PATCH 8/9] rust: Do not link qemuutil into Rust rlibs Paolo Bonzini
2025-11-27 13:20 ` [PATCH 9/9] rust: only link the Rust part of the code into devices Paolo Bonzini
2025-12-03 9:32 ` Paolo Bonzini [this message]
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=CABgObfaQouR4Jc20XM+LT0m0O7agBGtWU_WVuAcO-bQt-hpezA@mail.gmail.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.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;
as well as URLs for NNTP newsgroup(s).