b9ae585
commit 7b5af2d8f2a2b858319a792678b15a0db08764c7
b9ae585
Author: Zack Weinberg <zackw@panix.com>
b9ae585
Date:   Wed Sep 4 08:18:57 2019 +0200
b9ae585
b9ae585
    Finish move of clock_* functions to libc. [BZ #24959]
b9ae585
    
b9ae585
    In glibc 2.17, the functions clock_getcpuclockid, clock_getres,
b9ae585
    clock_gettime, clock_nanosleep, and clock_settime were moved from
b9ae585
    librt.so to libc.so, leaving compatibility stubs behind.  Now that the
b9ae585
    dynamic linker no longer insists on finding versioned symbols in the
b9ae585
    same library that originally defined them, we do not need the stubs
b9ae585
    anymore, and this means we don't need GLIBC_PRIVATE __-prefix aliases
b9ae585
    for most of the functions anymore either.  (clock_gettime still needs
b9ae585
    one.)  For ports added before 2.17, libc.so needs to provide two
b9ae585
    symbol versions for each, the default at GLIBC_2.17 plus a compat
b9ae585
    version matching what librt had.
b9ae585
    
b9ae585
    While I'm at it, move the clock_*.c files and their tests from rt/ to
b9ae585
    time/.
b9ae585
b9ae585
Conflicts:
b9ae585
	sysdeps/unix/sysv/linux/arm/le/libc.abilist
b9ae585
	sysdeps/unix/sysv/linux/arm/le/librt.abilist
b9ae585
	sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
b9ae585
	sysdeps/unix/sysv/linux/sh/le/libc.abilist
b9ae585
	sysdeps/unix/sysv/linux/sh/le/librt.abilist
b9ae585
	  (Upstream split in to be/le ABI lists.  Changes applied to
b9ae585
	  the shared ABI list.)
b9ae585
	time/Makefile
b9ae585
	  (Missing test backport.)
b9ae585
b9ae585
diff --git a/include/time.h b/include/time.h
b9ae585
index f935e9dd3e07daa4..25453a330013f701 100644
b9ae585
--- a/include/time.h
b9ae585
+++ b/include/time.h
b9ae585
@@ -16,12 +16,10 @@ libc_hidden_proto (localtime)
b9ae585
 libc_hidden_proto (strftime)
b9ae585
 libc_hidden_proto (strptime)
b9ae585
 
b9ae585
-extern __typeof (clock_getres) __clock_getres;
b9ae585
 extern __typeof (clock_gettime) __clock_gettime;
b9ae585
 libc_hidden_proto (__clock_gettime)
b9ae585
 extern __typeof (clock_settime) __clock_settime;
b9ae585
-extern __typeof (clock_nanosleep) __clock_nanosleep;
b9ae585
-extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
b9ae585
+libc_hidden_proto (__clock_settime)
b9ae585
 
b9ae585
 /* Now define the internal interfaces.  */
b9ae585
 struct tm;
b9ae585
diff --git a/rt/Makefile b/rt/Makefile
b9ae585
index 9ea8394565815bf7..e6fbc32438c205cf 100644
b9ae585
--- a/rt/Makefile
b9ae585
+++ b/rt/Makefile
b9ae585
@@ -28,9 +28,6 @@ aio-routines   := aio_cancel aio_error aio_fsync aio_misc aio_read	\
b9ae585
 		  aio_read64 aio_return aio_suspend aio_write		\
b9ae585
 		  aio_write64 lio_listio lio_listio64 aio_sigqueue	\
b9ae585
 		  aio_notify
b9ae585
-clock-routines := clock_getcpuclockid					\
b9ae585
-		  clock_getres clock_gettime clock_settime		\
b9ae585
-		  clock_nanosleep
b9ae585
 timer-routines := timer_create timer_delete timer_getoverr		\
b9ae585
 		  timer_gettime timer_settime
b9ae585
 shm-routines   := shm_open shm_unlink
b9ae585
@@ -38,22 +35,18 @@ mq-routines    := mq_open mq_close mq_unlink mq_getattr mq_setattr	\
b9ae585
 		  mq_notify mq_send mq_receive mq_timedsend		\
b9ae585
 		  mq_timedreceive
b9ae585
 
b9ae585
-routines = $(clock-routines)
b9ae585
-
b9ae585
 librt-routines = $(aio-routines) \
b9ae585
 		 $(timer-routines) \
b9ae585
-		 $(shm-routines) $(mq-routines) \
b9ae585
-		 clock-compat
b9ae585
+		 $(shm-routines) $(mq-routines)
b9ae585
 
b9ae585
-tests := tst-shm tst-clock tst-clock_nanosleep tst-timer tst-timer2 \
b9ae585
+tests := tst-shm tst-timer tst-timer2 \
b9ae585
 	 tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \
b9ae585
 	 tst-aio7 tst-aio8 tst-aio9 tst-aio10 \
b9ae585
 	 tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
b9ae585
 	 tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \
b9ae585
 	 tst-timer3 tst-timer4 tst-timer5 \
b9ae585
-	 tst-cpuclock1 tst-cpuclock2 \
b9ae585
-	 tst-cputimer1 tst-cputimer2 tst-cputimer3 \
b9ae585
-	 tst-clock2 tst-shm-cancel
b9ae585
+	 tst-cpuclock2 tst-cputimer1 tst-cputimer2 tst-cputimer3 \
b9ae585
+	 tst-shm-cancel
b9ae585
 
b9ae585
 extra-libs := librt
b9ae585
 extra-libs-others := $(extra-libs)
b9ae585
diff --git a/rt/Versions b/rt/Versions
b9ae585
index 91e3fd2a204ded9c..84d1345420dc4dc4 100644
b9ae585
--- a/rt/Versions
b9ae585
+++ b/rt/Versions
b9ae585
@@ -1,15 +1,3 @@
b9ae585
-libc {
b9ae585
-  GLIBC_2.17 {
b9ae585
-    # c*
b9ae585
-    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
b9ae585
-    clock_nanosleep;
b9ae585
-  }
b9ae585
-  GLIBC_PRIVATE {
b9ae585
-    __clock_getres; __clock_gettime; __clock_settime; __clock_getcpuclockid;
b9ae585
-    __clock_nanosleep;
b9ae585
-  }
b9ae585
-}
b9ae585
-
b9ae585
 librt {
b9ae585
   GLIBC_2.1 {
b9ae585
     # AIO functions.
b9ae585
@@ -18,10 +6,6 @@ librt {
b9ae585
     aio_suspend64; aio_write; aio_write64; lio_listio; lio_listio64;
b9ae585
   }
b9ae585
   GLIBC_2.2 {
b9ae585
-    # These have moved to libc and are still here only for compatibility.
b9ae585
-    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
b9ae585
-    clock_nanosleep;
b9ae585
-
b9ae585
     # s*
b9ae585
     shm_open; shm_unlink;
b9ae585
 
b9ae585
diff --git a/rt/clock-compat.c b/rt/clock-compat.c
b9ae585
deleted file mode 100644
b9ae585
index d8ced3cdc1fe324c..0000000000000000
b9ae585
--- a/rt/clock-compat.c
b9ae585
+++ /dev/null
b9ae585
@@ -1,63 +0,0 @@
b9ae585
-/* ABI compatibility redirects for clock_* symbols in librt.
b9ae585
-   Copyright (C) 2012-2019 Free Software Foundation, Inc.
b9ae585
-   This file is part of the GNU C Library.
b9ae585
-
b9ae585
-   The GNU C Library is free software; you can redistribute it and/or
b9ae585
-   modify it under the terms of the GNU Lesser General Public
b9ae585
-   License as published by the Free Software Foundation; either
b9ae585
-   version 2.1 of the License, or (at your option) any later version.
b9ae585
-
b9ae585
-   The GNU C Library is distributed in the hope that it will be useful,
b9ae585
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
b9ae585
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
b9ae585
-   Lesser General Public License for more details.
b9ae585
-
b9ae585
-   You should have received a copy of the GNU Lesser General Public
b9ae585
-   License along with the GNU C Library; if not, see
b9ae585
-   <http://www.gnu.org/licenses/>.  */
b9ae585
-
b9ae585
-#include <shlib-compat.h>
b9ae585
-
b9ae585
-/* The clock_* symbols were originally defined in librt and so
b9ae585
-   are part of its ABI.  As of 2.17, they have moved to libc.
b9ae585
-   So we supply definitions for librt that just redirect to
b9ae585
-   their libc counterparts.  */
b9ae585
-
b9ae585
-#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
b9ae585
-
b9ae585
-#include <time.h>
b9ae585
-
b9ae585
-#if HAVE_IFUNC
b9ae585
-# undef INIT_ARCH
b9ae585
-# define INIT_ARCH()
b9ae585
-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \
b9ae585
-    compat_symbol (librt, name, name, GLIBC_2_2);
b9ae585
-#else
b9ae585
-# define COMPAT_REDIRECT(name, proto, arglist)				      \
b9ae585
-  int									      \
b9ae585
-  name proto								      \
b9ae585
-  {									      \
b9ae585
-    return __##name arglist;						      \
b9ae585
-  }									      \
b9ae585
-  compat_symbol (librt, name, name, GLIBC_2_2);
b9ae585
-#endif
b9ae585
-
b9ae585
-COMPAT_REDIRECT (clock_getres,
b9ae585
-		 (clockid_t clock_id, struct timespec *res),
b9ae585
-		 (clock_id, res))
b9ae585
-COMPAT_REDIRECT (clock_gettime,
b9ae585
-		 (clockid_t clock_id, struct timespec *tp),
b9ae585
-		 (clock_id, tp))
b9ae585
-COMPAT_REDIRECT (clock_settime,
b9ae585
-		 (clockid_t clock_id, const struct timespec *tp),
b9ae585
-		 (clock_id, tp))
b9ae585
-COMPAT_REDIRECT (clock_getcpuclockid,
b9ae585
-		 (pid_t pid, clockid_t *clock_id),
b9ae585
-		 (pid, clock_id))
b9ae585
-COMPAT_REDIRECT (clock_nanosleep,
b9ae585
-		 (clockid_t clock_id, int flags,
b9ae585
-		  const struct timespec *req,
b9ae585
-		  struct timespec *rem),
b9ae585
-		 (clock_id, flags, req, rem))
b9ae585
-
b9ae585
-#endif
b9ae585
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
b9ae585
index dd3cf6f9f266544e..0d9efbcea2bdb284 100644
b9ae585
--- a/sysdeps/mach/hurd/i386/libc.abilist
b9ae585
+++ b/sysdeps/mach/hurd/i386/libc.abilist
b9ae585
@@ -711,6 +711,11 @@ GLIBC_2.2.6 clntudp_bufcreate F
b9ae585
 GLIBC_2.2.6 clntudp_create F
b9ae585
 GLIBC_2.2.6 clntunix_create F
b9ae585
 GLIBC_2.2.6 clock F
b9ae585
+GLIBC_2.2.6 clock_getcpuclockid F
b9ae585
+GLIBC_2.2.6 clock_getres F
b9ae585
+GLIBC_2.2.6 clock_gettime F
b9ae585
+GLIBC_2.2.6 clock_nanosleep F
b9ae585
+GLIBC_2.2.6 clock_settime F
b9ae585
 GLIBC_2.2.6 close F
b9ae585
 GLIBC_2.2.6 closedir F
b9ae585
 GLIBC_2.2.6 closelog F
b9ae585
diff --git a/sysdeps/mach/hurd/i386/librt.abilist b/sysdeps/mach/hurd/i386/librt.abilist
b9ae585
index d5fe32b3a9917254..3726e41f06cc500c 100644
b9ae585
--- a/sysdeps/mach/hurd/i386/librt.abilist
b9ae585
+++ b/sysdeps/mach/hurd/i386/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.2.6 aio_suspend F
b9ae585
 GLIBC_2.2.6 aio_suspend64 F
b9ae585
 GLIBC_2.2.6 aio_write F
b9ae585
 GLIBC_2.2.6 aio_write64 F
b9ae585
-GLIBC_2.2.6 clock_getcpuclockid F
b9ae585
-GLIBC_2.2.6 clock_getres F
b9ae585
-GLIBC_2.2.6 clock_gettime F
b9ae585
-GLIBC_2.2.6 clock_nanosleep F
b9ae585
-GLIBC_2.2.6 clock_settime F
b9ae585
 GLIBC_2.2.6 lio_listio F
b9ae585
 GLIBC_2.2.6 lio_listio64 F
b9ae585
 GLIBC_2.2.6 shm_open F
b9ae585
diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
b9ae585
index 01024a3f55883284..e529cadb1f827946 100644
b9ae585
--- a/sysdeps/posix/clock_getres.c
b9ae585
+++ b/sysdeps/posix/clock_getres.c
b9ae585
@@ -22,7 +22,7 @@
b9ae585
 #include <unistd.h>
b9ae585
 #include <sys/param.h>
b9ae585
 #include <libc-internal.h>
b9ae585
-
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 static inline int
b9ae585
 realtime_getres (struct timespec *res)
b9ae585
@@ -62,4 +62,11 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
b9ae585
 
b9ae585
   return retval;
b9ae585
 }
b9ae585
-weak_alias (__clock_getres, clock_getres)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
b9ae585
+/* clock_getres moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_getres, __clock_getres_2);
b9ae585
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
b9ae585
index 10a6c96d9d62edc3..2a82fc106663acc7 100644
b9ae585
--- a/sysdeps/unix/clock_gettime.c
b9ae585
+++ b/sysdeps/unix/clock_gettime.c
b9ae585
@@ -17,24 +17,9 @@
b9ae585
    <http://www.gnu.org/licenses/>.  */
b9ae585
 
b9ae585
 #include <errno.h>
b9ae585
-#include <stdint.h>
b9ae585
 #include <time.h>
b9ae585
 #include <sys/time.h>
b9ae585
-#include <libc-internal.h>
b9ae585
-#include <ldsodefs.h>
b9ae585
-
b9ae585
-
b9ae585
-static inline int
b9ae585
-realtime_gettime (struct timespec *tp)
b9ae585
-{
b9ae585
-  struct timeval tv;
b9ae585
-  int retval = __gettimeofday (&tv, NULL);
b9ae585
-  if (retval == 0)
b9ae585
-    /* Convert into `timespec'.  */
b9ae585
-    TIMEVAL_TO_TIMESPEC (&tv, tp);
b9ae585
-  return retval;
b9ae585
-}
b9ae585
-
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 /* Get current value of CLOCK and store it in TP.  */
b9ae585
 int
b9ae585
@@ -60,5 +45,12 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
b9ae585
 
b9ae585
   return retval;
b9ae585
 }
b9ae585
-weak_alias (__clock_gettime, clock_gettime)
b9ae585
 libc_hidden_def (__clock_gettime)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
b9ae585
+/* clock_gettime moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_gettime, __clock_gettime_2);
b9ae585
+compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/clock_nanosleep.c b/sysdeps/unix/clock_nanosleep.c
b9ae585
index b27608570ca629c8..6a477520d11536f2 100644
b9ae585
--- a/sysdeps/unix/clock_nanosleep.c
b9ae585
+++ b/sysdeps/unix/clock_nanosleep.c
b9ae585
@@ -20,6 +20,7 @@
b9ae585
 #include <errno.h>
b9ae585
 #include <time.h>
b9ae585
 #include <sysdep-cancel.h>
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 /* This implementation assumes that these is only a `nanosleep' system
b9ae585
    call.  So we have to remap all other activities.  */
b9ae585
@@ -76,4 +77,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
b9ae585
 
b9ae585
   return __nanosleep (req, rem), 0 ? errno : 0;
b9ae585
 }
b9ae585
-weak_alias (__clock_nanosleep, clock_nanosleep)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
b9ae585
+/* clock_nanosleep moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_nanosleep, __clock_nanosleep_2);
b9ae585
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c
b9ae585
index 109a1ad872671b50..5b398491abc83512 100644
b9ae585
--- a/sysdeps/unix/clock_settime.c
b9ae585
+++ b/sysdeps/unix/clock_settime.c
b9ae585
@@ -18,8 +18,7 @@
b9ae585
 #include <errno.h>
b9ae585
 #include <time.h>
b9ae585
 #include <sys/time.h>
b9ae585
-#include <ldsodefs.h>
b9ae585
-
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 /* Set CLOCK to value TP.  */
b9ae585
 int
b9ae585
@@ -51,4 +50,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
b9ae585
 
b9ae585
   return retval;
b9ae585
 }
