[RFC PATCH v4 07/19] meson: Prepare to accept per-binary TargetInfo structure implementation

Philippe Mathieu-Daudé posted 19 patches 5 months, 3 weeks ago
There is a newer version of this series
[RFC PATCH v4 07/19] meson: Prepare to accept per-binary TargetInfo structure implementation
Posted by Philippe Mathieu-Daudé 5 months, 3 weeks ago
If a file defining the binary TargetInfo structure is available,
link with it. Otherwise keep using the stub.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 meson.build                 | 9 ++++++++-
 configs/targets/meson.build | 3 +++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 configs/targets/meson.build

diff --git a/meson.build b/meson.build
index a1109b6db3f..69f60755377 100644
--- a/meson.build
+++ b/meson.build
@@ -3216,6 +3216,7 @@ config_devices_mak_list = []
 config_devices_h = {}
 config_target_h = {}
 config_target_mak = {}
+config_target_info = {}
 
 disassemblers = {
   'alpha' : ['CONFIG_ALPHA_DIS'],
@@ -3809,9 +3810,9 @@ 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('configs/targets')
 subdir('disas')
 subdir('migration')
 subdir('monitor')
@@ -4272,6 +4273,12 @@ foreach target : target_dirs
     arch_srcs += gdbstub_xml
   endif
 
+  if target in config_target_info
+    arch_srcs += config_target_info[target]
+  else
+    arch_srcs += files('target-info-stub.c')
+  endif
+
   t = target_arch[target_base_arch].apply(config_target, strict: false)
   arch_srcs += t.sources()
   arch_deps += t.dependencies()
diff --git a/configs/targets/meson.build b/configs/targets/meson.build
new file mode 100644
index 00000000000..e9a5f7b078e
--- /dev/null
+++ b/configs/targets/meson.build
@@ -0,0 +1,3 @@
+foreach target : ['arm-softmmu', 'aarch64-softmmu']
+  config_target_info += {target : files(target + '.c')}
+endforeach
-- 
2.47.1


Re: [RFC PATCH v4 07/19] meson: Prepare to accept per-binary TargetInfo structure implementation
Posted by Richard Henderson 5 months, 3 weeks ago
On 4/22/25 07:54, Philippe Mathieu-Daudé wrote:
> If a file defining the binary TargetInfo structure is available,
> link with it. Otherwise keep using the stub.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier<pierrick.bouvier@linaro.org>
> ---
>   meson.build                 | 9 ++++++++-
>   configs/targets/meson.build | 3 +++
>   2 files changed, 11 insertions(+), 1 deletion(-)
>   create mode 100644 configs/targets/meson.build

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~