@@ -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]
@@ -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
@@ -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)
@@ -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:
@@ -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),\
deleted file mode 100644
@@ -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_;
@@ -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
@@ -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)
{
new file mode 100644
@@ -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. */
@@ -497,70 +497,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. */
new file mode 100644
@@ -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>
new file mode 100644
@@ -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>
@@ -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>
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper acos */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper acosf */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper acosh */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper acoshf */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper acosl */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper acosl */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper asin */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper asinf */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper asinl */
@@ -23,6 +23,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
@@ -23,6 +23,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
@@ -23,6 +23,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
long double
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper atanh */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper atanhf */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper atanhl */
@@ -16,6 +16,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
__cosh (double x)
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
__coshf (float x)
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
long double
__coshl (long double x)
@@ -23,6 +23,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
__exp10 (double x)
@@ -23,6 +23,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
__exp10f (float x)
@@ -23,6 +23,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
long double
__exp10l (long double x)
@@ -4,6 +4,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
__exp2 (double x)
@@ -4,6 +4,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
__exp2f (float x)
@@ -4,6 +4,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
long double
__exp2l (long double x)
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper fmod */
double
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper fmodf */
float
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper fmodl */
long double
@@ -16,6 +16,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
long double
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper j0 */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper j0f */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper j0l */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper j1 */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper j1f */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper j1l */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper jn */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper jnf */
@@ -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 */
{
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include <lgamma-compat.h>
@@ -16,6 +16,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
@@ -15,6 +15,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include <lgamma-compat.h>
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include <lgamma-compat.h>
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
long double
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper log10(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper log10f(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper log10l(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper log2(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper log2f(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper log2l(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper log(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper logf(x) */
@@ -19,6 +19,7 @@
#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper logl(x) */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper pow */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper powf */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper powl */
@@ -18,6 +18,8 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
+#include <math-svid-compat.h>
/* wrapper remainder */
@@ -18,6 +18,8 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
+#include <math-svid-compat.h>
/* wrapper remainderf */
@@ -18,6 +18,8 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
+#include <math-svid-compat.h>
/* wrapper remainderl */
@@ -19,6 +19,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
static double
@@ -19,6 +19,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
static float
@@ -19,6 +19,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
static long double
@@ -16,6 +16,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
__sinh (double x)
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
__sinhf (float x)
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
long double
__sinhl (long double x)
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper sqrt */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper sqrtf */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper sqrtl */
@@ -18,6 +18,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
double
__tgamma(double x)
@@ -16,6 +16,7 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
float
__tgammaf(float x)
@@ -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)
@@ -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);
@@ -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__ )
@@ -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*/
@@ -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
@@ -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
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper exp */
double
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper expf */
float
@@ -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>
@@ -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
@@ -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>
@@ -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 */
{
@@ -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 */
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
/* wrapper expl */
long double
@@ -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
@@ -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
@@ -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).
@@ -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).
@@ -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).
@@ -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).
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt)
clr %g1
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf)
st %g0, [%sp + 68]
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt_vis3)
movwtos %o0, %f0
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf_vis3)
movwtos %o0, %f0
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt)
std %o0, [%sp + 80]
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf)
st %o0, [%sp + 72]
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrt)
fzero %f8
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math-svid-compat.h>
ENTRY (__sqrtf)
fzeros %f8