b9ae585
-weak_alias (__clock_settime, clock_settime)
b9ae585
+libc_hidden_def (__clock_settime)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
b9ae585
+/* clock_settime moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_settime, __clock_settime_2);
b9ae585
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
b9ae585
index f630fa4c6fcd6c17..6ff4a638e05b34c0 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
b9ae585
@@ -1863,6 +1863,11 @@ GLIBC_2.2 __xpg_sigpause F
b9ae585
 GLIBC_2.2 _flushlbf F
b9ae585
 GLIBC_2.2 _res_hconf D 0x48
b9ae585
 GLIBC_2.2 bind_textdomain_codeset F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 dngettext F
b9ae585
 GLIBC_2.2 fgetpos F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/alpha/librt.abilist b/sysdeps/unix/sysv/linux/alpha/librt.abilist
b9ae585
index d7a049cf600e2966..71f86e03ce67fd19 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/alpha/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/alpha/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist
b9ae585
index b96f45590f554469..52deb55da03d448a 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/arm/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/arm/libc.abilist
b9ae585
@@ -762,6 +762,11 @@ GLIBC_2.4 clntudp_bufcreate F
b9ae585
 GLIBC_2.4 clntudp_create F
b9ae585
 GLIBC_2.4 clntunix_create F
b9ae585
 GLIBC_2.4 clock F
b9ae585
+GLIBC_2.4 clock_getcpuclockid F
b9ae585
+GLIBC_2.4 clock_getres F
b9ae585
+GLIBC_2.4 clock_gettime F
b9ae585
+GLIBC_2.4 clock_nanosleep F
b9ae585
+GLIBC_2.4 clock_settime F
b9ae585
 GLIBC_2.4 clone F
b9ae585
 GLIBC_2.4 close F
b9ae585
 GLIBC_2.4 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/arm/librt.abilist b/sysdeps/unix/sysv/linux/arm/librt.abilist
b9ae585
index cfbbd2755765e720..3c0647b2516bb51d 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/arm/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/arm/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F
b9ae585
 GLIBC_2.4 aio_suspend64 F
b9ae585
 GLIBC_2.4 aio_write F
b9ae585
 GLIBC_2.4 aio_write64 F
b9ae585
-GLIBC_2.4 clock_getcpuclockid F
b9ae585
-GLIBC_2.4 clock_getres F
b9ae585
-GLIBC_2.4 clock_gettime F
b9ae585
-GLIBC_2.4 clock_nanosleep F
b9ae585
-GLIBC_2.4 clock_settime F
b9ae585
 GLIBC_2.4 lio_listio F
b9ae585
 GLIBC_2.4 lio_listio64 F
b9ae585
 GLIBC_2.4 mq_close F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
b9ae585
index f4a652966fe7bd6c..f2d8b916cb24010f 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
b9ae585
+++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
b9ae585
@@ -20,6 +20,7 @@
b9ae585
 #include <time.h>
b9ae585
 #include <unistd.h>
b9ae585
 #include "kernel-posix-cpu-timers.h"
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 int
b9ae585
 __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
b9ae585
@@ -45,4 +46,11 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
b9ae585
   else
b9ae585
     return INTERNAL_SYSCALL_ERRNO (r, err);
b9ae585
 }
b9ae585
-weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17);
b9ae585
+/* clock_getcpuclockid moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_getcpuclockid, __clock_getcpuclockid_2);
b9ae585
+compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c
b9ae585
index 24b2299938c10b2b..18a7ce53c0a4e3c3 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/clock_getres.c
b9ae585
+++ b/sysdeps/unix/sysv/linux/clock_getres.c
b9ae585
@@ -26,10 +26,19 @@
b9ae585
 #endif
b9ae585
 #include <sysdep-vdso.h>
b9ae585
 
b9ae585
+#include <shlib-compat.h>
b9ae585
+
b9ae585
 /* Get resolution of clock.  */
