diff options
| author | Yelninei <yelninei@tutamail.com> | 2025-05-16 08:28:07 +0000 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2025-07-18 20:17:33 +0200 |
| commit | 6cebf0e1d5e13ce6010aace03a3d1d4a1071d49a (patch) | |
| tree | fbd584625c1234f821c5cdd5dd9dfe7023dfc886 /gnu/packages | |
| parent | 635da6eb693ebd974a2bced5162160015ec0bdb2 (diff) | |
gnu: glibc/hurd: Fix gnulib tests.
With glibc-2.41 several gnulib tests are failing on the Hurd in multiple core packages
- test-once1
- test-pthread_sigmask1
- test-symlink/test-symlinkat
This adds the relevant patches from glibc upstream or the version from the
debian glibc adapted for glibc 2.41.
* gnu/packages/patches/glibc-hurd-2.41-pthread-once.patch: New patch.
* gnu/packages/patches/glibc-hurd-2.41-pthread-sigmask.patch: New patch.
* gnu/packages/patches/glibc-hurd-2.41-symlink.patch: New patch.
* gnu/packages/base.scm (glibc/hurd): Add them.
* gnu/local.mk : Register them.
Change-Id: I90ec984757da54ebbc7cb7817de00f2876f4a81a
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/base.scm | 3 | ||||
| -rw-r--r-- | gnu/packages/patches/glibc-hurd-2.41-pthread-once.patch | 185 | ||||
| -rw-r--r-- | gnu/packages/patches/glibc-hurd-2.41-pthread-sigmask.patch | 22 | ||||
| -rw-r--r-- | gnu/packages/patches/glibc-hurd-2.41-symlink.patch | 32 |
4 files changed, 242 insertions, 0 deletions
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index e606d42f4b8..f4bd25177a1 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm | |||
| @@ -1662,6 +1662,9 @@ command.") | |||
| 1662 | (patches | 1662 | (patches |
| 1663 | (append (origin-patches (package-source glibc)) | 1663 | (append (origin-patches (package-source glibc)) |
| 1664 | (search-patches "glibc-hurd-pthread_setcancelstate.patch" | 1664 | (search-patches "glibc-hurd-pthread_setcancelstate.patch" |
| 1665 | "glibc-hurd-2.41-pthread-once.patch" | ||
| 1666 | "glibc-hurd-2.41-pthread-sigmask.patch" | ||
| 1667 | "glibc-hurd-2.41-symlink.patch" | ||
| 1665 | "glibc-hurd64-intr-msg-clobber.patch" | 1668 | "glibc-hurd64-intr-msg-clobber.patch" |
| 1666 | "glibc-hurd64-gcc-14.2-tls-bug.patch"))))))) | 1669 | "glibc-hurd64-gcc-14.2-tls-bug.patch"))))))) |
| 1667 | 1670 | ||
diff --git a/gnu/packages/patches/glibc-hurd-2.41-pthread-once.patch b/gnu/packages/patches/glibc-hurd-2.41-pthread-once.patch new file mode 100644 index 00000000000..ba345b361e5 --- /dev/null +++ b/gnu/packages/patches/glibc-hurd-2.41-pthread-once.patch | |||
| @@ -0,0 +1,185 @@ | |||
| 1 | Taken from: | ||
| 2 | https://salsa.debian.org/glibc-team/glibc/-/blob/22f0a9381fe844a5de92a57012833bec225a9686/debian/patches/hurd-i386/local-pthread_once.diff | ||
| 3 | This is glibc ccdb68e829a31e4cda8339ea0d2dc3e51fb81ba5 adapted for glibc 2.41 | ||
| 4 | |||
| 5 | Note: compared to upstream, this was changed to exposing pthread_once as version | ||
| 6 | 2.41. | ||
| 7 | |||
| 8 | commit ccdb68e829a31e4cda8339ea0d2dc3e51fb81ba5 | ||
| 9 | Author: Samuel Thibault <samuel.thibault@ens-lyon.org> | ||
| 10 | Date: Sun Mar 2 15:16:45 2025 +0100 | ||
| 11 | |||
| 12 | htl: move pthread_once into libc | ||
| 13 | |||
| 14 | diff --git a/htl/Makefile b/htl/Makefile | ||
| 15 | index 310097914f..603af24ce4 100644 | ||
| 16 | --- a/htl/Makefile | ||
| 17 | +++ b/htl/Makefile | ||
| 18 | @@ -31,7 +31,6 @@ libpthread-routines := \ | ||
| 19 | pt-key-delete \ | ||
| 20 | pt-getspecific \ | ||
| 21 | pt-setspecific \ | ||
| 22 | - pt-once \ | ||
| 23 | pt-alloc \ | ||
| 24 | pt-create \ | ||
| 25 | pt-getattr \ | ||
| 26 | @@ -186,6 +185,7 @@ routines := \ | ||
| 27 | pt-mutexattr-setrobust \ | ||
| 28 | pt-mutexattr-settype \ | ||
| 29 | pt-nthreads \ | ||
| 30 | + pt-once \ | ||
| 31 | pt-pthread_self \ | ||
| 32 | pt-self pt-equal \ | ||
| 33 | pt-setschedparam \ | ||
| 34 | diff --git a/htl/Versions b/htl/Versions | ||
| 35 | index 3d2cb4e7a4..a07a3b3708 100644 | ||
| 36 | --- a/htl/Versions | ||
| 37 | +++ b/htl/Versions | ||
| 38 | @@ -63,6 +63,7 @@ libc { | ||
| 39 | pthread_mutexattr_setprotocol; | ||
| 40 | pthread_mutexattr_setpshared; | ||
| 41 | pthread_mutexattr_settype; | ||
| 42 | + pthread_once; | ||
| 43 | pthread_sigmask; | ||
| 44 | } | ||
| 45 | |||
| 46 | @@ -158,6 +159,7 @@ libc { | ||
| 47 | pthread_mutexattr_setpshared; | ||
| 48 | pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np; | ||
| 49 | pthread_mutexattr_settype; | ||
| 50 | + pthread_once; | ||
| 51 | pthread_sigmask; | ||
| 52 | } | ||
| 53 | |||
| 54 | @@ -211,6 +213,7 @@ libc { | ||
| 55 | __pthread_mutexattr_destroy; | ||
| 56 | __pthread_mutexattr_init; | ||
| 57 | __pthread_mutexattr_settype; | ||
| 58 | + __pthread_once; | ||
| 59 | __pthread_sigstate; | ||
| 60 | __pthread_sigstate_destroy; | ||
| 61 | __pthread_sigmask; | ||
| 62 | @@ -264,8 +267,6 @@ libpthread { | ||
| 63 | pthread_mutex_timedlock; pthread_mutex_transfer_np; | ||
| 64 | pthread_mutex_trylock; pthread_mutex_unlock; | ||
| 65 | |||
| 66 | - pthread_once; | ||
| 67 | - | ||
| 68 | pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock; | ||
| 69 | pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock; | ||
| 70 | pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock; | ||
| 71 | diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h | ||
| 72 | index 5085570baa..092eb35831 100644 | ||
| 73 | --- a/sysdeps/htl/libc-lockP.h | ||
| 74 | +++ b/sysdeps/htl/libc-lockP.h | ||
| 75 | @@ -114,6 +114,7 @@ libc_hidden_proto (__pthread_rwlock_unlock) | ||
| 76 | |||
| 77 | extern int __pthread_once (pthread_once_t *__once_control, | ||
| 78 | void (*__init_routine) (void)); | ||
| 79 | +libc_hidden_proto (__pthread_once); | ||
| 80 | |||
| 81 | extern int __pthread_atfork (void (*__prepare) (void), | ||
| 82 | void (*__parent) (void), | ||
| 83 | @@ -128,7 +129,6 @@ libc_hidden_proto (__pthread_setcancelstate) | ||
| 84 | weak_extern (__pthread_key_create) | ||
| 85 | weak_extern (__pthread_setspecific) | ||
| 86 | weak_extern (__pthread_getspecific) | ||
| 87 | -weak_extern (__pthread_once) | ||
| 88 | weak_extern (__pthread_initialize) | ||
| 89 | weak_extern (__pthread_atfork) | ||
| 90 | weak_extern (__pthread_setcancelstate) | ||
| 91 | @@ -128,7 +129,6 @@ libc_hidden_proto (__pthread_setcancelstate) | ||
| 92 | # pragma weak __pthread_key_create | ||
| 93 | # pragma weak __pthread_setspecific | ||
| 94 | # pragma weak __pthread_getspecific | ||
| 95 | -# pragma weak __pthread_once | ||
| 96 | # pragma weak __pthread_initialize | ||
| 97 | # pragma weak __pthread_atfork | ||
| 98 | # pragma weak __pthread_setcancelstate | ||
| 99 | diff --git a/sysdeps/htl/pt-once.c b/sysdeps/htl/pt-once.c | ||
| 100 | index 68fb2e1129..1f999ce492 100644 | ||
| 101 | --- a/sysdeps/htl/pt-once.c | ||
| 102 | +++ b/sysdeps/htl/pt-once.c | ||
| 103 | @@ -20,6 +20,7 @@ | ||
| 104 | #include <atomic.h> | ||
| 105 | |||
| 106 | #include <pt-internal.h> | ||
| 107 | +#include <shlib-compat.h> | ||
| 108 | |||
| 109 | static void | ||
| 110 | clear_once_control (void *arg) | ||
| 111 | @@ -53,4 +54,9 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void)) | ||
| 112 | |||
| 113 | return 0; | ||
| 114 | } | ||
| 115 | -weak_alias (__pthread_once, pthread_once); | ||
| 116 | +libc_hidden_def (__pthread_once) | ||
| 117 | +versioned_symbol (libc, __pthread_once, pthread_once, GLIBC_2_41); | ||
| 118 | + | ||
| 119 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41) | ||
| 120 | +compat_symbol (libpthread, __pthread_once, pthread_once, GLIBC_2_12); | ||
| 121 | +#endif | ||
| 122 | diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist | ||
| 123 | index bf62539c57..461df01ffb 100644 | ||
| 124 | --- a/sysdeps/mach/hurd/i386/libc.abilist | ||
| 125 | +++ b/sysdeps/mach/hurd/i386/libc.abilist | ||
| 126 | @@ -88,6 +88,7 @@ GLIBC_2.12 pthread_mutexattr_setprioceiling F | ||
| 127 | GLIBC_2.12 pthread_mutexattr_setprotocol F | ||
| 128 | GLIBC_2.12 pthread_mutexattr_setpshared F | ||
| 129 | GLIBC_2.12 pthread_mutexattr_settype F | ||
| 130 | +GLIBC_2.12 pthread_once F | ||
| 131 | GLIBC_2.12 pthread_self F | ||
| 132 | GLIBC_2.12 pthread_setschedparam F | ||
| 133 | GLIBC_2.12 pthread_sigmask F | ||
| 134 | @@ -2595,6 +2596,7 @@ GLIBC_2.42 pthread_mutex_consistent_np F | ||
| 135 | GLIBC_2.41 pthread_mutexattr_setrobust F | ||
| 136 | GLIBC_2.41 pthread_mutexattr_setrobust_np F | ||
| 137 | GLIBC_2.41 pthread_mutexattr_settype F | ||
| 138 | +GLIBC_2.41 pthread_once F | ||
| 139 | GLIBC_2.41 pthread_sigmask F | ||
| 140 | GLIBC_2.5 __readlinkat_chk F | ||
| 141 | GLIBC_2.5 inet6_opt_append F | ||
| 142 | diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist | ||
| 143 | index d9c1a1790a..b067d377b3 100644 | ||
| 144 | --- a/sysdeps/mach/hurd/i386/libpthread.abilist | ||
| 145 | +++ b/sysdeps/mach/hurd/i386/libpthread.abilist | ||
| 146 | @@ -35,7 +35,6 @@ GLIBC_2.12 pthread_key_create F | ||
| 147 | GLIBC_2.12 pthread_mutex_transfer_np F | ||
| 148 | GLIBC_2.12 pthread_mutex_trylock F | ||
| 149 | GLIBC_2.12 pthread_mutex_unlock F | ||
| 150 | -GLIBC_2.12 pthread_once F | ||
| 151 | GLIBC_2.12 pthread_rwlock_destroy F | ||
| 152 | GLIBC_2.12 pthread_rwlock_init F | ||
| 153 | GLIBC_2.12 pthread_rwlock_rdlock F | ||
| 154 | diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist | ||
| 155 | index fb068ab45e..6f235d20ba 100644 | ||
| 156 | --- a/sysdeps/mach/hurd/x86_64/libc.abilist | ||
| 157 | +++ b/sysdeps/mach/hurd/x86_64/libc.abilist | ||
| 158 | @@ -1579,6 +1579,7 @@ GLIBC_2.38 pthread_mutexattr_setpshared F | ||
| 159 | GLIBC_2.38 pthread_mutexattr_setrobust F | ||
| 160 | GLIBC_2.38 pthread_mutexattr_setrobust_np F | ||
| 161 | GLIBC_2.38 pthread_mutexattr_settype F | ||
| 162 | +GLIBC_2.38 pthread_once F | ||
| 163 | GLIBC_2.38 pthread_self F | ||
| 164 | GLIBC_2.38 pthread_setcancelstate F | ||
| 165 | GLIBC_2.38 pthread_setcanceltype F | ||
| 166 | @@ -2278,6 +2279,7 @@ GLIBC_2.42 pthread_mutex_consistent_np F | ||
| 167 | GLIBC_2.41 pthread_mutexattr_setrobust F | ||
| 168 | GLIBC_2.41 pthread_mutexattr_setrobust_np F | ||
| 169 | GLIBC_2.41 pthread_mutexattr_settype F | ||
| 170 | +GLIBC_2.41 pthread_once F | ||
| 171 | GLIBC_2.41 pthread_sigmask F | ||
| 172 | HURD_CTHREADS_0.3 __cthread_getspecific F | ||
| 173 | HURD_CTHREADS_0.3 __cthread_keycreate F | ||
| 174 | diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist | ||
| 175 | index 71ce1d6288..6b8acec832 100644 | ||
| 176 | --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist | ||
| 177 | +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist | ||
| 178 | @@ -55,7 +55,6 @@ GLIBC_2.38 pthread_key_create F | ||
| 179 | GLIBC_2.38 pthread_mutex_transfer_np F | ||
| 180 | GLIBC_2.38 pthread_mutex_trylock F | ||
| 181 | GLIBC_2.38 pthread_mutex_unlock F | ||
| 182 | -GLIBC_2.38 pthread_once F | ||
| 183 | GLIBC_2.38 pthread_rwlock_clockrdlock F | ||
| 184 | GLIBC_2.38 pthread_rwlock_clockwrlock F | ||
| 185 | GLIBC_2.38 pthread_rwlock_destroy F | ||
diff --git a/gnu/packages/patches/glibc-hurd-2.41-pthread-sigmask.patch b/gnu/packages/patches/glibc-hurd-2.41-pthread-sigmask.patch new file mode 100644 index 00000000000..4c65ddbd53b --- /dev/null +++ b/gnu/packages/patches/glibc-hurd-2.41-pthread-sigmask.patch | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | Taken from: | ||
| 2 | https://salsa.debian.org/glibc-team/glibc/-/blob/6c823b5862bd91ca757eeb9c6f5326875bc8af01/debian/patches/hurd-i386/git-pthread_sigmask_nothread.diff | ||
| 3 | |||
| 4 | Upstream 2.42 has a much more involved cleanup fix which in the end | ||
| 5 | boils down to this. | ||
| 6 | |||
| 7 | Index: glibc-upstream/sysdeps/mach/hurd/htl/pt-sigstate.c | ||
| 8 | =================================================================== | ||
| 9 | --- glibc-upstream.orig/sysdeps/mach/hurd/htl/pt-sigstate.c | ||
| 10 | +++ glibc-upstream/sysdeps/mach/hurd/htl/pt-sigstate.c | ||
| 11 | @@ -36,7 +36,10 @@ __pthread_sigstate (struct __pthread *th | ||
| 12 | if (set != NULL) | ||
| 13 | new = *set; | ||
| 14 | |||
| 15 | - ss = _hurd_thread_sigstate (thread->kernel_thread); | ||
| 16 | + if (thread == _pthread_self ()) | ||
| 17 | + ss = _hurd_self_sigstate (); | ||
| 18 | + else | ||
| 19 | + ss = _hurd_thread_sigstate (thread->kernel_thread); | ||
| 20 | assert (ss); | ||
| 21 | |||
| 22 | _hurd_sigstate_lock (ss); | ||
diff --git a/gnu/packages/patches/glibc-hurd-2.41-symlink.patch b/gnu/packages/patches/glibc-hurd-2.41-symlink.patch new file mode 100644 index 00000000000..8b106ca0a45 --- /dev/null +++ b/gnu/packages/patches/glibc-hurd-2.41-symlink.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | Taken from: | ||
| 2 | https://sourceware.org/git/?p=glibc.git;a=patch;h=39183b953c68a489cc0b9aefb8974711c834fb38 | ||
| 3 | |||
| 4 | From 39183b953c68a489cc0b9aefb8974711c834fb38 Mon Sep 17 00:00:00 2001 | ||
| 5 | From: Samuel Thibault <samuel.thibault@ens-lyon.org> | ||
| 6 | Date: Mon, 21 Apr 2025 22:21:17 +0200 | ||
| 7 | Subject: [PATCH] hurd: Make symlink return EEXIST on existing target directory | ||
| 8 | |||
| 9 | 8ef17919509e ("hurd: Fix EINVAL error on linking to a slash-trailing path | ||
| 10 | [BZ #32569]) made symlink return ENOTDIR, but the gnulib testsuite does | ||
| 11 | not recognize it for such a situation, and EEXIST is indeed more | ||
| 12 | comprehensible to users. | ||
| 13 | --- | ||
| 14 | sysdeps/mach/hurd/symlinkat.c | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/sysdeps/mach/hurd/symlinkat.c b/sysdeps/mach/hurd/symlinkat.c | ||
| 18 | index e7dfb673df..cb6250e6f0 100644 | ||
| 19 | --- a/sysdeps/mach/hurd/symlinkat.c | ||
| 20 | +++ b/sysdeps/mach/hurd/symlinkat.c | ||
| 21 | @@ -47,7 +47,7 @@ __symlinkat (const char *from, int fd, const char *to) | ||
| 22 | |||
| 23 | if (! *name) | ||
| 24 | /* Can't link to the existing directory itself. */ | ||
| 25 | - err = ENOTDIR; | ||
| 26 | + err = EEXIST; | ||
| 27 | else | ||
| 28 | /* Create a new, unlinked node in the target directory. */ | ||
| 29 | err = __dir_mkfile (dir, O_WRITE, 0777 & ~_hurd_umask, &node); | ||
| 30 | -- | ||
| 31 | 2.49.0 | ||
| 32 | |||
