Skip to contentSkip to conversation

libvirt-dbus: disable -Werror=inline to fix build error

PATCH Superseded Tanguy Raufflet 2 participants 3 messages Apr 13 – Apr 14

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libvirt-dbus: disable -Werror=inline to fix build error

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.

---
 recipes-extended/libvirt/libvirt-dbus_1.4.1.bb | 2 ++
 1 file changed, 2 insertions(+)
recipes-extended/libvirt/libvirt-dbus_1.4.1.bb +2 -0
index 767470e2..e4859b0b 100644
@@ -16,6 +16,8 @@ SRCREV = "0c355bb8921d7cbccf93f41a8615fcd973e64f70"
 
 inherit meson pkgconfig
 
+CFLAGS:append = " -Wno-error=inline"
+
 FILES:${PN} += "\
     ${datadir}/dbus-1/* \
     ${datadir}/polkit-1/* \
Signature · 1 line
2.53.0
#1 lore raw

Can you check with upstream first? After all, they'll be facing the same issue with us.

The reason is that if we use this solution like this directly, chances are that nobody will ever revisit this issue any more...

Regards,
Qi

Quoted 37 lines · Tanguy Raufflet via lists.yoctoproject.org

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.

---
  recipes-extended/libvirt/libvirt-dbus_1.4.1.bb | 2 ++
  1 file changed, 2 insertions(+)
recipes-extended/libvirt/libvirt-dbus_1.4.1.bb +2 -1
index 767470e2..e4859b0b 100644
@@ -16,6 +16,8 @@ SRCREV = "0c355bb8921d7cbccf93f41a8615fcd973e64f70"
 
  inherit meson pkgconfig
 
+CFLAGS:append = " -Wno-error=inline"
+
  FILES:${PN} += "\
      ${datadir}/dbus-1/* \
      ${datadir}/polkit-1/* \
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#9695): https://lists.yoctoproject.org/g/meta-virtualization/message/9695
Mute This Topic: https://lists.yoctoproject.org/mt/118803008/3618072
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-