b9ae585
 int
b9ae585
 __clock_getres (clockid_t clock_id, struct timespec *res)
b9ae585
 {
b9ae585
   return INLINE_VSYSCALL (clock_getres, 2, clock_id, res);
b9ae585
 }
b9ae585
-weak_alias (__clock_getres, clock_getres)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
b9ae585
+/* clock_getres moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_getres, __clock_getres_2);
b9ae585
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
b9ae585
index 5fc47fb7dc7c8fab..7ad1c91be68a10cf 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
b9ae585
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
b9ae585
@@ -26,11 +26,20 @@
b9ae585
 #endif
b9ae585
 #include <sysdep-vdso.h>
b9ae585
 
b9ae585
+#include <shlib-compat.h>
b9ae585
+
b9ae585
 /* Get current value of CLOCK and store it in TP.  */
b9ae585
 int
b9ae585
 __clock_gettime (clockid_t clock_id, struct timespec *tp)
b9ae585
 {
b9ae585
   return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
b9ae585
 }
b9ae585
-weak_alias (__clock_gettime, clock_gettime)
b9ae585
 libc_hidden_def (__clock_gettime)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
b9ae585
+/* clock_gettime moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_gettime, __clock_gettime_2);
b9ae585
+compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c
b9ae585
index 0cb6614dc9224097..e19e09d197d6f015 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c
b9ae585
+++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c
b9ae585
@@ -21,6 +21,7 @@
b9ae585
 #include <sysdep-cancel.h>
b9ae585
 #include "kernel-posix-cpu-timers.h"
b9ae585
 
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 /* We can simply use the syscall.  The CPU clocks are not supported
b9ae585
    with this function.  */
