| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch series cleans up the many uses of __ieee754_sqrt(f/l) in GLIBC.
The goal is to enable GCC to do the inlining, and if this fails call the
__ieee754_sqrt function. This is done by internally declaring sqrt with asm
redirects. The compat symbols and sqrt wrappers need to disable the redirect.
The redirect is also disabled if there are already redirects defined when
using -ffinite-math-only.
All math functions (but not math tests, non-library code and libnldbl) are
built with -fno-math-errno which means GCC will typically inline sqrt as a
single instruction. This means targets are no longer forced to add a special
inline for sqrt.
* include/math.h (sqrt): Declare with asm redirect.
(sqrtf): Likewise.
(sqrtl): Likewise.
(sqrtf128): Likewise.
* Makeconfig: Add -fno-math-errno for libc/libm, but build testsuite,
nonlib and libnldbl with -fmath-errno.
* math/w_sqrt_compat.c: Define NO_MATH_REDIRECT.
* math/w_sqrt_template.c: Likewise.
* math/w_sqrtf_compat.c: Likewise.
* math/w_sqrtl_compat.c: Likewise.
* sysdeps/i386/fpu/w_sqrt.c: Likewise.
* sysdeps/i386/fpu/w_sqrt_compat.c: Likewise.
* sysdeps/generic/math-type-macros-float128.h: Remove math.h and
complex.h.
|
|
|
|
|
|
|
| |
* All files with FSF copyright notices: Update copyright dates
using scripts/update-copyrights.
* locale/programs/charmap-kw.h: Regenerated.
* locale/programs/locfile-kw.h: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch converts libm function implementations in math/ from using
weak_alias to using libm_alias_double to define public function names,
in cases where it would be appropriate to define _Float64 / _Float32x
aliases for those functions as well. This eliminates many
NO_LONG_DOUBLE conditionals and ldbl-opt wrappers round these function
implementations.
Tested for x86_64. Also tested with build-many-glibcs.py. Binary
differences seen are that the different order in which remainder and
drem symbols get defined as a result of this patch (the same source
file defines the same aliases, but in a different order of definition)
changes the order of symbols in the final libm.so when long double =
double, and for ldbl-opt configurations, the compat symbols for Bessel
functions were previously defined by e.g. "compat_symbol (libm, j0,
j0l, GLIBC_2_0)", which declares j0l as a compat symbol based on j0
and so makes j0l weak because j0 is weak, and are now defined
(indirectly via the relevant macros) based on e.g. __j0, so are no
longer weak because __j0 isn't weak.
* math/s_fma.c: Include <libm-alias-double.h>.
(fma): Define using libm_alias_double.
* math/s_nextafter.c: Include <libm-alias-double.h>.
(nextafter): Define using libm_alias_double.
* math/w_acos_compat.c: Include <libm-alias-double.h>.
(acos): Define using libm_alias_double.
* math/w_acosh_compat.c: Include <libm-alias-double.h>.
(aocsh): Define using libm_alias_double.
* math/w_asin_compat.c: Include <libm-alias-double.h>.
(asin): Define using libm_alias_double.
* math/w_atan2_compat.c: Include <libm-alias-double.h>.
(atan2): Define using libm_alias_double.
* math/w_atanh_compat.c: Include <libm-alias-double.h>.
(atanh): Define using libm_alias_double.
* math/w_cosh_compat.c: Include <libm-alias-double.h>.
(cosh): Define using libm_alias_double.
* math/w_exp10_compat.c: Include <libm-alias-double.h>.
(exp10): Define using libm_alias_double.
* math/w_exp2_compat.c: Include <libm-alias-double.h>.
(exp2): Define using libm_alias_double.
* math/w_exp_compat.c: Include <libm-alias-double.h>.
(exp): Define using libm_alias_double.
* math/w_fmod_compat.c: Include <libm-alias-double.h>.
(fmod): Define using libm_alias_double.
* math/w_hypot_compat.c: Include <libm-alias-double.h>.
(hypot): Define using libm_alias_double.
* math/w_j0_compat.c: Include <libm-alias-double.h>.
(j0): Define using libm_alias_double.
(y0): Likewise.
* math/w_j1_compat.c: Include <libm-alias-double.h>.
(j1): Define using libm_alias_double.
(y1): Likewise.
* math/w_jn_compat.c: Include <libm-alias-double.h>.
(jn): Define using libm_alias_double.
(yn): Likewise.
* math/w_log10_compat.c: Include <libm-alias-double.h>.
(log10): Define using libm_alias_double.
* math/w_log2_compat.c: Include <libm-alias-double.h>.
(log2): Define using libm_alias_double.
* math/w_log_compat.c: Include <libm-alias-double.h>.
(log): Define using libm_alias_double.
* math/w_pow_compat.c: Include <libm-alias-double.h>.
(pow): Define using libm_alias_double.
* math/w_remainder_compat.c: Include <libm-alias-double.h>.
(remainder): Define using libm_alias_double.
* math/w_sinh_compat.c: Include <libm-alias-double.h>.
(sinh): Define using libm_alias_double.
* math/w_sqrt_compat.c: Include <libm-alias-double.h>.
(sqrt): Define using libm_alias_double.
* math/w_tgamma_compat.c: Include <libm-alias-double.h>.
(tgamma): Define using libm_alias_double.
* sysdeps/ieee754/ldbl-opt/s_nextafter.c [LONG_DOUBLE_COMPAT(libm,
GLIBC_2_0)] (nextafterl): Do not define compat symbol here.
* sysdeps/ieee754/ldbl-opt/w_exp10_compat.c
[LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)] (exp10l): Likewise.
* sysdeps/ieee754/ldbl-opt/w_remainder_compat.c
[LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)] (remainderl): Likewise.
* sysdeps/ieee754/ldbl-opt/w_acos_compat.c: Remove.
* sysdeps/ieee754/ldbl-opt/w_acosh_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_asin_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_atan2_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_atanh_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_cosh_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_exp_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_fmod_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_hypot_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_j0_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_j1_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_jn_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_log10_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_log2_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_log_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_pow_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_sinh_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_sqrt_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_tgamma_compat.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial obsoletion of SVID libm error handling left the old
wrappers and __kernel_standard still being used for new ports and
static linking, just with macro definitions of _LIB_VERSION and
matherr that meant symbols with those names were never actually used
and the code for different error handling variants could be optimized
out.
This patch cleans things up further by eliminating the
__kernel_standard use for new ports and static linking. Now, the old
wrappers no longer generate any code in the !LIBM_SVID_COMPAT case,
while the new errno-only wrappers that were added for float128 support
are now also used for float, double and long double in that case.
The changes are generally straightforward. The w_scalb*_compat
wrappers continue to be used (scalb is obsolescent in the sense of not
being supported for float128, but is present in supported standards -
the 2001 edition of POSIX and earlier XSI versions - so remains
supported for static linking and new ports, as do the float and long
double variants that are existing GNU extensions). Those wrappers
would only call __kernel_standard in the _LIB_VERSION == _SVID_ case.
Since we would like to be able to compile most of glibc without
optimization, relying on a static function whose only use is under an
if (0) condition being optimized away to avoid an undefined
__kernel_standard reference may not be a good idea. Thus, the
relevant code in the scalb wrappers has LIBM_SVID_COMPAT conditionals
added to guarantee it's not built at all in the case where
__kernel_standard does not exist.
Just as i386 has its own w_sqrt_compat.c, so w_sqrt.c is also added.
ia64 gets dummy w_*.c to prevent those files being built where they
would conflict with the ia64 libm, as with its existing w_*_compat.c.
Conditions disabling code for !LIBM_SVID_COMPAT are needed in both the
math/ wrappers and in the long double wrappers in ldbl-opt (to avoid
them setting up aliases and symbol versions for undefined symbols). I
hope that future cleanups to how libm function aliases and symbol
versioning are done will eliminate the need for most of the ldbl-opt
wrappers.
Tested for x86_64 and x86, and with build-many-glibcs.py.
* sysdeps/generic/math-type-macros-double.h: Include
<math-svid-compat.h>.
(__USE_WRAPPER_TEMPLATE): Define to !LIBM_SVID_COMPAT.
* sysdeps/generic/math-type-macros-float.h: Include
<math-svid-compat.h>.
(__USE_WRAPPER_TEMPLATE): Define to !LIBM_SVID_COMPAT.
* sysdeps/generic/math-type-macros-ldouble.h: Include
<math-svid-compat.h>.
(__USE_WRAPPER_TEMPLATE): Define to !LIBM_SVID_COMPAT.
* math/lgamma-compat.h (BUILD_LGAMMA): Include LIBM_SVID_COMPAT
condition.
* math/w_acos_compat.c: Condition contents on [LIBM_SVID_COMPAT].
* math/w_acosf_compat.c: Likewise.
* math/w_acosh_compat.c: Likewise.
* math/w_acoshf_compat.c: Likewise.
* math/w_acoshl_compat.c: Likewise.
* math/w_acosl_compat.c: Likewise.
* math/w_asin_compat.c: Likewise.
* math/w_asinf_compat.c: Likewise.
* math/w_asinl_compat.c: Likewise.
* math/w_atan2_compat.c: Likewise.
* math/w_atan2f_compat.c: Likewise.
* math/w_atan2l_compat.c: Likewise.
* math/w_atanh_compat.c: Likewise.
* math/w_atanhf_compat.c: Likewise.
* math/w_atanhl_compat.c: Likewise.
* math/w_cosh_compat.c: Likewise.
* math/w_coshf_compat.c: Likewise.
* math/w_coshl_compat.c: Likewise.
* math/w_exp10_compat.c: Likewise.
* math/w_exp10f_compat.c: Likewise.
* math/w_exp10l_compat.c: Likewise.
* math/w_exp2_compat.c: Likewise.
* math/w_exp2f_compat.c: Likewise.
* math/w_exp2l_compat.c: Likewise.
* math/w_fmod_compat.c: Likewise.
* math/w_fmodf_compat.c: Likewise.
* math/w_fmodl_compat.c: Likewise.
* math/w_hypot_compat.c: Likewise.
* math/w_hypotf_compat.c: Likewise.
* math/w_hypotl_compat.c: Likewise.
* math/w_j0_compat.c: Likewise.
* math/w_j0f_compat.c: Likewise.
* math/w_j0l_compat.c: Likewise.
* math/w_j1_compat.c: Likewise.
* math/w_j1f_compat.c: Likewise.
* math/w_j1l_compat.c: Likewise.
* math/w_jn_compat.c: Likewise.
* math/w_jnf_compat.c: Likewise.
* math/w_jnl_compat.c: Likewise.
* math/w_lgamma_r_compat.c: Likewise.
* math/w_lgammaf_r_compat.c: Likewise.
* math/w_lgammal_r_compat.c: Likewise.
* math/w_log10_compat.c: Likewise.
* math/w_log10f_compat.c: Likewise.
* math/w_log10l_compat.c: Likewise.
* math/w_log2_compat.c: Likewise.
* math/w_log2f_compat.c: Likewise.
* math/w_log2l_compat.c: Likewise.
* math/w_log_compat.c: Likewise.
* math/w_logf_compat.c: Likewise.
* math/w_logl_compat.c: Likewise.
* math/w_pow_compat.c: Likewise.
* math/w_powf_compat.c: Likewise.
* math/w_powl_compat.c: Likewise.
* math/w_remainder_compat.c: Likewise.
* math/w_remainderf_compat.c: Likewise.
* math/w_remainderl_compat.c: Likewise.
* math/w_sinh_compat.c: Likewise.
* math/w_sinhf_compat.c: Likewise.
* math/w_sinhl_compat.c: Likewise.
* math/w_sqrt_compat.c: Likewise.
* math/w_sqrtf_compat.c: Likewise.
* math/w_sqrtl_compat.c: Likewise.
* math/w_tgamma_compat.c: Likewise.
* math/w_tgammaf_compat.c: Likewise.
* math/w_tgammal_compat.c: Likewise.
* math/w_scalb_compat.c (sysv_scalb): Condition definition on
[LIBM_SVID_COMPAT].
(__scalb): Condition call to sysv_scalb on [LIBM_SVID_COMPAT].
* math/w_scalbf_compat.c (sysv_scalbf): Condition definition on
[LIBM_SVID_COMPAT].
(__scalbf): Condition call to sysv_scalbf on [LIBM_SVID_COMPAT].
* math/w_scalbl_compat.c (sysv_scalbl): Condition definition on
[LIBM_SVID_COMPAT].
(__scalbl): Condition call to sysv_scalbl on [LIBM_SVID_COMPAT].
* sysdeps/i386/fpu/w_sqrt.c: New file.
* sysdeps/ia64/fpu/w_acos.c: Likewise.
* sysdeps/ia64/fpu/w_acosf.c: Likewise.
* sysdeps/ia64/fpu/w_acosh.c: Likewise.
* sysdeps/ia64/fpu/w_acoshf.c: Likewise.
* sysdeps/ia64/fpu/w_acoshl.c: Likewise.
* sysdeps/ia64/fpu/w_acosl.c: Likewise.
* sysdeps/ia64/fpu/w_asin.c: Likewise.
* sysdeps/ia64/fpu/w_asinf.c: Likewise.
* sysdeps/ia64/fpu/w_asinl.c: Likewise.
* sysdeps/ia64/fpu/w_atan2.c: Likewise.
* sysdeps/ia64/fpu/w_atan2f.c: Likewise.
* sysdeps/ia64/fpu/w_atan2l.c: Likewise.
* sysdeps/ia64/fpu/w_atanh.c: Likewise.
* sysdeps/ia64/fpu/w_atanhf.c: Likewise.
* sysdeps/ia64/fpu/w_atanhl.c: Likewise.
* sysdeps/ia64/fpu/w_cosh.c: Likewise.
* sysdeps/ia64/fpu/w_coshf.c: Likewise.
* sysdeps/ia64/fpu/w_coshl.c: Likewise.
* sysdeps/ia64/fpu/w_exp.c: Likewise.
* sysdeps/ia64/fpu/w_exp10.c: Likewise.
* sysdeps/ia64/fpu/w_exp10f.c: Likewise.
* sysdeps/ia64/fpu/w_exp10l.c: Likewise.
* sysdeps/ia64/fpu/w_exp2.c: Likewise.
* sysdeps/ia64/fpu/w_exp2f.c: Likewise.
* sysdeps/ia64/fpu/w_exp2l.c: Likewise.
* sysdeps/ia64/fpu/w_expf.c: Likewise.
* sysdeps/ia64/fpu/w_expl.c: Likewise.
* sysdeps/ia64/fpu/w_fmod.c: Likewise.
* sysdeps/ia64/fpu/w_fmodf.c: Likewise.
* sysdeps/ia64/fpu/w_fmodl.c: Likewise.
* sysdeps/ia64/fpu/w_hypot.c: Likewise.
* sysdeps/ia64/fpu/w_hypotf.c: Likewise.
* sysdeps/ia64/fpu/w_hypotl.c: Likewise.
* sysdeps/ia64/fpu/w_lgamma_r.c: Likewise.
* sysdeps/ia64/fpu/w_lgammaf_r.c: Likewise.
* sysdeps/ia64/fpu/w_lgammal_r.c: Likewise.
* sysdeps/ia64/fpu/w_log.c: Likewise.
* sysdeps/ia64/fpu/w_log10.c: Likewise.
* sysdeps/ia64/fpu/w_log10f.c: Likewise.
* sysdeps/ia64/fpu/w_log10l.c: Likewise.
* sysdeps/ia64/fpu/w_log2.c: Likewise.
* sysdeps/ia64/fpu/w_log2f.c: Likewise.
* sysdeps/ia64/fpu/w_log2l.c: Likewise.
* sysdeps/ia64/fpu/w_logf.c: Likewise.
* sysdeps/ia64/fpu/w_logl.c: Likewise.
* sysdeps/ia64/fpu/w_pow.c: Likewise.
* sysdeps/ia64/fpu/w_powf.c: Likewise.
* sysdeps/ia64/fpu/w_powl.c: Likewise.
* sysdeps/ia64/fpu/w_remainder.c: Likewise.
* sysdeps/ia64/fpu/w_remainderf.c: Likewise.
* sysdeps/ia64/fpu/w_remainderl.c: Likewise.
* sysdeps/ia64/fpu/w_sinh.c: Likewise.
* sysdeps/ia64/fpu/w_sinhf.c: Likewise.
* sysdeps/ia64/fpu/w_sinhl.c: Likewise.
* sysdeps/ia64/fpu/w_sqrt.c: Likewise.
* sysdeps/ia64/fpu/w_sqrtf.c: Likewise.
* sysdeps/ia64/fpu/w_sqrtl.c: Likewise.
* sysdeps/ia64/fpu/w_tgamma.c: Likewise.
* sysdeps/ia64/fpu/w_tgammaf.c: Likewise.
* sysdeps/ia64/fpu/w_tgammal.c: Likewise.
* sysdeps/ieee754/dbl-64/w_exp_compat.c: Condition contents on
[LIBM_SVID_COMPAT].
* sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise.
* sysdeps/ieee754/k_standard.c: Likewise.
* sysdeps/ieee754/k_standardf.c: Likewise.
* sysdeps/ieee754/k_standardl.c: Likewise.
* sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-64-128/w_expl_compat.c: Condition
long_double_symbol call on [LIBM_SVID_COMPAT].
* sysdeps/ieee754/ldbl-opt/w_acoshl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_acosl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_asinl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_atan2l_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_atanhl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_coshl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_fmodl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_hypotl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_j0l_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_j1l_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_jnl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_log10l_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_log2l_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_logl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_powl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_sinhl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_sqrtl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_tgammal_compat.c: Likewise.
* sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c: Condition
long_double_symbol and compat_symbol calls on [LIBM_SVID_COMPAT].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch obsoletes support for SVID libm error handling (the system
where a user-defined function matherr is called on a libm function
error; only enabled if you also set _LIB_VERSION = _SVID_ or
_LIB_VERSION = _XOPEN_) and the use of the _LIB_VERSION global
variable to control libm error handling. matherr and _LIB_VERSION are
made into compat symbols, not supported for new ports or for static
linking. The libieee.a object file (which sets _LIB_VERSION = _IEEE_,
so disabling errno setting for some functions) is also removed, and
all the related definitions are removed from math.h.
The manual already recommends against using matherr, and it's already
not supported for _Float128 functions (those use new wrappers that
don't support matherr, only errno) - this patch means that it becomes
possible to e.g. add sinf32 as an alias to sinf without that resulting
in undesired matherr support in sinf32 for existing glibc ports.
matherr support is not part of any standard supported by glibc (it was
removed in XPG4).
Because matherr is a function to be defined by the user, of course
user programs defining such a function will still continue to link; it
just quietly won't be used. If they try to write to the library's
copy of _LIB_VERSION to enable SVID error handling, however, they will
get a link error (but if they define their own _LIB_VERSION variable,
they won't).
I expect the most likely case of build failures from this patch to be
programs with unconditional cargo-culted uses of -lieee (based on a
notion of "I want IEEE floating point", not any actual requirement for
that library).
Ideally, the new-port-or-static-linking case would use the new
wrappers used for _Float128. This is not implemented in this patch,
because of the complication of architecture-specific (powerpc32 and
sparc) sqrt wrappers that use _LIB_VERSION and __kernel_standard
directly. Thus, the old wrappers and __kernel_standard are still
built unconditionally, and _LIB_VERSION still exists in static libm.
But when the old wrappers and __kernel_standard are built in the
non-compat case, _LIB_VERSION and matherr are defined as macros so
code to support those features isn't actually built into static libm
or new ports' shared libm after this patch.
I intend to move to the new wrappers for static libm and new ports in
followup patches. I believe the sqrt wrappers for powerpc32 and sparc
can reasonably be removed. GCC already optimizes the normal case of
sqrt by generating code that uses a hardware instruction and only
calls the sqrt function if the argument was negative (if
-fno-math-errno, of course, it just uses the hardware instruction
without any check for negative argument being needed). Thus those
wrappers will only actually get called in the case of negative
arguments, which is not a case it makes sense to optimize for. But
even without removing the powerpc32 and sparc wrappers it should still
be possible to move to the new wrappers for static libm and new ports,
just without having those dubious architecture-specific optimizations
in static libm.
Everything said about matherr equally applies to matherrf and matherrl
(IA64-specific, undocumented), except that the structure of IA64 libm
means it won't be converted to using the new wrappers (it doesn't use
the old ones either, but its own error-handling code instead).
As with other tests of compat symbols, I expect test-matherr and
test-matherr-2 to need to become appropriately conditional once we
have a system for disabling such tests for ports too new to have the
relevant symbols.
Tested for x86_64 and x86, and with build-many-glibcs.py.
* math/math.h [__USE_MISC] (_LIB_VERSION_TYPE): Remove.
[__USE_MISC] (_LIB_VERSION): Likewise.
[__USE_MISC] (struct exception): Likewise.
[__USE_MISC] (matherr): Likewise.
[__USE_MISC] (DOMAIN): Likewise.
[__USE_MISC] (SING): Likewise.
[__USE_MISC] (OVERFLOW): Likewise.
[__USE_MISC] (UNDERFLOW): Likewise.
[__USE_MISC] (TLOSS): Likewise.
[__USE_MISC] (PLOSS): Likewise.
[__USE_MISC] (HUGE): Likewise.
[__USE_XOPEN] (MAXFLOAT): Define even if [__USE_MISC].
* math/math-svid-compat.h: New file.
* conform/linknamespace.pl (@whitelist): Remove matherr, matherrf
and matherrl.
* include/math.h [!_ISOMAC] (__matherr): Remove.
* manual/arith.texi (FP Exceptions): Do not document matherr.
* math/Makefile (tests): Change test-matherr to test-matherr-3.
(tests-internal): New variable.
(install-lib): Do not add libieee.a.
(non-lib.a): Likewise.
(extra-objs): Do not add libieee.a and ieee-math.o.
(CPPFLAGS-s_lib_version.c): Remove variable.
($(objpfx)libieee.a): Remove rule.
($(addprefix $(objpfx), $(tests-internal)): Depend on $(libm).
* math/ieee-math.c: Remove.
* math/libm-test-support.c (matherr): Remove.
* math/test-matherr.c: Use <support/test-driver.c>. Add copyright
and license notices. Include <math-svid-compat.h> and
<shlib-compat.h>.
(matherr): Undefine as macro. Use compat_symbol_reference.
(_LIB_VERSION): Likewise.
* math/test-matherr-2.c: New file.
* math/test-matherr-3.c: Likewise.
* sysdeps/generic/math_private.h (__kernel_standard): Remove
declaration.
(__kernel_standard_f): Likewise.
(__kernel_standard_l): Likewise.
* sysdeps/ieee754/s_lib_version.c: Do not include <math.h> or
<math_private.h>. Include <math-svid-compat.h>.
(_LIB_VERSION): Undefine as macro.
(_LIB_VERSION_INTERNAL): Always initialize to _POSIX_. Define
only if [LIBM_SVID_COMPAT || !defined SHARED]. If
[LIBM_SVID_COMPAT], use compat_symbol.
* sysdeps/ieee754/s_matherr.c: Do not include <math.h> or
<math_private.h>. Include <math-svid-compat.h>.
(matherr): Undefine as macro.
(__matherr): Define only if [LIBM_SVID_COMPAT]. Use
compat_symbol.
* sysdeps/ia64/fpu/libm_error.c: Include <math-svid-compat.h>.
[_LIBC && LIBM_SVID_COMPAT] (matherrf): Use
compat_symbol_reference.
[_LIBC && LIBM_SVID_COMPAT] (matherrl): Likewise.
[_LIBC && !LIBM_SVID_COMPAT] (matherrf): Define as macro.
[_LIBC && !LIBM_SVID_COMPAT] (matherrl): Likewise.
* sysdeps/ia64/fpu/libm_support.h: Include <math-svid-compat.h>.
(MATHERR_D): Remove declaration.
[!_LIBC] (_LIB_VERSION_TYPE): Likewise
[!LIBM_BUILD] (_LIB_VERSIONIMF): Likewise.
[LIBM_BUILD] (pmatherrf): Likewise.
[LIBM_BUILD] (pmatherr): Likewise.
[LIBM_BUILD] (pmatherrl): Likewise.
(DOMAIN): Likewise.
(SING): Likewise.
(OVERFLOW): Likewise.
(UNDERFLOW): Likewise.
(TLOSS): Likewise.
(PLOSS): Likewise.
* sysdeps/ia64/fpu/s_matherrf.c: Include <math-svid-compat.h>.
(__matherrf): Define only if [LIBM_SVID_COMPAT]. Use
compat_symbol.
* sysdeps/ia64/fpu/s_matherrl.c: Include <math-svid-compat.h>.
(__matherrl): Define only if [LIBM_SVID_COMPAT]. Use
compat_symbol.
* math/lgamma-compat.h: Include <math-svid-compat.h>.
* math/w_acos_compat.c: Likewise.
* math/w_acosf_compat.c: Likewise.
* math/w_acosh_compat.c: Likewise.
* math/w_acoshf_compat.c: Likewise.
* math/w_acoshl_compat.c: Likewise.
* math/w_acosl_compat.c: Likewise.
* math/w_asin_compat.c: Likewise.
* math/w_asinf_compat.c: Likewise.
* math/w_asinl_compat.c: Likewise.
* math/w_atan2_compat.c: Likewise.
* math/w_atan2f_compat.c: Likewise.
* math/w_atan2l_compat.c: Likewise.
* math/w_atanh_compat.c: Likewise.
* math/w_atanhf_compat.c: Likewise.
* math/w_atanhl_compat.c: Likewise.
* math/w_cosh_compat.c: Likewise.
* math/w_coshf_compat.c: Likewise.
* math/w_coshl_compat.c: Likewise.
* math/w_exp10_compat.c: Likewise.
* math/w_exp10f_compat.c: Likewise.
* math/w_exp10l_compat.c: Likewise.
* math/w_exp2_compat.c: Likewise.
* math/w_exp2f_compat.c: Likewise.
* math/w_exp2l_compat.c: Likewise.
* math/w_fmod_compat.c: Likewise.
* math/w_fmodf_compat.c: Likewise.
* math/w_fmodl_compat.c: Likewise.
* math/w_hypot_compat.c: Likewise.
* math/w_hypotf_compat.c: Likewise.
* math/w_hypotl_compat.c: Likewise.
* math/w_j0_compat.c: Likewise.
* math/w_j0f_compat.c: Likewise.
* math/w_j0l_compat.c: Likewise.
* math/w_j1_compat.c: Likewise.
* math/w_j1f_compat.c: Likewise.
* math/w_j1l_compat.c: Likewise.
* math/w_jn_compat.c: Likewise.
* math/w_jnf_compat.c: Likewise.
* math/w_jnl_compat.c: Likewise.
* math/w_lgamma_main.c: Likewise.
* math/w_lgamma_r_compat.c: Likewise.
* math/w_lgammaf_main.c: Likewise.
* math/w_lgammaf_r_compat.c: Likewise.
* math/w_lgammal_main.c: Likewise.
* math/w_lgammal_r_compat.c: Likewise.
* math/w_log10_compat.c: Likewise.
* math/w_log10f_compat.c: Likewise.
* math/w_log10l_compat.c: Likewise.
* math/w_log2_compat.c: Likewise.
* math/w_log2f_compat.c: Likewise.
* math/w_log2l_compat.c: Likewise.
* math/w_log_compat.c: Likewise.
* math/w_logf_compat.c: Likewise.
* math/w_logl_compat.c: Likewise.
* math/w_pow_compat.c: Likewise.
* math/w_powf_compat.c: Likewise.
* math/w_powl_compat.c: Likewise.
* math/w_remainder_compat.c: Likewise.
* math/w_remainderf_compat.c: Likewise.
* math/w_remainderl_compat.c: Likewise.
* math/w_scalb_compat.c: Likewise.
* math/w_scalbf_compat.c: Likewise.
* math/w_scalbl_compat.c: Likewise.
* math/w_sinh_compat.c: Likewise.
* math/w_sinhf_compat.c: Likewise.
* math/w_sinhl_compat.c: Likewise.
* math/w_sqrt_compat.c: Likewise.
* math/w_sqrtf_compat.c: Likewise.
* math/w_sqrtl_compat.c: Likewise.
* math/w_tgamma_compat.c: Likewise.
* math/w_tgammaf_compat.c: Likewise.
* math/w_tgammal_compat.c: Likewise.
* sysdeps/ieee754/dbl-64/w_exp_compat.c: Likewise.
* sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise.
* sysdeps/ieee754/k_standard.c: Likewise.
* sysdeps/ieee754/k_standardf.c: Likewise.
* sysdeps/ieee754/k_standardl.c: Likewise.
* sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise.
* sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S: Likewise.
* sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S: Likewise.
* sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S: Likewise.
* sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S: Likewise.
* sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S: Likewise.
* sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S: Likewise.
* sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S: Likewise.
|
|
This commit moves one step towards the deprecation of wrappers that
use _LIB_VERSION / matherr / __kernel_standard functionality, by
adding the suffix '_compat' to their filenames and adjusting Makefiles
and #includes accordingly.
New template wrappers that do not use such functionality will be added
by future patches and will be first used by the float128 wrappers.
|