Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 glibc (2.34-0experimental3) experimental; urgency=medium
 .
   [ Aurelien Jarno ]
   * debian/testsuite-xfail-debian.mk: whitelist again test-xfail-tst-pkey on
     powerpc, as 32-bit protection key support on powerpc is unclear.
   * debian/testsuite-xfail-debian.mk: whitelist dirent/tst-readdir64-compat
     and signal/tst-minsigstksz-5.  Closes: #1002041.
   * debian/patches/git-updates.diff: update from upstream stable branch.
   * debian/rules.d/build.mk: Move the dynamic linker into the slibdir location
     and replace it with a symlink. This is needed for TCC which is not able to
     find the dynamic linker if it is not in a lib directory.
   * debian/rules.d/build.mk, debian/debhelper.in/libc.postrm: correctly
     recreate the dynamic linker symlink with the new naming scheme.
   * debian/libc*.symbols.*: force __sysconf@GLIBC_2.* and sysconf@GLIBC_2.*
     dependencies to 2.34 to correctly support the new definition of MINSIGSTKSZ
     and SIGSTKSZ.
   * debian/debhelper.in/libc*.fixperms: remove, they are ignored by
     dh_fixperms.
   * debian/debhelper.in/libc-alt.lintian-overrides: adjust overrides for the
     case slibdir = rtlddir.
 .
   [ Samuel Thibault ]
   * debian/testsuite-xfail-debian.mk: Update hurd tests.
   * debian/patches/hurd-i386/git-random-getrandom.diff: Fix random translator
     startup.
   * debian/control: Break hurd << 1:0.9.git20211230-2 accordingly.
Author: Aurelien Jarno <aurel32@debian.org>
Bug-Debian: https://bugs.debian.org/1002041

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2022-03-17

--- glibc-2.34.orig/argp/Makefile
+++ glibc-2.34/argp/Makefile
@@ -22,7 +22,7 @@ subdir	:= argp
 
 include ../Makeconfig
 
-headers		= argp.h bits/argp-ldbl.h
+headers		= argp.h
 routines	= $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
 				     pvh xinl eexst)
 