b9ae585
@@ -41,4 +42,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
b9ae585
   return (INTERNAL_SYSCALL_ERROR_P (r, err)
b9ae585
 	  ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
b9ae585
 }
b9ae585
-weak_alias (__clock_nanosleep, clock_nanosleep)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
b9ae585
+/* clock_nanosleep moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_nanosleep, __clock_nanosleep_2);
b9ae585
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c
b9ae585
index d837e3019c6aca93..0586d1572221f563 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/clock_settime.c
b9ae585
+++ b/sysdeps/unix/sysv/linux/clock_settime.c
b9ae585
@@ -18,6 +18,7 @@
b9ae585
 #include <errno.h>
b9ae585
 #include <sysdep.h>
b9ae585
 #include <time.h>
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 #include "kernel-posix-cpu-timers.h"
b9ae585
 
b9ae585
@@ -34,4 +35,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
b9ae585
 
b9ae585
   return INLINE_SYSCALL_CALL (clock_settime, clock_id, tp);
b9ae585
 }
b9ae585
-weak_alias (__clock_settime, clock_settime)
b9ae585
+libc_hidden_def (__clock_settime)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
b9ae585
+/* clock_settime moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_settime, __clock_settime_2);
b9ae585
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
b9ae585
index 088a8ee369602900..594963eed61744ab 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
b9ae585
@@ -615,6 +615,11 @@ GLIBC_2.2 clntudp_bufcreate F
b9ae585
 GLIBC_2.2 clntudp_create F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
 GLIBC_2.2 clock F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 clone F
b9ae585
 GLIBC_2.2 close F
b9ae585
 GLIBC_2.2 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist
b9ae585
index 595f1b712a4e8d70..bb03781dcc04d219 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/hppa/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
b9ae585
index f7ff2c57b91543e9..a196bc18ec998918 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
b9ae585
@@ -1869,6 +1869,11 @@ GLIBC_2.2 _flushlbf F
b9ae585
 GLIBC_2.2 _res_hconf D 0x30
b9ae585
 GLIBC_2.2 alphasort64 F
b9ae585
 GLIBC_2.2 bind_textdomain_codeset F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 dngettext F
b9ae585
 GLIBC_2.2 fgetpos F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist
b9ae585
index 595f1b712a4e8d70..bb03781dcc04d219 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/i386/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/i386/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
b9ae585
index becd8b103359f8a2..bd229f573af53b2f 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
b9ae585
@@ -627,6 +627,11 @@ GLIBC_2.2 clntudp_bufcreate F
b9ae585
 GLIBC_2.2 clntudp_create F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
 GLIBC_2.2 clock F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 close F
b9ae585
 GLIBC_2.2 closedir F
b9ae585
 GLIBC_2.2 closelog F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/ia64/librt.abilist b/sysdeps/unix/sysv/linux/ia64/librt.abilist
b9ae585
index 804622a14abd8ea9..08384c906518837d 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/ia64/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/ia64/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
b9ae585
index 74e42a5209936c27..9359f10f30328ded 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
b9ae585
@@ -751,6 +751,11 @@ GLIBC_2.4 clntudp_bufcreate F
b9ae585
 GLIBC_2.4 clntudp_create F
b9ae585
 GLIBC_2.4 clntunix_create F
b9ae585
 GLIBC_2.4 clock F
b9ae585
+GLIBC_2.4 clock_getcpuclockid F
b9ae585
+GLIBC_2.4 clock_getres F
b9ae585
+GLIBC_2.4 clock_gettime F
b9ae585
+GLIBC_2.4 clock_nanosleep F
b9ae585
+GLIBC_2.4 clock_settime F
b9ae585
 GLIBC_2.4 clone F
b9ae585
 GLIBC_2.4 close F
b9ae585
 GLIBC_2.4 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
b9ae585
index cfbbd2755765e720..3c0647b2516bb51d 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F
b9ae585
 GLIBC_2.4 aio_suspend64 F
b9ae585
 GLIBC_2.4 aio_write F
b9ae585
 GLIBC_2.4 aio_write64 F
b9ae585
-GLIBC_2.4 clock_getcpuclockid F
b9ae585
-GLIBC_2.4 clock_getres F
b9ae585
-GLIBC_2.4 clock_gettime F
b9ae585
-GLIBC_2.4 clock_nanosleep F
b9ae585
-GLIBC_2.4 clock_settime F
b9ae585
 GLIBC_2.4 lio_listio F
b9ae585
 GLIBC_2.4 lio_listio64 F
b9ae585
 GLIBC_2.4 mq_close F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
b9ae585
index 4af5a74e8a47d619..e70c183a2571f348 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
b9ae585
@@ -1825,6 +1825,11 @@ GLIBC_2.2 _flushlbf F
b9ae585
 GLIBC_2.2 _res_hconf D 0x30
b9ae585
 GLIBC_2.2 alphasort64 F
b9ae585
 GLIBC_2.2 bind_textdomain_codeset F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 dngettext F
b9ae585
 GLIBC_2.2 fgetpos F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
b9ae585
index 595f1b712a4e8d70..bb03781dcc04d219 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/microblaze/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/librt.abilist
b9ae585
index fb85d8729e1bc69d..889dfbc0eef5e75a 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/microblaze/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/microblaze/librt.abilist
b9ae585
@@ -14,11 +14,6 @@ GLIBC_2.18 aio_suspend F
b9ae585
 GLIBC_2.18 aio_suspend64 F
b9ae585
 GLIBC_2.18 aio_write F
b9ae585
 GLIBC_2.18 aio_write64 F
b9ae585
-GLIBC_2.18 clock_getcpuclockid F
b9ae585
-GLIBC_2.18 clock_getres F
b9ae585
-GLIBC_2.18 clock_gettime F
b9ae585
-GLIBC_2.18 clock_nanosleep F
b9ae585
-GLIBC_2.18 clock_settime F
b9ae585
 GLIBC_2.18 lio_listio F
b9ae585
 GLIBC_2.18 lio_listio64 F
b9ae585
 GLIBC_2.18 mq_close F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
b9ae585
index 1054bb599e5c1f00..85e9925b62fd215a 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
b9ae585
@@ -1612,6 +1612,11 @@ GLIBC_2.2 capget F
b9ae585
 GLIBC_2.2 capset F
b9ae585
 GLIBC_2.2 cbc_crypt F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 creat64 F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 des_setparity F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
b9ae585
index 84837c8a2ef02e1b..1539c1cef92bccfd 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
b9ae585
 GLIBC_2.2 aio_suspend64 F
b9ae585
 GLIBC_2.2 aio_write F
b9ae585
 GLIBC_2.2 aio_write64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 lio_listio F
b9ae585
 GLIBC_2.2 lio_listio64 F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
b9ae585
index 4f5b5ffebf975663..22ac802c7abd909b 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
b9ae585
@@ -1610,6 +1610,11 @@ GLIBC_2.2 capget F
b9ae585
 GLIBC_2.2 capset F
b9ae585
 GLIBC_2.2 cbc_crypt F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 creat64 F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 des_setparity F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
b9ae585
index 84837c8a2ef02e1b..1539c1cef92bccfd 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
b9ae585
 GLIBC_2.2 aio_suspend64 F
b9ae585
 GLIBC_2.2 aio_write F
b9ae585
 GLIBC_2.2 aio_write64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 lio_listio F
b9ae585
 GLIBC_2.2 lio_listio64 F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
b9ae585
index 943aee58d443057c..fc073cf877824883 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
b9ae585
@@ -1611,6 +1611,11 @@ GLIBC_2.2 capget F
b9ae585
 GLIBC_2.2 capset F
b9ae585
 GLIBC_2.2 cbc_crypt F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 creat64 F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 des_setparity F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
b9ae585
index 17a5d17ef9e007f0..6d9a5dcd28a6dfbc 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
b9ae585
@@ -1607,6 +1607,11 @@ GLIBC_2.2 capget F
b9ae585
 GLIBC_2.2 capset F
b9ae585
 GLIBC_2.2 cbc_crypt F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 creat64 F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 des_setparity F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
b9ae585
index ecc2d6fa13e3f097..23819c23bb10edbe 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
b9ae585
@@ -1830,6 +1830,11 @@ GLIBC_2.2 __xstat64 F
b9ae585
 GLIBC_2.2 _flushlbf F
b9ae585
 GLIBC_2.2 _res_hconf D 0x30
b9ae585
 GLIBC_2.2 bind_textdomain_codeset F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 dngettext F
b9ae585
 GLIBC_2.2 fgetpos F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
b9ae585
index 595f1b712a4e8d70..bb03781dcc04d219 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
b9ae585
index f5830f9c33fc37af..28717eab62646159 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
b9ae585
@@ -1834,6 +1834,11 @@ GLIBC_2.2 __xstat64 F
b9ae585
 GLIBC_2.2 _flushlbf F
b9ae585
 GLIBC_2.2 _res_hconf D 0x30
b9ae585
 GLIBC_2.2 bind_textdomain_codeset F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 dngettext F
b9ae585
 GLIBC_2.2 fgetpos F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
b9ae585
index 633d8f4792987f41..ce94bba505c60a3f 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
b9ae585
@@ -673,6 +673,11 @@ GLIBC_2.3 clntudp_bufcreate F
b9ae585
 GLIBC_2.3 clntudp_create F
b9ae585
 GLIBC_2.3 clntunix_create F
b9ae585
 GLIBC_2.3 clock F
b9ae585
+GLIBC_2.3 clock_getcpuclockid F
b9ae585
+GLIBC_2.3 clock_getres F
b9ae585
+GLIBC_2.3 clock_gettime F
b9ae585
+GLIBC_2.3 clock_nanosleep F
b9ae585
+GLIBC_2.3 clock_settime F
b9ae585
 GLIBC_2.3 clone F
b9ae585
 GLIBC_2.3 close F
b9ae585
 GLIBC_2.3 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/librt.abilist
b9ae585
index e76b7eb49566718b..6a5bd96963e67109 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.3 aio_suspend F
b9ae585
 GLIBC_2.3 aio_suspend64 F
b9ae585
 GLIBC_2.3 aio_write F
b9ae585
 GLIBC_2.3 aio_write64 F
b9ae585
-GLIBC_2.3 clock_getcpuclockid F
b9ae585
-GLIBC_2.3 clock_getres F
b9ae585
-GLIBC_2.3 clock_gettime F
b9ae585
-GLIBC_2.3 clock_nanosleep F
b9ae585
-GLIBC_2.3 clock_settime F
b9ae585
 GLIBC_2.3 lio_listio F
b9ae585
 GLIBC_2.3 lio_listio64 F
b9ae585
 GLIBC_2.3 shm_open F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
b9ae585
index 334def033c375afe..2ebc24c96bbcf215 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
b9ae585
@@ -1829,6 +1829,11 @@ GLIBC_2.2 _flushlbf F
b9ae585
 GLIBC_2.2 _res_hconf D 0x30
b9ae585
 GLIBC_2.2 alphasort64 F
b9ae585
 GLIBC_2.2 bind_textdomain_codeset F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 dngettext F
b9ae585
 GLIBC_2.2 fgetpos F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
b9ae585
index 595f1b712a4e8d70..bb03781dcc04d219 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
b9ae585
index 536f4c4ced282049..19f555450ac7d9e0 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
b9ae585
@@ -632,6 +632,11 @@ GLIBC_2.2 clntudp_bufcreate F
b9ae585
 GLIBC_2.2 clntudp_create F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
 GLIBC_2.2 clock F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 clone F
b9ae585
 GLIBC_2.2 close F
b9ae585
 GLIBC_2.2 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
b9ae585
index 41be3bb84b6e4df0..5905498a488359d7 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
b9ae585
 GLIBC_2.2 aio_suspend64 F
b9ae585
 GLIBC_2.2 aio_write F
b9ae585
 GLIBC_2.2 aio_write64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 lio_listio F
b9ae585
 GLIBC_2.2 lio_listio64 F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist
b9ae585
index 30ae3b6ebb6510f6..25f1e6a94a77f8a0 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/sh/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/sh/libc.abilist
b9ae585
@@ -618,6 +618,11 @@ GLIBC_2.2 clntudp_bufcreate F
b9ae585
 GLIBC_2.2 clntudp_create F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
 GLIBC_2.2 clock F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 clone F
b9ae585
 GLIBC_2.2 close F
b9ae585
 GLIBC_2.2 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/sh/librt.abilist b/sysdeps/unix/sysv/linux/sh/librt.abilist
b9ae585
index 595f1b712a4e8d70..bb03781dcc04d219 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/sh/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/sh/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
b9ae585
index 68b107d08058c383..6354e3bd7bc2e6c9 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
b9ae585
@@ -1826,6 +1826,11 @@ GLIBC_2.2 __xstat64 F
b9ae585
 GLIBC_2.2 _flushlbf F
b9ae585
 GLIBC_2.2 _res_hconf D 0x30
b9ae585
 GLIBC_2.2 bind_textdomain_codeset F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 dcngettext F
b9ae585
 GLIBC_2.2 dngettext F
b9ae585
 GLIBC_2.2 fgetpos F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
b9ae585
index cb874f41477109c3..38f0aad791793010 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
b9ae585
index e5b6a4da50e9295d..bde2c2d427933225 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
b9ae585
@@ -660,6 +660,11 @@ GLIBC_2.2 clntudp_bufcreate F
b9ae585
 GLIBC_2.2 clntudp_create F
b9ae585
 GLIBC_2.2 clntunix_create F
b9ae585
 GLIBC_2.2 clock F
b9ae585
+GLIBC_2.2 clock_getcpuclockid F
b9ae585
+GLIBC_2.2 clock_getres F
b9ae585
+GLIBC_2.2 clock_gettime F
b9ae585
+GLIBC_2.2 clock_nanosleep F
b9ae585
+GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 clone F
b9ae585
 GLIBC_2.2 close F
b9ae585
 GLIBC_2.2 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
b9ae585
index d7a049cf600e2966..71f86e03ce67fd19 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
b9ae585
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
b9ae585
 GLIBC_2.1 aio_write64 F
b9ae585
 GLIBC_2.1 lio_listio F
b9ae585
 GLIBC_2.1 lio_listio64 F
b9ae585
-GLIBC_2.2 clock_getcpuclockid F
b9ae585
-GLIBC_2.2 clock_getres F
b9ae585
-GLIBC_2.2 clock_gettime F
b9ae585
-GLIBC_2.2 clock_nanosleep F
b9ae585
-GLIBC_2.2 clock_settime F
b9ae585
 GLIBC_2.2 shm_open F
b9ae585
 GLIBC_2.2 shm_unlink F
b9ae585
 GLIBC_2.2 timer_create F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
b9ae585
index 86dfb0c94d66f586..deab0d2dac3a4622 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
b9ae585
@@ -621,6 +621,11 @@ GLIBC_2.2.5 clntudp_bufcreate F
b9ae585
 GLIBC_2.2.5 clntudp_create F
b9ae585
 GLIBC_2.2.5 clntunix_create F
b9ae585
 GLIBC_2.2.5 clock F
b9ae585
+GLIBC_2.2.5 clock_getcpuclockid F
b9ae585
+GLIBC_2.2.5 clock_getres F
b9ae585
+GLIBC_2.2.5 clock_gettime F
b9ae585
+GLIBC_2.2.5 clock_nanosleep F
b9ae585
+GLIBC_2.2.5 clock_settime F
b9ae585
 GLIBC_2.2.5 clone F
b9ae585
 GLIBC_2.2.5 close F
b9ae585
 GLIBC_2.2.5 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
b9ae585
index e2e8b60bf8e29f55..95e3f22daa06b237 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
b9ae585
@@ -13,11 +13,6 @@ GLIBC_2.2.5 aio_suspend F
b9ae585
 GLIBC_2.2.5 aio_suspend64 F
b9ae585
 GLIBC_2.2.5 aio_write F
b9ae585
 GLIBC_2.2.5 aio_write64 F
b9ae585
-GLIBC_2.2.5 clock_getcpuclockid F
b9ae585
-GLIBC_2.2.5 clock_getres F
b9ae585
-GLIBC_2.2.5 clock_gettime F
b9ae585
-GLIBC_2.2.5 clock_nanosleep F
b9ae585
-GLIBC_2.2.5 clock_settime F
b9ae585
 GLIBC_2.2.5 lio_listio F
b9ae585
 GLIBC_2.2.5 lio_listio64 F
b9ae585
 GLIBC_2.2.5 shm_open F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
b9ae585
index dd688263aa728f84..c2c65df32f673624 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
b9ae585
@@ -660,6 +660,11 @@ GLIBC_2.16 clntudp_create F
b9ae585
 GLIBC_2.16 clntunix_create F
b9ae585
 GLIBC_2.16 clock F
b9ae585
 GLIBC_2.16 clock_adjtime F
b9ae585
+GLIBC_2.16 clock_getcpuclockid F
b9ae585
+GLIBC_2.16 clock_getres F
b9ae585
+GLIBC_2.16 clock_gettime F
b9ae585
+GLIBC_2.16 clock_nanosleep F
b9ae585
+GLIBC_2.16 clock_settime F
b9ae585
 GLIBC_2.16 clone F
b9ae585
 GLIBC_2.16 close F
b9ae585
 GLIBC_2.16 closedir F
b9ae585
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
b9ae585
index 94e84e4dcfaa85dc..66969fb9ab887756 100644
b9ae585
--- a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
b9ae585
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
b9ae585
@@ -14,11 +14,6 @@ GLIBC_2.16 aio_suspend F
b9ae585
 GLIBC_2.16 aio_suspend64 F
b9ae585
 GLIBC_2.16 aio_write F
b9ae585
 GLIBC_2.16 aio_write64 F
b9ae585
-GLIBC_2.16 clock_getcpuclockid F
b9ae585
-GLIBC_2.16 clock_getres F
b9ae585
-GLIBC_2.16 clock_gettime F
b9ae585
-GLIBC_2.16 clock_nanosleep F
b9ae585
-GLIBC_2.16 clock_settime F
b9ae585
 GLIBC_2.16 lio_listio F
b9ae585
 GLIBC_2.16 lio_listio64 F
b9ae585
 GLIBC_2.16 mq_close F
b9ae585
diff --git a/time/Makefile b/time/Makefile
b9ae585
index 5c6304ece1dcadaa..ffe90ef04e18ebb1 100644
b9ae585
--- a/time/Makefile
b9ae585
+++ b/time/Makefile
b9ae585
@@ -36,14 +36,18 @@ routines := offtime asctime clock ctime ctime_r difftime \
b9ae585
 	    stime dysize timegm ftime			 \
b9ae585
 	    getdate strptime strptime_l			 \
b9ae585
 	    strftime wcsftime strftime_l wcsftime_l	 \
b9ae585
-	    timespec_get
b9ae585
+	    timespec_get 	 			 \
b9ae585
+	    clock_getcpuclockid clock_getres 		 \
b9ae585
+	    clock_gettime clock_settime clock_nanosleep
b9ae585
+
b9ae585
 aux :=	    era alt_digit lc-time-cleanup
b9ae585
 
b9ae585
 tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
b9ae585
 	   tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
b9ae585
 	   tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
b9ae585
 	   tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \
b9ae585
-	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2
b9ae585
+	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 \
b9ae585
+	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1
b9ae585
 
b9ae585
 include ../Rules
b9ae585
 
b9ae585
diff --git a/time/Versions b/time/Versions
b9ae585
index fd838181e4f0969d..8788e192ce358d77 100644
b9ae585
--- a/time/Versions
b9ae585
+++ b/time/Versions
b9ae585
@@ -49,6 +49,10 @@ libc {
b9ae585
   GLIBC_2.2 {
b9ae585
     # w*
b9ae585
     wcsftime;
b9ae585
+
b9ae585
+    # c*; actually in librt in version 2.2, moved to libc in 2.17
b9ae585
+    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
b9ae585
+    clock_nanosleep;
b9ae585
   }
b9ae585
   GLIBC_2.3 {
b9ae585
     # these internal names are used by libstdc++
b9ae585
@@ -65,4 +69,13 @@ libc {
b9ae585
   GLIBC_2.16 {
b9ae585
     timespec_get;
b9ae585
   }
b9ae585
+  GLIBC_2.17 {
b9ae585
+    # c*
b9ae585
+    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
b9ae585
+    clock_nanosleep;
b9ae585
+  }
b9ae585
+  GLIBC_PRIVATE {
b9ae585
+    # same as clock_gettime; used in other libraries
b9ae585
+    __clock_gettime;
b9ae585
+  }
b9ae585
 }
b9ae585
diff --git a/rt/clock_getcpuclockid.c b/time/clock_getcpuclockid.c
b9ae585
similarity index 75%
b9ae585
rename from rt/clock_getcpuclockid.c
b9ae585
rename to time/clock_getcpuclockid.c
b9ae585
index 22b9f1383c8bc180..8d205abfa96c8682 100644
b9ae585
--- a/rt/clock_getcpuclockid.c
b9ae585
+++ b/time/clock_getcpuclockid.c
b9ae585
@@ -19,6 +19,7 @@
b9ae585
 #include <errno.h>
b9ae585
 #include <time.h>
b9ae585
 #include <unistd.h>
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 int
b9ae585
 __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
b9ae585
@@ -37,4 +38,10 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
b9ae585
   return ENOENT;
b9ae585
 #endif
b9ae585
 }
b9ae585
-weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
b9ae585
+versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17);
b9ae585
+/* clock_getcpuclockid moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_getcpuclockid, __clock_getcpuclockid_2);
b9ae585
+compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2);
b9ae585
+#endif
b9ae585
diff --git a/rt/clock_getres.c b/time/clock_getres.c
b9ae585
similarity index 73%
b9ae585
rename from rt/clock_getres.c
b9ae585
rename to time/clock_getres.c
b9ae585
index b990bf0af0f6718a..412f80fbec345e5f 100644
b9ae585
--- a/rt/clock_getres.c
b9ae585
+++ b/time/clock_getres.c
b9ae585
@@ -18,6 +18,7 @@
b9ae585
 
b9ae585
 #include <errno.h>
b9ae585
 #include <time.h>
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 /* Get resolution of clock.  */
b9ae585
 int
