Skip to contentSkip to conversation

meson: Do not try to build module for empty per-target hw/ directory

PATCH In review Philippe Mathieu-Daudé 2 participants 3 messages Jan 16 – Jan 20 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: Do not try to build module for empty per-target hw/ directory

In commit 83d5db95d38 ("meson: Allow system binaries to not have target-specific units") we allowed targets with empty target_system_arch[] source set, but missed hw_arch[] could also be empty when building modules.

Skip such case, otherwise due to commit a1ced487549 ("hw/microblaze: Build files once"), building with --enable-modules triggers:

../meson.build:4034:14: ERROR: Key microblaze is not in the dictionary.

Fixes a1ced487549 ("hw/microblaze: Build files once")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3272

---
 meson.build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meson.build +5 -2
index 2339aa4db2a..5bb8d0b3ebc 100644
@@ -4029,6 +4029,11 @@ if enable_modules
   foreach target : target_dirs
     if target.endswith('-softmmu')
       config_target = config_target_mak[target]
+      arch = config_target['TARGET_NAME'] == 'sparc64' ? 'sparc64' : config_target['TARGET_BASE_ARCH']
+      if not hw_arch.has_key(arch)
+        continue
+      endif
+
       config_devices_mak = target + '-config-devices.mak'
       modinfo_src = custom_target('modinfo-' + target + '.c',
                                   output: 'modinfo-' + target + '.c',
@@ -4038,8 +4043,6 @@ if enable_modules
 
       modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src)
       modinfo_dep = declare_dependency(link_with: modinfo_lib)
-
-      arch = config_target['TARGET_NAME'] == 'sparc64' ? 'sparc64' : config_target['TARGET_BASE_ARCH']
       hw_arch[arch].add(modinfo_dep)
     endif
   endforeach
Signature · 1 line
2.52.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Philippe Mathieu-Daudé

In commit 83d5db95d38 ("meson: Allow system binaries to not have target-specific units") we allowed targets with empty target_system_arch[] source set, but missed hw_arch[] could also be empty when building modules.

Skip such case, otherwise due to commit a1ced487549 ("hw/microblaze: Build files once"), building with --enable-modules triggers:

../meson.build:4034:14: ERROR: Key microblaze is not in the dictionary.

Quoted 8 lines
Fixes a1ced487549 ("hw/microblaze: Build files once")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3272

---
  meson.build | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 11 lines · Philippe Mathieu-Daudé

In commit 83d5db95d38 ("meson: Allow system binaries to not have target-specific units") we allowed targets with empty target_system_arch[] source set, but missed hw_arch[] could also be empty when building modules.

Skip such case, otherwise due to commit a1ced487549 ("hw/microblaze: Build files once"), building with --enable-modules triggers:

../meson.build:4034:14: ERROR: Key microblaze is not in the dictionary.

Quoted 7 lines
Fixes a1ced487549 ("hw/microblaze: Build files once")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3272

---
  meson.build | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

Queued.