--- glibc-2.34.orig/argp/argp-help.c
+++ glibc-2.34/argp/argp-help.c
@@ -210,7 +210,7 @@ fill_in_uparams (const struct argp_state
 	      }
 	    else if (isdigit ((unsigned char) *arg))
 	      {
-		val = atoi (arg);
+		val = (int) __strtol (arg, NULL, 10);
 		while (isdigit ((unsigned char) *arg))
 		  arg++;
 		SKIPWS (arg);
--- glibc-2.34.orig/argp/argp-parse.c
+++ glibc-2.34/argp/argp-parse.c
@@ -147,7 +147,7 @@ argp_default_parser (int key, char *arg,
       break;
 
     case OPT_HANG:
-      _argp_hang = atoi (arg ? arg : "3600");
+      _argp_hang = (int) __strtol (arg ? arg : "3600", NULL, 10);
       while (_argp_hang-- > 0)
 	__sleep (1);
       break;
@@ -177,7 +177,7 @@ argp_version_parser (int key, char *arg,
       if (argp_program_version_hook)
 	(*argp_program_version_hook) (state->out_stream, state);
       else if (argp_program_version)
-	fprintf (state->out_stream, "%s\n", argp_program_version);
+	__fprintf (state->out_stream, "%s\n", argp_program_version);
       else
 	__argp_error (state, dgettext (state->root_argp->argp_domain,
 				       "(PROGRAM ERROR) No version known!?"));
@@ -618,7 +618,7 @@ parser_finalize (struct parser *parser,
 	{
 	  if (!(parser->state.flags & ARGP_NO_ERRS)
 	      && parser->state.err_stream)
-	    fprintf (parser->state.err_stream,
+	    __fprintf (parser->state.err_stream,
 		     dgettext (parser->argp->argp_domain,
 			       "%s: Too many arguments\n"),
 		     parser->state.name);
--- glibc-2.34.orig/argp/argp.h
+++ glibc-2.34/argp/argp.h
@@ -25,6 +25,7 @@
 #include <getopt.h>
 #include <limits.h>
 #include <errno.h>
+#include <bits/floatn.h>
 
 __BEGIN_DECLS
 
@@ -464,11 +465,10 @@ extern void __argp_state_help (const str
 extern void argp_usage (const struct argp_state *__state);
 extern void __argp_usage (const struct argp_state *__state);
 
-/* If appropriate, print the printf string FMT and following args, preceded
-   by the program name and `:', to stderr, and followed by a `Try ... --help'
-   message, then exit (1).  */
-extern void argp_error (const struct argp_state *__restrict __state,
-			const char *__restrict __fmt, ...)
+extern void __REDIRECT_LDBL (argp_error,
+			     (const struct argp_state *__restrict __state,
+			      const char *__restrict __fmt, ...),
+			     __argp_errorieee128, __nldbl_argp_error)
      __attribute__ ((__format__ (__printf__, 2, 3)));
 extern void __argp_error (const struct argp_state *__restrict __state,
 			  const char *__restrict __fmt, ...)
@@ -482,10 +482,13 @@ extern void __argp_error (const struct a
    difference between this function and argp_error is that the latter is for
    *parsing errors*, and the former is for other problems that occur during
    parsing but don't reflect a (syntactic) problem with the input.  */
-extern void argp_failure (const struct argp_state *__restrict __state,
-			  int __status, int __errnum,
-			  const char *__restrict __fmt, ...)
+extern void __REDIRECT_LDBL (argp_failure,
+			     (const struct argp_state *__restrict __state,
+			      int __status, int __errnum,
+			      const char *__restrict __fmt, ...),
+			     __argp_failureieee128,__nldbl_argp_failure)
      __attribute__ ((__format__ (__printf__, 4, 5)));
+
 extern void __argp_failure (const struct argp_state *__restrict __state,
 			    int __status, int __errnum,
 			    const char *__restrict __fmt, ...)
@@ -554,11 +557,6 @@ __NTH (__option_is_end (const struct arg
 # endif
 #endif /* Use extern inlines.  */
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/argp-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif /* argp.h */
--- glibc-2.34.orig/argp/bits/argp-ldbl.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Redirections for argp functions for -mlong-double-64.
-   Copyright (C) 2019-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _ARGP_H
-# error "Never include <bits/argp-ldbl.h> directly; use <argp.h> instead."
-#endif
-
-__LDBL_REDIR_DECL (argp_error)
-__LDBL_REDIR_DECL (argp_failure)
--- glibc-2.34.orig/debug/backtracesyms.c
+++ glibc-2.34/debug/backtracesyms.c
@@ -84,10 +84,10 @@ __backtrace_symbols (void *const *array,
 		info[cnt].dli_saddr = info[cnt].dli_fbase;
 
 	      if (info[cnt].dli_sname == NULL && info[cnt].dli_saddr == 0)
-		last += 1 + sprintf (last, "%s(%s) [%p]",
-				     info[cnt].dli_fname ?: "",
-				     info[cnt].dli_sname ?: "",
-				     array[cnt]);
+		last += 1 + __sprintf (last, "%s(%s) [%p]",
+				       info[cnt].dli_fname ?: "",
+				       info[cnt].dli_sname ?: "",
+				       array[cnt]);
 	      else
 		{
 		  char sign;
@@ -103,14 +103,14 @@ __backtrace_symbols (void *const *array,
 		      offset = info[cnt].dli_saddr - array[cnt];
 		    }
 
-		  last += 1 + sprintf (last, "%s(%s%c%#tx) [%p]",
-				       info[cnt].dli_fname ?: "",
-				       info[cnt].dli_sname ?: "",
-				       sign, offset, array[cnt]);
+		  last += 1 + __sprintf (last, "%s(%s%c%#tx) [%p]",
+					 info[cnt].dli_fname ?: "",
+					 info[cnt].dli_sname ?: "",
+					 sign, offset, array[cnt]);
 		}
 	    }
 	  else
-	    last += 1 + sprintf (last, "[%p]", array[cnt]);
+	    last += 1 + __sprintf (last, "[%p]", array[cnt]);
 	}
       assert (last <= (char *) result + size * sizeof (char *) + total);
     }
--- glibc-2.34.orig/grp/putgrent.c
+++ glibc-2.34/grp/putgrent.c
@@ -45,10 +45,10 @@ putgrent (const struct group *gr, FILE *
   flockfile (stream);
 
   if (gr->gr_name[0] == '+' || gr->gr_name[0] == '-')
-    retval = fprintf (stream, "%s:%s::",
+    retval = __fprintf (stream, "%s:%s::",
 		      gr->gr_name, _S (gr->gr_passwd));
   else
-    retval = fprintf (stream, "%s:%s:%lu:",
+    retval = __fprintf (stream, "%s:%s:%lu:",
 		      gr->gr_name, _S (gr->gr_passwd),
 		      (unsigned long int) gr->gr_gid);
   if (__builtin_expect (retval, 0) < 0)
@@ -60,7 +60,7 @@ putgrent (const struct group *gr, FILE *
   if (gr->gr_mem != NULL)
     {
       for (size_t i = 0; gr->gr_mem[i] != NULL; i++)
-	if (fprintf (stream, i == 0 ? "%s" : ",%s", gr->gr_mem[i]) < 0)
+	if (__fprintf (stream, i == 0 ? "%s" : ",%s", gr->gr_mem[i]) < 0)
 	  {
 	    /* What else can we do?  */
 	    funlockfile (stream);
--- glibc-2.34.orig/gshadow/putsgent.c
+++ glibc-2.34/gshadow/putsgent.c
@@ -42,7 +42,7 @@ putsgent (const struct sgrp *g, FILE *st
 
   _IO_flockfile (stream);
 
-  if (fprintf (stream, "%s:%s:", g->sg_namp, _S (g->sg_passwd)) < 0)
+  if (__fprintf (stream, "%s:%s:", g->sg_namp, _S (g->sg_passwd)) < 0)
     ++errors;
 
   bool first = true;
@@ -50,7 +50,7 @@ putsgent (const struct sgrp *g, FILE *st
   if (sp != NULL)
     while (*sp != NULL)
       {
-	if (fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
+	if (__fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
 	  {
 	    ++errors;
 	    break;
@@ -65,7 +65,7 @@ putsgent (const struct sgrp *g, FILE *st
   if (sp != NULL)
     while (*sp != NULL)
       {
-	if (fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
+	if (__fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
 	  {
 	    ++errors;
 	    break;
--- glibc-2.34.orig/iconv/gconv_conf.c
+++ glibc-2.34/iconv/gconv_conf.c
@@ -291,7 +291,7 @@ add_module (char *rp, const char *direct
       char *endp;
 
       *wp++ = '\0';
-      cost_hi = strtol (rp, &endp, 10);
+      cost_hi = __strtol (rp, &endp, 10);
       if (rp == endp || cost_hi < 1)
 	/* No useful information.  */
 	cost_hi = 1;
--- glibc-2.34.orig/include/bits/argp-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <argp/bits/argp-ldbl.h>
--- glibc-2.34.orig/include/bits/err-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/err-ldbl.h>
--- glibc-2.34.orig/include/bits/monetary-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <stdlib/bits/monetary-ldbl.h>
--- glibc-2.34.orig/include/bits/printf-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <stdio-common/bits/printf-ldbl.h>
--- glibc-2.34.orig/include/bits/stdio-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <libio/bits/stdio-ldbl.h>
--- glibc-2.34.orig/include/bits/stdlib-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <stdlib/bits/stdlib-ldbl.h>
--- glibc-2.34.orig/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
--- glibc-2.34.orig/include/bits/wchar-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <wcsmbs/bits/wchar-ldbl.h>
--- glibc-2.34.orig/include/err.h
+++ glibc-2.34/include/err.h
@@ -12,12 +12,28 @@ __vwarn_internal (const char *format, __
 
 # ifndef _ISOMAC
 
-libc_hidden_ldbl_proto (warn)
-libc_hidden_ldbl_proto (warnx)
-libc_hidden_ldbl_proto (vwarn)
-libc_hidden_ldbl_proto (vwarnx)
-libc_hidden_ldbl_proto (verr)
-libc_hidden_ldbl_proto (verrx)
+/*  Some libc_hidden_ldbl_proto's do not map to a unique symbol when
+    redirecting ldouble to _Float128 variants.  We can therefore safely
+    directly alias them to their internal name.  */
+# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED
+#  define __err_hidden_ldbl_proto(name, alias) \
+  extern __typeof (name) __##name __asm__ (__hidden_asmname (#alias));
+#  define err_hidden_ldbl_proto(name) \
+  extern typeof (name) __##name##ieee128; \
+  libc_hidden_proto (__##name##ieee128); \
+  __err_hidden_ldbl_proto (name, __GI___##name##ieee128)
+# else
+#  define err_hidden_ldbl_proto(name) \
+  extern __typeof (name) __##name __attribute_copy__ (name); \
+  libc_hidden_proto (__##name)
+# endif
+
+err_hidden_ldbl_proto (warn);
+err_hidden_ldbl_proto (warnx);
+err_hidden_ldbl_proto (vwarn);
+err_hidden_ldbl_proto (vwarnx);
+err_hidden_ldbl_proto (verr);
+err_hidden_ldbl_proto (verrx);
 
 # endif /* !_ISOMAC */
 #endif /* err.h */
--- glibc-2.34.orig/include/stdio.h
+++ glibc-2.34/include/stdio.h
@@ -22,13 +22,17 @@
 /*  Some libc_hidden_ldbl_proto's do not map to a unique symbol when
     redirecting ldouble to _Float128 variants.  We can therefore safely
     directly alias them to their internal name.  */
-# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc)
-#  define stdio_hidden_ldbl_proto(p, f) \
-  extern __typeof (p ## f) p ## f __asm (__ASMNAME ("___ieee128_" #f));
-# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-#  define stdio_hidden_ldbl_proto(p,f) __LDBL_REDIR1_DECL (p ## f, p ## f ## ieee128)
+# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED
+#  define __stdio_hidden_ldbl_proto(name, alias) \
+  extern __typeof (name) __##name __asm__ (__hidden_asmname (#alias));
+#  define stdio_hidden_ldbl_proto(name) \
+  extern typeof (name) __##name##ieee128; \
+  libc_hidden_proto (__##name##ieee128); \
+  __stdio_hidden_ldbl_proto (name, __GI___##name##ieee128)
 # else
-#  define stdio_hidden_ldbl_proto(p,f) libc_hidden_proto (p ## f)
+#  define stdio_hidden_ldbl_proto(name) \
+  extern __typeof (name) __##name; \
+  libc_hidden_proto (__##name)
 # endif
 
 /* Set the error indicator on FP.  */
@@ -39,10 +43,7 @@ fseterr_unlocked (FILE *fp)
 }
 
 extern int __fcloseall (void) attribute_hidden;
-extern int __snprintf (char *__restrict __s, size_t __maxlen,
-		       const char *__restrict __format, ...)
-     __attribute__ ((__format__ (__printf__, 3, 4)));
-stdio_hidden_ldbl_proto (__, snprintf)
+stdio_hidden_ldbl_proto (snprintf);
 
 extern int __vfscanf (FILE *__restrict __s,
 		      const char *__restrict __format,
@@ -183,7 +184,7 @@ extern const char *const _sys_errlist_in
 extern const char *__get_errlist (int) attribute_hidden;
 extern const char *__get_errname (int) attribute_hidden;
 
-libc_hidden_ldbl_proto (__asprintf)
+stdio_hidden_ldbl_proto (asprintf);
 
 #  if IS_IN (libc)
 extern FILE *_IO_new_fopen (const char*, const char*);
@@ -205,13 +206,10 @@ extern int _IO_new_fgetpos (FILE *, __fp
 #   define fgetpos(fp, posp) _IO_new_fgetpos (fp, posp)
 #  endif
 
-extern __typeof (dprintf) __dprintf
-     __attribute__ ((__format__ (__printf__, 2, 3)));
-stdio_hidden_ldbl_proto (__, dprintf)
-libc_hidden_ldbl_proto (dprintf)
-libc_hidden_ldbl_proto (fprintf)
-libc_hidden_ldbl_proto (vfprintf)
-libc_hidden_ldbl_proto (sprintf)
+stdio_hidden_ldbl_proto (dprintf);
+stdio_hidden_ldbl_proto (fprintf);
+stdio_hidden_ldbl_proto (vfprintf);
+stdio_hidden_ldbl_proto (sprintf);
 libc_hidden_proto (ungetc)
 libc_hidden_proto (__getdelim)
 libc_hidden_proto (fwrite)
--- glibc-2.34.orig/include/stdlib.h
+++ glibc-2.34/include/stdlib.h
@@ -221,15 +221,22 @@ libc_hidden_proto (____strtoul_l_interna
 libc_hidden_proto (____strtoull_l_internal)
 
 #include <bits/floatn.h>
-libc_hidden_proto (strtof)
-libc_hidden_proto (strtod)
+extern __typeof (strtof) __strtof;
+libc_hidden_proto (__strtof)
+extern __typeof (strtod) __strtod;
+libc_hidden_proto (__strtod)
 #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0
-libc_hidden_proto (strtold)
+extern __typeof (strtold) __strtold;
+libc_hidden_proto (__strtold)
 #endif
-libc_hidden_proto (strtol)
-libc_hidden_proto (strtoll)
-libc_hidden_proto (strtoul)
-libc_hidden_proto (strtoull)
+extern __typeof (strtol) __strtol;
+libc_hidden_proto (__strtol)
+extern __typeof (strtoll) __strtoll;
+libc_hidden_proto (__strtoll)
+extern __typeof (strtoul) __strtoul;
+libc_hidden_proto (__strtoul)
+extern __typeof (strtoull) __strtoull;
+libc_hidden_proto (__strtoull)
 
 libc_hidden_proto (atoi)
 
@@ -251,10 +258,10 @@ libc_hidden_proto (__wcstold_nan)
 #include <bits/floatn.h>
 
 #if __HAVE_DISTINCT_FLOAT128
+extern __typeof (strtof128) __strtof128;
+libc_hidden_proto (__strtof128)
 extern __typeof (strtof128_l) __strtof128_l;
-
 libc_hidden_proto (__strtof128_l)
-libc_hidden_proto (strtof128)
 
 extern _Float128 __strtof128_nan (const char *, char **, char);
 extern _Float128 __wcstof128_nan (const wchar_t *, wchar_t **, wchar_t);
--- glibc-2.34.orig/include/sys/cdefs.h
+++ glibc-2.34/include/sys/cdefs.h
@@ -13,26 +13,6 @@ extern void __chk_fail (void) __attribut
 libc_hidden_proto (__chk_fail)
 rtld_hidden_proto (__chk_fail)
 
-/* If we are using redirects internally to support long double,
-   we need to tweak some macros to ensure the PLT bypass tricks
-   continue to work in libc. */
-#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED
-
-# undef __LDBL_REDIR_DECL
-# define __LDBL_REDIR_DECL(func) \
-   extern __typeof(func) func __asm (__ASMNAME ("__GI____ieee128_" #func));
-
-# undef libc_hidden_ldbl_proto
-# define libc_hidden_ldbl_proto(func, attrs...) \
-   extern __typeof(func) ___ieee128_ ## func; \
-   libc_hidden_proto (___ieee128_ ## func, ##attrs);
-
-# undef __LDBL_REDIR2_DECL
-# define __LDBL_REDIR2_DECL(func) \
-   extern __typeof(__ ## func) __ ## func __asm (__ASMNAME ("__GI____ieee128___" #func));
-
-#endif
-
 #endif /* !defined _ISOMAC */
 
 #endif
--- glibc-2.34.orig/include/sys/syslog.h
+++ glibc-2.34/include/sys/syslog.h
@@ -3,7 +3,23 @@
 #include <misc/sys/syslog.h>
 #ifndef _ISOMAC
 
-libc_hidden_ldbl_proto (syslog)
+/*  Some libc_hidden_ldbl_proto's do not map to a unique symbol when
+    redirecting ldouble to _Float128 variants.  We can therefore safely
+    directly alias them to their internal name.  */
+# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED
+#  define __syslog_hidden_ldbl_proto(name, alias) \
+  extern __typeof (name) __##name __asm__ (__hidden_asmname (#alias));
+#  define syslog_hidden_ldbl_proto(name) \
+  extern typeof (name) __##name##ieee128; \
+  libc_hidden_proto (__##name##ieee128); \
+  __syslog_hidden_ldbl_proto (name, __GI___##name##ieee128)
+# else
+#  define syslog_hidden_ldbl_proto(name) \
+  extern __typeof (name) __##name; \
+  libc_hidden_proto (__##name)
+# endif
+
+syslog_hidden_ldbl_proto (syslog);
 
 /* __vsyslog_internal uses the same mode_flags bits as
    __v*printf_internal; see libio/libioP.h.  */
--- glibc-2.34.orig/include/wchar.h
+++ glibc-2.34/include/wchar.h
@@ -71,13 +71,20 @@ libc_hidden_proto (__wcstol_internal)
 libc_hidden_proto (__wcstoll_internal)
 libc_hidden_proto (__wcstoul_internal)
 libc_hidden_proto (__wcstoull_internal)
-libc_hidden_proto (wcstof)
-libc_hidden_proto (wcstod)
-libc_hidden_ldbl_proto (wcstold)
-libc_hidden_proto (wcstol)
-libc_hidden_proto (wcstoll)
-libc_hidden_proto (wcstoul)
-libc_hidden_proto (wcstoull)
+extern __typeof (wcstof) __wcstof;
+libc_hidden_proto (__wcstof)
+extern __typeof (wcstod) __wcstod;
+libc_hidden_proto (__wcstod)
+extern __typeof (wcstold) __wcstold;
+libc_hidden_ldbl_proto (__wcstold)
+extern __typeof (wcstol) __wcstol;
+libc_hidden_proto (__wcstol)
+extern __typeof (wcstoll) __wcstoll;
+libc_hidden_proto (__wcstoll)
+extern __typeof (wcstoul) __wcstoul;
+libc_hidden_proto (__wcstoul)
+extern __typeof (wcstoull) __wcstoull;
+libc_hidden_proto (__wcstoull)
 
 extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
 				    locale_t) attribute_hidden;
@@ -100,6 +107,8 @@ extern unsigned long long int ____wcstou
      attribute_hidden;
 
 #if __HAVE_DISTINCT_FLOAT128
+extern __typeof (wcstof128) __wcstof128;
+libc_hidden_proto (__wcstof128)
 extern __typeof (wcstof128_l) __wcstof128_l;
 libc_hidden_proto (__wcstof128_l)
 extern _Float128 __wcstof128_internal (const wchar_t *__restrict __nptr,
@@ -110,7 +119,6 @@ extern _Float128 ____wcstof128_l_interna
 					   locale_t) attribute_hidden;
 
 libc_hidden_proto (__wcstof128_internal)
-libc_hidden_proto (wcstof128)
 #endif
 
 libc_hidden_proto (__wcscasecmp_l)
--- glibc-2.34.orig/inet/ether_ntoa_r.c
+++ glibc-2.34/inet/ether_ntoa_r.c
@@ -24,10 +24,10 @@
 char *
 ether_ntoa_r (const struct ether_addr *addr, char *buf)
 {
-  sprintf (buf, "%x:%x:%x:%x:%x:%x",
-	   addr->ether_addr_octet[0], addr->ether_addr_octet[1],
-	   addr->ether_addr_octet[2], addr->ether_addr_octet[3],
-	   addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
+  __sprintf (buf, "%x:%x:%x:%x:%x:%x",
+	     addr->ether_addr_octet[0], addr->ether_addr_octet[1],
+	     addr->ether_addr_octet[2], addr->ether_addr_octet[3],
+	     addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
   return buf;
 }
 libc_hidden_def (ether_ntoa_r)
--- glibc-2.34.orig/inet/rexec.c
+++ glibc-2.34/inet/rexec.c
@@ -134,8 +134,8 @@ retry:
 		if (!getnameinfo(&sa2.sa, sa2len,
 				 NULL, 0, servbuff, sizeof(servbuff),
 				 NI_NUMERICSERV))
-			port = atoi(servbuff);
-		(void) sprintf(num, "%u", port);
+			port = (int) __strtol (servbuff, NULL, 10);
+		(void) __sprintf(num, "%u", port);
 		(void) __write(s, num, strlen(num)+1);
 		{ socklen_t len = sizeof (from);
 		  s3 = TEMP_FAILURE_RETRY (accept(s2, (struct sockaddr *)&from,
--- glibc-2.34.orig/inet/ruserpass.c
+++ glibc-2.34/inet/ruserpass.c
@@ -112,7 +112,7 @@ ruserpass (const char *host, const char
 	cfile = fopen(buf, "rce");
 	if (cfile == NULL) {
 		if (errno != ENOENT)
-			warn("%s", buf);
+			__warn("%s", buf);
 		return (0);
 	}
 	/* No threads use this stream.  */
@@ -162,7 +162,7 @@ next:
 				  newp = malloc((unsigned) strlen(tokval) + 1);
 				  if (newp == NULL)
 				    {
-				      warnx(_("out of memory"));
+				      __warnx(_("out of memory"));
 				      goto bad;
 				    }
 				  *aname = strcpy(newp, tokval);
@@ -176,8 +176,8 @@ next:
 			if (strcmp(*aname, "anonymous") &&
 			    __fstat64(fileno(cfile), &stb) >= 0 &&
 			    (stb.st_mode & 077) != 0) {
-	warnx(_("Error: .netrc file is readable by others."));
-	warnx(_("Remove 'password' line or make file unreadable by others."));
+	__warnx(_("Error: .netrc file is readable by others."));
+	__warnx(_("Remove 'password' line or make file unreadable by others."));
 				goto bad;
 			}
 			if (token() && *apass == 0) {
@@ -185,7 +185,7 @@ next:
 				newp = malloc((unsigned) strlen(tokval) + 1);
 				if (newp == NULL)
 				  {
-				    warnx(_("out of memory"));
+				    __warnx(_("out of memory"));
 				    goto bad;
 				  }
 				*apass = strcpy(newp, tokval);
@@ -196,7 +196,7 @@ next:
 		case MACDEF:
 			break;
 		default:
-			warnx(_("Unknown .netrc keyword %s"), tokval);
+			__warnx(_("Unknown .netrc keyword %s"), tokval);
 			break;
 		}
 		goto done;
--- glibc-2.34.orig/intl/plural-exp.c
+++ glibc-2.34/intl/plural-exp.c
@@ -120,7 +120,7 @@ EXTRACT_PLURAL_EXPRESSION (const char *n
 	  if (!(*nplurals >= '0' && *nplurals <= '9'))
 	    goto no_plural;
 #if defined HAVE_STRTOUL || defined _LIBC
-	  n = strtoul (nplurals, &endp, 10);
+	  n = __strtoul (nplurals, &endp, 10);
 #else
 	  for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
 	    n = n * 10 + (*endp - '0');
--- glibc-2.34.orig/io/bits/poll2.h
+++ glibc-2.34/io/bits/poll2.h
@@ -36,16 +36,9 @@ extern int __REDIRECT (__poll_chk_warn,
 __fortify_function __attr_access ((__write_only__, 1, 2)) int
 poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
 {
-  if (__glibc_objsize (__fds) != (__SIZE_TYPE__) -1)
-    {
-      if (! __builtin_constant_p (__nfds))
-	return __poll_chk (__fds, __nfds, __timeout, __glibc_objsize (__fds));
-      else if (__glibc_objsize (__fds) / sizeof (*__fds) < __nfds)
-	return __poll_chk_warn (__fds, __nfds, __timeout,
-				__glibc_objsize (__fds));
-    }
-
-  return __poll_alias (__fds, __nfds, __timeout);
+  return __glibc_fortify (poll, __nfds, sizeof (*__fds),
+			  __glibc_objsize (__fds),
+			  __fds, __nfds, __timeout);
 }
 
 
@@ -68,17 +61,9 @@ __fortify_function __attr_access ((__wri
 ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout,
        const __sigset_t *__ss)
 {
-  if (__glibc_objsize (__fds) != (__SIZE_TYPE__) -1)
-    {
-      if (! __builtin_constant_p (__nfds))
-	return __ppoll_chk (__fds, __nfds, __timeout, __ss,
-			    __glibc_objsize (__fds));
-      else if (__glibc_objsize (__fds) / sizeof (*__fds) < __nfds)
-	return __ppoll_chk_warn (__fds, __nfds, __timeout, __ss,
-				 __glibc_objsize (__fds));
-    }
-
-  return __ppoll_alias (__fds, __nfds, __timeout, __ss);
+  return __glibc_fortify (ppoll, __nfds, sizeof (*__fds),
+			  __glibc_objsize (__fds),
+			  __fds, __nfds, __timeout, __ss);
 }
 #endif
 
--- glibc-2.34.orig/libio/Makefile
+++ glibc-2.34/libio/Makefile
@@ -23,7 +23,7 @@ subdir	:= libio
 include ../Makeconfig
 
 headers	:= stdio.h \
-	   bits/stdio.h bits/stdio2.h bits/stdio-ldbl.h \
+	   bits/stdio.h bits/stdio2.h \
 	   bits/types/FILE.h bits/types/__FILE.h bits/types/struct_FILE.h \
 	   bits/types/__fpos_t.h bits/types/__fpos64_t.h \
 	   bits/types/cookie_io_functions_t.h
--- glibc-2.34.orig/libio/bits/stdio-ldbl.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -mlong-double-64 compatibility mode for stdio functions.
-   Copyright (C) 2006-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _STDIO_H
-# error "Never include <bits/stdio-ldbl.h> directly; use <stdio.h> instead."
-#endif
-
-__LDBL_REDIR_DECL (fprintf)
-__LDBL_REDIR_DECL (printf)
-__LDBL_REDIR_DECL (sprintf)
-__LDBL_REDIR_DECL (vfprintf)
-__LDBL_REDIR_DECL (vprintf)
-__LDBL_REDIR_DECL (vsprintf)
-#if !__GLIBC_USE (DEPRECATED_SCANF)
-# if defined __LDBL_COMPAT
-__LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf)
-__LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf)
-__LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf)
-# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-__LDBL_REDIR1_DECL (fscanf, __isoc99_fscanfieee128)
-__LDBL_REDIR1_DECL (scanf, __isoc99_scanfieee128)
-__LDBL_REDIR1_DECL (sscanf, __isoc99_sscanfieee128)
-# else
-#  error bits/stdlib-ldbl.h included when no ldbl redirections are required.
-# endif
-#else
-__LDBL_REDIR_DECL (fscanf)
-__LDBL_REDIR_DECL (scanf)
-__LDBL_REDIR_DECL (sscanf)
-#endif
-
-#if defined __USE_ISOC99 || defined __USE_UNIX98
-__LDBL_REDIR_DECL (snprintf)
-__LDBL_REDIR_DECL (vsnprintf)
-#endif
-
-#ifdef	__USE_ISOC99
-# if !__GLIBC_USE (DEPRECATED_SCANF)
-#  if defined __LDBL_COMPAT
-__LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf)
-__LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf)
-__LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf)
-#  elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-__LDBL_REDIR1_DECL (vfscanf, __isoc99_vfscanfieee128)
-__LDBL_REDIR1_DECL (vscanf, __isoc99_vscanfieee128)
-__LDBL_REDIR1_DECL (vsscanf, __isoc99_vsscanfieee128)
-#  else
-#   error bits/stdlib-ldbl.h included when no ldbl redirections are required.
-#  endif
-# else
-__LDBL_REDIR_DECL (vfscanf)
-__LDBL_REDIR_DECL (vsscanf)
-__LDBL_REDIR_DECL (vscanf)
-# endif
-#endif
-
-#ifdef __USE_XOPEN2K8
-__LDBL_REDIR_DECL (vdprintf)
-__LDBL_REDIR_DECL (dprintf)
-#endif
-
-#ifdef __USE_GNU
-__LDBL_REDIR_DECL (vasprintf)
-__LDBL_REDIR2_DECL (asprintf)
-__LDBL_REDIR_DECL (asprintf)
-__LDBL_REDIR_DECL (obstack_printf)
-__LDBL_REDIR_DECL (obstack_vprintf)
-#endif
-
-#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
-__LDBL_REDIR2_DECL (sprintf_chk)
-__LDBL_REDIR2_DECL (vsprintf_chk)
-# if defined __USE_ISOC99 || defined __USE_UNIX98
-__LDBL_REDIR2_DECL (snprintf_chk)
-__LDBL_REDIR2_DECL (vsnprintf_chk)
-# endif
-# if __USE_FORTIFY_LEVEL > 1
-__LDBL_REDIR2_DECL (fprintf_chk)
-__LDBL_REDIR2_DECL (printf_chk)
-__LDBL_REDIR2_DECL (vfprintf_chk)
-__LDBL_REDIR2_DECL (vprintf_chk)
-#  ifdef __USE_XOPEN2K8
-__LDBL_REDIR2_DECL (dprintf_chk)
-__LDBL_REDIR2_DECL (vdprintf_chk)
-#  endif
-#  ifdef __USE_GNU
-__LDBL_REDIR2_DECL (asprintf_chk)
-__LDBL_REDIR2_DECL (vasprintf_chk)
-__LDBL_REDIR2_DECL (obstack_printf_chk)
-__LDBL_REDIR2_DECL (obstack_vprintf_chk)
-#  endif
-# endif
-#endif
--- glibc-2.34.orig/libio/bits/stdio2.h
+++ glibc-2.34/libio/bits/stdio2.h
@@ -23,12 +23,17 @@
 # error "Never include <bits/stdio2.h> directly; use <stdio.h> instead."
 #endif
 
-extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
-			  const char *__restrict __format, ...) __THROW
+extern int __REDIRECT_LDBL_NTHNL (__sprintf_chk, (char *__restrict __s,
+						  int __flag, size_t __slen,
+						  const char *__restrict __format,
+						  ...),
+				  __sprintf_chkieee128, __nldbl___sprintf_chk)
     __attr_access ((__write_only__, 1, 3));
-extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
-			   const char *__restrict __format,
-			   __gnuc_va_list __ap) __THROW
+extern int __REDIRECT_LDBL_NTHNL (__vsprintf_chk, (char *__restrict __s,
+						   int __flag, size_t __slen,
+						   const char *__restrict __format,
+						   __gnuc_va_list __ap),
+				  __vsprintf_chkieee128, __nldbl___vsprintf_chk)
     __attr_access ((__write_only__, 1, 3));
 
 #ifdef __va_arg_pack
@@ -54,14 +59,19 @@ __NTH (vsprintf (char *__restrict __s, c
 }
 
 #if defined __USE_ISOC99 || defined __USE_UNIX98
-
-extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
-			   size_t __slen, const char *__restrict __format,
-			   ...) __THROW
+extern int __REDIRECT_LDBL_NTHNL (__snprintf_chk, (char *__restrict __s,
+						   size_t __n, int __flag,
+						   size_t __slen,
+						   const char *__restrict __format,
+						   ...),
+				  __snprintf_chkieee128, __nldbl___snprintf_chk)
     __attr_access ((__write_only__, 1, 2));
-extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
-			    size_t __slen, const char *__restrict __format,
-			    __gnuc_va_list __ap) __THROW;
+extern int __REDIRECT_LDBL_NTHNL (__vsnprintf_chk, (char *__restrict __s,
+						    size_t __n, int __flag,
+						    size_t __slen,
+						    const char *__restrict __format,
+						    __gnuc_va_list __ap),
+				  __vsnprintf_chkieee128, __nldbl___vsnprintf_chk);
 
 # ifdef __va_arg_pack
 __fortify_function int
@@ -89,14 +99,24 @@ __NTH (vsnprintf (char *__restrict __s,
 #endif
 
 #if __USE_FORTIFY_LEVEL > 1
-
-extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
-			  const char *__restrict __format, ...);
-extern int __printf_chk (int __flag, const char *__restrict __format, ...);
-extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
-			   const char *__restrict __format, __gnuc_va_list __ap);
-extern int __vprintf_chk (int __flag, const char *__restrict __format,
-			  __gnuc_va_list __ap);
+extern int __REDIRECT_LDBL (__fprintf_chk, (FILE *__restrict __stream,
+					    int __flag,
+					    const char *__restrict __format,
+					    ...),
+			    __fprintf_chkieee128, __nldbl___fprintf_chk);
+extern int __REDIRECT_LDBL (__printf_chk, (int __flag,
+					   const char *__restrict __format,
+					   ...),
+			    __printf_chkieee128, __nldbl___printf_chk);
+extern int __REDIRECT_LDBL (__vfprintf_chk, (FILE *__restrict __stream,
+					     int __flag,
+					     const char *__restrict __format,
+					     __gnuc_va_list __ap),
+			    __vfprintf_chkieee128, __nldbl___vfprintf_chk);
+extern int __REDIRECT_LDBL (__vprintf_chk, (int __flag,
+					    const char *__restrict __format,
+					    __gnuc_va_list __ap),
+			    __vprintf_chkieee128, __nldbl___vprintf_chk);
 
 # ifdef __va_arg_pack
 __fortify_function int
@@ -136,10 +156,15 @@ vfprintf (FILE *__restrict __stream,
 }
 
 # ifdef __USE_XOPEN2K8
-extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
-			  ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-extern int __vdprintf_chk (int __fd, int __flag,
-			   const char *__restrict __fmt, __gnuc_va_list __arg)
+extern int __REDIRECT_LDBL (__dprintf_chk, (int __fd, int __flag,
+					    const char *__restrict __fmt,
+					    ...),
+			    __dprintf_chkieee128, __nldbl___dprintf_chk)
+     __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int __REDIRECT_LDBL (__vdprintf_chk, (int __fd, int __flag,
+					     const char *__restrict __fmt,
+					     __gnuc_va_list __arg),
+			    __vdprintf_chkieee128, __nldbl___vdprintf_chk)
      __attribute__ ((__format__ (__printf__, 3, 0)));
 
 #  ifdef __va_arg_pack
@@ -162,22 +187,32 @@ vdprintf (int __fd, const char *__restri
 # endif
 
 # ifdef __USE_GNU
-
-extern int __asprintf_chk (char **__restrict __ptr, int __flag,
-			   const char *__restrict __fmt, ...)
-     __THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur;
-extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
-			    const char *__restrict __fmt, __gnuc_va_list __arg)
-     __THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur;
-extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
-				 int __flag, const char *__restrict __format,
-				 ...)
-     __THROW __attribute__ ((__format__ (__printf__, 3, 4)));
-extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
-				  int __flag,
-				  const char *__restrict __format,
-				  __gnuc_va_list __args)
-     __THROW __attribute__ ((__format__ (__printf__, 3, 0)));
+extern int __REDIRECT_LDBL_NTHNL (__asprintf_chk, (char **__restrict __ptr,
+						   int __flag,
+						   const char *__restrict __fmt,
+						   ...),
+				  __asprintf_chkieee128, __nldbl___asprintf_chk)
+     __attribute__ ((__format__ (__printf__, 3, 4))) __wur;
+extern int __REDIRECT_LDBL_NTHNL (__vasprintf_chk, (char **__restrict __ptr,
+						    int __flag,
+						    const char *__restrict __fmt,
+						    __gnuc_va_list __arg),
+				  __vasprintf_chkieee128, __nldbl___vasnprintf_chk)
+     __attribute__ ((__format__ (__printf__, 3, 0))) __wur;
+extern int __REDIRECT_LDBL_NTHNL (__obstack_printf_chk, (struct obstack *__restrict __obstack,
+							 int __flag,
+							 const char *__restrict __format,
+							 ...),
+				  __obstack_printf_chkieee128,
+				  __nldbl___obstack_printf_chk)
+     __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int __REDIRECT_LDBL_NTHNL (__obstack_vprintf_chk, (struct obstack *__restrict __obstack,
+							  int __flag,
+							  const char *__restrict __format,
+							  __gnuc_va_list __args),
+				  __obstack_vprintf_chkieee128,
+				  __nldbl___obstack_vprintf_chk)
+     __attribute__ ((__format__ (__printf__, 3, 0)));
 
 #  ifdef __va_arg_pack
 __fortify_function int
@@ -261,15 +296,12 @@ extern char *__REDIRECT (__fgets_chk_war
 __fortify_function __wur __attr_access ((__write_only__, 1, 2)) char *
 fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
 {
-  if (__glibc_objsize (__s) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n) || __n <= 0)
-	return __fgets_chk (__s, __glibc_objsize (__s), __n, __stream);
-
-      if ((size_t) __n > __glibc_objsize (__s))
-	return __fgets_chk_warn (__s, __glibc_objsize (__s), __n, __stream);
-    }
-  return __fgets_alias (__s, __n, __stream);
+  size_t sz = __glibc_objsize (__s);
+  if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
+    return __fgets_alias (__s, __n, __stream);
+  if (__glibc_unsafe_len (__n, sizeof (char), sz))
+    return __fgets_chk_warn (__s, sz, __n, __stream);
+  return __fgets_chk (__s, sz, __n, __stream);
 }
 
 extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
@@ -291,19 +323,12 @@ __fortify_function __wur size_t
 fread (void *__restrict __ptr, size_t __size, size_t __n,
        FILE *__restrict __stream)
 {
-  if (__glibc_objsize0 (__ptr) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__size)
-	  || !__builtin_constant_p (__n)
-	  || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
-	return __fread_chk (__ptr, __glibc_objsize0 (__ptr), __size, __n,
-			    __stream);
-
-      if (__size * __n > __glibc_objsize0 (__ptr))
-	return __fread_chk_warn (__ptr, __glibc_objsize0 (__ptr), __size, __n,
-				 __stream);
-    }
-  return __fread_alias (__ptr, __size, __n, __stream);
+  size_t sz = __glibc_objsize0 (__ptr);
+  if (__glibc_safe_or_unknown_len (__n, __size, sz))
+    return __fread_alias (__ptr, __size, __n, __stream);
+  if (__glibc_unsafe_len (__n, __size, sz))
+    return __fread_chk_warn (__ptr, sz, __size, __n, __stream);
+  return __fread_chk (__ptr, sz, __size, __n, __stream);
 }
 
 #ifdef __USE_GNU
@@ -323,17 +348,12 @@ extern char *__REDIRECT (__fgets_unlocke
 __fortify_function __wur __attr_access ((__write_only__, 1, 2)) char *
 fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
 {
-  if (__glibc_objsize (__s) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n) || __n <= 0)
-	return __fgets_unlocked_chk (__s, __glibc_objsize (__s), __n,
-				     __stream);
-
-      if ((size_t) __n > __glibc_objsize (__s))
-	return __fgets_unlocked_chk_warn (__s, __glibc_objsize (__s), __n,
-					  __stream);
-    }
-  return __fgets_unlocked_alias (__s, __n, __stream);
+  size_t sz = __glibc_objsize (__s);
+  if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
+    return __fgets_unlocked_alias (__s, __n, __stream);
+  if (__glibc_unsafe_len (__n, sizeof (char), sz))
+    return __fgets_unlocked_chk_warn (__s, sz, __n, __stream);
+  return __fgets_unlocked_chk (__s, sz, __n, __stream);
 }
 #endif
 
@@ -358,41 +378,36 @@ __fortify_function __wur size_t
 fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
 		FILE *__restrict __stream)
 {
-  if (__glibc_objsize0 (__ptr) != (size_t) -1)
+  size_t sz = __glibc_objsize0 (__ptr);
+  if (__glibc_safe_or_unknown_len (__n, __size, sz))
     {
-      if (!__builtin_constant_p (__size)
-	  || !__builtin_constant_p (__n)
-	  || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
-	return __fread_unlocked_chk (__ptr, __glibc_objsize0 (__ptr), __size,
-				     __n, __stream);
-
-      if (__size * __n > __glibc_objsize0 (__ptr))
-	return __fread_unlocked_chk_warn (__ptr, __glibc_objsize0 (__ptr),
-					  __size, __n, __stream);
-    }
-
 # ifdef __USE_EXTERN_INLINES
-  if (__builtin_constant_p (__size)
-      && __builtin_constant_p (__n)
-      && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
-      && __size * __n <= 8)
-    {
-      size_t __cnt = __size * __n;
-      char *__cptr = (char *) __ptr;
-      if (__cnt == 0)
-	return 0;
-
-      for (; __cnt > 0; --__cnt)
+      if (__builtin_constant_p (__size)
+	  && __builtin_constant_p (__n)
+	  && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
+	  && __size * __n <= 8)
 	{
-	  int __c = getc_unlocked (__stream);
-	  if (__c == EOF)
-	    break;
-	  *__cptr++ = __c;
+	  size_t __cnt = __size * __n;
+	  char *__cptr = (char *) __ptr;
+	  if (__cnt == 0)
+	    return 0;
+
+	  for (; __cnt > 0; --__cnt)
+	    {
+	      int __c = getc_unlocked (__stream);
+	      if (__c == EOF)
+		break;
+	      *__cptr++ = __c;
+	    }
+	  return (__cptr - (char *) __ptr) / __size;
 	}
-      return (__cptr - (char *) __ptr) / __size;
-    }
 # endif
-  return __fread_unlocked_alias (__ptr, __size, __n, __stream);
+      return __fread_unlocked_alias (__ptr, __size, __n, __stream);
+    }
+  if (__glibc_unsafe_len (__n, __size, sz))
+    return __fread_unlocked_chk_warn (__ptr, sz, __size, __n, __stream);
+  return __fread_unlocked_chk (__ptr, sz, __size, __n, __stream);
+
 }
 #endif
 
--- glibc-2.34.orig/libio/libio.h
+++ glibc-2.34/libio/libio.h
@@ -258,7 +258,9 @@ extern __ssize_t _IO_wpadn (FILE *, wint
 extern void _IO_free_wbackup_area (FILE *) __THROW;
 
 #ifdef __LDBL_COMPAT
-__LDBL_REDIR_DECL (_IO_vfscanf)
+extern int __REDIRECT_LDBL_COMPAT (_IO_vfscanf, (FILE * __restrict,
+						 const char * __restrict,
+						 __gnuc_va_list, int *__restrict));
 #endif
 
 libc_hidden_proto (__overflow)
--- glibc-2.34.orig/libio/stdio.h
+++ glibc-2.34/libio/stdio.h
@@ -41,6 +41,7 @@ __BEGIN_DECLS
 #include <bits/types/__FILE.h>
 #include <bits/types/FILE.h>
 #include <bits/types/struct_FILE.h>
+#include <bits/floatn.h>
 
 #ifdef __USE_GNU
 # include <bits/types/cookie_io_functions_t.h>
@@ -336,78 +337,143 @@ extern void setbuffer (FILE *__restrict
 extern void setlinebuf (FILE *__stream) __THROW;
 #endif
 
-
 /* Write formatted output to STREAM.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int fprintf (FILE *__restrict __stream,
-		    const char *__restrict __format, ...);
+extern int __REDIRECT_LDBL (fprintf, (FILE *__restrict __stream,
+				      const char *__restrict __format, ...),
+			    __fprintfieee128, __nldbl_fprintf);
 /* Write formatted output to stdout.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int printf (const char *__restrict __format, ...);
+extern int __REDIRECT_LDBL (printf, (const char *__restrict __format, ...),
+			    __printfieee128, __nldbl_printf);
 /* Write formatted output to S.  */
-extern int sprintf (char *__restrict __s,
-		    const char *__restrict __format, ...) __THROWNL;
+extern int __REDIRECT_LDBL_NTHNL (sprintf, (char *__restrict __s,
+					    const char *__restrict __format,
+					    ...),
+				  __sprintfieee128, __nldbl_sprintf);
 
 /* Write formatted output to S from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
-		     __gnuc_va_list __arg);
+extern int __REDIRECT_LDBL (vfprintf, (FILE *__restrict __s,
+				       const char *__restrict __format,
+				       __gnuc_va_list __arg),
+			    __vfprintfieee128, __nldbl_vfprintf);
 /* Write formatted output to stdout from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
+extern int __REDIRECT_LDBL (vprintf, (const char *__restrict __format,
+				      __gnuc_va_list __arg),
+			    __vprintfieee128, __nldbl_vprintf);
 /* Write formatted output to S from argument list ARG.  */
-extern int vsprintf (char *__restrict __s, const char *__restrict __format,
-		     __gnuc_va_list __arg) __THROWNL;
+extern int __REDIRECT_LDBL_NTHNL (vsprintf, (char *__restrict __s,
+					     const char *__restrict __format,
+					     __gnuc_va_list __arg),
+				  __vsprintfieee128, __nldbl_vsprintf);
 
 #if defined __USE_ISOC99 || defined __USE_UNIX98
 /* Maximum chars of output to write in MAXLEN.  */
-extern int snprintf (char *__restrict __s, size_t __maxlen,
-		     const char *__restrict __format, ...)
-     __THROWNL __attribute__ ((__format__ (__printf__, 3, 4)));
-
-extern int vsnprintf (char *__restrict __s, size_t __maxlen,
-		      const char *__restrict __format, __gnuc_va_list __arg)
-     __THROWNL __attribute__ ((__format__ (__printf__, 3, 0)));
+extern int __REDIRECT_LDBL_NTHNL (snprintf, (char *__restrict __s,
+					     size_t __maxlen,
+					     const char *__restrict __format,
+					     ...),
+				  __snprintfieee128, __nldbl_snprintf)
+     __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int __REDIRECT_LDBL_NTHNL (vsnprintf, (char *__restrict __s,
+					      size_t __maxlen,
+					      const char *__restrict __format,
+					      __gnuc_va_list __arg),
+				  __vsnprintfieee128, __nldbl_vsnprintf)
+     __attribute__ ((__format__ (__printf__, 3, 0)));
 #endif
 
 #if __GLIBC_USE (LIB_EXT2)
 /* Write formatted output to a string dynamically allocated with `malloc'.
    Store the address of the string in *PTR.  */
-extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
-		      __gnuc_va_list __arg)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
-extern int __asprintf (char **__restrict __ptr,
-		       const char *__restrict __fmt, ...)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
-extern int asprintf (char **__restrict __ptr,
-		     const char *__restrict __fmt, ...)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+extern int __REDIRECT_LDBL_NTHNL (vasprintf, (char **__restrict __ptr,
+					      const char *__restrict __f,
+					      __gnuc_va_list __arg),
+				  __vasprintfieee128, __nldbl_vasprintf)
+     __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
+extern int __REDIRECT_LDBL_NTHNL (asprintf, (char **__restrict __ptr,
+					     const char *__restrict __fmt,
+					     ...),
+				  __asprintfieee128, __nldbl_asprintf)
+     __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
 #endif
 
 #ifdef __USE_XOPEN2K8
 /* Write formatted output to a file descriptor.  */
-extern int vdprintf (int __fd, const char *__restrict __fmt,
-		     __gnuc_va_list __arg)
+extern int __REDIRECT_LDBL (vdprintf, (int __fd, const char *__restrict __fmt,
+				       __gnuc_va_list __arg),
+			    __vdprintfieee128, __nldbl_vdprintf)
      __attribute__ ((__format__ (__printf__, 2, 0)));
-extern int dprintf (int __fd, const char *__restrict __fmt, ...)
+extern int __REDIRECT_LDBL (dprintf, (int __fd, const char *__restrict __fmt,
+				      ...),
+			    __dprintfieee128, __nldbl_dprintf)
      __attribute__ ((__format__ (__printf__, 2, 3)));
 #endif
 
-
+#if !__GLIBC_USE (DEPRECATED_SCANF)
+# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (fscanf, (FILE *__restrict __stream,
+				     const char *__restrict __format,
+				     ...),
+			    __isoc99_fscanfieee128, __nldbl___isoc99_fscanf) __wur;
+extern int __REDIRECT_LDBL (scanf, (const char *__restrict __format,
+				    ...),
+			    __isoc99_scanfieee128, __nldbl___isoc99_scanf) __wur;
+extern int __REDIRECT_LDBL_NTH (sscanf, (const char *__restrict __s,
+					 const char *__restrict __format,
+					 ...),
+			    __isoc99_sscanfieee128, __nldbl___isoc99_sscanf);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fscanf, (FILE *__restrict __stream,
+                                const char *__restrict __format, ...),
+                       __isoc99_fscanf) __wur;
+extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
+                       __isoc99_scanf) __wur;
+extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s,
+                                    const char *__restrict __format, ...),
+                           __isoc99_sscanf);
+#  else
+extern int __isoc99_fscanf (FILE *__restrict __stream,
+                            const char *__restrict __format, ...) __wur;
+extern int __isoc99_scanf (const char *__restrict __format, ...) __wur;
+extern int __isoc99_sscanf (const char *__restrict __s,
+                            const char *__restrict __format, ...) __THROW;
+#   define fscanf __isoc99_fscanf
+#   define scanf __isoc99_scanf
+#   define sscanf __isoc99_sscanf
+#  endif /* __REDIRECT */
+# endif
+#else
+# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (fscanf, (FILE *__restrict __stream,
+				     const char *__restrict __format,
+				     ...),
+			    __fscanfieee128, __nldbl_fscanf) __wur;
+extern int __REDIRECT_LDBL (scanf, (const char *__restrict __format,
+				    ...),
+			    __scanfieee128, __nldbl_scanf) __wur;
+extern int __REDIRECT_LDBL_NTH (sscanf, (const char *__restrict __s,
+					 const char *__restrict __format,
+					 ...),
+				__sscanfieee128, __nldbl_sscanf) __wur;
+# else
 /* Read formatted input from STREAM.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int fscanf (FILE *__restrict __stream,
-		   const char *__restrict __format, ...) __wur;
+                   const char *__restrict __format, ...) __wur;
 /* Read formatted input from stdin.
 
    This function is a possible cancellation point and therefore not
@@ -415,43 +481,81 @@ extern int fscanf (FILE *__restrict __st
 extern int scanf (const char *__restrict __format, ...) __wur;
 /* Read formatted input from S.  */
 extern int sscanf (const char *__restrict __s,
-		   const char *__restrict __format, ...) __THROW;
-
-/* For historical reasons, the C99-compliant versions of the scanf
-   functions are at alternative names.  When __LDBL_COMPAT or
-   __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in
-   bits/stdio-ldbl.h.  */
-#include <bits/floatn.h>
-#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \
-    && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0
-# ifdef __REDIRECT
-extern int __REDIRECT (fscanf, (FILE *__restrict __stream,
-				const char *__restrict __format, ...),
-		       __isoc99_fscanf) __wur;
-extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
-		       __isoc99_scanf) __wur;
-extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s,
-				    const char *__restrict __format, ...),
-			   __isoc99_sscanf);
-# else
-extern int __isoc99_fscanf (FILE *__restrict __stream,
-			    const char *__restrict __format, ...) __wur;
-extern int __isoc99_scanf (const char *__restrict __format, ...) __wur;
-extern int __isoc99_sscanf (const char *__restrict __s,
-			    const char *__restrict __format, ...) __THROW;
-#  define fscanf __isoc99_fscanf
-#  define scanf __isoc99_scanf
-#  define sscanf __isoc99_sscanf
+                   const char *__restrict __format, ...) __THROW;
 # endif
-#endif
+#endif /* DEPRECATED_SCANF */
 
-#ifdef	__USE_ISOC99
+#ifdef __USE_ISOC99
+# if !__GLIBC_USE (DEPRECATED_SCANF)
+#  if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (vfscanf, (FILE *__restrict __stream,
+				      const char *__restrict __format,
+				      __gnuc_va_list __arg),
+			    __isoc99_vfscanfieee128, __nldbl___isoc99_vfscanf)
+     __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
+extern int __REDIRECT_LDBL (vscanf, (const char *__restrict __format,
+				     __gnuc_va_list __arg),
+			    __isoc99_vscanfieee128, __nldbl___isoc99_vscanf)
+     __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
+extern int __REDIRECT_LDBL_NTH (vsscanf, (const char *__restrict __s,
+					  const char *__restrict __format,
+					  __gnuc_va_list __arg),
+				__isoc99_vsscanfieee128, __nldbl___isoc99_vsscanf)
+     __attribute__ ((__format__ (__scanf__, 2, 0)));
+#  else
+#   ifdef __REDIRECT
+extern int __REDIRECT (vfscanf,
+                       (FILE *__restrict __s,
+                        const char *__restrict __format, __gnuc_va_list __arg),
+                       __isoc99_vfscanf)
+     __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
+extern int __REDIRECT (vscanf, (const char *__restrict __format,
+                                __gnuc_va_list __arg),
+		       __isoc99_vscanf)
+     __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
+extern int __REDIRECT_NTH (vsscanf,
+                           (const char *__restrict __s,
+                            const char *__restrict __format,
+                            __gnuc_va_list __arg),
+			   __isoc99_vsscanf)
+     __attribute__ ((__format__ (__scanf__, 2, 0)));
+#   else
+extern int __isoc99_vfscanf (FILE *__restrict __s,
+                             const char *__restrict __format,
+                             __gnuc_va_list __arg) __wur;
+extern int __isoc99_vscanf (const char *__restrict __format,
+                            __gnuc_va_list __arg) __wur;
+extern int __isoc99_vsscanf (const char *__restrict __s,
+                             const char *__restrict __format,
+                             __gnuc_va_list __arg) __THROW;
+#    define vfscanf __isoc99_vfscanf
+#    define vscanf __isoc99_vscanf
+#    define vsscanf __isoc99_vsscanf
+#   endif /* __REDIRECT */
+#  endif
+# else /* DEPRECATED_SCANF */
+#  if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (vfscanf, (FILE *__restrict __stream,
+				      const char *__restrict __format,
+				      __gnuc_va_list __arg),
+			    __vfscanfieee128, __nldbl_vfscanf)
+     __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
+extern int __REDIRECT_LDBL (vscanf, (const char *__restrict __format,
+				     __gnuc_va_list __arg),
+			    __vscanfieee128, __nldbl_vscanf)
+     __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
+extern int __REDIRECT_LDBL_NTH (vsscanf, (const char *__restrict __s,
+					  const char *__restrict __format,
+					  __gnuc_va_list __arg),
+				__vsscanfieee128, __nldbl_vsscanf)
+     __attribute__ ((__format__ (__scanf__, 2, 0)));
+#  else
 /* Read formatted input from S into argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
-		    __gnuc_va_list __arg)
+                    __gnuc_va_list __arg)
      __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
 
 /* Read formatted input from stdin into argument list ARG.
@@ -463,42 +567,11 @@ extern int vscanf (const char *__restric
 
 /* Read formatted input from S into argument list ARG.  */
 extern int vsscanf (const char *__restrict __s,
-		    const char *__restrict __format, __gnuc_va_list __arg)
+                    const char *__restrict __format, __gnuc_va_list __arg)
      __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
-
-/* Same redirection as above for the v*scanf family.  */
-# if !__GLIBC_USE (DEPRECATED_SCANF)
-#  if defined __REDIRECT && !defined __LDBL_COMPAT \
-      && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0
-extern int __REDIRECT (vfscanf,
-		       (FILE *__restrict __s,
-			const char *__restrict __format, __gnuc_va_list __arg),
-		       __isoc99_vfscanf)
-     __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
-extern int __REDIRECT (vscanf, (const char *__restrict __format,
-				__gnuc_va_list __arg), __isoc99_vscanf)
-     __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
-extern int __REDIRECT_NTH (vsscanf,
-			   (const char *__restrict __s,
-			    const char *__restrict __format,
-			    __gnuc_va_list __arg), __isoc99_vsscanf)
-     __attribute__ ((__format__ (__scanf__, 2, 0)));
-#  elif !defined __REDIRECT
-extern int __isoc99_vfscanf (FILE *__restrict __s,
-			     const char *__restrict __format,
-			     __gnuc_va_list __arg) __wur;
-extern int __isoc99_vscanf (const char *__restrict __format,
-			    __gnuc_va_list __arg) __wur;
-extern int __isoc99_vsscanf (const char *__restrict __s,
-			     const char *__restrict __format,
-			     __gnuc_va_list __arg) __THROW;
-#   define vfscanf __isoc99_vfscanf
-#   define vscanf __isoc99_vscanf
-#   define vsscanf __isoc99_vsscanf
 #  endif
 # endif
-#endif /* Use ISO C9x.  */
-
+#endif /* __USE_ISOC99 */
 
 /* Read a character from STREAM.
 
@@ -844,13 +917,17 @@ extern char *cuserid (char *__s)
 struct obstack;			/* See <obstack.h>.  */
 
 /* Write formatted output to an obstack.  */
-extern int obstack_printf (struct obstack *__restrict __obstack,
-			   const char *__restrict __format, ...)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3)));
-extern int obstack_vprintf (struct obstack *__restrict __obstack,
-			    const char *__restrict __format,
-			    __gnuc_va_list __args)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int __REDIRECT_LDBL_NTHNL (obstack_printf,
+				  (struct obstack *__restrict __obstack,
+				   const char *__restrict __format, ...),
+				  __obstack_printfieee128, __nldbl_obstack_printf)
+     __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int __REDIRECT_LDBL_NTHNL (obstack_vprintf,
+				  (struct obstack *__restrict __obstack,
+				   const char *__restrict __format,
+				   __gnuc_va_list __args),
+				  __obstack_vprintfieee128, __nldbl_obstack_vprintf)
+     __attribute__ ((__format__ (__printf__, 2, 0)));
 #endif /* Use GNU.  */
 
 
@@ -888,11 +965,6 @@ extern int __overflow (FILE *, int);
 # include <bits/stdio2.h>
 #endif
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/stdio-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif /* <stdio.h> included.  */
--- glibc-2.34.orig/malloc/malloc-check.c
+++ glibc-2.34/malloc/malloc-check.c
@@ -18,6 +18,7 @@
    not, see <https://www.gnu.org/licenses/>.  */
 
 #define __mremap mremap
+#define __fprintf fprintf
 #include "malloc.c"
 
 /* When memory is tagged, the checking data is stored in the user part
--- glibc-2.34.orig/malloc/malloc.c
+++ glibc-2.34/malloc/malloc.c
@@ -5167,9 +5167,9 @@ __malloc_stats (void)
       memset (&mi, 0, sizeof (mi));
       __libc_lock_lock (ar_ptr->mutex);
       int_mallinfo (ar_ptr, &mi);
-      fprintf (stderr, "Arena %d:\n", i);
-      fprintf (stderr, "system bytes     = %10u\n", (unsigned int) mi.arena);
-      fprintf (stderr, "in use bytes     = %10u\n", (unsigned int) mi.uordblks);
+      __fprintf (stderr, "Arena %d:\n", i);
+      __fprintf (stderr, "system bytes     = %10u\n", (unsigned int) mi.arena);
+      __fprintf (stderr, "in use bytes     = %10u\n", (unsigned int) mi.uordblks);
 #if MALLOC_DEBUG > 1
       if (i > 0)
         dump_heap (heap_for_ptr (top (ar_ptr)));
@@ -5181,12 +5181,12 @@ __malloc_stats (void)
       if (ar_ptr == &main_arena)
         break;
     }
-  fprintf (stderr, "Total (incl. mmap):\n");
-  fprintf (stderr, "system bytes     = %10u\n", system_b);
-  fprintf (stderr, "in use bytes     = %10u\n", in_use_b);
-  fprintf (stderr, "max mmap regions = %10u\n", (unsigned int) mp_.max_n_mmaps);
-  fprintf (stderr, "max mmap bytes   = %10lu\n",
-           (unsigned long) mp_.max_mmapped_mem);
+  __fprintf (stderr, "Total (incl. mmap):\n");
+  __fprintf (stderr, "system bytes     = %10u\n", system_b);
+  __fprintf (stderr, "in use bytes     = %10u\n", in_use_b);
+  __fprintf (stderr, "max mmap regions = %10u\n", (unsigned int) mp_.max_n_mmaps);
+  __fprintf (stderr, "max mmap bytes   = %10lu\n",
+	     (unsigned long) mp_.max_mmapped_mem);
   stderr->_flags2 = old_flags2;
   _IO_funlockfile (stderr);
 }
@@ -5601,7 +5601,7 @@ __malloc_info (int options, FILE *fp)
   mstate ar_ptr = &main_arena;
   do
     {
-      fprintf (fp, "<heap nr=\"%d\">\n<sizes>\n", n++);
+      __fprintf (fp, "<heap nr=\"%d\">\n<sizes>\n", n++);
 
       size_t nblocks = 0;
       size_t nfastblocks = 0;
@@ -5712,12 +5712,12 @@ __malloc_info (int options, FILE *fp)
 
       for (size_t i = 0; i < nsizes; ++i)
 	if (sizes[i].count != 0 && i != NFASTBINS)
-	  fprintf (fp, "\
+	  __fprintf (fp, "\
   <size from=\"%zu\" to=\"%zu\" total=\"%zu\" count=\"%zu\"/>\n",
 		   sizes[i].from, sizes[i].to, sizes[i].total, sizes[i].count);
 
       if (sizes[NFASTBINS].count != 0)
-	fprintf (fp, "\
+	__fprintf (fp, "\
   <unsorted from=\"%zu\" to=\"%zu\" total=\"%zu\" count=\"%zu\"/>\n",
 		 sizes[NFASTBINS].from, sizes[NFASTBINS].to,
 		 sizes[NFASTBINS].total, sizes[NFASTBINS].count);
@@ -5725,7 +5725,7 @@ __malloc_info (int options, FILE *fp)
       total_system += ar_ptr->system_mem;
       total_max_system += ar_ptr->max_system_mem;
 
-      fprintf (fp,
+      __fprintf (fp,
 	       "</sizes>\n<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
 	       "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
 	       "<system type=\"current\" size=\"%zu\"/>\n"
@@ -5735,7 +5735,7 @@ __malloc_info (int options, FILE *fp)
 
       if (ar_ptr != &main_arena)
 	{
-	  fprintf (fp,
+	  __fprintf (fp,
 		   "<aspace type=\"total\" size=\"%zu\"/>\n"
 		   "<aspace type=\"mprotect\" size=\"%zu\"/>\n"
 		   "<aspace type=\"subheaps\" size=\"%zu\"/>\n",
@@ -5745,7 +5745,7 @@ __malloc_info (int options, FILE *fp)
 	}
       else
 	{
-	  fprintf (fp,
+	  __fprintf (fp,
 		   "<aspace type=\"total\" size=\"%zu\"/>\n"
 		   "<aspace type=\"mprotect\" size=\"%zu\"/>\n",
 		   ar_ptr->system_mem, ar_ptr->system_mem);
@@ -5758,7 +5758,7 @@ __malloc_info (int options, FILE *fp)
     }
   while (ar_ptr != &main_arena);
 
-  fprintf (fp,
+  __fprintf (fp,
 	   "<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
 	   "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
 	   "<total type=\"mmap\" count=\"%d\" size=\"%zu\"/>\n"
--- glibc-2.34.orig/misc/Makefile
+++ glibc-2.34/misc/Makefile
@@ -34,10 +34,10 @@ headers	:= sys/uio.h bits/uio-ext.h bits
 	   sys/select.h sys/sysinfo.h \
 	   regexp.h bits/select.h bits/mman.h sys/xattr.h \
 	   syslog.h sys/syslog.h \
-	   bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \
+	   bits/syslog.h bits/syslog-path.h bits/error.h \
 	   bits/select2.h bits/hwcap.h bits/auxv.h sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
-	   bits/err-ldbl.h bits/error-ldbl.h \
+	   bits/error-ldbl.h \
 	   sys/single_threaded.h
 
 routines := brk sbrk sstk ioctl \
--- glibc-2.34.orig/misc/bits/err-ldbl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Redirections for err.h functions for -mlong-double-64.
-   Copyright (C) 2019-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _ERR_H
-# error "Never include <bits/err-ldbl.h> directly; use <err.h> instead."
-#endif
-
-__LDBL_REDIR_DECL (warn)
-__LDBL_REDIR_DECL (vwarn)
-__LDBL_REDIR_DECL (warnx)
-__LDBL_REDIR_DECL (vwarnx)
-__LDBL_REDIR_DECL (err)
-__LDBL_REDIR_DECL (verr)
-__LDBL_REDIR_DECL (errx)
-__LDBL_REDIR_DECL (verrx)
--- glibc-2.34.orig/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_SYSLOG_H
-# error "Never include <bits/syslog-ldbl.h> directly; use <sys/syslog.h> instead."
-#endif
-
-__LDBL_REDIR_DECL (syslog)
-
-#ifdef __USE_MISC
-__LDBL_REDIR_DECL (vsyslog)
-#endif
-
-#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
-__LDBL_REDIR2_DECL (syslog_chk)
-
-# ifdef __USE_MISC
-__LDBL_REDIR2_DECL (vsyslog_chk)
-# endif
-#endif
--- glibc-2.34.orig/misc/bits/syslog.h
+++ glibc-2.34/misc/bits/syslog.h
@@ -21,8 +21,17 @@
 #endif
 
 
-extern void __syslog_chk (int __pri, int __flag, const char *__fmt, ...)
+extern void __REDIRECT_LDBL (__syslog_chk, (int __pri, int __flag,
+					    const char *__fmt, ...),
+			     __syslog_chkieee128, __nldbl___syslog_chk)
      __attribute__ ((__format__ (__printf__, 3, 4)));
+#ifdef __USE_MISC
+extern void __REDIRECT_LDBL (__vsyslog_chk, (int __pri, int __flag,
+					     const char *__fmt,
+					     __gnuc_va_list __ap),
+			     __vsyslog_chkieee128, __nldbl___vsyslog_chk)
+     __attribute__ ((__format__ (__printf__, 3, 0)));
+#endif
 
 #ifdef __va_arg_pack
 __fortify_function void
@@ -37,10 +46,6 @@ syslog (int __pri, const char *__fmt, ..
 
 
 #ifdef __USE_MISC
-extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt,
-			   __gnuc_va_list __ap)
-     __attribute__ ((__format__ (__printf__, 3, 0)));
-
 __fortify_function void
 vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
 {
--- glibc-2.34.orig/misc/efgcvt-template.c
+++ glibc-2.34/misc/efgcvt-template.c
@@ -24,7 +24,7 @@
 #include <math_ldbl_opt.h>
 
 #ifndef SPRINTF
-# define SPRINTF sprintf
+# define SPRINTF __sprintf
 #endif
 
 #define APPEND(a, b) APPEND2 (a, b)
--- glibc-2.34.orig/misc/err.c
+++ glibc-2.34/misc/err.c
@@ -33,7 +33,7 @@ extern char *__progname;
 {									      \
   va_list ap;								      \
   va_start (ap, format);						      \
-  call;									      \
+  __##call;								      \
   va_end (ap);								      \
 }
 
@@ -72,48 +72,54 @@ __vwarn_internal (const char *format, __
 }
 
 void
-vwarn (const char *format, __gnuc_va_list ap)
+__vwarn (const char *format, __gnuc_va_list ap)
 {
   __vwarn_internal (format, ap, 0);
 }
-libc_hidden_def (vwarn)
+libc_hidden_def (__vwarn)
+weak_alias (__vwarn, vwarn)
 
 void
-vwarnx (const char *format, __gnuc_va_list ap)
+__vwarnx (const char *format, __gnuc_va_list ap)
 {
   __vwarnx_internal (format, ap, 0);
 }
-libc_hidden_def (vwarnx)
+libc_hidden_def (__vwarnx)
+weak_alias (__vwarnx, vwarnx)
 
 void
-warn (const char *format, ...)
+__warn (const char *format, ...)
 {
   VA (vwarn (format, ap))
 }
-libc_hidden_def (warn)
+libc_hidden_def (__warn)
+weak_alias (__warn, warn)
 
 void
-warnx (const char *format, ...)
+__warnx (const char *format, ...)
 {
   VA (vwarnx (format, ap))
 }
-libc_hidden_def (warnx)
+libc_hidden_def (__warnx)
+weak_alias (__warnx, warnx)
 
 void
-verr (int status, const char *format, __gnuc_va_list ap)
+__verr (int status, const char *format, __gnuc_va_list ap)
 {
-  vwarn (format, ap);
+  __vwarn (format, ap);
   exit (status);
 }
-libc_hidden_def (verr)
+libc_hidden_def (__verr)
+weak_alias (__verr, verr)
 
 void
-verrx (int status, const char *format, __gnuc_va_list ap)
+__verrx (int status, const char *format, __gnuc_va_list ap)
 {
-  vwarnx (format, ap);
+  __vwarnx (format, ap);
   exit (status);
 }
-libc_hidden_def (verrx)
+libc_hidden_def (__verrx)
+weak_alias (__verrx, verrx)
 
 void
 err (int status, const char *format, ...)
--- glibc-2.34.orig/misc/err.h
+++ glibc-2.34/misc/err.h
@@ -31,32 +31,37 @@ __BEGIN_DECLS
 
 /* Print "program: ", FORMAT, ": ", the standard error string for errno,
    and a newline, on stderr.  */
-extern void warn (const char *__format, ...)
+extern void __REDIRECT_LDBL (warn, (const char *__format, ...),
+			     __warnieee128, __nldbl_warn)
      __attribute__ ((__format__ (__printf__, 1, 2)));
-extern void vwarn (const char *__format, __gnuc_va_list)
+extern void __REDIRECT_LDBL (vwarn, (const char *__format, __gnuc_va_list),
+			     __vwarnieee128, __nldbl_vwarn)
      __attribute__ ((__format__ (__printf__, 1, 0)));
 
 /* Likewise, but without ": " and the standard error string.  */
-extern void warnx (const char *__format, ...)
+extern void __REDIRECT_LDBL (warnx, (const char *__format, ...),
+			     __warnxieee128, __nldbl_warnx)
      __attribute__ ((__format__ (__printf__, 1, 2)));
-extern void vwarnx (const char *__format, __gnuc_va_list)
+extern void __REDIRECT_LDBL (vwarnx, (const char *__format, __gnuc_va_list),
+			     __vwarnxieee128, __nldbl_vwarnx)
      __attribute__ ((__format__ (__printf__, 1, 0)));
 
 /* Likewise, and then exit with STATUS.  */
-extern void err (int __status, const char *__format, ...)
+extern void __REDIRECT_LDBL (err, (int __status, const char *__format, ...),
+			     __errieee128, __nldbl_err)
      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
-extern void verr (int __status, const char *__format, __gnuc_va_list)
+extern void __REDIRECT_LDBL (verr, (int __status, const char *__format,
+				    __gnuc_va_list),
+			     __verrieee128, __nldbl_verr)
      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
-extern void errx (int __status, const char *__format, ...)
+extern void __REDIRECT_LDBL (errx, (int __status, const char *__format, ...),
+			     __errxieee128, __nldbl_errx)
      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
-extern void verrx (int __status, const char *, __gnuc_va_list)
+extern void __REDIRECT_LDBL (verrx, (int __status, const char *__format,
+				     __gnuc_va_list),
+			     __verrxieee128, __nldbl_verrx)
      __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/err-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif	/* err.h */
--- glibc-2.34.orig/misc/mntent_r.c
+++ glibc-2.34/misc/mntent_r.c
@@ -251,7 +251,7 @@ __addmntent (FILE *stream, const struct
   write_string (stream, mnt->mnt_dir);
   write_string (stream, mnt->mnt_type);
   write_string (stream, mnt->mnt_opts);
-  fprintf (stream, "%d %d\n", mnt->mnt_freq, mnt->mnt_passno);
+  __fprintf (stream, "%d %d\n", mnt->mnt_freq, mnt->mnt_passno);
 
   ret = __ferror_unlocked (stream) != 0 || fflush (stream) != 0;
 
--- glibc-2.34.orig/misc/sys/cdefs.h
+++ glibc-2.34/misc/sys/cdefs.h
@@ -150,6 +150,53 @@
 # define __glibc_objsize(__o) __bos (__o)
 #endif
 
+/* Compile time conditions to choose between the regular, _chk and _chk_warn
+   variants.  These conditions should get evaluated to constant and optimized
+   away.  */
+
+#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
+#define __glibc_unsigned_or_positive(__l) \
+  ((__typeof (__l)) 0 < (__typeof (__l)) -1				      \
+   || (__builtin_constant_p (__l) && (__l) > 0))
+
+/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
+   condition can be folded to a constant and if it is true.  The -1 check is
+   redundant because since it implies that __glibc_safe_len_cond is true.  */
+#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
+  (__glibc_unsigned_or_positive (__l)					      \
+   && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l),     \
+						   __s, __osz))		      \
+   && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
+
+/* Conversely, we know at compile time that the length is safe if the
+   __L * __S <= __OBJSZ condition can be folded to a constant and if it is
+   false.  */
+#define __glibc_unsafe_len(__l, __s, __osz) \
+  (__glibc_unsigned_or_positive (__l)					      \
+   && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l),     \
+						   __s, __osz))		      \
+   && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
+
+/* Fortify function f.  __f_alias, __f_chk and __f_chk_warn must be
+   declared.  */
+
+#define __glibc_fortify(f, __l, __s, __osz, ...) \
+  (__glibc_safe_or_unknown_len (__l, __s, __osz)			      \
+   ? __ ## f ## _alias (__VA_ARGS__)					      \
+   : (__glibc_unsafe_len (__l, __s, __osz)				      \
+      ? __ ## f ## _chk_warn (__VA_ARGS__, __osz)			      \
+      : __ ## f ## _chk (__VA_ARGS__, __osz)))			      \
+
+/* Fortify function f, where object size argument passed to f is the number of
+   elements and not total size.  */
+
+#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
+  (__glibc_safe_or_unknown_len (__l, __s, __osz)			      \
+   ? __ ## f ## _alias (__VA_ARGS__)					      \
+   : (__glibc_unsafe_len (__l, __s, __osz)				      \
+      ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s))		      \
+      : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))		      \
+
 #if __GNUC_PREREQ (4,3)
 # define __warnattr(msg) __attribute__((__warning__ (msg)))
 # define __errordecl(name, msg) \
@@ -500,70 +547,71 @@
 # include <bits/long-double.h>
 #endif
 
-#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# ifdef __REDIRECT
-
-/* Alias name defined automatically.  */
-#  define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
-#  define __LDBL_REDIR_DECL(name) \
-  extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
-
-/* Alias name defined automatically, with leading underscores.  */
-#  define __LDBL_REDIR2_DECL(name) \
-  extern __typeof (__##name) __##name \
-    __asm (__ASMNAME ("__" #name "ieee128"));
-
-/* Alias name defined manually.  */
-#  define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1
-#  define __LDBL_REDIR1_DECL(name, alias) \
-  extern __typeof (name) name __asm (__ASMNAME (#alias));
-
-#  define __LDBL_REDIR1_NTH(name, proto, alias) \
-  __REDIRECT_NTH (name, proto, alias)
-#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
-  __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
-
-/* Unused.  */
-#  define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
-#  define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
-
-# else
+#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
+# define __REDIRECT_LDBL1(name, prenth, posnth, proto, alias) \
+    name proto prenth __asm__ (__ASMNAME (__ASMNAME (#alias))) posnth
+# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+#  ifdef __REDIRECT
+#   define __REDIRECT_LDBL(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, , , proto, ieee128)
+#   define __REDIRECT_LDBL128(name, proto) \
+      __REDIRECT_LDBL1 (name, , , proto, __##name##ieee128)
+#   ifdef __cplusplus
+#    define __REDIRECT_LDBL_NTH(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, __THROW, , proto, ieee128)
+#    define __REDIRECT_LDBL128_NTH(name, proto) \
+      __REDIRECT_LDBL1 (name, __THROW, , proto, __##name##ieee128)
+#    define __REDIRECT_LDBL_NTHNL(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, __THROWNL, , proto, ieee128)
+#    define __REDIRECT_LDBL128_NTHNL(name, proto) \
+      __REDIRECT_LDBL1 (name, __THROWNL, , proto, __##name##ieee128)
+#   else
+#    define __REDIRECT_LDBL_NTH(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, , __THROW, proto, ieee128)
+#    define __REDIRECT_LDBL128_NTH(name, proto) \
+      __REDIRECT_LDBL1 (name, , __THROW, proto, __##name##ieee128)
+#    define __REDIRECT_LDBL_NTHNL(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, , __THROWNL, proto, ieee128)
+#    define __REDIRECT_LDBL128_NTHNL(name, proto) \
+      __REDIRECT_LDBL1 (name, , __THROWNL, proto, __##name##ieee128)
+#   endif /* __cplusplus */
+#  else
 _Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
-# endif
-#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
-# define __LDBL_COMPAT 1
-# ifdef __REDIRECT
-#  define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
-#  define __LDBL_REDIR(name, proto) \
-  __LDBL_REDIR1 (name, proto, __nldbl_##name)
-#  define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
-#  define __LDBL_REDIR_NTH(name, proto) \
-  __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
-#  define __LDBL_REDIR2_DECL(name) \
-  extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
-#  define __LDBL_REDIR1_DECL(name, alias) \
-  extern __typeof (name) name __asm (__ASMNAME (#alias));
-#  define __LDBL_REDIR_DECL(name) \
-  extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
-#  define __REDIRECT_LDBL(name, proto, alias) \
-  __LDBL_REDIR1 (name, proto, __nldbl_##alias)
-#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
-  __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
+#  endif /* __REDIRECT */
+# elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+#  define __LDBL_COMPAT 1
+#  ifdef __REDIRECT
+#   define __REDIRECT_LDBL(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, , , proto, compat)
+#   define __REDIRECT_LDBL_COMPAT(name, proto) \
+      __REDIRECT_LDBL1 (name, , , proto, __nldbl_##name)
+#   ifdef __cplusplus
+#    define __REDIRECT_LDBL_NTH(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, __THROW, , proto, compat)
+#    define __REDIRECT_LDBL_NTHNL(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, __THROWNL, , proto, compat)
+#   else
+#    define __REDIRECT_LDBL_NTH(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, , __THROW, proto, compat)
+#    define __REDIRECT_LDBL_NTHNL(name, proto, ieee128, compat) \
+      __REDIRECT_LDBL1 (name, , __THROWNL, proto, compat)
+#   endif /* __cplusplus */
+#  else
+_Static_assert (0, "Compat long double requires redirection on this platform");
+#  endif /* __REDIRECT */
 # endif
 #endif
-#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
-    || !defined __REDIRECT
-# define __LDBL_REDIR1(name, proto, alias) name proto
-# define __LDBL_REDIR(name, proto) name proto
-# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
-# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
-# define __LDBL_REDIR2_DECL(name)
-# define __LDBL_REDIR_DECL(name)
-# ifdef __REDIRECT
-#  define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
-#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
-  __REDIRECT_NTH (name, proto, alias)
-# endif
+
+#ifndef __REDIRECT_LDBL
+# define __REDIRECT_LDBL(name, proto, ieee128, compat) name proto
+# define __REDIRECT_LDBL_NTH(name, proto, ieee128, compat) name proto __THROW
+# define __REDIRECT_LDBL_NTHNL(name, proto, ieee128, compat) name proto __THROWNL
+# define __REDIRECT_LDBL128(name, proto) name proto
+# define __REDIRECT_LDBL128_NTH(name, proto) name proto __THROW
+# define __REDIRECT_LDBL128_NTHNL(name, proto) name proto __THROWNL
+#endif
+#ifndef __REDIRECT_LDBL_COMPAT
+# define __REDIRECT_LDBL_COMPAT(name, proto)
 #endif
 
 /* __glibc_macro_warning (MESSAGE) issues warning MESSAGE.  This is
--- glibc-2.34.orig/misc/sys/syslog.h
+++ glibc-2.34/misc/sys/syslog.h
@@ -38,6 +38,7 @@
 
 /* This file defines _PATH_LOG.  */
 #include <bits/syslog-path.h>
+#include <bits/floatn.h>
 
 /*
  * priorities/facilities are encoded into a single 32-bit quantity, where the
@@ -187,9 +188,9 @@ extern int setlogmask (int __mask) __THR
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern void syslog (int __pri, const char *__fmt, ...)
+extern void __REDIRECT_LDBL (syslog, (int __pri, const char *__fmt, ...),
+			     __syslogieee128, __nldbl_syslog)
      __attribute__ ((__format__ (__printf__, 2, 3)));
-
 #ifdef __USE_MISC
 /* Generate a log message using FMT and using arguments pointed to by AP.
 
@@ -197,21 +198,17 @@ extern void syslog (int __pri, const cha
    cancellation point.  But due to similarity with an POSIX interface
    or due to the implementation it is a cancellation point and
    therefore not marked with __THROW.  */
-extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
+extern void __REDIRECT_LDBL (vsyslog, (int __pri, const char *__fmt,
+				       __gnuc_va_list __ap),
+			     __vsyslogieee128, __nldbl_vsyslog)
      __attribute__ ((__format__ (__printf__, 2, 0)));
 #endif
 
-
 /* Define some macros helping to catch buffer overflows.  */
 #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
 # include <bits/syslog.h>
 #endif
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/syslog-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif /* sys/syslog.h */
--- glibc-2.34.orig/misc/syslog.c
+++ glibc-2.34/misc/syslog.c
@@ -109,7 +109,7 @@ __syslog(int pri, const char *fmt, ...)
 	__vsyslog_internal(pri, fmt, ap, 0);
 	va_end(ap);
 }
-ldbl_hidden_def (__syslog, syslog)
+libc_hidden_def (__syslog)
 ldbl_strong_alias (__syslog, syslog)
 
 void
@@ -152,7 +152,7 @@ __vsyslog_internal(int pri, const char *
 #define	INTERNALLOG	LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
 	/* Check for invalid bits. */
 	if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
-		syslog(INTERNALLOG,
+		__syslog(INTERNALLOG,
 		    "syslog: unknown facility/priority: %x", pri);
 		pri &= LOG_PRIMASK|LOG_FACMASK;
 	}
@@ -200,7 +200,7 @@ __vsyslog_internal(int pri, const char *
 	else
 	  {
 	    __fsetlocking (f, FSETLOCKING_BYCALLER);
-	    fprintf (f, "<%d>", pri);
+	    __fprintf (f, "<%d>", pri);
 	    now = time_now ();
 	    f->_IO_write_ptr += __strftime_l (f->_IO_write_ptr,
 					      f->_IO_write_end
@@ -214,7 +214,7 @@ __vsyslog_internal(int pri, const char *
 	    if (LogTag != NULL)
 	      __fputs_unlocked (LogTag, f);
 	    if (LogStat & LOG_PID)
-	      fprintf (f, "[%d]", (int) __getpid ());
+	      __fprintf (f, "[%d]", (int) __getpid ());
 	    if (LogTag != NULL)
 	      {
 		__putc_unlocked (':', f);
--- glibc-2.34.orig/nis/nis_subr.c
+++ glibc-2.34/nis/nis_subr.c
@@ -281,10 +281,10 @@ nis_getnames (const_nis_name name)
     }
 
   if (pos == 0
-      && __asprintf (&getnames[pos++], "%s%s%s%s",
-		     name, name[name_len - 1] == '.' ? "" : ".",
-		     local_domain,
-		     local_domain[local_domain_len - 1] == '.' ? "" : ".") < 0)
+      && asprintf (&getnames[pos++], "%s%s%s%s",
+		   name, name[name_len - 1] == '.' ? "" : ".",
+		   local_domain,
+		   local_domain[local_domain_len - 1] == '.' ? "" : ".") < 0)
     goto free_null;
 
   getnames[pos] = NULL;
--- glibc-2.34.orig/nptl/pthread_getname.c
+++ glibc-2.34/nptl/pthread_getname.c
@@ -42,7 +42,7 @@ __pthread_getname_np (pthread_t th, char
 
 #define FMT "/proc/self/task/%u/comm"
   char fname[sizeof (FMT) + 8];
-  sprintf (fname, FMT, (unsigned int) pd->tid);
+  __sprintf (fname, FMT, (unsigned int) pd->tid);
 
   int fd = __open64_nocancel (fname, O_RDONLY);
   if (fd == -1)
--- glibc-2.34.orig/nptl/pthread_setname.c
+++ glibc-2.34/nptl/pthread_setname.c
@@ -44,7 +44,7 @@ __pthread_setname_np (pthread_t th, cons
 
 #define FMT "/proc/self/task/%u/comm"
   char fname[sizeof (FMT) + 8];
-  sprintf (fname, FMT, (unsigned int) pd->tid);
+  __sprintf (fname, FMT, (unsigned int) pd->tid);
 
   int fd = __open64_nocancel (fname, O_RDWR);
   if (fd == -1)
--- glibc-2.34.orig/nss/nss_files/files-parse.c
+++ glibc-2.34/nss/nss_files/files-parse.c
@@ -54,6 +54,10 @@
 # define STRUCTURE ENTNAME
 #endif
 
+#if IS_IN(libc)
+# define strtoul __strtoul
+#endif
+
 
 struct parser_data
   {
--- glibc-2.34.orig/posix/bits/unistd.h
+++ glibc-2.34/posix/bits/unistd.h
@@ -35,16 +35,9 @@ extern ssize_t __REDIRECT (__read_chk_wa
 __fortify_function __wur ssize_t
 read (int __fd, void *__buf, size_t __nbytes)
 {
-  if (__glibc_objsize0 (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__nbytes))
-	return __read_chk (__fd, __buf, __nbytes, __glibc_objsize0 (__buf));
-
-      if (__nbytes > __glibc_objsize0 (__buf))
-	return __read_chk_warn (__fd, __buf, __nbytes,
-				__glibc_objsize0 (__buf));
-    }
-  return __read_alias (__fd, __buf, __nbytes);
+  return __glibc_fortify (read, __nbytes, sizeof (char),
+			  __glibc_objsize0 (__buf),
+			  __fd, __buf, __nbytes);
 }
 
 #ifdef __USE_UNIX98
@@ -78,34 +71,17 @@ extern ssize_t __REDIRECT (__pread64_chk
 __fortify_function __wur ssize_t
 pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
 {
-  if (__glibc_objsize0 (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__nbytes))
-	return __pread_chk (__fd, __buf, __nbytes, __offset,
-			    __glibc_objsize0 (__buf));
-
-      if ( __nbytes > __glibc_objsize0 (__buf))
-	return __pread_chk_warn (__fd, __buf, __nbytes, __offset,
-				 __glibc_objsize0 (__buf));
-    }
-  return __pread_alias (__fd, __buf, __nbytes, __offset);
+  return __glibc_fortify (pread, __nbytes, sizeof (char),
+			  __glibc_objsize0 (__buf),
+			  __fd, __buf, __nbytes, __offset);
 }
 # else
 __fortify_function __wur ssize_t
 pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
 {
-  if (__glibc_objsize0 (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__nbytes))
-	return __pread64_chk (__fd, __buf, __nbytes, __offset,
-			      __glibc_objsize0 (__buf));
-
-      if ( __nbytes > __glibc_objsize0 (__buf))
-	return __pread64_chk_warn (__fd, __buf, __nbytes, __offset,
-				   __glibc_objsize0 (__buf));
-    }
-
-  return __pread64_alias (__fd, __buf, __nbytes, __offset);
+  return __glibc_fortify (pread64, __nbytes, sizeof (char),
+			  __glibc_objsize0 (__buf),
+			  __fd, __buf, __nbytes, __offset);
 }
 # endif
 
@@ -113,18 +89,9 @@ pread (int __fd, void *__buf, size_t __n
 __fortify_function __wur ssize_t
 pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
 {
-  if (__glibc_objsize0 (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__nbytes))
-	return __pread64_chk (__fd, __buf, __nbytes, __offset,
-			      __glibc_objsize0 (__buf));
-
-      if ( __nbytes > __glibc_objsize0 (__buf))
-	return __pread64_chk_warn (__fd, __buf, __nbytes, __offset,
-				   __glibc_objsize0 (__buf));
-    }
-
-  return __pread64_alias (__fd, __buf, __nbytes, __offset);
+  return __glibc_fortify (pread64, __nbytes, sizeof (char),
+			  __glibc_objsize0 (__buf),
+			  __fd, __buf, __nbytes, __offset);
 }
 # endif
 #endif
@@ -149,16 +116,9 @@ __fortify_function __nonnull ((1, 2)) __
 __NTH (readlink (const char *__restrict __path, char *__restrict __buf,
 		 size_t __len))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __readlink_chk (__path, __buf, __len, __glibc_objsize (__buf));
-
-      if ( __len > __glibc_objsize (__buf))
-	return __readlink_chk_warn (__path, __buf, __len,
-				    __glibc_objsize (__buf));
-    }
-  return __readlink_alias (__path, __buf, __len);
+  return __glibc_fortify (readlink, __len, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __path, __buf, __len);
 }
 #endif
 
@@ -184,17 +144,9 @@ __fortify_function __nonnull ((2, 3)) __
 __NTH (readlinkat (int __fd, const char *__restrict __path,
 		   char *__restrict __buf, size_t __len))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __readlinkat_chk (__fd, __path, __buf, __len,
-				 __glibc_objsize (__buf));
-
-      if (__len > __glibc_objsize (__buf))
-	return __readlinkat_chk_warn (__fd, __path, __buf, __len,
-				      __glibc_objsize (__buf));
-    }
-  return __readlinkat_alias (__fd, __path, __buf, __len);
+  return __glibc_fortify (readlinkat, __len, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __fd, __path, __buf, __len);
 }
 #endif
 
@@ -211,15 +163,9 @@ extern char *__REDIRECT_NTH (__getcwd_ch
 __fortify_function __wur char *
 __NTH (getcwd (char *__buf, size_t __size))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__size))
-	return __getcwd_chk (__buf, __size, __glibc_objsize (__buf));
-
-      if (__size > __glibc_objsize (__buf))
-	return __getcwd_chk_warn (__buf, __size, __glibc_objsize (__buf));
-    }
-  return __getcwd_alias (__buf, __size);
+  return __glibc_fortify (getcwd, __size, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __buf, __size);
 }
 
 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
@@ -253,16 +199,9 @@ extern size_t __REDIRECT_NTH (__confstr_
 __fortify_function size_t
 __NTH (confstr (int __name, char *__buf, size_t __len))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __confstr_chk (__name, __buf, __len, __glibc_objsize (__buf));
-
-      if (__glibc_objsize (__buf) < __len)
-	return __confstr_chk_warn (__name, __buf, __len,
-				   __glibc_objsize (__buf));
-    }
-  return __confstr_alias (__name, __buf, __len);
+  return __glibc_fortify (confstr, __len, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __name, __buf, __len);
 }
 
 
@@ -279,15 +218,9 @@ extern int __REDIRECT_NTH (__getgroups_c
 __fortify_function int
 __NTH (getgroups (int __size, __gid_t __list[]))
 {
-  if (__glibc_objsize (__list) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__size) || __size < 0)
-	return __getgroups_chk (__size, __list, __glibc_objsize (__list));
-
-      if (__size * sizeof (__gid_t) > __glibc_objsize (__list))
-	return __getgroups_chk_warn (__size, __list, __glibc_objsize (__list));
-    }
-  return __getgroups_alias (__size, __list);
+  return __glibc_fortify (getgroups, __size, sizeof (__gid_t),
+			  __glibc_objsize (__list),
+			  __size, __list);
 }
 
 
@@ -306,17 +239,9 @@ extern int __REDIRECT_NTH (__ttyname_r_c
 __fortify_function int
 __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__buflen))
-	return __ttyname_r_chk (__fd, __buf, __buflen,
-				__glibc_objsize (__buf));
-
-      if (__buflen > __glibc_objsize (__buf))
-	return __ttyname_r_chk_warn (__fd, __buf, __buflen,
-				     __glibc_objsize (__buf));
-    }
-  return __ttyname_r_alias (__fd, __buf, __buflen);
+  return __glibc_fortify (ttyname_r, __buflen, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __fd, __buf, __buflen);
 }
 
 
@@ -334,16 +259,9 @@ extern int __REDIRECT (__getlogin_r_chk_
 __fortify_function int
 getlogin_r (char *__buf, size_t __buflen)
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__buflen))
-	return __getlogin_r_chk (__buf, __buflen, __glibc_objsize (__buf));
-
-      if (__buflen > __glibc_objsize (__buf))
-	return __getlogin_r_chk_warn (__buf, __buflen,
-				      __glibc_objsize (__buf));
-    }
-  return __getlogin_r_alias (__buf, __buflen);
+  return __glibc_fortify (getlogin_r, __buflen, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __buf, __buflen);
 }
 #endif
 
@@ -363,16 +281,9 @@ extern int __REDIRECT_NTH (__gethostname
 __fortify_function int
 __NTH (gethostname (char *__buf, size_t __buflen))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__buflen))
-	return __gethostname_chk (__buf, __buflen, __glibc_objsize (__buf));
-
-      if (__buflen > __glibc_objsize (__buf))
-	return __gethostname_chk_warn (__buf, __buflen,
-				       __glibc_objsize (__buf));
-    }
-  return __gethostname_alias (__buf, __buflen);
+  return __glibc_fortify (gethostname, __buflen, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __buf, __buflen);
 }
 #endif
 
@@ -394,15 +305,8 @@ extern int __REDIRECT_NTH (__getdomainna
 __fortify_function int
 __NTH (getdomainname (char *__buf, size_t __buflen))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__buflen))
-	return __getdomainname_chk (__buf, __buflen, __glibc_objsize (__buf));
-
-      if (__buflen > __glibc_objsize (__buf))
-	return __getdomainname_chk_warn (__buf, __buflen,
-					 __glibc_objsize (__buf));
-    }
-  return __getdomainname_alias (__buf, __buflen);
+  return __glibc_fortify (getdomainname, __buflen, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __buf, __buflen);
 }
 #endif
--- glibc-2.34.orig/posix/wordexp.c
+++ glibc-2.34/posix/wordexp.c
@@ -565,7 +565,7 @@ eval_expr_val (char **expr, long int *re
 
   /* POSIX requires that decimal, octal, and hexadecimal constants are
      recognized.  Therefore we pass 0 as the third parameter to strtol.  */
-  *result = strtol (digit, expr, 0);
+  *result = __strtol (digit, expr, 0);
   if (digit == *expr)
     return WRDE_SYNTAX;
 
@@ -1399,7 +1399,7 @@ envsubst:
   /* Is it a numeric parameter? */
   else if (isdigit (env[0]))
     {
-      unsigned long n = strtoul (env, NULL, 10);
+      unsigned long n = __strtoul (env, NULL, 10);
 
       if (n >= __libc_argc)
 	/* Substitute NULL. */
--- glibc-2.34.orig/pwd/getpw.c
+++ glibc-2.34/pwd/getpw.c
@@ -50,9 +50,9 @@ __getpw (__uid_t uid, char *buf)
   if (p == NULL)
     return -1;
 
-  if (sprintf (buf, "%s:%s:%lu:%lu:%s:%s:%s", p->pw_name, p->pw_passwd,
-	       (unsigned long int) p->pw_uid, (unsigned long int) p->pw_gid,
-	       p->pw_gecos, p->pw_dir, p->pw_shell) < 0)
+  if (__sprintf (buf, "%s:%s:%lu:%lu:%s:%s:%s", p->pw_name, p->pw_passwd,
+		 (unsigned long int) p->pw_uid, (unsigned long int) p->pw_gid,
+		 p->pw_gecos, p->pw_dir, p->pw_shell) < 0)
     return -1;
 
   return 0;
--- glibc-2.34.orig/pwd/putpwent.c
+++ glibc-2.34/pwd/putpwent.c
@@ -48,11 +48,11 @@ putpwent (const struct passwd *p, FILE *
     return -1;
 
   if (p->pw_name[0] == '+' || p->pw_name[0] == '-')
-      ret = fprintf (stream, "%s:%s:::%s:%s:%s\n",
+      ret = __fprintf (stream, "%s:%s:::%s:%s:%s\n",
 		     p->pw_name, _S (p->pw_passwd),
 		     gecos, _S (p->pw_dir), _S (p->pw_shell));
   else
-      ret = fprintf (stream, "%s:%s:%lu:%lu:%s:%s:%s\n",
+      ret = __fprintf (stream, "%s:%s:%lu:%lu:%s:%s:%s\n",
 		     p->pw_name, _S (p->pw_passwd),
 		     (unsigned long int) p->pw_uid,
 		     (unsigned long int) p->pw_gid,
--- glibc-2.34.orig/resolv/inet_addr.c
+++ glibc-2.34/resolv/inet_addr.c
@@ -130,7 +130,7 @@ inet_aton_end (const char *cp, struct in
 	goto ret_0;
       {
 	char *endp;
-	unsigned long ul = strtoul (cp, &endp, 0);
+	unsigned long ul = __strtoul (cp, &endp, 0);
 	if (ul == ULONG_MAX && errno == ERANGE)
 	  goto ret_0;
 	if (ul > 0xfffffffful)
--- glibc-2.34.orig/resolv/inet_ntop.c
+++ glibc-2.34/resolv/inet_ntop.c
@@ -28,9 +28,9 @@
 #include <string.h>
 
 #ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
+# define SPRINTF(x) strlen(__sprintf/**/x)
 #else
-# define SPRINTF(x) ((size_t)sprintf x)
+# define SPRINTF(x) ((size_t)__sprintf x)
 #endif
 
 /*
--- glibc-2.34.orig/resolv/nss_dns/dns-host.c
+++ glibc-2.34/resolv/nss_dns/dns-host.c
@@ -508,8 +508,8 @@ _nss_dns_gethostbyaddr2_r (const void *a
   switch (af)
     {
     case AF_INET:
-      sprintf (qbuf, "%u.%u.%u.%u.in-addr.arpa", (uaddr[3] & 0xff),
-	       (uaddr[2] & 0xff), (uaddr[1] & 0xff), (uaddr[0] & 0xff));
+      __sprintf (qbuf, "%u.%u.%u.%u.in-addr.arpa", (uaddr[3] & 0xff),
+		 (uaddr[2] & 0xff), (uaddr[1] & 0xff), (uaddr[0] & 0xff));
       break;
     case AF_INET6:
       qp = qbuf;
--- glibc-2.34.orig/resolv/nss_dns/dns-network.c
+++ glibc-2.34/resolv/nss_dns/dns-network.c
@@ -192,21 +192,21 @@ _nss_dns_getnetbyaddr_r (uint32_t net, i
     {
     case 3:
       /* Class A network.  */
-      sprintf (qbuf, "0.0.0.%u.in-addr.arpa", net_bytes[3]);
+      __sprintf (qbuf, "0.0.0.%u.in-addr.arpa", net_bytes[3]);
       break;
     case 2:
       /* Class B network.  */
-      sprintf (qbuf, "0.0.%u.%u.in-addr.arpa", net_bytes[3], net_bytes[2]);
+      __sprintf (qbuf, "0.0.%u.%u.in-addr.arpa", net_bytes[3], net_bytes[2]);
       break;
     case 1:
       /* Class C network.  */
-      sprintf (qbuf, "0.%u.%u.%u.in-addr.arpa", net_bytes[3], net_bytes[2],
-	       net_bytes[1]);
+      __sprintf (qbuf, "0.%u.%u.%u.in-addr.arpa", net_bytes[3], net_bytes[2],
+		 net_bytes[1]);
       break;
     case 0:
       /* Class D - E network.  */
-      sprintf (qbuf, "%u.%u.%u.%u.in-addr.arpa", net_bytes[3], net_bytes[2],
-	       net_bytes[1], net_bytes[0]);
+      __sprintf (qbuf, "%u.%u.%u.%u.in-addr.arpa", net_bytes[3], net_bytes[2],
+		 net_bytes[1], net_bytes[0]);
       break;
     }
 
--- glibc-2.34.orig/resolv/res_init.c
+++ glibc-2.34/resolv/res_init.c
@@ -654,7 +654,7 @@ res_setoptions (struct resolv_conf_parse
       /* Search for and process individual options.  */
       if (!strncmp (cp, "ndots:", sizeof ("ndots:") - 1))
         {
-          int i = atoi (cp + sizeof ("ndots:") - 1);
+	  int i = (int) __strtol (cp + sizeof ("ndots:") - 1, NULL, 10);
           if (i <= RES_MAXNDOTS)
             parser->template.ndots = i;
           else
@@ -662,7 +662,7 @@ res_setoptions (struct resolv_conf_parse
         }
       else if (!strncmp (cp, "timeout:", sizeof ("timeout:") - 1))
         {
-          int i = atoi (cp + sizeof ("timeout:") - 1);
+	  int i = (int) __strtol (cp + sizeof ("timeout:") - 1, NULL, 10);
           if (i <= RES_MAXRETRANS)
             parser->template.retrans = i;
           else
@@ -670,7 +670,7 @@ res_setoptions (struct resolv_conf_parse
         }
       else if (!strncmp (cp, "attempts:", sizeof ("attempts:") - 1))
         {
-          int i = atoi (cp + sizeof ("attempts:") - 1);
+	  int i = (int) __strtol (cp + sizeof ("attempts:") - 1, NULL, 10);
           if (i <= RES_MAXRETRY)
             parser->template.retry = i;
           else
--- glibc-2.34.orig/resolv/res_query.c
+++ glibc-2.34/resolv/res_query.c
@@ -618,7 +618,7 @@ __res_context_querydomain (struct resolv
 			RES_SET_H_ERRNO(statp, NO_RECOVERY);
 			return (-1);
 		}
-		sprintf(nbuf, "%s.%s", name, domain);
+		__sprintf(nbuf, "%s.%s", name, domain);
 	}
 	return __res_context_query (ctx, longname, class, type, answer,
 				    anslen, answerp, answerp2, nanswerp2,
--- glibc-2.34.orig/shadow/putspent.c
+++ glibc-2.34/shadow/putspent.c
@@ -42,47 +42,47 @@ putspent (const struct spwd *p, FILE *st
 
   flockfile (stream);
 
-  if (fprintf (stream, "%s:%s:", p->sp_namp, _S (p->sp_pwdp)) < 0)
+  if (__fprintf (stream, "%s:%s:", p->sp_namp, _S (p->sp_pwdp)) < 0)
     ++errors;
 
   if ((p->sp_lstchg != (long int) -1
-       && fprintf (stream, "%ld:", p->sp_lstchg) < 0)
+       && __fprintf (stream, "%ld:", p->sp_lstchg) < 0)
       || (p->sp_lstchg == (long int) -1
 	  && putc_unlocked (':', stream) == EOF))
     ++errors;
 
   if ((p->sp_min != (long int) -1
-       && fprintf (stream, "%ld:", p->sp_min) < 0)
+       && __fprintf (stream, "%ld:", p->sp_min) < 0)
       || (p->sp_min == (long int) -1
 	  && putc_unlocked (':', stream) == EOF))
     ++errors;
 
   if ((p->sp_max != (long int) -1
-       && fprintf (stream, "%ld:", p->sp_max) < 0)
+       && __fprintf (stream, "%ld:", p->sp_max) < 0)
       || (p->sp_max == (long int) -1
 	  && putc_unlocked (':', stream) == EOF))
     ++errors;
 
   if ((p->sp_warn != (long int) -1
-       && fprintf (stream, "%ld:", p->sp_warn) < 0)
+       && __fprintf (stream, "%ld:", p->sp_warn) < 0)
       || (p->sp_warn == (long int) -1
 	  && putc_unlocked (':', stream) == EOF))
     ++errors;
 
   if ((p->sp_inact != (long int) -1
-       && fprintf (stream, "%ld:", p->sp_inact) < 0)
+       && __fprintf (stream, "%ld:", p->sp_inact) < 0)
       || (p->sp_inact == (long int) -1
 	  && putc_unlocked (':', stream) == EOF))
     ++errors;
 
   if ((p->sp_expire != (long int) -1
-       && fprintf (stream, "%ld:", p->sp_expire) < 0)
+       && __fprintf (stream, "%ld:", p->sp_expire) < 0)
       || (p->sp_expire == (long int) -1
 	  && putc_unlocked (':', stream) == EOF))
     ++errors;
 
   if (p->sp_flag != ~0ul
-      && fprintf (stream, "%ld", p->sp_flag) < 0)
+      && __fprintf (stream, "%ld", p->sp_flag) < 0)
     ++errors;
 
   if (putc_unlocked ('\n', stream) == EOF)
--- glibc-2.34.orig/socket/bits/socket2.h
+++ glibc-2.34/socket/bits/socket2.h
@@ -33,17 +33,12 @@ extern ssize_t __REDIRECT (__recv_chk_wa
 __fortify_function ssize_t
 recv (int __fd, void *__buf, size_t __n, int __flags)
 {
-  if (__glibc_objsize0 (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __recv_chk (__fd, __buf, __n, __glibc_objsize0 (__buf),
-			   __flags);
-
-      if (__n > __glibc_objsize0 (__buf))
-	return __recv_chk_warn (__fd, __buf, __n, __glibc_objsize0 (__buf),
-				__flags);
-    }
-  return __recv_alias (__fd, __buf, __n, __flags);
+  size_t sz = __glibc_objsize0 (__buf);
+  if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
+    return __recv_alias (__fd, __buf, __n, __flags);
+  if (__glibc_unsafe_len (__n, sizeof (char), sz))
+    return __recv_chk_warn (__fd, __buf, __n, sz, __flags);
+  return __recv_chk (__fd, __buf, __n, sz, __flags);
 }
 
 extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n,
@@ -66,14 +61,11 @@ __fortify_function ssize_t
 recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
 	  __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
 {
-  if (__glibc_objsize0 (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __recvfrom_chk (__fd, __buf, __n, __glibc_objsize0 (__buf),
-			       __flags, __addr, __addr_len);
-      if (__n > __glibc_objsize0 (__buf))
-	return __recvfrom_chk_warn (__fd, __buf, __n, __glibc_objsize0 (__buf),
-				    __flags, __addr, __addr_len);
-    }
-  return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len);
+  size_t sz = __glibc_objsize0 (__buf);
+  if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
+    return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len);
+  if (__glibc_unsafe_len (__n, sizeof (char), sz))
+    return __recvfrom_chk_warn (__fd, __buf, __n, sz, __flags, __addr,
+				__addr_len);
+  return __recvfrom_chk (__fd, __buf, __n, sz, __flags, __addr, __addr_len);
 }
--- glibc-2.34.orig/stdio-common/Makefile
+++ glibc-2.34/stdio-common/Makefile
@@ -22,7 +22,7 @@ subdir	:= stdio-common
 
 include ../Makeconfig
 
-headers	:= stdio_ext.h printf.h bits/printf-ldbl.h bits/stdio_lim.h
+headers	:= stdio_ext.h printf.h bits/stdio_lim.h
 
 routines	:=							      \
 	ctermid cuserid							      \
--- glibc-2.34.orig/stdio-common/bits/printf-ldbl.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -mlong-double-64 compatibility mode for <printf.h> functions.
-   Copyright (C) 2006-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _PRINTF_H
-# error "Never include <bits/printf-ldbl.h> directly; use <printf.h> instead."
-#endif
-
-__LDBL_REDIR_DECL (printf_size)
--- glibc-2.34.orig/stdio-common/dprintf.c
+++ glibc-2.34/stdio-common/dprintf.c
@@ -33,5 +33,4 @@ __dprintf (int d, const char *format, ..
   return done;
 }
 libc_hidden_def (__dprintf)
-ldbl_hidden_def (__dprintf, dprintf)
 ldbl_weak_alias (__dprintf, dprintf)
--- glibc-2.34.orig/stdio-common/fprintf.c
+++ glibc-2.34/stdio-common/fprintf.c
@@ -34,7 +34,7 @@ __fprintf (FILE *stream, const char *for
 
   return done;
 }
-ldbl_hidden_def (__fprintf, fprintf)
+libc_hidden_def (__fprintf)
 ldbl_strong_alias (__fprintf, fprintf)
 
 /* We define the function with the real name here.  But deep down in
--- glibc-2.34.orig/stdio-common/printf.h
+++ glibc-2.34/stdio-common/printf.h
@@ -29,6 +29,7 @@ __BEGIN_DECLS
 #include <stddef.h>
 
 #include <stdarg.h>
+#include <bits/floatn.h>
 
 
 struct printf_info
@@ -173,20 +174,16 @@ enum
    of magnitude used for numbers ('k' for kilo, 'm' for mega etc).  If
    the format specifier is a uppercase character powers of 1000 are
    used.  Otherwise powers of 1024.  */
-extern int printf_size (FILE *__restrict __fp,
-			const struct printf_info *__info,
-			const void *const *__restrict __args) __THROW;
+extern int __REDIRECT_LDBL_NTH (printf_size, (FILE *__restrict __fp,
+					      const struct printf_info *__info,
+					      const void *const *__restrict __args),
+				__printf_sizeieee128, __nldbl_printf_size);
 
 /* This is the appropriate argument information function for `printf_size'.  */
 extern int printf_size_info (const struct printf_info *__restrict
 			     __info, size_t __n, int *__restrict __argtypes)
      __THROW;
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/printf-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif /* printf.h  */
--- glibc-2.34.orig/stdio-common/psiginfo.c
+++ glibc-2.34/stdio-common/psiginfo.c
@@ -76,7 +76,7 @@ psiginfo (const siginfo_t *pinfo, const
     }
 
   if (s != NULL && *s != '\0')
-    fprintf (fp, "%s: ", s);
+    __fprintf (fp, "%s: ", s);
 
   const char *desc;
   if (pinfo->si_signo >= 0 && pinfo->si_signo < NSIG
@@ -92,21 +92,21 @@ psiginfo (const siginfo_t *pinfo, const
 	  if (pinfo->si_signo - SIGRTMIN < SIGRTMAX - pinfo->si_signo)
 	    {
 	      if (pinfo->si_signo == SIGRTMIN)
-		fprintf (fp, "SIGRTMIN (");
+		__fprintf (fp, "SIGRTMIN (");
 	      else
-		fprintf (fp, "SIGRTMIN+%d (", pinfo->si_signo - SIGRTMIN);
+		__fprintf (fp, "SIGRTMIN+%d (", pinfo->si_signo - SIGRTMIN);
 	    }
 	  else
 	    {
 	      if (pinfo->si_signo == SIGRTMAX)
-		fprintf (fp, "SIGRTMAX (");
+		__fprintf (fp, "SIGRTMAX (");
 	      else
-		fprintf (fp, "SIGRTMAX-%d (", SIGRTMAX - pinfo->si_signo);
+		__fprintf (fp, "SIGRTMAX-%d (", SIGRTMAX - pinfo->si_signo);
 	    }
 	}
       else
 #endif
-	fprintf (fp, "%s (", _(desc));
+	__fprintf (fp, "%s (", _(desc));
 
       const char *base = NULL;
       const uint8_t *offarr = NULL;
@@ -178,25 +178,25 @@ Signal generated by the completion of an
 	  }
 
       if (str != NULL)
-	fprintf (fp, "%s ", _(str));
+	__fprintf (fp, "%s ", _(str));
       else
-	fprintf (fp, "%d ", pinfo->si_code);
+	__fprintf (fp, "%d ", pinfo->si_code);
 
       if (pinfo->si_signo == SIGILL || pinfo->si_signo == SIGFPE
 	  || pinfo->si_signo == SIGSEGV || pinfo->si_signo == SIGBUS)
-	fprintf (fp, "[%p])\n", pinfo->si_addr);
+	__fprintf (fp, "[%p])\n", pinfo->si_addr);
       else if (pinfo->si_signo == SIGCHLD)
-	fprintf (fp, "%ld %d %ld)\n",
-		 (long int) pinfo->si_pid, pinfo->si_status,
-		 (long int) pinfo->si_uid);
+	__fprintf (fp, "%ld %d %ld)\n",
+		   (long int) pinfo->si_pid, pinfo->si_status,
+		   (long int) pinfo->si_uid);
       else if (pinfo->si_signo == SIGPOLL)
-	fprintf (fp, "%ld)\n", (long int) pinfo->si_band);
+	__fprintf (fp, "%ld)\n", (long int) pinfo->si_band);
       else
-	fprintf (fp, "%ld %ld)\n",
-		 (long int) pinfo->si_pid, (long int) pinfo->si_uid);
+	__fprintf (fp, "%ld %ld)\n",
+		   (long int) pinfo->si_pid, (long int) pinfo->si_uid);
     }
   else
-    fprintf (fp, _("Unknown signal %d\n"),  pinfo->si_signo);
+    __fprintf (fp, _("Unknown signal %d\n"),  pinfo->si_signo);
 
   fclose (fp);
 
--- glibc-2.34.orig/stdio-common/sprintf.c
+++ glibc-2.34/stdio-common/sprintf.c
@@ -32,6 +32,6 @@ __sprintf (char *s, const char *format,
 
   return done;
 }
-ldbl_hidden_def (__sprintf, sprintf)
+libc_hidden_def (__sprintf)
 ldbl_strong_alias (__sprintf, sprintf)
 ldbl_strong_alias (__sprintf, _IO_sprintf)
--- glibc-2.34.orig/stdio-common/vfprintf.c
+++ glibc-2.34/stdio-common/vfprintf.c
@@ -24,4 +24,4 @@ __vfprintf (FILE *fp, const char *format
 }
 ldbl_strong_alias (__vfprintf, _IO_vfprintf);
 ldbl_strong_alias (__vfprintf, vfprintf);
-ldbl_hidden_def (__vfprintf, vfprintf)
+libc_hidden_def (__vfprintf)
--- glibc-2.34.orig/stdlib/Makefile
+++ glibc-2.34/stdlib/Makefile
@@ -22,8 +22,8 @@ subdir	:= stdlib
 
 include ../Makeconfig
 
-headers	:= stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h      \
-	   monetary.h bits/monetary-ldbl.h				      \
+headers	:= stdlib.h bits/stdlib.h bits/stdlib-float.h                         \
+	   monetary.h 							      \
 	   inttypes.h stdint.h bits/wordsize.h bits/timesize.h		      \
 	   errno.h sys/errno.h bits/errno.h bits/types/error_t.h	      \
 	   ucontext.h sys/ucontext.h bits/indirect-return.h		      \
--- glibc-2.34.orig/stdlib/atof.c
+++ glibc-2.34/stdlib/atof.c
@@ -24,5 +24,5 @@
 double
 atof (const char *nptr)
 {
-  return strtod (nptr, (char **) NULL);
+  return __strtod (nptr, (char **) NULL);
 }
--- glibc-2.34.orig/stdlib/atoi.c
+++ glibc-2.34/stdlib/atoi.c
@@ -24,6 +24,6 @@
 int
 atoi (const char *nptr)
 {
-  return (int) strtol (nptr, (char **) NULL, 10);
+  return (int) __strtol (nptr, (char **) NULL, 10);
 }
 libc_hidden_def (atoi)
--- glibc-2.34.orig/stdlib/atol.c
+++ glibc-2.34/stdlib/atol.c
@@ -24,5 +24,5 @@
 long int
 atol (const char *nptr)
 {
-  return strtol (nptr, (char **) NULL, 10);
+  return __strtol (nptr, (char **) NULL, 10);
 }
--- glibc-2.34.orig/stdlib/atoll.c
+++ glibc-2.34/stdlib/atoll.c
@@ -24,5 +24,5 @@
 long long int
 atoll (const char *nptr)
 {
-  return strtoll (nptr, (char **) NULL, 10);
+  return __strtoll (nptr, (char **) NULL, 10);
 }
--- glibc-2.34.orig/stdlib/bits/monetary-ldbl.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -mlong-double-64 compatibility mode for monetary functions.
-   Copyright (C) 2006-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _MONETARY_H
-# error "Never include <bits/monetary-ldbl.h> directly; use <monetary.h> instead."
-#endif
-
-__LDBL_REDIR_DECL (strfmon)
-
-#ifdef __USE_GNU
-__LDBL_REDIR_DECL (strfmon_l)
-#endif
--- glibc-2.34.orig/stdlib/bits/stdlib-ldbl.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -mlong-double-64 compatibility mode for <stdlib.h> functions.
-   Copyright (C) 2006-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _STDLIB_H
-# error "Never include <bits/stdlib-ldbl.h> directly; use <stdlib.h> instead."
-#endif
-
-#ifdef	__USE_ISOC99
-# ifdef __LDBL_COMPAT
-__LDBL_REDIR1_DECL (strtold, strtod)
-# else
-__LDBL_REDIR1_DECL (strtold, __strtoieee128)
-# endif
-#endif
-
-#ifdef __USE_GNU
-# ifdef __LDBL_COMPAT
-__LDBL_REDIR1_DECL (strtold_l, strtod_l)
-# else
-__LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l)
-# endif
-#endif
-
-#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
-# ifdef __LDBL_COMPAT
-__LDBL_REDIR1_DECL (strfroml, strfromd)
-# else
-__LDBL_REDIR1_DECL (strfroml, __strfromieee128)
-# endif
-#endif
-
-#ifdef __USE_MISC
-# if defined __LDBL_COMPAT
-__LDBL_REDIR1_DECL (qecvt, ecvt)
-__LDBL_REDIR1_DECL (qfcvt, fcvt)
-__LDBL_REDIR1_DECL (qgcvt, gcvt)
-__LDBL_REDIR1_DECL (qecvt_r, ecvt_r)
-__LDBL_REDIR1_DECL (qfcvt_r, fcvt_r)
-# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-__LDBL_REDIR1_DECL (qecvt, __qecvtieee128)
-__LDBL_REDIR1_DECL (qfcvt, __qfcvtieee128)
-__LDBL_REDIR1_DECL (qgcvt, __qgcvtieee128)
-__LDBL_REDIR1_DECL (qecvt_r, __qecvtieee128_r)
-__LDBL_REDIR1_DECL (qfcvt_r, __qfcvtieee128_r)
-# else
-#  error bits/stdlib-ldbl.h included when no ldbl redirections are required.
-# endif
-#endif
--- glibc-2.34.orig/stdlib/bits/stdlib.h
+++ glibc-2.34/stdlib/bits/stdlib.h
@@ -36,17 +36,16 @@ extern char *__REDIRECT_NTH (__realpath_
 __fortify_function __wur char *
 __NTH (realpath (const char *__restrict __name, char *__restrict __resolved))
 {
-  if (__glibc_objsize (__resolved) != (size_t) -1)
-    {
+  size_t sz = __glibc_objsize (__resolved);
+
+  if (sz == (size_t) -1)
+    return __realpath_alias (__name, __resolved);
+
 #if defined _LIBC_LIMITS_H_ && defined PATH_MAX
-      if (__glibc_objsize (__resolved) < PATH_MAX)
-	return __realpath_chk_warn (__name, __resolved,
-				    __glibc_objsize (__resolved));
+  if (__glibc_unsafe_len (sz, sizeof (char), PATH_MAX))
+    return __realpath_chk_warn (__name, __resolved, sz);
 #endif
-      return __realpath_chk (__name, __resolved, __glibc_objsize (__resolved));
-    }
-
-  return __realpath_alias (__name, __resolved);
+  return __realpath_chk (__name, __resolved, sz);
 }
 
 
@@ -65,16 +64,9 @@ extern int __REDIRECT_NTH (__ptsname_r_c
 __fortify_function int
 __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
 {
-  if (__glibc_objsize (__buf) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__buflen))
-	return __ptsname_r_chk (__fd, __buf, __buflen,
-				__glibc_objsize (__buf));
-      if (__buflen > __glibc_objsize (__buf))
-	return __ptsname_r_chk_warn (__fd, __buf, __buflen,
-				     __glibc_objsize (__buf));
-    }
-  return __ptsname_r_alias (__fd, __buf, __buflen);
+  return __glibc_fortify (ptsname_r, __buflen, sizeof (char),
+			  __glibc_objsize (__buf),
+			  __fd, __buf, __buflen);
 }
 
 
@@ -120,18 +112,9 @@ __fortify_function size_t
 __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src,
 		 size_t __len))
 {
-  if (__glibc_objsize (__dst) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __mbstowcs_chk (__dst, __src, __len,
-			       __glibc_objsize (__dst) / sizeof (wchar_t));
-
-      if (__len > __glibc_objsize (__dst) / sizeof (wchar_t))
-	return __mbstowcs_chk_warn (__dst, __src, __len,
-				    (__glibc_objsize (__dst)
-				     / sizeof (wchar_t)));
-    }
-  return __mbstowcs_alias (__dst, __src, __len);
+  return __glibc_fortify_n (mbstowcs, __len, sizeof (wchar_t),
+			    __glibc_objsize (__dst),
+			    __dst, __src, __len);
 }
 
 
@@ -154,13 +137,7 @@ __fortify_function size_t
 __NTH (wcstombs (char *__restrict __dst, const wchar_t *__restrict __src,
 		 size_t __len))
 {
-  if (__glibc_objsize (__dst) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __wcstombs_chk (__dst, __src, __len, __glibc_objsize (__dst));
-      if (__len > __glibc_objsize (__dst))
-	return __wcstombs_chk_warn (__dst, __src, __len,
-				    __glibc_objsize (__dst));
-    }
-  return __wcstombs_alias (__dst, __src, __len);
+  return __glibc_fortify (wcstombs, __len, sizeof (char),
+			  __glibc_objsize (__dst),
+			  __dst, __src, __len);
 }
--- glibc-2.34.orig/stdlib/fmtmsg.c
+++ glibc-2.34/stdlib/fmtmsg.c
@@ -178,17 +178,17 @@ fmtmsg (long int classification, const c
 	  int need_colon = (do_label
 			    && (do_severity | do_text | do_action | do_tag));
 
-	  syslog (LOG_ERR, "%s%s%s%s%s%s%s%s%s%s\n",
-		  do_label ? label : "",
-		  need_colon ? ": " : "",
-		  do_severity ? severity_rec->string : "",
-		  do_severity && (do_text | do_action | do_tag) ? ": " : "",
-		  do_text ? text : "",
-		  do_text && (do_action | do_tag) ? "\n" : "",
-		  do_action ? "TO FIX: " : "",
-		  do_action ? action : "",
-		  do_action && do_tag ? "  " : "",
-		  do_tag ? tag : "");
+	  __syslog (LOG_ERR, "%s%s%s%s%s%s%s%s%s%s\n",
+		    do_label ? label : "",
+		    need_colon ? ": " : "",
+		    do_severity ? severity_rec->string : "",
+		    do_severity && (do_text | do_action | do_tag) ? ": " : "",
+		    do_text ? text : "",
+		    do_text && (do_action | do_tag) ? "\n" : "",
+		    do_action ? "TO FIX: " : "",
+		    do_action ? action : "",
+		    do_action && do_tag ? "  " : "",
+		    do_tag ? tag : "");
 	}
     }
 
@@ -264,7 +264,7 @@ init (void)
 	      /* Second field: severity level, a number.  */
 	      char *cp;
 
-	      level = strtol (sevlevel_var, &cp, 0);
+	      level = __strtol (sevlevel_var, &cp, 0);
 	      if (cp != sevlevel_var && cp < end && *cp++ == ','
 		  && level > MM_INFO)
 		{
--- glibc-2.34.orig/stdlib/monetary.h
+++ glibc-2.34/stdlib/monetary.h
@@ -25,6 +25,7 @@
 #define __need_size_t
 #include <stddef.h>
 #include <bits/types.h>
+#include <bits/floatn.h>
 
 #ifndef	__ssize_t_defined
 typedef __ssize_t ssize_t;
@@ -35,28 +36,26 @@ typedef __ssize_t ssize_t;
 __BEGIN_DECLS
 
 /* Formatting a monetary value according to the current locale.  */
-extern ssize_t strfmon (char *__restrict __s, size_t __maxsize,
-			const char *__restrict __format, ...)
-     __THROW __attribute_format_strfmon__ (3, 4)
+extern ssize_t __REDIRECT_LDBL_NTH (strfmon, (char *__restrict __s, size_t __maxsize,
+					      const char *__restrict __format, ...),
+				    __strfmonieee128, __nldbl_strfmon)
+     __attribute_format_strfmon__ (3, 4)
      __attr_access ((__write_only__, 1, 2));
 
 #ifdef __USE_XOPEN2K8
 /* POSIX.1-2008 extended locale interface (see locale.h).  */
 # include <bits/types/locale_t.h>
 
-/* Formatting a monetary value according to the given locale.  */
-extern ssize_t strfmon_l (char *__restrict __s, size_t __maxsize,
-			  locale_t __loc,
-			  const char *__restrict __format, ...)
-     __THROW __attribute_format_strfmon__ (4, 5)
+extern ssize_t __REDIRECT_LDBL_NTH (strfmon_l, (char *__restrict __s,
+					       	size_t __maxsize,
+     						locale_t __loc,
+						const char *__restrict __format,
+					       	...),
+			       __strfmon_lieee128, __nldbl_strfmon_l)
+     __attribute_format_strfmon__ (4, 5)
      __attr_access ((__write_only__, 1, 2));
 #endif
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/monetary-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif	/* monetary.h */
--- glibc-2.34.orig/stdlib/stdlib.h
+++ glibc-2.34/stdlib/stdlib.h
@@ -123,9 +123,10 @@ extern double strtod (const char *__rest
 extern float strtof (const char *__restrict __nptr,
 		     char **__restrict __endptr) __THROW __nonnull ((1));
 
-extern long double strtold (const char *__restrict __nptr,
-			    char **__restrict __endptr)
-     __THROW __nonnull ((1));
+extern long double __REDIRECT_LDBL_NTH (strtold, (const char *__restrict __nptr,
+						  char **__restrict __endptr),
+					__strtoieee128, strtod)
+     __nonnull ((1));
 #endif
 
 /* Likewise for '_FloatN' and '_FloatNx'.  */
@@ -217,9 +218,11 @@ extern int strfromf (char *__dest, size_
 		     float __f)
      __THROW __nonnull ((3));
 
-extern int strfroml (char *__dest, size_t __size, const char *__format,
-		     long double __f)
-     __THROW __nonnull ((3));
+extern int __REDIRECT_LDBL_NTH (strfroml, (char *__dest, size_t __size,
+					   const char *__format,
+					   long double __f),
+				__strfromieee128, strfromd)
+     __nonnull ((3));
 #endif
 
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
@@ -300,10 +303,11 @@ extern float strtof_l (const char *__res
 		       char **__restrict __endptr, locale_t __loc)
      __THROW __nonnull ((1, 3));
 
-extern long double strtold_l (const char *__restrict __nptr,
-			      char **__restrict __endptr,
-			      locale_t __loc)
-     __THROW __nonnull ((1, 3));
+extern long double __REDIRECT_LDBL_NTH (strtold_l, (const char *__restrict __nptr,
+						    char **__restrict __endptr,
+						    locale_t __loc),
+					__strtoieee128_l, strtod_l)
+     __nonnull ((1, 3));
 
 # if __HAVE_FLOAT16
 extern _Float16 strtof16_l (const char *__restrict __nptr,
@@ -893,14 +897,20 @@ extern char *gcvt (double __value, int _
 
 #ifdef __USE_MISC
 /* Long double versions of above functions.  */
-extern char *qecvt (long double __value, int __ndigit,
-		    int *__restrict __decpt, int *__restrict __sign)
-     __THROW __nonnull ((3, 4)) __wur;
-extern char *qfcvt (long double __value, int __ndigit,
-		    int *__restrict __decpt, int *__restrict __sign)
-     __THROW __nonnull ((3, 4)) __wur;
-extern char *qgcvt (long double __value, int __ndigit, char *__buf)
-     __THROW __nonnull ((3)) __wur;
+extern char * __REDIRECT_LDBL_NTH (qecvt, (long double __value, int __ndigit,
+					   int *__restrict __decpt,
+					   int *__restrict __sign),
+				   __qecvtieee128, ecvt)
+     __nonnull ((3, 4)) __wur;
+extern char * __REDIRECT_LDBL_NTH (qfcvt, (long double __value, int __ndigit,
+					   int *__restrict __decpt,
+					   int *__restrict __sign),
+				   __qfcvtieee128, fcvt)
+     __nonnull ((3, 4)) __wur;
+extern char * __REDIRECT_LDBL_NTH (qgcvt, (long double __value, int __ndigit,
+					   char *__buf),
+				   __qgcvtieee128, gcvt)
+     __nonnull ((3)) __wur;
 
 
 /* Reentrant version of the functions above which provide their own
@@ -912,14 +922,20 @@ extern int fcvt_r (double __value, int _
 		   int *__restrict __sign, char *__restrict __buf,
 		   size_t __len) __THROW __nonnull ((3, 4, 5));
 
-extern int qecvt_r (long double __value, int __ndigit,
-		    int *__restrict __decpt, int *__restrict __sign,
-		    char *__restrict __buf, size_t __len)
-     __THROW __nonnull ((3, 4, 5));
-extern int qfcvt_r (long double __value, int __ndigit,
-		    int *__restrict __decpt, int *__restrict __sign,
-		    char *__restrict __buf, size_t __len)
-     __THROW __nonnull ((3, 4, 5));
+extern int __REDIRECT_LDBL_NTH (qecvt_r, (long double __value, int __ndigit,
+					  int *__restrict __decpt,
+					  int *__restrict __sign,
+					  char *__restrict __buf,
+					  size_t __len),
+				__qecvtieee128_r, ecvt_r)
+     __nonnull ((3, 4, 5));
+extern int __REDIRECT_LDBL_NTH (qfcvt_r, (long double __value, int __ndigit,
+					  int *__restrict __decpt,
+					  int *__restrict __sign,
+					  char *__restrict __buf,
+					  size_t __len),
+				__qfcvtieee128_r, fcvt_r)
+     __nonnull ((3, 4, 5));
 #endif	/* misc */
 
 
@@ -1024,11 +1040,6 @@ extern int ttyslot (void) __THROW;
 # include <bits/stdlib.h>
 #endif
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/stdlib-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif /* stdlib.h  */
--- glibc-2.34.orig/stdlib/strtod.c
+++ glibc-2.34/stdlib/strtod.c
@@ -62,6 +62,8 @@
 
 #define INTERNAL(x) INTERNAL1(x)
 #define INTERNAL1(x) __##x##_internal
+#define DOUBLEUNDESCORE(x) DOUBLEUNDESCORE1(x)
+#define DOUBLEUNDESCORE1(x) __##x
 
 
 FLOAT
@@ -78,12 +80,13 @@ FLOAT
 #ifdef weak_function
 weak_function
 #endif
-STRTOF (const STRING_TYPE *nptr, STRING_TYPE **endptr)
+DOUBLEUNDESCORE (STRTOF) (const STRING_TYPE *nptr, STRING_TYPE **endptr)
 {
   return INTERNAL(STRTOF_L) (nptr, endptr, 0, _NL_CURRENT_LOCALE);
 }
 #if defined _LIBC
-libc_hidden_def (STRTOF)
+weak_alias (DOUBLEUNDESCORE (STRTOF), STRTOF)
+libc_hidden_def (DOUBLEUNDESCORE (STRTOF))
 #endif
 
 #ifdef LONG_DOUBLE_COMPAT
--- glibc-2.34.orig/stdlib/strtol.c
+++ glibc-2.34/stdlib/strtol.c
@@ -106,4 +106,4 @@ __strtol (const STRING_TYPE *nptr, STRIN
   return INTERNAL (__strtol_l) (nptr, endptr, base, 0, _NL_CURRENT_LOCALE);
 }
 weak_alias (__strtol, strtol)
-libc_hidden_weak (strtol)
+libc_hidden_weak (__strtol)
--- glibc-2.34.orig/stdlib/strtold.c
+++ glibc-2.34/stdlib/strtold.c
@@ -35,13 +35,13 @@
 #ifdef __LONG_DOUBLE_MATH_OPTIONAL
 # include <wchar.h>
 # define NEW(x) NEW1(x)
-# define NEW1(x) __new_##x
-long double ____new_strtold_internal (const char *, char **, int);
+# define NEW1(x) new_##x
+long double __new_strtold_internal (const char *, char **, int);
 long double __new_strtold (const char *, char **);
-long double ____new_wcstold_internal (const wchar_t *, wchar_t **, int);
+long double __new_wcstold_internal (const wchar_t *, wchar_t **, int);
 long double __new_wcstold (const wchar_t *, wchar_t **);
-libc_hidden_proto (____new_strtold_internal)
-libc_hidden_proto (____new_wcstold_internal)
+libc_hidden_proto (__new_strtold_internal)
+libc_hidden_proto (__new_wcstold_internal)
 libc_hidden_proto (__new_strtold)
 libc_hidden_proto (__new_wcstold)
 #else
@@ -64,12 +64,12 @@ libc_hidden_proto (__new_wcstold)
 # include <math_ldbl_opt.h>
 # ifdef USE_WIDE_CHAR
 long_double_symbol (libc, __new_wcstold, wcstold);
-long_double_symbol (libc, ____new_wcstold_internal, __wcstold_internal);
-libc_hidden_ver (____new_wcstold_internal, __wcstold_internal)
+long_double_symbol (libc, __new_wcstold_internal, __wcstold_internal);
+libc_hidden_ver (__new_wcstold_internal, __wcstold_internal)
 # else
 long_double_symbol (libc, __new_strtold, strtold);
-long_double_symbol (libc, ____new_strtold_internal, __strtold_internal);
-libc_hidden_ver (____new_strtold_internal, __strtold_internal)
+long_double_symbol (libc, __new_strtold_internal, __strtold_internal);
+libc_hidden_ver (__new_strtold_internal, __strtold_internal)
 # endif
 #endif
 
--- glibc-2.34.orig/sunrpc/netname.c
+++ glibc-2.34/sunrpc/netname.c
@@ -49,7 +49,7 @@ user2netname (char netname[MAXNETNAMELEN
   if ((strlen (dfltdom) + OPSYS_LEN + 3 + MAXIPRINT) > (size_t) MAXNETNAMELEN)
     return 0;
 
-  sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
+  __sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
   i = strlen (netname);
   if (netname[i - 1] == '.')
     netname[i - 1] = '\0';
@@ -113,7 +113,7 @@ host2netname (char netname[MAXNETNAMELEN
       > MAXNETNAMELEN)
     return 0;
 
-  sprintf (netname, "%s.%s@%s", OPSYS, hostname, domainname);
+  __sprintf (netname, "%s.%s@%s", OPSYS, hostname, domainname);
   return 1;
 }
 #ifdef EXPORT_RPC_SYMBOLS
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-asprintf.c
@@ -19,8 +19,8 @@
 #include <stdarg.h>
 #include <libio/libioP.h>
 
-extern int
-___ieee128___asprintf (char **string_ptr, const char *format, ...)
+int
+__asprintfieee128 (char **string_ptr, const char *format, ...)
 {
   va_list ap;
   int done;
@@ -32,5 +32,4 @@ ___ieee128___asprintf (char **string_ptr
 
   return done;
 }
-hidden_def (___ieee128___asprintf)
-strong_alias (___ieee128___asprintf, __asprintfieee128)
+libc_hidden_def (__asprintfieee128)
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-dprintf.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-dprintf.c
@@ -19,8 +19,8 @@
 #include <stdarg.h>
 #include <libio/libioP.h>
 
-extern int
-___ieee128_dprintf (int d, const char *format, ...)
+int
+__dprintfieee128 (int d, const char *format, ...)
 {
   va_list ap;
   int done;
@@ -31,5 +31,4 @@ ___ieee128_dprintf (int d, const char *f
 
   return done;
 }
-strong_alias (___ieee128_dprintf, __dprintfieee128)
-hidden_def (___ieee128_dprintf);
+libc_hidden_def (__dprintfieee128);
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-err.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-err.c
@@ -20,81 +20,72 @@
 #include <stdarg.h>
 #include <libio/libioP.h>
 
-#define VA(call)							\
+#define IEEE128_NAME(name) __ ## name ## ieee128
+
+#define VA(name, ...)							\
 {									\
   va_list ap;								\
   va_start (ap, format);						\
-  IEEE128_CALL (call);							\
+  IEEE128_NAME (name) (__VA_ARGS__);					\
   va_end (ap);								\
 }
 
 #define IEEE128_ALIAS(name) \
-  strong_alias (___ieee128_##name, __##name##ieee128)
+  libc_hidden_def (IEEE128_NAME(name))
 
-#define IEEE128_DECL(name) ___ieee128_##name
-#define IEEE128_CALL(name) ___ieee128_##name
 
 void
-IEEE128_DECL (vwarn) (const char *format, __gnuc_va_list ap)
+IEEE128_NAME (vwarn) (const char *format, __gnuc_va_list ap)
 {
   __vwarn_internal (format, ap, PRINTF_LDBL_USES_FLOAT128);
 }
 IEEE128_ALIAS (vwarn)
 
 void
-IEEE128_DECL (vwarnx) (const char *format, __gnuc_va_list ap)
+IEEE128_NAME (vwarnx) (const char *format, __gnuc_va_list ap)
 {
   __vwarnx_internal (format, ap, PRINTF_LDBL_USES_FLOAT128);
 }
 IEEE128_ALIAS (vwarnx)
 
 void
-IEEE128_DECL (warn) (const char *format, ...)
+IEEE128_NAME (warn) (const char *format, ...)
 {
-  VA (vwarn (format, ap))
+  VA (vwarn, format, ap)
 }
 IEEE128_ALIAS (warn)
 
 void
-IEEE128_DECL (warnx) (const char *format, ...)
+IEEE128_NAME (warnx) (const char *format, ...)
 {
-  VA (vwarnx (format, ap))
+  VA (vwarnx, format, ap)
 }
 IEEE128_ALIAS (warnx)
 
 void
-IEEE128_DECL (verr) (int status, const char *format, __gnuc_va_list ap)
+IEEE128_NAME (verr) (int status, const char *format, __gnuc_va_list ap)
 {
-  IEEE128_CALL (vwarn) (format, ap);
+  IEEE128_NAME (vwarn) (format, ap);
   exit (status);
 }
 IEEE128_ALIAS (verr)
 
 void
-IEEE128_DECL (verrx) (int status, const char *format, __gnuc_va_list ap)
+IEEE128_NAME (verrx) (int status, const char *format, __gnuc_va_list ap)
 {
-  IEEE128_CALL (vwarnx) (format, ap);
+  IEEE128_NAME (vwarnx) (format, ap);
   exit (status);
 }
 IEEE128_ALIAS (verrx)
 
 void
-IEEE128_DECL (err) (int status, const char *format, ...)
+IEEE128_NAME (err) (int status, const char *format, ...)
 {
-  VA (verr (status, format, ap))
+  VA (verr, status, format, ap)
 }
-IEEE128_ALIAS (err)
 
 void
-IEEE128_DECL (errx) (int status, const char *format, ...)
+IEEE128_NAME (errx) (int status, const char *format, ...)
 {
-  VA (verrx (status, format, ap))
+  VA (verrx, status, format, ap)
 }
-IEEE128_ALIAS (errx)
-
-hidden_def (___ieee128_warn)
-hidden_def (___ieee128_warnx)
-hidden_def (___ieee128_vwarn)
-hidden_def (___ieee128_vwarnx)
-hidden_def (___ieee128_verr)
-hidden_def (___ieee128_verrx)
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf.c
@@ -19,8 +19,8 @@
 #include <stdarg.h>
 #include <libio/libioP.h>
 
-extern int
-___ieee128_fprintf (FILE *fp, const char *format, ...)
+int
+__fprintfieee128 (FILE *fp, const char *format, ...)
 {
   va_list ap;
   int done;
@@ -31,5 +31,4 @@ ___ieee128_fprintf (FILE *fp, const char
 
   return done;
 }
-strong_alias (___ieee128_fprintf, __fprintfieee128)
-hidden_def (___ieee128_fprintf)
+libc_hidden_def (__fprintfieee128)
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-qefgcvt.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-qefgcvt.c
@@ -18,8 +18,8 @@
 
 /* When in IEEE long double mode, call ___ieee128_sprintf.  */
 #include <stdio.h>
-typeof (sprintf) ___ieee128_sprintf attribute_hidden;
-#define SPRINTF ___ieee128_sprintf
+typeof (sprintf) __sprintfieee128 attribute_hidden;
+#define SPRINTF __sprintfieee128
 
 /* Declare internal functions: ___qecvtieee128_r and ___qfcvtieee128_r,
    built from a different compiling unit, and called from here.  */
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-qefgcvt_r.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-qefgcvt_r.c
@@ -18,8 +18,8 @@
 
 /* When in IEEE long double mode, call ___ieee128_snprintf.  */
 #include <stdio.h>
-typeof (snprintf) ___ieee128_snprintf attribute_hidden;
-#define SNPRINTF ___ieee128_snprintf
+typeof (snprintf) __snprintfieee128 attribute_hidden;
+#define SNPRINTF __snprintfieee128
 
 #define ECVT_R __qecvtieee128_r
 #define FCVT_R __qfcvtieee128_r
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-snprintf.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-snprintf.c
@@ -19,8 +19,8 @@
 #include <stdarg.h>
 #include <libio/libioP.h>
 
-extern int
-___ieee128_snprintf (char *s, size_t maxlen, const char *format, ...)
+int
+__snprintfieee128 (char *s, size_t maxlen, const char *format, ...)
 {
   va_list ap;
   int done;
@@ -32,4 +32,4 @@ ___ieee128_snprintf (char *s, size_t max
 
   return done;
 }
-strong_alias (___ieee128_snprintf, __snprintfieee128)
+libc_hidden_def (__snprintfieee128)
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf.c
@@ -19,8 +19,8 @@
 #include <stdarg.h>
 #include <libio/libioP.h>
 
-extern int
-___ieee128_sprintf (char *s, const char *format, ...)
+int
+__sprintfieee128 (char *s, const char *format, ...)
 {
   va_list ap;
   int done;
@@ -32,5 +32,4 @@ ___ieee128_sprintf (char *s, const char
 
   return done;
 }
-strong_alias (___ieee128_sprintf, __sprintfieee128)
-hidden_def (___ieee128_sprintf)
+libc_hidden_def (__sprintfieee128)
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
@@ -21,7 +21,7 @@
 #include <syslog.h>
 
 void
-___ieee128_syslog (int pri, const char *fmt, ...)
+__syslogieee128 (int pri, const char *fmt, ...)
 {
   va_list ap;
 
@@ -29,8 +29,7 @@ ___ieee128_syslog (int pri, const char *
   __vsyslog_internal (pri, fmt, ap, PRINTF_LDBL_USES_FLOAT128);
   va_end (ap);
 }
-strong_alias (___ieee128_syslog, __syslogieee128)
-hidden_def (___ieee128_syslog)
+hidden_def (__syslogieee128)
 
 void
 ___ieee128_vsyslog (int pri, const char *fmt, va_list ap)
--- glibc-2.34.orig/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfprintf.c
+++ glibc-2.34/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfprintf.c
@@ -18,10 +18,9 @@
 
 #include <libio/libioP.h>
 
-extern int
-___ieee128_vfprintf (FILE *fp, const char *format, va_list ap)
+int
+__vfprintfieee128 (FILE *fp, const char *format, va_list ap)
 {
   return __vfprintf_internal (fp, format, ap, PRINTF_LDBL_USES_FLOAT128);
 }
-strong_alias (___ieee128_vfprintf, __vfprintfieee128)
-hidden_def (___ieee128_vfprintf)
+libc_hidden_def (__vfprintfieee128)
--- glibc-2.34.orig/sysdeps/posix/getaddrinfo.c
+++ glibc-2.34/sysdeps/posix/getaddrinfo.c
@@ -90,6 +90,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 
 #if IS_IN (libc)
 # define feof_unlocked(fp) __feof_unlocked (fp)
+# define strtoul __strtoul
 #endif
 
 struct gaih_service
--- glibc-2.34.orig/sysdeps/posix/tempname.c
+++ glibc-2.34/sysdeps/posix/tempname.c
@@ -161,7 +161,7 @@ __path_search (char *tmpl, size_t tmpl_l
       return -1;
     }
 
-  sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
+  __sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
   return 0;
 }
 #endif /* _LIBC */
--- glibc-2.34.orig/sysdeps/unix/sysv/linux/getlogin_r.c
+++ glibc-2.34/sysdeps/unix/sysv/linux/getlogin_r.c
@@ -51,7 +51,7 @@ __getlogin_r_loginuid (char *name, size_
   if (n <= 0
       || n == sizeof (uidbuf)
       || (uidbuf[n] = '\0',
-	  uid = strtoul (uidbuf, &endp, 10),
+	  uid = __strtoul (uidbuf, &endp, 10),
 	  endp == uidbuf || *endp != '\0'))
     return -1;
 
--- glibc-2.34.orig/sysdeps/unix/sysv/linux/getsysstats.c
+++ glibc-2.34/sysdeps/unix/sysv/linux/getsysstats.c
@@ -157,7 +157,7 @@ get_nprocs_cpu_online (void)
 	do
 	  {
 	    char *endp;
-	    unsigned long int n = strtoul (l, &endp, 10);
+	    unsigned long int n = __strtoul (l, &endp, 10);
 	    if (l == endp)
 	      {
 		result = 0;
@@ -168,7 +168,7 @@ get_nprocs_cpu_online (void)
 	    if (*endp == '-')
 	      {
 		l = endp + 1;
-		m = strtoul (l, &endp, 10);
+		m = __strtoul (l, &endp, 10);
 		if (l == endp)
 		  {
 		    result = 0;
@@ -205,7 +205,7 @@ get_nprocs_cpu (void)
 	if (d->d_type == DT_DIR && strncmp (d->d_name, "cpu", 3) == 0)
 	  {
 	    char *endp;
-	    unsigned long int nr = strtoul (d->d_name + 3, &endp, 10);
+	    unsigned long int nr = __strtoul (d->d_name + 3, &endp, 10);
 	    if (nr != ULONG_MAX && endp != d->d_name + 3 && *endp == '\0')
 	      ++count;
 	  }
--- glibc-2.34.orig/sysdeps/unix/sysv/linux/ia64/makecontext.c
+++ glibc-2.34/sysdeps/unix/sysv/linux/ia64/makecontext.c
@@ -55,7 +55,7 @@ __makecontext (ucontext_t *ucp, void (*f
 
   if (argc > 8)
     {
-      fprintf (stderr, _("\
+      __fprintf (stderr, _("\
 makecontext: does not know how to handle more than 8 arguments\n"));
       exit (-1);
     }
--- glibc-2.34.orig/sysdeps/unix/sysv/linux/readonly-area.c
+++ glibc-2.34/sysdeps/unix/sysv/linux/readonly-area.c
@@ -59,13 +59,13 @@ __readonly_area (const char *ptr, size_t
 	break;
 
       char *p;
-      uintptr_t from = strtoul (line, &p, 16);
+      uintptr_t from = __strtoul (line, &p, 16);
 
       if (p == line || *p++ != '-')
 	break;
 
       char *q;
-      uintptr_t to = strtoul (p, &q, 16);
+      uintptr_t to = __strtoul (p, &q, 16);
 
       if (q == p || *q++ != ' ')
 	break;
--- glibc-2.34.orig/sysdeps/unix/sysv/linux/sysconf.c
+++ glibc-2.34/sysdeps/unix/sysv/linux/sysconf.c
@@ -111,7 +111,7 @@ __sysconf (int name)
 	      buf[n] = '\0';
 
 	      char *endp;
-	      long int res = strtol (buf, &endp, 10);
+	      long int res = __strtol (buf, &endp, 10);
 	      if (endp != buf && (*endp == '\0' || *endp == '\n'))
 		return res;
 	    }
--- glibc-2.34.orig/sysdeps/wordsize-64/strtol.c
+++ glibc-2.34/sysdeps/wordsize-64/strtol.c
@@ -11,7 +11,6 @@
 strong_alias (__strtol_internal, __strtoll_internal)
 libc_hidden_ver (__strtol_internal, __strtoll_internal)
 weak_alias (strtol, strtoll)
-libc_hidden_ver (strtol, strtoll)
+libc_hidden_ver (__strtol, __strtoll)
 weak_alias (strtol, strtoq)
-libc_hidden_ver (strtol, strtoq)
 weak_alias (strtol, strtoimax)
--- glibc-2.34.orig/time/tzset.c
+++ glibc-2.34/time/tzset.c
@@ -242,7 +242,7 @@ parse_rule (const char **tzp, int whichr
       tzr->type = *tz == 'J' ? J1 : J0;
       if (tzr->type == J1 && !isdigit (*++tz))
 	return false;
-      unsigned long int d = strtoul (tz, &end, 10);
+      unsigned long int d = __strtoul (tz, &end, 10);
       if (end == tz || d > 365)
 	return false;
       if (tzr->type == J1 && d == 0)
--- glibc-2.34.orig/wcsmbs/Makefile
+++ glibc-2.34/wcsmbs/Makefile
@@ -22,7 +22,7 @@ subdir	:= wcsmbs
 
 include ../Makeconfig
 
-headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h \
+headers	:= wchar.h bits/wchar.h bits/wchar2.h uchar.h \
 	   bits/types/__mbstate_t.h bits/types/mbstate_t.h bits/types/wint_t.h
 
 routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
--- glibc-2.34.orig/wcsmbs/bits/wchar-ldbl.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -mlong-double-64 compatibility mode for <wchar.h> functions.
-   Copyright (C) 2006-2021 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _WCHAR_H
-# error "Never include <bits/wchar-ldbl.h> directly; use <wchar.h> instead."
-#endif
-
-#if defined __USE_ISOC95 || defined __USE_UNIX98
-__LDBL_REDIR_DECL (fwprintf);
-__LDBL_REDIR_DECL (wprintf);
-__LDBL_REDIR_DECL (swprintf);
-__LDBL_REDIR_DECL (vfwprintf);
-__LDBL_REDIR_DECL (vwprintf);
-__LDBL_REDIR_DECL (vswprintf);
-# if !__GLIBC_USE (DEPRECATED_SCANF)
-#  if defined __LDBL_COMPAT
-__LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf)
-__LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf)
-__LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf)
-#  elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-__LDBL_REDIR1_DECL (fwscanf, __isoc99_fwscanfieee128)
-__LDBL_REDIR1_DECL (wscanf, __isoc99_wscanfieee128)
-__LDBL_REDIR1_DECL (swscanf, __isoc99_swscanfieee128)
-#  else
-#   error bits/stdlib-ldbl.h included when no ldbl redirections are required.
-#  endif
-# else
-__LDBL_REDIR_DECL (fwscanf);
-__LDBL_REDIR_DECL (wscanf);
-__LDBL_REDIR_DECL (swscanf);
-# endif
-#endif
-
-#ifdef __USE_ISOC99
-# ifdef __LDBL_COMPAT
-__LDBL_REDIR1_DECL (wcstold, wcstod);
-# else
-__LDBL_REDIR1_DECL (wcstold, __wcstoieee128)
-# endif
-# if !__GLIBC_USE (DEPRECATED_SCANF)
-#  if defined __LDBL_COMPAT
-__LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf)
-__LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf)
-__LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf)
-#  elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-__LDBL_REDIR1_DECL (vfwscanf, __isoc99_vfwscanfieee128)
-__LDBL_REDIR1_DECL (vwscanf, __isoc99_vwscanfieee128)
-__LDBL_REDIR1_DECL (vswscanf, __isoc99_vswscanfieee128)
-#  else
-#   error bits/stdlib-ldbl.h included when no ldbl redirections are required.
-#  endif
-# else
-__LDBL_REDIR_DECL (vfwscanf);
-__LDBL_REDIR_DECL (vwscanf);
-__LDBL_REDIR_DECL (vswscanf);
-# endif
-#endif
-
-#ifdef __USE_GNU
-# ifdef __LDBL_COMPAT
-__LDBL_REDIR1_DECL (wcstold_l, wcstod_l);
-# else
-__LDBL_REDIR1_DECL (wcstold_l, __wcstoieee128_l)
-# endif
-#endif
-
-#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
-__LDBL_REDIR2_DECL (swprintf_chk)
-__LDBL_REDIR2_DECL (vswprintf_chk)
-# if __USE_FORTIFY_LEVEL > 1
-__LDBL_REDIR2_DECL (fwprintf_chk)
-__LDBL_REDIR2_DECL (wprintf_chk)
-__LDBL_REDIR2_DECL (vfwprintf_chk)
-__LDBL_REDIR2_DECL (vwprintf_chk)
-# endif
-#endif
--- glibc-2.34.orig/wcsmbs/bits/wchar2.h
+++ glibc-2.34/wcsmbs/bits/wchar2.h
@@ -39,17 +39,9 @@ __fortify_function wchar_t *
 __NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
 		size_t __n))
 {
-  if (__glibc_objsize0 (__s1) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __wmemcpy_chk (__s1, __s2, __n,
-			      __glibc_objsize0 (__s1) / sizeof (wchar_t));
-
-      if (__n > __glibc_objsize0 (__s1) / sizeof (wchar_t))
-	return __wmemcpy_chk_warn (__s1, __s2, __n,
-				   __glibc_objsize0 (__s1) / sizeof (wchar_t));
-    }
-  return __wmemcpy_alias (__s1, __s2, __n);
+  return __glibc_fortify_n (wmemcpy, __n, sizeof (wchar_t),
+			    __glibc_objsize0 (__s1),
+			    __s1, __s2, __n);
 }
 
 
@@ -67,18 +59,9 @@ extern wchar_t *__REDIRECT_NTH (__wmemmo
 __fortify_function wchar_t *
 __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n))
 {
-  if (__glibc_objsize0 (__s1) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __wmemmove_chk (__s1, __s2, __n,
-			       __glibc_objsize0 (__s1) / sizeof (wchar_t));
-
-      if (__n > __glibc_objsize0 (__s1) / sizeof (wchar_t))
-	return __wmemmove_chk_warn (__s1, __s2, __n,
-				    (__glibc_objsize0 (__s1)
-				     / sizeof (wchar_t)));
-    }
-  return __wmemmove_alias (__s1, __s2, __n);
+  return __glibc_fortify_n (wmemmove, __n, sizeof (wchar_t),
+			    __glibc_objsize0 (__s1),
+			    __s1, __s2, __n);
 }
 
 
@@ -101,18 +84,9 @@ __fortify_function wchar_t *
 __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
 		 size_t __n))
 {
-  if (__glibc_objsize0 (__s1) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __wmempcpy_chk (__s1, __s2, __n,
-			       __glibc_objsize0 (__s1) / sizeof (wchar_t));
-
-      if (__n > __glibc_objsize0 (__s1) / sizeof (wchar_t))
-	return __wmempcpy_chk_warn (__s1, __s2, __n,
-				    (__glibc_objsize0 (__s1)
-				     / sizeof (wchar_t)));
-    }
-  return __wmempcpy_alias (__s1, __s2, __n);
+  return __glibc_fortify_n (wmempcpy, __n, sizeof (wchar_t),
+			    __glibc_objsize0 (__s1),
+			    __s1, __s2, __n);
 }
 #endif
 
@@ -130,17 +104,9 @@ extern wchar_t *__REDIRECT_NTH (__wmemse
 __fortify_function wchar_t *
 __NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
 {
-  if (__glibc_objsize0 (__s) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __wmemset_chk (__s, __c, __n,
-			      __glibc_objsize0 (__s) / sizeof (wchar_t));
-
-      if (__n > __glibc_objsize0 (__s) / sizeof (wchar_t))
-	return __wmemset_chk_warn (__s, __c, __n,
-				   __glibc_objsize0 (__s) / sizeof (wchar_t));
-    }
-  return __wmemset_alias (__s, __c, __n);
+  return __glibc_fortify_n (wmemset, __n, sizeof (wchar_t),
+			    __glibc_objsize0 (__s),
+			    __s, __c, __n);
 }
 
 
@@ -154,9 +120,9 @@ extern wchar_t *__REDIRECT_NTH (__wcscpy
 __fortify_function wchar_t *
 __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
 {
-  if (__glibc_objsize (__dest) != (size_t) -1)
-    return __wcscpy_chk (__dest, __src,
-			 __glibc_objsize (__dest) / sizeof (wchar_t));
+  size_t sz = __glibc_objsize (__dest);
+  if (sz != (size_t) -1)
+    return __wcscpy_chk (__dest, __src, sz / sizeof (wchar_t));
   return __wcscpy_alias (__dest, __src);
 }
 
@@ -171,9 +137,9 @@ extern wchar_t *__REDIRECT_NTH (__wcpcpy
 __fortify_function wchar_t *
 __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
 {
-  if (__glibc_objsize (__dest) != (size_t) -1)
-    return __wcpcpy_chk (__dest, __src,
-			 __glibc_objsize (__dest) / sizeof (wchar_t));
+  size_t sz = __glibc_objsize (__dest);
+  if (sz != (size_t) -1)
+    return __wcpcpy_chk (__dest, __src, sz / sizeof (wchar_t));
   return __wcpcpy_alias (__dest, __src);
 }
 
@@ -196,17 +162,9 @@ __fortify_function wchar_t *
 __NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
 		size_t __n))
 {
-  if (__glibc_objsize (__dest) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __wcsncpy_chk (__dest, __src, __n,
-			      __glibc_objsize (__dest) / sizeof (wchar_t));
-      if (__n > __glibc_objsize (__dest) / sizeof (wchar_t))
-	return __wcsncpy_chk_warn (__dest, __src, __n,
-				   (__glibc_objsize (__dest)
-				    / sizeof (wchar_t)));
-    }
-  return __wcsncpy_alias (__dest, __src, __n);
+  return __glibc_fortify_n (wcsncpy, __n, sizeof (wchar_t),
+			    __glibc_objsize (__dest),
+			    __dest, __src, __n);
 }
 
 
@@ -228,17 +186,9 @@ __fortify_function wchar_t *
 __NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
 		size_t __n))
 {
-  if (__glibc_objsize (__dest) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n))
-	return __wcpncpy_chk (__dest, __src, __n,
-			      __glibc_objsize (__dest) / sizeof (wchar_t));
-      if (__n > __glibc_objsize (__dest) / sizeof (wchar_t))
-	return __wcpncpy_chk_warn (__dest, __src, __n,
-				   (__glibc_objsize (__dest)
-				    / sizeof (wchar_t)));
-    }
-  return __wcpncpy_alias (__dest, __src, __n);
+  return __glibc_fortify_n (wcpncpy, __n, sizeof (wchar_t),
+			    __glibc_objsize (__dest),
+			    __dest, __src, __n);
 }
 
 
@@ -252,9 +202,9 @@ extern wchar_t *__REDIRECT_NTH (__wcscat
 __fortify_function wchar_t *
 __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
 {
-  if (__glibc_objsize (__dest) != (size_t) -1)
-    return __wcscat_chk (__dest, __src,
-			 __glibc_objsize (__dest) / sizeof (wchar_t));
+  size_t sz = __glibc_objsize (__dest);
+  if (sz != (size_t) -1)
+    return __wcscat_chk (__dest, __src, sz / sizeof (wchar_t));
   return __wcscat_alias (__dest, __src);
 }
 
@@ -271,33 +221,35 @@ __fortify_function wchar_t *
 __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
 		size_t __n))
 {
-  if (__glibc_objsize (__dest) != (size_t) -1)
-    return __wcsncat_chk (__dest, __src, __n,
-			  __glibc_objsize (__dest) / sizeof (wchar_t));
+  size_t sz = __glibc_objsize (__dest);
+  if (sz != (size_t) -1)
+    return __wcsncat_chk (__dest, __src, __n, sz / sizeof (wchar_t));
   return __wcsncat_alias (__dest, __src, __n);
 }
 
-
-extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
-			   int __flag, size_t __s_len,
-			   const wchar_t *__restrict __format, ...)
-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
-
-extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
-				(wchar_t *__restrict __s, size_t __n,
-				 const wchar_t *__restrict __fmt, ...),
-				swprintf);
+extern int __REDIRECT_LDBL_NTH (__swprintf_chk, (wchar_t *__restrict __s,
+						 size_t __n,
+						 int __flag, size_t __s_len,
+						 const wchar_t *__restrict __format,
+						 ...),
+				__swprintf_chkieee128, __nldbl___swprintf_chk);
+extern int __REDIRECT_LDBL_NTH (__vswprintf_chk, (wchar_t *__restrict __s,
+						  size_t __n,
+						  int __flag, size_t __s_len,
+						  const wchar_t *__restrict __format,
+						  __gnuc_va_list __arg),
+				__vswprintf_chkieee128, __nldbl___vswprintf_chk);
 
 #ifdef __va_arg_pack
 __fortify_function int
 __NTH (swprintf (wchar_t *__restrict __s, size_t __n,
 		 const wchar_t *__restrict __fmt, ...))
 {
-  if (__glibc_objsize (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+  size_t sz = __glibc_objsize (__s);
+  if (sz != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
     return __swprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
-			   __glibc_objsize (__s) / sizeof (wchar_t),
-			   __fmt, __va_arg_pack ());
-  return __swprintf_alias (__s, __n, __fmt, __va_arg_pack ());
+			   sz / sizeof (wchar_t), __fmt, __va_arg_pack ());
+  return swprintf (__s, __n, __fmt, __va_arg_pack ());
 }
 #elif !defined __cplusplus
 /* XXX We might want to have support in gcc for swprintf.  */
@@ -308,40 +260,38 @@ __NTH (swprintf (wchar_t *__restrict __s
    : swprintf (s, n, __VA_ARGS__))
 #endif
 
-extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
-			    int __flag, size_t __s_len,
-			    const wchar_t *__restrict __format,
-			    __gnuc_va_list __arg)
-     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
-
-extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
-				(wchar_t *__restrict __s, size_t __n,
-				 const wchar_t *__restrict __fmt,
-				 __gnuc_va_list __ap), vswprintf);
-
 __fortify_function int
 __NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
 		  const wchar_t *__restrict __fmt, __gnuc_va_list __ap))
 {
-  if (__glibc_objsize (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+  size_t sz = __glibc_objsize (__s);
+  if (sz != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
     return __vswprintf_chk (__s, __n,  __USE_FORTIFY_LEVEL - 1,
-			    __glibc_objsize (__s) / sizeof (wchar_t), __fmt,
-			    __ap);
-  return __vswprintf_alias (__s, __n, __fmt, __ap);
+			    sz / sizeof (wchar_t), __fmt, __ap);
+  return vswprintf (__s, __n, __fmt, __ap);
 }
 
 
 #if __USE_FORTIFY_LEVEL > 1
 
-extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
-			   const wchar_t *__restrict __format, ...);
-extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
-			  ...);
-extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
-			    const wchar_t *__restrict __format,
-			    __gnuc_va_list __ap);
-extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
-			   __gnuc_va_list __ap);
+extern int __REDIRECT_LDBL (__fwprintf_chk, (__FILE *__restrict __stream,
+					     int __flag,
+					     const wchar_t *__restrict __format,
+					     ...),
+			    __fwprintf_chkieee128, __nldbl___fwprintf_chk);
+extern int __REDIRECT_LDBL (__wprintf_chk, (int __flag,
+					    const wchar_t *__restrict __format,
+					    ...),
+			    __wprintf_chkieee128, __nldbl___wprintf_chk);
+extern int __REDIRECT_LDBL (__vfwprintf_chk, (__FILE *__restrict __stream,
+					      int __flag,
+					      const wchar_t *__restrict __format,
+					      __gnuc_va_list __ap),
+			   __vfwprintf_chkieee128, __nldbl___vfwprintf_chk);
+extern int __REDIRECT_LDBL (__vwprintf_chk, (int __flag,
+					     const wchar_t *__restrict __format,
+					     __gnuc_va_list __ap),
+			    __vwprintf_chkieee128, __nldbl___vwprintf_chk);
 
 # ifdef __va_arg_pack
 __fortify_function int
@@ -392,18 +342,12 @@ extern wchar_t *__REDIRECT (__fgetws_chk
 __fortify_function __wur wchar_t *
 fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
 {
-  if (__glibc_objsize (__s) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n) || __n <= 0)
-	return __fgetws_chk (__s, __glibc_objsize (__s) / sizeof (wchar_t),
-			     __n, __stream);
-
-      if ((size_t) __n > __glibc_objsize (__s) / sizeof (wchar_t))
-	return __fgetws_chk_warn (__s,
-				  __glibc_objsize (__s) / sizeof (wchar_t),
-				  __n, __stream);
-    }
-  return __fgetws_alias (__s, __n, __stream);
+  size_t sz = __glibc_objsize (__s);
+  if (__glibc_safe_or_unknown_len (__n, sizeof (wchar_t), sz))
+    return __fgetws_alias (__s, __n, __stream);
+  if (__glibc_unsafe_len (__n, sizeof (wchar_t), sz))
+    return __fgetws_chk_warn (__s, sz / sizeof (wchar_t), __n, __stream);
+  return __fgetws_chk (__s, sz / sizeof (wchar_t), __n, __stream);
 }
 
 #ifdef __USE_GNU
@@ -424,20 +368,13 @@ extern wchar_t *__REDIRECT (__fgetws_unl
 __fortify_function __wur wchar_t *
 fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
 {
-  if (__glibc_objsize (__s) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__n) || __n <= 0)
-	return __fgetws_unlocked_chk (__s,
-				      __glibc_objsize (__s) / sizeof (wchar_t),
-				      __n, __stream);
-
-      if ((size_t) __n > __glibc_objsize (__s) / sizeof (wchar_t))
-	return __fgetws_unlocked_chk_warn (__s,
-					   (__glibc_objsize (__s)
-					    / sizeof (wchar_t)),
-					   __n, __stream);
-    }
-  return __fgetws_unlocked_alias (__s, __n, __stream);
+  size_t sz = __glibc_objsize (__s);
+  if (__glibc_safe_or_unknown_len (__n, sizeof (wchar_t), sz))
+    return __fgetws_unlocked_alias (__s, __n, __stream);
+  if (__glibc_unsafe_len (__n, sizeof (wchar_t), sz))
+    return __fgetws_unlocked_chk_warn (__s, sz / sizeof (wchar_t), __n,
+				       __stream);
+  return __fgetws_unlocked_chk (__s, sz / sizeof (wchar_t), __n, __stream);
 }
 #endif
 
@@ -488,18 +425,9 @@ __fortify_function size_t
 __NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
 		  size_t __len, mbstate_t *__restrict __ps))
 {
-  if (__glibc_objsize (__dst) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __mbsrtowcs_chk (__dst, __src, __len, __ps,
-				__glibc_objsize (__dst) / sizeof (wchar_t));
-
-      if (__len > __glibc_objsize (__dst) / sizeof (wchar_t))
-	return __mbsrtowcs_chk_warn (__dst, __src, __len, __ps,
-				     (__glibc_objsize (__dst)
-				      / sizeof (wchar_t)));
-    }
-  return __mbsrtowcs_alias (__dst, __src, __len, __ps);
+  return __glibc_fortify_n (mbsrtowcs, __len, sizeof (wchar_t),
+			    __glibc_objsize (__dst),
+			    __dst, __src, __len, __ps);
 }
 
 
@@ -523,17 +451,9 @@ __fortify_function size_t
 __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
 		  size_t __len, mbstate_t *__restrict __ps))
 {
-  if (__glibc_objsize (__dst) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __wcsrtombs_chk (__dst, __src, __len, __ps,
-				__glibc_objsize (__dst));
-
-      if (__len > __glibc_objsize (__dst))
-	return __wcsrtombs_chk_warn (__dst, __src, __len, __ps,
-				     __glibc_objsize (__dst));
-    }
-  return __wcsrtombs_alias (__dst, __src, __len, __ps);
+  return __glibc_fortify (wcsrtombs, __len, sizeof (char),
+			  __glibc_objsize (__dst),
+			  __dst, __src, __len, __ps);
 }
 
 
@@ -559,18 +479,9 @@ __fortify_function size_t
 __NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
 		   size_t __nmc, size_t __len, mbstate_t *__restrict __ps))
 {
-  if (__glibc_objsize (__dst) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __mbsnrtowcs_chk (__dst, __src, __nmc, __len, __ps,
-				 __glibc_objsize (__dst) / sizeof (wchar_t));
-
-      if (__len > __glibc_objsize (__dst) / sizeof (wchar_t))
-	return __mbsnrtowcs_chk_warn (__dst, __src, __nmc, __len, __ps,
-				      (__glibc_objsize (__dst)
-				       / sizeof (wchar_t)));
-    }
-  return __mbsnrtowcs_alias (__dst, __src, __nmc, __len, __ps);
+  return __glibc_fortify_n (mbsnrtowcs, __len, sizeof (wchar_t),
+			    __glibc_objsize (__dst),
+			    __dst, __src, __nmc, __len, __ps);
 }
 
 
@@ -596,16 +507,8 @@ __fortify_function size_t
 __NTH (wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
 		   size_t __nwc, size_t __len, mbstate_t *__restrict __ps))
 {
-  if (__glibc_objsize (__dst) != (size_t) -1)
-    {
-      if (!__builtin_constant_p (__len))
-	return __wcsnrtombs_chk (__dst, __src, __nwc, __len, __ps,
-				 __glibc_objsize (__dst));
-
-      if (__len > __glibc_objsize (__dst))
-	return __wcsnrtombs_chk_warn (__dst, __src, __nwc, __len, __ps,
-				      __glibc_objsize (__dst));
-    }
-  return __wcsnrtombs_alias (__dst, __src, __nwc, __len, __ps);
+  return __glibc_fortify (wcsnrtombs, __len, sizeof (char),
+			  __glibc_objsize (__dst),
+			  __dst, __src, __nwc, __len, __ps);
 }
 #endif
--- glibc-2.34.orig/wcsmbs/wchar.h
+++ glibc-2.34/wcsmbs/wchar.h
@@ -382,8 +382,10 @@ extern double wcstod (const wchar_t *__r
 /* Likewise for `float' and `long double' sizes of floating-point numbers.  */
 extern float wcstof (const wchar_t *__restrict __nptr,
 		     wchar_t **__restrict __endptr) __THROW;
-extern long double wcstold (const wchar_t *__restrict __nptr,
-			    wchar_t **__restrict __endptr) __THROW;
+extern long double __REDIRECT_LDBL_NTH (wcstold,
+					(const wchar_t *__restrict __nptr,
+					 wchar_t **__restrict __endptr),
+					__wcstoieee128, wcstod);
 #endif /* C99 */
 
 /* Likewise for `_FloatN' and `_FloatNx' when support is enabled.  */
@@ -498,9 +500,12 @@ extern float wcstof_l (const wchar_t *__
 		       wchar_t **__restrict __endptr, locale_t __loc)
      __THROW;
 
-extern long double wcstold_l (const wchar_t *__restrict __nptr,
-			      wchar_t **__restrict __endptr,
-			      locale_t __loc) __THROW;
+
+extern long double __REDIRECT_LDBL_NTH (wcstold_l,
+					(const wchar_t *__restrict __nptr,
+					 wchar_t **__restrict __endptr,
+					 locale_t __loc),
+					__wcstoieee128_l, wcstod_l);
 
 # if __HAVE_FLOAT16
 extern _Float16 wcstof16_l (const wchar_t *__restrict __nptr,
@@ -587,73 +592,61 @@ extern __FILE *open_wmemstream (wchar_t
 /* Select orientation for stream.  */
 extern int fwide (__FILE *__fp, int __mode) __THROW;
 
-
 /* Write formatted output to STREAM.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int fwprintf (__FILE *__restrict __stream,
-		     const wchar_t *__restrict __format, ...)
+extern int __REDIRECT_LDBL128 (fwprintf, (__FILE *__restrict __stream,
+					  const wchar_t *__restrict __format,
+					  ...))
      /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
 /* Write formatted output to stdout.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int wprintf (const wchar_t *__restrict __format, ...)
+extern int __REDIRECT_LDBL128 (wprintf, (const wchar_t *__restrict __format, ...))
      /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
 /* Write formatted output of at most N characters to S.  */
-extern int swprintf (wchar_t *__restrict __s, size_t __n,
-		     const wchar_t *__restrict __format, ...)
-     __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
+extern int __REDIRECT_LDBL128_NTH (swprintf, (wchar_t *__restrict __s, size_t __n,
+					      const wchar_t *__restrict __format,
+					      ...))
+     /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
 
 /* Write formatted output to S from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vfwprintf (__FILE *__restrict __s,
-		      const wchar_t *__restrict __format,
-		      __gnuc_va_list __arg)
+extern int __REDIRECT_LDBL128 (vfwprintf, (__FILE *__restrict __s,
+					const wchar_t *__restrict __format,
+					__gnuc_va_list __arg))
      /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
 /* Write formatted output to stdout from argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int vwprintf (const wchar_t *__restrict __format,
-		     __gnuc_va_list __arg)
+extern int __REDIRECT_LDBL128 (vwprintf, (const wchar_t *__restrict __format,
+				       __gnuc_va_list __arg))
      /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
 /* Write formatted output of at most N character to S from argument
    list ARG.  */
-extern int vswprintf (wchar_t *__restrict __s, size_t __n,
-		      const wchar_t *__restrict __format,
-		      __gnuc_va_list __arg)
-     __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
-
-
-/* Read formatted input from STREAM.
-
-   This function is a possible cancellation point and therefore not
-   marked with __THROW.  */
-extern int fwscanf (__FILE *__restrict __stream,
-		    const wchar_t *__restrict __format, ...)
-     /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
-/* Read formatted input from stdin.
-
-   This function is a possible cancellation point and therefore not
-   marked with __THROW.  */
-extern int wscanf (const wchar_t *__restrict __format, ...)
-     /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
-/* Read formatted input from S.  */
-extern int swscanf (const wchar_t *__restrict __s,
-		    const wchar_t *__restrict __format, ...)
-     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+extern int __REDIRECT_LDBL128_NTH (vswprintf, (wchar_t *__restrict __s, size_t __n,
+				      const wchar_t *__restrict __format,
+					      __gnuc_va_list __arg))
+     /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
 
-/* For historical reasons, the C99-compliant versions of the scanf
-   functions are at alternative names.  When __LDBL_COMPAT or
-   __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI are in effect, this is handled in
-   bits/wchar-ldbl.h.  */
-#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \
-     && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0
-#  ifdef __REDIRECT
+# if !__GLIBC_USE (DEPRECATED_SCANF)
+#  if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (fwscanf, (__FILE *__restrict __stream,
+				      const wchar_t *__restrict __format, ...),
+			    __isoc99_fwscanfieee128, __nldbl___isoc99_fwscanf);
+extern int __REDIRECT_LDBL (wscanf, (const wchar_t *__restrict __format, ...),
+			    __isoc99_wscanfieee128,__nldbl___isoc99_wscanf);
+extern int __REDIRECT_LDBL_NTH (swscanf, (const wchar_t *__restrict __s,
+					  const wchar_t *__restrict __format,
+					  ...),
+				__isoc99_swscanfieee128, __nldbl___isoc99_swscanf);
+#  else
+#   ifdef __REDIRECT
 extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream,
 				 const wchar_t *__restrict __format, ...),
 		       __isoc99_fwscanf)
@@ -665,72 +658,129 @@ extern int __REDIRECT_NTH (swscanf, (con
 				     const wchar_t *__restrict __format,
 				     ...), __isoc99_swscanf)
      /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
-#  else
+#   else
 extern int __isoc99_fwscanf (__FILE *__restrict __stream,
 			     const wchar_t *__restrict __format, ...);
 extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...);
 extern int __isoc99_swscanf (const wchar_t *__restrict __s,
 			     const wchar_t *__restrict __format, ...)
      __THROW;
-#   define fwscanf __isoc99_fwscanf
-#   define wscanf __isoc99_wscanf
-#   define swscanf __isoc99_swscanf
+#    define fwscanf __isoc99_fwscanf
+#    define wscanf __isoc99_wscanf
+#    define swscanf __isoc99_swscanf
+#   endif /* __REDIRECT */
+#  endif
+# else
+#  if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (fwscanf, (__FILE *__restrict __stream,
+				      const wchar_t *__restrict __format, ...),
+			    __fwscanfieee128, __nldbl_fwscanf);
+extern int __REDIRECT_LDBL (wscanf, (const wchar_t *__restrict __format, ...),
+			    __wscanfieee128,__nldbl_wscanf);
+extern int __REDIRECT_LDBL_NTH (swscanf, (const wchar_t *__restrict __s,
+					  const wchar_t *__restrict __format,
+					  ...),
+				__swscanfieee128, __nldbl_swscanf);
+#  else
+/* Read formatted input from STREAM.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int fwscanf (__FILE *__restrict __stream,
+                    const wchar_t *__restrict __format, ...)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+/* Read formatted input from stdin.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int wscanf (const wchar_t *__restrict __format, ...)
+     /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
+/* Read formatted input from S.  */
+extern int swscanf (const wchar_t *__restrict __s,
+                    const wchar_t *__restrict __format, ...)
+     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
 #  endif
 # endif
 
 #endif /* Use ISO C95, C99 and Unix98. */
 
 #ifdef __USE_ISOC99
+# if !__GLIBC_USE (DEPRECATED_SCANF)
+#  if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (vfwscanf, (__FILE *__restrict __stream,
+				       const wchar_t *__restrict __format,
+				       __gnuc_va_list __arg),
+			    __isoc99_vfwscanfieee128, __nldbl___isoc99_vfwscanf);
+extern int __REDIRECT_LDBL (vwscanf, (const wchar_t *__restrict __format,
+				      __gnuc_va_list __arg),
+			    __isoc99_vwscanfieee128, __nldbl___isoc99_vwscanf);
+extern int __REDIRECT_LDBL_NTH (vswscanf, (const wchar_t *__restrict __s,
+					   const wchar_t *__restrict __format,
+					   __gnuc_va_list __arg),
+				__isoc99_vswscanfieee128,
+				__nldbl___isoc99_vswscanf);
+#  else
+#   ifdef __REDIRECT
+extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s,
+                                  const wchar_t *__restrict __format,
+                                  __gnuc_va_list __arg), __isoc99_vfwscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format,
+                                 __gnuc_va_list __arg), __isoc99_vwscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
+extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s,
+                                      const wchar_t *__restrict __format,
+                                      __gnuc_va_list __arg), __isoc99_vswscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+#   else
+extern int __isoc99_vfwscanf (__FILE *__restrict __s,
+                              const wchar_t *__restrict __format,
+                              __gnuc_va_list __arg);
+extern int __isoc99_vwscanf (const wchar_t *__restrict __format,
+                             __gnuc_va_list __arg);
+extern int __isoc99_vswscanf (const wchar_t *__restrict __s,
+                              const wchar_t *__restrict __format,
+                              __gnuc_va_list __arg) __THROW;
+#    define vfwscanf __isoc99_vfwscanf
+#    define vwscanf __isoc99_vwscanf
+#    define vswscanf __isoc99_vswscanf
+#   endif /* __REDIRECT */
+#  endif
+# else
+#  if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 || defined __LDBL_COMPAT
+extern int __REDIRECT_LDBL (vfwscanf, (__FILE *__restrict __stream,
+				       const wchar_t *__restrict __format,
+				       __gnuc_va_list __arg),
+			    __vfwscanfieee128, __nldbl_vfwscanf);
+extern int __REDIRECT_LDBL (vwscanf, (const wchar_t *__restrict __format,
+				      __gnuc_va_list __arg),
+			    __vwscanfieee128, __nldbl_vwscanf);
+extern int __REDIRECT_LDBL_NTH (vswscanf, (const wchar_t *__restrict __s,
+					   const wchar_t *__restrict __format,
+					   __gnuc_va_list __arg),
+				__vswscanfieee128,
+				__nldbl_vswscanf);
+#  else
 /* Read formatted input from S into argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int vfwscanf (__FILE *__restrict __s,
-		     const wchar_t *__restrict __format,
-		     __gnuc_va_list __arg)
+                     const wchar_t *__restrict __format,
+                     __gnuc_va_list __arg)
      /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
 /* Read formatted input from stdin into argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int vwscanf (const wchar_t *__restrict __format,
-		    __gnuc_va_list __arg)
+                    __gnuc_va_list __arg)
      /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
 /* Read formatted input from S into argument list ARG.  */
 extern int vswscanf (const wchar_t *__restrict __s,
-		     const wchar_t *__restrict __format,
-		     __gnuc_va_list __arg)
+                     const wchar_t *__restrict __format,
+                     __gnuc_va_list __arg)
      __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
