public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-06-09 13:13 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:13 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fcfd4cb824d1ff0109bc9549b0d78206f2731b6d

commit fcfd4cb824d1ff0109bc9549b0d78206f2731b6d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 0a24ffcc8e..6fd23dd918 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index d933fea104..6a25ce017c 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..a1b67f6527 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -90,7 +90,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
@@ -131,7 +131,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
   /* Check for invalid bits. */
   if (pri & ~(LOG_PRIMASK | LOG_FACMASK))
     {
-      syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
+      __syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
       pri &= LOG_PRIMASK | LOG_FACMASK;
     }
 
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-06-09 21:17 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:17 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fcfd4cb824d1ff0109bc9549b0d78206f2731b6d

commit fcfd4cb824d1ff0109bc9549b0d78206f2731b6d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 0a24ffcc8e..6fd23dd918 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index d933fea104..6a25ce017c 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..a1b67f6527 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -90,7 +90,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
@@ -131,7 +131,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
   /* Check for invalid bits. */
   if (pri & ~(LOG_PRIMASK | LOG_FACMASK))
     {
-      syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
+      __syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
       pri &= LOG_PRIMASK | LOG_FACMASK;
     }
 
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-06-03 14:03 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:03 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f203a6221c1bbd73be6f3faa5b660d7d82ecee96

commit f203a6221c1bbd73be6f3faa5b660d7d82ecee96
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 0a24ffcc8e..6fd23dd918 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index d933fea104..6a25ce017c 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..a1b67f6527 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -90,7 +90,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
@@ -131,7 +131,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
   /* Check for invalid bits. */
   if (pri & ~(LOG_PRIMASK | LOG_FACMASK))
     {
-      syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
+      __syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
       pri &= LOG_PRIMASK | LOG_FACMASK;
     }
 
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-05-13 14:16 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:16 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=167f56a86595d8116da29a949b80fb42b63d36ff

commit 167f56a86595d8116da29a949b80fb42b63d36ff
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 0a24ffcc8e..6fd23dd918 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index d933fea104..6a25ce017c 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..a1b67f6527 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -90,7 +90,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
@@ -131,7 +131,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
   /* Check for invalid bits. */
   if (pri & ~(LOG_PRIMASK | LOG_FACMASK))
     {
-      syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
+      __syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
       pri &= LOG_PRIMASK | LOG_FACMASK;
     }
 
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-05-12 19:30 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:30 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6cf493547bb3be6ff1a82fe1ce8c8f609f44fa8f

commit 6cf493547bb3be6ff1a82fe1ce8c8f609f44fa8f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 0a24ffcc8e..6fd23dd918 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index d933fea104..6a25ce017c 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..a1b67f6527 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -90,7 +90,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
@@ -131,7 +131,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
   /* Check for invalid bits. */
   if (pri & ~(LOG_PRIMASK | LOG_FACMASK))
     {
-      syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
+      __syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
       pri &= LOG_PRIMASK | LOG_FACMASK;
     }
 
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-05-10 18:21 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d2ca3612c6ac74d39a5ff4c40e4b69ae59c68e79

commit d2ca3612c6ac74d39a5ff4c40e4b69ae59c68e79
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 0a24ffcc8e..6fd23dd918 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index d933fea104..6a25ce017c 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..a1b67f6527 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -90,7 +90,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
@@ -131,7 +131,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
   /* Check for invalid bits. */
   if (pri & ~(LOG_PRIMASK | LOG_FACMASK))
     {
-      syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
+      __syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
       pri &= LOG_PRIMASK | LOG_FACMASK;
     }
 
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-04-29 14:01 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:01 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0d1034f455d31d2d34c1837abf99ebfd4b402fdd

commit 0d1034f455d31d2d34c1837abf99ebfd4b402fdd
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 0a24ffcc8e..6fd23dd918 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index d933fea104..6a25ce017c 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..a1b67f6527 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -90,7 +90,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
@@ -131,7 +131,7 @@ __vsyslog_internal (int pri, const char *fmt, va_list ap,
   /* Check for invalid bits. */
   if (pri & ~(LOG_PRIMASK | LOG_FACMASK))
     {
-      syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
+      __syslog (INTERNALLOG, "syslog: unknown facility/priority: %x", pri);
       pri &= LOG_PRIMASK | LOG_FACMASK;
     }
 
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-04-04 12:51 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:51 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=34fb4cd3c5622aed551daed6d7351f152f2a6c91

commit 34fb4cd3c5622aed551daed6d7351f152f2a6c91
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 4472dd7ba2..0b7ccd4924 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index dc3b0e7ef8..4cab0907ad 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 0076361f6c..84c51a1af0 100644
--- a/misc/syslog.c
+++ b/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 *fmt, va_list ap,
 #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;
 	}
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-03-31 19:03 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-31 19:03 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9811c9d65a0e95bf7aa59035858a34fc64dc5a4a

commit 9811c9d65a0e95bf7aa59035858a34fc64dc5a4a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 4472dd7ba2..0b7ccd4924 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index dc3b0e7ef8..4cab0907ad 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 0076361f6c..84c51a1af0 100644
--- a/misc/syslog.c
+++ b/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 *fmt, va_list ap,
 #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;
 	}
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-03-29 20:26 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-29 20:26 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=faab0d4430c89c3dded1b0a7a00098bb5e54d4c9

