If a file defining the binary TargetInfo structure is available,
link with it. Otherwise keep using the stub. Implement such
structure for arm-softmmu.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
 meson.build                   |  7 ++++++-
 configs/targets/arm-softmmu.c | 22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 configs/targets/arm-softmmu.c

diff --git a/meson.build b/meson.build
index 168b07b5887..da24cc2ba41 100644
--- a/meson.build
+++ b/meson.build
@@ -3809,7 +3809,6 @@ specific_ss.add(files('page-target.c', 
'page-vary-target.c'))
 
 common_ss.add(files('target_info.c'))
 system_ss.add(files('target_info-qom.c'))
-specific_ss.add(files('target_info-stub.c'))
 
 subdir('backends')
 subdir('disas')
@@ -4272,6 +4271,12 @@ foreach target : target_dirs
     arch_srcs += gdbstub_xml
   endif
 
+  target_info_c = meson.project_source_root() / 'configs' / 'targets' / target 
+ '.c'
+  if not fs.exists(target_info_c)
+    target_info_c = meson.project_source_root() / 'target_info-stub.c'
+  endif
+  arch_srcs += target_info_c
+
   t = target_arch[target_base_arch].apply(config_target, strict: false)
   arch_srcs += t.sources()
   arch_deps += t.dependencies()
diff --git a/configs/targets/arm-softmmu.c b/configs/targets/arm-softmmu.c
new file mode 100644
index 00000000000..6263d604f19
--- /dev/null
+++ b/configs/targets/arm-softmmu.c
@@ -0,0 +1,22 @@
+/*
+ * QEMU binary/target API (qemu-system-arm)
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/target_info-impl.h"
+#include "qemu/target_info-qom.h"
+#include "cpu-qom.h"
+
+static const TargetInfo target_info_arm_system = {
+    .name = "arm",
+    .machine_typename = TYPE_TARGET_ARM_MACHINE,
+};
+
+const TargetInfo *target_info(void)
+{
+    return &target_info_arm_system;
+}
-- 
2.47.1


Reply via email to