From 7b5af2d8f2a2b858319a792678b15a0db08764c7 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 4 Sep 2019 08:18:57 +0200 Subject: Finish move of clock_* functions to libc. [BZ #24959] In glibc 2.17, the functions clock_getcpuclockid, clock_getres, clock_gettime, clock_nanosleep, and clock_settime were moved from librt.so to libc.so, leaving compatibility stubs behind. Now that the dynamic linker no longer insists on finding versioned symbols in the same library that originally defined them, we do not need the stubs anymore, and this means we don't need GLIBC_PRIVATE __-prefix aliases for most of the functions anymore either. (clock_gettime still needs one.) For ports added before 2.17, libc.so needs to provide two symbol versions for each, the default at GLIBC_2.17 plus a compat version matching what librt had. While I'm at it, move the clock_*.c files and their tests from rt/ to time/. --- sysdeps/posix/clock_getres.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sysdeps/posix') diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c index 01024a3f55..e529cadb1f 100644 --- a/sysdeps/posix/clock_getres.c +++ b/sysdeps/posix/clock_getres.c @@ -22,7 +22,7 @@ #include #include #include - +#include static inline int realtime_getres (struct timespec *res) @@ -62,4 +62,11 @@ __clock_getres (clockid_t clock_id, struct timespec *res) return retval; } -weak_alias (__clock_getres, clock_getres) + +versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17); +/* clock_getres moved to libc in version 2.17; + old binaries may expect the symbol version it had in librt. */ +#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) +strong_alias (__clock_getres, __clock_getres_2); +compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2); +#endif -- cgit 1.4.1