dfa500
commit 7b5af2d8f2a2b858319a792678b15a0db08764c7
dfa500
Author: Zack Weinberg <zackw@panix.com>
dfa500
Date:   Wed Sep 4 08:18:57 2019 +0200
dfa500
dfa500
    Finish move of clock_* functions to libc. [BZ #24959]
dfa500
    
dfa500
    In glibc 2.17, the functions clock_getcpuclockid, clock_getres,
dfa500
    clock_gettime, clock_nanosleep, and clock_settime were moved from
dfa500
    librt.so to libc.so, leaving compatibility stubs behind.  Now that the
dfa500
    dynamic linker no longer insists on finding versioned symbols in the
dfa500
    same library that originally defined them, we do not need the stubs
dfa500
    anymore, and this means we don't need GLIBC_PRIVATE __-prefix aliases
dfa500
    for most of the functions anymore either.  (clock_gettime still needs
dfa500
    one.)  For ports added before 2.17, libc.so needs to provide two
dfa500
    symbol versions for each, the default at GLIBC_2.17 plus a compat
dfa500
    version matching what librt had.
dfa500
    
dfa500
    While I'm at it, move the clock_*.c files and their tests from rt/ to
dfa500
    time/.
dfa500
dfa500
 Conflicts:
dfa500
	rt/clock-compat.c
dfa500
	  (Removal after copyright year update upstream.)
dfa500
	sysdeps/unix/sysv/linux/arm/be/libc.abilist
dfa500
	sysdeps/unix/sysv/linux/arm/le/librt.abilist
dfa500
	sysdeps/unix/sysv/linux/microblaze/le/librt.abilist
dfa500
	sysdeps/unix/sysv/linux/sh/be/libc.abilist
dfa500
	sysdeps/unix/sysv/linux/sh/le/librt.abilist
dfa500
	  (These ABI lists were split into be/le variants upstream.
dfa500
	  The choice of files here reflects the decision of the Git
dfa500
	  rename detection for the source of the unsplit ABI list
dfa500
	  update.)
dfa500
	time/Makefile
dfa500
	  (Missing tests downstream.)
dfa500
dfa500
diff --git a/include/time.h b/include/time.h
dfa500
index 23d2580528b02490..832ee6896e1ca537 100644
dfa500
--- a/include/time.h
dfa500
+++ b/include/time.h
dfa500
@@ -16,12 +16,10 @@ libc_hidden_proto (localtime)
dfa500
 libc_hidden_proto (strftime)
dfa500
 libc_hidden_proto (strptime)
dfa500
 
dfa500
-extern __typeof (clock_getres) __clock_getres;
dfa500
 extern __typeof (clock_gettime) __clock_gettime;
dfa500
 libc_hidden_proto (__clock_gettime)
dfa500
 extern __typeof (clock_settime) __clock_settime;
dfa500
-extern __typeof (clock_nanosleep) __clock_nanosleep;
dfa500
-extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
dfa500
+libc_hidden_proto (__clock_settime)
dfa500
 
dfa500
 /* Now define the internal interfaces.  */
dfa500
 struct tm;
dfa500
diff --git a/rt/Makefile b/rt/Makefile
dfa500
index 14f38ef74d262188..de53133cedc778f6 100644
dfa500
--- a/rt/Makefile
dfa500
+++ b/rt/Makefile
dfa500
@@ -28,9 +28,6 @@ aio-routines   := aio_cancel aio_error aio_fsync aio_misc aio_read	\
dfa500
 		  aio_read64 aio_return aio_suspend aio_write		\
dfa500
 		  aio_write64 lio_listio lio_listio64 aio_sigqueue	\
dfa500
 		  aio_notify
dfa500
-clock-routines := clock_getcpuclockid					\
dfa500
-		  clock_getres clock_gettime clock_settime		\
dfa500
-		  clock_nanosleep
dfa500
 timer-routines := timer_create timer_delete timer_getoverr		\
dfa500
 		  timer_gettime timer_settime
dfa500
 shm-routines   := shm_open shm_unlink
dfa500
@@ -38,22 +35,18 @@ mq-routines    := mq_open mq_close mq_unlink mq_getattr mq_setattr	\
dfa500
 		  mq_notify mq_send mq_receive mq_timedsend		\
dfa500
 		  mq_timedreceive
dfa500
 
dfa500
-routines = $(clock-routines)
dfa500
-
dfa500
 librt-routines = $(aio-routines) \
dfa500
 		 $(timer-routines) \
dfa500
-		 $(shm-routines) $(mq-routines) \
dfa500
-		 clock-compat
dfa500
+		 $(shm-routines) $(mq-routines)
dfa500
 
dfa500
-tests := tst-shm tst-clock tst-clock_nanosleep tst-timer tst-timer2 \
dfa500
+tests := tst-shm tst-timer tst-timer2 \
dfa500
 	 tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \
dfa500
 	 tst-aio7 tst-aio8 tst-aio9 tst-aio10 \
dfa500
 	 tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
dfa500
 	 tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \
dfa500
 	 tst-timer3 tst-timer4 tst-timer5 \
dfa500
-	 tst-cpuclock1 tst-cpuclock2 \
dfa500
-	 tst-cputimer1 tst-cputimer2 tst-cputimer3 \
dfa500
-	 tst-clock2 tst-shm-cancel
dfa500
+	 tst-cpuclock2 tst-cputimer1 tst-cputimer2 tst-cputimer3 \
dfa500
+	 tst-shm-cancel
dfa500
 
dfa500
 extra-libs := librt
dfa500
 extra-libs-others := $(extra-libs)
dfa500
diff --git a/rt/Versions b/rt/Versions
dfa500
index 91e3fd2a204ded9c..84d1345420dc4dc4 100644
dfa500
--- a/rt/Versions
dfa500
+++ b/rt/Versions
dfa500
@@ -1,15 +1,3 @@
dfa500
-libc {
dfa500
-  GLIBC_2.17 {
dfa500
-    # c*
dfa500
-    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
dfa500
-    clock_nanosleep;
dfa500
-  }
dfa500
-  GLIBC_PRIVATE {
dfa500
-    __clock_getres; __clock_gettime; __clock_settime; __clock_getcpuclockid;
dfa500
-    __clock_nanosleep;
dfa500
-  }
dfa500
-}
dfa500
-
dfa500
 librt {
dfa500
   GLIBC_2.1 {
dfa500
     # AIO functions.
dfa500
@@ -18,10 +6,6 @@ librt {
dfa500
     aio_suspend64; aio_write; aio_write64; lio_listio; lio_listio64;
dfa500
   }
dfa500
   GLIBC_2.2 {
dfa500
-    # These have moved to libc and are still here only for compatibility.
dfa500
-    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
dfa500
-    clock_nanosleep;
dfa500
-
dfa500
     # s*
dfa500
     shm_open; shm_unlink;
dfa500
 
dfa500
diff --git a/rt/clock-compat.c b/rt/clock-compat.c
dfa500
deleted file mode 100644
dfa500
index 11e71aa89019b173..0000000000000000
dfa500
--- a/rt/clock-compat.c
dfa500
+++ /dev/null
dfa500
@@ -1,63 +0,0 @@
dfa500
-/* ABI compatibility redirects for clock_* symbols in librt.
dfa500
-   Copyright (C) 2012-2018 Free Software Foundation, Inc.
dfa500
-   This file is part of the GNU C Library.
dfa500
-
dfa500
-   The GNU C Library is free software; you can redistribute it and/or
dfa500
-   modify it under the terms of the GNU Lesser General Public
dfa500
-   License as published by the Free Software Foundation; either
dfa500
-   version 2.1 of the License, or (at your option) any later version.
dfa500
-
dfa500
-   The GNU C Library is distributed in the hope that it will be useful,
dfa500
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
dfa500
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dfa500
-   Lesser General Public License for more details.
dfa500
-
dfa500
-   You should have received a copy of the GNU Lesser General Public
dfa500
-   License along with the GNU C Library; if not, see
dfa500
-   <http://www.gnu.org/licenses/>.  */
dfa500
-
dfa500
-#include <shlib-compat.h>
dfa500
-
dfa500
-/* The clock_* symbols were originally defined in librt and so
dfa500
-   are part of its ABI.  As of 2.17, they have moved to libc.
dfa500
-   So we supply definitions for librt that just redirect to
dfa500
-   their libc counterparts.  */
dfa500
-
dfa500
-#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
dfa500
-
dfa500
-#include <time.h>
dfa500
-
dfa500
-#if HAVE_IFUNC
dfa500
-# undef INIT_ARCH
dfa500
-# define INIT_ARCH()
dfa500
-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \
dfa500
-    compat_symbol (librt, name, name, GLIBC_2_2);
dfa500
-#else
dfa500
-# define COMPAT_REDIRECT(name, proto, arglist)				      \
dfa500
-  int									      \
dfa500
-  name proto								      \
dfa500
-  {									      \
dfa500
-    return __##name arglist;						      \
dfa500
-  }									      \
dfa500
-  compat_symbol (librt, name, name, GLIBC_2_2);
dfa500
-#endif
dfa500
-
dfa500
-COMPAT_REDIRECT (clock_getres,
dfa500
-		 (clockid_t clock_id, struct timespec *res),
dfa500
-		 (clock_id, res))
dfa500
-COMPAT_REDIRECT (clock_gettime,
dfa500
-		 (clockid_t clock_id, struct timespec *tp),
dfa500
-		 (clock_id, tp))
dfa500
-COMPAT_REDIRECT (clock_settime,
dfa500
-		 (clockid_t clock_id, const struct timespec *tp),
dfa500
-		 (clock_id, tp))
dfa500
-COMPAT_REDIRECT (clock_getcpuclockid,
dfa500
-		 (pid_t pid, clockid_t *clock_id),
dfa500
-		 (pid, clock_id))
dfa500
-COMPAT_REDIRECT (clock_nanosleep,
dfa500
-		 (clockid_t clock_id, int flags,
dfa500
-		  const struct timespec *req,
dfa500
-		  struct timespec *rem),
dfa500
-		 (clock_id, flags, req, rem))
dfa500
-
dfa500
-#endif
dfa500
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
dfa500
index e3fc05137b18194b..f89ef9a43251c164 100644
dfa500
--- a/sysdeps/mach/hurd/i386/libc.abilist
dfa500
+++ b/sysdeps/mach/hurd/i386/libc.abilist
dfa500
@@ -711,6 +711,11 @@ GLIBC_2.2.6 clntudp_bufcreate F
dfa500
 GLIBC_2.2.6 clntudp_create F
dfa500
 GLIBC_2.2.6 clntunix_create F
dfa500
 GLIBC_2.2.6 clock F
dfa500
+GLIBC_2.2.6 clock_getcpuclockid F
dfa500
+GLIBC_2.2.6 clock_getres F
dfa500
+GLIBC_2.2.6 clock_gettime F
dfa500
+GLIBC_2.2.6 clock_nanosleep F
dfa500
+GLIBC_2.2.6 clock_settime F
dfa500
 GLIBC_2.2.6 close F
dfa500
 GLIBC_2.2.6 closedir F
dfa500
 GLIBC_2.2.6 closelog F
dfa500
diff --git a/sysdeps/mach/hurd/i386/librt.abilist b/sysdeps/mach/hurd/i386/librt.abilist
dfa500
index d5fe32b3a9917254..3726e41f06cc500c 100644
dfa500
--- a/sysdeps/mach/hurd/i386/librt.abilist
dfa500
+++ b/sysdeps/mach/hurd/i386/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.2.6 aio_suspend F
dfa500
 GLIBC_2.2.6 aio_suspend64 F
dfa500
 GLIBC_2.2.6 aio_write F
dfa500
 GLIBC_2.2.6 aio_write64 F
dfa500
-GLIBC_2.2.6 clock_getcpuclockid F
dfa500
-GLIBC_2.2.6 clock_getres F
dfa500
-GLIBC_2.2.6 clock_gettime F
dfa500
-GLIBC_2.2.6 clock_nanosleep F
dfa500
-GLIBC_2.2.6 clock_settime F
dfa500
 GLIBC_2.2.6 lio_listio F
dfa500
 GLIBC_2.2.6 lio_listio64 F
dfa500
 GLIBC_2.2.6 shm_open F
dfa500
diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
dfa500
index 5b0d8eb8a1a0593e..7408197420b14aad 100644
dfa500
--- a/sysdeps/posix/clock_getres.c
dfa500
+++ b/sysdeps/posix/clock_getres.c
dfa500
@@ -22,7 +22,7 @@
dfa500
 #include <unistd.h>
dfa500
 #include <sys/param.h>
dfa500
 #include <libc-internal.h>
dfa500
-
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 static inline int
dfa500
 realtime_getres (struct timespec *res)
dfa500
@@ -62,4 +62,11 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
dfa500
 
dfa500
   return retval;
dfa500
 }
dfa500
-weak_alias (__clock_getres, clock_getres)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
dfa500
+/* clock_getres moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_getres, __clock_getres_2);
dfa500
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
dfa500
index f3ebbe15ccc2e95e..3ad8ea87bb7d379b 100644
dfa500
--- a/sysdeps/unix/clock_gettime.c
dfa500
+++ b/sysdeps/unix/clock_gettime.c
dfa500
@@ -17,24 +17,9 @@
dfa500
    <http://www.gnu.org/licenses/>.  */
dfa500
 
dfa500
 #include <errno.h>
dfa500
-#include <stdint.h>
dfa500
 #include <time.h>
dfa500
 #include <sys/time.h>
dfa500
-#include <libc-internal.h>
dfa500
-#include <ldsodefs.h>
dfa500
-
dfa500
-
dfa500
-static inline int
dfa500
-realtime_gettime (struct timespec *tp)
dfa500
-{
dfa500
-  struct timeval tv;
dfa500
-  int retval = __gettimeofday (&tv, NULL);
dfa500
-  if (retval == 0)
dfa500
-    /* Convert into `timespec'.  */
dfa500
-    TIMEVAL_TO_TIMESPEC (&tv, tp);
dfa500
-  return retval;
dfa500
-}
dfa500
-
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 /* Get current value of CLOCK and store it in TP.  */
dfa500
 int
dfa500
@@ -60,5 +45,12 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
dfa500
 
dfa500
   return retval;
dfa500
 }
dfa500
-weak_alias (__clock_gettime, clock_gettime)
dfa500
 libc_hidden_def (__clock_gettime)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
dfa500
+/* clock_gettime moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_gettime, __clock_gettime_2);
dfa500
+compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/clock_nanosleep.c b/sysdeps/unix/clock_nanosleep.c
dfa500
index 13dd0f4b905ec631..6513e2d64614c561 100644
dfa500
--- a/sysdeps/unix/clock_nanosleep.c
dfa500
+++ b/sysdeps/unix/clock_nanosleep.c
dfa500
@@ -20,6 +20,7 @@
dfa500
 #include <errno.h>
dfa500
 #include <time.h>
dfa500
 #include <sysdep-cancel.h>
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 /* This implementation assumes that these is only a `nanosleep' system
dfa500
    call.  So we have to remap all other activities.  */
dfa500
@@ -76,4 +77,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
dfa500
 
dfa500
   return __nanosleep (req, rem), 0 ? errno : 0;
dfa500
 }
dfa500
-weak_alias (__clock_nanosleep, clock_nanosleep)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
dfa500
+/* clock_nanosleep moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_nanosleep, __clock_nanosleep_2);
dfa500
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c
dfa500
index 4f5640f67047cef6..123b6f44ee3831d9 100644
dfa500
--- a/sysdeps/unix/clock_settime.c
dfa500
+++ b/sysdeps/unix/clock_settime.c
dfa500
@@ -18,8 +18,7 @@
dfa500
 #include <errno.h>
dfa500
 #include <time.h>
dfa500
 #include <sys/time.h>
dfa500
-#include <ldsodefs.h>
dfa500
-
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 /* Set CLOCK to value TP.  */
dfa500
 int
dfa500
@@ -51,4 +50,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
dfa500
 
dfa500
   return retval;
dfa500
 }
