glib: update to 2.80.3.

This commit is contained in:
oreo639 2024-06-18 11:53:04 -07:00 committed by oreo639
parent bddd7e2881
commit d77119b5c5
4 changed files with 4 additions and 175 deletions

View file

@ -1,47 +0,0 @@
From 014f12bb095382770f000055f63f82e2903f6b33 Mon Sep 17 00:00:00 2001
From: q66 <q66@chimera-linux.org>
Date: Sat, 23 Mar 2024 20:51:52 +0100
Subject: [PATCH] Use CPU_COUNT to get the number of set CPUs
This fixes an issue with the number getting very big due to
CPU_ISSET not returning exactly 0 or 1.
This also fixes scenarios where there are holes in the CPU
set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
the old code would return 2 instead of 3, due to iterating
until `ncores` (which is 3) and therefore not accounting for
CPUs further in the set.
Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
(cherry picked from commit cc25486b233ada380ac8452f47f5fb35536888f4)
---
glib/gthread.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/glib/gthread.c b/glib/gthread.c
index b39acc475c..a264353ecb 100644
--- a/glib/gthread.c
+++ b/glib/gthread.c
@@ -1092,7 +1092,6 @@ g_get_num_processors (void)
return count;
#elif defined(_SC_NPROCESSORS_ONLN) && defined(THREADS_POSIX) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
{
- int idx;
int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
cpu_set_t cpu_mask;
CPU_ZERO (&cpu_mask);
@@ -1100,8 +1099,7 @@ g_get_num_processors (void)
int af_count = 0;
int err = pthread_getaffinity_np (pthread_self (), sizeof (cpu_mask), &cpu_mask);
if (!err)
- for (idx = 0; idx < ncores && idx < CPU_SETSIZE; ++idx)
- af_count += CPU_ISSET (idx, &cpu_mask);
+ af_count = CPU_COUNT (&cpu_mask);
int count = (af_count > 0) ? af_count : ncores;
return count;
--
GitLab

View file

@ -1,33 +0,0 @@
From d2a6c379e85bacc89a7a8468f7e8447c8df15785 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 15 Mar 2024 13:49:47 +0000
Subject: [PATCH] girparser: Don't assume sizeof(size_t) == sizeof(void *)
We don't actually need to use the results of configure-time checks here:
sizeof is a perfectly reasonable integer constant expression, so we can
use that directly.
Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
girepository/girparser.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 647cf2498d..b5d8fc7108 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -459,8 +459,8 @@ static IntegerAliasInfo integer_aliases[] = {
{ "gulong", SIZEOF_LONG, 0 },
{ "gssize", GLIB_SIZEOF_SIZE_T, 1 },
{ "gsize", GLIB_SIZEOF_SIZE_T, 0 },
- { "gintptr", GLIB_SIZEOF_SIZE_T, 1 },
- { "guintptr", GLIB_SIZEOF_SIZE_T, 0 },
+ { "gintptr", sizeof (gintptr), 1 },
+ { "guintptr", sizeof (guintptr), 0 },
};
typedef struct {
--
GitLab

View file

@ -1,91 +0,0 @@
From fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 15 Mar 2024 13:56:20 +0000
Subject: [PATCH] girparser: Allow time_t, off_t, etc. to appear in GIR XML
g-ir-scanner currently maps these to lower-level types at scan time by
assuming that time_t is an alias for long, off_t is an alias for size_t
and so on. This is not always accurate: some ILP32 architectures have
64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file
support), and that mismatch is tracked as GNOME/gobject-introspection#494.
One option for resolving this g-ir-scanner bug is to have it pass these
types through to the GIR XML, and teach g-ir-compiler and its replacement
gi-compile-repository to convert them to the corresponding concrete
type tag, as they already do for abstract types such as `long long` and
`size_t`.
Loosely based on GNOME/gobject-introspection!451 by Shuyu Liu.
Co-authored-by: Shuyu Liu <liushuyu011@gmail.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
girepository/girparser.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/girepository/girparser.c b/girepository/girparser.c
index b5d8fc7108..9667900826 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -32,6 +32,12 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <time.h> /* For time_t */
+#include <sys/types.h> /* For off_t on both Unix and Windows */
+
+#ifdef G_OS_UNIX
+#include <sys/socket.h> /* For socklen_t */
+#endif
/* This is a "major" version in the sense that it's only bumped
* for incompatible changes.
@@ -448,6 +454,19 @@ typedef struct {
unsigned int is_signed : 1;
} IntegerAliasInfo;
+/* Ignore warnings from use of signedness() */
+#if G_GNUC_CHECK_VERSION(4, 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wtype-limits"
+#elif defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtype-limits"
+#endif
+
+#define signedness(T) (((T) -1) < 0)
+G_STATIC_ASSERT (signedness (int) == 1);
+G_STATIC_ASSERT (signedness (unsigned int) == 0);
+
static IntegerAliasInfo integer_aliases[] = {
{ "gchar", SIZEOF_CHAR, 1 },
{ "guchar", SIZEOF_CHAR, 0 },
@@ -461,8 +480,25 @@ static IntegerAliasInfo integer_aliases[] = {
{ "gsize", GLIB_SIZEOF_SIZE_T, 0 },
{ "gintptr", sizeof (gintptr), 1 },
{ "guintptr", sizeof (guintptr), 0 },
+#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
+ INTEGER_ALIAS (off_t),
+ INTEGER_ALIAS (time_t),
+#ifdef G_OS_UNIX
+ INTEGER_ALIAS (dev_t),
+ INTEGER_ALIAS (gid_t),
+ INTEGER_ALIAS (pid_t),
+ INTEGER_ALIAS (socklen_t),
+ INTEGER_ALIAS (uid_t),
+#endif
+#undef INTEGER_ALIAS
};
+#if G_GNUC_CHECK_VERSION(4, 6)
+#pragma GCC diagnostic pop
+#elif defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
typedef struct {
const char *str;
int tag;
--
GitLab

View file

@ -1,7 +1,7 @@
# Template file for 'glib'
# keep in sync with glib-bootstrap
pkgname=glib
version=2.80.0
version=2.80.3
revision=1
build_style=meson
build_helper=qemu
@ -17,10 +17,10 @@ short_desc="GNU library of C routines"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/GLib"
#changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
changelog="https://gitlab.gnome.org/GNOME/glib/raw/glib-2-80/NEWS"
#changelog="https://gitlab.gnome.org/GNOME/glib/raw/main/NEWS"
distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
checksum=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d
checksum=3947a0eaddd0f3613d0230bb246d0c69e46142c19022f5c4b1b2e3cba236d417
conflicts="gir-freedesktop<1.80.0_1" # glib typelibs are now in glib
make_check_pre="dbus-run-session"