b9ae585
@@ -26,5 +27,13 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
b9ae585
   __set_errno (ENOSYS);
b9ae585
   return -1;
b9ae585
 }
b9ae585
-weak_alias (__clock_getres, clock_getres)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
b9ae585
+/* clock_getres moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_getres, __clock_getres_2);
b9ae585
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
b9ae585
+#endif
b9ae585
+
b9ae585
 stub_warning (clock_getres)
b9ae585
diff --git a/rt/clock_gettime.c b/time/clock_gettime.c
b9ae585
similarity index 74%
b9ae585
rename from rt/clock_gettime.c
b9ae585
rename to time/clock_gettime.c
b9ae585
index 0426dd2c764d315c..92c6081dcb29684d 100644
b9ae585
--- a/rt/clock_gettime.c
b9ae585
+++ b/time/clock_gettime.c
b9ae585
@@ -18,6 +18,7 @@
b9ae585
 
b9ae585
 #include <errno.h>
b9ae585
 #include <time.h>
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 /* Get current value of CLOCK and store it in TP.  */
b9ae585
 int
b9ae585
@@ -26,6 +27,14 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
b9ae585
   __set_errno (ENOSYS);
b9ae585
   return -1;
b9ae585
 }
b9ae585
-weak_alias (__clock_gettime, clock_gettime)
b9ae585
 libc_hidden_def (__clock_gettime)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
