diff --git a/glib2-solve-compile-error-for-ilp32.patch b/glib2-solve-compile-error-for-ilp32.patch new file mode 100644 index 0000000000000000000000000000000000000000..e226002050a97f2709a03e69735f8dc02947eea6 --- /dev/null +++ b/glib2-solve-compile-error-for-ilp32.patch @@ -0,0 +1,89 @@ +From a440dc0b2b2a45846e9ae06ecbb2c4dc9d68fe2e Mon Sep 17 00:00:00 2001 +From: chenbingzhao +Date: Tue, 4 Apr 2023 17:41:11 +0800 +Subject: [PATCH] glib2: solve compile error for ilp32 + +reason:fix compile error: +../glib-2.60.6/glib/gslice.c:1527:26: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t {aka long unsigned int}' [-Werror=format=] + g_fprintf (stderr, "GSlice: MemChecker: attempt to release non-allocated block: %p size=%" G_GSIZE_FORMAT "\n", pointer, size); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In file included from ../glib-2.60.6/glib/gslice.c:20:0: +glib/glibconfig.h:81:25: note: format string is defined here + +Signed-off-by: chenbingzhao +--- + gobject/gclosure.c | 4 ++++ + meson.build | 35 +++++++++++++++++++++++++++++++++++ + 2 files changed, 39 insertions(+) + +diff --git a/gobject/gclosure.c b/gobject/gclosure.c +index 85002a2..701181c 100644 +--- a/gobject/gclosure.c ++++ b/gobject/gclosure.c +@@ -1302,7 +1302,11 @@ restart: + g_value_set_boolean (gvalue, (gboolean) *int_val); + break; + case G_TYPE_STRING: ++#ifdef __ILP32__ ++ g_value_take_string (gvalue, (gchar*) *int_val); ++#else + g_value_take_string (gvalue, *(gchar**)value); ++#endif + break; + case G_TYPE_CHAR: + g_value_set_schar (gvalue, (gint8) *int_val); +diff --git a/meson.build b/meson.build +index 882049c..426fdc5 100644 +--- a/meson.build ++++ b/meson.build +@@ -1564,6 +1564,40 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang' + } + endif + ++if host_system == 'linux-gnu_ilp32' ++if g_sizet_compatibility['short'] ++ glibconfig_conf.set('glib_size_type_define', 'short') ++ glibconfig_conf.set_quoted('gsize_modifier', 'h') ++ glibconfig_conf.set_quoted('gssize_modifier', 'h') ++ glibconfig_conf.set_quoted('gsize_format', 'hu') ++ glibconfig_conf.set_quoted('gssize_format', 'hi') ++ glibconfig_conf.set('glib_msize_type', 'SHRT') ++elif g_sizet_compatibility['long'] ++ glibconfig_conf.set('glib_size_type_define', 'long') ++ glibconfig_conf.set_quoted('gsize_modifier', 'l') ++ glibconfig_conf.set_quoted('gssize_modifier', 'l') ++ glibconfig_conf.set_quoted('gsize_format', 'lu') ++ glibconfig_conf.set_quoted('gssize_format', 'li') ++ glibconfig_conf.set('glib_msize_type', 'LONG') ++elif g_sizet_compatibility['int'] ++ glibconfig_conf.set('glib_size_type_define', 'int') ++ glibconfig_conf.set_quoted('gsize_modifier', '') ++ glibconfig_conf.set_quoted('gssize_modifier', '') ++ glibconfig_conf.set_quoted('gsize_format', 'u') ++ glibconfig_conf.set_quoted('gssize_format', 'i') ++ glibconfig_conf.set('glib_msize_type', 'INT') ++elif g_sizet_compatibility['long long'] ++ glibconfig_conf.set('glib_size_type_define', 'long long') ++ glibconfig_conf.set_quoted('gsize_modifier', int64_m) ++ glibconfig_conf.set_quoted('gssize_modifier', int64_m) ++ glibconfig_conf.set_quoted('gsize_format', int64_m + 'u') ++ glibconfig_conf.set_quoted('gssize_format', int64_m + 'i') ++ glibconfig_conf.set('glib_msize_type', 'INT64') ++else ++ error('Could not determine size of size_t.') ++endif ++ ++else + if g_sizet_compatibility['short'] + glibconfig_conf.set('glib_size_type_define', 'short') + glibconfig_conf.set_quoted('gsize_modifier', 'h') +@@ -1595,6 +1629,7 @@ elif g_sizet_compatibility['long long'] + else + error('Could not determine size of size_t.') + endif ++endif + + if voidp_size == int_size + glibconfig_conf.set('glib_intptr_type_define', 'int') +-- +2.12.3 \ No newline at end of file diff --git a/glib2.spec b/glib2.spec index 0cdd6369490d958737d67799bb3fcfe98c089d15..3f857ce1932aec100a8c598ee4947e5cdb954718 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,6 +1,6 @@ Name: glib2 Version: 2.72.2 -Release: 10 +Release: 11 Summary: The core library that forms the basis for projects such as GTK+ and GNOME License: LGPLv2+ URL: http://www.gtk.org @@ -63,6 +63,8 @@ patch6053: backport-gdbusinterfaceskeleton-Fix-a-use-after-free-of-a-GDBusMethod patch6054: backport-CVE-2023-24593_CVE-2023-25180-1.patch patch6055: backport-CVE-2023-24593_CVE-2023-25180-2.patch +patch9001: glib2-solve-compile-error-for-ilp32.patch + BuildRequires: chrpath gcc gcc-c++ gettext perl-interpreter BUildRequires: glibc-devel libattr-devel libselinux-devel meson BuildRequires: systemtap-sdt-devel pkgconfig(libelf) pkgconfig(libffi) @@ -257,6 +259,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %endif %changelog +* Tue Apr 4 2023 EibzChan - 2.72.2-11 +- solve compile error for ilp32 + * Sat Apr 1 2023 hanhuihui - 2.72.2-10 - fix CVE-2023-24593 and CVE-2023-25180