diff options
Diffstat (limited to 'math')
-rw-r--r-- | math/Versions | 2 | ||||
-rw-r--r-- | math/w_log2.c | 8 | ||||
-rw-r--r-- | math/w_log2_compat.c | 20 |
3 files changed, 26 insertions, 4 deletions
diff --git a/math/Versions b/math/Versions index 87aa6590ed..a887602f2f 100644 --- a/math/Versions +++ b/math/Versions @@ -577,6 +577,6 @@ libm { } GLIBC_2.29 { # No SVID compatible error handling. - exp; exp2; log; + exp; exp2; log; log2; } } diff --git a/math/w_log2.c b/math/w_log2.c new file mode 100644 index 0000000000..148d5d48e1 --- /dev/null +++ b/math/w_log2.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_log2_template.c> +versioned_symbol (libm, __log2, log2, GLIBC_2_29); +libm_alias_double_other (__log2, log2) diff --git a/math/w_log2_compat.c b/math/w_log2_compat.c index 61e7170ae1..4459ce275f 100644 --- a/math/w_log2_compat.c +++ b/math/w_log2_compat.c @@ -23,10 +23,12 @@ #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) /* wrapper log2(x) */ double -__log2 (double x) +__log2_compat (double x) { if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_) { @@ -44,5 +46,17 @@ __log2 (double x) return __ieee754_log2 (x); } -libm_alias_double (__log2, log2) +# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_29) +compat_symbol (libm, __log2_compat, log2, GLIBC_2_1); +# endif +# ifdef NO_LONG_DOUBLE +weak_alias (__log2_compat, log2l) +# endif +# ifdef LONG_DOUBLE_COMPAT +/* Work around gas bug "multiple versions for symbol". */ +weak_alias (__log2_compat, __log2_compat_alias) + +LONG_DOUBLE_COMPAT_CHOOSE_libm_log2l ( + compat_symbol (libm, __log2_compat_alias, log2l, FIRST_VERSION_libm_log2l), ); +# endif #endif |