From fc8b8ed923c338b37f3c10b0616dd4d92a9909e4 Mon Sep 17 00:00:00 2001 From: Arjun Shankar Date: Tue, 19 Aug 2025 17:55:03 +0200 Subject: [PATCH] Define __libc_tsd_CTYPE_* thread variables as TLS initial-exec (RHEL-107518) Related: RHEL-72017 Resolves: RHEL-107518 --- glibc-RHEL-107518.patch | 39 +++++++++++++++++++++++++++++++++++++++ glibc.spec | 6 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 glibc-RHEL-107518.patch diff --git a/glibc-RHEL-107518.patch b/glibc-RHEL-107518.patch new file mode 100644 index 0000000..4c4d18c --- /dev/null +++ b/glibc-RHEL-107518.patch @@ -0,0 +1,39 @@ +commit e5363e6f460c2d58809bf10fc96d70fd1ef8b5b2 +Author: Jens Remus +Date: Fri Jul 25 15:40:03 2025 +0200 + + Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables [BZ #33234] + + Commit 10a66a8e421b ("Remove ") removed the TLS initial-exec + (IE) model attribute from the __libc_tsd_CTYPE_* thread variable declarations + and definitions. Commit a894f04d8776 ("Optimize __libc_tsd_* thread + variable access") restored it on declarations. + + Restore the TLS initial-exec model attribute on __libc_tsd_CTYPE_* thread + variable definitions. + + This resolves test tst-locale1 failure on s390 32-bit, when using a + GNU linker without the fix from GNU binutils commit aefebe82dc89 + ("IBM zSystems: Fix offset relative to static TLS"). + + Reviewed-by: Florian Weimer + +diff --git a/ctype/ctype-info.c b/ctype/ctype-info.c +index e0752b4a1af6df15..315cedcfaa357ead 100644 +--- a/ctype/ctype-info.c ++++ b/ctype/ctype-info.c +@@ -24,11 +24,11 @@ + __ctype_init before user code runs, but this does not happen for + threads in secondary namespaces. With the initializers, secondary + namespaces at least get locale data from the C locale. */ +-__thread const uint16_t * __libc_tsd_CTYPE_B ++__thread const uint16_t * __libc_tsd_CTYPE_B attribute_tls_model_ie + = (const uint16_t *) _nl_C_LC_CTYPE_class + 128; +-__thread const int32_t * __libc_tsd_CTYPE_TOLOWER ++__thread const int32_t * __libc_tsd_CTYPE_TOLOWER attribute_tls_model_ie + = (const int32_t *) _nl_C_LC_CTYPE_tolower + 128; +-__thread const int32_t * __libc_tsd_CTYPE_TOUPPER ++__thread const int32_t * __libc_tsd_CTYPE_TOUPPER attribute_tls_model_ie + = (const int32_t *) _nl_C_LC_CTYPE_toupper + 128; + + diff --git a/glibc.spec b/glibc.spec index b5e50fb..d433745 100644 --- a/glibc.spec +++ b/glibc.spec @@ -157,7 +157,7 @@ end \ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: 230%{?dist} +Release: 231%{?dist} # In general, GPLv2+ is used by programs, LGPLv2+ is used for # libraries. @@ -1340,6 +1340,7 @@ Patch1024: glibc-RHEL-104852-1.patch Patch1025: glibc-RHEL-104852-2.patch Patch1026: glibc-RHEL-106206.patch Patch1027: glibc-RHEL-108220.patch +Patch1028: glibc-RHEL-107518.patch ############################################################################## # Continued list of core "glibc" package information: @@ -3427,6 +3428,9 @@ update_gconv_modules_cache () %endif %changelog +* Tue Aug 19 2025 Arjun Shankar - 2.34-231 +- Define __libc_tsd_CTYPE_* TLS variables as initial-exec (RHEL-107518) + * Tue Aug 19 2025 Arjun Shankar - 2.34-230 - elf: Remove a duplicate test related Makefile target (RHEL-108220)