-
-/* Same redirection as above for the v*wscanf family.  */
-# if !__GLIBC_USE (DEPRECATED_SCANF) \
-     && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
-     && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) \
-     && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0
-#  ifdef __REDIRECT
-extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s,
-				  const wchar_t *__restrict __format,
-				  __gnuc_va_list __arg), __isoc99_vfwscanf)
-     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
-extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format,
-				 __gnuc_va_list __arg), __isoc99_vwscanf)
-     /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
-extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s,
-				      const wchar_t *__restrict __format,
-				      __gnuc_va_list __arg), __isoc99_vswscanf)
-     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
-#  else
-extern int __isoc99_vfwscanf (__FILE *__restrict __s,
-			      const wchar_t *__restrict __format,
-			      __gnuc_va_list __arg);
-extern int __isoc99_vwscanf (const wchar_t *__restrict __format,
-			     __gnuc_va_list __arg);
-extern int __isoc99_vswscanf (const wchar_t *__restrict __s,
-			      const wchar_t *__restrict __format,
-			      __gnuc_va_list __arg) __THROW;
-#   define vfwscanf __isoc99_vfwscanf
-#   define vwscanf __isoc99_vwscanf
-#   define vswscanf __isoc99_vswscanf
 #  endif
 # endif
 
@@ -867,11 +917,6 @@ extern size_t wcsftime_l (wchar_t *__res
 # include <bits/wchar2.h>
 #endif
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/wchar-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif /* wchar.h  */
