diff options
Diffstat (limited to 'math')
-rw-r--r-- | math/Versions | 4 | ||||
-rw-r--r-- | math/w_exp.c | 8 | ||||
-rw-r--r-- | math/w_exp2.c | 8 | ||||
-rw-r--r-- | math/w_exp2_compat.c | 20 | ||||
-rw-r--r-- | math/w_exp_compat.c | 21 |
5 files changed, 54 insertions, 7 deletions
diff --git a/math/Versions b/math/Versions index b5a2500..29e02d6 100644 --- a/math/Versions +++ b/math/Versions @@ -575,4 +575,8 @@ libm { f32xsubf64x; f32xsubf128; f64subf64x; f64subf128; f64xsubf128; } + GLIBC_2.29 { + # No SVID compatible error handling. + exp; exp2; + } } diff --git a/math/w_exp.c b/math/w_exp.c new file mode 100644 index 0000000..9a18bd5 --- /dev/null +++ b/math/w_exp.c @@ -0,0 +1,8 @@ +#include <math-type-macros-double.h> +#undef __USE_WRAPPER_TEMPLATE +#define __USE_WRAPPER_TEMPLATE 1 +#undef declare_mgen_alias +#define declare_mgen_alias(a, b) +#include <w_exp_template.c> +versioned_symbol (libm, __exp, exp, GLIBC_2_29); +libm_alias_double_other (__exp, exp) diff --git a/math/w_exp2.c b/math/w_exp2.c new file mode 100644 index 0000000..6c84871 --- /dev/null +++ b/math/w_exp2.c @@ -0,0 +1,8 @@ +#include <math-type-macros-double.h> +#undef __USE_WRAPPER_TEMPLATE +#define __USE_WRAPPER_TEMPLATE 1 +#undef declare_mgen_alias +#define declare_mgen_alias(a, b) +#include <w_exp2_template.c> +versioned_symbol (libm, __exp2, exp2, GLIBC_2_29); +libm_alias_double_other (__exp2, exp2) diff --git a/math/w_exp2_compat.c b/math/w_exp2_compat.c index 7ab6182..567383d 100644 --- a/math/w_exp2_compat.c +++ b/math/w_exp2_compat.c @@ -7,9 +7,11 @@ #include <math-svid-compat.h> #include <libm-alias-double.h> -#if LIBM_SVID_COMPAT +#if LIBM_SVID_COMPAT && (SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_29) \ + || defined NO_LONG_DOUBLE \ + || defined LONG_DOUBLE_COMPAT) double -__exp2 (double x) +__exp2_compat (double x) { double z = __ieee754_exp2 (x); if (__builtin_expect (!isfinite (z) || z == 0, 0) @@ -19,5 +21,17 @@ __exp2 (double x) return z; } -libm_alias_double (__exp2, exp2) +# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_29) +compat_symbol (libm, __exp2_compat, exp2, GLIBC_2_1); +# endif +# ifdef NO_LONG_DOUBLE +weak_alias (__exp2_compat, exp2l) +# endif +# ifdef LONG_DOUBLE_COMPAT +/* Work around gas bug "multiple versions for symbol". */ +weak_alias (__exp2_compat, __exp2_compat_alias) + +LONG_DOUBLE_COMPAT_CHOOSE_libm_exp2l ( + compat_symbol (libm, __exp2_compat_alias, exp2l, FIRST_VERSION_libm_exp2l), ); +# endif #endif diff --git a/math/w_exp_compat.c b/math/w_exp_compat.c index ccda100..df0137c 100644 --- a/math/w_exp_compat.c +++ b/math/w_exp_compat.c @@ -21,10 +21,12 @@ #include <math-svid-compat.h> #include <libm-alias-double.h> -#if LIBM_SVID_COMPAT +#if LIBM_SVID_COMPAT && (SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_29) \ + || defined NO_LONG_DOUBLE \ + || defined LONG_DOUBLE_COMPAT) /* wrapper exp */ double -__exp (double x) +__exp_compat (double x) { double z = __ieee754_exp (x); if (__builtin_expect (!isfinite (z) || z == 0, 0) @@ -33,6 +35,17 @@ __exp (double x) return z; } -libm_hidden_def (__exp) -libm_alias_double (__exp, exp) +# if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_29) +compat_symbol (libm, __exp_compat, exp, GLIBC_2_0); +# endif +# ifdef NO_LONG_DOUBLE +weak_alias (__exp_compat, expl) +# endif +# ifdef LONG_DOUBLE_COMPAT +/* Work around gas bug "multiple versions for symbol". */ +weak_alias (__exp_compat, __exp_compat_alias) + +LONG_DOUBLE_COMPAT_CHOOSE_libm_expl ( + compat_symbol (libm, __exp_compat_alias, expl, FIRST_VERSION_libm_expl), ); +# endif #endif |