dfa500
-weak_alias (__clock_settime, clock_settime)
dfa500
+libc_hidden_def (__clock_settime)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
dfa500
+/* clock_settime moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_settime, __clock_settime_2);
dfa500
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
dfa500
index e22b91655dd5f7e0..77f0432d0f1f5aab 100644
dfa500
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
dfa500
@@ -1863,6 +1863,11 @@ GLIBC_2.2 __xpg_sigpause F
dfa500
 GLIBC_2.2 _flushlbf F
dfa500
 GLIBC_2.2 _res_hconf D 0x48
dfa500
 GLIBC_2.2 bind_textdomain_codeset F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 dngettext F
dfa500
 GLIBC_2.2 fgetpos F
dfa500
diff --git a/sysdeps/unix/sysv/linux/alpha/librt.abilist b/sysdeps/unix/sysv/linux/alpha/librt.abilist
dfa500
index d7a049cf600e2966..71f86e03ce67fd19 100644
dfa500
--- a/sysdeps/unix/sysv/linux/alpha/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/alpha/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist
dfa500
index a231812eea6dc556..e748ec28912ce773 100644
dfa500
--- a/sysdeps/unix/sysv/linux/arm/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/arm/libc.abilist
dfa500
@@ -759,6 +759,11 @@ GLIBC_2.4 clntudp_bufcreate F
dfa500
 GLIBC_2.4 clntudp_create F
dfa500
 GLIBC_2.4 clntunix_create F
dfa500
 GLIBC_2.4 clock F
dfa500
+GLIBC_2.4 clock_getcpuclockid F
dfa500
+GLIBC_2.4 clock_getres F
dfa500
+GLIBC_2.4 clock_gettime F
dfa500
+GLIBC_2.4 clock_nanosleep F
dfa500
+GLIBC_2.4 clock_settime F
dfa500
 GLIBC_2.4 clone F
dfa500
 GLIBC_2.4 close F
dfa500
 GLIBC_2.4 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/arm/librt.abilist b/sysdeps/unix/sysv/linux/arm/librt.abilist
dfa500
index cfbbd2755765e720..3c0647b2516bb51d 100644
dfa500
--- a/sysdeps/unix/sysv/linux/arm/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/arm/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F
dfa500
 GLIBC_2.4 aio_suspend64 F
dfa500
 GLIBC_2.4 aio_write F
dfa500
 GLIBC_2.4 aio_write64 F
dfa500
-GLIBC_2.4 clock_getcpuclockid F
dfa500
-GLIBC_2.4 clock_getres F
dfa500
-GLIBC_2.4 clock_gettime F
dfa500
-GLIBC_2.4 clock_nanosleep F
dfa500
-GLIBC_2.4 clock_settime F
dfa500
 GLIBC_2.4 lio_listio F
dfa500
 GLIBC_2.4 lio_listio64 F
dfa500
 GLIBC_2.4 mq_close F
dfa500
diff --git a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
dfa500
index 190a47950eb1d177..877f4f3c7916a534 100644
dfa500
--- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
dfa500
+++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
dfa500
@@ -20,6 +20,7 @@
dfa500
 #include <time.h>
dfa500
 #include <unistd.h>
dfa500
 #include "kernel-posix-cpu-timers.h"
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 int
dfa500
 __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
dfa500
@@ -45,4 +46,11 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
dfa500
   else
dfa500
     return INTERNAL_SYSCALL_ERRNO (r, err);
dfa500
 }
dfa500
-weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17);
dfa500
+/* clock_getcpuclockid moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_getcpuclockid, __clock_getcpuclockid_2);
dfa500
+compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c
dfa500
index 2517e66910a79d93..1fbb638097ba4a80 100644
dfa500
--- a/sysdeps/unix/sysv/linux/clock_getres.c
dfa500
+++ b/sysdeps/unix/sysv/linux/clock_getres.c
dfa500
@@ -26,10 +26,19 @@
dfa500
 #endif
dfa500
 #include <sysdep-vdso.h>
dfa500
 
dfa500
+#include <shlib-compat.h>
dfa500
+
dfa500
 /* Get resolution of clock.  */
