Complete Yocto mirror with license table for TQMa6UL (2038-compliance)

- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
Siggi (OpenClaw Agent)
2026-03-01 20:58:18 +00:00
commit 16accb6b24
15086 changed files with 1292356 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
From e7077aa23bfcd31a8e72e39dc93ce4f854678376 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 15 Feb 2019 11:17:27 +0100
Subject: [PATCH] Do not write $bindir into pkg-config files
This would otherwise break when using the files to build other target
components (we need to rely on PATH containing the paths to utilities,
rather than use target paths).
Upstream-Status: Inappropriate [upstream wants the paths in .pc files]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
gio/meson.build | 16 ++++++++--------
glib/meson.build | 6 +++---
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gio/meson.build b/gio/meson.build
index 5f91586..1a95f4f 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -884,14 +884,14 @@ pkg.generate(libgio,
'dtdsdir=' + '${datadir}' / dtds_subdir,
'bindir=' + '${prefix}' / get_option('bindir'),
'giomoduledir=' + pkgconfig_giomodulesdir,
- 'gio=' + '${bindir}' / 'gio',
- 'gio_querymodules=' + pkgconfig_multiarch_bindir / 'gio-querymodules',
- 'glib_compile_schemas=' + pkgconfig_multiarch_bindir / 'glib-compile-schemas',
- 'glib_compile_resources=' + '${bindir}' / 'glib-compile-resources',
- 'gdbus=' + '${bindir}' /'gdbus',
- 'gdbus_codegen=' + '${bindir}' / 'gdbus-codegen',
- 'gresource=' + '${bindir}' / 'gresource',
- 'gsettings=' + '${bindir}' / 'gsettings',
+ 'gio=gio',
+ 'gio_querymodules=gio-querymodules',
+ 'glib_compile_schemas=glib-compile-schemas',
+ 'glib_compile_resources=glib-compile-resources',
+ 'gdbus=gdbus',
+ 'gdbus_codegen=gdbus-codegen',
+ 'gresource=gresource',
+ 'gsettings=gsettings',
],
version : glib_version,
install_dir : glib_pkgconfigreldir,
diff --git a/glib/meson.build b/glib/meson.build
index c26a35e..1d8ca6b 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -447,9 +447,9 @@ pkg.generate(libglib,
variables : [
'bindir=' + '${prefix}' / get_option('bindir'),
'datadir=' + '${prefix}' / get_option('datadir'),
- 'glib_genmarshal=' + '${bindir}' / 'glib-genmarshal',
- 'gobject_query=' + '${bindir}' / 'gobject-query',
- 'glib_mkenums=' + '${bindir}' / 'glib-mkenums',
+ 'glib_genmarshal=glib-genmarshal',
+ 'gobject_query=gobject-query',
+ 'glib_mkenums=glib-mkenums',
'glib_valgrind_suppressions=' + '${datadir}' /
valgrind_suppression_file_install_subdir /
fs.name(valgrind_suppression_file),

View File

@@ -0,0 +1,29 @@
From 9a5d4bf65b658d744d610ee27ecd2ae65b14b158 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 15 Mar 2014 22:42:29 -0700
Subject: [PATCH] Fix DATADIRNAME on uclibc/Linux
translation files are always installed under PREFIX/share/locale in uclibc
based systems therefore lets set DATADIRNAME to "share".
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
---
m4macros/glib-gettext.m4 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4
index df6fbf0..47db864 100644
--- a/m4macros/glib-gettext.m4
+++ b/m4macros/glib-gettext.m4
@@ -293,6 +293,10 @@ msgstr ""
CATOBJEXT=.mo
DATADIRNAME=share
;;
+ *-*-musl* | *-*-linux-uclibc*)
+ CATOBJEXT=.gmo
+ DATADIRNAME=share
+ ;;
*)
CATOBJEXT=.mo
DATADIRNAME=lib

View File

@@ -0,0 +1,26 @@
From 4933aef791857a5aac650b60af800778658b875b Mon Sep 17 00:00:00 2001
From: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date: Tue, 22 Mar 2016 15:14:58 +0200
Subject: [PATCH] Install gio-querymodules as libexec_PROGRAM
We want to install this binary with the gio library, and debian
renamer does not cope with library packages with files in ${bindir}
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Upstream-Status: Inappropriate [OE specific]
---
gio/meson.build | 1 +
1 file changed, 1 insertion(+)
diff --git a/gio/meson.build b/gio/meson.build
index f9fdf6e..5f91586 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -1005,6 +1005,7 @@ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodu
c_args : gio_c_args,
# intl.lib is not compatible with SAFESEH
link_args : noseh_link_args,
+ install_dir: glib_libexecdir,
dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
glib_compile_schemas = executable('glib-compile-schemas',

View File

@@ -0,0 +1,39 @@
From 8ae2e9c2a04e089306693a021149dc6b7d1bd679 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 12 Jun 2015 17:08:46 +0300
Subject: [PATCH] Remove the warning about deprecated paths in schemas
Some schemas in gsettings-desktop-schemas (such as proxy and locale)
are still using deprecated paths, as of 3.16.1. This causes warning
messages, and meta/lib/oe/rootfs.py complaints about them.
Upstream-Status: Inappropriate
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
gio/glib-compile-schemas.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
index 04ef404..e791ce2 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -1232,19 +1232,6 @@ parse_state_start_schema (ParseState *state,
return;
}
- if (path && (g_str_has_prefix (path, "/apps/") ||
- g_str_has_prefix (path, "/desktop/") ||
- g_str_has_prefix (path, "/system/")))
- {
- gchar *message = NULL;
- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. "
- "Paths starting with "
- "“/apps/”, “/desktop/” or “/system/” are deprecated."),
- id, path);
- g_printerr ("%s\n", message);
- g_free (message);
- }
-
state->schema_state = schema_state_new (path, gettext_domain,
extends, extends_name, list_of);

View File

