2019-07-11 14:47:21 +00:00
|
|
|
ifeq ($(subdir),libio)
|
|
|
|
ldbl-extra-routines += fwscanf \
|
2020-02-07 20:06:41 +00:00
|
|
|
fwprintf \
|
|
|
|
obprintf \
|
2019-07-11 14:47:21 +00:00
|
|
|
swscanf \
|
2020-02-07 20:06:41 +00:00
|
|
|
swprintf \
|
2019-07-11 14:47:21 +00:00
|
|
|
wscanf \
|
2020-02-07 20:06:41 +00:00
|
|
|
vasprintf \
|
|
|
|
vdprintf \
|
|
|
|
vscanf \
|
|
|
|
vsprintf \
|
|
|
|
vsnprintf \
|
|
|
|
vsscanf \
|
|
|
|
vswprintf \
|
2019-07-11 14:47:21 +00:00
|
|
|
vswscanf \
|
2020-02-07 20:06:41 +00:00
|
|
|
vwprintf \
|
|
|
|
vwscanf \
|
|
|
|
wprintf
|
2019-07-11 14:47:21 +00:00
|
|
|
endif
|
|
|
|
|
2019-07-11 14:48:00 +00:00
|
|
|
ifeq ($(subdir),wcsmbs)
|
2019-07-11 14:47:43 +00:00
|
|
|
ldbl-extra-routines += isoc99_fwscanf \
|
|
|
|
isoc99_swscanf \
|
|
|
|
isoc99_wscanf \
|
|
|
|
isoc99_vfwscanf \
|
|
|
|
isoc99_vswscanf \
|
|
|
|
isoc99_vwscanf
|
|
|
|
|
2019-07-11 14:48:00 +00:00
|
|
|
tests-internal += test-wcstold-ibm128 test-wcstold-ieee128
|
|
|
|
CFLAGS-test-wcstold-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-wcstold-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
ldbl-128ibm-compat: Add printf_size
Since the addition of the _Float128 API, strfromf128 and printf_size use
__printf_fp to print _Float128 values. This is achieved by setting the
'is_binary128' member of the 'printf_info' structure to one. Now that
the format of long double on powerpc64le is getting a third option, this
mechanism is reused for long double values that have binary128 format
(i.e.: when -mabi=ieeelongdouble).
This patch adds __printf_sizeieee128 as an exported symbol, but doesn't
provide redirections from printf_size, yet. All redirections will be
installed in a future commit, once all other functions that print or
read long double values with binary128 format are ready. In
__printf_fp, when 'is_binary128' is one, the floating-point argument is
treated as if it was of _Float128 type, regardless of the value of
'is_long_double', thus __printf_sizeieee128 sets 'is_binary128' to the
same value of 'is_long_double'. Otherwise, double values would not be
printed correctly.
Tested for powerpc64le.
2018-06-29 01:38:55 +00:00
|
|
|
ifeq ($(subdir),stdio-common)
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
ldbl-extra-routines += printf_size \
|
|
|
|
asprintf \
|
|
|
|
dprintf \
|
|
|
|
fprintf \
|
|
|
|
printf \
|
|
|
|
snprintf \
|
|
|
|
sprintf \
|
|
|
|
vfprintf \
|
|
|
|
vprintf \
|
2019-07-11 14:46:51 +00:00
|
|
|
vfwprintf \
|
2019-07-11 14:47:16 +00:00
|
|
|
fscanf \
|
|
|
|
scanf \
|
|
|
|
sscanf \
|
|
|
|
vfscanf \
|
2019-07-11 14:47:47 +00:00
|
|
|
vfwscanf \
|
2019-07-11 14:47:43 +00:00
|
|
|
isoc99_fscanf \
|
|
|
|
isoc99_scanf \
|
|
|
|
isoc99_sscanf \
|
|
|
|
isoc99_vfscanf \
|
|
|
|
isoc99_vscanf \
|
|
|
|
isoc99_vsscanf
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
|
|
|
|
# Printing long double values with IEEE binary128 format reuses part
|
|
|
|
# of the internal float128 implementation (__printf_fp, __printf_fphex,
|
2019-07-11 14:47:16 +00:00
|
|
|
# and __float128 variables and union members). Likewise, reading these
|
|
|
|
# values reuses __strtof128_internal. Thus, the compilation of the
|
|
|
|
# following functions, must have -mfloat128 and -mabi=ibmlongdouble
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
# passed to the compiler.
|
|
|
|
CFLAGS-vfprintf-internal.c += -mfloat128 -mabi=ibmlongdouble
|
2019-07-11 14:46:51 +00:00
|
|
|
CFLAGS-vfwprintf-internal.c += -mfloat128 -mabi=ibmlongdouble
|
2019-07-11 14:47:16 +00:00
|
|
|
CFLAGS-vfscanf-internal.c += -mfloat128 -mabi=ibmlongdouble
|
2019-07-11 14:47:21 +00:00
|
|
|
CFLAGS-vfwscanf-internal.c += -mfloat128 -mabi=ibmlongdouble
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
|
|
|
|
# Basic tests for the implementation of long double with IEEE binary128
|
|
|
|
# format and for the related redirections in installed headers.
|
|
|
|
tests-internal += test-printf-ieee128 test-printf-ibm128
|
|
|
|
CFLAGS-test-printf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-printf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
ldbl-128ibm-compat: Add printf_size
Since the addition of the _Float128 API, strfromf128 and printf_size use
__printf_fp to print _Float128 values. This is achieved by setting the
'is_binary128' member of the 'printf_info' structure to one. Now that
the format of long double on powerpc64le is getting a third option, this
mechanism is reused for long double values that have binary128 format
(i.e.: when -mabi=ieeelongdouble).
This patch adds __printf_sizeieee128 as an exported symbol, but doesn't
provide redirections from printf_size, yet. All redirections will be
installed in a future commit, once all other functions that print or
read long double values with binary128 format are ready. In
__printf_fp, when 'is_binary128' is one, the floating-point argument is
treated as if it was of _Float128 type, regardless of the value of
'is_long_double', thus __printf_sizeieee128 sets 'is_binary128' to the
same value of 'is_long_double'. Otherwise, double values would not be
printed correctly.
Tested for powerpc64le.
2018-06-29 01:38:55 +00:00
|
|
|
|
2019-07-11 14:46:51 +00:00
|
|
|
tests-internal += test-wprintf-ieee128 test-wprintf-ibm128
|
|
|
|
CFLAGS-test-wprintf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-wprintf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
2019-07-11 14:47:47 +00:00
|
|
|
tests-internal += test-obstack-ieee128 test-obstack-ibm128
|
|
|
|
CFLAGS-test-obstack-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-obstack-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
|
|
|
tests-internal += test-obstack-chk-ieee128 test-obstack-chk-ibm128
|
|
|
|
CFLAGS-test-obstack-chk-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-obstack-chk-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
2019-07-11 14:47:16 +00:00
|
|
|
tests-internal += test-scanf-ieee128 test-scanf-ibm128
|
2019-11-27 16:06:50 +00:00
|
|
|
CFLAGS-test-scanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
|
|
|
|
CFLAGS-test-scanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
|
2019-07-11 14:47:16 +00:00
|
|
|
|
2019-07-11 14:47:21 +00:00
|
|
|
tests-internal += test-wscanf-ieee128 test-wscanf-ibm128
|
2019-11-27 16:06:50 +00:00
|
|
|
CFLAGS-test-wscanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
|
|
|
|
CFLAGS-test-wscanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
|
2019-07-11 14:47:21 +00:00
|
|
|
|
2019-07-11 14:47:43 +00:00
|
|
|
tests-internal += test-isoc99-scanf-ieee128 test-isoc99-scanf-ibm128
|
|
|
|
CFLAGS-test-isoc99-scanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi -std=c99
|
|
|
|
CFLAGS-test-isoc99-scanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi -std=c99
|
|
|
|
|
|
|
|
tests-internal += test-isoc99-wscanf-ieee128 test-isoc99-wscanf-ibm128
|
|
|
|
CFLAGS-test-isoc99-wscanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi -std=c99
|
|
|
|
CFLAGS-test-isoc99-wscanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi -std=c99
|
|
|
|
|
2019-07-11 14:47:16 +00:00
|
|
|
ifeq ($(run-built-tests),yes)
|
|
|
|
tests-special += $(objpfx)test-scanf-ieee128.out
|
|
|
|
tests-special += $(objpfx)test-scanf-ibm128.out
|
2019-07-11 14:47:21 +00:00
|
|
|
|
|
|
|
tests-special += $(objpfx)test-wscanf-ieee128.out
|
|
|
|
tests-special += $(objpfx)test-wscanf-ibm128.out
|
2019-07-11 14:47:43 +00:00
|
|
|
|
|
|
|
tests-special += $(objpfx)test-isoc99-scanf-ieee128.out
|
|
|
|
tests-special += $(objpfx)test-isoc99-scanf-ibm128.out
|
|
|
|
|
|
|
|
tests-special += $(objpfx)test-isoc99-wscanf-ieee128.out
|
|
|
|
tests-special += $(objpfx)test-isoc99-wscanf-ibm128.out
|
2019-07-11 14:47:16 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
$(objpfx)test-scanf-ieee128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-scanf-ieee128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
|
|
|
$(objpfx)test-scanf-ibm128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-scanf-ibm128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
2019-07-11 14:47:21 +00:00
|
|
|
$(objpfx)test-wscanf-ieee128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-wscanf-ieee128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
|
|
|
$(objpfx)test-wscanf-ibm128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-wscanf-ibm128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
2019-07-11 14:47:43 +00:00
|
|
|
$(objpfx)test-isoc99-scanf-ieee128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-isoc99-scanf-ieee128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
|
|
|
$(objpfx)test-isoc99-scanf-ibm128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-isoc99-scanf-ibm128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
|
|
|
$(objpfx)test-isoc99-wscanf-ieee128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-isoc99-wscanf-ieee128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
|
|
|
$(objpfx)test-isoc99-wscanf-ibm128.out: \
|
|
|
|
../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
|
|
|
|
$(objpfx)test-isoc99-wscanf-ibm128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
ldbl-128ibm-compat: Add printf_size
Since the addition of the _Float128 API, strfromf128 and printf_size use
__printf_fp to print _Float128 values. This is achieved by setting the
'is_binary128' member of the 'printf_info' structure to one. Now that
the format of long double on powerpc64le is getting a third option, this
mechanism is reused for long double values that have binary128 format
(i.e.: when -mabi=ieeelongdouble).
This patch adds __printf_sizeieee128 as an exported symbol, but doesn't
provide redirections from printf_size, yet. All redirections will be
installed in a future commit, once all other functions that print or
read long double values with binary128 format are ready. In
__printf_fp, when 'is_binary128' is one, the floating-point argument is
treated as if it was of _Float128 type, regardless of the value of
'is_long_double', thus __printf_sizeieee128 sets 'is_binary128' to the
same value of 'is_long_double'. Otherwise, double values would not be
printed correctly.
Tested for powerpc64le.
2018-06-29 01:38:55 +00:00
|
|
|
tests-internal += test-printf-size-ieee128 test-printf-size-ibm128
|
|
|
|
CFLAGS-test-printf-size-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-printf-size-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
|
|
|
ifeq ($(run-built-tests),yes)
|
|
|
|
tests-special += $(objpfx)test-printf-size-ieee128.out
|
|
|
|
tests-special += $(objpfx)test-printf-size-ibm128.out
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(objpfx)test-printf-size-ieee128.out: \
|
|
|
|
tst-printfsz-islongdouble.sh $(objpfx)test-printf-size-ieee128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
|
|
|
|
$(objpfx)test-printf-size-ibm128.out: \
|
|
|
|
tst-printfsz-islongdouble.sh $(objpfx)test-printf-size-ibm128
|
|
|
|
$(SHELL) $^ '$(test-program-prefix)' $@; \
|
|
|
|
$(evaluate-test)
|
|
|
|
endif
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
|
ldbl-128ibm-compat: Add regular character, fortified printing functions
Since the introduction of internal functions with explicit flags for the
printf family of functions, the 'mode' parameter can be used to select
which format long double parameters have (with the mode flags:
PRINTF_LDBL_IS_DBL and PRINTF_LDBL_USES_FLOAT128), as well as to select
whether to check for overflows (mode flag: PRINTF_FORTIFY).
This patch combines PRINTF_LDBL_USES_FLOAT128 and PRINTF_FORTIFY to
provide the IEEE binary128 version of printf-like function for platforms
where long double can take this format, in addition to the double format
and to some non-ieee format (currently, this means powerpc64le).
There are two flavors of test cases provided with this patch: one that
explicitly calls the fortified functions, for instance __asprintf_chk,
and another that reuses the non-fortified test, but defining
_FORTIFY_SOURCE as 2. The first guarantees that the implementations are
actually being tested (in bits/stdio2.h, vprintf gets redirected to
__vfprintf_chk, which would leave __vprintf_chk untested), whereas the
second guarantees that the redirections calls the correct function in
the IBM and IEEE long double cases.
Tested for powerpc64le.
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-07-11 14:46:57 +00:00
|
|
|
ifeq ($(subdir),debug)
|
|
|
|
ldbl-extra-routines += asprintf_chk \
|
|
|
|
dprintf_chk \
|
|
|
|
fprintf_chk \
|
|
|
|
printf_chk \
|
|
|
|
snprintf_chk \
|
|
|
|
sprintf_chk \
|
|
|
|
vasprintf_chk \
|
|
|
|
vdprintf_chk \
|
|
|
|
vfprintf_chk \
|
|
|
|
vprintf_chk \
|
|
|
|
vsnprintf_chk \
|
2019-07-11 14:47:01 +00:00
|
|
|
vsprintf_chk \
|
|
|
|
fwprintf_chk \
|
|
|
|
swprintf_chk \
|
|
|
|
wprintf_chk \
|
|
|
|
vfwprintf_chk \
|
|
|
|
vswprintf_chk \
|
2020-02-07 20:06:41 +00:00
|
|
|
vwprintf_chk \
|
|
|
|
obstack_chk \
|
|
|
|
vobstack_chk
|
ldbl-128ibm-compat: Add regular character, fortified printing functions
Since the introduction of internal functions with explicit flags for the
printf family of functions, the 'mode' parameter can be used to select
which format long double parameters have (with the mode flags:
PRINTF_LDBL_IS_DBL and PRINTF_LDBL_USES_FLOAT128), as well as to select
whether to check for overflows (mode flag: PRINTF_FORTIFY).
This patch combines PRINTF_LDBL_USES_FLOAT128 and PRINTF_FORTIFY to
provide the IEEE binary128 version of printf-like function for platforms
where long double can take this format, in addition to the double format
and to some non-ieee format (currently, this means powerpc64le).
There are two flavors of test cases provided with this patch: one that
explicitly calls the fortified functions, for instance __asprintf_chk,
and another that reuses the non-fortified test, but defining
_FORTIFY_SOURCE as 2. The first guarantees that the implementations are
actually being tested (in bits/stdio2.h, vprintf gets redirected to
__vfprintf_chk, which would leave __vprintf_chk untested), whereas the
second guarantees that the redirections calls the correct function in
the IBM and IEEE long double cases.
Tested for powerpc64le.
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-07-11 14:46:57 +00:00
|
|
|
|
|
|
|
tests-internal += test-printf-chk-ieee128 test-printf-chk-ibm128
|
|
|
|
CFLAGS-test-printf-chk-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-printf-chk-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
|
|
|
tests-internal += test-printf-chk-redir-ieee128 test-printf-chk-redir-ibm128
|
|
|
|
CFLAGS-test-printf-chk-redir-ieee128.c += -mfloat128 -mabi=ieeelongdouble \
|
|
|
|
-Wno-psabi -Wno-unused-result
|
|
|
|
CFLAGS-test-printf-chk-redir-ibm128.c += -mabi=ibmlongdouble -Wno-psabi \
|
|
|
|
-Wno-unused-result
|
2019-07-11 14:47:01 +00:00
|
|
|
|
|
|
|
tests-internal += test-wprintf-chk-ieee128 test-wprintf-chk-ibm128
|
|
|
|
CFLAGS-test-wprintf-chk-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-wprintf-chk-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
|
|
|
tests-internal += test-wprintf-chk-redir-ieee128 test-wprintf-chk-redir-ibm128
|
|
|
|
CFLAGS-test-wprintf-chk-redir-ieee128.c += -mfloat128 -mabi=ieeelongdouble \
|
|
|
|
-Wno-psabi -Wno-unused-result
|
|
|
|
CFLAGS-test-wprintf-chk-redir-ibm128.c += -mabi=ibmlongdouble -Wno-psabi \
|
|
|
|
-Wno-unused-result
|
ldbl-128ibm-compat: Add regular character, fortified printing functions
Since the introduction of internal functions with explicit flags for the
printf family of functions, the 'mode' parameter can be used to select
which format long double parameters have (with the mode flags:
PRINTF_LDBL_IS_DBL and PRINTF_LDBL_USES_FLOAT128), as well as to select
whether to check for overflows (mode flag: PRINTF_FORTIFY).
This patch combines PRINTF_LDBL_USES_FLOAT128 and PRINTF_FORTIFY to
provide the IEEE binary128 version of printf-like function for platforms
where long double can take this format, in addition to the double format
and to some non-ieee format (currently, this means powerpc64le).
There are two flavors of test cases provided with this patch: one that
explicitly calls the fortified functions, for instance __asprintf_chk,
and another that reuses the non-fortified test, but defining
_FORTIFY_SOURCE as 2. The first guarantees that the implementations are
actually being tested (in bits/stdio2.h, vprintf gets redirected to
__vfprintf_chk, which would leave __vprintf_chk untested), whereas the
second guarantees that the redirections calls the correct function in
the IBM and IEEE long double cases.
Tested for powerpc64le.
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-07-11 14:46:57 +00:00
|
|
|
endif
|
|
|
|
|
2019-07-11 14:47:25 +00:00
|
|
|
ifeq ($(subdir),argp)
|
|
|
|
ldbl-extra-routines += argp-help
|
|
|
|
|
|
|
|
$(objpfx)tst-ieee128-argp.c: tst-ldbl-argp.c
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(objpfx)tst-ibm128-argp.c: tst-ldbl-argp.c
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
tests-internal += tst-ieee128-argp tst-ibm128-argp
|
|
|
|
CFLAGS-tst-ieee128-argp.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-tst-ibm128-argp.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
endif
|
|
|
|
|
2019-07-11 14:47:30 +00:00
|
|
|
ifeq ($(subdir),misc)
|
2019-07-11 14:47:35 +00:00
|
|
|
ldbl-extra-routines += err \
|
2019-07-11 14:47:51 +00:00
|
|
|
error \
|
2019-07-11 14:48:24 +00:00
|
|
|
syslog \
|
|
|
|
qefgcvt \
|
|
|
|
qefgcvt_r
|
|
|
|
|
|
|
|
CFLAGS-ieee128-qefgcvt.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute
|
|
|
|
CFLAGS-ieee128-qefgcvt_r.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute
|
2019-07-11 14:47:39 +00:00
|
|
|
|
|
|
|
tests-internal += tst-ibm128-warn tst-ieee128-warn
|
|
|
|
tests-internal += tst-ibm128-error tst-ieee128-error
|
2019-07-11 14:48:24 +00:00
|
|
|
tests-internal += tst-ibm128-efgcvt tst-ieee128-efgcvt
|
|
|
|
|
2019-07-11 14:47:39 +00:00
|
|
|
$(objpfx)tst-ibm128-%.c: tst-ldbl-%.c
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(objpfx)tst-ieee128-%.c: tst-ldbl-%.c
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
CFLAGS-tst-ibm128-warn.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
CFLAGS-tst-ibm128-error.c += -mabi=ibmlongdouble -Wno-psabi
|
2019-07-11 14:48:24 +00:00
|
|
|
CFLAGS-tst-ibm128-efgcvt.c += -mabi=ibmlongdouble -Wno-psabi
|
2019-07-11 14:47:39 +00:00
|
|
|
|
|
|
|
CFLAGS-tst-ieee128-warn.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-tst-ieee128-error.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
2019-07-11 14:48:24 +00:00
|
|
|
CFLAGS-tst-ieee128-efgcvt.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
2019-07-11 14:47:51 +00:00
|
|
|
|
|
|
|
tests-container += test-syslog-ieee128 test-syslog-ibm128
|
|
|
|
CFLAGS-test-syslog-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-syslog-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
|
|
|
tests-container += test-syslog-chk-ieee128 test-syslog-chk-ibm128
|
|
|
|
CFLAGS-test-syslog-chk-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-syslog-chk-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
2019-07-11 14:47:30 +00:00
|
|
|
endif
|
|
|
|
|
2018-06-28 09:47:42 +00:00
|
|
|
ifeq ($(subdir),stdlib)
|
|
|
|
ldbl-extra-routines += strfmon strfmon_l
|
|
|
|
|
|
|
|
# Printing long double values with IEEE binary128 format reuses part
|
|
|
|
# of the internal float128 implementation (__printf_fp, __printf_fphex,
|
|
|
|
# and __float128 variables and union members). Thus, the compilation of
|
|
|
|
# the following files, must have -mfloat128 passed to the compiler.
|
|
|
|
# Also, guarantee that they are compiled in IBM long double mode.
|
|
|
|
CFLAGS-strfmon.c += -mfloat128 -mabi=ibmlongdouble
|
|
|
|
CFLAGS-strfmon_l.c += -mfloat128 -mabi=ibmlongdouble
|
2019-07-11 14:47:56 +00:00
|
|
|
|
|
|
|
tests-internal += test-strfmon-ibm128 test-strfmon-ieee128
|
|
|
|
CFLAGS-test-strfmon-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-strfmon-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
$(objpfx)tst-strfmon-ibm128.out: $(gen-locales)
|
|
|
|
$(objpfx)tst-strfmon-ieee128.out: $(gen-locales)
|
2019-07-11 14:48:00 +00:00
|
|
|
|
|
|
|
tests-internal += test-strfrom-ibm128 test-strfrom-ieee128
|
|
|
|
CFLAGS-test-strfrom-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
|
|
|
|
CFLAGS-test-strfrom-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
|
|
|
|
|
2018-06-28 09:47:42 +00:00
|
|
|
endif
|
|
|
|
|
2020-02-07 20:06:53 +00:00
|
|
|
ifeq ($(subdir),math)
|
|
|
|
# The totalorder{,mag} compatibility tests were added prior to this
|
|
|
|
# support. Thus, they can only correctly be used with ibm128.
|
|
|
|
CFLAGS-test-ldouble-compat_totalorder.c += -mabi=ibmlongdouble
|
|
|
|
CFLAGS-test-ldouble-compat_totalordermag.c += -mabi=ibmlongdouble
|
|
|
|
endif
|
|
|
|
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
# Add IEEE binary128 files as make targets.
|
|
|
|
routines += $(foreach r,$(ldbl-extra-routines),ieee128-$(r))
|
|
|
|
|
|
|
|
# On powerpc64le, the routines responsible for converting between long
|
|
|
|
# double and string (e.g.: printf, scanf, strtold, strfroml) default to
|
|
|
|
# IBM long double mode. When support for TS 18661-3 was added, several
|
|
|
|
# internal functions were modified so that they could also handle
|
|
|
|
# floating-point variables with IEEE binary128 format, but as an
|
|
|
|
# additional type, _Float128.
|
|
|
|
#
|
|
|
|
# The following rule ensures that the string conversion routines will
|
|
|
|
# always be built in IBM long double mode, with additional support for
|
|
|
|
# IEEE binary128, through the use of -mabi=ibmlongdouble and -mfloat128.
|
|
|
|
ldbl-ibm128-files := $(objpfx)test-%-ibm128^ \
|
2018-07-30 15:04:40 +00:00
|
|
|
$(objpfx)iovdprintf^ \
|
|
|
|
$(objpfx)iovsprintf^ \
|
|
|
|
$(objpfx)iovsscanf^ \
|
|
|
|
$(objpfx)iovswscanf^ \
|
|
|
|
$(objpfx)iovfscanf^ \
|
2020-02-07 20:06:35 +00:00
|
|
|
$(objpfx)mpn2ldbl^ \
|
|
|
|
$(objpfx)ldbl2mpn^ \
|
|
|
|
$(objpfx)strtold_nan^ \
|
|
|
|
$(objpfx)strtold_l^ \
|
|
|
|
$(objpfx)strtold^ \
|
|
|
|
$(objpfx)strfroml^ \
|
|
|
|
$(objpfx)wcstold_nan^ \
|
|
|
|
$(objpfx)wcstold_l^ \
|
|
|
|
$(objpfx)wcstold^ \
|
|
|
|
$(objpfx)printf_fphex^ \
|
|
|
|
$(objpfx)printf_fp^ \
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
$(foreach r,$(ldbl-extra-routines),$(objpfx)$(r)^) \
|
|
|
|
$(foreach r,$(ldbl-extra-routines),$(objpfx)$(r)-internal^)
|
|
|
|
obj-suf-foreach = $(foreach suf,$(all-object-suffixes),$(subst ^,$(suf),$(1)))
|
2019-09-10 13:05:03 +00:00
|
|
|
|
|
|
|
# Explicitly add -mabi=ibm-long-double to required files.
|
ldbl-128ibm-compat: Add regular character printing functions
The 'mode' argument to __vfprintf_internal allows the selection of the
long double format for all long double arguments requested by the format
string. Currently, there are two possibilities: long double with the
same format as double or long double as something else. The 'something
else' format varies between architectures, and on powerpc64le, it means
IBM Extended Precision format.
In preparation for the third option of long double format on
powerpc64le, this patch uses the new mode mask,
PRINTF_LDBL_USES_FLOAT128, which tells __vfprintf_internal to save the
floating-point values into variables of type __float128 and adjusts the
parameters to __printf_fp and __printf_fphex as if it was a call from
strfromf128.
Many files from the stdio-common, wcsmbs, argp, misc, and libio
directories will have IEEE binary128 counterparts. Setting the correct
compiler options to these files (original and counterparts) would
produce a large amount of repetitive Makefile rules. To avoid this
repetition, this patch adds a Makefile routine that iterates over the
files adding or removing the appropriate flags.
Tested for powerpc64le.
Reviewed-By: Florian Weimer <fweimer@redhat.com>
Reviewed-By: Joseph Myers <joseph@codesourcery.com>
Reviewed-By: Paul E. Murphy <murphyp@linux.ibm.com>
2019-08-08 13:42:35 +00:00
|
|
|
$(call obj-suf-foreach,$(ldbl-ibm128-files)): \
|
|
|
|
sysdep-CFLAGS += -mabi=ibmlongdouble
|