b9ae585
+/* clock_gettime moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_gettime, __clock_gettime_2);
b9ae585
+compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
b9ae585
+#endif
b9ae585
+
b9ae585
 stub_warning (clock_gettime)
b9ae585
diff --git a/rt/clock_nanosleep.c b/time/clock_nanosleep.c
b9ae585
similarity index 76%
b9ae585
rename from rt/clock_nanosleep.c
b9ae585
rename to time/clock_nanosleep.c
b9ae585
index 5b724e593bf790ad..c53c820880ad7186 100644
b9ae585
--- a/rt/clock_nanosleep.c
b9ae585
+++ b/time/clock_nanosleep.c
b9ae585
@@ -18,6 +18,7 @@
b9ae585
 
b9ae585
 #include <errno.h>
b9ae585
 #include <time.h>
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 int
b9ae585
 __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
b9ae585
@@ -33,5 +34,13 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
b9ae585
   /* Not implemented.  */
b9ae585
   return ENOSYS;
b9ae585
 }
b9ae585
-weak_alias (__clock_nanosleep, clock_nanosleep)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
b9ae585
+/* clock_nanosleep moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_nanosleep, __clock_nanosleep_2);
b9ae585
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
b9ae585
+#endif
b9ae585
+
b9ae585
 stub_warning (clock_nanosleep)
b9ae585
diff --git a/rt/clock_settime.c b/time/clock_settime.c
b9ae585
similarity index 71%
b9ae585
rename from rt/clock_settime.c
b9ae585
rename to time/clock_settime.c
b9ae585
index 891925ab2c2ee307..dd86a1c189deba7a 100644
b9ae585
--- a/rt/clock_settime.c
b9ae585
+++ b/time/clock_settime.c
b9ae585
@@ -18,6 +18,7 @@
b9ae585
 
b9ae585
 #include <errno.h>
b9ae585
 #include <time.h>
b9ae585
+#include <shlib-compat.h>
b9ae585
 
b9ae585
 /* Set CLOCK to value TP.  */