dfa500
 int
dfa500
 __clock_getres (clockid_t clock_id, struct timespec *res)
dfa500
 {
dfa500
   return INLINE_VSYSCALL (clock_getres, 2, clock_id, res);
dfa500
 }
dfa500
-weak_alias (__clock_getres, clock_getres)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
dfa500
+/* clock_getres moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_getres, __clock_getres_2);
dfa500
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
dfa500
index dadfc518b74baea0..3f8feb37a1795306 100644
dfa500
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
dfa500
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
dfa500
@@ -26,11 +26,20 @@
dfa500
 #endif
dfa500
 #include <sysdep-vdso.h>
dfa500
 
dfa500
+#include <shlib-compat.h>
dfa500
+
dfa500
 /* Get current value of CLOCK and store it in TP.  */
dfa500
 int
dfa500
 __clock_gettime (clockid_t clock_id, struct timespec *tp)
dfa500
 {
dfa500
   return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
dfa500
 }
dfa500
-weak_alias (__clock_gettime, clock_gettime)
dfa500
 libc_hidden_def (__clock_gettime)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
dfa500
+/* clock_gettime moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_gettime, __clock_gettime_2);
dfa500
+compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c
dfa500
index 93d5d6ef120ca9ef..a90da63069b7f0f8 100644
dfa500
--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c
dfa500
+++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c
dfa500
@@ -21,6 +21,7 @@
dfa500
 #include <sysdep-cancel.h>
dfa500
 #include "kernel-posix-cpu-timers.h"
dfa500
 
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 /* We can simply use the syscall.  The CPU clocks are not supported
dfa500
    with this function.  */