@@ -0,0 +1,80 @@
From c0733f7a91dfe13152abc60c5a3064456b3e9d63 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Wed, 13 Feb 2019 15:32:05 +0100
Subject: [PATCH] Set host_machine correctly when building with mingw32
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
gio/tests/meson.build | 8 ++++----
glib/tests/meson.build | 2 +-
meson.build | 3 +++
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 4ef3343..e498e7e 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -29,7 +29,7 @@ endif
test_cpp_args = test_c_args
-if host_machine.system() == 'windows'
+if host_system == 'windows'
common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')]
endif
@@ -230,7 +230,7 @@ if have_dbus_daemon
endif
# Test programs buildable on UNIX only
-if host_machine.system() != 'windows'
+if host_system != 'windows'
gio_tests += {
'file' : {},
'gdbus-peer-object-manager' : {},
@@ -562,7 +562,7 @@ if host_machine.system() != 'windows'
endif # unix
# Test programs buildable on Windows only
-if host_machine.system() == 'windows'
+if host_system == 'windows'
gio_tests += {'win32-streams' : {}}
endif
@@ -632,7 +632,7 @@ if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
}
endif
-if host_machine.system() != 'windows'
+if host_system != 'windows'
test_extra_programs += {
'gdbus-example-unix-fd-client' : {
'install' : false,
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
index d80c86e..5329cda 100644
--- a/glib/tests/meson.build
+++ b/glib/tests/meson.build
@@ -216,7 +216,7 @@ if glib_conf.has('HAVE_EVENTFD')
}
endif
-if host_machine.system() == 'windows'
+if host_system == 'windows'
if winsock2.found()
glib_tests += {
'gpoll' : {
diff --git a/meson.build b/meson.build
index 813c9b7..6ee775e 100644
--- a/meson.build
+++ b/meson.build
@@ -54,6 +54,9 @@ else
endif
host_system = host_machine.system()
+if host_system == 'mingw32'
+ host_system = 'windows'
+endif
if host_system == 'darwin'
ios_test_code = '''#include <TargetConditionals.h>

View File

@@ -0,0 +1,34 @@
From a8eb944a10353403241608a084787f6efcbb2eb7 Mon Sep 17 00:00:00 2001
From: Jordan Williams <jordan@jwillikers.com>
Date: Fri, 1 Dec 2023 09:53:50 -0600
Subject: [PATCH] Switch from the deprecated distutils module to the packaging
module
The distutils module was removed in Python 3.12.
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/6ef967a0f930ce37a8c9b5aff969693b34714291]
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
gio/gdbus-2.0/codegen/utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py
index 0204610..08f1ba9 100644
--- a/gio/gdbus-2.0/codegen/utils.py
+++ b/gio/gdbus-2.0/codegen/utils.py
@@ -19,7 +19,7 @@
#
# Author: David Zeuthen <davidz@redhat.com>
-import distutils.version
+import packaging.version
import os
import sys
@@ -166,4 +166,4 @@ def version_cmp_key(key):
v = str(key[0])
else:
v = "0"
- return (distutils.version.LooseVersion(v), key[1])
+ return (packaging.version.Version(v), key[1])

View File

@@ -0,0 +1,27 @@
From 878e51f82100c698236fda0e069e14ea9249350c Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Wed, 8 Jan 2020 18:22:46 +0100
Subject: [PATCH] gio/tests/resources.c: comment out a build host-only test
This test requires building resources in a way that is
not cross-compatible (hardcodes ld and objcopy).
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
gio/tests/resources.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gio/tests/resources.c b/gio/tests/resources.c
index f567914..b21b616 100644
--- a/gio/tests/resources.c
+++ b/gio/tests/resources.c
@@ -1068,7 +1068,7 @@ main (int argc,
g_test_add_func ("/resource/automatic", test_resource_automatic);
/* This only uses automatic resources too, so it tests the constructors and destructors */
g_test_add_func ("/resource/module", test_resource_module);
- g_test_add_func ("/resource/binary-linked", test_resource_binary_linked);
+ /* g_test_add_func ("/resource/binary-linked", test_resource_binary_linked); */
#endif
g_test_add_func ("/resource/uri/query-info", test_uri_query_info);
g_test_add_func ("/resource/uri/file", test_uri_file);

View File

@@ -0,0 +1,28 @@
From b4b523160ef550a53705fcc45ac6e10d086ce491 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 12 Oct 2019 17:46:26 -0700
Subject: [PATCH] meson: Run atomics test on clang as well
Fixes
./glib-2.62.1/glib/gatomic.c:675:2: error: G_ATOMIC_LOCK_FREE defined, but incapable of lock-free atomics.
^
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 6ee775e..8bc5fa7 100644
--- a/meson.build
+++ b/meson.build
@@ -1938,7 +1938,7 @@ atomicdefine = '''
# We know that we can always use real ("lock free") atomic operations with MSVC
if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' or cc.links(atomictest, name : 'atomic ops')
have_atomic_lock_free = true
- if cc.get_id() == 'gcc' and not cc.compiles(atomicdefine, name : 'atomic ops define')
+ if (cc.get_id() == 'gcc' or cc.get_id() == 'clang') and not cc.compiles(atomicdefine, name : 'atomic ops define')
# Old gcc release may provide
# __sync_bool_compare_and_swap but doesn't define
# __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4

View File

@@ -0,0 +1,29 @@
From 294f3e6e9a0a9f4733e85ed6810d1b743055370b Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Sat, 16 Sep 2023 22:28:27 +0200
Subject: [PATCH] meson.build: do not enable pidfd features on native glib
builds
We still use host distros like alma 8 with kernels older than 5.4,
where these features are not implemented.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 8bc5fa7..df1fa60 100644
--- a/meson.build
+++ b/meson.build
@@ -981,7 +981,8 @@ if cc.links('''#include <sys/syscall.h>
waitid (P_PIDFD, 0, &child_info, WEXITED | WNOHANG);
return 0;
}''', name : 'pidfd_open(2) system call')
- glib_conf.set('HAVE_PIDFD', 1)
+ #requires kernel 5.4+
+ #glib_conf.set('HAVE_PIDFD', 1)
endif
# Check for __uint128_t (gcc) by checking for 128-bit division

View File

@@ -0,0 +1,43 @@
From 50636758c73e5e61212a8f801c6c602b8aab5ba7 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Tue, 3 Oct 2017 10:45:55 +0300
Subject: [PATCH] Do not hardcode python path into various tools
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
gio/gdbus-2.0/codegen/gdbus-codegen.in | 2 +-
gobject/glib-genmarshal.in | 2 +-
gobject/glib-mkenums.in | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
index 67d3675..4e92a7a 100755
--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
+++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env @PYTHON@
+#!/usr/bin/env python3
# GDBus - GLib D-Bus Library
#
diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in
index aa5af43..56e8e2e 100755
--- a/gobject/glib-genmarshal.in
+++ b/gobject/glib-genmarshal.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env @PYTHON@
+#!/usr/bin/env python3
# pylint: disable=too-many-lines, missing-docstring, invalid-name
diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
index 353e53a..8ed6c39 100755
--- a/gobject/glib-mkenums.in
+++ b/gobject/glib-mkenums.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env @PYTHON@
+#!/usr/bin/env python3
# If the code below looks horrible and unpythonic, do not panic.
#

View File

@@ -0,0 +1,49 @@
From ec0b708b981af77fef8e4bbb603cde4de4cd2e29 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Thu, 19 Sep 2024 18:35:53 +0100
Subject: [PATCH] gsocks4aproxy: Fix a single byte buffer overflow in connect
messages
`SOCKS4_CONN_MSG_LEN` failed to account for the length of the final nul
byte in the connect message, which is an addition in SOCKSv4a vs
SOCKSv4.
This means that the buffer for building and transmitting the connect
message could be overflowed if the username and hostname are both
`SOCKS4_MAX_LEN` (255) bytes long.
Proxy configurations are normally statically configured, so the username
is very unlikely to be near its maximum length, and hence this overflow
is unlikely to be triggered in practice.
(Commit message by Philip Withnall, diagnosis and fix by Michael
Catanzaro.)
Fixes: #3461
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/ec0b708b981af77fef8e4bbb603cde4de4cd2e29]
CVE: CVE-2024-52533
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
gio/gsocks4aproxy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gio/gsocks4aproxy.c b/gio/gsocks4aproxy.c
index 3dad118eb7..b3146d08fd 100644
--- a/gio/gsocks4aproxy.c
+++ b/gio/gsocks4aproxy.c
@@ -79,9 +79,9 @@ g_socks4a_proxy_init (GSocks4aProxy *proxy)
* +----+----+----+----+----+----+----+----+----+----+....+----+------+....+------+
* | VN | CD | DSTPORT | DSTIP | USERID |NULL| HOST | | NULL |
* +----+----+----+----+----+----+----+----+----+----+....+----+------+....+------+
- * 1 1 2 4 variable 1 variable
+ * 1 1 2 4 variable 1 variable 1
*/
-#define SOCKS4_CONN_MSG_LEN (9 + SOCKS4_MAX_LEN * 2)
+#define SOCKS4_CONN_MSG_LEN (10 + SOCKS4_MAX_LEN * 2)
static gint
set_connect_msg (guint8 *msg,
const gchar *hostname,
--
GitLab

View File

@@ -0,0 +1,57 @@
From fe6af80931c35fafc6a2cd0651b6de052d1bffae Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 18 Feb 2025 16:44:58 +0000
Subject: [PATCH 1/6] gdatetime: Fix integer overflow when parsing very long
ISO8601 inputs
This will only happen with invalid (or maliciously invalid) potential
ISO8601 strings, but `g_date_time_new_from_iso8601()` needs to be robust
against that.
Prevent `length` overflowing by correctly defining it as a `size_t`.
Similarly for `date_length`, but additionally track its validity in a
boolean rather than as its sign.
Spotted by chamalsl as #YWH-PGM9867-43.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
CVE: CVE-2025-3360
Upstream-Status: Backport [https://github.com/GNOME/glib/commit/fe6af80931c35fafc6a2cd0651b6de052d1bffae]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
glib/gdatetime.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index ad9c190b6..b33db2c20 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -1497,7 +1497,8 @@ parse_iso8601_time (const gchar *text, gsize length,
GDateTime *
g_date_time_new_from_iso8601 (const gchar *text, GTimeZone *default_tz)
{
- gint length, date_length = -1;
+ size_t length, date_length = 0;
+ gboolean date_length_set = FALSE;
gint hour = 0, minute = 0;
gdouble seconds = 0.0;
GTimeZone *tz = NULL;
@@ -1508,11 +1509,14 @@ g_date_time_new_from_iso8601 (const gchar *text, GTimeZone *default_tz)
/* Count length of string and find date / time separator ('T', 't', or ' ') */
for (length = 0; text[length] != '\0'; length++)
{
- if (date_length < 0 && (text[length] == 'T' || text[length] == 't' || text[length] == ' '))
- date_length = length;
+ if (!date_length_set && (text[length] == 'T' || text[length] == 't' || text[length] == ' '))
+ {
+ date_length = length;
+ date_length_set = TRUE;
+ }
}
- if (date_length < 0)
+ if (!date_length_set)
return NULL;
if (!parse_iso8601_time (text + date_length + 1, length - (date_length + 1),

View File

@@ -0,0 +1,53 @@
From 495c85278f9638fdf3ebf002c759e1bdccebaf2f Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 18 Feb 2025 16:51:36 +0000
Subject: [PATCH 2/6] gdatetime: Fix potential integer overflow in timezone
offset handling
This one is much harder to trigger than the one in the previous commit,
but mixing `gssize` and `gsize` always runs the risk of the former
overflowing for very (very very) long input strings.
Avoid that possibility by not using the sign of the `tz_offset` to
indicate its validity, and instead using the return value of the
function.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
CVE: CVE-2025-3360
Upstream-Status: Backport [https://github.com/GNOME/glib/commit/495c85278f9638fdf3ebf002c759e1bdccebaf2f]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
glib/gdatetime.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index b33db2c20..792c2ed15 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -1346,8 +1346,10 @@ parse_iso8601_date (const gchar *text, gsize length,
return FALSE;
}
+/* Value returned in tz_offset is valid if and only if the function return value
+ * is non-NULL. */
static GTimeZone *
-parse_iso8601_timezone (const gchar *text, gsize length, gssize *tz_offset)
+parse_iso8601_timezone (const gchar *text, gsize length, size_t *tz_offset)
{
gint i, tz_length, offset_hours, offset_minutes;
gint offset_sign = 1;
@@ -1415,11 +1417,11 @@ static gboolean
parse_iso8601_time (const gchar *text, gsize length,
gint *hour, gint *minute, gdouble *seconds, GTimeZone **tz)
{
- gssize tz_offset = -1;
+ size_t tz_offset = 0;
/* Check for timezone suffix */
*tz = parse_iso8601_timezone (text, length, &tz_offset);
- if (tz_offset >= 0)
+ if (*tz != NULL)
length = tz_offset;
/* hh:mm:ss(.sss) */

View File

@@ -0,0 +1,36 @@
From 5e8a3c19fcad2936dc5e070cf0767a5c5af907c5 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 18 Feb 2025 16:55:18 +0000
Subject: [PATCH 3/6] gdatetime: Track timezone length as an unsigned size_t
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Its guaranteed to be in (0, length] by the calculations above.
This avoids the possibility of integer overflow through `gssize` not
being as big as `size_t`.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
CVE: CVE-2025-3360
Upstream-Status: Backport [https://github.com/GNOME/glib/commit/5e8a3c19fcad2936dc5e070cf0767a5c5af907c5]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
glib/gdatetime.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index 792c2ed15..6335bcbe2 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -1351,7 +1351,8 @@ parse_iso8601_date (const gchar *text, gsize length,
static GTimeZone *
parse_iso8601_timezone (const gchar *text, gsize length, size_t *tz_offset)
{
- gint i, tz_length, offset_hours, offset_minutes;
+ size_t tz_length;
+ gint i, offset_hours, offset_minutes;
gint offset_sign = 1;
GTimeZone *tz;

View File

@@ -0,0 +1,76 @@
From 804a3957720449dcfac601da96bd5f5db2b71ef1 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 18 Feb 2025 17:07:24 +0000
Subject: [PATCH 4/6] gdatetime: Factor out some string pointer arithmetic
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Makes the following code a little clearer, but doesnt introduce any
functional changes.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
CVE: CVE-2025-3360
Upstream-Status: Backport [https://github.com/GNOME/glib/commit/804a3957720449dcfac601da96bd5f5db2b71ef1]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
glib/gdatetime.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index 6335bcbe2..de5dd7af0 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -1355,6 +1355,7 @@ parse_iso8601_timezone (const gchar *text, gsize length, size_t *tz_offset)
gint i, offset_hours, offset_minutes;
gint offset_sign = 1;
GTimeZone *tz;
+ const char *tz_start;
/* UTC uses Z suffix */
if (length > 0 && text[length - 1] == 'Z')
@@ -1372,34 +1373,35 @@ parse_iso8601_timezone (const gchar *text, gsize length, size_t *tz_offset)
}
if (i < 0)
return NULL;
+ tz_start = text + i;
tz_length = length - i;
/* +hh:mm or -hh:mm */
- if (tz_length == 6 && text[i+3] == ':')
+ if (tz_length == 6 && tz_start[3] == ':')
{
- if (!get_iso8601_int (text + i + 1, 2, &offset_hours) ||
- !get_iso8601_int (text + i + 4, 2, &offset_minutes))
+ if (!get_iso8601_int (tz_start + 1, 2, &offset_hours) ||
+ !get_iso8601_int (tz_start + 4, 2, &offset_minutes))
return NULL;
}
/* +hhmm or -hhmm */
else if (tz_length == 5)
{
- if (!get_iso8601_int (text + i + 1, 2, &offset_hours) ||
- !get_iso8601_int (text + i + 3, 2, &offset_minutes))
+ if (!get_iso8601_int (tz_start + 1, 2, &offset_hours) ||
+ !get_iso8601_int (tz_start + 3, 2, &offset_minutes))
return NULL;
}
/* +hh or -hh */
else if (tz_length == 3)
{
- if (!get_iso8601_int (text + i + 1, 2, &offset_hours))
+ if (!get_iso8601_int (tz_start + 1, 2, &offset_hours))
return NULL;
offset_minutes = 0;
}
else
return NULL;
- *tz_offset = i;
- tz = g_time_zone_new_identifier (text + i);
+ *tz_offset = tz_start - text;
+ tz = g_time_zone_new_identifier (tz_start);
/* Double-check that the GTimeZone matches our interpretation of the timezone.
* This can fail because our interpretation is less strict than (for example)

View File

@@ -0,0 +1,57 @@
From 4c56ff80344e0d8796eb2307091f7b24ec198aa9 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 18 Feb 2025 17:28:33 +0000
Subject: [PATCH 5/6] gdatetime: Factor out an undersized variable
For long input strings, it would have been possible for `i` to overflow.
Avoid that problem by using the `tz_length` instead, so that we count up
rather than down.
This commit introduces no functional changes (outside of changing
undefined behaviour), and can be verified using the identity
`i === length - tz_length`.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
CVE: CVE-2025-3360
Upstream-Status: Backport [https://github.com/GNOME/glib/commit/4c56ff80344e0d8796eb2307091f7b24ec198aa9]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
glib/gdatetime.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index de5dd7af0..2f8c864a1 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -1352,7 +1352,7 @@ static GTimeZone *
parse_iso8601_timezone (const gchar *text, gsize length, size_t *tz_offset)
{
size_t tz_length;
- gint i, offset_hours, offset_minutes;
+ gint offset_hours, offset_minutes;
gint offset_sign = 1;
GTimeZone *tz;
const char *tz_start;
@@ -1365,16 +1365,15 @@ parse_iso8601_timezone (const gchar *text, gsize length, size_t *tz_offset)
}
/* Look for '+' or '-' of offset */
- for (i = length - 1; i >= 0; i--)
- if (text[i] == '+' || text[i] == '-')
+ for (tz_length = 1; tz_length <= length; tz_length++)
+ if (text[length - tz_length] == '+' || text[length - tz_length] == '-')
{
- offset_sign = text[i] == '-' ? -1 : 1;
+ offset_sign = text[length - tz_length] == '-' ? -1 : 1;
break;
}
- if (i < 0)
+ if (tz_length > length)
return NULL;
- tz_start = text + i;
- tz_length = length - i;
+ tz_start = text + length - tz_length;
/* +hh:mm or -hh:mm */
if (tz_length == 6 && tz_start[3] == ':')

View File

@@ -0,0 +1,50 @@
From 7f6d81130ec05406a8820bc753ed03859e88daea Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Date: Tue, 18 Feb 2025 18:20:56 +0000
Subject: [PATCH 6/6] tests: Add some missing GDateTime ISO8601 parsing tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This improves test coverage, adding coverage for some lines which I
spotted were not covered while testing the preceding commits.
It doesnt directly test the preceding commits, though.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
CVE: CVE-2025-3360
Upstream-Status: Backport [https://github.com/GNOME/glib/commit/7f6d81130ec05406a8820bc753ed03859e88daea]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
glib/tests/gdatetime.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index 9e1acd097..94dd028a3 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -859,6 +859,23 @@ test_GDateTime_new_from_iso8601 (void)
* NaN */
dt = g_date_time_new_from_iso8601 ("0005306 000001,666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666600080000-00", NULL);
g_assert_null (dt);
+
+ /* Various invalid timezone offsets which look like they could be in
+ * `+hh:mm`, `-hh:mm`, `+hhmm`, `-hhmm`, `+hh` or `-hh` format */
+ dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+01:xx", NULL);
+ g_assert_null (dt);
+ dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx:00", NULL);
+ g_assert_null (dt);
+ dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx:xx", NULL);
+ g_assert_null (dt);
+ dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+01xx", NULL);
+ g_assert_null (dt);
+ dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx00", NULL);
+ g_assert_null (dt);
+ dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xxxx", NULL);
+ g_assert_null (dt);
+ dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx", NULL);
+ g_assert_null (dt);
}
typedef struct {

View File

@@ -0,0 +1,120 @@
From cc647f9e46d55509a93498af19659baf9c80f2e3 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Thu, 10 Apr 2025 10:57:20 -0500
Subject: [PATCH 1/2] gstring: carefully handle gssize parameters
Wherever we use gssize to allow passing -1, we need to ensure we don't
overflow the value by assigning a gsize to it without checking if the
size exceeds the maximum gssize. The safest way to do this is to just
use normal gsize everywhere instead and use gssize only for the
parameter.
Our computers don't have enough RAM to write tests for this. I tried
forcing string->len to high values for test purposes, but this isn't
valid and will just cause out of bounds reads/writes due to
string->allocated_len being unexpectedly small, so I don't think we can
test this easily.
CVE: CVE-2025-4373
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/cc647f9e46d55509a93498af19659baf9c80f2e3]
Signed-off-by: Praveen Kumar <praveen.kumar@windriver.com>
---
glib/gstring.c | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/glib/gstring.c b/glib/gstring.c
index 9f04144..d016b65 100644
--- a/glib/gstring.c
+++ b/glib/gstring.c
@@ -490,8 +490,9 @@ g_string_insert_len (GString *string,
return string;
if (len < 0)
- len = strlen (val);
- len_unsigned = len;
+ len_unsigned = strlen (val);
+ else
+ len_unsigned = len;
if (pos < 0)
pos_unsigned = string->len;
@@ -788,10 +789,12 @@ g_string_insert_c (GString *string,
g_string_maybe_expand (string, 1);
if (pos < 0)
- pos = string->len;
+ pos_unsigned = string->len;
else
- g_return_val_if_fail ((gsize) pos <= string->len, string);
- pos_unsigned = pos;
+ {
+ pos_unsigned = pos;
+ g_return_val_if_fail (pos_unsigned <= string->len, string);
+ }
/* If not just an append, move the old stuff */
if (pos_unsigned < string->len)
@@ -824,6 +827,7 @@ g_string_insert_unichar (GString *string,
gssize pos,
gunichar wc)
{
+ gsize pos_unsigned;
gint charlen, first, i;
gchar *dest;
@@ -865,15 +869,18 @@ g_string_insert_unichar (GString *string,
g_string_maybe_expand (string, charlen);
if (pos < 0)
- pos = string->len;
+ pos_unsigned = string->len;
else
- g_return_val_if_fail ((gsize) pos <= string->len, string);
+ {
+ pos_unsigned = pos;
+ g_return_val_if_fail (pos_unsigned <= string->len, string);
+ }
/* If not just an append, move the old stuff */
- if ((gsize) pos < string->len)
- memmove (string->str + pos + charlen, string->str + pos, string->len - pos);
+ if (pos_unsigned < string->len)
+ memmove (string->str + pos_unsigned + charlen, string->str + pos_unsigned, string->len - pos_unsigned);
- dest = string->str + pos;
+ dest = string->str + pos_unsigned;
/* Code copied from g_unichar_to_utf() */
for (i = charlen - 1; i > 0; --i)
{
@@ -931,6 +938,7 @@ g_string_overwrite_len (GString *string,
const gchar *val,
gssize len)
{
+ gssize len_unsigned;
gsize end;
g_return_val_if_fail (string != NULL, NULL);
@@ -942,14 +950,16 @@ g_string_overwrite_len (GString *string,
g_return_val_if_fail (pos <= string->len, string);
if (len < 0)
- len = strlen (val);
+ len_unsigned = strlen (val);
+ else
+ len_unsigned = len;
- end = pos + len;
+ end = pos + len_unsigned;
if (end > string->len)
g_string_maybe_expand (string, end - string->len);
- memcpy (string->str + pos, val, len);
+ memcpy (string->str + pos, val, len_unsigned);
if (end > string->len)
{
--
2.40.0

View File

@@ -0,0 +1,29 @@
From 4d435bb4809793c445846db8fb87e3c9184c4703 Mon Sep 17 00:00:00 2001
From: Peter Bloomfield <peterbloomfield@bellsouth.net>
Date: Fri, 11 Apr 2025 05:52:33 +0000
Subject: [PATCH 2/2] gstring: Make len_unsigned unsigned
CVE: CVE-2025-4373
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/4d435bb4809793c445846db8fb87e3c9184c4703]
Signed-off-by: Praveen Kumar <praveen.kumar@windriver.com>
---
glib/gstring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/glib/gstring.c b/glib/gstring.c
index d016b65..d9ad0c3 100644
--- a/glib/gstring.c
+++ b/glib/gstring.c
@@ -938,7 +938,7 @@ g_string_overwrite_len (GString *string,
const gchar *val,
gssize len)
{
- gssize len_unsigned;
+ gsize len_unsigned;
gsize end;
g_return_val_if_fail (string != NULL, NULL);
--
2.40.0

View File

@@ -0,0 +1,72 @@
From 39af934b11ec7bb8f943ba963919816266a3316e Mon Sep 17 00:00:00 2001
From: "Rebecca N. Palmer" <rebecca_palmer@zoho.com>
Date: Fri, 11 Oct 2024 09:38:52 +0100
Subject: [PATCH 1/3] gdatetime test: Do not assume PST8PDT was always exactly
-8/-7
In newer tzdata, it is an alias for America/Los_Angeles, which has a
slightly different meaning: DST did not exist there before 1883. As a
result, we can no longer hard-code the knowledge that interval 0 is
standard time and interval 1 is summer time, and instead we need to look
up the correct intervals from known timestamps.
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3502
Bug-Debian: https://bugs.debian.org/1084190
[smcv: expand commit message, fix whitespace]
Signed-off-by: Simon McVittie <smcv@debian.org>
Upstream-Status: Backport
[https://github.com/GNOME/glib/commit/c0619f08e6c608fd6464d2f0c6970ef0bbfb9ecf]
Signed-off-by: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
---
glib/tests/gdatetime.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index 141263b66..cfe00906d 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -2625,6 +2625,7 @@ test_posix_parse (void)
{
GTimeZone *tz;
GDateTime *gdt1, *gdt2;
+ gint i1, i2;
/* Check that an unknown zone name falls back to UTC. */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -2648,16 +2649,25 @@ test_posix_parse (void)
/* This fails rules_from_identifier on Unix (though not on Windows)
* but passes anyway because PST8PDT is a zone name.
+ *
+ * Intervals i1 and i2 (rather than 0 and 1) are needed because in
+ * recent tzdata, PST8PDT may be an alias for America/Los_Angeles,
+ * and hence be aware that DST has not always existed.
+ * https://bugs.debian.org/1084190
*/
tz = g_time_zone_new_identifier ("PST8PDT");
g_assert_nonnull (tz);
g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "PST8PDT");
- g_assert_cmpstr (g_time_zone_get_abbreviation (tz, 0), ==, "PST");
- g_assert_cmpint (g_time_zone_get_offset (tz, 0), ==, - 8 * 3600);
- g_assert (!g_time_zone_is_dst (tz, 0));
- g_assert_cmpstr (g_time_zone_get_abbreviation (tz, 1), ==, "PDT");
- g_assert_cmpint (g_time_zone_get_offset (tz, 1), ==,- 7 * 3600);
- g_assert (g_time_zone_is_dst (tz, 1));
+ /* a date in winter = non-DST */
+ i1 = g_time_zone_find_interval (tz, G_TIME_TYPE_STANDARD, 0);
+ /* approximately 6 months in seconds, i.e. a date in summer = DST */
+ i2 = g_time_zone_find_interval (tz, G_TIME_TYPE_DAYLIGHT, 15000000);
+ g_assert_cmpstr (g_time_zone_get_abbreviation (tz, i1), ==, "PST");
+ g_assert_cmpint (g_time_zone_get_offset (tz, i1), ==, - 8 * 3600);
+ g_assert (!g_time_zone_is_dst (tz, i1));
+ g_assert_cmpstr (g_time_zone_get_abbreviation (tz, i2), ==, "PDT");
+ g_assert_cmpint (g_time_zone_get_offset (tz, i2), ==,- 7 * 3600);
+ g_assert (g_time_zone_is_dst (tz, i2));
g_time_zone_unref (tz);
tz = g_time_zone_new_identifier ("PST8PDT6:32:15");
--
2.34.1

View File

@@ -0,0 +1,65 @@
From 27eb6eb01d5752c201dd2ec02f656463d12ebee0 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Fri, 18 Oct 2024 11:03:19 +0100
Subject: [PATCH 2/3] gdatetime test: Try to make PST8PDT test more obviously
correct
Instead of using timestamp 0 as a magic number (in this case interpreted
as 1970-01-01T00:00:00-08:00), calculate a timestamp from a recent
year/month/day in winter, in this case 2024-01-01T00:00:00-08:00.
Similarly, instead of using a timestamp 15 million seconds later
(1970-06-23T15:40:00-07:00), calculate a timestamp from a recent
year/month/day in summer, in this case 2024-07-01T00:00:00-07:00.
Signed-off-by: Simon McVittie <smcv@debian.org>
Upstream-Status: Backport
[https://github.com/GNOME/glib/commit/30e9cfa5733003cd1079e0e9e8a4bff1a191171a]
Signed-off-by: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
---
glib/tests/gdatetime.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index cfe00906d..22aa5112a 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -2649,19 +2649,16 @@ test_posix_parse (void)
/* This fails rules_from_identifier on Unix (though not on Windows)
* but passes anyway because PST8PDT is a zone name.
- *
- * Intervals i1 and i2 (rather than 0 and 1) are needed because in
- * recent tzdata, PST8PDT may be an alias for America/Los_Angeles,
- * and hence be aware that DST has not always existed.
- * https://bugs.debian.org/1084190
*/
tz = g_time_zone_new_identifier ("PST8PDT");
g_assert_nonnull (tz);
g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "PST8PDT");
/* a date in winter = non-DST */
- i1 = g_time_zone_find_interval (tz, G_TIME_TYPE_STANDARD, 0);
- /* approximately 6 months in seconds, i.e. a date in summer = DST */
- i2 = g_time_zone_find_interval (tz, G_TIME_TYPE_DAYLIGHT, 15000000);
+ gdt1 = g_date_time_new (tz, 2024, 1, 1, 0, 0, 0);
+ i1 = g_time_zone_find_interval (tz, G_TIME_TYPE_STANDARD, g_date_time_to_unix (gdt1));
+ /* a date in summer = DST */
+ gdt2 = g_date_time_new (tz, 2024, 7, 1, 0, 0, 0);
+ i2 = g_time_zone_find_interval (tz, G_TIME_TYPE_DAYLIGHT, g_date_time_to_unix (gdt2));
g_assert_cmpstr (g_time_zone_get_abbreviation (tz, i1), ==, "PST");
g_assert_cmpint (g_time_zone_get_offset (tz, i1), ==, - 8 * 3600);
g_assert (!g_time_zone_is_dst (tz, i1));
@@ -2669,6 +2666,8 @@ test_posix_parse (void)
g_assert_cmpint (g_time_zone_get_offset (tz, i2), ==,- 7 * 3600);
g_assert (g_time_zone_is_dst (tz, i2));
g_time_zone_unref (tz);
+ g_date_time_unref (gdt1);
+ g_date_time_unref (gdt2);
tz = g_time_zone_new_identifier ("PST8PDT6:32:15");
#ifdef G_OS_WIN32
--
2.34.1

View File

@@ -0,0 +1,63 @@
From 9dd5e9f49620f13a3eaf2b862b7aa3c680953f01 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Fri, 18 Oct 2024 11:23:42 +0100
Subject: [PATCH 3/3] gdatetime test: Fall back if legacy System V PST8PDT is
not available
On recent versions of Debian, PST8PDT is part of the tzdata-legacy
package, which is not always installed and might disappear in future.
Successfully tested with and without tzdata-legacy on Debian unstable.
Signed-off-by: Simon McVittie <smcv@debian.org>
Upstream-Status: Backport
[https://github.com/GNOME/glib/commit/fe2699369f79981dcf913af4cfd98b342b84a9c1]
Signed-off-by: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
---
glib/tests/gdatetime.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index 22aa5112a..4e963b171 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -2626,6 +2626,7 @@ test_posix_parse (void)
GTimeZone *tz;
GDateTime *gdt1, *gdt2;
gint i1, i2;
+ const char *expect_id;
/* Check that an unknown zone name falls back to UTC. */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -2648,11 +2649,25 @@ test_posix_parse (void)
g_time_zone_unref (tz);
/* This fails rules_from_identifier on Unix (though not on Windows)
- * but passes anyway because PST8PDT is a zone name.
+ * but can pass anyway because PST8PDT is a legacy System V zone name.
*/
tz = g_time_zone_new_identifier ("PST8PDT");
+ expect_id = "PST8PDT";
+
+#ifndef G_OS_WIN32
+ /* PST8PDT is in tzdata's "backward" set, packaged as tzdata-legacy and
+ * not always present in some OSs; fall back to the equivalent geographical
+ * name if the "backward" time zones are absent. */
+ if (tz == NULL)
+ {
+ g_test_message ("Legacy PST8PDT time zone not available, falling back");
+ tz = g_time_zone_new_identifier ("America/Los_Angeles");
+ expect_id = "America/Los_Angeles";
+ }
+#endif
+
g_assert_nonnull (tz);
- g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, "PST8PDT");
+ g_assert_cmpstr (g_time_zone_get_identifier (tz), ==, expect_id);
/* a date in winter = non-DST */
gdt1 = g_date_time_new (tz, 2024, 1, 1, 0, 0, 0);
i1 = g_time_zone_find_interval (tz, G_TIME_TYPE_STANDARD, g_date_time_to_unix (gdt1));
--
2.34.1

View File

@@ -0,0 +1,361 @@
From ce840b6b111e1e109e511f6833d6aa419e2b723a Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip@tecnocode.co.uk>
Date: Tue, 23 Jan 2024 11:16:52 +0000
Subject: [PATCH] Merge branch '2887-memory-monitor-tests' into 'main'
tests: Fix race condition in memory-monitor-dbus.test
Closes #2887
See merge request GNOME/glib!3844
Hopefully these commits fix the occasional failures we've been seeing:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15362
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
gio/tests/memory-monitor-dbus.py.in | 64 +++++++++++++-------
gio/tests/memory-monitor-portal.py.in | 54 ++++++++++-------
gio/tests/power-profile-monitor-dbus.py.in | 35 ++++++-----
gio/tests/power-profile-monitor-portal.py.in | 34 ++++++-----
4 files changed, 113 insertions(+), 74 deletions(-)
diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in
index bf32918..7aae01e 100755
--- a/gio/tests/memory-monitor-dbus.py.in
+++ b/gio/tests/memory-monitor-dbus.py.in
@@ -16,7 +16,6 @@ import sys
import subprocess
import fcntl
import os
-import time
import taptestrunner
@@ -57,53 +56,74 @@ try:
fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
self.last_warning = -1
self.dbusmock = dbus.Interface(self.obj_lmm, dbusmock.MOCK_IFACE)
+
+ try:
+ self.wait_for_bus_object('org.freedesktop.LowMemoryMonitor',
+ '/org/freedesktop/LowMemoryMonitor',
+ system_bus=True)
+ except:
+ raise
+
self.memory_monitor = Gio.MemoryMonitor.dup_default()
+ assert("GMemoryMonitorDBus" in str(self.memory_monitor))
self.memory_monitor.connect("low-memory-warning", self.memory_warning_cb)
self.mainloop = GLib.MainLoop()
self.main_context = self.mainloop.get_context()
+ # The LowMemoryMonitor API is stateless: it doesnt expose any
+ # properties, just a warning signal. Emit the signal in a loop until
+ # the GMemoryMonitor instance has initialised and synchronised to
+ # the right state.
+ def emit_warning(level):
+ self.dbusmock.EmitWarning(level)
+ return GLib.SOURCE_CONTINUE
+
+ idle_id = GLib.idle_add(emit_warning, 0)
+ while self.last_warning != 0:
+ self.main_context.iteration(True)
+ GLib.source_remove(idle_id)
+
def tearDown(self):
self.p_mock.terminate()
self.p_mock.wait()
- def assertEventually(self, condition, message=None, timeout=50):
+ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
- while timeout >= 0:
- context = GLib.MainContext.default()
- while context.iteration(False):
- pass
- if condition():
- break
- timeout -= 1
- time.sleep(0.1)
- else:
- self.fail(message or 'timed out waiting for ' + str(condition))
+ if not message:
+ message = 'timed out waiting for ' + str(condition)
+
+ def timed_out_cb(message):
+ self.fail(message)
+ return GLib.SOURCE_REMOVE
+
+ timeout_source = GLib.timeout_source_new_seconds(timeout)
+ timeout_source.set_callback(timed_out_cb, message)
+ timeout_source.attach(self.main_context)
+
+ while not condition():
+ self.main_context.iteration(True)
+
+ timeout_source.destroy()
def memory_warning_cb(self, monitor, level):
+ print("Received memory warning signal, level", level)
self.last_warning = level
self.main_context.wakeup()
def test_low_memory_warning_signal(self):
'''LowMemoryWarning signal'''
- # Wait 2 seconds
- timeout = 2
- while timeout > 0:
- time.sleep(0.5)
- timeout -= 0.5
- self.main_context.iteration(False)
-
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
- self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20)
+ self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 2)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
- self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20)
+ self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 2)
except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
diff --git a/gio/tests/memory-monitor-portal.py.in b/gio/tests/memory-monitor-portal.py.in
index 748cee8..f570508 100755
--- a/gio/tests/memory-monitor-portal.py.in
+++ b/gio/tests/memory-monitor-portal.py.in
@@ -16,7 +16,6 @@ import sys
import subprocess
import fcntl
import os
-import time
import taptestrunner
@@ -80,26 +79,44 @@ try:
self.mainloop = GLib.MainLoop()
self.main_context = self.mainloop.get_context()
+ # The LowMemoryMonitor API is stateless: it doesnt expose any
+ # properties, just a warning signal. Emit the signal in a loop until
+ # the GMemoryMonitor instance has initialised and synchronised to
+ # the right state.
+ def emit_warning(level):
+ self.dbusmock.EmitWarning(level)
+ return GLib.SOURCE_CONTINUE
+
+ idle_id = GLib.idle_add(self.emit_warning, 0)
+ while self.last_warning != 0:
+ self.main_context.iteration(True)
+ GLib.source_remove(idle_id)
+
def tearDown(self):
self.p_mock.terminate()
self.p_mock.wait()
- def assertEventually(self, condition, message=None, timeout=50):
+ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
- while timeout >= 0:
- context = GLib.MainContext.default()
- while context.iteration(False):
- pass
- if condition():
- break
- timeout -= 1
- time.sleep(0.1)
- else:
- self.fail(message or 'timed out waiting for ' + str(condition))
+ if not message:
+ message = 'timed out waiting for ' + str(condition)
+
+ def timed_out_cb(message):
+ self.fail(message)
+ return GLib.SOURCE_REMOVE
+
+ timeout_source = GLib.timeout_source_new_seconds(timeout)
+ timeout_source.set_callback(timed_out_cb, message)
+ timeout_source.attach(self.main_context)
+
+ while not condition():
+ self.main_context.iteration(True)
+
+ timeout_source.destroy()
def portal_memory_warning_cb(self, monitor, level):
self.last_warning = level
@@ -108,20 +125,13 @@ try:
def test_low_memory_warning_portal_signal(self):
'''LowMemoryWarning signal'''
- # Wait 2 seconds
- timeout = 2
- while timeout > 0:
- time.sleep(0.5)
- timeout -= 0.5
- self.main_context.iteration(False)
-
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
- self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20)
+ self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 2)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
- self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20)
+ self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 2)
except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
diff --git a/gio/tests/power-profile-monitor-dbus.py.in b/gio/tests/power-profile-monitor-dbus.py.in
index 06e594f..f955afc 100755
--- a/gio/tests/power-profile-monitor-dbus.py.in
+++ b/gio/tests/power-profile-monitor-dbus.py.in
@@ -16,7 +16,6 @@ import sys
import subprocess
import fcntl
import os
-import time
import taptestrunner
@@ -58,6 +57,7 @@ try:
self.power_saver_enabled = False
self.dbus_props = dbus.Interface(self.obj_ppd, dbus.PROPERTIES_IFACE)
self.power_profile_monitor = Gio.PowerProfileMonitor.dup_default()
+ assert("GPowerProfileMonitorDBus" in str(self.power_profile_monitor))
self.power_profile_monitor.connect("notify::power-saver-enabled", self.power_saver_enabled_cb)
self.mainloop = GLib.MainLoop()
self.main_context = self.mainloop.get_context()
@@ -66,22 +66,27 @@ try:
self.p_mock.terminate()
self.p_mock.wait()
- def assertEventually(self, condition, message=None, timeout=50):
+ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
- while timeout >= 0:
- context = GLib.MainContext.default()
- while context.iteration(False):
- pass
- if condition():
- break
- timeout -= 1
- time.sleep(0.1)
- else:
- self.fail(message or 'timed out waiting for ' + str(condition))
+ if not message:
+ message = 'timed out waiting for ' + str(condition)
+
+ def timed_out_cb(message):
+ self.fail(message)
+ return GLib.SOURCE_REMOVE
+
+ timeout_source = GLib.timeout_source_new_seconds(timeout)
+ timeout_source.set_callback(timed_out_cb, message)
+ timeout_source.attach(self.main_context)
+
+ while not condition():
+ self.main_context.iteration(True)
+
+ timeout_source.destroy()
def power_saver_enabled_cb(self, spec, data):
self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled()
@@ -92,10 +97,10 @@ try:
self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1))
- self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10)
+ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 1)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1))
- self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10)
+ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 1)
except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
diff --git a/gio/tests/power-profile-monitor-portal.py.in b/gio/tests/power-profile-monitor-portal.py.in
index 09e9a45..ad2abf6 100755
--- a/gio/tests/power-profile-monitor-portal.py.in
+++ b/gio/tests/power-profile-monitor-portal.py.in
@@ -16,7 +16,6 @@ import sys
import subprocess
import fcntl
import os
-import time
import taptestrunner
@@ -90,22 +89,27 @@ try:
self.p_mock.terminate()
self.p_mock.wait()
- def assertEventually(self, condition, message=None, timeout=50):
+ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
- while timeout >= 0:
- context = GLib.MainContext.default()
- while context.iteration(False):
- pass
- if condition():
- break
- timeout -= 1
- time.sleep(0.1)
- else:
- self.fail(message or 'timed out waiting for ' + str(condition))
+ if not message:
+ message = 'timed out waiting for ' + str(condition)
+
+ def timed_out_cb(message):
+ self.fail(message)
+ return GLib.SOURCE_REMOVE
+
+ timeout_source = GLib.timeout_source_new_seconds(timeout)
+ timeout_source.set_callback(timed_out_cb, message)
+ timeout_source.attach(self.main_context)
+
+ while not condition():
+ self.main_context.iteration(True)
+
+ timeout_source.destroy()
def power_saver_enabled_cb(self, spec, data):
self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled()
@@ -116,10 +120,10 @@ try:
self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1))
- self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10)
+ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 1)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1))
- self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10)
+ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 1)
def test_power_profile_power_saver_enabled_portal_default(self):
'''power-saver-enabled property default value'''

