summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/Versions2
-rw-r--r--math/w_log.c8
-rw-r--r--math/w_log_compat.c20
3 files changed, 26 insertions, 4 deletions
diff --git a/math/Versions b/math/Versions
index 29e02d6654..87aa6590ed 100644
--- a/math/Versions
+++ b/math/Versions
@@ -577,6 +577,6 @@ libm {
}
GLIBC_2.29 {
# No SVID compatible error handling.
- exp; exp2;
+ exp; exp2; log;
}
}
diff --git a/math/w_log.c b/math/w_log.c
new file mode 100644
index 0000000000..50065e302f
--- /dev/null
+++ b/math/w_log.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_log_template.c>
+versioned_symbol (libm, __log, log, GLIBC_2_29);
+libm_alias_double_other (__log, log)
diff --git a/math/w_log_compat.c b/math/w_log_compat.c
index 5413b8e8df..d99dd4f689 100644
--- a/math/w_log_compat.c
+++ b/math/w_log_compat.c
@@ -23,10 +23,12 @@
#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 log(x) */
double
-__log (double x)
+__log_compat (double x)
{
if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
{
@@ -44,5 +46,17 @@ __log (double x)
return __ieee754_log (x);
}
-libm_alias_double (__log, log)
+# if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_29)
+compat_symbol (libm, __log_compat, log, GLIBC_2_0);
+# endif
+# ifdef NO_LONG_DOUBLE
+weak_alias (__log_compat, logl)
+# endif
+# ifdef LONG_DOUBLE_COMPAT
+/* Work around gas bug "multiple versions for symbol". */
+weak_alias (__log_compat, __log_compat_alias)
+
+LONG_DOUBLE_COMPAT_CHOOSE_libm_logl (
+ compat_symbol (libm, __log_compat_alias, logl, FIRST_VERSION_libm_logl), );
+# endif
#endif