dfa500
@@ -51,4 +52,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
dfa500
   return (INTERNAL_SYSCALL_ERROR_P (r, err)
dfa500
 	  ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
dfa500
 }
dfa500
-weak_alias (__clock_nanosleep, clock_nanosleep)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
dfa500
+/* clock_nanosleep moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_nanosleep, __clock_nanosleep_2);
dfa500
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c
dfa500
index c71461a4f6deac5a..21efc6c982c084b4 100644
dfa500
--- a/sysdeps/unix/sysv/linux/clock_settime.c
dfa500
+++ b/sysdeps/unix/sysv/linux/clock_settime.c
dfa500
@@ -18,6 +18,7 @@
dfa500
 #include <errno.h>
dfa500
 #include <sysdep.h>
dfa500
 #include <time.h>
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 #include "kernel-posix-cpu-timers.h"
dfa500
 
dfa500
@@ -34,4 +35,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
dfa500
 
dfa500
   return INLINE_SYSCALL_CALL (clock_settime, clock_id, tp);
dfa500
 }
dfa500
-weak_alias (__clock_settime, clock_settime)
dfa500
+libc_hidden_def (__clock_settime)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
dfa500
+/* clock_settime moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_settime, __clock_settime_2);
dfa500
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
dfa500
index 24b11b15c0e71140..d34f040d85cc5bb2 100644
dfa500
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
dfa500
@@ -615,6 +615,11 @@ GLIBC_2.2 clntudp_bufcreate F
dfa500
 GLIBC_2.2 clntudp_create F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
 GLIBC_2.2 clock F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 clone F
dfa500
 GLIBC_2.2 close F
dfa500
 GLIBC_2.2 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist
dfa500
index 595f1b712a4e8d70..bb03781dcc04d219 100644
dfa500
--- a/sysdeps/unix/sysv/linux/hppa/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
dfa500
index 9762c81365b0abcd..48e838fc2813df0d 100644
dfa500
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
dfa500
@@ -1869,6 +1869,11 @@ GLIBC_2.2 _flushlbf F
dfa500
 GLIBC_2.2 _res_hconf D 0x30
dfa500
 GLIBC_2.2 alphasort64 F
dfa500
 GLIBC_2.2 bind_textdomain_codeset F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 dngettext F
dfa500
 GLIBC_2.2 fgetpos F
dfa500
diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist
dfa500
index 595f1b712a4e8d70..bb03781dcc04d219 100644
dfa500
--- a/sysdeps/unix/sysv/linux/i386/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/i386/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
dfa500
index 50c94adff93b5bb4..e9fe0697b784be64 100644
dfa500
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
dfa500
@@ -627,6 +627,11 @@ GLIBC_2.2 clntudp_bufcreate F
dfa500
 GLIBC_2.2 clntudp_create F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
 GLIBC_2.2 clock F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 close F
dfa500
 GLIBC_2.2 closedir F
dfa500
 GLIBC_2.2 closelog F
dfa500
diff --git a/sysdeps/unix/sysv/linux/ia64/librt.abilist b/sysdeps/unix/sysv/linux/ia64/librt.abilist
dfa500
index 804622a14abd8ea9..08384c906518837d 100644
dfa500
--- a/sysdeps/unix/sysv/linux/ia64/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/ia64/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
dfa500
index f57be98e494d0701..98f07b79918d1c17 100644
dfa500
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
dfa500
@@ -748,6 +748,11 @@ GLIBC_2.4 clntudp_bufcreate F
dfa500
 GLIBC_2.4 clntudp_create F
dfa500
 GLIBC_2.4 clntunix_create F
dfa500
 GLIBC_2.4 clock F
dfa500
+GLIBC_2.4 clock_getcpuclockid F
dfa500
+GLIBC_2.4 clock_getres F
dfa500
+GLIBC_2.4 clock_gettime F
dfa500
+GLIBC_2.4 clock_nanosleep F
dfa500
+GLIBC_2.4 clock_settime F
dfa500
 GLIBC_2.4 clone F
dfa500
 GLIBC_2.4 close F
dfa500
 GLIBC_2.4 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
dfa500
index cfbbd2755765e720..3c0647b2516bb51d 100644
dfa500
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F
dfa500
 GLIBC_2.4 aio_suspend64 F
dfa500
 GLIBC_2.4 aio_write F
dfa500
 GLIBC_2.4 aio_write64 F
dfa500
-GLIBC_2.4 clock_getcpuclockid F
dfa500
-GLIBC_2.4 clock_getres F
dfa500
-GLIBC_2.4 clock_gettime F
dfa500
-GLIBC_2.4 clock_nanosleep F
dfa500
-GLIBC_2.4 clock_settime F
dfa500
 GLIBC_2.4 lio_listio F
dfa500
 GLIBC_2.4 lio_listio64 F
dfa500
 GLIBC_2.4 mq_close F
dfa500
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
dfa500
index ddc7ebca673a466c..6a60d7876120f2f2 100644
dfa500
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
dfa500
@@ -1825,6 +1825,11 @@ GLIBC_2.2 _flushlbf F
dfa500
 GLIBC_2.2 _res_hconf D 0x30
dfa500
 GLIBC_2.2 alphasort64 F
dfa500
 GLIBC_2.2 bind_textdomain_codeset F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 dngettext F
dfa500
 GLIBC_2.2 fgetpos F
dfa500
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
dfa500
index 595f1b712a4e8d70..bb03781dcc04d219 100644
dfa500
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/microblaze/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/librt.abilist
dfa500
index fb85d8729e1bc69d..889dfbc0eef5e75a 100644
dfa500
--- a/sysdeps/unix/sysv/linux/microblaze/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/microblaze/librt.abilist
dfa500
@@ -14,11 +14,6 @@ GLIBC_2.18 aio_suspend F
dfa500
 GLIBC_2.18 aio_suspend64 F
dfa500
 GLIBC_2.18 aio_write F
dfa500
 GLIBC_2.18 aio_write64 F
dfa500
-GLIBC_2.18 clock_getcpuclockid F
dfa500
-GLIBC_2.18 clock_getres F
dfa500
-GLIBC_2.18 clock_gettime F
dfa500
-GLIBC_2.18 clock_nanosleep F
dfa500
-GLIBC_2.18 clock_settime F
dfa500
 GLIBC_2.18 lio_listio F
dfa500
 GLIBC_2.18 lio_listio64 F
dfa500
 GLIBC_2.18 mq_close F
dfa500
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
dfa500
index dda9797e0ea736f6..34a24582ca7a4a08 100644
dfa500
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
dfa500
@@ -1612,6 +1612,11 @@ GLIBC_2.2 capget F
dfa500
 GLIBC_2.2 capset F
dfa500
 GLIBC_2.2 cbc_crypt F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 creat64 F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 des_setparity F
dfa500
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
dfa500
index 84837c8a2ef02e1b..1539c1cef92bccfd 100644
dfa500
--- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
dfa500
 GLIBC_2.2 aio_suspend64 F
dfa500
 GLIBC_2.2 aio_write F
dfa500
 GLIBC_2.2 aio_write64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 lio_listio F
dfa500
 GLIBC_2.2 lio_listio64 F
dfa500
 GLIBC_2.2 shm_open F
dfa500
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
dfa500
index 42e930d56595083e..176a57298a45d492 100644
dfa500
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
dfa500
@@ -1610,6 +1610,11 @@ GLIBC_2.2 capget F
dfa500
 GLIBC_2.2 capset F
dfa500
 GLIBC_2.2 cbc_crypt F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 creat64 F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 des_setparity F
dfa500
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
dfa500
index 84837c8a2ef02e1b..1539c1cef92bccfd 100644
dfa500
--- a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
dfa500
 GLIBC_2.2 aio_suspend64 F
dfa500
 GLIBC_2.2 aio_write F
dfa500
 GLIBC_2.2 aio_write64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 lio_listio F
dfa500
 GLIBC_2.2 lio_listio64 F
dfa500
 GLIBC_2.2 shm_open F
dfa500
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
dfa500
index f89b44f3a14d0f85..5a66ffd67e5cf364 100644
dfa500
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
dfa500
@@ -1611,6 +1611,11 @@ GLIBC_2.2 capget F
dfa500
 GLIBC_2.2 capset F
dfa500
 GLIBC_2.2 cbc_crypt F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 creat64 F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 des_setparity F
dfa500
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
dfa500
index 1486af11d755d37e..a817f33695a5230f 100644
dfa500
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
dfa500
@@ -1607,6 +1607,11 @@ GLIBC_2.2 capget F
dfa500
 GLIBC_2.2 capset F
dfa500
 GLIBC_2.2 cbc_crypt F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 creat64 F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 des_setparity F
dfa500
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
dfa500
index 45839ed25b0fde5f..d5e121b76e583f4c 100644
dfa500
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
dfa500
@@ -1830,6 +1830,11 @@ GLIBC_2.2 __xstat64 F
dfa500
 GLIBC_2.2 _flushlbf F
dfa500
 GLIBC_2.2 _res_hconf D 0x30
dfa500
 GLIBC_2.2 bind_textdomain_codeset F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 dngettext F
dfa500
 GLIBC_2.2 fgetpos F
dfa500
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
dfa500
index 595f1b712a4e8d70..bb03781dcc04d219 100644
dfa500
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
dfa500
index 344e5ae87c5d76b2..3dfddbddb3a11180 100644
dfa500
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
dfa500
@@ -1834,6 +1834,11 @@ GLIBC_2.2 __xstat64 F
dfa500
 GLIBC_2.2 _flushlbf F
dfa500
 GLIBC_2.2 _res_hconf D 0x30
dfa500
 GLIBC_2.2 bind_textdomain_codeset F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 dngettext F
dfa500
 GLIBC_2.2 fgetpos F
dfa500
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
dfa500
index 8c1781adf49a7432..06ce341194a37dd4 100644
dfa500
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
dfa500
@@ -670,6 +670,11 @@ GLIBC_2.3 clntudp_bufcreate F
dfa500
 GLIBC_2.3 clntudp_create F
dfa500
 GLIBC_2.3 clntunix_create F
dfa500
 GLIBC_2.3 clock F
dfa500
+GLIBC_2.3 clock_getcpuclockid F
dfa500
+GLIBC_2.3 clock_getres F
dfa500
+GLIBC_2.3 clock_gettime F
dfa500
+GLIBC_2.3 clock_nanosleep F
dfa500
+GLIBC_2.3 clock_settime F
dfa500
 GLIBC_2.3 clone F
dfa500
 GLIBC_2.3 close F
dfa500
 GLIBC_2.3 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist
dfa500
index e76b7eb49566718b..6a5bd96963e67109 100644
dfa500
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.3 aio_suspend F
dfa500
 GLIBC_2.3 aio_suspend64 F
dfa500
 GLIBC_2.3 aio_write F
dfa500
 GLIBC_2.3 aio_write64 F
dfa500
-GLIBC_2.3 clock_getcpuclockid F
dfa500
-GLIBC_2.3 clock_getres F
dfa500
-GLIBC_2.3 clock_gettime F
dfa500
-GLIBC_2.3 clock_nanosleep F
dfa500
-GLIBC_2.3 clock_settime F
dfa500
 GLIBC_2.3 lio_listio F
dfa500
 GLIBC_2.3 lio_listio64 F
dfa500
 GLIBC_2.3 shm_open F
dfa500
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
dfa500
index 3a5ec2a1e47b5da5..02ff949c33197774 100644
dfa500
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
dfa500
@@ -1829,6 +1829,11 @@ GLIBC_2.2 _flushlbf F
dfa500
 GLIBC_2.2 _res_hconf D 0x30
dfa500
 GLIBC_2.2 alphasort64 F
dfa500
 GLIBC_2.2 bind_textdomain_codeset F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 dngettext F
dfa500
 GLIBC_2.2 fgetpos F
dfa500
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
dfa500
index 595f1b712a4e8d70..bb03781dcc04d219 100644
dfa500
--- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
dfa500
index 3b5465558b72f166..96693d41df267e1b 100644
dfa500
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
dfa500
@@ -632,6 +632,11 @@ GLIBC_2.2 clntudp_bufcreate F
dfa500
 GLIBC_2.2 clntudp_create F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
 GLIBC_2.2 clock F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 clone F
dfa500
 GLIBC_2.2 close F
dfa500
 GLIBC_2.2 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
dfa500
index 41be3bb84b6e4df0..5905498a488359d7 100644
dfa500
--- a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F
dfa500
 GLIBC_2.2 aio_suspend64 F
dfa500
 GLIBC_2.2 aio_write F
dfa500
 GLIBC_2.2 aio_write64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 lio_listio F
dfa500
 GLIBC_2.2 lio_listio64 F
dfa500
 GLIBC_2.2 shm_open F
dfa500
diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist
dfa500
index 1f4e648baade9c47..b126bda07a9cc58c 100644
dfa500
--- a/sysdeps/unix/sysv/linux/sh/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/sh/libc.abilist
dfa500
@@ -618,6 +618,11 @@ GLIBC_2.2 clntudp_bufcreate F
dfa500
 GLIBC_2.2 clntudp_create F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
 GLIBC_2.2 clock F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 clone F
dfa500
 GLIBC_2.2 close F
dfa500
 GLIBC_2.2 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/sh/librt.abilist b/sysdeps/unix/sysv/linux/sh/librt.abilist
dfa500
index 595f1b712a4e8d70..bb03781dcc04d219 100644
dfa500
--- a/sysdeps/unix/sysv/linux/sh/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/sh/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
dfa500
index d308ac8b0527cb3f..63b78d80b333d4b4 100644
dfa500
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
dfa500
@@ -1826,6 +1826,11 @@ GLIBC_2.2 __xstat64 F
dfa500
 GLIBC_2.2 _flushlbf F
dfa500
 GLIBC_2.2 _res_hconf D 0x30
dfa500
 GLIBC_2.2 bind_textdomain_codeset F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 dcngettext F
dfa500
 GLIBC_2.2 dngettext F
dfa500
 GLIBC_2.2 fgetpos F
dfa500
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
dfa500
index cb874f41477109c3..38f0aad791793010 100644
dfa500
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
dfa500
index 6731ebfc2877c5c6..a899eb6a92215b47 100644
dfa500
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
dfa500
@@ -660,6 +660,11 @@ GLIBC_2.2 clntudp_bufcreate F
dfa500
 GLIBC_2.2 clntudp_create F
dfa500
 GLIBC_2.2 clntunix_create F
dfa500
 GLIBC_2.2 clock F
dfa500
+GLIBC_2.2 clock_getcpuclockid F
dfa500
+GLIBC_2.2 clock_getres F
dfa500
+GLIBC_2.2 clock_gettime F
dfa500
+GLIBC_2.2 clock_nanosleep F
dfa500
+GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 clone F
dfa500
 GLIBC_2.2 close F
dfa500
 GLIBC_2.2 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
dfa500
index d7a049cf600e2966..71f86e03ce67fd19 100644
dfa500
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist
dfa500
@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F
dfa500
 GLIBC_2.1 aio_write64 F
dfa500
 GLIBC_2.1 lio_listio F
dfa500
 GLIBC_2.1 lio_listio64 F
dfa500
-GLIBC_2.2 clock_getcpuclockid F
dfa500
-GLIBC_2.2 clock_getres F
dfa500
-GLIBC_2.2 clock_gettime F
dfa500
-GLIBC_2.2 clock_nanosleep F
dfa500
-GLIBC_2.2 clock_settime F
dfa500
 GLIBC_2.2 shm_open F
dfa500
 GLIBC_2.2 shm_unlink F
dfa500
 GLIBC_2.2 timer_create F
dfa500
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
dfa500
index 816e4a742632ad44..0ebb018e2089c70a 100644
dfa500
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
dfa500
@@ -621,6 +621,11 @@ GLIBC_2.2.5 clntudp_bufcreate F
dfa500
 GLIBC_2.2.5 clntudp_create F
dfa500
 GLIBC_2.2.5 clntunix_create F
dfa500
 GLIBC_2.2.5 clock F
dfa500
+GLIBC_2.2.5 clock_getcpuclockid F
dfa500
+GLIBC_2.2.5 clock_getres F
dfa500
+GLIBC_2.2.5 clock_gettime F
dfa500
+GLIBC_2.2.5 clock_nanosleep F
dfa500
+GLIBC_2.2.5 clock_settime F
dfa500
 GLIBC_2.2.5 clone F
dfa500
 GLIBC_2.2.5 close F
dfa500
 GLIBC_2.2.5 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
dfa500
index e2e8b60bf8e29f55..95e3f22daa06b237 100644
dfa500
--- a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist
dfa500
@@ -13,11 +13,6 @@ GLIBC_2.2.5 aio_suspend F
dfa500
 GLIBC_2.2.5 aio_suspend64 F
dfa500
 GLIBC_2.2.5 aio_write F
dfa500
 GLIBC_2.2.5 aio_write64 F
dfa500
-GLIBC_2.2.5 clock_getcpuclockid F
dfa500
-GLIBC_2.2.5 clock_getres F
dfa500
-GLIBC_2.2.5 clock_gettime F
dfa500
-GLIBC_2.2.5 clock_nanosleep F
dfa500
-GLIBC_2.2.5 clock_settime F
dfa500
 GLIBC_2.2.5 lio_listio F
dfa500
 GLIBC_2.2.5 lio_listio64 F
dfa500
 GLIBC_2.2.5 shm_open F
dfa500
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
dfa500
index 6fee16a850adc7b8..0b6b3fa98183e5af 100644
dfa500
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
dfa500
@@ -660,6 +660,11 @@ GLIBC_2.16 clntudp_create F
dfa500
 GLIBC_2.16 clntunix_create F
dfa500
 GLIBC_2.16 clock F
dfa500
 GLIBC_2.16 clock_adjtime F
dfa500
+GLIBC_2.16 clock_getcpuclockid F
dfa500
+GLIBC_2.16 clock_getres F
dfa500
+GLIBC_2.16 clock_gettime F
dfa500
+GLIBC_2.16 clock_nanosleep F
dfa500
+GLIBC_2.16 clock_settime F
dfa500
 GLIBC_2.16 clone F
dfa500
 GLIBC_2.16 close F
dfa500
 GLIBC_2.16 closedir F
dfa500
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
dfa500
index 94e84e4dcfaa85dc..66969fb9ab887756 100644
dfa500
--- a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
dfa500
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist
dfa500
@@ -14,11 +14,6 @@ GLIBC_2.16 aio_suspend F
dfa500
 GLIBC_2.16 aio_suspend64 F
dfa500
 GLIBC_2.16 aio_write F
dfa500
 GLIBC_2.16 aio_write64 F
dfa500
-GLIBC_2.16 clock_getcpuclockid F
dfa500
-GLIBC_2.16 clock_getres F
dfa500
-GLIBC_2.16 clock_gettime F
dfa500
-GLIBC_2.16 clock_nanosleep F
dfa500
-GLIBC_2.16 clock_settime F
dfa500
 GLIBC_2.16 lio_listio F
dfa500
 GLIBC_2.16 lio_listio64 F
dfa500
 GLIBC_2.16 mq_close F
dfa500
diff --git a/time/Makefile b/time/Makefile
dfa500
index ec3e39dcea75ee51..6a68481a5de1b148 100644
dfa500
--- a/time/Makefile
dfa500
+++ b/time/Makefile
dfa500
@@ -36,14 +36,18 @@ routines := offtime asctime clock ctime ctime_r difftime \
dfa500
 	    stime dysize timegm ftime			 \
dfa500
 	    getdate strptime strptime_l			 \
dfa500
 	    strftime wcsftime strftime_l wcsftime_l	 \
dfa500
-	    timespec_get
dfa500
+	    timespec_get 	 			 \
dfa500
+	    clock_getcpuclockid clock_getres 		 \
dfa500
+	    clock_gettime clock_settime clock_nanosleep
dfa500
+
dfa500
 aux :=	    era alt_digit lc-time-cleanup
dfa500
 
dfa500
 tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
dfa500
 	   tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
dfa500
 	   tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
dfa500
 	   tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \
dfa500
-	   tst-tzname tst-y2039
dfa500
+	   tst-tzname tst-y2039 \
dfa500
+	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1
dfa500
 
dfa500
 include ../Rules
dfa500
 
dfa500
diff --git a/time/Versions b/time/Versions
dfa500
index fd838181e4f0969d..8788e192ce358d77 100644
dfa500
--- a/time/Versions
dfa500
+++ b/time/Versions
dfa500
@@ -49,6 +49,10 @@ libc {
dfa500
   GLIBC_2.2 {
dfa500
     # w*
dfa500
     wcsftime;
dfa500
+
dfa500
+    # c*; actually in librt in version 2.2, moved to libc in 2.17
dfa500
+    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
dfa500
+    clock_nanosleep;
dfa500
   }
dfa500
   GLIBC_2.3 {
dfa500
     # these internal names are used by libstdc++
dfa500
@@ -65,4 +69,13 @@ libc {
dfa500
   GLIBC_2.16 {
dfa500
     timespec_get;
dfa500
   }
dfa500
+  GLIBC_2.17 {
dfa500
+    # c*
dfa500
+    clock_getres; clock_gettime; clock_settime; clock_getcpuclockid;
dfa500
+    clock_nanosleep;
dfa500
+  }
dfa500
+  GLIBC_PRIVATE {
dfa500
+    # same as clock_gettime; used in other libraries
dfa500
+    __clock_gettime;
dfa500
+  }
dfa500
 }
dfa500
diff --git a/rt/clock_getcpuclockid.c b/time/clock_getcpuclockid.c
dfa500
similarity index 75%
dfa500
rename from rt/clock_getcpuclockid.c
dfa500
rename to time/clock_getcpuclockid.c
dfa500
index 6bc42a0863d92d5a..81b86241f7adc6c9 100644
dfa500
--- a/rt/clock_getcpuclockid.c
dfa500
+++ b/time/clock_getcpuclockid.c
dfa500
@@ -19,6 +19,7 @@
dfa500
 #include <errno.h>
dfa500
 #include <time.h>
dfa500
 #include <unistd.h>
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 int
dfa500
 __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
dfa500
@@ -37,4 +38,10 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
dfa500
   return ENOENT;
dfa500
 #endif
dfa500
 }
dfa500
-weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
dfa500
+versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17);
dfa500
+/* clock_getcpuclockid moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_getcpuclockid, __clock_getcpuclockid_2);
dfa500
+compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2);
dfa500
+#endif
dfa500
diff --git a/rt/clock_getres.c b/time/clock_getres.c
dfa500
similarity index 73%
dfa500
rename from rt/clock_getres.c
dfa500
rename to time/clock_getres.c
dfa500
index 816f7b2a907e27ce..e8315393e560b186 100644
dfa500
--- a/rt/clock_getres.c
dfa500
+++ b/time/clock_getres.c
dfa500
@@ -18,6 +18,7 @@
dfa500
 
dfa500
 #include <errno.h>
dfa500
 #include <time.h>
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 /* Get resolution of clock.  */
dfa500
 int