View File

@@ -0,0 +1,3 @@
[properties]
# On all known supported architectures the stack grows down
growing_stack = false

View File

@@ -0,0 +1,6 @@
[properties]
have_c99_vsnprintf = true
have_c99_snprintf = true
have_unix98_printf = true
va_val_copy = true
have_strlcpy = true

View File

@@ -0,0 +1,5 @@
[properties]
have_proc_self_cmdline = true
[binaries]
env = '/usr/bin/env'

View File

@@ -0,0 +1,6 @@
[properties]
have_c99_vsnprintf = false
have_c99_snprintf = false
have_unix98_printf = false
va_val_copy = true
have_proc_self_cmdline = false

View File

@@ -0,0 +1,6 @@
[properties]
have_c99_vsnprintf = true
have_c99_snprintf = true
have_unix98_printf = true
va_val_copy = true
have_strlcpy = true

View File

@@ -0,0 +1,44 @@
From f40e89b3852df37959606ee13b1a14ade81fa886 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@intel.com>
Date: Fri, 11 Mar 2016 15:35:55 +0000
Subject: [PATCH] glib-2.0: relocate the GIO module directory for native builds
Instead of hard-coding GIO_MODULE_PATH when glib is built, use dladdr() to
determine where libglib.so is and use that path to calculate GIO_MODULES_DIR.
This solves relocation problems with GIOModule for native builds of glib.
Upstream-Status: Inappropriate
Signed-off-by: Ross Burton <ross.burton@intel.com>
Port patch to 2.48
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
gio/giomodule.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/gio/giomodule.c b/gio/giomodule.c
index 17fabe6..8021208 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -1271,11 +1271,6 @@ get_gio_module_dir (void)
g_free (install_dir);
#else
module_dir = g_strdup (GIO_MODULE_DIR);
-#ifdef __APPLE__
-#include "TargetConditionals.h"
-/* Only auto-relocate on macOS, not watchOS etc; older macOS SDKs only define TARGET_OS_MAC */
-#if (defined (TARGET_OS_OSX) && TARGET_OS_OSX) || \
- (!defined (TARGET_OS_OSX) && defined (TARGET_OS_MAC) && TARGET_OS_MAC)
#include <dlfcn.h>
{
g_autofree gchar *path = NULL;
@@ -1294,8 +1289,6 @@ get_gio_module_dir (void)
}
}
}
-#endif
-#endif
#endif
}

