aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/math_private.h5
-rw-r--r--sysdeps/ia64/fpu/libm_error.c8
-rw-r--r--sysdeps/ia64/fpu/libm_support.h39
-rw-r--r--sysdeps/ia64/fpu/s_matherrf.c5
-rw-r--r--sysdeps/ia64/fpu/s_matherrl.c5
-rw-r--r--sysdeps/ieee754/dbl-64/w_exp_compat.c1
-rw-r--r--sysdeps/ieee754/flt-32/w_expf_compat.c1
-rw-r--r--sysdeps/ieee754/k_standard.c1
-rw-r--r--sysdeps/ieee754/k_standardf.c1
-rw-r--r--sysdeps/ieee754/k_standardl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128/w_expl_compat.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c1
-rw-r--r--sysdeps/ieee754/ldbl-96/w_expl_compat.c1
-rw-r--r--sysdeps/ieee754/s_lib_version.c22
-rw-r--r--sysdeps/ieee754/s_matherr.c8
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S1
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S1
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S1
-rw-r--r--sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S1
-rw-r--r--sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S1
-rw-r--r--sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S1
-rw-r--r--sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S1
-rw-r--r--sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S1
27 files changed, 51 insertions, 61 deletions
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 4d962e1d09..80c7c92108 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -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);
diff --git a/sysdeps/ia64/fpu/libm_error.c b/sysdeps/ia64/fpu/libm_error.c
index a9307dd4b5..34d1466e09 100644
--- a/sysdeps/ia64/fpu/libm_error.c
+++ b/sysdeps/ia64/fpu/libm_error.c
@@ -91,11 +91,19 @@
#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__ )
diff --git a/sysdeps/ia64/fpu/libm_support.h b/sysdeps/ia64/fpu/libm_support.h
index dc9c0a2648..4e7a66799d 100644
--- a/sysdeps/ia64/fpu/libm_support.h
+++ b/sysdeps/ia64/fpu/libm_support.h
@@ -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*/
diff --git a/sysdeps/ia64/fpu/s_matherrf.c b/sysdeps/ia64/fpu/s_matherrf.c
index a47d4b89a2..5808c04573 100644
--- a/sysdeps/ia64/fpu/s_matherrf.c
+++ b/sysdeps/ia64/fpu/s_matherrf.c
@@ -13,8 +13,10 @@
#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
diff --git a/sysdeps/ia64/fpu/s_matherrl.c b/sysdeps/ia64/fpu/s_matherrl.c
index 6fe92d7739..dc64b31e50 100644
--- a/sysdeps/ia64/fpu/s_matherrl.c
+++ b/sysdeps/ia64/fpu/s_matherrl.c
@@ -13,8 +13,10 @@
#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
diff --git a/sysdeps/ieee754/dbl-64/w_exp_compat.c b/sysdeps/ieee754/dbl-64/w_exp_compat.c
index e61e03b335..69ec0a1ebc 100644
--- a/sysdeps/ieee754/dbl-64/w_exp_compat.c
+++ b/sysdeps/ieee754/dbl-64/w_exp_compat.c
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper exp */
double
diff --git a/sysdeps/ieee754/flt-32/w_expf_compat.c b/sysdeps/ieee754/flt-32/w_expf_compat.c
index b2be6aa7e1..8a1fa51e46 100644
--- a/sysdeps/ieee754/flt-32/w_expf_compat.c
+++ b/sysdeps/ieee754/flt-32/w_expf_compat.c
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper expf */
float
diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c
index b100b3e351..0a0201f1d5 100644
--- a/sysdeps/ieee754/k_standard.c
+++ b/sysdeps/ieee754/k_standard.c
@@ -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>
diff --git a/sysdeps/ieee754/k_standardf.c b/sysdeps/ieee754/k_standardf.c
index 678b38d91a..85b2003daf 100644
--- a/sysdeps/ieee754/k_standardf.c
+++ b/sysdeps/ieee754/k_standardf.c
@@ -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
diff --git a/sysdeps/ieee754/k_standardl.c b/sysdeps/ieee754/k_standardl.c
index 08d789f942..783fd0b87d 100644
--- a/sysdeps/ieee754/k_standardl.c
+++ b/sysdeps/ieee754/k_standardl.c
@@ -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>
diff --git a/sysdeps/ieee754/ldbl-128/w_expl_compat.c b/sysdeps/ieee754/ldbl-128/w_expl_compat.c
index c32616e504..e0fa9e3501 100644
--- a/sysdeps/ieee754/ldbl-128/w_expl_compat.c
+++ b/sysdeps/ieee754/ldbl-128/w_expl_compat.c
@@ -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 */
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c b/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c
index c9d44b61dd..019a48fb0d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c
@@ -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 */
diff --git a/sysdeps/ieee754/ldbl-96/w_expl_compat.c b/sysdeps/ieee754/ldbl-96/w_expl_compat.c
index a0b852a3e2..c9e6003a43 100644
--- a/sysdeps/ieee754/ldbl-96/w_expl_compat.c
+++ b/sysdeps/ieee754/ldbl-96/w_expl_compat.c
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper expl */
long double
diff --git a/sysdeps/ieee754/s_lib_version.c b/sysdeps/ieee754/s_lib_version.c
index bb59300953..f11d1c31f6 100644
--- a/sysdeps/ieee754/s_lib_version.c
+++ b/sysdeps/ieee754/s_lib_version.c
@@ -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
diff --git a/sysdeps/ieee754/s_matherr.c b/sysdeps/ieee754/s_matherr.c
index d5dc6f122d..5eacdd51c6 100644
--- a/sysdeps/ieee754/s_matherr.c
+++ b/sysdeps/ieee754/s_matherr.c
@@ -14,9 +14,10 @@
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
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S
index bb896a33cd..82e3baffd4 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S
@@ -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).
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S
index c304ab5ca2..0c663529e9 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S
@@ -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).
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S
index 93625c5aa9..ecefdc3283 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S
@@ -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).
diff --git a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S
index 2ca86b6155..9ae0c5f47d 100644
--- a/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S
+++ b/sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S
@@ -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).
diff --git a/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S b/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S
index 703f228766..cca76541e4 100644
--- a/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S
+++ b/sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt)
clr %g1
diff --git a/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S b/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S
index 05d1160378..34f6113a0b 100644
--- a/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S
+++ b/sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf)
st %g0, [%sp + 68]
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S
index 06ff449150..a3a642fba6 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt_vis3)
movwtos %o0, %f0
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S
index 5b21523fc0..8cd160765a 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf_vis3)
movwtos %o0, %f0
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S
index 4415a82024..f3003da14f 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt)
std %o0, [%sp + 80]
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S
index 1c3c97f8e9..7a102de3dd 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf)
st %o0, [%sp + 72]
diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S b/sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S
index de95e52e8e..937e15009e 100644
--- a/sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S
+++ b/sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt)
fzero %f8
diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S b/sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S
index 0c253fe43a..875ed3b3b2 100644
--- a/sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S
+++ b/sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf)
fzeros %f8