[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] meson: fix qxl module build
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH] meson: fix qxl module build |
Date: |
Fri, 4 Sep 2020 11:02:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 04/09/20 10:12, Gerd Hoffmann wrote:
> Hi,
>
>> 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'))
>
> 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:". :)
> 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:
diff --git a/meson.build b/meson.build
index 6ed3c37f46..88f2254f3b 100644
--- a/meson.build
+++ b/meson.build
@@ -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