Overwrite target for x86_64_v2

Update patch-git.lua to handle AlmaLinux branches correctly
This commit is contained in:
Eduard Abdullin 2025-10-14 01:43:13 +00:00 committed by root
commit c15ebecd85
3 changed files with 136 additions and 1 deletions

84
glibc-RHEL-119400-1.patch Normal file
View File

@ -0,0 +1,84 @@
commit 03b8d764109be48a53b18abd4b5050e8cdc2c6da
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Thu Nov 21 17:13:33 2024 -0500
nptl: Add smoke test for pthread_getcpuclockid failure
Exercise the case where an exited thread will cause
pthread_getcpuclockid to fail.
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Conflicts:
nptl/Makefile
(fixup context)
diff --git a/nptl/Makefile b/nptl/Makefile
index 34c80f6f38261669..7139f76827b5ffe6 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -318,6 +318,7 @@ tests = \
tst-pthread-defaultattr-free \
tst-pthread-gdb-attach \
tst-pthread-gdb-attach-static \
+ tst-pthread-getcpuclockid-invalid \
tst-pthread-timedlock-lockloop \
tst-pthread_exit-nothreads \
tst-pthread_exit-nothreads-static \
diff --git a/nptl/tst-pthread-getcpuclockid-invalid.c b/nptl/tst-pthread-getcpuclockid-invalid.c
new file mode 100644
index 0000000000000000..e88a56342767a83e
--- /dev/null
+++ b/nptl/tst-pthread-getcpuclockid-invalid.c
@@ -0,0 +1,50 @@
+/* Smoke test to verify that pthread_getcpuclockid fails with ESRCH when the
+ thread in question has exited.
+ Copyright the GNU Toolchain Authors.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+
+#include <support/check.h>
+#include <support/test-driver.h>
+#include <support/xthread.h>
+
+void *
+thr (void *in)
+{
+ return in;
+}
+
+int
+do_test (void)
+{
+ clockid_t c;
+ pthread_t t = xpthread_create (NULL, thr, NULL);
+
+ int ret = 0;
+ while ((ret = pthread_getcpuclockid (t, &c)) == 0)
+ sched_yield ();
+
+ TEST_COMPARE (ret, ESRCH);
+
+ return 0;
+}
+
+#include <support/test-driver.c>

51
glibc-RHEL-119400-2.patch Normal file
View File

@ -0,0 +1,51 @@
commit 19a198f05802fcc05441c364ed75311ef3f6d663
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Thu Nov 28 06:30:40 2024 -0500
pthread_getcpuclockid: Add descriptive comment to smoke test
Add a descriptive comment to the tst-pthread-cpuclockid-invalid test and
also drop pthread_getcpuclockid from the TODO-testing list since it now
has full coverage.
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
diff --git a/nptl/TODO-testing b/nptl/TODO-testing
index e076e5624f1cfbaa..f50d2ceb51b247c3 100644
--- a/nptl/TODO-testing
+++ b/nptl/TODO-testing
@@ -10,10 +10,6 @@ pthread_attr_[sg]etstack
some more tests needed
-pthread_getcpuclockid
-
- check that value is reset -> rt subdir
-
pthread_getschedparam
pthread_setschedparam
diff --git a/nptl/tst-pthread-getcpuclockid-invalid.c b/nptl/tst-pthread-getcpuclockid-invalid.c
index e88a56342767a83e..7ac46acad8fe0fd7 100644
--- a/nptl/tst-pthread-getcpuclockid-invalid.c
+++ b/nptl/tst-pthread-getcpuclockid-invalid.c
@@ -1,5 +1,4 @@
-/* Smoke test to verify that pthread_getcpuclockid fails with ESRCH when the
- thread in question has exited.
+/* pthread_getcpuclockid should fail with ESRCH when the thread exits.
Copyright the GNU Toolchain Authors.
This file is part of the GNU C Library.
@@ -17,6 +16,12 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+/* The input thread descriptor to pthread_getcpuclockid needs to be valid when
+ the function is called. For the purposes of this test, this means that the
+ thread should not be detached, have exited, but not joined. This should be
+ good enough to complete coverage for pthread_getcpuclockid alongside
+ tst-clock2. */
+
#include <errno.h>
#include <pthread.h>
#include <sched.h>

View File

@ -2348,7 +2348,7 @@ update_gconv_modules_cache ()
%endif
%changelog
* Thu Oct 09 2025 Eduard Abdullin <eabdullin@almalinux.org> - 2.39-75.alma.1
* Tue Oct 14 2025 Eduard Abdullin <eabdullin@almalinux.org> - 2.39-76.alma.1
- Overwrite target for x86_64_v2
- Update patch-git.lua to handle AlmaLinux branches correctly