b9ae585
 int
b9ae585
@@ -26,5 +27,14 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
b9ae585
   __set_errno (ENOSYS);
b9ae585
   return -1;
b9ae585
 }
b9ae585
-weak_alias (__clock_settime, clock_settime)
b9ae585
+libc_hidden_def (__clock_settime)
b9ae585
+
b9ae585
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
b9ae585
+/* clock_settime moved to libc in version 2.17;
b9ae585
+   old binaries may expect the symbol version it had in librt.  */
b9ae585
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
b9ae585
+strong_alias (__clock_settime, __clock_settime_2);
b9ae585
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
b9ae585
+#endif
b9ae585
+
b9ae585
 stub_warning (clock_settime)
b9ae585
diff --git a/rt/tst-clock.c b/time/tst-clock.c
b9ae585
similarity index 100%
b9ae585
rename from rt/tst-clock.c
b9ae585
rename to time/tst-clock.c
b9ae585
diff --git a/rt/tst-clock2.c b/time/tst-clock2.c
b9ae585
similarity index 100%
b9ae585
rename from rt/tst-clock2.c
b9ae585
rename to time/tst-clock2.c
b9ae585
diff --git a/rt/tst-clock_nanosleep.c b/time/tst-clock_nanosleep.c
b9ae585
similarity index 100%
b9ae585
rename from rt/tst-clock_nanosleep.c
b9ae585
rename to time/tst-clock_nanosleep.c
b9ae585
diff --git a/rt/tst-cpuclock1.c b/time/tst-cpuclock1.c
b9ae585
similarity index 100%
b9ae585
rename from rt/tst-cpuclock1.c
b9ae585
rename to time/tst-cpuclock1.c