mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 10:30:52 +00:00
compat: add interface overrides for libm
wraps pow.3 exp.3 and log.3 to explicitly use backward compatible glibc symbols. this is needed to stay compatible with old linux versions with minor releases
This commit is contained in:
parent
f449518940
commit
87b1dc9300
@ -504,7 +504,10 @@ if test x$use_glibc_compat != xno; then
|
||||
AC_MSG_RESULT($fdelt_type)
|
||||
AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=exp]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=exp"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=pow]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=pow"])
|
||||
else
|
||||
AC_SEARCH_LIBS([clock_gettime],[rt])
|
||||
fi
|
||||
|
||||
@ -73,3 +73,45 @@ extern "C" float __wrap_log2f(float x)
|
||||
{
|
||||
return log2f_old(x);
|
||||
}
|
||||
|
||||
extern "C" double exp_old(double x);
|
||||
#ifdef __i386__
|
||||
__asm(".symver exp_old,exp@GLIBC_2.0");
|
||||
#elif defined(__amd64__)
|
||||
__asm(".symver exp_old,exp@GLIBC_2.2.5");
|
||||
#elif defined(__arm__)
|
||||
__asm(".symver exp_old,exp@GLIBC_2.4");
|
||||
#elif defined(__aarch64__)
|
||||
__asm(".symver exp_old,exp@GLIBC_2.17");
|
||||
#endif
|
||||
extern "C" double __wrap_exp(double x) {
|
||||
return exp_old(x);
|
||||
}
|
||||
|
||||
extern "C" double log_old(double x);
|
||||
#ifdef __i386__
|
||||
__asm(".symver log_old,log@GLIBC_2.0");
|
||||
#elif defined(__amd64__)
|
||||
__asm(".symver log_old,log@GLIBC_2.2.5");
|
||||
#elif defined(__arm__)
|
||||
__asm(".symver log_old,log@GLIBC_2.4");
|
||||
#elif defined(__aarch64__)
|
||||
__asm(".symver log_old,log@GLIBC_2.17");
|
||||
#endif
|
||||
extern "C" double __wrap_log(double x) {
|
||||
return log_old(x);
|
||||
}
|
||||
|
||||
extern "C" double pow_old(double x, double y);
|
||||
#ifdef __i386__
|
||||
__asm(".symver pow_old,pow@GLIBC_2.0");
|
||||
#elif defined(__amd64__)
|
||||
__asm(".symver pow_old,pow@GLIBC_2.2.5");
|
||||
#elif defined(__arm__)
|
||||
__asm(".symver pow_old,pow@GLIBC_2.4");
|
||||
#elif defined(__aarch64__)
|
||||
__asm(".symver pow_old,pow@GLIBC_2.17");
|
||||
#endif
|
||||
extern "C" double __wrap_pow(double x, double y) {
|
||||
return pow_old(x,y);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user