dfa500
@@ -26,5 +27,13 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
dfa500
   __set_errno (ENOSYS);
dfa500
   return -1;
dfa500
 }
dfa500
-weak_alias (__clock_getres, clock_getres)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17);
dfa500
+/* clock_getres moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_getres, __clock_getres_2);
dfa500
+compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2);
dfa500
+#endif
dfa500
+
dfa500
 stub_warning (clock_getres)
dfa500
diff --git a/rt/clock_gettime.c b/time/clock_gettime.c
dfa500
similarity index 74%
dfa500
rename from rt/clock_gettime.c
dfa500
rename to time/clock_gettime.c
dfa500
index 30a012473f5bc821..4a5f808845351156 100644
dfa500
--- a/rt/clock_gettime.c
dfa500
+++ b/time/clock_gettime.c
dfa500
@@ -18,6 +18,7 @@
dfa500
 
dfa500
 #include <errno.h>
dfa500
 #include <time.h>
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 /* Get current value of CLOCK and store it in TP.  */
dfa500
 int
dfa500
@@ -26,6 +27,14 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
dfa500
   __set_errno (ENOSYS);
dfa500
   return -1;
dfa500
 }
dfa500
-weak_alias (__clock_gettime, clock_gettime)
dfa500
 libc_hidden_def (__clock_gettime)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
