[PATCH 1/6] meson: Allow system binaries to not have target-specific units

Philippe Mathieu-Daudé posted 6 patches 1 month ago
Maintainers: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
[PATCH 1/6] meson: Allow system binaries to not have target-specific units
Posted by Philippe Mathieu-Daudé 1 month ago
As we are moving toward a single binary, targets might end
without any target-specific objects (all objects being in
the 'common' source set). Allow this by checking the
target_system_arch[] dictionary contains the target key
before using it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 meson.build | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index db87358d62d..734c801cc77 100644
--- a/meson.build
+++ b/meson.build
@@ -4275,9 +4275,11 @@ foreach target : target_dirs
   endif
   if target.endswith('-softmmu')
     target_type='system'
-    t = target_system_arch[target_base_arch].apply(config_target, strict: false)
-    arch_srcs += t.sources()
-    arch_deps += t.dependencies()
+    if target_base_arch in target_system_arch
+      t = target_system_arch[target_base_arch].apply(config_target, strict: false)
+      arch_srcs += t.sources()
+      arch_deps += t.dependencies()
+    endif
 
     hw_dir = target_name == 'sparc64' ? 'sparc64' : target_base_arch
     if hw_arch.has_key(hw_dir)
-- 
2.52.0


Re: [PATCH 1/6] meson: Allow system binaries to not have target-specific units
Posted by Pierrick Bouvier 1 month ago
On 1/6/26 3:53 PM, Philippe Mathieu-Daudé wrote:
> As we are moving toward a single binary, targets might end
> without any target-specific objects (all objects being in
> the 'common' source set). Allow this by checking the
> target_system_arch[] dictionary contains the target key
> before using it.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   meson.build | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index db87358d62d..734c801cc77 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -4275,9 +4275,11 @@ foreach target : target_dirs
>     endif
>     if target.endswith('-softmmu')
>       target_type='system'
> -    t = target_system_arch[target_base_arch].apply(config_target, strict: false)
> -    arch_srcs += t.sources()
> -    arch_deps += t.dependencies()
> +    if target_base_arch in target_system_arch
> +      t = target_system_arch[target_base_arch].apply(config_target, strict: false)
> +      arch_srcs += t.sources()
> +      arch_deps += t.dependencies()
> +    endif
>   
>       hw_dir = target_name == 'sparc64' ? 'sparc64' : target_base_arch
>       if hw_arch.has_key(hw_dir)

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>