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

Michal Prívozník mprivozn at redhat.com
Thu Apr 27 12:57:54 UTC 2023


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>

Michal



More information about the libvir-list mailing list