summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch
diff options
context:
space:
mode:
authorZheng Junjie <z572@z572.online>2025-02-06 23:59:21 +0800
committerAndreas Enge <andreas@enge.fr>2025-07-18 20:17:28 +0200
commit3ac9be2a5c1efa8fc994305232b00962e33d2dfb (patch)
treed55b949e19440872e8e4d16e39aa1cf48eb80a2b /gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch
parent700529a4e148a9db8f799e7818540d7732e66542 (diff)
gnu: glibc: update to 2.41.
* gnu/packages/base.scm (glibc): Update to 2.41. (%glibc-patches): update it. (glibc/hurd)[sources]<patches>: Adjust it. * gnu/packages/patches/glibc-2.37-hurd-local-clock_gettime_MONOTONIC.patch: Rename to... glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch: ...this, and update. * gnu/packages/patches/glibc-2.28-ldd-x86_64.patch: Rename to ... * glibc-2.41-ldd-x86_64.patch: ...this, and update. * gnu/packages/patches/glibc-2.40-CVE-2025-0.patch, gnu/packages/patches/glibc-hurd64-fault.patch, gnu/packages/patches/glibc-hurd64-sgms-context.patch: Remove. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch: Update for glibc-2.41. * gnu/packages/make-bootstrap.scm (glibc-for-bootstrap): Update it. * gnu/packages/patches/glibc-2.39-bootstrap-system.patch: Rename to... * glibc-2.41-bootstrap-system.patch: ...this, and update. * gnu/local.mk (dist_patch_DATA): Update accordingly. Change-Id: I51c12e3e8fa91dac340571e07a90d6220e0dc6ae
Diffstat (limited to 'gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch')
-rw-r--r--gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch87
1 files changed, 87 insertions, 0 deletions
diff --git a/gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch b/gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch
new file mode 100644
index 0000000000..7af04e2d73
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch
@@ -0,0 +1,87 @@
+Taken from: https://salsa.debian.org/glibc-team/glibc/-/blob/9ce19663f00176f30d6eab29fd14db3e7cd53dcf/debian/patches/hurd-i386/local-clock_gettime_MONOTONIC.diff
+
+Use the realtime clock for the monotonic clock. This is of course not a proper
+implementation (which is being done in Mach), but will permit to fix at least
+the iceweasel stack.
+
+vlc however doesn't build when _POSIX_CLOCK_SELECTION is enabled but
+_POSIX_TIMERS is not, and they refuse to fix that (see #765578), so disable the
+former.
+
+Adjust for glibc-2.41.
+
+---
+ sysdeps/mach/hurd/bits/posix_opt.h | 2 +-
+ sysdeps/unix/clock_gettime.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+Index: glibc-2.27/sysdeps/mach/clock_gettime.c
+===================================================================
+--- glibc-2.27.orig/sysdeps/mach/clock_gettime.c
++++ glibc-2.27/sysdeps/mach/clock_gettime.c
+@@ -31,6 +31,9 @@ __clock_gettime (clockid_t clock_id, str
+ switch (clock_id) {
+
+ case CLOCK_REALTIME:
++ case CLOCK_MONOTONIC_RAW:
++ case CLOCK_REALTIME_COARSE:
++ case CLOCK_MONOTONIC_COARSE:
+ {
+ /* __host_get_time can only fail if passed an invalid host_t.
+ __mach_host_self could theoretically fail (producing an
+Index: glibc-2.27/rt/timer_create.c
+===================================================================
+--- glibc-2.27.orig/rt/timer_create.c
++++ glibc-2.27/rt/timer_create.c
+@@ -48,7 +48,7 @@ timer_create (clockid_t clock_id, struct
+ return -1;
+ }
+
+- if (clock_id != CLOCK_REALTIME)
++ if (clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_MONOTONIC_RAW && clock_id != CLOCK_REALTIME_COARSE && clock_id != CLOCK_MONOTONIC_COARSE)
+ {
+ __set_errno (EINVAL);
+ return -1;
+Index: glibc-2.27/sysdeps/mach/hurd/bits/posix_opt.h
+===================================================================
+--- glibc-2.27.orig/sysdeps/mach/hurd/bits/posix_opt.h
++++ glibc-2.27/sysdeps/mach/hurd/bits/posix_opt.h
+@@ -163,10 +163,10 @@
+ #define _POSIX_THREAD_PROCESS_SHARED -1
+
+ /* The monotonic clock might be available. */
+ #define _POSIX_MONOTONIC_CLOCK 200809L
+
+-/* The clock selection interfaces are available. */
+-#define _POSIX_CLOCK_SELECTION 200809L
++/* The clock selection interfaces are not really available yet. */
++#define _POSIX_CLOCK_SELECTION -1
+
+ /* Advisory information interfaces could be available in future. */
+ #define _POSIX_ADVISORY_INFO 0
+Index: glibc-upstream/sysdeps/posix/clock_getres.c
+===================================================================
+--- glibc-upstream.orig/sysdeps/posix/clock_getres.c
++++ glibc-upstream/sysdeps/posix/clock_getres.c
+@@ -52,6 +52,10 @@ __clock_getres (clockid_t clock_id, stru
+ switch (clock_id)
+ {
+ case CLOCK_REALTIME:
++ case CLOCK_MONOTONIC:
++ case CLOCK_MONOTONIC_RAW:
++ case CLOCK_REALTIME_COARSE:
++ case CLOCK_MONOTONIC_COARSE:
+ retval = realtime_getres (res);
+ break;
+
+--- ./sysdeps/mach/clock_nanosleep.c.original 2020-07-21 00:31:35.226113142 +0200
++++ ./sysdeps/mach/clock_nanosleep.c 2020-07-21 00:31:49.026185761 +0200
+@@ -62,8 +62,8 @@
+ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
+ struct timespec *rem)
+ {
+- if ((clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC)
++ if ((clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_MONOTONIC_RAW && clock_id != CLOCK_REALTIME_COARSE && clock_id != CLOCK_MONOTONIC_COARSE)
+ || req->tv_sec < 0
+ || !valid_nanoseconds (req->tv_nsec)
+ || (flags != 0 && flags != TIMER_ABSTIME))
+ return EINVAL;