From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 08F311F453 for ; Thu, 21 Feb 2019 20:57:27 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=Bylop JCqmbzBb0Rppg5f4BVBQo/aqrCqAzjNo+o6uTTbmZjQBR7CAwo2kSjcQ2Zzr/LJZ TkUlDulCFBJxBKggjxWo69/Wk+bqUGHS8KrxWFdBmk41Xrk5AmaP4Xy9MXldK0w0 Pi6Or7y9ev67fvHUo3XzH98fMTeN+jhnsvgM78= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=x3ldizrJJFu cQn19fXuIDrFfYIs=; b=Wr7RfzU/5dBAXnO83puHDjFdUlpmbUYsH4mE6SIGNCo ApKdSkgtknDXEjBNDMd9pkc5B1kAd5327kJBDsiIYOlh3eznRmpoAsqI11TuFmM5 Pq5xD9czqhAGtWHZqauTpGr0TzfuDXd/icge5I+22kJrEZA+hsHntaER3T9IAZ+0 = Received: (qmail 52725 invoked by alias); 21 Feb 2019 20:57:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 52641 invoked by uid 89); 21 Feb 2019 20:57:23 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: smtpout1.mo803.mail-out.ovh.net From: "Gabriel F. T. Gomes" To: Subject: [PATCH v4 1/5] ldbl-opt: Add arpg_error and argp_failure (bug 23983) Date: Thu, 21 Feb 2019 17:57:02 -0300 Message-ID: <20190221205706.12225-2-gabriel@inconstante.eti.br> In-Reply-To: <20190221205706.12225-1-gabriel@inconstante.eti.br> References: <20190221205706.12225-1-gabriel@inconstante.eti.br> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 1201335204332883651 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrtdekgddugeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc Changes since v3: - Updated symbol version to the 2.30 development cycle. - Updated copyright years. Changes since v2: - Added bits/argp-ldbl.h to the list of installed headers. Changes since v1: - Added include/bits/argp-ldbl.h. - Added mention to bugzilla fix. -- 8< -- The functions argp_error and argp_failure are missing support for printing long double values when long double has the same format as double. This patch adds the new functions __nldbl_argp_error and __nldbl_argp_failure, as well as header magic to redirect calls to them when -mlong-double-64 is in use. Tested for powerpc64 and powerpc64le. [BZ #23983] * argp/Makefile (headers): Add bits/argp-ldbl.h. * argp/argp.h [defined __LDBL_COMPAT]: Include bits/argp-ldbl.h. * argp/bits/argp-ldbl.h: New file. * include/argp.h: Include stdarg.h. Add prototypes for internal functions: __argp_error_internal and __argp_failure_internal. * include/bits/argp-ldbl.h: New file. * sysdeps/ieee754/ldbl-opt/Versions (libc) Add __nldbl_argp_error and __nldbl_argp_failure. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Include argp.h. (__nldbl_argp_error, __nldbl_argp_failure): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h: Include argp.h. Redirect argp_error and argp_failure calls. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. --- argp/Makefile | 2 +- argp/argp.h | 4 ++++ argp/bits/argp-ldbl.h | 24 ++++++++++++++++++++++ include/argp.h | 11 ++++++++++ include/bits/argp-ldbl.h | 1 + sysdeps/ieee754/ldbl-opt/Versions | 3 +++ sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 21 +++++++++++++++++++ sysdeps/ieee754/ldbl-opt/nldbl-compat.h | 3 +++ sysdeps/unix/sysv/linux/alpha/libc.abilist | 2 ++ .../sysv/linux/powerpc/powerpc32/fpu/libc.abilist | 2 ++ .../linux/powerpc/powerpc32/nofpu/libc.abilist | 2 ++ .../sysv/linux/powerpc/powerpc64/be/libc.abilist | 2 ++ .../sysv/linux/powerpc/powerpc64/le/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist | 2 ++ 16 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 argp/bits/argp-ldbl.h create mode 100644 include/bits/argp-ldbl.h diff --git a/argp/Makefile b/argp/Makefile index bebd71c564..d5c2d77658 100644 --- a/argp/Makefile +++ b/argp/Makefile @@ -22,7 +22,7 @@ subdir := argp include ../Makeconfig -headers = argp.h +headers = argp.h bits/argp-ldbl.h routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \ pvh xinl eexst) diff --git a/argp/argp.h b/argp/argp.h index fae6dfb3ef..c7322581bf 100644 --- a/argp/argp.h +++ b/argp/argp.h @@ -554,6 +554,10 @@ __NTH (__option_is_end (const struct argp_option *__opt)) # endif #endif /* Use extern inlines. */ +#ifdef __LDBL_COMPAT +# include +#endif + __END_DECLS #endif /* argp.h */ diff --git a/argp/bits/argp-ldbl.h b/argp/bits/argp-ldbl.h new file mode 100644 index 0000000000..86022a04ac --- /dev/null +++ b/argp/bits/argp-ldbl.h @@ -0,0 +1,24 @@ +/* Redirections for argp functions for -mlong-double-64. + Copyright (C) 2019 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 _ARGP_H +# error "Never include directly; use instead." +#endif + +__LDBL_REDIR_DECL (argp_error) +__LDBL_REDIR_DECL (argp_failure) diff --git a/include/argp.h b/include/argp.h index 6cf8782060..7077471d99 100644 --- a/include/argp.h +++ b/include/argp.h @@ -1,6 +1,17 @@ #ifndef _ARGP_H #include +/* Prototypes for internal argp.h functions. */ +#include +void +__argp_error_internal (const struct argp_state *state, const char *fmt, + va_list ap, unsigned int mode_flags); + +void +__argp_failure_internal (const struct argp_state *state, int status, + int errnum, const char *fmt, va_list ap, + unsigned int mode_flags); + #ifndef _ISOMAC extern __typeof (__argp_error) __argp_error attribute_hidden; extern __typeof (__argp_failure) __argp_failure attribute_hidden; diff --git a/include/bits/argp-ldbl.h b/include/bits/argp-ldbl.h new file mode 100644 index 0000000000..7c1a343d1b --- /dev/null +++ b/include/bits/argp-ldbl.h @@ -0,0 +1 @@ +#include diff --git a/sysdeps/ieee754/ldbl-opt/Versions b/sysdeps/ieee754/ldbl-opt/Versions index af0c4a098c..1842a1a3ef 100644 --- a/sysdeps/ieee754/ldbl-opt/Versions +++ b/sysdeps/ieee754/ldbl-opt/Versions @@ -78,6 +78,9 @@ libc { __nldbl___dprintf_chk; __nldbl___vdprintf_chk; __nldbl___obstack_printf_chk; __nldbl___obstack_vprintf_chk; } + GLIBC_2.30 { + __nldbl_argp_error; __nldbl_argp_failure; + } } libm { NLDBL_VERSION { diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c index 76ef8a8f74..4f70207f2d 100644 --- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c +++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c @@ -22,6 +22,7 @@ #undef __GLIBC_USE_DEPRECATED_SCANF #define __GLIBC_USE_DEPRECATED_SCANF 1 +#include #include #include #include @@ -990,6 +991,26 @@ __nldbl___isoc99_wscanf (const wchar_t *fmt, ...) return ret; } +void +__nldbl_argp_error (const struct argp_state *state, const char *fmt, ...) +{ + va_list ap; + va_start (ap, fmt); + __argp_error_internal (state, fmt, ap, PRINTF_LDBL_IS_DBL); + va_end (ap); +} + +void +__nldbl_argp_failure (const struct argp_state *state, int status, + int errnum, const char *fmt, ...) +{ + va_list ap; + va_start (ap, fmt); + __argp_failure_internal (state, status, errnum, fmt, ap, + PRINTF_LDBL_IS_DBL); + va_end (ap); +} + #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0); compat_symbol (libc, __nldbl__IO_sprintf, _IO_sprintf, GLIBC_2_0); diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h index f2079066cf..9f5836586c 100644 --- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h +++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h @@ -26,6 +26,7 @@ /* Avoid long double prototypes. */ #define __NO_LONG_DOUBLE_MATH 1 +#include #include #include #include @@ -76,6 +77,8 @@ NLDBL_DECL (__isoc99_swscanf); NLDBL_DECL (__isoc99_vwscanf); NLDBL_DECL (__isoc99_vfwscanf); NLDBL_DECL (__isoc99_vswscanf); +NLDBL_DECL (argp_error); +NLDBL_DECL (argp_failure); /* These do not exist in the normal interface, but must exist in the __nldbl interface so that they can be called from libnldbl. */ diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index fe0de20b2b..454a01dcc5 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2204,6 +2204,8 @@ GLIBC_2.3.4 setipv4sourcefilter F GLIBC_2.3.4 setsourcefilter F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index d99a835544..b689f20112 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2164,6 +2164,8 @@ GLIBC_2.3.4 siglongjmp F GLIBC_2.3.4 swapcontext F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 826772777a..8b6d72abb6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2197,6 +2197,8 @@ GLIBC_2.3.4 siglongjmp F GLIBC_2.3.4 swapcontext F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 5aa038971b..2c14eae34c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2027,6 +2027,8 @@ GLIBC_2.3.4 siglongjmp F GLIBC_2.3.4 swapcontext F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index c630d0c37d..450d42736a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2231,4 +2231,6 @@ GLIBC_2.28 thrd_yield F GLIBC_2.29 getcpu F GLIBC_2.29 posix_spawn_file_actions_addchdir_np F GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 361240400c..9e6184044c 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2159,6 +2159,8 @@ GLIBC_2.3.4 setipv4sourcefilter F GLIBC_2.3.4 setsourcefilter F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index f44f178a08..9a8a4b247e 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2063,6 +2063,8 @@ GLIBC_2.3.4 setipv4sourcefilter F GLIBC_2.3.4 setsourcefilter F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 37957959e2..e1d35a40aa 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2153,6 +2153,8 @@ GLIBC_2.3.4 setipv4sourcefilter F GLIBC_2.3.4 setsourcefilter F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F +GLIBC_2.30 __nldbl_argp_error F +GLIBC_2.30 __nldbl_argp_failure F GLIBC_2.30 gettid F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F -- 2.14.5