From: Zhao Liu <zhao1.liu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org,
Zhao Liu <zhao1.liu@intel.com>
Subject: [PATCH] rust: Prefer link_with over link_whole
Date: Tue, 18 Feb 2025 16:37:34 +0800 [thread overview]
Message-ID: <20250218083734.3345966-1-zhao1.liu@intel.com> (raw)
The commit fccb744f41c6 ("gdbstub: Try unlinking the unix socket before
binding") causes the compilation of rust-qemu-api-integration to fail,
because rust-qemu-api-integration uses link_whole which meets the
duplicate symbol linker error.
Though it's not the issue of link_whole used by Rust side, there's no
need to use link_whole.
Use link_with, which may also bring some benefits, such as faster
linking or smaller output files.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
rust/hw/char/pl011/meson.build | 2 +-
rust/hw/timer/hpet/meson.build | 2 +-
rust/qemu-api/meson.build | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/rust/hw/char/pl011/meson.build b/rust/hw/char/pl011/meson.build
index 547cca5a96f7..4ba9089fcf8e 100644
--- a/rust/hw/char/pl011/meson.build
+++ b/rust/hw/char/pl011/meson.build
@@ -18,7 +18,7 @@ _libpl011_rs = static_library(
)
rust_devices_ss.add(when: 'CONFIG_X_PL011_RUST', if_true: [declare_dependency(
- link_whole: [_libpl011_rs],
+ link_with: [_libpl011_rs],
# Putting proc macro crates in `dependencies` is necessary for Meson to find
# them when compiling the root per-target static rust lib.
dependencies: [bilge_impl_dep, qemu_api_macros],
diff --git a/rust/hw/timer/hpet/meson.build b/rust/hw/timer/hpet/meson.build
index c2d7c0532ca4..ce90cc4f021a 100644
--- a/rust/hw/timer/hpet/meson.build
+++ b/rust/hw/timer/hpet/meson.build
@@ -10,7 +10,7 @@ _libhpet_rs = static_library(
)
rust_devices_ss.add(when: 'CONFIG_X_HPET_RUST', if_true: [declare_dependency(
- link_whole: [_libhpet_rs],
+ link_with: [_libhpet_rs],
# Putting proc macro crates in `dependencies` is necessary for Meson to find
# them when compiling the root per-target static rust lib.
dependencies: [qemu_api_macros],
diff --git a/rust/qemu-api/meson.build b/rust/qemu-api/meson.build
index 2e9c1078b9b2..e825671b694b 100644
--- a/rust/qemu-api/meson.build
+++ b/rust/qemu-api/meson.build
@@ -63,7 +63,7 @@ test('rust-qemu-api-integration',
rust_args: ['--test'],
install: false,
dependencies: [qemu_api, qemu_api_macros],
- link_whole: [rust_qemu_api_objs, libqemuutil]),
+ link_with: [rust_qemu_api_objs, libqemuutil]),
args: [
'--test', '--test-threads', '1',
'--format', 'pretty',
--
2.34.1
next reply other threads:[~2025-02-18 8:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 8:37 Zhao Liu [this message]
2025-02-18 8:58 ` [PATCH] rust: Prefer link_with over link_whole Paolo Bonzini
2025-02-18 17:50 ` Zhao Liu
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=20250218083734.3345966-1-zhao1.liu@intel.com \
--to=zhao1.liu@intel.com \
--cc=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).