On 2/23/23 13:17, Philippe Mathieu-Daudé wrote:
Extract non-x86 stubs to win_dump-stub.c. We can now
build dump.o once for system emulation. Update meson.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  dump/dump.c          | 14 --------------
  dump/meson.build     |  6 ++++--
  dump/win_dump-stub.c | 23 +++++++++++++++++++++++
  3 files changed, 27 insertions(+), 16 deletions(-)
  create mode 100644 dump/win_dump-stub.c

diff --git a/dump/dump.c b/dump/dump.c
index b33a613d45..7cde3e326e 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -32,20 +32,6 @@
  #include "migration/blocker.h"
  #include "win_dump.h"
-#ifndef TARGET_X86_64
-bool win_dump_available(Error **errp)
-{
-    error_setg(errp, "Windows dump is only available for x86-64");
-
-    return false;
-}
-
-void create_win_dump(DumpState *s, Error **errp)
-{
-    win_dump_available(errp);
-}
-#endif
-
  #include <zlib.h>
  #ifdef CONFIG_LZO
  #include <lzo/lzo1x.h>
diff --git a/dump/meson.build b/dump/meson.build
index 2eff29c3ea..6ae07e6fed 100644
--- a/dump/meson.build
+++ b/dump/meson.build
@@ -1,4 +1,6 @@
  softmmu_ss.add(files('dump-hmp-cmds.c'))
-specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])
-specific_ss.add(when: ['CONFIG_SOFTMMU', 'TARGET_X86_64'], if_true: 
files('win_dump.c'))
+softmmu_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])
+specific_ss.add(when: ['CONFIG_SOFTMMU', 'TARGET_X86_64'],
+                if_true: files('win_dump.c'),
+                if_false: files('win_dump-stub.c'))

Doesn't this add win_dump-stub.c when !(SOFTMMU && X86_64), i.e. !SOFTMMU || 
!X86_64?

I trying to imagine how well this will scale with ARM64, for the ongoing Windows on ARM project. Would it just be easier have the stubs in win_dump.c, using ifdefs?


r~

Reply via email to