public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] stdio: Move include of bits/stdio-ldbl.h before bits/stdio.h
Date: Thu, 24 Feb 2022 14:10:35 -0300	[thread overview]
Message-ID: <00f81cc7-ae24-f055-9bd5-42169c6c3a61@linaro.org> (raw)
In-Reply-To: <4439e314-dd0d-fb57-0a68-83c3e6f36c20@physik.fu-berlin.de>



On 23/02/2022 17:51, John Paul Adrian Glaubitz wrote:
> Hi Adhemerval!
> 
> On 3/23/21 18:59, Adhemerval Zanella wrote:
>> I am not sure if this is the correct approach, I am seeing it building for powerpc64le with gcc version 10.2.1 20210126:
>>
>> | powerpc64le-glibc-linux-gnu-gcc nscd.c -c [...]
>> | In file included from ../include/sys/cdefs.h:3,
>> |                  from ../include/features.h:484,
>> |                  from ../sysdeps/powerpc/bits/floatn.h:22,
>> |                  from ../include/stdio.h:7,
>> |                  from ../argp/argp.h:23,
>> |                  from ../include/argp.h:2,
>> |                  from nscd.c:20:
>> | ../misc/sys/cdefs.h:503:20: error: ‘__dprintf_chk’ undeclared here (not in a function); did you mean ‘__sprintf_chk’?
>> |   503 |   extern __typeof (__##name) __##name \
>>       |                    ^~
>> | ../libio/bits/stdio-ldbl.h:98:1: note: in expansion of macro ‘__LDBL_REDIR2_DECL’
>> |    98 | __LDBL_REDIR2_DECL (dprintf_chk)
>> |       | ^~~~~~~~~~~~~~~~~~
>> | [...]
>>
>> The postprocessor output shows:
>>
>> | [...]
>> |  2820 extern __typeof (__dprintf_chk) __dprintf_chk __asm ("" "__" "dprintf_chk" "ieee128");
>> | [...]
>> |  3067 extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
>> | 3068      ...) __attribute__ ((__format__ (__printf__, 3, 4)));
>>
>> Meaning we are not using __typeof *before* the function prototype
>> is define.
>>
>> I think to proper handle this LLVM limitation we will need to fully
>> rework how __LDBL_REDIR2_DECL does the redirect by something similar
>> to what __REDIRECT does by defining something like:
>>
>> | #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
>> | # ifdef __REDIRECT
>> |
>> | /* Alias name defined automatically.  */
>> | #  define __LDBL_REDIR(name, proto) \
>> |  extern name proto __asm__ (__ASMNAME ("__" #name "ieee128"));
>> |
>> | /* Alias name defined automatically, with leading underscores.  */
>> | #  define __LDBL_REDIR2_DECL(name) \
>> |    extern __##name proto __asm__ (__ASMNAME ("__" #name "ieee128"));
>>
>> |
>> | /* Alias name defined manually.  */
>> | #  define __LDBL_REDIR1(name, proto, alias) \
>> |  extern name proto __asm__ (__ASMNAME (alias));
>>
>> And replace __LDBL_REDIR_DECL with __LDBL_REDIR and __LDBL_REDIR1_DECL
>> with __LDBL_REDIR1 (while adding the require argument prototype).  It
>> will allow to move the stdio-ldbl.h definitions to stdio and remove the
>> header.
> 
> I don't fully understand how to implement this but I would like to fix this because
> this the main remaining issue with glibc that keeps LLVM from successfully building
> on sparc64.
> 
> Could you maybe help me come up with a patch to fix this issue?

The idea is to refactor the way we define both the external alias and the
internal ones to remove the libc_hidden_ldbl_proto, __LDBL_REDIR_DECL, and
associate macros.

We will have only one definition, we glibc will define all the expected aliase
(for float128 or nldbl if the case), instead of redefine the function prototype
after the initial prototype (as bits/stdio-ldbl.h).  Afaik this is essentially
what clang does not support and most likely won't.

Below is a very hacking and incomplete patch that does it *only* for fprintf. 
The internal usage change to use a proper internal symbol.  Our current pratice
is not do it for symbols defined in standard C (such as memcpy), but I don't
see who we won't accomplish it since the currenct pratice is doing exactly
what clang does not support so we can use the default symbol name internally
on glibc.

diff --git a/argp/argp-parse.c b/argp/argp-parse.c
index 68dc45417b..2bfbb2d928 100644
--- a/argp/argp-parse.c
+++ b/argp/argp-parse.c
@@ -177,7 +177,7 @@ argp_version_parser (int key, char *arg, struct argp_state *state)
       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);
diff --git a/grp/putgrent.c b/grp/putgrent.c
index 966ba2a763..305ff44359 100644
--- a/grp/putgrent.c
+++ b/grp/putgrent.c
@@ -45,10 +45,10 @@ putgrent (const struct group *gr, FILE *stream)
   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 *stream)
   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);
