diff --git a/meta-oe/recipes-support/libosinfo/libosinfo/0002-meson-don-t-error-on-clang-s-unused-but-set-global.patch b/meta-oe/recipes-support/libosinfo/libosinfo/0002-meson-don-t-error-on-clang-s-unused-but-set-global.patch new file mode 100644 index 0000000000..042aaac21a --- /dev/null +++ b/meta-oe/recipes-support/libosinfo/libosinfo/0002-meson-don-t-error-on-clang-s-unused-but-set-global.patch @@ -0,0 +1,45 @@ +From ab54bb415451f0b85207867ae2d68c5dcf1a191c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 7 Sep 2026 18:39:42 -0700 +Subject: [PATCH] meson: don't error on clang's -Wunused-but-set-global + +clang 23 added -Wunused-but-set-global to the -Wunused warning group, so +the -Werror that meson.build adds for git builds now turns it into a hard +error: + + osinfo/osinfo_avatar_format.c:24:1: error: variable + 'osinfo_avatar_format_parent_class' set but not used + [-Werror,-Wunused-but-set-global] + +It fires on the _parent_class variables that GLib's G_DEFINE_TYPE +family of macros emit, which libosinfo cannot fix, and on the write-only +'format' global in tools/osinfo-detect.c. + +Keep the warning visible but not fatal. gcc does not know this warning +group and rejects the flag outright, so compiler.has_argument() drops it +there. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + meson.build | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/meson.build b/meson.build +index 377539d..7fd9de7 100644 +--- a/meson.build ++++ b/meson.build +@@ -246,6 +246,12 @@ if compiler.get_id() == 'clang' + libosinfo_check_cflags += [ + '-Wno-typedef-redefinition', + '-Wno-missing-field-initializers', ++ # clang 23 added -Wunused-but-set-global to the -Wunused group. It ++ # fires on the _parent_class variables that GLib's G_DEFINE_TYPE ++ # family of macros emit, which libosinfo cannot fix, and on the ++ # deliberately write-only 'format' global in osinfo-detect. ++ # Keep the warning visible but not fatal. ++ '-Wno-error=unused-but-set-global', + ] + endif + diff --git a/meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb b/meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb index 94286872b3..2a8059cf22 100644 --- a/meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb +++ b/meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb @@ -9,6 +9,7 @@ SRC_URI = " \ git://gitlab.com/libosinfo/libosinfo.git;branch=main;protocol=https \ file://0001-meson.build-allow-crosscompiling-gir.patch \ file://0adf38535637ec668e658d43f04f60f11f51574f.patch \ + file://0002-meson-don-t-error-on-clang-s-unused-but-set-global.patch \ " SRCREV = "b505ef5161d2552102a743acd4ad83298d3d8f99"