]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Obsolete matherr, _LIB_VERSION, libieee.a.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 21 Aug 2017 17:45:10 +0000 (17:45 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 21 Aug 2017 17:45:10 +0000 (17:45 +0000)
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.

113 files changed:
ChangeLog
NEWS
conform/linknamespace.pl
include/math.h
manual/arith.texi
math/Makefile
math/ieee-math.c [deleted file]
math/lgamma-compat.h
math/libm-test-support.c
math/math-svid-compat.h [new file with mode: 0644]
math/math.h
math/test-matherr-2.c [new file with mode: 0644]
math/test-matherr-3.c [new file with mode: 0644]
math/test-matherr.c
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_main.c
math/w_lgamma_r_compat.c
math/w_lgammaf_main.c
math/w_lgammaf_r_compat.c
math/w_lgammal_main.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_private.h
sysdeps/ia64/fpu/libm_error.c
sysdeps/ia64/fpu/libm_support.h
sysdeps/ia64/fpu/s_matherrf.c
sysdeps/ia64/fpu/s_matherrl.c
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-96/w_expl_compat.c
sysdeps/ieee754/s_lib_version.c
sysdeps/ieee754/s_matherr.c
sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S
sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S
sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S
sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S
sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S
sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S
sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S
sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S
sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S
sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S
sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S

index 768f235a084b136f1c21bb31aec5a38fdf9bef8b..f1a1e0b0472ea02d3f88f671f12e249220d1278a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,175 @@
+2017-08-21  Joseph Myers  <joseph@codesourcery.com>
+
+       * 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.
+
 2017-08-21  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #21864]
diff --git a/NEWS b/NEWS
index 6639633c2ba3e794f3985cb920fb491eba5ac6d2..8fe0879bc44063d8d97fa5589b3a16d2d0606b68 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,14 @@ Deprecated and removed features, and other changes affecting compatibility:
 * On GNU/Linux, the obsolete Linux constant PTRACE_SEIZE_DEVEL is no longer
   defined by <sys/ptrace.h>.
 
+* libm no longer supports SVID error handling (calling a user-provided
+  matherr function on error) or the _LIB_VERSION variable to control error
+  handling.  (SVID error handling and the _LIB_VERSION variable still work
+  for binaries linked against older versions of the GNU C Library.)  The
+  libieee.a library is no longer provided.  math.h no longer defines struct
+  exception, or the macros X_TLOSS, DOMAIN, SING, OVERFLOW, UNDERFLOW,
+  TLOSS, PLOSS and HUGE.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
index 35257304b93375fe4c36e71c83aac052e688584d..2ce5388a782d2eb70146967f1833fbff9827a97f 100644 (file)
@@ -47,11 +47,7 @@ close (STDSYMS) || die ("close $stdsyms_file: $!\n");
 # * Bug 18442: re_syntax_options wrongly brought in by regcomp and
 # used by re_comp.
 #
-# * False positive: matherr only used conditionally.  matherrf/matherrl are used
-# by IA64 too for the same reason.
-#
-@whitelist = qw(stdin stdout stderr re_syntax_options matherr matherrf
-               matherrl);
+@whitelist = qw(stdin stdout stderr re_syntax_options);
 foreach my $sym (@whitelist) {
   $stdsyms{$sym} = 1;
 }
@@ -134,7 +130,7 @@ foreach my $sym (@sym_data) {
 # possible that (a) any standard library definition is weak, so can be
 # overridden by the user's definition, and (b) the symbol is only used
 # conditionally and not if the program is limited to standard
-# functionality.  (matherr is an example of such a false positive.)
+# functionality.
 #
 # * If a symbol reference is only brought in by the user using a data
 # symbol rather than a function from the standard library, this will
index fdb43517e11fc79712a10b0e5f1dde127a77c2e1..b62a388b5c9de6e405d9c981a4b99b7b07f7ef64 100644 (file)
@@ -9,8 +9,6 @@
 
 #ifndef _ISOMAC
 /* Now define the internal interfaces.  */
-extern int __matherr (struct exception *__exc);
-
 extern int __signgam;
 
 # if IS_IN (libc) || IS_IN (libm)
index 28a0e134d5fee6f291cd5f08d94de83898c4e9ea..d12a6c9d267b4d46f8328dd814938e22a6f48c80 100644 (file)
@@ -514,14 +514,6 @@ signal.  The default action for this signal is to terminate the
 program.  @xref{Signal Handling}, for how you can change the effect of
 the signal.
 
-@findex matherr
-In the System V math library, the user-defined function @code{matherr}
-is called when certain exceptions occur inside math library functions.
-However, the Unix98 standard deprecates this interface.  We support it
-for historical compatibility, but recommend that you do not use it in
-new programs.  When this interface is used, exceptions may not be
-raised.
-
 @noindent
 The exceptions defined in @w{IEEE 754} are:
 
index e09b0c05457f1d473c2f65f4dca6bd10f7854dc2..25d3e95c6c1b284e48d28117753835d425a60a77 100644 (file)
@@ -181,7 +181,7 @@ $(inst_libdir)/libm.a: $(common-objpfx)format.lds \
 endif
 
 # Rules for the test suite.
-tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
+tests = test-matherr-3 test-fenv atest-exp atest-sincos atest-exp2 basic-test \
        test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \
        test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \
        test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \
@@ -201,6 +201,7 @@ tests-static = test-fpucw-static test-fpucw-ieee-static \
               test-signgam-uchar-static test-signgam-uchar-init-static \
               test-signgam-uint-static test-signgam-uint-init-static \
               test-signgam-ullong-static test-signgam-ullong-init-static
+tests-internal = test-matherr test-matherr-2
 
 ifneq (,$(CXX))
 tests += test-math-isinff test-math-iszero
@@ -357,12 +358,6 @@ CFLAGS-test-flt-eval-method.c = -fexcess-precision=standard
 
 CFLAGS-test-fe-snans-always-signal.c = -fsignaling-nans
 
-# The -lieee module sets the _LIB_VERSION_ switch to IEEE mode
-# for error handling in the -lm functions.
-install-lib += libieee.a
-non-lib.a += libieee.a
-extra-objs += libieee.a ieee-math.o
-
 include ../Rules
 
 gen-all-calls = $(gen-libm-calls) $(gen-calls)
@@ -542,10 +537,6 @@ endef
 object-suffixes-left := $(all-object-suffixes)
 include $(o-iterator)
 
-# This file defines the default _LIB_VERSION variable that controls
-# the error return conventions for the math functions.
-CPPFLAGS-s_lib_version.c := -D_POSIX_MODE
-
 # We don't want the fdlibm code to use the inline math functions,
 # only the fdlibm code.
 math-CPPFLAGS += -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES
@@ -566,17 +557,9 @@ CFLAGS-s_modff.c += -fsignaling-nans
 CFLAGS-s_modfl.c += -fsignaling-nans
 CFLAGS-s_modff128.c += -fsignaling-nans
 
-# The -lieee library is actually an object file.
-# The module just defines the _LIB_VERSION_ variable.
-# It's not a library to make sure it is linked in instead of s_lib_version.o.
-$(objpfx)libieee.a: $(objpfx)ieee-math.o
-       rm -f $@
-       $(patsubst %/,cd % &&,$(objpfx)) \
-       $(LN_S) $(<F) $(@F)
-
 $(addprefix $(objpfx),\
            $(filter-out $(tests-static) $(libm-tests-vector),\
-                        $(tests))): $(libm)
+                        $(tests) $(tests-internal))): $(libm)
 $(addprefix $(objpfx),$(tests-static)): $(objpfx)libm.a
 define o-iterator-doit
 $(foreach f,$($(o)-funcs),\
diff --git a/math/ieee-math.c b/math/ieee-math.c
deleted file mode 100644 (file)
index 99e41a3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Linking in this module forces IEEE error handling rules for math functions.
-   The default is POSIX.1 error handling.  */
-
-#include <math.h>
-
-_LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
index 90a423756a16eaf59dd87898158c1afd8bf3eab6..189d12688271eefd9ff56456e6c823dd2fcdb895 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef LGAMMA_COMPAT_H
 #define LGAMMA_COMPAT_H 1
 
+#include <math-svid-compat.h>
 #include <shlib-compat.h>
 
 /* XSI POSIX requires lgamma to set signgam, but ISO C does not permit
index 078d30743dafc922ed757cd5133ac45ac08c16c6..9ce3eb1c04512f888c2544c37622a999724274bc 100644 (file)
@@ -989,13 +989,6 @@ enable_test (int exceptions)
   return 1;
 }
 
-/* This is to prevent messages from the SVID libm emulation.  */
-int
-matherr (struct exception *x __attribute__ ((unused)))
-{
-  return 1;
-}
-
 static void
 initialize (void)
 {
diff --git a/math/math-svid-compat.h b/math/math-svid-compat.h
new file mode 100644 (file)
index 0000000..284cc13
--- /dev/null
@@ -0,0 +1,90 @@
+/* Declarations for SVID math error handling compatibility.
+   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef        _MATH_SVID_COMPAT_H
+#define        _MATH_SVID_COMPAT_H     1
+
+#ifndef __ASSEMBLER__
+/* Support for various different standard error handling behaviors.  */
+typedef enum
+{
+  _IEEE_ = -1, /* According to IEEE 754/IEEE 854.  */
+  _SVID_,      /* According to System V, release 4.  */
+  _XOPEN_,     /* Nowadays also Unix98.  */
+  _POSIX_,
+  _ISOC_       /* Actually this is ISO C99.  */
+} _LIB_VERSION_TYPE;
+
+/* This variable can be changed at run-time to any of the values above to
+   affect floating point error handling behavior (it may also be necessary
+   to change the hardware FPU exception settings).  */
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+
+/* In SVID error handling, `matherr' is called with this description
+   of the exceptional condition.  */
+struct exception
+  {
+    int type;
+    char *name;
+    double arg1;
+    double arg2;
+    double retval;
+  };
+
+extern int matherr (struct exception *__exc);
+extern int __matherr (struct exception *__exc);
+
+# define X_TLOSS       1.41484755040568800000e+16
+
+/* Types of exceptions in the `type' field.  */
+# define DOMAIN                1
+# define SING          2
+# define OVERFLOW      3
+# define UNDERFLOW     4
+# define TLOSS         5
+# define PLOSS         6
+
+/* SVID mode specifies returning this large value instead of infinity.  */
+# define HUGE          3.40282347e+38F
+#endif
+
+/* The above definitions may be used in testcases.  The following code
+   is only used in the implementation.  */
+
+#ifdef _LIBC
+# ifndef __ASSEMBLER__
+/* fdlibm kernel function */
+extern double __kernel_standard (double, double, int);
+extern float __kernel_standard_f (float, float, int);
+extern long double __kernel_standard_l (long double, long double, int);
+# endif
+
+# include <shlib-compat.h>
+# define LIBM_SVID_COMPAT SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27)
+# if LIBM_SVID_COMPAT
+compat_symbol_reference (libm, matherr, matherr, GLIBC_2_0);
+compat_symbol_reference (libm, _LIB_VERSION, _LIB_VERSION, GLIBC_2_0);
+# elif !defined __ASSEMBLER__
+/* Except when building compat code, optimize out references to
+   _LIB_VERSION and matherr.  */
+#  define _LIB_VERSION _POSIX_
+#  define matherr(EXC) ((void) (EXC), 0)
+# endif
+#endif
+
+#endif /* math-svid-compat.h.  */
index dea8dbe1ae486410394150867a59ad99af837ed9..275534be114eae5393d3ba73b629486683eafe93 100644 (file)
@@ -501,70 +501,10 @@ iszero (__T __val)
 # endif        /* __cplusplus */
 #endif /* Use IEC_60559_BFP_EXT.  */
 
-#ifdef __USE_MISC
-/* Support for various different standard error handling behaviors.  */
-typedef enum
-{
-  _IEEE_ = -1, /* According to IEEE 754/IEEE 854.  */
-  _SVID_,      /* According to System V, release 4.  */
-  _XOPEN_,     /* Nowadays also Unix98.  */
-  _POSIX_,
-  _ISOC_       /* Actually this is ISO C99.  */
-} _LIB_VERSION_TYPE;
-
-/* This variable can be changed at run-time to any of the values above to
-   affect floating point error handling behavior (it may also be necessary
-   to change the hardware FPU exception settings).  */
-extern _LIB_VERSION_TYPE _LIB_VERSION;
-#endif
-
-
-#ifdef __USE_MISC
-/* In SVID error handling, `matherr' is called with this description
-   of the exceptional condition.
-
-   We have a problem when using C++ since `exception' is a reserved
-   name in C++.  */
-# ifdef __cplusplus
-struct __exception
-# else
-struct exception
-# endif
-  {
-    int type;
-    char *name;
-    double arg1;
-    double arg2;
-    double retval;
-  };
-
-# ifdef __cplusplus
-extern int matherr (struct __exception *__exc) throw ();
-# else
-extern int matherr (struct exception *__exc);
-# endif
-
-# define X_TLOSS       1.41484755040568800000e+16
-
-/* Types of exceptions in the `type' field.  */
-# define DOMAIN                1
-# define SING          2
-# define OVERFLOW      3
-# define UNDERFLOW     4
-# define TLOSS         5
-# define PLOSS         6
-
-/* SVID mode specifies returning this large value instead of infinity.  */
-# define HUGE          3.40282347e+38F
-
-#else  /* !Misc.  */
-
-# ifdef __USE_XOPEN
+#ifdef __USE_XOPEN
 /* X/Open wants another strange constant.  */
-#  define MAXFLOAT     3.40282347e+38F
-# endif
-
-#endif /* Misc.  */
+# define MAXFLOAT      3.40282347e+38F
+#endif
 
 
 /* Some useful constants.  */
diff --git a/math/test-matherr-2.c b/math/test-matherr-2.c
new file mode 100644 (file)
index 0000000..c2fc5e6
--- /dev/null
@@ -0,0 +1,49 @@
+/* Test matherr (compat symbols, binary defines own _LIB_VERSION).
+   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <math-svid-compat.h>
+#include <shlib-compat.h>
+#undef matherr
+#undef _LIB_VERSION
+compat_symbol_reference (libm, matherr, matherr, GLIBC_2_0);
+compat_symbol_reference (libm, _LIB_VERSION, _LIB_VERSION, GLIBC_2_0);
+
+_LIB_VERSION_TYPE _LIB_VERSION = _SVID_;
+
+static int fail = 1;
+
+int
+matherr (struct exception *s)
+{
+  printf ("matherr is working\n");
+  fail = 0;
+  return 1;
+}
+
+static int
+do_test (void)
+{
+  acos (2.0);
+  return fail;
+}
+
+#include <support/test-driver.c>
diff --git a/math/test-matherr-3.c b/math/test-matherr-3.c
new file mode 100644 (file)
index 0000000..c81a04f
--- /dev/null
@@ -0,0 +1,44 @@
+/* Test matherr not supported for new binaries.
+   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <math-svid-compat.h>
+
+_LIB_VERSION_TYPE _LIB_VERSION = _SVID_;
+
+static int fail = 0;
+
+int
+matherr (struct exception *s)
+{
+  printf ("matherr is working, but should not be\n");
+  fail = 1;
+  return 1;
+}
+
+static int
+do_test (void)
+{
+  acos (2.0);
+  return fail;
+}
+
+#include <support/test-driver.c>
index 6983879da44d79521eed93359e513e07d53594a6..34856f1ffb7954a26d7c63459c333fbcbfc7cd76 100644 (file)
@@ -1,7 +1,32 @@
+/* Test matherr (compat symbols, binary modifies library's _LIB_VERSION).
+   Copyright (C) 1997-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <math-svid-compat.h>
+#include <shlib-compat.h>
+#undef matherr
+#undef _LIB_VERSION
+compat_symbol_reference (libm, matherr, matherr, GLIBC_2_0);
+compat_symbol_reference (libm, _LIB_VERSION, _LIB_VERSION, GLIBC_2_0);
+
 static int fail = 1;
 
 int
@@ -20,5 +45,4 @@ do_test (void)
   return fail;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
index e6fbdf139ca9259a0542534ff3007ddd3682a493..5115732a83786cb48b587ee46854cdb48d2f9723 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper acos */
index f389da19babd13566b619b760067ecd3eadff873..0bf557c9c59c51ebe2954cdd041d1d1ac6c8198a 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper acosf */
index 286ea86b899e05dd9f20e062927c9c77107133f6..31251ce760b3a69449b0ee6ae7b3c4890b97dfeb 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper acosh */
index 801a52edf0563132753c5d68dd64a7b85e85fee2..6a4482e5340cc4ce7479715487552014ff31e087 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper acoshf */
index 310f3c99544441e55af17e769e2f5f1da976c2d5..b9f66c53efb1ff49940c04a0038608b3d134266a 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper acosl */
index eaccc6646d7aa7119fb6ed4f3d843f61e8bacfd5..66600b5d38eb93af2e96bfdbad43b74663c662c2 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper acosl */
index b2ad6323eda7ddd26199c6c557c25064063e1a27..59beea817d7051779cab7166ee109cff8afc7c2a 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper asin */
index 0d0ee98f98ec3c2bc1c9dab6fdc84e64341e979e..0eb20b10b5379525d31ff2c7d4d9cc95ad89f725 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper asinf */
index a02fa1e04cf15f763f2dfc2ef6520a72b01316db..c8f4d150c67b9c3d1c131be4b462b2dee0c700c5 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper asinl */
index cceb602258b247c7be49d1095cc8a49b3688109f..fa098ffeb77c6af54b3ba48142a91ae12c61e0aa 100644 (file)
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 double
index 8343893e749e1e9e32f3608499e2d03e2f0b5d85..15e05d825367bd839e5af5915db5c0851e045a2e 100644 (file)
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 float
index b7b29ff6c3f7bde87c48a73f62a700fee0f806db..87b73948dae4dedce946d3f059e67c03799d3d36 100644 (file)
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 long double
index 456dcb34e706804eb4d96878c4e388d21bc74eaf..f7a43beb0905dce7c07a16e73024d8b2778881d9 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper atanh */
index dd14145c1c04781cd9dbd1e91208d139400eb85f..c9d2c3a3aeb174f07c1506d131f4e4962bd59c6d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper atanhf */
index 37e8da598aa1b54e28e9f9671a1c8a48b82fa14f..56f9f1ed613eb28dd9412b82c0552fca5b607009 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper atanhl */
index 0771434ec1df4ae3b118b77fcb858a100958e3c3..fd16436520451443504c374830968718520fce29 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 double
 __cosh (double x)
index dc7fb53ba30d0ed21db07fbe35ebfb770d997232..dd622816936fd0ff8d13d23579867cdd2521301c 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 float
 __coshf (float x)
index 27f0a4f4c30463fc3f5cd748def6ab75a9349710..5fa32bea880eac8655eef082ac010399e4d9df23 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 long double
 __coshl (long double x)
index 1ba9279e8b7a4268524a62d93a2a1b86b5570627..64f1d19950b32afba69709f70ab36773950d2270 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 double
 __exp10 (double x)
index 7993945900eb60ea139a4880de9878c5c9ec8436..5cf926aee26b2d02c5fbcf1e4d42fc3c7f6bcf2a 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 float
 __exp10f (float x)
index 27344686c35e6fb10d8c4a31bb6b6bc84ec0f053..06f5267a8fb436380a2a08420f17c21fb3f5b31a 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 long double
 __exp10l (long double x)
index ca17f9ea630b1f089764fe17a0c6385b776bbf1f..a4d46537085640ed3f8cd9d1b7af109afff97d60 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 double
 __exp2 (double x)
index 61cbd6cda1c5bbbe5ea48687ae3df55d9859cd30..b21fe36903a875b6a5e3cd56a02e40948fc1a427 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 float
 __exp2f (float x)
index 47aed3cb830f325e4241892285225465809b8267..04cd666b68448b6e10d2debaa51d9a5a21f77e52 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 long double
 __exp2l (long double x)
index 746550a33c735b0b8553c9cd2ffa5cf659dfc513..1079d3a6035748ee67cc405a5dd55ed7fa26edbe 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 /* wrapper fmod */
 double
index 45ece587c8883cfdbcc3dea0eb942d63e0593434..88b64a24bd5882ed61c9ca82a31156632e1f1c0e 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 /* wrapper fmodf */
 float
index 1f385bdbaee65643764b3526f3d97a9496dc3381..23422fa6525aafc5475a4fc90c2b7d73f7605399 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 /* wrapper fmodl */
 long double
index 7c662c8e40e1f3aa22a0e7c226bcefbc0a78a776..ff3774cf62e23acecb501b62640f25e040ec3406 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 double
index 0ecacae71526aaba5a6f4613039ff2a1d70d9254..0a43d90a00778b5e664ad74d95f0466e265bb992 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 float
index c784fa2c64214aabeb41e78807d4d7c33b88a637..13060f74a78a452f579d4e411de1f1ed79331242 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 long double
index e7b56f2412ac4f4533dc62d735a8b13d34825d6d..80d21acde1d0c94d9d59f7a7ffd4b8f4761470ff 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper j0 */
index 34220b90b80474e4a2f409ff7999529c3b924144..36fc4f944329941a3b7bafee515d69ba74503126 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper j0f */
index e03fa1d2236e0b38227f15e8d6eab7ef00fee496..ff7e1b145677f7f5c36b06ee760c02e6172126ac 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper j0l */
index efbe8df5e0271ffdd2847dee00bd915bab292b2c..f7a76c10d5e6fddc8a0fd5a1cd6c526bfa3b53f1 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper j1 */
index 755868594600270917ca23fa3e52962afb362290..9aa5c8c4fdaf45d2b81cab124d98d53dd7e96be8 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper j1f */
index f35261dd2addca1e75773972ac6ab108b673dc85..7e6d9f57f2693f1f35ee067a01b819b9a1f46014 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper j1l */
index 9321bf5e7deda793b158cfbe8036fcb1e3963c23..7c49992cf4cb9aa3f5b40d4900f06c742f4a04cb 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper jn */
index 9752b2a8c5811cf2db351726bd01e3eea38864e1..ead40e7a606dd8312128b685a91b89bc95e68fc9 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper jnf */
index d17b047956507c5a343b39ff71a5752b6c733ebd..bc416359c281b1518f8b751c13fc6b61e7743a58 100644 (file)
@@ -46,6 +46,7 @@ static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 long double __jnl(int n, long double x)        /* wrapper jnl */
 {
index cdea331f1a0f1c240e539d642f91eb265476d3c2..7dbba22f4efe70f55fa039518e94e707668cb719 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 #include <lgamma-compat.h>
 
index 6578b2c76cbecbe067d987db0d9789b49ae1371b..3f7fbce62bee3930540f365507bde8b797827d9b 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 double
index ba7ff0e573944e578f0316292ab9678d6cd5f26a..a3d7e1ae99c4d4faa880c5f804a8905e5b620e02 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 #include <lgamma-compat.h>
 
index d7d2cb8bc1e4f028580328b0fa67462e9cf1d211..d9601f45d7f03ea543e6ecc9cd944a5f340a5466 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 float
index c3c41f6fff4f91910d1591c47150f523b73333df..447fb97cb7244f0671f67e1c24622b2edc1267aa 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 #include <lgamma-compat.h>
 
index 7caeb1264f4395cf84189ec30ba61739f36dd49b..d1b58e42ddf50ddbe3bc81ee5ce52df8ac63e14d 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 long double
index 9704ba9cdc3dd7744025800a99f4ae7a19064cbc..6f3eb3408c5c02c0674871bf08610ad95823c0b4 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper log10(x) */
index f8921fe285ba75e3250f69b0486e7c8ff8539284..2cb5c9a1bb0dd39bb963c375e9368575b9808e87 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper log10f(x) */
index cfb514a8ab0e2cd2e5cff924ac4237675f54a30c..0063c50778829506fdf1b7353dd84246b4308529 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper log10l(x) */
index b8e842d5bed1ea19bf570c29976c0934a2372229..252fc0d86a1d1e47066a165369f2c1ffcf632950 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper log2(x) */
index 357cc0afe9ae01227d17d9fb0827b24a3e8f4365..6adaff6c7247eb1a9d879805d0b2d467cf0b80b6 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper log2f(x) */
index 3d9994e055376f748078a7a26f6b5477703333ed..f496c3630ee2ceb5b39f759b5c68b33233425c10 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper log2l(x) */
index 4b470695ae508b3c75c9824d91acfae8235ea4f8..82f3ff4eec93a0585f941f3eebb9977edbe909d3 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper log(x) */
index 8b0f4fc9d15423f06459588692598bd3b5994b3c..ac18b65c5e92198ffd1aa207999e886918fbb7c6 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper logf(x) */
index 12afbe575a52baacdf6da62774b56314b3265b19..ba65830b6754fb37dfa0917f55e0369e43240040 100644 (file)
@@ -19,6 +19,7 @@
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper logl(x) */
index 0e24b755b22bc24dd3f2cbb684c068d7b8366023..367f609dc28beeaa525375f0f01b786b8125aa3a 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper pow */
index 7e3b0150016a2c24ad85988bfbc5ee20862b855a..afc3fced8045d4d50dc205f99bddcacd0515ec6b 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper powf */
index 60a89c2b42fd478cf764a051f3dd36162c268987..b25dad870d334ac6c761eda552dc0fd8470cb960 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper powl */
index 66445901f62917eeb8f48d7fdfb64dc237135f70..27fa14f207821ce3ee41e9cb28312493fd60a758 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper remainder */
index 1db246a1c3cb0ae281f4029ecbdc475852b0bf2d..627b4f1de148ea359ad18bc66ed29e9c998faefd 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper remainderf */
index 2fc40f1992d484db537219824f44b83a9778f2ea..985847598be7d59f833189b07915b78310d8ddbf 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper remainderl */
index 8354115512d516bcb2ba496cca4441c84789cfed..a31e54dd78e7e715614d5f97e59806ce88b235af 100644 (file)
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 static double
index fe93f0ac645d2577f1e57f7fadcda0333349ee72..2b96df0cbfb3d414ff38a11db410aa6036033ca8 100644 (file)
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 static float
index 62645d4848d405aa4b3cd4e940f65f8fbee62ee3..a4a0f8e942ed2694bafe7e3c6c2d171c9a1e30e3 100644 (file)
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 static long double
index 51daf2ff35b612f140fd4e0b53432c4f701f24a0..121edfc8924a3c8e8e551be2788fd444c897bcec 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 double
 __sinh (double x)
index 0e530b1600165697919f46104d2b68639c9aa7b6..2103b06253b8287ee87e33f7ec0f046903b9020a 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 float
 __sinhf (float x)
index 7df7c0614fff7c0f8f7339b6905cb0446b047fa1..57f08e7ecc7f5715285e0293cf81ff2852efdf21 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 long double
 __sinhl (long double x)
index 018da82e7a9bee7013b664b9da56501c922c0314..743df321d5d19011ffc6a2b9509de6eb0d50187d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper sqrt */
index de5b42d8f65a802a624843b1e8983903cd58c95e..0689b4bb1a530b394fd7f75bdba0b72c05e053d7 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper sqrtf */
index b4663b71e08dda9416115d32264fcfc35c55dc90..43e81acf0a9322b2462389dfe94a47b4ac7ec8b0 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* wrapper sqrtl */
index 99b60298cabe539b725736c9c8df0c05fea8638d..93bd48fd3ffceb3da865fa5b36203a4d149977cf 100644 (file)
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 double
 __tgamma(double x)
index dfce894cc8878dc46a9ef59dddd9681fff7a3144..e6ae48c1f5ab7843784d17cfb8bdf58d86e74656 100644 (file)
@@ -16,6 +16,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 float
 __tgammaf(float x)
index 50de8cf90675c0e109f80e80e1651cc05bd69278..306f672077ab03c30e09dfe0a148339ef6c40f22 100644 (file)
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 long double
 __tgammal(long double x)
index 4d962e1d09f445cce97a87e1f7d4a3c11e5965fd..80c7c9210886488d16e20cbe4405ffebe7641cce 100644 (file)
@@ -249,11 +249,6 @@ fabsf128 (_Float128 x)
 
 
 
-/* fdlibm kernel function */
-extern double __kernel_standard (double,double,int);
-extern float __kernel_standard_f (float,float,int);
-extern long double __kernel_standard_l (long double,long double,int);
-
 /* Prototypes for functions of the IBM Accurate Mathematical Library.  */
 extern double __exp1 (double __x, double __xx, double __error);
 extern double __sin (double __x);
index a9307dd4b5fdcc639d21cbc73de316412b6e26a5..34d1466e09e748cb1a09521dac65746d9e334908 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include "libm_support.h"
+#include <math-svid-compat.h>
 
 #ifdef _LIBC
 # define pmatherr matherr
 # define pmatherrf matherrf
 # define pmatherrl matherrl
+# if LIBM_SVID_COMPAT
+compat_symbol_reference (libm, matherrf, matherrf, GLIBC_2_2_3);
+compat_symbol_reference (libm, matherrl, matherrl, GLIBC_2_2_3);
+# else
+#  define matherrf(EXC) ((void) (EXC), 0)
+#  define matherrl(EXC) ((void) (EXC), 0)
+# endif
 #else
 _LIB_VERSION_TYPE
 #if defined( __POSIX__ )
index dc9c0a2648447087020ed7f54f86059565badf9b..4e7a66799db13a6e9f41dd4d18e72d5e71d527ea 100644 (file)
@@ -83,6 +83,8 @@
 #ifndef __LIBM_SUPPORT_H_INCLUDED__
 #define __LIBM_SUPPORT_H_INCLUDED__
 
+#include <math-svid-compat.h>
+
 #ifndef _LIBC
 #if !(defined(_WIN32) || defined(_WIN64))
 # pragma const_seg(".rodata") /* place constant data in text (code) section */
@@ -156,36 +158,8 @@ struct exceptionl
 #endif
 
 extern int MATHERR_F(struct exceptionf*);
-extern int MATHERR_D(struct EXC_DECL_D*);
 extern int matherrl(struct exceptionl*);
 
-#ifndef _LIBC
-// Add code to support _LIB_VERSIONIMF
-typedef enum
-{
-    _IEEE_ = -1, // IEEE-like behavior
-    _SVID_,      // SysV, Rel. 4 behavior
-    _XOPEN_,     // Unix98
-    _POSIX_,     // Posix
-    _ISOC_       // ISO C9X
-} _LIB_VERSION_TYPE;
-#endif
-
-// This is a run-time variable and may affect
-// floating point behavior of the libm functions
-
-#if !defined( LIBM_BUILD )
-#if defined( _DLL )
-extern _LIB_VERSION_TYPE __declspec(dllimport) _LIB_VERSIONIMF;
-#else
-extern _LIB_VERSION_TYPE _LIB_VERSIONIMF;
-#endif  /* _DLL */
-#else
-extern int (*pmatherrf)(struct exceptionf*);
-extern int (*pmatherr)(struct EXC_DECL_D*);
-extern int (*pmatherrl)(struct exceptionl*);
-#endif  /* LIBM_BUILD */
-
 /* memory format definitions (LITTLE_ENDIAN only) */
 
 #if !(defined(SIZE_INT_32) || defined(SIZE_INT_64))
@@ -1031,15 +1005,6 @@ struct ker80 {
 #endif
 
 
-/* error codes */
-
-#define DOMAIN     1   /* argument domain error */
-#define SING       2   /* argument singularity */
-#define OVERFLOW   3   /* overflow range error */
-#define UNDERFLOW  4   /* underflow range error */
-#define TLOSS      5   /* total loss of precision */
-#define PLOSS      6   /* partial loss of precision */
-
 /* */
 
 #define VOLATILE_32 /*volatile*/
index a47d4b89a20db33a57309c87f65b597bc315a7de..5808c04573b858bc09c8dc3ad27ee97cc97d1fba 100644 (file)
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 #include "libm_support.h"
 
+#if LIBM_SVID_COMPAT
 int
 weak_function
 __matherrf(struct exceptionf *x)
@@ -23,4 +25,5 @@ __matherrf(struct exceptionf *x)
        if(x->arg1!=x->arg1) return 0;
        return n;
 }
-weak_alias (__matherrf, matherrf)
+compat_symbol (libm, __matherrf, matherrf, GLIBC_2_2_3);
+#endif
index 6fe92d773906c3918c9508ee541cd3e7328fdebb..dc64b31e50e1b4059f9633eb498ba3a934d1b2bd 100644 (file)
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 #include "libm_support.h"
 
+#if LIBM_SVID_COMPAT
 int
 weak_function
 __matherrl(struct exceptionl *x)
@@ -23,4 +25,5 @@ __matherrl(struct exceptionl *x)
        if(x->arg1!=x->arg1) return 0;
        return n;
 }
-weak_alias (__matherrl, matherrl)
+compat_symbol (libm, __matherrl, matherrl, GLIBC_2_2_3);
+#endif
index e61e03b3356803394d9f1fd9fb8fe88821686974..69ec0a1ebc3169972b77cc44b67b334904d443a6 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 /* wrapper exp */
 double
index b2be6aa7e1f8c028def3c9958091a2c82eec4af4..8a1fa51e46e923c0e1e79648d9264e8caa4efc52 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 /* wrapper expf */
 float
index b100b3e3519e174e215e4a876319c7c5d7ecac9f..0a0201f1d5034018bfb13603049d8c6634b24dd5 100644 (file)
@@ -16,6 +16,7 @@ static char rcsid[] = "$NetBSD: k_standard.c,v 1.6 1995/05/10 20:46:35 jtc Exp $
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 #include <errno.h>
 
 #include <assert.h>
index 678b38d91a01768d0667a700740e33bdc482ea55..85b2003daff20ec41fa105a64d66bd0a93209dfc 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 
 /* Handle errors for a libm function as specified by TYPE (see
index 08d789f942ffe0b9e26963274c343ec84dfce698..783fd0b87dff5df4246860f6de6d7d2a46d6bdbb 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 #include <fenv.h>
 #include <float.h>
 #include <errno.h>
index c32616e504cce255bd6a3dcff6740f7805eefe92..e0fa9e350182ea48cc8376c68e8b7d4ecb714703 100644 (file)
@@ -24,6 +24,7 @@ static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 long double __expl(long double x)      /* wrapper exp */
 {
index c9d44b61ddf77d39f712e407d4dfffea91ed5444..019a48fb0d5133a39a6cde07397a7cf8b1cb220b 100644 (file)
@@ -1,5 +1,6 @@
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 #include <math_ldbl_opt.h>
 
 long double __expl(long double x)      /* wrapper exp  */
index a0b852a3e273423bd0561c33f7a7dc03fcd2bc7c..c9e6003a43096e12956b34c0e4a297d1f5a265e4 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <math-svid-compat.h>
 
 /* wrapper expl */
 long double
index bb59300953fd4aa90736fc36f1da9500b7fd9e47..f11d1c31f66ce217cb2945d159f9eeead6f491d7 100644 (file)
@@ -18,24 +18,18 @@ static char rcsid[] = "$NetBSD: s_lib_version.c,v 1.6 1995/05/10 20:47:44 jtc Ex
  * MACRO for standards
  */
 
-#include <math.h>
-#include <math_private.h>
+#include <math-svid-compat.h>
 
 /*
  * define and initialize _LIB_VERSION
  */
-#ifdef _POSIX_MODE
+#undef _LIB_VERSION
+#if LIBM_SVID_COMPAT || !defined SHARED
 _LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _POSIX_;
-#else
-#ifdef _XOPEN_MODE
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _XOPEN_;
-#else
-#ifdef _SVID3_MODE
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _SVID_;
-#else                                  /* default _IEEE_MODE */
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _IEEE_;
 #endif
-#endif
-#endif
-
+#if LIBM_SVID_COMPAT
+compat_symbol (libm, _LIB_VERSION_INTERNAL, _LIB_VERSION, GLIBC_2_0);
+#elif !defined SHARED
+/* For use in .S wrappers.  */
 weak_alias (_LIB_VERSION_INTERNAL, _LIB_VERSION)
+#endif
index d5dc6f122dfcee8f14ad581e73683934dd82659d..5eacdd51c6789f7bfcd730cb9c20031e9e900ae7 100644 (file)
 static char rcsid[] = "$NetBSD: s_matherr.c,v 1.6 1995/05/10 20:47:53 jtc Exp $";
 #endif
 
-#include <math.h>
-#include <math_private.h>
+#include <math-svid-compat.h>
 
+#undef matherr
+#if LIBM_SVID_COMPAT
 int
 weak_function
 __matherr(struct exception *x)
@@ -25,4 +26,5 @@ __matherr(struct exception *x)
        if(x->arg1!=x->arg1) return 0;
        return n;
 }
-weak_alias (__matherr, matherr)
+compat_symbol (libm, __matherr, matherr, GLIBC_2_0);
+#endif
index bb896a33cd01a1a9a797223bb4f715ee9be643fa..82e3baffd44c59b0d9613cc450838092dc162528 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
+#include <math-svid-compat.h>
 
 /* double [fp1] sqrt (double x [fp1])
    Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
index c304ab5ca24839e662046be549b932da501da173..0c663529e99902b6f503851c131bde4e1bc122f6 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
+#include <math-svid-compat.h>
 
 /* float [fp1] sqrts (float x [fp1])
    Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
index 93625c5aa9ea1b0fa01209a86739d9245a49c116..ecefdc328398a8d7397694ef890616a308d29fa6 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
+#include <math-svid-compat.h>
 
 /* double [fp1] sqrt (double x [fp1])
    Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
index 2ca86b6155e1cb58fb511d2cc197dc7a12962b6f..9ae0c5f47da3c4d3cbbd2b09e138a3c7add7bb11 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
+#include <math-svid-compat.h>
 
 /* float [fp1] sqrts (float x [fp1])
    Power4 (ISA V2.0) and above implement sqrt in hardware (not optional).
index 703f228766757c415dbfbe75ce41ebf5a7437564..cca76541e413e1f3622da7a8b8158ff01a71906d 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrt)
        clr     %g1
index 05d1160378cde307bc388d96c830d8fbf79aacb3..34f6113a0bb8931108c2a6a1b71beafc5d536166 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrtf)
        st      %g0, [%sp + 68]
index 06ff449150aa19e90ef9c6e4a37ebed21990285d..a3a642fba69e1be943a3b4a1da766dc3371d0d37 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrt_vis3)
        movwtos %o0, %f0
index 5b21523fc0a09fa8460c09405ba10be7532f3d04..8cd160765a73db295cf955f630877d03899d7336 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrtf_vis3)
        movwtos %o0, %f0
index 4415a82024a90bc7a5763b86c487ce6730111945..f3003da14f24f5f93684eb186370b12dc95751b6 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrt)
        std     %o0, [%sp + 80]
index 1c3c97f8e9b016faf3087150cf1389f6498fc947..7a102de3ddc41f0a76a98bc4c654c0a3b6e6d6a7 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrtf)
        st      %o0, [%sp + 72]
index de95e52e8e83b4e0e8fbbe0af3e5b6bd7ed94cb0..937e15009e794cee9a32e8f1f38ae8d1fdda113c 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrt)
        fzero   %f8
index 0c253fe43a88bc3a0b0c7cca99efc4e8f5e08350..875ed3b3b2fe7767b8f1e98b7a30da594ab5c150 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math-svid-compat.h>
 
 ENTRY (__sqrtf)
        fzeros  %f8