glibc/sysdeps/ieee754
Joseph Myers 9aa4965cdf Also create and use ldbl-compat-choose.h.
This patch makes the glibc build generate an additional header
ldbl-compat-choose.h that defines LONG_DOUBLE_COMPAT_CHOOSE_* macros
for each libc and libm symbol, which select one or the other of their
arguments based on whether the symbol was added before a change to
long double != double.

The effect of this is that it is then possible to define a macro
maybe_long_double_symbol that automatically acts as either
long_double_symbol or weak_alias depending on when the symbol being
defined was added.  This can be used when building long double
functions from type-generic templates.  Thus, with this patch ldbl-opt
no longer needs special long double implementations of each new libm
function added using such a template, and the existing such
implementations are removed.

This is a step towards being able more generally to use common macros
to create all the aliases needed for a libm function, so reducing the
amount of special-case code needed in ldbl-opt and ldbl-64-128, and
facilitating subsequently adding *f32 / *f64 / *f128 / *f32x / *f64x
aliases to existing functions (where the set of aliases that a
function should have may depend on the architecture in various ways).

Tested with build-many-glibcs.py.  Except for on
powerpc64le-linux-gnu, installed stripped shared libraries are
unchanged by the patch.  powerpc64le-linux-gnu is the unique
configuration which used ldbl-opt from the start rather than adding a
new long double choice after originally only having had long double =
double.  The effect of the patch there is that various cases that
previously used long_double_symbol unconditionally now use weak_alias
instead, so .os files contain e.g. a symbol cabsl instead of
cabsl@@GLIBC_2.17.  The final dynamic symbols and versions in the
resulting shared libraries are unchanged (ABI tests pass), as is the
disassembly of the shared libraries, but the differences in the .os
files still result in different .gnu_hash contents in libm.so; the
differences are of no significance and logically using weak_alias is
what's most appropriate in those cases.

	* scripts/versions.awk: Generate ldbl-compat-choose.h.
	* sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h: Include
	<ldbl-compat-choose.h>.
	(maybe_long_double_symbol): New macro.
	[!declare_mgen_alias] (declare_mgen_alias): Use
	maybe_long_double_symbol.
	* sysdeps/ieee754/ldbl-opt/s_canonicalizel.c: Remove.
	* sysdeps/ieee754/ldbl-opt/s_fmaxmagl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_fminmagl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_nextdownl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_llogbl.c: Likewise.
	* Makerules [$(build-shared) = yes && !avoid-generated]
	(before-compile): Add $(common-objpfx)ldbl-compat-choose.h.
	[$(build-shared) = yes && !avoid-generated]
	($(common-objpfx)ldbl-compat-choose.h): New target.
2017-05-19 11:30:26 +00:00
..
bits Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dbl-64 Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
float128 float128: Add _Float128 make bits to libm. 2017-05-09 11:40:28 -03:00
flt-32 Improve float range reduction accuracy near pi/2 (bug 21094). 2017-03-15 22:00:54 +00:00
ldbl-64-128 Move w_exp to libm-compat-call-auto 2017-02-08 17:44:20 -02:00
ldbl-96 Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
ldbl-128 ldbl-128: Use mathx_hidden_def inplace of hidden_def 2017-05-04 14:47:27 -03:00
ldbl-128ibm Remove unneeded declarations from math_private.h 2017-04-10 12:20:47 -03:00
ldbl-opt Also create and use ldbl-compat-choose.h. 2017-05-19 11:30:26 +00:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
k_standard.c Fix pow (qNaN, 0) result with -lieee (bug 20919), remove dead parts of wrappers. 2016-12-02 22:50:46 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
k_standardl.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Makefile Avoid -Wno-write-strings for k_standard.c. 2015-02-26 22:50:54 +00:00
s_lib_version.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_matherr.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_signgam.c Fix lgamma setting signgam for ISO C (bug 15421). 2015-11-20 22:49:59 +00:00