meson: Bump glib version to 2.58.0
commit9c1cfc337ec245ffeefa4c549b6c2d13f41d8be7
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 3 May 2024 13:48:54 +0000 (3 15:48 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 14 May 2024 13:17:20 +0000 (14 15:17 +0200)
tree30c1339e75d36cafe2eba9af281ce00288b19adb
parenta50f870da6652433f1bb11db4593034ea3f8f47f
meson: Bump glib version to 2.58.0

Now that we don't have any distro stuck with glib-2.56.0, we can
bump the glib version. In fact, this is needed, because of
g_clear_pointer. Since v7.4.0-rc1~301 we declare at compile time
what version of glib APIs we want to use (by setting
GLIB_VERSION_MIN_REQUIRED = GLIB_VERSION_MAX_ALLOWED = 2.56.0),
regardless of actual glib version in the host.

And since we currently require glib-2.56.0 and force glib to use
APIs of that version, some newer bits are slipping from us. For
instance: regular function version of g_clear_pointer() is used
instead of a fancy macro. So what? Well, g_clear_pointer()
function typecasts passed free function to void (*)(void *) and
then calls it. Well, this triggers UBSAN, understandably. But
with glib-2.58.0 the g_clear_pointer() becomes a macro which
calls the free function directly, with no typecasting and thus no
undefined behavior.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
libvirt.spec.in
meson.build
src/libvirt_private.syms
src/util/glibcompat.c
src/util/glibcompat.h