Skip to contentSkip to conversation

meson: fix qxl module build

PATCH In review Gerd Hoffmann 3 participants 6 messages Aug 27, 2020 – Sep 4, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: fix qxl module build

Drop qxl object from softmmu source set, it is built as module.

Also drop CONFIG_QXL condition from qxl_ss.add. First because it is pointless, the whole thing is wrapped into "has_key('CONFIG_QXL')". Second because it doesn't work for some reason. Looks like the source files are not added to the set for some reason and we end up with an empty hw-display-qxl.so.

---
 hw/display/meson.build | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/display/meson.build +1 -3
index 78adaf9db463..becbedd24c23 100644
@@ -41,12 +41,10 @@ specific_ss.add(when: 'CONFIG_VGA', if_true: files('vga.c'))
 
 if config_all_devices.has_key('CONFIG_QXL')
   qxl_ss = ss.source_set()
-  qxl_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
+  qxl_ss.add(files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
   hw_display_modules += {'qxl': qxl_ss}
 endif
 
-softmmu_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
-
 softmmu_ss.add(when: 'CONFIG_DPCD', if_true: files('dpcd.c'))
 softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx_dp.c'))
 
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Gerd Hoffmann

Drop qxl object from softmmu source set, it is built as module.

Also drop CONFIG_QXL condition from qxl_ss.add. First because it is pointless, the whole thing is wrapped into "has_key('CONFIG_QXL')". Second because it doesn't work for some reason. Looks like the source files are not added to the set for some reason and we end up with an empty hw-display-qxl.so.

Quoted 31 lines
---
 hw/display/meson.build | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/display/meson.build +1 -3
index 78adaf9db463..becbedd24c23 100644
@@ -41,12 +41,10 @@ specific_ss.add(when: 'CONFIG_VGA', if_true:
 files('vga.c'))
 
 if config_all_devices.has_key('CONFIG_QXL')
   qxl_ss = ss.source_set()
-  qxl_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c',
 'qxl-render.c'))
+  qxl_ss.add(files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
   hw_display_modules += {'qxl': qxl_ss}
 endif
 
-softmmu_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c',
 'qxl-logger.c', 'qxl-render.c'))
-

softmmu_ss.add(when: 'CONFIG_DPCD', if_true: files('dpcd.c')) softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true:
files('xlnx_dp.c'))

--
2.27.0

Signature · 1 line
Marc-André Lureau
#2 lore raw
In reply to Gerd Hoffmann

Hi,

hw/display/meson.build specific_ss.add(when: 'CONFIG_VGA', if_true: files('vga.c')) · line 48

Quoted 8 lines

if config_all_devices.has_key('CONFIG_QXL')
qxl_ss = ss.source_set()

hw/display/meson.build +1 -2
-  qxl_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
+  qxl_ss.add(files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
   hw_display_modules += {'qxl': qxl_ss}
 endif
 
-softmmu_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))

Damn. Turned out to not be that easy. Modular builds work fine, but with non-modular builds I have the problem that qxl_ss is merged into softmmu_ss *unconditionally*. So when building two targets, one with qxl enabled (i386 for example) and one without pci support (avr for example) I get missing symbols for pci+vga due to the attempt to link qxl into avr-softmmu.

Any hints how to solve that one?

thanks,
Gerd

#3 lore raw
Quoted 9 lines · Gerd Hoffmann

Hi,

Quoted 7 lines

if config_all_devices.has_key('CONFIG_QXL')
qxl_ss = ss.source_set()

(quoted diff) +1 -1
-  qxl_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
+  qxl_ss.add(files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
   hw_display_modules += {'qxl': qxl_ss}
 endif
Quoted 8 lines
Quoted 1 line

-softmmu_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))

Damn. Turned out to not be that easy. Modular builds work fine, but with non-modular builds I have the problem that qxl_ss is merged into softmmu_ss *unconditionally*. So when building two targets, one with qxl enabled (i386 for example) and one without pci support (avr for example) I get missing symbols for pci+vga due to the attempt to link qxl into avr-softmmu.

You have found why it's got that "when:". :)

Quoted 1 line

Any hints how to solve that one?

I think this should be enough---fixing it in the common code, not with a qxl-specific change:

meson.build +1 -1
index 6ed3c37f46..88f2254f3b 100644
@@ -923,7 +923,7 @@ softmmu_mods = []
 foreach d, list : modules
   foreach m, module_ss : list
     if enable_modules and targetos != 'windows'
-      module_ss = module_ss.apply(config_host, strict: false)
+      module_ss = module_ss.apply(config_all, strict: false)
       sl = static_library(d + '-' + m, [genh, module_ss.sources()],
                           dependencies: [modulecommon, module_ss.dependencies()], pic: true)
       if d == 'block'

:-O

If you want to get rid of the "if config_all_devices.has_key(...)", you perhaps could try doing something like

module_srcs = module_ss.sources()
if module_srcs.length() == 0
continue
endif
sl = static_library(d + '-' + m, [genh, module_srcs],
dependencies: [modulecommon, module_ss.dependencies()], pic: true)

etc. This would work also for the CONFIG_VIRTIO_GPU changes.

Paolo

#4 lore raw

Hi,

meson.build softmmu_mods = [] · line 926

Quoted 7 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-  qxl_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
+  qxl_ss.add(files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))

You have found why it's got that "when:". :)

meson.build +1 -1
-      module_ss = module_ss.apply(config_host, strict: false)
+      module_ss = module_ss.apply(config_all, strict: false)

Ah. That nicely explains why the "when:" didn't work in the first place.

Quoted 1 line

etc. This would work also for the CONFIG_VIRTIO_GPU changes.

Yes, virtio-gpu modules are next on the list ;)

thanks,
Gerd

#5 lore raw
Quoted 10 lines · Gerd Hoffmann

Hi,

meson.build softmmu_mods = [] · line 926

Quoted 7 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-  qxl_ss.add(when: 'CONFIG_QXL', if_true: files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))
+  qxl_ss.add(files('qxl.c', 'qxl-logger.c', 'qxl-render.c'))

You have found why it's got that "when:". :)

meson.build +1 -1
-      module_ss = module_ss.apply(config_host, strict: false)
+      module_ss = module_ss.apply(config_all, strict: false)
Quoted 6 lines

Ah. That nicely explains why the "when:" didn't work in the first place.

Quoted 1 line

etc. This would work also for the CONFIG_VIRTIO_GPU changes.

Yes, virtio-gpu modules are next on the list ;)

Great, feel free to pick the patch up, no need for attribution or anything.

Paolo