[v1,0/7] Add missing nldbl functions to libc

Message ID 20181206180824.1761-1-gabriel@inconstante.eti.br
Headers show
Series
  • Add missing nldbl functions to libc
Related show

Message

Gabriel F. T. Gomes Dec. 6, 2018, 6:08 p.m.
The functions: argp_error and argp_failure (from argp.h); err, errx,
verr, verrx, warn, warnx, vwarn, and vwarnx (from err.h); error and
error_at_line (from error.h); can take long double arguments if
requested by the format string.  However, on platforms where long double
format changed in GLIBC 2.4, a compat function (nldbl) has never been
added.  This patch set adds these functions, as well as header magic to
redirect function calls when user code is built with -mlong-double-64.

The first patch in the set is a fix for the recently integrated rework
to printf and scanf functions, which did not cause test case failures
with the current set of tests in the master branch.  The tests added by
this patch set expose the problem.

The second patch also fixes a problem exposed by the new tests, where
the redirection for strtold causes a problem on a Debian 9 machine,
because /usr/include/powerpc64le-linux-gnu/bits/stdlib-ldbl.h still
contains the __BEGIN_NAMESPACE_C99 and __END_NAMESPACE_C99 macros.

Gabriel F. T. Gomes (7):
  Remove redirection of _IO_vfprintf
  Add *-ldbl.h headers to include/bits
  ldbl-opt: Add arpg_error and argp_failure
  ldbl-opt: Reuse argp tests that print long double
  ldbl-opt: Add err, errx, verr, verrx, warn, warnx, vwarn, and vwarnx
  ldbl-opt: Add error and error_at_line
  ldbl-opt: Reuse test cases from misc/ that check long double

 argp/argp.h                                        |   4 +
 argp/bits/argp-ldbl.h                              |  24 +++++
 include/argp.h                                     |  11 +++
 include/bits/argp-ldbl.h                           |   1 +
 include/bits/err-ldbl.h                            |   1 +
 include/bits/error-ldbl.h                          |   1 +
 include/bits/monetary-ldbl.h                       |   1 +
 include/bits/printf-ldbl.h                         |   1 +
 include/bits/stdio-ldbl.h                          |   1 +
 include/bits/stdlib-ldbl.h                         |   1 +
 include/bits/syslog-ldbl.h                         |   1 +
 include/bits/wchar-ldbl.h                          |   1 +
 include/err.h                                      |   9 ++
 include/error.h                                    |  14 +++
 libio/libio.h                                      |   1 -
 misc/bits/err-ldbl.h                               |  30 ++++++
 misc/bits/error-ldbl.h                             |  24 +++++
 misc/err.h                                         |   4 +
 misc/error.h                                       |  12 ++-
 misc/tst-ldbl-error.c                              |  25 ++---
 misc/tst-ldbl-warn.c                               |  20 ++--
 sysdeps/ieee754/ldbl-opt/Makefile                  |  26 ++++++
 sysdeps/ieee754/ldbl-opt/Versions                  |   6 ++
 sysdeps/ieee754/ldbl-opt/nldbl-compat.c            | 104 +++++++++++++++++++++
 sysdeps/ieee754/ldbl-opt/nldbl-compat.h            |  15 +++
 sysdeps/unix/sysv/linux/alpha/libc.abilist         |  12 +++
 .../sysv/linux/powerpc/powerpc32/fpu/libc.abilist  |  12 +++
 .../linux/powerpc/powerpc32/nofpu/libc.abilist     |  12 +++
 .../sysv/linux/powerpc/powerpc64/libc-le.abilist   |  12 +++
 .../unix/sysv/linux/powerpc/powerpc64/libc.abilist |  12 +++
 sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist  |  12 +++
 sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist  |  12 +++
 sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist |  12 +++
 33 files changed, 412 insertions(+), 22 deletions(-)
 create mode 100644 argp/bits/argp-ldbl.h
 create mode 100644 include/bits/argp-ldbl.h
 create mode 100644 include/bits/err-ldbl.h
 create mode 100644 include/bits/error-ldbl.h
 create mode 100644 include/bits/monetary-ldbl.h
 create mode 100644 include/bits/printf-ldbl.h
 create mode 100644 include/bits/stdio-ldbl.h
 create mode 100644 include/bits/stdlib-ldbl.h
 create mode 100644 include/bits/syslog-ldbl.h
 create mode 100644 include/bits/wchar-ldbl.h
 create mode 100644 misc/bits/err-ldbl.h
 create mode 100644 misc/bits/error-ldbl.h

-- 
2.14.5

Comments

Gabriel F. T. Gomes Dec. 6, 2018, 6:24 p.m. | #1
On Thu, 06 Dec 2018, Gabriel F. T. Gomes wrote:

>Gabriel F. T. Gomes (7):

>  Remove redirection of _IO_vfprintf

>  Add *-ldbl.h headers to include/bits

>  ldbl-opt: Add arpg_error and argp_failure

>  ldbl-opt: Reuse argp tests that print long double

>  ldbl-opt: Add err, errx, verr, verrx, warn, warnx, vwarn, and vwarnx

>  ldbl-opt: Add error and error_at_line

>  ldbl-opt: Reuse test cases from misc/ that check long double


I forgot to mention that these patches are relative to a branch with the
patch to add internal functions for argp*, err* and warn* functions (and
I sent them in the wrong order... sorry):

https://sourceware.org/ml/libc-alpha/2018-12/msg00220.html
Joseph Myers Dec. 6, 2018, 8:38 p.m. | #2
On Thu, 6 Dec 2018, Gabriel F. T. Gomes wrote:

> The functions: argp_error and argp_failure (from argp.h); err, errx,

> verr, verrx, warn, warnx, vwarn, and vwarnx (from err.h); error and

> error_at_line (from error.h); can take long double arguments if

> requested by the format string.  However, on platforms where long double

> format changed in GLIBC 2.4, a compat function (nldbl) has never been

> added.  This patch set adds these functions, as well as header magic to

> redirect function calls when user code is built with -mlong-double-64.


As this is a bug that's user-visible in releases, it should be filed in 
Bugzilla if not already there, then the relevant patches should reference 
that bug (which should be resolved as FIXED with target milestone set once 
all the patches are in).

-- 
Joseph S. Myers
joseph@codesourcery.com