mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 10:30:52 +00:00
compat: wrap clock_gettime
wraps librt clock_gettime for backward compatibility with glibc versions < 2.17.
This commit is contained in:
parent
87b1dc9300
commit
99cbe5129a
@ -503,6 +503,7 @@ if test x$use_glibc_compat != xno; then
|
||||
[ fdelt_type="long int"])
|
||||
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=clock_gettime]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=clock_gettime"])
|
||||
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"])
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(HAVE_SYS_SELECT_H)
|
||||
#include <sys/select.h>
|
||||
@ -115,3 +116,17 @@ __asm(".symver pow_old,pow@GLIBC_2.17");
|
||||
extern "C" double __wrap_pow(double x, double y) {
|
||||
return pow_old(x,y);
|
||||
}
|
||||
|
||||
extern "C" int clock_gettime_old(clockid_t a, struct timespec *b);
|
||||
#ifdef __i386__
|
||||
__asm(".symver clock_gettime_old,clock_gettime@GLIBC_2.2");
|
||||
#elif defined(__amd64__)
|
||||
__asm(".symver clock_gettime_old,clock_gettime@GLIBC_2.2.5");
|
||||
#elif defined(__arm__)
|
||||
__asm(".symver clock_gettime_old,clock_gettime@GLIBC_2.4");
|
||||
#elif defined(__aarch64__)
|
||||
__asm(".symver clock_gettime_old,clock_gettime@GLIBC_2.17");
|
||||
#endif
|
||||
extern "C" int __wrap_clock_gettime(clockid_t a, struct timespec *b) {
|
||||
return clock_gettime_old(a, b);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user