View File

@@ -0,0 +1,10 @@
#! /bin/sh
set -eux
if id -u glib2-test; then
userdel glib2-test
fi
useradd glib2-test
cd /tmp
su glib2-test -c 'G_TEST_TMPDIR=`readlink -f /tmp` gnome-desktop-testing-runner glib'
userdel glib2-test

View File

@@ -0,0 +1,32 @@
From bb11d1a4ae77d93ec0743e54077cf0f990243fa6 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Thu, 28 Mar 2024 16:27:09 +0000
Subject: [PATCH] Skip /timeout/rounding test
This test is sensitive to load because it expects certain timeout operations
to succeed in specific time periods. Whilst these timeouts are fairly large,
they're still exceeded inside a qemu on a loaded system.
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14464
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
glib/tests/timeout.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/glib/tests/timeout.c b/glib/tests/timeout.c
index 1ae3f3a34..85a715b0f 100644
--- a/glib/tests/timeout.c
+++ b/glib/tests/timeout.c
@@ -214,7 +214,6 @@ main (int argc, char *argv[])
g_test_add_func ("/timeout/seconds-once", test_seconds_once);
g_test_add_func ("/timeout/weeks-overflow", test_weeks_overflow);
g_test_add_func ("/timeout/far-future-ready-time", test_far_future_ready_time);
- g_test_add_func ("/timeout/rounding", test_rounding);
return g_test_run ();
}
--
2.34.1

