[meta-virtualization][PATCH] libvirt-dbus: disable -Werror=inline to fix build error

Tanguy Raufflet <[email protected]> Mon, 13 Apr 2026 13:52:39 +0200
Newsgroups org.yoctoproject.lists.meta-virtualization
Message-ID <[email protected]>
The meson.build from libvirt-dbus enables the flag -Winline. Combined
with -Werror from Yocto, this causes a build failure because GCC refuses
to inline g_autoptr_cleanup_generic_gfree() from the glib header
glib-autocleanups.h, as it considers the call unlikely and estimates
code size would grow.

Because the function g_autoptr_cleanup_generic_gfree is defined as
static inline with good reason, this patch disables -Werror=inline for
libvirt-dbus to allow the build to succeed.

Signed-off-by: Tanguy Raufflet <[email protected]>
---
 recipes-extended/libvirt/libvirt-dbus_1.4.1.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb b/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb
index 767470e2..e4859b0b 100644
--- a/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb
+++ b/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb
@@ -16,6 +16,8 @@ SRCREV = "0c355bb8921d7cbccf93f41a8615fcd973e64f70"
 
 inherit meson pkgconfig
 
+CFLAGS:append = " -Wno-error=inline"
+
 FILES:${PN} += "\
     ${datadir}/dbus-1/* \
     ${datadir}/polkit-1/* \
-- 
2.53.0