]> git.ipfire.org Git - thirdparty/glibc.git/commit - math/lgamma-compat.h
Prefer new libm function wrappers for !LIBM_SVID_COMPAT.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 5 Sep 2017 23:35:55 +0000 (23:35 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 5 Sep 2017 23:35:55 +0000 (23:35 +0000)
commit4f3647e46e3f645c6516faa299efc6e89d520d7b
treeb2fb27343f3825d5da1c29ba173aa71fabcf24c1
parent05b38d64b1a3451d1fa10794b01dbc9bebe6a398
Prefer new libm function wrappers for !LIBM_SVID_COMPAT.

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].
165 files changed:
ChangeLog
math/lgamma-compat.h
math/w_acos_compat.c
math/w_acosf_compat.c
math/w_acosh_compat.c
math/w_acoshf_compat.c
math/w_acoshl_compat.c
math/w_acosl_compat.c
math/w_asin_compat.c
math/w_asinf_compat.c
math/w_asinl_compat.c
math/w_atan2_compat.c
math/w_atan2f_compat.c
math/w_atan2l_compat.c
math/w_atanh_compat.c
math/w_atanhf_compat.c
math/w_atanhl_compat.c
math/w_cosh_compat.c
math/w_coshf_compat.c
math/w_coshl_compat.c
math/w_exp10_compat.c
math/w_exp10f_compat.c
math/w_exp10l_compat.c
math/w_exp2_compat.c
math/w_exp2f_compat.c
math/w_exp2l_compat.c
math/w_fmod_compat.c
math/w_fmodf_compat.c
math/w_fmodl_compat.c
math/w_hypot_compat.c
math/w_hypotf_compat.c
math/w_hypotl_compat.c
math/w_j0_compat.c
math/w_j0f_compat.c
math/w_j0l_compat.c
math/w_j1_compat.c
math/w_j1f_compat.c
math/w_j1l_compat.c
math/w_jn_compat.c
math/w_jnf_compat.c
math/w_jnl_compat.c
math/w_lgamma_r_compat.c
math/w_lgammaf_r_compat.c
math/w_lgammal_r_compat.c
math/w_log10_compat.c
math/w_log10f_compat.c
math/w_log10l_compat.c
math/w_log2_compat.c
math/w_log2f_compat.c
math/w_log2l_compat.c
math/w_log_compat.c
math/w_logf_compat.c
math/w_logl_compat.c
math/w_pow_compat.c
math/w_powf_compat.c
math/w_powl_compat.c
math/w_remainder_compat.c
math/w_remainderf_compat.c
math/w_remainderl_compat.c
math/w_scalb_compat.c
math/w_scalbf_compat.c
math/w_scalbl_compat.c
math/w_sinh_compat.c
math/w_sinhf_compat.c
math/w_sinhl_compat.c
math/w_sqrt_compat.c
math/w_sqrtf_compat.c
math/w_sqrtl_compat.c
math/w_tgamma_compat.c
math/w_tgammaf_compat.c
math/w_tgammal_compat.c
sysdeps/generic/math-type-macros-double.h
sysdeps/generic/math-type-macros-float.h
sysdeps/generic/math-type-macros-ldouble.h
sysdeps/i386/fpu/w_sqrt.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_acos.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_acosf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_acosh.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_acoshf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_acoshl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_acosl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_asin.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_asinf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_asinl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_atan2.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_atan2f.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_atan2l.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_atanh.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_atanhf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_atanhl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_cosh.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_coshf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_coshl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_exp.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_exp10.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_exp10f.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_exp10l.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_exp2.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_exp2f.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_exp2l.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_expf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_expl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_fmod.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_fmodf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_fmodl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_hypot.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_hypotf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_hypotl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_lgamma_r.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_lgammaf_r.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_lgammal_r.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_log.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_log10.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_log10f.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_log10l.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_log2.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_log2f.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_log2l.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_logf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_logl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_pow.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_powf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_powl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_remainder.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_remainderf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_remainderl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_sinh.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_sinhf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_sinhl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_sqrt.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_sqrtf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_sqrtl.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_tgamma.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_tgammaf.c [new file with mode: 0644]
sysdeps/ia64/fpu/w_tgammal.c [new file with mode: 0644]
sysdeps/ieee754/dbl-64/w_exp_compat.c
sysdeps/ieee754/flt-32/w_expf_compat.c
sysdeps/ieee754/k_standard.c
sysdeps/ieee754/k_standardf.c
sysdeps/ieee754/k_standardl.c
sysdeps/ieee754/ldbl-128/w_expl_compat.c
sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c
sysdeps/ieee754/ldbl-64-128/w_expl_compat.c
sysdeps/ieee754/ldbl-96/w_expl_compat.c
sysdeps/ieee754/ldbl-opt/w_acoshl_compat.c
sysdeps/ieee754/ldbl-opt/w_acosl_compat.c
sysdeps/ieee754/ldbl-opt/w_asinl_compat.c
sysdeps/ieee754/ldbl-opt/w_atan2l_compat.c
sysdeps/ieee754/ldbl-opt/w_atanhl_compat.c
sysdeps/ieee754/ldbl-opt/w_coshl_compat.c
sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c
sysdeps/ieee754/ldbl-opt/w_fmodl_compat.c
sysdeps/ieee754/ldbl-opt/w_hypotl_compat.c
sysdeps/ieee754/ldbl-opt/w_j0l_compat.c
sysdeps/ieee754/ldbl-opt/w_j1l_compat.c
sysdeps/ieee754/ldbl-opt/w_jnl_compat.c
sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c
sysdeps/ieee754/ldbl-opt/w_log10l_compat.c
sysdeps/ieee754/ldbl-opt/w_log2l_compat.c
sysdeps/ieee754/ldbl-opt/w_logl_compat.c
sysdeps/ieee754/ldbl-opt/w_powl_compat.c
sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c
sysdeps/ieee754/ldbl-opt/w_sinhl_compat.c
sysdeps/ieee754/ldbl-opt/w_sqrtl_compat.c
sysdeps/ieee754/ldbl-opt/w_tgammal_compat.c