commit faab0d4430c89c3dded1b0a7a00098bb5e54d4c9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 4472dd7ba2..0b7ccd4924 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index dc3b0e7ef8..4cab0907ad 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 0076361f6c..84c51a1af0 100644
--- a/misc/syslog.c
+++ b/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 *fmt, va_list ap,
 #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;
 	}
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-03-16 17:58 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-16 17:58 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=efec4409233e4efe848e8169b6edafd7b25f7811

commit efec4409233e4efe848e8169b6edafd7b25f7811
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 4472dd7ba2..0b7ccd4924 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index dc3b0e7ef8..4cab0907ad 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 0076361f6c..84c51a1af0 100644
--- a/misc/syslog.c
+++ b/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 *fmt, va_list ap,
 #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;
 	}
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-03-15 18:36 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-15 18:36 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=efec4409233e4efe848e8169b6edafd7b25f7811

commit efec4409233e4efe848e8169b6edafd7b25f7811
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 4472dd7ba2..0b7ccd4924 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index dc3b0e7ef8..4cab0907ad 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 0076361f6c..84c51a1af0 100644
--- a/misc/syslog.c
+++ b/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 *fmt, va_list ap,
 #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;
 	}
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-03-11 17:20 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-11 17:20 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f4259cc6896e70d9499f26e93db98adec3185cd6

commit f4259cc6896e70d9499f26e93db98adec3185cd6
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 4472dd7ba2..0b7ccd4924 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index dc3b0e7ef8..4cab0907ad 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 0076361f6c..84c51a1af0 100644
--- a/misc/syslog.c
+++ b/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 *fmt, va_list ap,
 #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;
 	}
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [glibc/azanella/clang] Remove syslog-ldbl.h
@ 2022-03-08 18:56 Adhemerval Zanella
  0 siblings, 0 replies; 14+ messages in thread
From: Adhemerval Zanella @ 2022-03-08 18:56 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7bb1720ff0952720ddd2a87328a7a9ac664db9a7

commit 7bb1720ff0952720ddd2a87328a7a9ac664db9a7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 1 15:37:30 2022 -0300

    Remove syslog-ldbl.h
    
    The functions which require different alias to long double depending
    of the ABI now uses a set os macros that defines the expected alias
    on the function prototype, instead of redefine them using the
    __LDBL_REDIR_DEC macros.
    
    All syslog internal usage are also replaced to use internal alias
    instead.
    
    Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Diff:
---
 include/bits/syslog-ldbl.h                         |  1 -
 include/sys/syslog.h                               | 18 ++++++++++-
 misc/Makefile                                      |  2 +-
 misc/bits/syslog-ldbl.h                            | 35 ----------------------
 misc/bits/syslog.h                                 | 15 ++++++----
 misc/sys/syslog.h                                  | 15 ++++------
 misc/syslog.c                                      |  4 +--
 stdlib/fmtmsg.c                                    | 22 +++++++-------
 .../ieee754/ldbl-128ibm-compat/ieee128-syslog.c    |  5 ++--
 9 files changed, 49 insertions(+), 68 deletions(-)

diff --git a/include/bits/syslog-ldbl.h b/include/bits/syslog-ldbl.h
deleted file mode 100644
index e86815632b..0000000000
--- a/include/bits/syslog-ldbl.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <misc/bits/syslog-ldbl.h>
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 44422eab13..321655469b 100644
--- a/include/sys/syslog.h
+++ b/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.  */
diff --git a/misc/Makefile b/misc/Makefile
index 4472dd7ba2..0b7ccd4924 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -34,7 +34,7 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   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 sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
 	   sys/single_threaded.h
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
deleted file mode 100644
index 78ca888441..0000000000
--- a/misc/bits/syslog-ldbl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -mlong-double-64 compatibility mode for syslog functions.
-   Copyright (C) 2006-2022 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index fd30dd3114..e3b37623ff 100644
--- a/misc/bits/syslog.h
+++ b/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)
 {
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index dc3b0e7ef8..4cab0907ad 100644
--- a/misc/sys/syslog.h
+++ b/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) __THROW;
 
    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 char *__fmt, ...)
    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 */
diff --git a/misc/syslog.c b/misc/syslog.c
index 0076361f6c..84c51a1af0 100644
--- a/misc/syslog.c
+++ b/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 *fmt, va_list ap,
 #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;
 	}
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 3e48800331..59384b646b 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -177,17 +177,17 @@ fmtmsg (long int classification, const char *label, int severity,
 	  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 : "");
 	}
     }
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
index e7bc822bcb..467c14b6bb 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-syslog.c
+++ b/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 *fmt, ...)
   __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)


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-06-09 21:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 13:13 [glibc/azanella/clang] Remove syslog-ldbl.h Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2022-06-09 21:17 Adhemerval Zanella
2022-06-03 14:03 Adhemerval Zanella
2022-05-13 14:16 Adhemerval Zanella
2022-05-12 19:30 Adhemerval Zanella
2022-05-10 18:21 Adhemerval Zanella
2022-04-29 14:01 Adhemerval Zanella
2022-04-04 12:51 Adhemerval Zanella
2022-03-31 19:03 Adhemerval Zanella
2022-03-29 20:26 Adhemerval Zanella
2022-03-16 17:58 Adhemerval Zanella
2022-03-15 18:36 Adhemerval Zanella
2022-03-11 17:20 Adhemerval Zanella
2022-03-08 18:56 Adhemerval Zanella

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).