dfa500
+/* clock_gettime moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_gettime, __clock_gettime_2);
dfa500
+compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
dfa500
+#endif
dfa500
+
dfa500
 stub_warning (clock_gettime)
dfa500
diff --git a/rt/clock_nanosleep.c b/time/clock_nanosleep.c
dfa500
similarity index 76%
dfa500
rename from rt/clock_nanosleep.c
dfa500
rename to time/clock_nanosleep.c
dfa500
index 15aa6f7c4f22e197..a314b169a9455e0d 100644
dfa500
--- a/rt/clock_nanosleep.c
dfa500
+++ b/time/clock_nanosleep.c
dfa500
@@ -18,6 +18,7 @@
dfa500
 
dfa500
 #include <errno.h>
dfa500
 #include <time.h>
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 int
dfa500
 __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
dfa500
@@ -33,5 +34,13 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
dfa500
   /* Not implemented.  */
dfa500
   return ENOSYS;
dfa500
 }
dfa500
-weak_alias (__clock_nanosleep, clock_nanosleep)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17);
dfa500
+/* clock_nanosleep moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_nanosleep, __clock_nanosleep_2);
dfa500
+compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2);
dfa500
+#endif
dfa500
+
dfa500
 stub_warning (clock_nanosleep)
dfa500
diff --git a/rt/clock_settime.c b/time/clock_settime.c
dfa500
similarity index 71%
dfa500
rename from rt/clock_settime.c
dfa500
rename to time/clock_settime.c
dfa500
index 0b6d4b2a2a0dc46c..2091239448e307f2 100644
dfa500
--- a/rt/clock_settime.c
dfa500
+++ b/time/clock_settime.c
dfa500
@@ -18,6 +18,7 @@
dfa500
 
dfa500
 #include <errno.h>
dfa500
 #include <time.h>
dfa500
+#include <shlib-compat.h>
dfa500
 
dfa500
 /* Set CLOCK to value TP.  */
