Skip to contentSkip to conversation

stubs: avoid duplicate symbols in libqemuutil.a

PATCH In review Paolo Bonzini 3 participants 3 messages Oct 21, 2024 – Oct 24, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stubs: avoid duplicate symbols in libqemuutil.a

qapi_event_send_device_deleted is always included (together with the rest of QAPI) in libqemuutil.a if either system-mode emulation or tools are being built, and in that case the stub causes a duplicate symbol to appear in libqemuutil.a.

Add the symbol only if events are not being requested.

Supersedes: <[email protected]>

---
v1 fails to build with --disable-system --disable-tools, which I have now noticed in CI.

 stubs/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
stubs/meson.build +6 -1
index 772a3e817df..e91614a874d 100644
@@ -55,7 +55,12 @@ endif
 if have_user
   # Symbols that are used by hw/core.
   stub_ss.add(files('cpu-synchronize-state.c'))
-  stub_ss.add(files('qdev.c'))
+
+  # Stubs for QAPI events.  Those can always be included in the build, but
+  # they are not built at all for --disable-system --disable-tools builds.
+  if not (have_system or have_tools)
+    stub_ss.add(files('qdev.c'))
+  endif
 endif
 
 if have_system
Signature · 1 line
2.46.2
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · Paolo Bonzini

qapi_event_send_device_deleted is always included (together with the rest of QAPI) in libqemuutil.a if either system-mode emulation or tools are being built, and in that case the stub causes a duplicate symbol to appear in libqemuutil.a.

Add the symbol only if events are not being requested.

Supersedes: <[email protected]>

(with all the other binggen/rustc fixes in my tree)

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#2 lore raw
In reply to Paolo Bonzini
Quoted 8 lines · Paolo Bonzini

qapi_event_send_device_deleted is always included (together with the rest of QAPI) in libqemuutil.a if either system-mode emulation or tools are being built, and in that case the stub causes a duplicate symbol to appear in libqemuutil.a.

Add the symbol only if events are not being requested.

Supersedes: <[email protected]>

strip ^

Quoted 27 lines

---
v1 fails to build with --disable-system --disable-tools, which I have now noticed in CI.

  stubs/meson.build | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
stubs/meson.build +6 -1
index 772a3e817df..e91614a874d 100644
@@ -55,7 +55,12 @@ endif
  if have_user
    # Symbols that are used by hw/core.
    stub_ss.add(files('cpu-synchronize-state.c'))
-  stub_ss.add(files('qdev.c'))
+
+  # Stubs for QAPI events.  Those can always be included in the build, but
+  # they are not built at all for --disable-system --disable-tools builds.
+  if not (have_system or have_tools)
+    stub_ss.add(files('qdev.c'))
+  endif
  endif
 
  if have_system