diff --git a/gshadow/putsgent.c b/gshadow/putsgent.c
index 9e2dca7eaf..870438de6d 100644
--- a/gshadow/putsgent.c
+++ b/gshadow/putsgent.c
@@ -42,7 +42,7 @@ putsgent (const struct sgrp *g, FILE *stream)
 
   _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 *stream)
   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 *stream)
   if (sp != NULL)
     while (*sp != NULL)
       {
-	if (fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
+	if (__fprintf (stream, "%s%s", first ? "" : ",", *sp++) < 0)
 	  {
 	    ++errors;
 	    break;
diff --git a/include/stdio.h b/include/stdio.h
index 23b7fd288c..ffdeabba91 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -209,7 +209,16 @@ 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 (fprintf)
+#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED
+extern __typeof (fprintf) __fprintfieee128;
+libc_hidden_proto (__fprintfieee128);
+extern __typeof (fprintf) __fprintf __asm__ ("__GI___fprintfieee128") __attribute__ ((visibility ("hidden")));
+#else
+extern __typeof (fprintf) __fprintf;
+libc_hidden_proto (__fprintf);
+#endif
+//libc_hidden_proto (fprintf);
 libc_hidden_ldbl_proto (vfprintf)
 libc_hidden_ldbl_proto (sprintf)
 libc_hidden_proto (ungetc)
diff --git a/libio/stdio.h b/libio/stdio.h
index e6425341ce..d5ffb840fd 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -347,8 +347,27 @@ extern void setlinebuf (FILE *__stream) __THROW;
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
+#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+# ifdef __REDIRECT_LDBL
+extern int __REDIRECT_LDBL (fprintf, (FILE *__restrict __stream,
+				      const char *__restrict __format, ...),
+			    __fprintfieee128);
+# else
+#  define fprintf ___fprintfieee128
+# endif
+#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# ifdef __REDIRECT_LDBL
+extern int __REDIRECT_LDBL (fprintf, (FILE *__restrict __stream,
+				      const char *__restrict __format, ...),
+			    __nldbl_fprintf);
+# else
+#  define fprintf __nldbl_fprintf
+# endif
+#else
 extern int fprintf (FILE *__restrict __stream,
 		    const char *__restrict __format, ...);
+#endif
+
 /* Write formatted output to stdout.
 
    This function is a possible cancellation point and therefore not
@@ -895,9 +914,11 @@ extern int __overflow (FILE *, int);
 #endif
 
 #include <bits/floatn.h>
+#if 0
 #if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
 # include <bits/stdio-ldbl.h>
 #endif
+#endif
 
 __END_DECLS
 
diff --git a/malloc/malloc-check.c b/malloc/malloc-check.c
index 0299fe99a7..e1f68bddfb 100644
--- a/malloc/malloc-check.c
+++ b/malloc/malloc-check.c
@@ -17,6 +17,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
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 1a1ac1d8f0..f5a6d87160 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -5279,9 +5279,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)));
@@ -5293,12 +5293,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);
 }
@@ -5729,7 +5729,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;
@@ -5840,12 +5840,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);
@@ -5853,7 +5853,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"
@@ -5863,7 +5863,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",
@@ -5873,7 +5873,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);
@@ -5886,7 +5886,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"
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index 3311ba0b50..65f29b97e9 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -251,7 +251,7 @@ __addmntent (FILE *stream, const struct mntent *mnt)
   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;
 
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 44d3826bca..4904d28383 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -560,6 +560,28 @@
 # include <bits/long-double.h>
 #endif
 
+#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
+# if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+#  define __REDIRECT_LDBL(name, proto, alias) \
+      name proto __asm__ (__ASMNAME (#alias))
+#  ifdef __cplusplus
+#   define __REDIRECT_LDBL_NTH(name, proto, alias) \
+      name proto __THROW __asm__ (__ASMNAME (#alias))
+#   define __REDIRECT_LDBL_NTHNL(name, proto, alias) \
+      name proto __THROWNL __asm__ (__ASMNAME (#alias))
+#  else
+#   define __REDIRECT_LDBL_NTH(name, proto, alias) \
+      name proto __asm__ (__ASMNAME (#alias)) __THROW
+#   define __REDIRECT_LDBL_NTHNL(name, proto, alias) \
+      name proto __asm__ (__ASMNAME (#alias)) __THROWNL
+#  endif
+# else
+#  define __REDIRECT_LDBL(name, proto, alias) name proto
+#  define __REDIRECT_LDBL_NTH(name, proto, alias) name proto
+#  define __REDIRECT_LDBL_NTHNL(name, proto, alias) name proto
+# endif
+#endif
+
 #if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
 # ifdef __REDIRECT
 
@@ -583,9 +605,11 @@
 #  define __REDIRECT_NTH_LDBL(name, proto, alias) \
   __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
 
+#if 0
 /* Unused.  */
 #  define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
 #  define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
+#endif
 
 # else
 _Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
@@ -605,12 +629,15 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
   extern __typeof (name) name __asm (__ASMNAME (#alias));
 #  define __LDBL_REDIR_DECL(name) \
   extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
+#if 0
 #  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
 # endif
 #endif
+#if 0
 #if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
     || !defined __REDIRECT
 # define __LDBL_REDIR1(name, proto, alias) name proto
@@ -625,6 +652,7 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
   __REDIRECT_NTH (name, proto, alias)
 # endif
 #endif
+#endif
 
 /* __glibc_macro_warning (MESSAGE) issues warning MESSAGE.  This is
    intended for use in preprocessor macros.
diff --git a/misc/syslog.c b/misc/syslog.c
index ee83b1bb76..0076361f6c 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -200,7 +200,7 @@ __vsyslog_internal(int pri, const char *fmt, va_list ap,
 	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 *fmt, va_list ap,
 	    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);
diff --git a/pwd/putpwent.c b/pwd/putpwent.c
index e3f2f4e09e..480dd59813 100644
--- a/pwd/putpwent.c
+++ b/pwd/putpwent.c
@@ -48,11 +48,11 @@ putpwent (const struct passwd *p, FILE *stream)
     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,
diff --git a/shadow/putspent.c b/shadow/putspent.c
index cbbb840d5b..d675e28210 100644
--- a/shadow/putspent.c
+++ b/shadow/putspent.c
@@ -42,47 +42,47 @@ putspent (const struct spwd *p, FILE *stream)
 
   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)
diff --git a/stdio-common/fprintf.c b/stdio-common/fprintf.c
index 8d2cd37433..fcfc791a7d 100644
--- a/stdio-common/fprintf.c
+++ b/stdio-common/fprintf.c
@@ -34,8 +34,10 @@ __fprintf (FILE *stream, const char *format, ...)
 
   return done;
 }
-ldbl_hidden_def (__fprintf, fprintf)
-ldbl_strong_alias (__fprintf, fprintf)
+//ldbl_hidden_def (__fprintf, fprintf)
+//ldbl_strong_alias (__fprintf, fprintf)
+hidden_def (__fprintf)
+strong_alias (__fprintf, fprintf)
 
 /* We define the function with the real name here.  But deep down in
    libio the original function _IO_fprintf is also needed.  So make
diff --git a/stdio-common/psiginfo.c b/stdio-common/psiginfo.c
index adf3b71b77..f99c51da17 100644
--- a/stdio-common/psiginfo.c
+++ b/stdio-common/psiginfo.c
@@ -76,7 +76,7 @@ psiginfo (const siginfo_t *pinfo, const char *s)
     }
 
   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 char *s)
 	  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 I/O request");
 	  }
 
       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);
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf.c
index 4462588675..9892eac1d1 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fprintf.c
+++ b/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 *format, ...)
 
   return done;
 }
-strong_alias (___ieee128_fprintf, __fprintfieee128)
-hidden_def (___ieee128_fprintf)
+hidden_def (__fprintfieee128)
diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
index 0e017f458b..055d77eaa9 100644
--- a/wcsmbs/bits/wchar2.h
+++ b/wcsmbs/bits/wchar2.h
@@ -233,6 +233,7 @@ extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
 			   const wchar_t *__restrict __format, ...)
      __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
 
+#if 0
 extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
 				(wchar_t *__restrict __s, size_t __n,
 				 const wchar_t *__restrict __fmt, ...),
@@ -249,6 +250,7 @@ __NTH (swprintf (wchar_t *__restrict __s, size_t __n,
 			   sz / sizeof (wchar_t), __fmt, __va_arg_pack ());
   return __swprintf_alias (__s, __n, __fmt, __va_arg_pack ());
 }
+#endif
 #elif !defined __cplusplus
 /* XXX We might want to have support in gcc for swprintf.  */
 # define swprintf(s, n, ...) \
@@ -264,6 +266,7 @@ extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
 			    __gnuc_va_list __arg)
      __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
 
+#if 0
 extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
 				(wchar_t *__restrict __s, size_t __n,
 				 const wchar_t *__restrict __fmt,
@@ -279,6 +282,7 @@ __NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
 			    sz / sizeof (wchar_t), __fmt, __ap);
   return __vswprintf_alias (__s, __n, __fmt, __ap);
 }
+#endif
 
 
 #if __USE_FORTIFY_LEVEL > 1

  reply	other threads:[~2022-02-24 17:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 11:15 John Paul Adrian Glaubitz
2021-03-23 17:59 ` Adhemerval Zanella
2021-08-16 12:24   ` John Paul Adrian Glaubitz
2022-01-22 10:39   ` John Paul Adrian Glaubitz
2022-02-23 20:51   ` John Paul Adrian Glaubitz
2022-02-24 17:10     ` Adhemerval Zanella [this message]
2022-03-03 19:25       ` Adhemerval Zanella
2022-03-08 10:34         ` John Paul Adrian Glaubitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00f81cc7-ae24-f055-9bd5-42169c6c3a61@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).