[libvirt PATCH v2 1/1] meson: Check header usability

Michal Prívozník mprivozn at redhat.com
Thu Apr 27 13:23:29 UTC 2023


On 4/27/23 15:12, Andrea Bolognani wrote:
> On Thu, Apr 27, 2023 at 02:57:54PM +0200, Michal Prívozník wrote:
>> On 4/27/23 14:22, Andrea Bolognani wrote:
>>> This fixes cross-building in some scenarios.
>>>
>>> Specifically, when building for armv7l on x86_64, has_header()
>>> will see the x86_64 version of the linux/kmv.h header and
>>> consider it to be usable. Later, when an attempt is made to
>>> actually include it, the compiler will quickly realize that
>>> things can't quite work.
>>>
>>> The reason why we haven't hit this in our CI is that we only ever
>>> install the foreign version of header files. When building the
>>> Debian package, however, some of the Debian-specific tooling will
>>> bring in the native version of the Linux headers in addition to
>>> the foreign one, causing meson to misreport the header's
>>> availability status.
>>>
>>> Checking for actual usability, as opposed to mere presence, of
>>> headers is enough to make things work correctly in all cases.
>>>
>>> The meson documentation recommends using has_header() instead of
>>> check_header() whenever possible for performance reasons, but
>>> while testing this change on fairly old and underpowered hardware
>>> I haven't been able to measure any meaningful slowdown.
>>>
>>> https://bugs.debian.org/1024504
>>>
>>> Suggested-by: Helmut Grohne <helmut at subdivi.de>
>>> Signed-off-by: Andrea Bolognani <abologna at redhat.com>
>>> ---
>>>  meson.build | 16 ++++++++--------
>>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> Reviewed-by: Michal Privoznik <mprivozn at redhat.com>
> 
> Thanks!
> 
> Do you think it's okay for me to push this now, so that it gets
> included in 9.3.0, or should I rather wait until after the release?
> 

It's a bug fix and as such can and in fact should be merged.

Michal



More information about the libvir-list mailing list