qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 6/7] dump: Build once by adding stubs for non-x86 targets


From: Philippe Mathieu-Daudé
Subject: [PATCH v4 6/7] dump: Build once by adding stubs for non-x86 targets
Date: Fri, 24 Feb 2023 00:17:54 +0100

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é <philmd@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'))
diff --git a/dump/win_dump-stub.c b/dump/win_dump-stub.c
new file mode 100644
index 0000000000..87cb699e3d
--- /dev/null
+++ b/dump/win_dump-stub.c
@@ -0,0 +1,23 @@
+/*
+ * Windows crashdump stubs for non-x86 targets
+ *
+ * Copyright (c) 2023 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "win_dump.h"
+
+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);
+}
-- 
2.38.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]