From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B20D53858434; Mon, 4 Apr 2022 12:51:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B20D53858434 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] Remove syslog-ldbl.h X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 2b9a08baad93c4996059039722681559c0eddd22 X-Git-Newrev: 34fb4cd3c5622aed551daed6d7351f152f2a6c91 Message-Id: <20220404125115.B20D53858434@sourceware.org> Date: Mon, 4 Apr 2022 12:51:15 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2022 12:51:15 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=34fb4cd3c5622aed551daed6d7351f152f2a6c91 commit 34fb4cd3c5622aed551daed6d7351f152f2a6c91 Author: Adhemerval Zanella 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 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 #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 - . */ - -#ifndef _SYS_SYSLOG_H -# error "Never include directly; use 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 +#include /* * 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 #endif -#include -#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# include -#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 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)