glibc/scripts
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
..
abi-versions.awk Remove bitrotten --enable-oldest-abi (bug 6652). 2014-09-16 17:45:03 +00:00
abilist.awk Simplify the abilist format 2015-11-06 13:58:53 +01:00
backport-support.sh Add scripts/backport-support.sh 2017-02-28 16:36:26 +01:00
build-many-glibcs.py Default Linux kernel version in build-many-glibcs.py to 4.11. 2017-05-01 11:15:43 +00:00
check-c++-types.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
check-execstack.awk Do check-execstack test using readelf rather than a build-time C program. 2012-05-01 13:27:52 -07:00
check-installed-headers.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
check-local-headers.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
check-localplt.awk Extend local PLT reference check 2015-07-29 11:58:06 -07:00
check-textrel.awk Do check-textrel test using readelf rather than a build-time C program. 2012-05-01 13:27:11 -07:00
config-uname.sh Rejigger header generation for default uname implementation. 2010-08-24 11:56:52 -07:00
config.guess Update config.guess and config.sub to current versions. 2017-01-01 00:29:55 +00:00
config.sub Update config.guess and config.sub to current versions. 2017-01-01 00:29:55 +00:00
cpp Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
cross-test-ssh.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
documented.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
evaluate-test.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
firstversions.awk Fix bug in firstversions.awk version range handling. 2012-01-28 12:02:44 -05:00
gen-as-const.awk Fix 64-bit platform handling in test cases for generated headers with constants. 2009-08-16 00:39:43 -07:00
gen-libc-abis Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
gen-libc-modules.awk Auto-generate libc-modules.h 2014-11-19 12:16:00 +05:30
gen-posix-conf-vars.awk Remove uses of sprintf in gen-posix-conf-vars.awk 2015-01-02 11:16:35 +05:30
gen-py-const.awk Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gen-rrtypes.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gen-sorted.awk Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gen-tunables.awk tunables: Specify a default value for tunables 2017-05-17 13:11:00 +05:30
install-sh Update miscellaneous files from upstream sources. 2016-12-21 16:05:55 +00:00
lib-names.awk Clean up gnu/lib-names.h generation (bug 14171). 2014-09-26 17:33:04 +00:00
list-fixed-bugs.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
list-sources.sh Update scripts/list-sources.sh for ports repository merge. 2014-06-26 21:30:07 +00:00
localplt.awk Support PLT and GOT references in local PIC check 2015-10-14 06:00:02 -07:00
merge-test-results.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkinstalldirs Update miscellaneous files from upstream sources. 2016-12-21 16:05:55 +00:00
move-if-change Update miscellaneous files from upstream sources. 2016-12-21 16:05:55 +00:00
output-format.sed
pylint Implement benchmarking script in python 2014-03-21 17:32:50 +05:30
pylintrc pylintrc: disable reports 2015-11-11 13:41:57 -05:00
rellns-sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
soversions.awk Remove bitrotten --enable-oldest-abi (bug 6652). 2014-09-16 17:45:03 +00:00
sysd-rules.awk sysd-rules: Cut down the number of rtld-% pattern rules 2016-09-20 10:41:05 +02:00
test_printers_common.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
test_printers_exceptions.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
test-installation.pl Update copyright dates not handled by scripts/update-copyrights. 2017-01-01 00:26:24 +00:00
update-abilist.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
update-copyrights Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
versionlist.awk Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
versions.awk Also create and use ldbl-compat-choose.h. 2017-05-19 11:30:26 +00:00