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