From b928a76c1b4166cd5c136532e63a79c08fdab49720f8d3c65ea30993040e4dc0 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 7 Feb 2023 09:37:31 +0000 Subject: [PATCH] Accepting request 1063589 from home:Andreas_Schwab:Factory - Update to glibc 2.37 * The getent tool now supports the --no-addrconfig option * The dynamic linker no longer loads shared objects from the "tls" subdirectories on the library search path or the subdirectory that corresponds to the AT_PLATFORM system name, or employs the legacy AT_HWCAP search mechanism, which was deprecated in version 2.33 - printf-grouping.patch: Account for grouping in printf width (BZ #30068) - strftime-time64.patch: Use 64-bit time_t interfaces in strftime and strptime (BZ #30053) - glibcextract-compile-c-snippet.patch, sys-mount-kernel-definition.patch, sys-mount-usage.patch, nscd-netlink-cache-invalidation.patch, syslog-large-messages.patch, dlmopen-libc-early-init.patch, ldd-vdso-dependency.patch, syslog-extra-whitespace.patch, errlist-edeadlock.patch, makeflags.patch, get-nscd-addresses.patch, x86-64-avx2-string-functions.patch, nscd-aicache.patch, dl-debug-bindings.patch, floatn.patch: Removed OBS-URL: https://build.opensuse.org/request/show/1063589 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=645 --- _constraints | 2 +- dl-debug-bindings.patch | 44 -- dlmopen-libc-early-init.patch | 239 ----------- errlist-edeadlock.patch | 57 --- fix-locking-in-_IO_cleanup.patch | 2 +- floatn.patch | 392 ------------------ get-nscd-addresses.patch | 37 -- glibc-2.36.tar.xz | 3 - glibc-2.36.tar.xz.sig | 16 - glibc-2.37.tar.xz | 3 + glibc-2.37.tar.xz.sig | 16 + glibc-version.diff | 2 +- glibc.changes | 20 + glibc.spec | 60 +-- glibcextract-compile-c-snippet.patch | 50 --- ldd-vdso-dependency.patch | 50 --- makeflags.patch | 114 ----- nscd-aicache.patch | 53 --- nscd-netlink-cache-invalidation.patch | 45 -- printf-grouping.patch | 159 +++++++ strftime-time64.patch | 137 ++++++ sys-mount-kernel-definition.patch | 30 -- sys-mount-usage.patch | 336 --------------- syslog-extra-whitespace.patch | 58 --- syslog-large-messages.patch | 336 --------------- x86-64-avx2-string-functions.patch | 576 -------------------------- 26 files changed, 345 insertions(+), 2492 deletions(-) delete mode 100644 dl-debug-bindings.patch delete mode 100644 dlmopen-libc-early-init.patch delete mode 100644 errlist-edeadlock.patch delete mode 100644 floatn.patch delete mode 100644 get-nscd-addresses.patch delete mode 100644 glibc-2.36.tar.xz delete mode 100644 glibc-2.36.tar.xz.sig create mode 100644 glibc-2.37.tar.xz create mode 100644 glibc-2.37.tar.xz.sig delete mode 100644 glibcextract-compile-c-snippet.patch delete mode 100644 ldd-vdso-dependency.patch delete mode 100644 makeflags.patch delete mode 100644 nscd-aicache.patch delete mode 100644 nscd-netlink-cache-invalidation.patch create mode 100644 printf-grouping.patch create mode 100644 strftime-time64.patch delete mode 100644 sys-mount-kernel-definition.patch delete mode 100644 sys-mount-usage.patch delete mode 100644 syslog-extra-whitespace.patch delete mode 100644 syslog-large-messages.patch delete mode 100644 x86-64-avx2-string-functions.patch diff --git a/_constraints b/_constraints index 4255e47..14bd648 100644 --- a/_constraints +++ b/_constraints @@ -6,7 +6,7 @@ - 2500 + 3000 5600 diff --git a/dl-debug-bindings.patch b/dl-debug-bindings.patch deleted file mode 100644 index 291e130..0000000 --- a/dl-debug-bindings.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 891a7958a28eac6d4af1517dd2896fef5e4951d4 Mon Sep 17 00:00:00 2001 -From: Adhemerval Zanella -Date: Tue, 25 Oct 2022 13:19:16 -0300 -Subject: [PATCH] elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x - -The prelink removal done by 6628c742b2c16e wrongly removed the debug -support. - -Checked on x86_64-linux-gnu. ---- - elf/dl-lookup.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c -index 4c86dc694e..67fb2e31e2 100644 ---- a/elf/dl-lookup.c -+++ b/elf/dl-lookup.c -@@ -854,6 +854,23 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map, - if (__glibc_unlikely (current_value.m->l_used == 0)) - current_value.m->l_used = 1; - -+ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)) -+ { -+ const char *reference_name = undef_map->l_name; -+ -+ _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'", -+ DSO_FILENAME (reference_name), -+ undef_map->l_ns, -+ DSO_FILENAME (current_value.m->l_name), -+ current_value.m->l_ns, -+ protected ? "protected" : "normal", undef_name); -+ if (version) -+ _dl_debug_printf_c (" [%s]\n", version->name); -+ else -+ _dl_debug_printf_c ("\n"); -+ } -+ -+ - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } --- -2.38.1 - diff --git a/dlmopen-libc-early-init.patch b/dlmopen-libc-early-init.patch deleted file mode 100644 index 65e7611..0000000 --- a/dlmopen-libc-early-init.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 924e4f3eaa502ce82fccf8537f021a796d158771 Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Fri, 26 Aug 2022 21:15:43 +0200 -Subject: [PATCH] elf: Call __libc_early_init for reused namespaces (bug 29528) - -libc_map is never reset to NULL, neither during dlclose nor on a -dlopen call which reuses the namespace structure. As a result, if a -namespace is reused, its libc is not initialized properly. The most -visible result is a crash in the functions. - -To prevent similar bugs on namespace reuse from surfacing, -unconditionally initialize the chosen namespace to zero using memset. - -(cherry picked from commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe) ---- - NEWS | 1 + - elf/Makefile | 25 ++++++++++++++++++ - elf/dl-open.c | 13 ++++++---- - elf/tst-dlmopen-twice-mod1.c | 37 ++++++++++++++++++++++++++ - elf/tst-dlmopen-twice-mod2.c | 50 ++++++++++++++++++++++++++++++++++++ - elf/tst-dlmopen-twice.c | 34 ++++++++++++++++++++++++ - 6 files changed, 155 insertions(+), 5 deletions(-) - create mode 100644 elf/tst-dlmopen-twice-mod1.c - create mode 100644 elf/tst-dlmopen-twice-mod2.c - create mode 100644 elf/tst-dlmopen-twice.c - -diff --git a/elf/Makefile b/elf/Makefile -index fd77d0c7c8..43353a4b08 100644 ---- a/elf/Makefile -+++ b/elf/Makefile -@@ -408,6 +408,7 @@ tests += \ - tst-dlmopen4 \ - tst-dlmopen-dlerror \ - tst-dlmopen-gethostbyname \ -+ tst-dlmopen-twice \ - tst-dlopenfail \ - tst-dlopenfail-2 \ - tst-dlopenrpath \ -@@ -834,6 +835,8 @@ modules-names += \ - tst-dlmopen1mod \ - tst-dlmopen-dlerror-mod \ - tst-dlmopen-gethostbyname-mod \ -+ tst-dlmopen-twice-mod1 \ -+ tst-dlmopen-twice-mod2 \ - tst-dlopenfaillinkmod \ - tst-dlopenfailmod1 \ - tst-dlopenfailmod2 \ -@@ -2967,3 +2970,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \ - grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \ - && grep -q '^status: 127$$' $@; \ - $(evaluate-test) -+ -+$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \ -+ $(objpfx)tst-audit-tlsdesc-mod2.so \ -+ $(shared-thread-library) -+ifeq (yes,$(have-mtls-dialect-gnu2)) -+# The test is valid for all TLS types, but we want to exercise GNU2 -+# TLS if possible. -+CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2 -+CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2 -+endif -+$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library) -+$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \ -+ $(objpfx)tst-audit-tlsdesc-mod2.so -+$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so -+$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so -+tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so -+$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so -+tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so -+ -+$(objpfx)tst-dlmopen-twice.out: \ -+ $(objpfx)tst-dlmopen-twice-mod1.so \ -+ $(objpfx)tst-dlmopen-twice-mod2.so -diff --git a/elf/dl-open.c b/elf/dl-open.c -index a23e65926b..46e8066fd8 100644 ---- a/elf/dl-open.c -+++ b/elf/dl-open.c -@@ -844,11 +844,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid, - _dl_signal_error (EINVAL, file, NULL, N_("\ - no more namespaces available for dlmopen()")); - } -- else if (nsid == GL(dl_nns)) -- { -- __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock); -- ++GL(dl_nns); -- } -+ -+ if (nsid == GL(dl_nns)) -+ ++GL(dl_nns); -+ -+ /* Initialize the new namespace. Most members are -+ zero-initialized, only the lock needs special treatment. */ -+ memset (&GL(dl_ns)[nsid], 0, sizeof (GL(dl_ns)[nsid])); -+ __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock); - - _dl_debug_update (nsid)->r_state = RT_CONSISTENT; - } -diff --git a/elf/tst-dlmopen-twice-mod1.c b/elf/tst-dlmopen-twice-mod1.c -new file mode 100644 -index 0000000000..0eaf04948c ---- /dev/null -+++ b/elf/tst-dlmopen-twice-mod1.c -@@ -0,0 +1,37 @@ -+/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528). Module 1. -+ Copyright (C) 2022 Free Software Foundation, Inc. -+ 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 -+ . */ -+ -+#include -+ -+static void __attribute__ ((constructor)) -+init (void) -+{ -+ puts ("info: tst-dlmopen-twice-mod1.so loaded"); -+ fflush (stdout); -+} -+ -+static void __attribute__ ((destructor)) -+fini (void) -+{ -+ puts ("info: tst-dlmopen-twice-mod1.so about to be unloaded"); -+ fflush (stdout); -+} -+ -+/* Large allocation. The second module does not have this, so it -+ should load libc at a different address. */ -+char large_allocate[16 * 1024 * 1024]; -diff --git a/elf/tst-dlmopen-twice-mod2.c b/elf/tst-dlmopen-twice-mod2.c -new file mode 100644 -index 0000000000..40c6c01f96 ---- /dev/null -+++ b/elf/tst-dlmopen-twice-mod2.c -@@ -0,0 +1,50 @@ -+/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528). Module 2. -+ Copyright (C) 2022 Free Software Foundation, Inc. -+ 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 -+ . */ -+ -+#include -+#include -+ -+static void __attribute__ ((constructor)) -+init (void) -+{ -+ puts ("info: tst-dlmopen-twice-mod2.so loaded"); -+ fflush (stdout); -+} -+ -+static void __attribute__ ((destructor)) -+fini (void) -+{ -+ puts ("info: tst-dlmopen-twice-mod2.so about to be unloaded"); -+ fflush (stdout); -+} -+ -+int -+run_check (void) -+{ -+ puts ("info: about to call isalpha"); -+ fflush (stdout); -+ -+ volatile char ch = 'a'; -+ if (!isalpha (ch)) -+ { -+ puts ("error: isalpha ('a') is not true"); -+ fflush (stdout); -+ return 1; -+ } -+ return 0; -+} -diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c -new file mode 100644 -index 0000000000..449f3c8fa9 ---- /dev/null -+++ b/elf/tst-dlmopen-twice.c -@@ -0,0 +1,34 @@ -+/* Initialization of libc after dlmopen/dlclose/dlmopen (bug 29528). Main. -+ Copyright (C) 2022 Free Software Foundation, Inc. -+ 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 -+ . */ -+ -+#include -+#include -+ -+static int -+do_test (void) -+{ -+ void *handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod1.so", RTLD_NOW); -+ xdlclose (handle); -+ handle = xdlmopen (LM_ID_NEWLM, "tst-dlmopen-twice-mod2.so", RTLD_NOW); -+ int (*run_check) (void) = xdlsym (handle, "run_check"); -+ TEST_COMPARE (run_check (), 0); -+ xdlclose (handle); -+ return 0; -+} -+ -+#include --- -2.37.3 - diff --git a/errlist-edeadlock.patch b/errlist-edeadlock.patch deleted file mode 100644 index 7c2dd32..0000000 --- a/errlist-edeadlock.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 3d7d5c10c806ee24f8e35014e41e203002609a3f Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Thu, 8 Sep 2022 10:25:21 +0200 -Subject: [PATCH] errlist: add missing entry for EDEADLOCK (bug 29545) - -Some architectures (mips, powerpc and sparc) define separate values for -EDEADLOCK and EDEADLK. Readd the errlist entry for EDEADLOCK for those -configurations. Also use the dependency files from generating the -auxiliary errlist and siglist files. ---- - stdio-common/Makefile | 8 ++++++++ - sysdeps/gnu/errlist.h | 3 +++ - 2 files changed, 11 insertions(+) - -diff --git a/stdio-common/Makefile b/stdio-common/Makefile -index e11aaedd96..9c98c02884 100644 ---- a/stdio-common/Makefile -+++ b/stdio-common/Makefile -@@ -267,6 +267,10 @@ $(objpfx)errlist-data-aux.S: errlist-data-gen.c - $(make-target-directory) - $(compile-command.c) $(pie-default) $(no-stack-protector) -S - -+ifndef no_deps -+-include $(objpfx)errlist-data-aux.S.d $(objpfx)errlist-data-aux-shared.S.d -+endif -+ - $(objpfx)errlist-data.os: $(objpfx)errlist-data-aux-shared.S - $(objpfx)errlist-data.o: $(objpfx)errlist-data-aux.S - -@@ -278,6 +282,10 @@ $(objpfx)siglist-aux.S: siglist-gen.c - $(make-target-directory) - $(compile-command.c) $(pie-default) $(no-stack-protector) -S - -+ifndef no_deps -+-include $(objpfx)siglist-aux.S.d $(objpfx)siglist-aux-shared.S.d -+endif -+ - $(objpfx)siglist.os: $(objpfx)siglist-aux-shared.S - $(objpfx)siglist.o: $(objpfx)siglist-aux.S - -diff --git a/sysdeps/gnu/errlist.h b/sysdeps/gnu/errlist.h -index 6329e5f393..e8416448da 100644 ---- a/sysdeps/gnu/errlist.h -+++ b/sysdeps/gnu/errlist.h -@@ -593,6 +593,9 @@ _S(EBADRQC, N_("Invalid request code")) - #ifdef EBADSLT - _S(EBADSLT, N_("Invalid slot")) - #endif -+#if defined EDEADLOCK && EDEADLOCK != EDEADLK -+_S (EDEADLOCK, N_ ("File locking deadlock error")) -+#endif - #ifdef EBFONT - _S(EBFONT, N_("Bad font file format")) - #endif --- -2.37.3 - diff --git a/fix-locking-in-_IO_cleanup.patch b/fix-locking-in-_IO_cleanup.patch index ec960cc..071853a 100644 --- a/fix-locking-in-_IO_cleanup.patch +++ b/fix-locking-in-_IO_cleanup.patch @@ -144,7 +144,7 @@ Index: glibc-2.32/sysdeps/pthread/tst-stdio1.c --- glibc-2.32.orig/sysdeps/pthread/tst-stdio1.c +++ /dev/null @@ -1,55 +0,0 @@ --/* Copyright (C) 2002-2022 Free Software Foundation, Inc. +-/* Copyright (C) 2002-2023 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or diff --git a/floatn.patch b/floatn.patch deleted file mode 100644 index 70174f0..0000000 --- a/floatn.patch +++ /dev/null @@ -1,392 +0,0 @@ -From 3e5760fcb48528d48deeb60cb885a97bb731160c Mon Sep 17 00:00:00 2001 -From: Joseph Myers -Date: Wed, 28 Sep 2022 20:09:34 +0000 -Subject: [PATCH] Update _FloatN header support for C++ in GCC 13 - -GCC 13 adds support for _FloatN and _FloatNx types in C++, so breaking -the installed glibc headers that assume such support is not present. -GCC mostly works around this with fixincludes, but that doesn't help -for building glibc and its tests (glibc doesn't itself contain C++ -code, but there's C++ code built for tests). Update glibc's -bits/floatn-common.h and bits/floatn.h headers to handle the GCC 13 -support directly. - -In general the changes match those made by fixincludes, though I think -the ones in sysdeps/powerpc/bits/floatn.h, where the header tests -__LDBL_MANT_DIG__ == 113 or uses #elif, wouldn't match the existing -fixincludes patterns. - -Some places involving special C++ handling in relation to _FloatN -support are not changed. There's no need to change the -__HAVE_FLOATN_NOT_TYPEDEF definition (also in a form that wouldn't be -matched by the fixincludes fixes) because it's only used in relation -to macro definitions using features not supported for C++ -(__builtin_types_compatible_p and _Generic). And there's no need to -change the inline function overloads for issignaling, iszero and -iscanonical in C++ because cases where types have the same format but -are no longer compatible types are handled automatically by the C++ -overload resolution rules. - -This patch also does not change the overload handling for iseqsig, and -there I think changes *are* needed, beyond those in this patch or made -by fixincludes. The way that overload is defined, via a template -parameter to a structure type, requires overloads whenever the types -are incompatible, even if they have the same format. So I think we -need to add overloads with GCC 13 for every supported _FloatN and -_FloatNx type, rather than just having one for _Float128 when it has a -different ABI to long double as at present (but for older GCC, such -overloads must not be defined for types that end up defined as -typedefs for another type). - -Tested with build-many-glibcs.py: compilers build for -aarch64-linux-gnu ia64-linux-gnu mips64-linux-gnu powerpc-linux-gnu -powerpc64le-linux-gnu x86_64-linux-gnu; glibcs build for -aarch64-linux-gnu ia64-linux-gnu i686-linux-gnu mips-linux-gnu -mips64-linux-gnu-n32 powerpc-linux-gnu powerpc64le-linux-gnu -x86_64-linux-gnu. ---- - bits/floatn-common.h | 40 +++++++++++++------------- - sysdeps/ia64/bits/floatn.h | 6 ++-- - sysdeps/ieee754/ldbl-128/bits/floatn.h | 6 ++-- - sysdeps/mips/ieee754/bits/floatn.h | 6 ++-- - sysdeps/powerpc/bits/floatn.h | 6 ++-- - sysdeps/x86/bits/floatn.h | 6 ++-- - 6 files changed, 35 insertions(+), 35 deletions(-) - -diff --git a/bits/floatn-common.h b/bits/floatn-common.h -index 92982d6460..67519dbb74 100644 ---- a/bits/floatn-common.h -+++ b/bits/floatn-common.h -@@ -78,7 +78,7 @@ - or _FloatNx types, if __HAVE_ is 1. The corresponding - literal suffixes exist since GCC 7, for C only. */ - # if __HAVE_FLOAT16 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* No corresponding suffix available for this type. */ - # define __f16(x) ((_Float16) x##f) - # else -@@ -87,7 +87,7 @@ - # endif - - # if __HAVE_FLOAT32 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # define __f32(x) x##f - # else - # define __f32(x) x##f32 -@@ -95,7 +95,7 @@ - # endif - - # if __HAVE_FLOAT64 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # ifdef __NO_LONG_DOUBLE_MATH - # define __f64(x) x##l - # else -@@ -107,7 +107,7 @@ - # endif - - # if __HAVE_FLOAT32X --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # define __f32x(x) x - # else - # define __f32x(x) x##f32x -@@ -115,7 +115,7 @@ - # endif - - # if __HAVE_FLOAT64X --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # if __HAVE_FLOAT64X_LONG_DOUBLE - # define __f64x(x) x##l - # else -@@ -127,7 +127,7 @@ - # endif - - # if __HAVE_FLOAT128X --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # error "_Float128X supported but no constant suffix" - # else - # define __f128x(x) x##f128x -@@ -136,7 +136,7 @@ - - /* Defined to a complex type if __HAVE_ is 1. */ - # if __HAVE_FLOAT16 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); - # define __CFLOAT16 __cfloat16 - # else -@@ -145,7 +145,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); - # endif - - # if __HAVE_FLOAT32 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # define __CFLOAT32 _Complex float - # else - # define __CFLOAT32 _Complex _Float32 -@@ -153,7 +153,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); - # endif - - # if __HAVE_FLOAT64 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # ifdef __NO_LONG_DOUBLE_MATH - # define __CFLOAT64 _Complex long double - # else -@@ -165,7 +165,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); - # endif - - # if __HAVE_FLOAT32X --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # define __CFLOAT32X _Complex double - # else - # define __CFLOAT32X _Complex _Float32x -@@ -173,7 +173,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); - # endif - - # if __HAVE_FLOAT64X --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # if __HAVE_FLOAT64X_LONG_DOUBLE - # define __CFLOAT64X _Complex long double - # else -@@ -185,7 +185,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); - # endif - - # if __HAVE_FLOAT128X --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # error "_Float128X supported but no complex type" - # else - # define __CFLOAT128X _Complex _Float128x -@@ -195,7 +195,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); - /* The remaining of this file provides support for older compilers. */ - # if __HAVE_FLOAT16 - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef float _Float16 __attribute__ ((__mode__ (__HF__))); - # endif - -@@ -210,7 +210,7 @@ typedef float _Float16 __attribute__ ((__mode__ (__HF__))); - - # if __HAVE_FLOAT32 - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef float _Float32; - # endif - -@@ -234,7 +234,7 @@ typedef float _Float32; - - # ifdef __NO_LONG_DOUBLE_MATH - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef long double _Float64; - # endif - -@@ -247,7 +247,7 @@ typedef long double _Float64; - - # else - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef double _Float64; - # endif - -@@ -264,7 +264,7 @@ typedef double _Float64; - - # if __HAVE_FLOAT32X - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef double _Float32x; - # endif - -@@ -281,7 +281,7 @@ typedef double _Float32x; - - # if __HAVE_FLOAT64X_LONG_DOUBLE - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef long double _Float64x; - # endif - -@@ -294,7 +294,7 @@ typedef long double _Float64x; - - # else - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef _Float128 _Float64x; - # endif - -@@ -311,7 +311,7 @@ typedef _Float128 _Float64x; - - # if __HAVE_FLOAT128X - --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # error "_Float128x supported but no type" - # endif - -diff --git a/sysdeps/ia64/bits/floatn.h b/sysdeps/ia64/bits/floatn.h -index 5507038bc7..75f7547045 100644 ---- a/sysdeps/ia64/bits/floatn.h -+++ b/sysdeps/ia64/bits/floatn.h -@@ -56,7 +56,7 @@ - /* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* The literal suffix f128 exists only since GCC 7.0. */ - # define __f128(x) x##q - # else -@@ -66,7 +66,7 @@ - - /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* Add a typedef for older GCC compilers which don't natively support - _Complex _Float128. */ - typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); -@@ -80,7 +80,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); - # if __HAVE_FLOAT128 - - /* The type _Float128 exists only since GCC 7.0. */ --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef __float128 _Float128; - # endif - -diff --git a/sysdeps/ieee754/ldbl-128/bits/floatn.h b/sysdeps/ieee754/ldbl-128/bits/floatn.h -index 9ae7b30373..6ef60a3c9b 100644 ---- a/sysdeps/ieee754/ldbl-128/bits/floatn.h -+++ b/sysdeps/ieee754/ldbl-128/bits/floatn.h -@@ -55,7 +55,7 @@ - /* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* The literal suffix f128 exists only since GCC 7.0. */ - # define __f128(x) x##l - # else -@@ -65,7 +65,7 @@ - - /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # define __CFLOAT128 _Complex long double - # else - # define __CFLOAT128 _Complex _Float128 -@@ -76,7 +76,7 @@ - # if __HAVE_FLOAT128 - - /* The type _Float128 exists only since GCC 7.0. */ --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef long double _Float128; - # endif - -diff --git a/sysdeps/mips/ieee754/bits/floatn.h b/sysdeps/mips/ieee754/bits/floatn.h -index 1d51db04c7..f0321eb010 100644 ---- a/sysdeps/mips/ieee754/bits/floatn.h -+++ b/sysdeps/mips/ieee754/bits/floatn.h -@@ -55,7 +55,7 @@ - /* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* The literal suffix f128 exists only since GCC 7.0. */ - # define __f128(x) x##l - # else -@@ -65,7 +65,7 @@ - - /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - # define __CFLOAT128 _Complex long double - # else - # define __CFLOAT128 _Complex _Float128 -@@ -76,7 +76,7 @@ - # if __HAVE_FLOAT128 - - /* The type _Float128 exists only since GCC 7.0. */ --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef long double _Float128; - # endif - -diff --git a/sysdeps/powerpc/bits/floatn.h b/sysdeps/powerpc/bits/floatn.h -index 23db8be5a3..3c756dfc9d 100644 ---- a/sysdeps/powerpc/bits/floatn.h -+++ b/sysdeps/powerpc/bits/floatn.h -@@ -57,7 +57,7 @@ - /* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* The literal suffix (f128) exist for powerpc only since GCC 7.0. */ - # if __LDBL_MANT_DIG__ == 113 - # define __f128(x) x##l -@@ -71,10 +71,10 @@ - - /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if __LDBL_MANT_DIG__ == 113 && defined __cplusplus -+# if __LDBL_MANT_DIG__ == 113 && defined __cplusplus && !__GNUC_PREREQ (13, 0) - typedef long double _Float128; - # define __CFLOAT128 _Complex long double --# elif !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# elif !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* The type _Float128 exist for powerpc only since GCC 7.0. */ - typedef __float128 _Float128; - /* Add a typedef for older GCC and C++ compilers which don't natively support -diff --git a/sysdeps/x86/bits/floatn.h b/sysdeps/x86/bits/floatn.h -index 34a6fdc864..4ff39457b5 100644 ---- a/sysdeps/x86/bits/floatn.h -+++ b/sysdeps/x86/bits/floatn.h -@@ -58,7 +58,7 @@ - /* Defined to concatenate the literal suffix to be used with _Float128 - types, if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* The literal suffix f128 exists only since GCC 7.0. */ - # define __f128(x) x##q - # else -@@ -68,7 +68,7 @@ - - /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ - # if __HAVE_FLOAT128 --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - /* Add a typedef for older GCC compilers which don't natively support - _Complex _Float128. */ - typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); -@@ -82,7 +82,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); - # if __HAVE_FLOAT128 - - /* The type _Float128 exists only since GCC 7.0. */ --# if !__GNUC_PREREQ (7, 0) || defined __cplusplus -+# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) - typedef __float128 _Float128; - # endif - --- -2.39.0 - diff --git a/get-nscd-addresses.patch b/get-nscd-addresses.patch deleted file mode 100644 index 529fc22..0000000 --- a/get-nscd-addresses.patch +++ /dev/null @@ -1,37 +0,0 @@ -From c9226c03da0276593a0918eaa9a14835183343e8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=B6rg=20Sonnenberger?= -Date: Mon, 26 Sep 2022 13:59:16 -0400 -Subject: [PATCH] get_nscd_addresses: Fix subscript typos [BZ #29605] - -Fix the subscript on air->family, which was accidentally set to COUNT -when it should have remained as I. - -Resolves: BZ #29605 - -Reviewed-by: Siddhesh Poyarekar ---- - sysdeps/posix/getaddrinfo.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c -index bcff909b2f..5cda9bb072 100644 ---- a/sysdeps/posix/getaddrinfo.c -+++ b/sysdeps/posix/getaddrinfo.c -@@ -540,11 +540,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req, - at[count].addr[2] = htonl (0xffff); - } - else if (req->ai_family == AF_UNSPEC -- || air->family[count] == req->ai_family) -+ || air->family[i] == req->ai_family) - { -- at[count].family = air->family[count]; -+ at[count].family = air->family[i]; - memcpy (at[count].addr, addrs, size); -- if (air->family[count] == AF_INET6) -+ if (air->family[i] == AF_INET6) - res->got_ipv6 = true; - } - at[count].next = at + count + 1; --- -2.37.3 - diff --git a/glibc-2.36.tar.xz b/glibc-2.36.tar.xz deleted file mode 100644 index 9e28a4f..0000000 --- a/glibc-2.36.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75 -size 18610836 diff --git a/glibc-2.36.tar.xz.sig b/glibc-2.36.tar.xz.sig deleted file mode 100644 index 67d60fb..0000000 --- a/glibc-2.36.tar.xz.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEEcnNUKzmWLfeymZMUFnkrTqJTQPgFAmLoeDoACgkQFnkrTqJT -QPg4aBAAi49jj5b+KYLEPqwqvBL9o9lF6EX66sxmvcTL/ygZcAGFy2Px3sKfZQpC -0cFuVJNGOXJkbFg+jNzK5pPUWx1NLtYYyhHrIvIBYaAJnJsLNNfIullqOI4doJsY -uXczpqAmwvlAwYdlZMLoTYVtxS80Td27gk+cL/Uk8gEbJANu1iL/G3ruKwb42jD9 -dutEFDaTn6tD4rT0yB92rY3UMH7M2SuNertkhO+10utPNMIwEaaIk28Wa+2Q80xc -R+ALx36O4RQ5NWfOCnw3nrusEFd2dAHEI5mwBpjyCDaZ/XA3QuURjHzcT4jWF3Df -HIi5ED1fbVQpG6gM9V7cfay6hwacDtjoDfEhx3vN4m9l4LD7ySrgh0zrfo9EzO6a -prD1OFA+tgWEA1RoQcuoP5WQ0PloLApX758cQd7XhGPkx2vceffpifpxWiSZXVk0 -Y7u6muq2S3/qzQHHu61ERmNpEYesGEZlXLxvuJvosEmssmYAMTLj7tFTPyIppMDw -aOuNX8Qen5ri4bPrBtibAry02n1NTZ/4IAhHc0WbHUMHqZv2BRmXqj0mP48++Jx/ -BDnJynprKf6yfShhp/6bDXue7eLev21VJH/0GQdppU9f7L/CMlQBI55RLf3fEnw+ -pgmojWTrDp7R7TnTEglb2bTdPvbOx4YKNlTUYURcJGexiF5ydVE= -=EyZe ------END PGP SIGNATURE----- diff --git a/glibc-2.37.tar.xz b/glibc-2.37.tar.xz new file mode 100644 index 0000000..338bfa4 --- /dev/null +++ b/glibc-2.37.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2257eff111a1815d74f46856daaf40b019c1e553156c69d48ba0cbfc1bb91a43 +size 18674604 diff --git a/glibc-2.37.tar.xz.sig b/glibc-2.37.tar.xz.sig new file mode 100644 index 0000000..46a30c8 --- /dev/null +++ b/glibc-2.37.tar.xz.sig @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEcnNUKzmWLfeymZMUFnkrTqJTQPgFAmPbDiYACgkQFnkrTqJT +QPhzuA/7B6Ct1UCXS/0t2KnjRpsbeMRsaq7Of+t3lAfOYdU3TcBNpPsFoSUFmf0m +s6S92zlvYMkoHobEIOhKZsu1+RQwdAZidCvNy7YTsXGUypP0J4vRnOKYdsDG3JBp +YQIj5ra90aTDrF/DDSmmWXkPnAEXUKaliMcllvaWdnQwsXfg8lPwd80kcerWHq7d +4HtSdhTN5ELuVe6WunqLDqv1mA2vdOe6pzf6/ZWcr0JywcKFsI3mstbU42djAN/8 +dLm28tQCGnif5CcG1M+ljQ94bnbeYP9K5Tq7swQm6W4KN+UFmz3GWcQiKYk2Khra +KjAHHwOyEcFPtwlm4ghMYNjrE0lTjPu9wGKxKGhnhKc+wnxflw2p81tdR6WGTJow +gQdWDtsg3m5JdFoqsj2jIGoeSMuOJhjeg7xLH9+4Fpjl5lVQUHmomygVZO0Hd4dJ +JRqyGYUecHM8odSN+45DqDBcaRu9UJihXKf5YxrFhnDckjgKTfl7t8OzC1Tgzyac +tCFsvNi8JUYPpcWFrcyUEzYCsbdRrH/V+73d2c7ghIrq1LDCLU25ThPLVKB7yxg+ +yfv0IgOOgCox8anSZnEKV91HOlM4dUu7LEjL669Ww6MMZnHU0mAVaqJJyPWqVzz0 +i/K+9amzjNMW9/BfzvLMmmcqj91foGXdWcqVxrrAZuGKPXXSxaE= +=guFd +-----END PGP SIGNATURE----- diff --git a/glibc-version.diff b/glibc-version.diff index 18a558b..2b63759 100644 --- a/glibc-version.diff +++ b/glibc-version.diff @@ -8,7 +8,7 @@ Index: glibc-2.27/csu/version.c static const char banner[] = -"GNU C Library "PKGVERSION RELEASE" release version "VERSION".\n\ +"GNU C Library "PKGVERSION RELEASE" release version "VERSION" (git "GITID").\n\ - Copyright (C) 2022 Free Software Foundation, Inc.\n\ + Copyright (C) 2023 Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ PARTICULAR PURPOSE.\n\ diff --git a/glibc.changes b/glibc.changes index 51106f1..10d03ae 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Wed Feb 1 16:06:35 UTC 2023 - Andreas Schwab + +- Update to glibc 2.37 + * The getent tool now supports the --no-addrconfig option + * The dynamic linker no longer loads shared objects from the "tls" + subdirectories on the library search path or the subdirectory that + corresponds to the AT_PLATFORM system name, or employs the legacy AT_HWCAP + search mechanism, which was deprecated in version 2.33 +- printf-grouping.patch: Account for grouping in printf width (BZ #30068) +- strftime-time64.patch: Use 64-bit time_t interfaces in strftime and + strptime (BZ #30053) +- glibcextract-compile-c-snippet.patch, sys-mount-kernel-definition.patch, + sys-mount-usage.patch, nscd-netlink-cache-invalidation.patch, + syslog-large-messages.patch, dlmopen-libc-early-init.patch, + ldd-vdso-dependency.patch, syslog-extra-whitespace.patch, + errlist-edeadlock.patch, makeflags.patch, get-nscd-addresses.patch, + x86-64-avx2-string-functions.patch, nscd-aicache.patch, + dl-debug-bindings.patch, floatn.patch: Removed + ------------------------------------------------------------------- Tue Dec 27 12:24:54 UTC 2022 - Ludwig Nussel diff --git a/glibc.spec b/glibc.spec index bd85d45..2bda65b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -137,10 +137,10 @@ Name: glibc%{name_suffix} Summary: Standard Shared Libraries (from the GNU C Library) License: GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH GCC-exception-2.0 Group: System/Libraries -Version: 2.36 +Version: 2.37 Release: 0 %if %{without snapshot} -%define git_id c804cd1c00 +%define git_id a704fd9a13 %define libversion %version %else %define git_id %(echo %version | sed 's/.*\.g//') @@ -280,36 +280,10 @@ Patch306: glibc-fix-double-loopback.diff ### # Patches from upstream ### -# PATCH-FIX-UPSTREAM glibcextract.py: Add compile_c_snippet -Patch1000: glibcextract-compile-c-snippet.patch -# PATCH-FIX-UPSTREAM linux: Mimic kernel definition for BLOCK_SIZE -Patch1001: sys-mount-kernel-definition.patch -# PATCH-FIX-UPSTREAM linux: Fix sys/mount.h usage with kernel headers -Patch1002: sys-mount-usage.patch -# PATCH-FIX-UPSTREAM nscd: Fix netlink cache invalidation if epoll is used (BZ #29415) -Patch1003: nscd-netlink-cache-invalidation.patch -# PATCH-FIX-UPSTREAM syslog: Fix large messages (CVE-2022-39046, BZ #29536) -Patch1004: syslog-large-messages.patch -# PATCH-FIX-UPSTREAM elf: Call __libc_early_init for reused namespaces (BZ #29528) -Patch1005: dlmopen-libc-early-init.patch -# PATCH-FIX-UPSTREAM elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ #29539) -Patch1006: ldd-vdso-dependency.patch -# PATCH-FIX-UPSTREAM syslog: Remove extra whitespace between timestamp and message (BZ #29544) -Patch1007: syslog-extra-whitespace.patch -# PATCH-FIX-UPSTREAM errlist: add missing entry for EDEADLOCK (BZ #29545) -Patch1008: errlist-edeadlock.patch -# PATCH-FIX-UPSTREAM Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 (BZ# 29564) -Patch1009: makeflags.patch -# PATCH-FIX-UPSTREAM get_nscd_addresses: Fix subscript typos (BZ #29605) -Patch1010: get-nscd-addresses.patch -# PATCH-FIX-UPSTREAM check for required cpu features in AVX2 string functions (BZ #29611) -Patch1011: x86-64-avx2-string-functions.patch -# PATCH-FIX-UPSTREAM nscd: Drop local address tuple variable (BZ #29607) -Patch1012: nscd-aicache.patch -# PATCH-FIX-UPSTREAM elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x -Patch1013: dl-debug-bindings.patch -# PATCH-FIX-UPSTREAM Update _FloatN header support for C++ in GCC 13 -Patch1014: floatn.patch +# PATCH-FIX-UPSTREAM Account for grouping in printf width (BZ #30068) +Patch1000: printf-grouping.patch +# PATCH-FIX-UPSTREAM Use 64-bit time_t interfaces in strftime and strptime (BZ #30053) +Patch1001: strftime-time64.patch ### # Patches awaiting upstream approval @@ -536,19 +510,6 @@ library in a cross compilation setting. %if %{without snapshot} %patch1000 -p1 %patch1001 -p1 -%patch1002 -p1 -%patch1003 -p1 -%patch1004 -p1 -%patch1005 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 -%patch1009 -p1 -%patch1010 -p1 -%patch1011 -p1 -%patch1012 -p1 -%patch1013 -p1 -%patch1014 -p1 %endif %patch2000 -p1 @@ -932,10 +893,6 @@ install -D -m 644 %{SOURCE5} %{buildroot}%{_prefix}/etc/nsswitch.conf install -m 644 %{SOURCE5} %{buildroot}/etc %endif -mkdir -p %{buildroot}%{_includedir}/resolv -install -m 0644 resolv/mapv4v6addr.h %{buildroot}%{_includedir}/resolv/ -install -m 0644 resolv/mapv4v6hostent.h %{buildroot}%{_includedir}/resolv/ - %if %{build_html} mkdir -p %{buildroot}%{_datadir}/doc/glibc cp -p cc-base/manual/libc/*.html %{buildroot}%{_datadir}/doc/glibc @@ -1060,7 +1017,7 @@ rm -f %{buildroot}%{_libdir}/lib* %else rm -f %{buildroot}%{_libdir}/lib*.a %endif -rm -f %{buildroot}%{_bindir}/{ld.so,ldd*,sprof} +rm -f %{buildroot}%{_bindir}/{ld.so,ldd,sprof} rm -rf %{buildroot}%{_mandir}/man* rm -rf %{buildroot}%{rootsbindir} %{buildroot}%{_includedir} %ifarch riscv64 @@ -1259,9 +1216,6 @@ exit 0 %{_bindir}/getent %{_bindir}/iconv %attr(755,root,root) %{_bindir}/ldd -%ifarch %ix86 sparc sparcv9 m68k - %{_bindir}/lddlibc4 -%endif %{_bindir}/locale %{_bindir}/localedef %dir %attr(0755,root,root) %{_libexecdir}/getconf diff --git a/glibcextract-compile-c-snippet.patch b/glibcextract-compile-c-snippet.patch deleted file mode 100644 index 1f43365..0000000 --- a/glibcextract-compile-c-snippet.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 841afa116e32b3c7195475769c26bf46fd870d32 Mon Sep 17 00:00:00 2001 -From: Adhemerval Zanella -Date: Wed, 10 Aug 2022 16:24:06 -0300 -Subject: [PATCH] glibcextract.py: Add compile_c_snippet - -It might be used on tests to check if a snippet build with the provided -compiler and flags. - -Reviewed-by: Florian Weimer ---- - scripts/glibcextract.py | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py -index 43ab58ffe2..36d204c9b0 100644 ---- a/scripts/glibcextract.py -+++ b/scripts/glibcextract.py -@@ -17,6 +17,7 @@ - # License along with the GNU C Library; if not, see - # . - -+import collections - import os.path - import re - import subprocess -@@ -173,3 +174,21 @@ def compare_macro_consts(source_1, source_2, cc, macro_re, exclude_re=None, - if not allow_extra_2: - ret = 1 - return ret -+ -+CompileResult = collections.namedtuple("CompileResult", "returncode output") -+ -+def compile_c_snippet(snippet, cc, extra_cc_args=''): -+ """Compile and return whether the SNIPPET can be build with CC along -+ EXTRA_CC_ARGS compiler flags. Return a CompileResult with RETURNCODE -+ being 0 for success, or the failure value and the compiler output. -+ """ -+ with tempfile.TemporaryDirectory() as temp_dir: -+ c_file_name = os.path.join(temp_dir, 'test.c') -+ obj_file_name = os.path.join(temp_dir, 'test.o') -+ with open(c_file_name, 'w') as c_file: -+ c_file.write(snippet + '\n') -+ cmd = cc.split() + extra_cc_args.split() + ['-c', '-o', obj_file_name, -+ c_file_name] -+ r = subprocess.run(cmd, check=False, stdout=subprocess.PIPE, -+ stderr=subprocess.STDOUT) -+ return CompileResult(r.returncode, r.stdout) --- -2.37.2 - diff --git a/ldd-vdso-dependency.patch b/ldd-vdso-dependency.patch deleted file mode 100644 index bd6197c..0000000 --- a/ldd-vdso-dependency.patch +++ /dev/null @@ -1,50 +0,0 @@ -From b3736d1a3c60a3ec9959bf3b38794958546bf6a2 Mon Sep 17 00:00:00 2001 -From: Adhemerval Zanella -Date: Tue, 30 Aug 2022 13:35:52 -0300 -Subject: [PATCH] elf: Restore how vDSO dependency is printed with - LD_TRACE_LOADED_OBJECTS (BZ #29539) - -The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like -dependencies are printed, instead of just the name and address it -follows other libraries mode and prints 'name => path'. - -Unfortunately, this broke some ldd consumer that uses the output to -filter out the program's dependencies. For instance CMake -bundleutilities module [1], where GetPrequirite uses the regex to filter -out 'name => path' [2]. - -This patch restore the previous way to print just the name and the -mapping address. - -Checked on x86_64-linux-gnu. - -[1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities -[2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733 - -Reviewed-by: Florian Weimer -(cherry picked from commit 1e903124cec4492463d075c6c061a2a772db77bf) ---- - NEWS | 2 +- - elf/rtld.c | 6 ++++++ - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/elf/rtld.c b/elf/rtld.c -index cbbaf4a331..3e771a93d8 100644 ---- a/elf/rtld.c -+++ b/elf/rtld.c -@@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr, - if (l->l_faked) - /* The library was not found. */ - _dl_printf ("\t%s => not found\n", l->l_libname->name); -+ else if (strcmp (l->l_libname->name, l->l_name) == 0) -+ /* Print vDSO like libraries without duplicate name. Some -+ consumers depend of this format. */ -+ _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name, -+ (int) sizeof l->l_map_start * 2, -+ (size_t) l->l_map_start); - else - _dl_printf ("\t%s => %s (0x%0*Zx)\n", - DSO_FILENAME (l->l_libname->name), --- -2.37.3 - diff --git a/makeflags.patch b/makeflags.patch deleted file mode 100644 index d2cf582..0000000 --- a/makeflags.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 2d7ed98add14f75041499ac189696c9bd3d757fe Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich -Date: Tue, 13 Sep 2022 13:39:13 -0400 -Subject: [PATCH] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 - [BZ# 29564] - -make-4.4 will add long flags to MAKEFLAGS variable: - - * WARNING: Backward-incompatibility! - Previously only simple (one-letter) options were added to the MAKEFLAGS - variable that was visible while parsing makefiles. Now, all options - are available in MAKEFLAGS. - -This causes locale builds to fail when long options are used: - - $ make --shuffle - ... - make -C localedata install-locales - make: invalid shuffle mode: '1662724426r' - -The change fixes it by passing eash option via whitespace and dashes. -That way option is appended to both single-word form and whitespace -separated form. - -While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering -out --long-options. Otherwise options like --shuffle flag enable silent -mode unintentionally. $(silent-make) variable consolidates the checks. - -Resolves: BZ# 29564 - -CC: Paul Smith -CC: Siddhesh Poyarekar -Signed-off-by: Sergei Trofimovich -Reviewed-by: Siddhesh Poyarekar ---- - Makeconfig | 18 +++++++++++++++++- - Makerules | 4 ++-- - elf/rtld-Rules | 2 +- - 3 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/Makeconfig b/Makeconfig -index f8164a0025..842f49eb58 100644 ---- a/Makeconfig -+++ b/Makeconfig -@@ -43,6 +43,22 @@ else - $(error objdir must be defined by the build-directory Makefile) - endif - -+# Did we request 'make -s' run? "yes" or "no". -+# Starting from make-4.4 MAKEFLAGS now contains long -+# options like '--shuffle'. To detect presence of 's' -+# we pick first word with short options. Long options -+# are guaranteed to come after whitespace. We use '-' -+# prefix to always have a word before long options -+# even if no short options were passed. -+# Typical MAKEFLAGS values to watch for: -+# "rs --shuffle=42" (silent) -+# " --shuffle" (not silent) -+ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),) -+silent-make := no -+else -+silent-make := yes -+endif -+ - # Root of the sysdeps tree. - sysdep_dir := $(..)sysdeps - export sysdep_dir := $(sysdep_dir) -@@ -917,7 +933,7 @@ endif - # umpteen zillion filenames along with it (we use `...' instead) - # but we don't want this echoing done when the user has said - # he doesn't want to see commands echoed by using -s. --ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s -+ifeq ($(silent-make),yes) # if -s - +cmdecho := echo >/dev/null - else # not -s - +cmdecho := echo -diff --git a/Makerules b/Makerules -index d1e139d03c..09c0cf8357 100644 ---- a/Makerules -+++ b/Makerules -@@ -794,7 +794,7 @@ endif - # Maximize efficiency by minimizing the number of rules. - .SUFFIXES: # Clear the suffix list. We don't use suffix rules. - # Don't define any builtin rules. --MAKEFLAGS := $(MAKEFLAGS)r -+MAKEFLAGS := $(MAKEFLAGS) -r - - # Generic rule for making directories. - %/: -@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r - .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c)) - - # Use the verbose option of ar and tar when not running silently. --ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s -+ifeq ($(silent-make),no) # if not -s - verbose := v - else # -s - verbose := -diff --git a/elf/rtld-Rules b/elf/rtld-Rules -index ca00dd1fe2..3c5e273f2b 100644 ---- a/elf/rtld-Rules -+++ b/elf/rtld-Rules -@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\ - mv -f $@T $@ - - # Use the verbose option of ar and tar when not running silently. --ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s -+ifeq ($(silent-make),no) # if not -s - verbose := v - else # -s - verbose := --- -2.37.3 - diff --git a/nscd-aicache.patch b/nscd-aicache.patch deleted file mode 100644 index 9a3b6c7..0000000 --- a/nscd-aicache.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 6e33e5c4b73cea7b8aa3de0947123db16200fb65 Mon Sep 17 00:00:00 2001 -From: Siddhesh Poyarekar -Date: Tue, 4 Oct 2022 18:40:25 -0400 -Subject: [PATCH] nscd: Drop local address tuple variable [BZ #29607] -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When a request needs to be resent (e.g. due to insufficient buffer -space), the references to subsequent tuples in the local variable are -stale and should not be used. This used to work by accident before, but -since 1d495912a it no longer does. Instead of trying to reset it, just -let gethostbyname4_r write into TUMPBUF6 for us, thus maintaining a -consistent state at all times. This is now consistent with what is done -in gaih_inet for getaddrinfo. - -Resolves: BZ #29607 -Reported-by: Holger Hoffstätte -Tested-by: Holger Hoffstätte -Reviewed-by: Carlos O'Donell ---- - nscd/aicache.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/nscd/aicache.c b/nscd/aicache.c -index 51e793199f..e0baed170b 100644 ---- a/nscd/aicache.c -+++ b/nscd/aicache.c -@@ -110,11 +110,10 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, - "gethostbyname4_r"); - if (fct4 != NULL) - { -- struct gaih_addrtuple atmem; - struct gaih_addrtuple *at; - while (1) - { -- at = &atmem; -+ at = NULL; - rc6 = 0; - herrno = 0; - status[1] = DL_CALL_FCT (fct4, (key, &at, -@@ -137,7 +136,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, - goto next_nip; - - /* We found the data. Count the addresses and the size. */ -- for (const struct gaih_addrtuple *at2 = at = &atmem; at2 != NULL; -+ for (const struct gaih_addrtuple *at2 = at; at2 != NULL; - at2 = at2->next) - { - ++naddrs; --- -2.38.0 - diff --git a/nscd-netlink-cache-invalidation.patch b/nscd-netlink-cache-invalidation.patch deleted file mode 100644 index 1162398..0000000 --- a/nscd-netlink-cache-invalidation.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 02ca25fef2785974011e9c5beecc99b900b69fd7 Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -Date: Wed, 27 Jul 2022 11:44:07 +0200 -Subject: [PATCH] nscd: Fix netlink cache invalidation if epoll is used [BZ - #29415] - -Processes cache network interface information such as whether IPv4 or IPv6 -are enabled. This is only checked again if the "netlink timestamp" provided -by nscd changed, which is triggered by netlink socket activity. - -However, in the epoll handler for the netlink socket, it was missed to -assign the new timestamp to the nscd database. The handler for plain poll -did that properly, copy that over. - -This bug caused that e.g. processes which started before network -configuration got unusuable addresses from getaddrinfo, like IPv6 only even -though only IPv4 is available: -https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041 - -It's a bit hard to reproduce, so I verified this by checking the timestamp -on calls to __check_pf manually. Without this patch it's stuck at 1, now -it's increasing on network changes as expected. - -Signed-off-by: Fabian Vogt ---- - nscd/connections.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/nscd/connections.c b/nscd/connections.c -index 61d1674eb4..531d2e83df 100644 ---- a/nscd/connections.c -+++ b/nscd/connections.c -@@ -2284,7 +2284,8 @@ main_loop_epoll (int efd) - sizeof (buf))) != -1) - ; - -- __bump_nl_timestamp (); -+ dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP] -+ = __bump_nl_timestamp (); - } - # endif - else --- -2.37.2 - diff --git a/printf-grouping.patch b/printf-grouping.patch new file mode 100644 index 0000000..ea0821e --- /dev/null +++ b/printf-grouping.patch @@ -0,0 +1,159 @@ +From c980549cc6a1c03c23cc2fe3e7b0fe626a0364b0 Mon Sep 17 00:00:00 2001 +From: Carlos O'Donell +Date: Thu, 19 Jan 2023 12:50:20 +0100 +Subject: [PATCH] Account for grouping in printf width (bug 30068) + +This is a partial fix for mishandling of grouping when formatting +integers. It properly computes the width in the presence of grouping +characters when the width is larger than the number of significant +digits. The precision related issue is documented in bug 23432. + +Co-authored-by: Andreas Schwab +--- + stdio-common/Makefile | 2 ++ + stdio-common/tst-grouping3.c | 54 +++++++++++++++++++++++++++++ + stdio-common/vfprintf-process-arg.c | 22 +++++++++--- + 3 files changed, 73 insertions(+), 5 deletions(-) + create mode 100644 stdio-common/tst-grouping3.c + +diff --git a/stdio-common/Makefile b/stdio-common/Makefile +index 34fdd6d1f8..652d9e5f95 100644 +--- a/stdio-common/Makefile ++++ b/stdio-common/Makefile +@@ -196,6 +196,7 @@ tests := \ + tst-gets \ + tst-grouping \ + tst-grouping2 \ ++ tst-grouping3 \ + tst-long-dbl-fphex \ + tst-memstream-string \ + tst-obprintf \ +@@ -340,6 +341,7 @@ $(objpfx)tst-sscanf.out: $(gen-locales) + $(objpfx)tst-swprintf.out: $(gen-locales) + $(objpfx)tst-vfprintf-mbs-prec.out: $(gen-locales) + $(objpfx)tst-vfprintf-width-i18n.out: $(gen-locales) ++$(objpfx)tst-grouping3.out: $(gen-locales) + endif + + tst-printf-bz18872-ENV = MALLOC_TRACE=$(objpfx)tst-printf-bz18872.mtrace \ +diff --git a/stdio-common/tst-grouping3.c b/stdio-common/tst-grouping3.c +new file mode 100644 +index 0000000000..e9e39218e2 +--- /dev/null ++++ b/stdio-common/tst-grouping3.c +@@ -0,0 +1,54 @@ ++/* Test printf with grouping and padding (bug 30068) ++ Copyright (C) 2023 Free Software Foundation, Inc. ++ 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 ++ . */ ++ ++#include ++#include ++#include ++#include ++ ++static int ++do_test (void) ++{ ++ char buf[80]; ++ ++ xsetlocale (LC_NUMERIC, "de_DE.UTF-8"); ++ ++ /* The format string has the following conversion specifier: ++ ' - Use thousands grouping. ++ + - The result of a signed conversion shall begin with a sign. ++ - - Left justified. ++ 13 - Minimum 13 bytes of width. ++ 9 - Minimum 9 digits of precision. ++ ++ In bug 30068 the grouping characters were not accounted for in ++ the width, and were added after the fact resulting in a 15-byte ++ output instead of a 13-byte output. The two additional bytes ++ come from the locale-specific thousands separator. This increase ++ in size could result in a buffer overflow if a reasonable caller ++ calculated the size of the expected buffer using nl_langinfo to ++ determine the sie of THOUSEP in bytes. ++ ++ This bug is distinct from bug 23432 which has to do with the ++ minimum precision calculation (digit based). */ ++ sprintf (buf, "%+-'13.9d", 1234567); ++ TEST_COMPARE_STRING (buf, "+001.234.567 "); ++ ++ return 0; ++} ++ ++#include +diff --git a/stdio-common/vfprintf-process-arg.c b/stdio-common/vfprintf-process-arg.c +index 24c9125f9f..8c0fcbcf78 100644 +--- a/stdio-common/vfprintf-process-arg.c ++++ b/stdio-common/vfprintf-process-arg.c +@@ -186,11 +186,17 @@ LABEL (unsigned_number): /* Unsigned number of base BASE. */ + bool octal_marker = (prec <= number_length && number.word != 0 + && alt && base == 8); + +- prec = MAX (0, prec - (workend - string)); ++ /* At this point prec_inc is the additional bytes required for the ++ specificed precision. It is 0 if the precision would not have ++ required additional bytes i.e. the number of input digits is more ++ than the precision. It is greater than zero if the precision is ++ more than the number of digits without grouping (precision only ++ considers digits). */ ++ unsigned int prec_inc = MAX (0, prec - (workend - string)); + + if (!left) + { +- width -= number_length + prec; ++ width -= number_length + prec_inc; + + if (number.word != 0 && alt && (base == 16 || base == 2)) + /* Account for 0X, 0x, 0B or 0b hex or binary marker. */ +@@ -221,7 +227,7 @@ LABEL (unsigned_number): /* Unsigned number of base BASE. */ + Xprintf_buffer_putc (buf, spec); + } + +- width += prec; ++ width += prec_inc; + Xprintf_buffer_pad (buf, L_('0'), width); + + if (octal_marker) +@@ -237,6 +243,8 @@ LABEL (unsigned_number): /* Unsigned number of base BASE. */ + } + else + { ++ /* Perform left justification adjustments. */ ++ + if (is_negative) + { + Xprintf_buffer_putc (buf, L_('-')); +@@ -263,9 +271,13 @@ LABEL (unsigned_number): /* Unsigned number of base BASE. */ + if (octal_marker) + --width; + +- width -= workend - string + prec; ++ /* Adjust the width by subtracting the number of bytes ++ required to represent the number with grouping characters ++ (NUMBER_LENGTH) and any additional bytes required for ++ precision. */ ++ width -= number_length + prec_inc; + +- Xprintf_buffer_pad (buf, L_('0'), prec); ++ Xprintf_buffer_pad (buf, L_('0'), prec_inc); + + if (octal_marker) + Xprintf_buffer_putc (buf, L_('0')); +-- +2.39.1 + diff --git a/strftime-time64.patch b/strftime-time64.patch new file mode 100644 index 0000000..5c3cd84 --- /dev/null +++ b/strftime-time64.patch @@ -0,0 +1,137 @@ +From 41349f6f67c83e7bafe49f985b56493d2c4c9c77 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Thu, 26 Jan 2023 14:25:05 +0100 +Subject: [PATCH] Use 64-bit time_t interfaces in strftime and strptime (bug + 30053) + +Both functions use time_t only internally, so the ABI is not affected. +--- + time/Makefile | 3 ++- + time/strftime_l.c | 4 +++ + time/strptime_l.c | 4 ++- + time/tst-strftime4-time64.c | 1 + + time/tst-strftime4.c | 52 +++++++++++++++++++++++++++++++++++++ + 5 files changed, 62 insertions(+), 2 deletions(-) + create mode 100644 time/tst-strftime4-time64.c + create mode 100644 time/tst-strftime4.c + +diff --git a/time/Makefile b/time/Makefile +index d86f2105c5..92bc3db315 100644 +--- a/time/Makefile ++++ b/time/Makefile +@@ -50,7 +50,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ + tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \ + tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \ + tst-settimeofday tst-itimer tst-gmtime tst-timegm \ +- tst-timespec_get tst-timespec_getres ++ tst-timespec_get tst-timespec_getres tst-strftime4 + + tests-time64 := \ + tst-adjtime-time64 \ +@@ -65,6 +65,7 @@ tests-time64 := \ + tst-itimer-time64 \ + tst-mktime4-time64 \ + tst-settimeofday-time64 \ ++ tst-strftime4-time64 \ + tst-timegm-time64 \ + tst-timespec_get-time64 \ + tst-timespec_getres-time64 \ +diff --git a/time/strftime_l.c b/time/strftime_l.c +index e09561c39c..402c6c4111 100644 +--- a/time/strftime_l.c ++++ b/time/strftime_l.c +@@ -159,6 +159,10 @@ extern char *tzname[]; + #ifdef _LIBC + # define tzname __tzname + # define tzset __tzset ++ ++# define time_t __time64_t ++# define __gmtime_r(t, tp) __gmtime64_r (t, tp) ++# define mktime(tp) __mktime64 (tp) + #endif + + #if !HAVE_TM_GMTOFF +diff --git a/time/strptime_l.c b/time/strptime_l.c +index 80fd705b8d..85c3249fcc 100644 +--- a/time/strptime_l.c ++++ b/time/strptime_l.c +@@ -30,8 +30,10 @@ + #ifdef _LIBC + # define HAVE_LOCALTIME_R 0 + # include "../locale/localeinfo.h" +-#endif + ++# define time_t __time64_t ++# define __localtime_r(t, tp) __localtime64_r (t, tp) ++#endif + + #if ! HAVE_LOCALTIME_R && ! defined localtime_r + # ifdef _LIBC +diff --git a/time/tst-strftime4-time64.c b/time/tst-strftime4-time64.c +new file mode 100644 +index 0000000000..4d47ee7d79 +--- /dev/null ++++ b/time/tst-strftime4-time64.c +@@ -0,0 +1 @@ ++#include "tst-strftime4.c" +diff --git a/time/tst-strftime4.c b/time/tst-strftime4.c +new file mode 100644 +index 0000000000..659716d0fa +--- /dev/null ++++ b/time/tst-strftime4.c +@@ -0,0 +1,52 @@ ++/* Test strftime and strptime after 2038-01-19 03:14:07 UTC (bug 30053). ++ Copyright (C) 2023 Free Software Foundation, Inc. ++ 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 ++ . */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++static int ++do_test (void) ++{ ++ TEST_VERIFY_EXIT (setenv ("TZ", "UTC0", 1) == 0); ++ tzset (); ++ if (sizeof (time_t) > 4) ++ { ++ time_t wrap = (time_t) 2147483648LL; ++ char buf[80]; ++ struct tm *tm = gmtime (&wrap); ++ TEST_VERIFY_EXIT (tm != NULL); ++ TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%s", tm) > 0); ++ puts (buf); ++ TEST_VERIFY (strcmp (buf, "2147483648") == 0); ++ ++ struct tm tm2; ++ char *p = strptime (buf, "%s", &tm2); ++ TEST_VERIFY_EXIT (p != NULL && *p == '\0'); ++ time_t t = mktime (&tm2); ++ printf ("%lld\n", (long long) t); ++ TEST_VERIFY (t == wrap); ++ } ++ else ++ FAIL_UNSUPPORTED ("32-bit time_t"); ++ return 0; ++} ++ ++#include +-- +2.39.1 + diff --git a/sys-mount-kernel-definition.patch b/sys-mount-kernel-definition.patch deleted file mode 100644 index 5468c43..0000000 --- a/sys-mount-kernel-definition.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c68b6044bc7945716431f1adc091b17c39b80a06 Mon Sep 17 00:00:00 2001 -From: Adhemerval Zanella -Date: Wed, 10 Aug 2022 14:24:45 -0300 -Subject: [PATCH] linux: Mimic kernel defition for BLOCK_SIZE - -To avoid possible warnings if the kernel header is included before -sys/mount.h. - -Reviewed-by: Florian Weimer ---- - sysdeps/unix/sysv/linux/sys/mount.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h -index f965986ba8..df6b0dbb42 100644 ---- a/sysdeps/unix/sysv/linux/sys/mount.h -+++ b/sysdeps/unix/sysv/linux/sys/mount.h -@@ -27,8 +27,8 @@ - #include - #include - --#define BLOCK_SIZE 1024 - #define BLOCK_SIZE_BITS 10 -+#define BLOCK_SIZE (1< -Date: Wed, 10 Aug 2022 14:24:47 -0300 -Subject: [PATCH] linux: Fix sys/mount.h usage with kernel headers - -Now that kernel exports linux/mount.h and includes it on linux/fs.h, -its definitions might clash with glibc exports sys/mount.h. To avoid -the need to rearrange the Linux header to be always after glibc one, -the glibc sys/mount.h is changed to: - - 1. Undefine the macros also used as enum constants. This covers prior - inclusion of (for instance MS_RDONLY). - - 2. Include based on the usual __has_include check - (needs to use __has_include ("linux/mount.h") to paper over GCC - bugs. - - 3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined. - (FSOPEN_CLOEXEC should be a very close proxy.) - - 4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined. - (Added in the same commit on the Linux side.) - -This patch also adds some tests to check if including linux/fs.h and -linux/mount.h after and before sys/mount.h does work. - -Checked on x86_64-linux-gnu. - -Reviewed-by: Florian Weimer ---- - sysdeps/unix/sysv/linux/Makefile | 8 +++ - sysdeps/unix/sysv/linux/sys/mount.h | 71 +++++++++++++++++--- - sysdeps/unix/sysv/linux/tst-mount-compile.py | 66 ++++++++++++++++++ - 3 files changed, 137 insertions(+), 8 deletions(-) - create mode 100755 sysdeps/unix/sysv/linux/tst-mount-compile.py - -diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile -index 3f31c19e4a..60e4cb1521 100644 ---- a/sysdeps/unix/sysv/linux/Makefile -+++ b/sysdeps/unix/sysv/linux/Makefile -@@ -265,6 +265,14 @@ $(objpfx)tst-mount-consts.out: ../sysdeps/unix/sysv/linux/tst-mount-consts.py - < /dev/null > $@ 2>&1; $(evaluate-test) - $(objpfx)tst-mount-consts.out: $(sysdeps-linux-python-deps) - -+tests-special += $(objpfx)tst-mount-compile.out -+$(objpfx)tst-mount-compile.out: ../sysdeps/unix/sysv/linux/tst-mount-compile.py -+ $(sysdeps-linux-python) \ -+ ../sysdeps/unix/sysv/linux/tst-mount-compile.py \ -+ $(sysdeps-linux-python-cc) \ -+ < /dev/null > $@ 2>&1; $(evaluate-test) -+$(objpfx)tst-mount-compile.out: $(sysdeps-linux-python-deps) -+ - tst-rseq-disable-ENV = GLIBC_TUNABLES=glibc.pthread.rseq=0 - - endif # $(subdir) == misc -diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h -index df6b0dbb42..2e3fd6a7fe 100644 ---- a/sysdeps/unix/sysv/linux/sys/mount.h -+++ b/sysdeps/unix/sysv/linux/sys/mount.h -@@ -27,6 +27,13 @@ - #include - #include - -+#ifdef __has_include -+# if __has_include ("linux/mount.h") -+# include "linux/mount.h" -+# endif -+#endif -+ -+ - #define BLOCK_SIZE_BITS 10 - #define BLOCK_SIZE (1<. -+ -+import argparse -+import sys -+ -+import glibcextract -+ -+ -+def main(): -+ """The main entry point.""" -+ parser = argparse.ArgumentParser( -+ description='Check if glibc provided sys/mount.h can be ' -+ ' used along related kernel headers.') -+ parser.add_argument('--cc', metavar='CC', -+ help='C compiler (including options) to use') -+ args = parser.parse_args() -+ -+ if glibcextract.compile_c_snippet( -+ '#include ', -+ args.cc).returncode != 0: -+ sys.exit (77) -+ -+ def check(testname, snippet): -+ # Add -Werror to catch macro redefinitions and _ISOMAC to avoid -+ # internal glibc definitions. -+ r = glibcextract.compile_c_snippet(snippet, args.cc, -+ '-Werror -D_ISOMAC') -+ if r.returncode != 0: -+ print('error: test {}:\n{}'.format(testname, r.output.decode())) -+ return r.returncode -+ -+ status = max( -+ check("sys/mount.h + linux/mount.h", -+ "#include \n" -+ "#include "), -+ check("sys/mount.h + linux/fs.h", -+ "#include \n" -+ "#include "), -+ check("linux/mount.h + sys/mount.h", -+ "#include \n" -+ "#include "), -+ check("linux/fs.h + sys/mount.h", -+ "#include \n" -+ "#include ")) -+ sys.exit(status) -+ -+if __name__ == '__main__': -+ main() --- -2.37.2 - diff --git a/syslog-extra-whitespace.patch b/syslog-extra-whitespace.patch deleted file mode 100644 index 7542f68..0000000 --- a/syslog-extra-whitespace.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 645d94808aaa90fb1b20a25ff70bb50d9eb1d55b Mon Sep 17 00:00:00 2001 -From: Adhemerval Zanella -Date: Mon, 5 Sep 2022 09:34:39 -0300 -Subject: [PATCH] syslog: Remove extra whitespace between timestamp and message - (BZ#29544) - -The rfc3164 clear states that a single space character must follow -the timestamp field. - -Checked on x86_64-linux-gnu. ---- - misc/syslog.c | 2 +- - misc/tst-syslog.c | 9 ++++++--- - 2 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/misc/syslog.c b/misc/syslog.c -index b88f66c835..f67d4b58a4 100644 ---- a/misc/syslog.c -+++ b/misc/syslog.c -@@ -167,7 +167,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap, - _nl_C_locobj_ptr); - - #define SYSLOG_HEADER(__pri, __timestamp, __msgoff, pid) \ -- "<%d>%s %n%s%s%.0d%s: ", \ -+ "<%d>%s%n%s%s%.0d%s: ", \ - __pri, __timestamp, __msgoff, \ - LogTag == NULL ? __progname : LogTag, \ - "[" + (pid == 0), pid, "]" + (pid == 0) -diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c -index 1d332ece53..3560b518a2 100644 ---- a/misc/tst-syslog.c -+++ b/misc/tst-syslog.c -@@ -275,16 +275,19 @@ parse_syslog_msg (const char *msg) - { - struct msg_t r = { .pid = -1 }; - int number; -+ int wsb, wsa; - - #define STRINPUT(size) XSTRINPUT(size) - #define XSTRINPUT(size) "%" # size "s" - - /* The message in the form: -- <179>Apr 8 14:51:19 tst-syslog: message 176 3 */ -- int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH) -+ <179>Apr 8 14:51:19 tst-syslog: message 176 3 */ -+ int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d%n %n" STRINPUT(IDENT_LENGTH) - " " STRINPUT(MSG_LENGTH) " %*d %*d", -- &number, r.ident, r.msg); -+ &number, &wsb, &wsa, r.ident, r.msg); - TEST_COMPARE (n, 3); -+ /* It should only one space between timestamp and message. */ -+ TEST_COMPARE (wsa - wsb, 1); - - r.facility = number & LOG_FACMASK; - r.priority = number & LOG_PRIMASK; --- -2.37.3 - diff --git a/syslog-large-messages.patch b/syslog-large-messages.patch deleted file mode 100644 index 4db9617..0000000 --- a/syslog-large-messages.patch +++ /dev/null @@ -1,336 +0,0 @@ -From b0e7888d1fa2dbd2d9e1645ec8c796abf78880b9 Mon Sep 17 00:00:00 2001 -From: Adhemerval Zanella -Date: Sun, 28 Aug 2022 16:52:53 -0300 -Subject: [PATCH] syslog: Fix large messages (BZ#29536) - -The a583b6add407c17cd change did not handle large messages that -would require a heap allocation correctly, where the message itself -is not take in consideration. - -This patch fixes it and extend the tst-syslog to check for large -messages as well. - -Checked on x86_64-linux-gnu. - -Reviewed-by: Siddhesh Poyarekar -(cherry picked from commit 52a5be0df411ef3ff45c10c7c308cb92993d15b1) ---- - misc/syslog.c | 18 +++--- - misc/tst-syslog.c | 152 +++++++++++++++++++++++++++++++++++++++------- - 2 files changed, 142 insertions(+), 28 deletions(-) - -diff --git a/misc/syslog.c b/misc/syslog.c -index 554089bfc4..b88f66c835 100644 ---- a/misc/syslog.c -+++ b/misc/syslog.c -@@ -193,28 +193,32 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap, - int vl = __vsnprintf_internal (bufs + l, sizeof bufs - l, fmt, apc, - mode_flags); - if (0 <= vl && vl < sizeof bufs - l) -- { -- buf = bufs; -- bufsize = l + vl; -- } -+ buf = bufs; -+ bufsize = l + vl; - - va_end (apc); - } - - if (buf == NULL) - { -- buf = malloc (l * sizeof (char)); -+ buf = malloc ((bufsize + 1) * sizeof (char)); - if (buf != NULL) - { - /* Tell the cancellation handler to free this buffer. */ - clarg.buf = buf; - - if (has_ts) -- __snprintf (bufs, sizeof bufs, -+ __snprintf (buf, l + 1, - SYSLOG_HEADER (pri, timestamp, &msgoff, pid)); - else -- __snprintf (bufs, sizeof bufs, -+ __snprintf (buf, l + 1, - SYSLOG_HEADER_WITHOUT_TS (pri, &msgoff)); -+ -+ va_list apc; -+ va_copy (apc, ap); -+ __vsnprintf_internal (buf + l, bufsize - l + 1, fmt, apc, -+ mode_flags); -+ va_end (apc); - } - else - { -diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c -index e550d15796..1d332ece53 100644 ---- a/misc/tst-syslog.c -+++ b/misc/tst-syslog.c -@@ -68,21 +68,19 @@ static const int priorities[] = - LOG_DEBUG - }; - --enum -- { -- ident_length = 64, -- msg_length = 64 -- }; -+#define IDENT_LENGTH 64 -+#define MSG_LENGTH 1024 - - #define SYSLOG_MSG_BASE "syslog_message" - #define OPENLOG_IDENT "openlog_ident" -+static char large_message[MSG_LENGTH]; - - struct msg_t - { - int priority; - int facility; -- char ident[ident_length]; -- char msg[msg_length]; -+ char ident[IDENT_LENGTH]; -+ char msg[MSG_LENGTH]; - pid_t pid; - }; - -@@ -147,6 +145,37 @@ check_syslog_message (const struct msg_t *msg, int msgnum, int options, - return true; - } - -+static void -+send_syslog_large (int options) -+{ -+ int facility = LOG_USER; -+ int priority = LOG_INFO; -+ -+ syslog (facility | priority, "%s %d %d", large_message, facility, -+ priority); -+} -+ -+static void -+send_vsyslog_large (int options) -+{ -+ int facility = LOG_USER; -+ int priority = LOG_INFO; -+ -+ call_vsyslog (facility | priority, "%s %d %d", large_message, facility, -+ priority); -+} -+ -+static bool -+check_syslog_message_large (const struct msg_t *msg, int msgnum, int options, -+ pid_t pid) -+{ -+ TEST_COMPARE (msg->facility, LOG_USER); -+ TEST_COMPARE (msg->priority, LOG_INFO); -+ TEST_COMPARE_STRING (msg->msg, large_message); -+ -+ return false; -+} -+ - static void - send_openlog (int options) - { -@@ -179,6 +208,17 @@ send_openlog (int options) - closelog (); - } - -+static void -+send_openlog_large (int options) -+{ -+ /* Define a non-default IDENT and a not default facility. */ -+ openlog (OPENLOG_IDENT, options, LOG_LOCAL0); -+ -+ syslog (LOG_INFO, "%s %d %d", large_message, LOG_LOCAL0, LOG_INFO); -+ -+ closelog (); -+} -+ - static bool - check_openlog_message (const struct msg_t *msg, int msgnum, - int options, pid_t pid) -@@ -189,7 +229,7 @@ check_openlog_message (const struct msg_t *msg, int msgnum, - int expected_priority = priorities[msgnum % array_length (priorities)]; - TEST_COMPARE (msg->priority, expected_priority); - -- char expected_ident[ident_length]; -+ char expected_ident[IDENT_LENGTH]; - snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:", - OPENLOG_IDENT, - options & LOG_PID ? "[" : "", -@@ -211,15 +251,38 @@ check_openlog_message (const struct msg_t *msg, int msgnum, - return true; - } - -+static bool -+check_openlog_message_large (const struct msg_t *msg, int msgnum, -+ int options, pid_t pid) -+{ -+ char expected_ident[IDENT_LENGTH]; -+ snprintf (expected_ident, sizeof (expected_ident), "%s%s%.0d%s:", -+ OPENLOG_IDENT, -+ options & LOG_PID ? "[" : "", -+ options & LOG_PID ? pid : 0, -+ options & LOG_PID ? "]" : ""); -+ -+ TEST_COMPARE_STRING (msg->ident, expected_ident); -+ TEST_COMPARE_STRING (msg->msg, large_message); -+ TEST_COMPARE (msg->priority, LOG_INFO); -+ TEST_COMPARE (msg->facility, LOG_LOCAL0); -+ -+ return false; -+} -+ - static struct msg_t - parse_syslog_msg (const char *msg) - { - struct msg_t r = { .pid = -1 }; - int number; - -+#define STRINPUT(size) XSTRINPUT(size) -+#define XSTRINPUT(size) "%" # size "s" -+ - /* The message in the form: -- <179>Apr 8 14:51:19 tst-syslog: syslog message 176 3 */ -- int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d %32s %64s %*d %*d", -+ <179>Apr 8 14:51:19 tst-syslog: message 176 3 */ -+ int n = sscanf (msg, "<%3d>%*s %*d %*d:%*d:%*d " STRINPUT(IDENT_LENGTH) -+ " " STRINPUT(MSG_LENGTH) " %*d %*d", - &number, r.ident, r.msg); - TEST_COMPARE (n, 3); - -@@ -246,7 +309,7 @@ parse_syslog_console (const char *msg) - - /* The message in the form: - openlog_ident: syslog_message 128 0 */ -- int n = sscanf (msg, "%32s %64s %d %d", -+ int n = sscanf (msg, STRINPUT(IDENT_LENGTH) " " STRINPUT(MSG_LENGTH) " %d %d", - r.ident, r.msg, &facility, &priority); - TEST_COMPARE (n, 4); - -@@ -281,7 +344,7 @@ check_syslog_udp (void (*syslog_send)(int), int options, - int msgnum = 0; - while (1) - { -- char buf[512]; -+ char buf[2048]; - size_t l = xrecvfrom (server_udp, buf, sizeof (buf), 0, - (struct sockaddr *) &addr, &addrlen); - buf[l] = '\0'; -@@ -325,7 +388,7 @@ check_syslog_tcp (void (*syslog_send)(int), int options, - - int client_tcp = xaccept (server_tcp, NULL, NULL); - -- char buf[512], *rb = buf; -+ char buf[2048], *rb = buf; - size_t rbl = sizeof (buf); - size_t prl = 0; /* Track the size of the partial record. */ - int msgnum = 0; -@@ -393,20 +456,34 @@ check_syslog_console_read (FILE *fp) - } - - static void --check_syslog_console (void) -+check_syslog_console_read_large (FILE *fp) -+{ -+ char buf[2048]; -+ TEST_VERIFY (fgets (buf, sizeof (buf), fp) != NULL); -+ struct msg_t msg = parse_syslog_console (buf); -+ -+ TEST_COMPARE_STRING (msg.ident, OPENLOG_IDENT ":"); -+ TEST_COMPARE_STRING (msg.msg, large_message); -+ TEST_COMPARE (msg.priority, LOG_INFO); -+ TEST_COMPARE (msg.facility, LOG_LOCAL0); -+} -+ -+static void -+check_syslog_console (void (*syslog_send)(int), -+ void (*syslog_check)(FILE *fp)) - { - xmkfifo (_PATH_CONSOLE, 0666); - - pid_t sender_pid = xfork (); - if (sender_pid == 0) - { -- send_openlog (LOG_CONS); -+ syslog_send (LOG_CONS); - _exit (0); - } - - { - FILE *fp = xfopen (_PATH_CONSOLE, "r+"); -- check_syslog_console_read (fp); -+ syslog_check (fp); - xfclose (fp); - } - -@@ -425,16 +502,28 @@ send_openlog_callback (void *clousure) - } - - static void --check_syslog_perror (void) -+send_openlog_callback_large (void *clousure) -+{ -+ int options = *(int *) clousure; -+ send_openlog_large (options); -+} -+ -+static void -+check_syslog_perror (bool large) - { - struct support_capture_subprocess result; -- result = support_capture_subprocess (send_openlog_callback, -+ result = support_capture_subprocess (large -+ ? send_openlog_callback_large -+ : send_openlog_callback, - &(int){LOG_PERROR}); - - FILE *mfp = fmemopen (result.err.buffer, result.err.length, "r"); - if (mfp == NULL) - FAIL_EXIT1 ("fmemopen: %m"); -- check_syslog_console_read (mfp); -+ if (large) -+ check_syslog_console_read_large (mfp); -+ else -+ check_syslog_console_read (mfp); - xfclose (mfp); - - support_capture_subprocess_check (&result, "tst-openlog-child", 0, -@@ -462,10 +551,31 @@ do_test (void) - check_syslog_tcp (send_openlog, LOG_PID, check_openlog_message); - - /* Check the LOG_CONS option. */ -- check_syslog_console (); -+ check_syslog_console (send_openlog, check_syslog_console_read); - - /* Check the LOG_PERROR option. */ -- check_syslog_perror (); -+ check_syslog_perror (false); -+ -+ /* Similar tests as before, but with a large message to trigger the -+ syslog path that uses dynamically allocated memory. */ -+ memset (large_message, 'a', sizeof large_message - 1); -+ large_message[sizeof large_message - 1] = '\0'; -+ -+ check_syslog_udp (send_syslog_large, 0, check_syslog_message_large); -+ check_syslog_tcp (send_syslog_large, 0, check_syslog_message_large); -+ -+ check_syslog_udp (send_vsyslog_large, 0, check_syslog_message_large); -+ check_syslog_tcp (send_vsyslog_large, 0, check_syslog_message_large); -+ -+ check_syslog_udp (send_openlog_large, 0, check_openlog_message_large); -+ check_syslog_tcp (send_openlog_large, 0, check_openlog_message_large); -+ -+ check_syslog_udp (send_openlog_large, LOG_PID, check_openlog_message_large); -+ check_syslog_tcp (send_openlog_large, LOG_PID, check_openlog_message_large); -+ -+ check_syslog_console (send_openlog_large, check_syslog_console_read_large); -+ -+ check_syslog_perror (true); - - return 0; - } --- -2.37.3 - diff --git a/x86-64-avx2-string-functions.patch b/x86-64-avx2-string-functions.patch deleted file mode 100644 index a64fd5d..0000000 --- a/x86-64-avx2-string-functions.patch +++ /dev/null @@ -1,576 +0,0 @@ -From 18bec23cbb4d530a2a8ce95353770661fabcd55f Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 1/8] x86: include BMI1 and BMI2 in x86-64-v3 level - -The "System V Application Binary Interface AMD64 Architecture Processor -Supplement" mandates the BMI1 and BMI2 CPU features for the x86-64-v3 -level. - -Reviewed-by: Noah Goldstein -(cherry picked from commit b80f16adbd979831bf25ea491e1261e81885c2b6) ---- - sysdeps/x86/get-isa-level.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/sysdeps/x86/get-isa-level.h b/sysdeps/x86/get-isa-level.h -index 1ade78ab73..5b4dd5f062 100644 ---- a/sysdeps/x86/get-isa-level.h -+++ b/sysdeps/x86/get-isa-level.h -@@ -47,6 +47,8 @@ get_isa_level (const struct cpu_features *cpu_features) - isa_level |= GNU_PROPERTY_X86_ISA_1_V2; - if (CPU_FEATURE_USABLE_P (cpu_features, AVX) - && CPU_FEATURE_USABLE_P (cpu_features, AVX2) -+ && CPU_FEATURE_USABLE_P (cpu_features, BMI1) -+ && CPU_FEATURE_USABLE_P (cpu_features, BMI2) - && CPU_FEATURE_USABLE_P (cpu_features, F16C) - && CPU_FEATURE_USABLE_P (cpu_features, FMA) - && CPU_FEATURE_USABLE_P (cpu_features, LZCNT) --- -2.38.0 - - -From 46479e5d10ed87825aa277da158d6a687974518b Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 2/8] x86-64: Require BMI2 for AVX2 str(n)casecmp - implementations - -The AVX2 str(n)casecmp implementations use the 'bzhi' instruction, which -belongs to the BMI2 CPU feature. - -NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF -as BSF if the CPU doesn't support TZCNT, and produces the same result -for non-zero input. - -Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S") -Partially resolves: BZ #29611 - -Reviewed-by: Noah Goldstein -(cherry picked from commit 10f79d3670b036925da63dc532b122d27ce65ff8) ---- - sysdeps/x86_64/multiarch/ifunc-impl-list.c | 28 +++++++++++++++------ - sysdeps/x86_64/multiarch/ifunc-strcasecmp.h | 1 + - 2 files changed, 21 insertions(+), 8 deletions(-) - -diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -index a71444eccb..d208fae4bf 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c -+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -@@ -448,13 +448,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL (i, name, strcasecmp, - X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp, - (CPU_FEATURE_USABLE (AVX512VL) -- && CPU_FEATURE_USABLE (AVX512BW)), -+ && CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI2)), - __strcasecmp_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __strcasecmp_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __strcasecmp_avx2_rtm) - X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp, -@@ -470,13 +473,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL (i, name, strcasecmp_l, - X86_IFUNC_IMPL_ADD_V4 (array, i, strcasecmp, - (CPU_FEATURE_USABLE (AVX512VL) -- && CPU_FEATURE_USABLE (AVX512BW)), -+ && CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI2)), - __strcasecmp_l_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __strcasecmp_l_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, strcasecmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __strcasecmp_l_avx2_rtm) - X86_IFUNC_IMPL_ADD_V2 (array, i, strcasecmp_l, -@@ -638,13 +644,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL (i, name, strncasecmp, - X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp, - (CPU_FEATURE_USABLE (AVX512VL) -- && CPU_FEATURE_USABLE (AVX512BW)), -+ && CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI2)), - __strncasecmp_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __strncasecmp_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __strncasecmp_avx2_rtm) - X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp, -@@ -660,13 +669,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL (i, name, strncasecmp_l, - X86_IFUNC_IMPL_ADD_V4 (array, i, strncasecmp, - (CPU_FEATURE_USABLE (AVX512VL) -- && CPU_FEATURE_USABLE (AVX512BW)), -+ & CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI2)), - __strncasecmp_l_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __strncasecmp_l_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, strncasecmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __strncasecmp_l_avx2_rtm) - X86_IFUNC_IMPL_ADD_V2 (array, i, strncasecmp_l, -diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h -index 68646ef199..7622af259c 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h -+++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h -@@ -34,6 +34,7 @@ IFUNC_SELECTOR (void) - const struct cpu_features *cpu_features = __get_cpu_features (); - - if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2) -+ && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2) - && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features, - AVX_Fast_Unaligned_Load, )) - { --- -2.38.0 - - -From 7afbd1e56acb721031bffd876f275dcb1af7e530 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 3/8] x86-64: Require BMI2 for AVX2 strcmp implementation - -The AVX2 strcmp implementation uses the 'bzhi' instruction, which -belongs to the BMI2 CPU feature. - -NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF -as BSF if the CPU doesn't support TZCNT, and produces the same result -for non-zero input. - -Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S") -Partially resolves: BZ #29611 - -Reviewed-by: Noah Goldstein -(cherry picked from commit 4d64c6445735e9b34e2ac8e369312cbfc2f88e17) ---- - sysdeps/x86_64/multiarch/ifunc-impl-list.c | 4 +++- - sysdeps/x86_64/multiarch/strcmp.c | 4 ++-- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -index d208fae4bf..a42b0a4620 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c -+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -@@ -591,10 +591,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - && CPU_FEATURE_USABLE (BMI2)), - __strcmp_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __strcmp_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, strcmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __strcmp_avx2_rtm) - X86_IFUNC_IMPL_ADD_V2 (array, i, strcmp, -diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c -index fdd5afe3af..9d6c9f66ba 100644 ---- a/sysdeps/x86_64/multiarch/strcmp.c -+++ b/sysdeps/x86_64/multiarch/strcmp.c -@@ -45,12 +45,12 @@ IFUNC_SELECTOR (void) - const struct cpu_features *cpu_features = __get_cpu_features (); - - if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2) -+ && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2) - && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features, - AVX_Fast_Unaligned_Load, )) - { - if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL) -- && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW) -- && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)) -+ && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)) - return OPTIMIZE (evex); - - if (CPU_FEATURE_USABLE_P (cpu_features, RTM)) --- -2.38.0 - - -From 29c577e0f54fe6e70ceacb3659179781c5569903 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 4/8] x86-64: Require BMI2 for AVX2 strncmp implementation - -The AVX2 strncmp implementations uses the 'bzhi' instruction, which -belongs to the BMI2 CPU feature. - -NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF -as BSF if the CPU doesn't support TZCNT, and produces the same result -for non-zero input. - -Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S") -Partially resolves: BZ #29611 - -Reviewed-by: Noah Goldstein -(cherry picked from commit fc7de1d9b99ae1676bc626ddca422d7abee0eb48) ---- - sysdeps/x86_64/multiarch/ifunc-impl-list.c | 7 +++++-- - sysdeps/x86_64/multiarch/strncmp.c | 4 ++-- - 2 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -index a42b0a4620..aebef3daaf 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c -+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -@@ -1176,13 +1176,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL (i, name, strncmp, - X86_IFUNC_IMPL_ADD_V4 (array, i, strncmp, - (CPU_FEATURE_USABLE (AVX512VL) -- && CPU_FEATURE_USABLE (AVX512BW)), -+ && CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI2)), - __strncmp_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __strncmp_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, strncmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __strncmp_avx2_rtm) - X86_IFUNC_IMPL_ADD_V2 (array, i, strncmp, -diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c -index 4ebe4bde30..c4f8b6bbb5 100644 ---- a/sysdeps/x86_64/multiarch/strncmp.c -+++ b/sysdeps/x86_64/multiarch/strncmp.c -@@ -41,12 +41,12 @@ IFUNC_SELECTOR (void) - const struct cpu_features *cpu_features = __get_cpu_features (); - - if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2) -+ && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2) - && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features, - AVX_Fast_Unaligned_Load, )) - { - if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL) -- && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW) -- && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2)) -+ && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512BW)) - return OPTIMIZE (evex); - - if (CPU_FEATURE_USABLE_P (cpu_features, RTM)) --- -2.38.0 - - -From d8bf4388df679fa5a3ae7889a649e573e3124530 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 5/8] x86-64: Require BMI2 for AVX2 wcs(n)cmp implementations - -The AVX2 wcs(n)cmp implementations use the 'bzhi' instruction, which -belongs to the BMI2 CPU feature. - -NB: It also uses the 'tzcnt' BMI1 instruction, but it is executed as BSF -as BSF if the CPU doesn't support TZCNT, and produces the same result -for non-zero input. - -Partially fixes: b77b06e0e296 ("x86: Optimize strcmp-avx2.S") -Partially resolves: BZ #29611 - -Reviewed-by: Noah Goldstein -(cherry picked from commit f31a5a884ed84bd37032729d4d1eb9d06c9f3c29) ---- - sysdeps/x86_64/multiarch/ifunc-impl-list.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -index aebef3daaf..fec8790c11 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c -+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -@@ -810,10 +810,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - && CPU_FEATURE_USABLE (BMI2)), - __wcscmp_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __wcscmp_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, wcscmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __wcscmp_avx2_rtm) - /* ISA V2 wrapper for SSE2 implementation because the SSE2 -@@ -830,10 +832,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - && CPU_FEATURE_USABLE (BMI2)), - __wcsncmp_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __wcsncmp_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, wcsncmp, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __wcsncmp_avx2_rtm) - /* ISA V2 wrapper for GENERIC implementation because the --- -2.38.0 - - -From d9196d4f3fa9997388655813ddd236426a16dd92 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 6/8] x86-64: Require BMI2 for AVX2 (raw|w)memchr - implementations - -The AVX2 memchr, rawmemchr and wmemchr implementations use the 'bzhi' -and 'sarx' instructions, which belongs to the BMI2 CPU feature. - -Fixes: acfd088a1963 ("x86: Optimize memchr-avx2.S") -Partially resolves: BZ #29611 - -Reviewed-by: Noah Goldstein -(cherry picked from commit e3e7fab7fe5186d18ca2046d99ba321c27db30ad) ---- - sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -index fec8790c11..7c84963d92 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c -+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -@@ -69,10 +69,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - && CPU_FEATURE_USABLE (BMI2)), - __memchr_evex_rtm) - X86_IFUNC_IMPL_ADD_V3 (array, i, memchr, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __memchr_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, memchr, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __memchr_avx2_rtm) - /* ISA V2 wrapper for SSE2 implementation because the SSE2 -@@ -335,10 +337,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - && CPU_FEATURE_USABLE (BMI2)), - __rawmemchr_evex_rtm) - X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __rawmemchr_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, rawmemchr, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __rawmemchr_avx2_rtm) - /* ISA V2 wrapper for SSE2 implementation because the SSE2 -@@ -927,10 +931,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - && CPU_FEATURE_USABLE (BMI2)), - __wmemchr_evex_rtm) - X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2)), - __wmemchr_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, wmemchr, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __wmemchr_avx2_rtm) - /* ISA V2 wrapper for SSE2 implementation because the SSE2 --- -2.38.0 - - -From 923c3f3c373f499e62160e00831dda576443317b Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 7/8] x86-64: Require BMI2 and LZCNT for AVX2 memrchr - implementation - -The AVX2 memrchr implementation uses the 'shlxl' instruction, which -belongs to the BMI2 CPU feature and uses the 'lzcnt' instruction, which -belongs to the LZCNT CPU feature. - -Fixes: af5306a735eb ("x86: Optimize memrchr-avx2.S") -Partially resolves: BZ #29611 - -Reviewed-by: Noah Goldstein -(cherry picked from commit 3c0c78afabfed4b6fc161c159e628fbf14ff370b) ---- - sysdeps/x86/isa-level.h | 1 + - sysdeps/x86_64/multiarch/ifunc-avx2.h | 1 + - sysdeps/x86_64/multiarch/ifunc-impl-list.c | 10 ++++++++-- - 3 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h -index 3c4480aba7..bbb90f5c5e 100644 ---- a/sysdeps/x86/isa-level.h -+++ b/sysdeps/x86/isa-level.h -@@ -80,6 +80,7 @@ - #define AVX_X86_ISA_LEVEL 3 - #define AVX2_X86_ISA_LEVEL 3 - #define BMI2_X86_ISA_LEVEL 3 -+#define LZCNT_X86_ISA_LEVEL 3 - #define MOVBE_X86_ISA_LEVEL 3 - - /* ISA level >= 2 guaranteed includes. */ -diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h -index a57a9952f3..f1741083fd 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-avx2.h -+++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h -@@ -37,6 +37,7 @@ IFUNC_SELECTOR (void) - - if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2) - && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2) -+ && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT) - && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features, - AVX_Fast_Unaligned_Load, )) - { -diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -index 7c84963d92..ec1c5b55fb 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c -+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -@@ -209,13 +209,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL (i, name, memrchr, - X86_IFUNC_IMPL_ADD_V4 (array, i, memrchr, - (CPU_FEATURE_USABLE (AVX512VL) -- && CPU_FEATURE_USABLE (AVX512BW)), -+ && CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI2) -+ && CPU_FEATURE_USABLE (LZCNT)), - __memrchr_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) -+ && CPU_FEATURE_USABLE (LZCNT)), - __memrchr_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, memrchr, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI2) -+ && CPU_FEATURE_USABLE (LZCNT) - && CPU_FEATURE_USABLE (RTM)), - __memrchr_avx2_rtm) - /* ISA V2 wrapper for SSE2 implementation because the SSE2 --- -2.38.0 - - -From 2d8ef784bd6a784496a6fd460de6b6f57c70a501 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 3 Oct 2022 23:46:11 +0200 -Subject: [PATCH 8/8] x86-64: Require BMI1/BMI2 for AVX2 strrchr and wcsrchr - implementations - -The AVX2 strrchr and wcsrchr implementation uses the 'blsmsk' -instruction which belongs to the BMI1 CPU feature and the 'shrx' -instruction, which belongs to the BMI2 CPU feature. - -Fixes: df7e295d18ff ("x86: Optimize {str|wcs}rchr-avx2") -Partially resolves: BZ #29611 - -Reviewed-by: Noah Goldstein -(cherry picked from commit 7e8283170c5d6805b609a040801d819e362a6292) ---- - sysdeps/x86/isa-level.h | 1 + - sysdeps/x86_64/multiarch/ifunc-avx2.h | 1 + - sysdeps/x86_64/multiarch/ifunc-impl-list.c | 17 ++++++++++++++--- - 3 files changed, 16 insertions(+), 3 deletions(-) - -diff --git a/sysdeps/x86/isa-level.h b/sysdeps/x86/isa-level.h -index bbb90f5c5e..06f6c9663e 100644 ---- a/sysdeps/x86/isa-level.h -+++ b/sysdeps/x86/isa-level.h -@@ -79,6 +79,7 @@ - /* ISA level >= 3 guaranteed includes. */ - #define AVX_X86_ISA_LEVEL 3 - #define AVX2_X86_ISA_LEVEL 3 -+#define BMI1_X86_ISA_LEVEL 3 - #define BMI2_X86_ISA_LEVEL 3 - #define LZCNT_X86_ISA_LEVEL 3 - #define MOVBE_X86_ISA_LEVEL 3 -diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h -index f1741083fd..f2f5e8a211 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-avx2.h -+++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h -@@ -36,6 +36,7 @@ IFUNC_SELECTOR (void) - const struct cpu_features *cpu_features = __get_cpu_features (); - - if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2) -+ && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI1) - && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, BMI2) - && X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, LZCNT) - && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features, -diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -index ec1c5b55fb..00a91123d3 100644 ---- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c -+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c -@@ -578,13 +578,19 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - IFUNC_IMPL (i, name, strrchr, - X86_IFUNC_IMPL_ADD_V4 (array, i, strrchr, - (CPU_FEATURE_USABLE (AVX512VL) -- && CPU_FEATURE_USABLE (AVX512BW)), -+ && CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI1) -+ && CPU_FEATURE_USABLE (BMI2)), - __strrchr_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI1) -+ && CPU_FEATURE_USABLE (BMI2)), - __strrchr_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, strrchr, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI1) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __strrchr_avx2_rtm) - /* ISA V2 wrapper for SSE2 implementation because the SSE2 -@@ -797,13 +803,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, - X86_IFUNC_IMPL_ADD_V4 (array, i, wcsrchr, - (CPU_FEATURE_USABLE (AVX512VL) - && CPU_FEATURE_USABLE (AVX512BW) -+ && CPU_FEATURE_USABLE (BMI1) - && CPU_FEATURE_USABLE (BMI2)), - __wcsrchr_evex) - X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr, -- CPU_FEATURE_USABLE (AVX2), -+ (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI1) -+ && CPU_FEATURE_USABLE (BMI2)), - __wcsrchr_avx2) - X86_IFUNC_IMPL_ADD_V3 (array, i, wcsrchr, - (CPU_FEATURE_USABLE (AVX2) -+ && CPU_FEATURE_USABLE (BMI1) -+ && CPU_FEATURE_USABLE (BMI2) - && CPU_FEATURE_USABLE (RTM)), - __wcsrchr_avx2_rtm) - /* ISA V2 wrapper for SSE2 implementation because the SSE2 --- -2.38.0 -