0002-stubs-only-build-stubs-for-QAPI-events-when-needed.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From ffd5e7cbc0cf2d1c0984bb453cc9e125c7259436 Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@smile.fr>
  3. Date: Tue, 7 Jan 2025 21:52:51 +0100
  4. Subject: [PATCH] stubs: only build stubs for QAPI events when needed
  5. Since commit "stubs: avoid duplicate symbols in libqemuutil.a" [1],
  6. Qemu doesn't build with:
  7. ./configure --enable-user --disable-system --enable-tools
  8. /usr/bin/ld: libhwcore.a.p/hw_core_qdev.c.o: in function 'device_finalize':
  9. [...]output/build/host-qemu-9.2.0/build/../hw/core/qdev.c:689:(.text+0x75c): undefined reference to 'qapi_event_send_device_deleted'
  10. collect2: error: ld returned 1 exit status
  11. Indeed, with have_system = false and have_tools = true, Qemu needs the
  12. stubs for QAPI events added by stub_ss.add(files('qdev.c')) to provide
  13. qapi_event_send_device_deleted().
  14. Fixes: 388b849fb6c33882b481123568995a749a54f648.
  15. [1] https://gitlab.com/qemu-project/qemu/-/commit/388b849fb6c33882b481123568995a749a54f648
  16. Upstream: https://gitlab.com/qemu-project/qemu/-/issues/2766
  17. Signed-off-by: Romain Naour <romain.naour@smile.fr>
  18. ---
  19. stubs/meson.build | 2 +-
  20. 1 file changed, 1 insertion(+), 1 deletion(-)
  21. diff --git a/stubs/meson.build b/stubs/meson.build
  22. index e91614a874..838a8ca3e3 100644
  23. --- a/stubs/meson.build
  24. +++ b/stubs/meson.build
  25. @@ -58,7 +58,7 @@ if have_user
  26. # Stubs for QAPI events. Those can always be included in the build, but
  27. # they are not built at all for --disable-system --disable-tools builds.
  28. - if not (have_system or have_tools)
  29. + if not have_system and have_tools
  30. stub_ss.add(files('qdev.c'))
  31. endif
  32. endif
  33. --
  34. 2.47.1