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

Tanguy Raufflet <[email protected]> Tue, 14 Apr 2026 11:00:10 +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.

Note: This patch is a workaround for a build issue in libvirt-dbus. The
underlying issue has been fixed [1] upstream in the libvirt-dbus project.
Once the next version of libvirt-dbus is released that includes the fix,
this patch should be removed.

[1]: build: Do not use -Winline
    SHA: c0fffce8c45e79b73bcb63fac70e24a827367dce
    Repo: https://gitlab.com/libvirt/libvirt-dbus

Signed-off-by: Tanguy Raufflet <[email protected]>
---
Changes in v2:
- Added comment referencing upstream fix and note to remove on next
version bump
- Link to v1:
https://lists.yoctoproject.org/g/meta-virtualization/message/9695
---
 recipes-extended/libvirt/libvirt-dbus_1.4.1.bb | 4 ++++
 1 file changed, 4 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..17db13a9 100644
--- a/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb
+++ b/recipes-extended/libvirt/libvirt-dbus_1.4.1.bb
@@ -16,6 +16,10 @@ SRCREV = "0c355bb8921d7cbccf93f41a8615fcd973e64f70"
 
 inherit meson pkgconfig
 
+# Fixed upstream but not yet released. Remove on next version bump.
+# https://gitlab.com/libvirt/libvirt-dbus/-/commit/c0fffce8c45e79b73bcb63fac70e24a827367dce
+CFLAGS:append = " -Wno-error=inline"
+
 FILES:${PN} += "\
     ${datadir}/dbus-1/* \
     ${datadir}/polkit-1/* \
-- 
2.53.0