View File

@@ -0,0 +1,68 @@
require glib.inc
PE = "1"
SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
file://run-ptest \
file://0001-Fix-DATADIRNAME-on-uclibc-Linux.patch \
file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
file://0010-Do-not-hardcode-python-path-into-various-tools.patch \
file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \
file://0001-Do-not-write-bindir-into-pkg-config-files.patch \
file://0001-meson-Run-atomics-test-on-clang-as-well.patch \
file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
file://0001-Switch-from-the-deprecated-distutils-module-to-the-p.patch \
file://memory-monitor.patch \
file://skip-timeout.patch \
file://CVE-2024-52533.patch \
file://gdatetime-test-fail-0001.patch \
file://gdatetime-test-fail-0002.patch \
file://gdatetime-test-fail-0003.patch \
file://CVE-2025-3360-01.patch \
file://CVE-2025-3360-02.patch \
file://CVE-2025-3360-03.patch \
file://CVE-2025-3360-04.patch \
file://CVE-2025-3360-05.patch \
file://CVE-2025-3360-06.patch \
file://CVE-2025-4373-01.patch \
file://CVE-2025-4373-02.patch \
"
SRC_URI:append:class-native = " file://relocate-modules.patch \
file://0001-meson.build-do-not-enable-pidfd-features-on-native-g.patch \
"
SRC_URI[sha256sum] = "244854654dd82c7ebcb2f8e246156d2a05eb9cd1ad07ed7a779659b4602c9fae"
# Find any meson cross files in FILESPATH that are relevant for the current
# build (using siteinfo) and add them to EXTRA_OEMESON.
inherit siteinfo
def find_meson_cross_files(d):
if bb.data.inherits_class('native', d):
return ""
thisdir = os.path.normpath(d.getVar("THISDIR"))
import collections
sitedata = siteinfo_data(d)
# filename -> found
files = collections.OrderedDict()
for path in d.getVar("FILESPATH").split(":"):
for element in sitedata:
filename = os.path.normpath(os.path.join(path, "meson.cross.d", element))
sanitized_path = filename.replace(thisdir, "${THISDIR}")
if sanitized_path == filename:
if os.path.exists(filename):
bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir))
continue
files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename)
items = ["--cross-file=" + k for k,v in files.items() if v]
d.appendVar("EXTRA_OEMESON", " " + " ".join(items))
items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()]
d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items))
python () {
find_meson_cross_files(d)
}