dfa500
 int
dfa500
@@ -26,5 +27,14 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp)
dfa500
   __set_errno (ENOSYS);
dfa500
   return -1;
dfa500
 }
dfa500
-weak_alias (__clock_settime, clock_settime)
dfa500
+libc_hidden_def (__clock_settime)
dfa500
+
dfa500
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
dfa500
+/* clock_settime moved to libc in version 2.17;
dfa500
+   old binaries may expect the symbol version it had in librt.  */
dfa500
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
dfa500
+strong_alias (__clock_settime, __clock_settime_2);
dfa500
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
dfa500
+#endif
dfa500
+
dfa500
 stub_warning (clock_settime)
dfa500
diff --git a/rt/tst-clock.c b/time/tst-clock.c
dfa500
similarity index 100%
dfa500
rename from rt/tst-clock.c
dfa500
rename to time/tst-clock.c
dfa500
diff --git a/rt/tst-clock2.c b/time/tst-clock2.c
dfa500
similarity index 100%
dfa500
rename from rt/tst-clock2.c
dfa500
rename to time/tst-clock2.c
dfa500
diff --git a/rt/tst-clock_nanosleep.c b/time/tst-clock_nanosleep.c
dfa500
similarity index 100%
dfa500
rename from rt/tst-clock_nanosleep.c
dfa500
rename to time/tst-clock_nanosleep.c
dfa500
diff --git a/rt/tst-cpuclock1.c b/time/tst-cpuclock1.c
dfa500
similarity index 100%
dfa500
rename from rt/tst-cpuclock1.c
dfa500
rename to time/tst-cpuclock1.c