View File

@@ -0,0 +1,206 @@
SUMMARY = "A general-purpose utility library"
DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on."
HOMEPAGE = "https://developer.gnome.org/glib/"
# pcre is under BSD;
# docs/reference/COPYING is with a 'public domain'-like license!
LICENSE = "LGPL-2.1-or-later & BSD-3-Clause & PD"
LIC_FILES_CHKSUM = "file://COPYING;md5=41890f71f740302b785c27661123bff5 \
file://glib/glib.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \
file://LICENSES/LGPL-2.1-or-later.txt;md5=41890f71f740302b785c27661123bff5 \
file://gmodule/gmodule.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \
file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc"
BUGTRACKER = "http://bugzilla.gnome.org"
SECTION = "libs"
CVE_PRODUCT = "glib"
BBCLASSEXTEND = "native nativesdk"
DEPENDS = "glib-2.0-native \
virtual/libintl \
virtual/libiconv \
libffi \
libpcre2 \
zlib"
PACKAGES += "${PN}-codegen ${PN}-utils"
LEAD_SONAME = "libglib-2.0.*"
inherit meson gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages gobject-introspection-data
GTKDOC_MESON_OPTION = "gtk_doc"
S = "${WORKDIR}/glib-${PV}"
PACKAGECONFIG ??= "libmount \
${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux"
PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native"
PACKAGECONFIG[libelf] = "-Dlibelf=enabled,-Dlibelf=disabled,elfutils"
PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,"
PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux"
EXTRA_OEMESON = "-Ddtrace=false -Dsystemtap=false"
do_configure:prepend() {
sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
}
FILES:${PN} = "${libdir}/lib*${SOLIBS} \
${libdir}/gio \
${libexecdir}/*gio-querymodules \
${libexecdir}/*gio-launch-desktop \
${datadir}/glib-2.0/dtds \
${datadir}/glib-2.0/schemas"
FILES:${PN}-dev += "${libdir}/glib-2.0/include \
${libdir}/gio/modules/lib*${SOLIBSDEV} \
${libdir}/gio/modules/*.la \
${datadir}/glib-2.0/gettext/po/Makefile.in.in \
${datadir}/glib-2.0/schemas/gschema.dtd \
${datadir}/glib-2.0/valgrind/glib.supp \
${datadir}/gettext/its"
FILES:${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb"
FILES:${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \
${bindir}/gdbus-codegen"
FILES:${PN}-utils = "${bindir}/*"
SHAREDMIMEDEP = "shared-mime-info"
SHAREDMIMEDEP:class-native = ""
# When cross compiling for Windows we don't want to include this
SHAREDMIMEDEP:mingw32 = ""
RRECOMMENDS:${PN} += "${SHAREDMIMEDEP}"
ARM_INSTRUCTION_SET:armv4 = "arm"
ARM_INSTRUCTION_SET:armv5 = "arm"
# Valgrind runtime detection works using hand-written assembly, which
# doesn't support mips16e
CPPFLAGS:append:class-target:mips16e = " -DNVALGRIND=1"
# GLib generally requires gettext to be present so for USE_NLS to yes. For
# native builds as i18n is disabled globally we have to add a gettext-native dependency.
USE_NLS:class-target = "yes"
USE_NLS:class-nativesdk = "yes"
DEPENDS:append:class-native = " gettext-native"
EXEEXT = ""
EXEEXT:mingw32 = ".exe"
do_install:append () {
if [ -f ${D}${bindir}/gtester-report ]; then
sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|'
fi
# Remove some unpackaged files
rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__
rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
if [ -e ${D}${libdir}/charset.alias ]; then
rm -f ${D}${libdir}/charset.alias
fi
# Make sure gio-querymodules is unique among multilibs
if test "x${MLPREFIX}" != "x"; then
mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT}
fi
# Autotools does this, meson does not
mkdir -p ${D}${libdir}/gio/modules
}
do_install:append:class-native () {
# Link gio-querymodules into ${bindir} as otherwise tools like meson won't find it
ln -rs ${D}${libexecdir}/gio-querymodules ${D}${bindir}
}
do_install:append:class-target () {
# Tests are only installed on targets, not native builds. Separating this out
# keeps glib-2.0-native from depending on DISTRO_FEATURES
if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then
if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then
rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
fi
fi
if [ -f ${D}${datadir}/installed-tests/glib/static-link.test ]; then
if test "x${MLPREFIX}" != "x"; then
mv ${D}${datadir}/installed-tests/glib/static-link.test ${D}${datadir}/installed-tests/glib/${MLPREFIX}static-link.test
fi
fi
# https://gitlab.gnome.org/GNOME/glib/-/issues/2810
rm -f ${D}${datadir}/installed-tests/glib/thread-pool-slow.test
}
do_install:append:class-target:libc-musl () {
# Remove failing tests on musl libc systems, this helps set baseline for musl testing
# they remain to be rootcaused and fixed but marked known failures here.
for t in convert.test collate.test gdatetime.test date.test converter-stream.test option-context.test; do
rm -rf ${D}${datadir}/installed-tests/glib/$t
done
}
# As we do not build python3 for windows, makes no sense to ship the script that's using it
do_install:append:mingw32() {
rm -f ${D}${bindir}/gtester-report
}
CODEGEN_PYTHON_RDEPENDS = "python3 python3-packaging python3-xml"
CODEGEN_PYTHON_RDEPENDS:mingw32 = ""
RDEPENDS:${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}"
RDEPENDS:${PN}-ptest += "${PN}-utils"
RDEPENDS:${PN}-ptest += "\
coreutils \
libgcc \
dbus \
desktop-file-utils \
gnome-desktop-testing \
tzdata \
tzdata-americas \
tzdata-asia \
tzdata-europe \
tzdata-posix \
shared-mime-info \
${PN}-locale-ja \
${PN}-locale-fr \
${PN}-locale-el \
${PN}-locale-hr \
${PN}-locale-lt \
${PN}-locale-pl \
${PN}-locale-ru \
${PN}-locale-th \
python3-core \
python3-modules \
${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-dbusmock', '', d)} \
${PN}-codegen \
locale-base-de-de \
locale-base-es-es \
locale-base-en-gb \
locale-base-en-us \
locale-base-fr-fr \
locale-base-ru-ru \
"
RDEPENDS:${PN}-ptest:append:libc-glibc = "\
glibc-gconv-utf-16 \
glibc-charmap-utf-8 \
glibc-gconv-cp1255 \
glibc-charmap-cp1255 \
glibc-gconv-utf-32 \
glibc-gconv-utf-7 \
glibc-gconv-euc-jp \
glibc-gconv-iso8859-1 \
glibc-gconv-iso8859-15 \
glibc-charmap-invariant \
glibc-localedata-translit-cjk-variants \
locale-base-lt-lt \
locale-base-ja-jp.euc-jp \
locale-base-fa-ir \
locale-base-hr-hr \
locale-base-el-gr \
locale-base-pl-pl \
locale-base-pl-pl.iso-8859-2 \
locale-base-tr-tr \
"