From 981dc983ca1b80a17a2c3dbef599e5a4301722bd Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 14 2020 22:18:22 +0000 Subject: import glibc-2.28-123.el8 --- diff --git a/SOURCES/glibc-rh1748197-1.patch b/SOURCES/glibc-rh1748197-1.patch new file mode 100644 index 0000000..4a68281 --- /dev/null +++ b/SOURCES/glibc-rh1748197-1.patch @@ -0,0 +1,18 @@ +commit 27cec9aed97447dff887a88f4241604fffd8c525 +Author: Florian Weimer +Date: Tue Jul 2 16:45:52 2019 +0200 + + malloc: Add nptl, htl dependency for the subdirectory [BZ #24757] + + memusagestat may indirectly link against libpthread. The built + libpthread should be used, but that is only possible if it has been + built before the malloc programs. + +diff --git a/malloc/Depend b/malloc/Depend +index 910c6d915211870f..f5e248047c4c46dd 100644 +--- a/malloc/Depend ++++ b/malloc/Depend +@@ -1 +1,3 @@ + dlfcn ++nptl ++htl diff --git a/SOURCES/glibc-rh1748197-2.patch b/SOURCES/glibc-rh1748197-2.patch new file mode 100644 index 0000000..483c4f9 --- /dev/null +++ b/SOURCES/glibc-rh1748197-2.patch @@ -0,0 +1,996 @@ +commit 41d6f74e6cb6a92ab428c11ee1e408b2a16aa1b0 +Author: Florian Weimer +Date: Tue Jul 2 15:12:20 2019 +0200 + + nptl: Remove vfork IFUNC-based forwarder from libpthread [BZ #20188] + + With commit f0b2132b35248c1f4a80f62a2c38cddcc802aa8c ("ld.so: + Support moving versioned symbols between sonames [BZ #24741]"), the + dynamic linker will find the definition of vfork in libc and binds + a vfork reference to that symbol, even if the soname in the version + reference says that the symbol should be located in libpthread. + + As a result, the forwarder (whether it's IFUNC-based or a duplicate + of the libc implementation) is no longer necessary. + + On older architectures, a placeholder symbol is required, to make sure + that the GLIBC_2.1.2 symbol version does not go away, or is turned in + to a weak symbol definition by the link editor. (The symbol version + needs to preserved so that the symbol coverage check in + elf/dl-version.c does not fail for old binaries.) + + mips32 is an outlier: It defined __vfork@@GLIBC_2.2, but the + baseline is GLIBC_2.0. Since there are other @@GLIBC_2.2 symbols, + the placeholder symbol is not needed there. + +Conflicts: + nptl/Makefile + (Missing lll_timedwait_tid removal, missing pthread_mutex_conf.) + nptl/pt-vfork.c + sysdeps/unix/sysv/linux/aarch64/pt-vfork.c + sysdeps/unix/sysv/linux/alpha/pt-vfork.S + sysdeps/unix/sysv/linux/hppa/pt-vfork.S + sysdeps/unix/sysv/linux/ia64/pt-vfork.S + sysdeps/unix/sysv/linux/microblaze/pt-vfork.S + (Removal after copyright year change upstream.) + +diff --git a/nptl/Makefile b/nptl/Makefile +index 071c53866d14d2fe..447dce0590295c9c 100644 +--- a/nptl/Makefile ++++ b/nptl/Makefile +@@ -121,7 +121,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ + cancellation \ + lowlevellock \ + lll_timedlock_wait lll_timedwait_tid \ +- pt-fork pt-vfork pt-fcntl \ ++ pt-fork pt-fcntl \ + $(pthread-compat-wrappers) \ + pt-raise pt-system \ + flockfile ftrylockfile funlockfile \ +@@ -145,7 +145,8 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ + mtx_destroy mtx_init mtx_lock mtx_timedlock \ + mtx_trylock mtx_unlock call_once cnd_broadcast \ + cnd_destroy cnd_init cnd_signal cnd_timedwait cnd_wait \ +- tss_create tss_delete tss_get tss_set ++ tss_create tss_delete tss_get tss_set \ ++ libpthread-compat + # pthread_setuid pthread_seteuid pthread_setreuid \ + # pthread_setresuid \ + # pthread_setgid pthread_setegid pthread_setregid \ +diff --git a/nptl/Versions b/nptl/Versions +index e7f691da7a15e9c3..6007fd03e7ed117c 100644 +--- a/nptl/Versions ++++ b/nptl/Versions +@@ -36,7 +36,6 @@ libc { + __libc_alloca_cutoff; + # Internal libc interface to libpthread + __libc_dl_error_tsd; +- __libc_vfork; + __libc_pthread_init; + __libc_current_sigrtmin_private; __libc_current_sigrtmax_private; + __libc_allocate_rtsig_private; +@@ -98,7 +97,7 @@ libpthread { + sem_destroy; sem_getvalue; sem_init; sem_post; sem_trywait; sem_wait; + + # Special fork handling. +- fork; __fork; vfork; ++ fork; __fork; + + # Cancellation points. + close; __close; fcntl; __fcntl; read; __read; write; __write; accept; +@@ -152,7 +151,7 @@ libpthread { + } + + GLIBC_2.1.2 { +- __vfork; ++ __libpthread_version_placeholder; + } + + GLIBC_2.2 { +diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c +new file mode 100644 +index 0000000000000000..ea29e9f47b698a25 +--- /dev/null ++++ b/nptl/libpthread-compat.c +@@ -0,0 +1,37 @@ ++/* Placeholder definitions to pull in removed symbol versions. ++ Copyright (C) 2019 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++/* This is an unused compatibility symbol definition, to prevent ld ++ from creating a weak version definition for GLIBC_2.1.2. (__vfork ++ used to be defined at that version, but it is now provided by libc, ++ and there are no versions left in libpthread for that symbol ++ version.) If the ABI baseline for glibc is the GLIBC_2.2 symbol ++ version or later, the placeholder symbol is not needed because ++ there are plenty of other symbols which populate those later ++ versions. */ ++#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2)) ++void ++attribute_compat_text_section ++__libpthread_version_placeholder (void) ++{ ++} ++compat_symbol (libpthread, __libpthread_version_placeholder, ++ __libpthread_version_placeholder, GLIBC_2_1_2); ++#endif +diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c +deleted file mode 100644 +index 2f890d3f3070d0e2..0000000000000000 +--- a/nptl/pt-vfork.c ++++ /dev/null +@@ -1,65 +0,0 @@ +-/* vfork ABI-compatibility entry points for libpthread. +- Copyright (C) 2014-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +- +-/* libpthread used to have its own vfork implementation that differed +- from libc's only in having a pointless micro-optimization. There +- is no longer any use to having a separate copy in libpthread, but +- the historical ABI requires it. For static linking, there is no +- need to provide anything here--the libc version will be linked in. +- For shared library ABI compatibility, there must be __vfork and +- vfork symbols in libpthread.so; so we define them using IFUNC to +- redirect to the libc function. */ +- +-/* Note! If the architecture doesn't support IFUNC, then we need an +- alternate target-specific mechanism to implement this. So we just +- assume IFUNC here and require that the target override this file +- if necessary. +- +- If the architecture can assume all supported versions of gcc will +- produce a tail-call to __libc_vfork, consider including the version +- in sysdeps/unix/sysv/linux/aarch64/pt-vfork.c. */ +- +-#if !HAVE_IFUNC +-# error "must write pt-vfork for this machine or get IFUNC support" +-#endif +- +-#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \ +- || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)) +- +-extern __typeof (vfork) __libc_vfork; /* Defined in libc. */ +- +-# undef INIT_ARCH +-# define INIT_ARCH() +-# define DEFINE_VFORK(name) libc_ifunc (name, &__libc_vfork) +- +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) +-extern __typeof(vfork) vfork_ifunc; +-DEFINE_VFORK (vfork_ifunc) +-compat_symbol (libpthread, vfork_ifunc, vfork, GLIBC_2_0); +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20) +-extern __typeof(vfork) __vfork_ifunc; +-DEFINE_VFORK (__vfork_ifunc) +-compat_symbol (libpthread, __vfork_ifunc, __vfork, GLIBC_2_1_2); +-#endif +diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +index 9a9e4cee85b18a35..6945b7cbe4c2bde8 100644 +--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +@@ -45,7 +45,6 @@ GLIBC_2.17 __read F + GLIBC_2.17 __res_state F + GLIBC_2.17 __send F + GLIBC_2.17 __sigaction F +-GLIBC_2.17 __vfork F + GLIBC_2.17 __wait F + GLIBC_2.17 __write F + GLIBC_2.17 _pthread_cleanup_pop F +@@ -216,7 +215,6 @@ GLIBC_2.17 siglongjmp F + GLIBC_2.17 sigwait F + GLIBC_2.17 system F + GLIBC_2.17 tcdrain F +-GLIBC_2.17 vfork F + GLIBC_2.17 wait F + GLIBC_2.17 waitpid F + GLIBC_2.17 write F +diff --git a/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c b/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c +deleted file mode 100644 +index 2b277f25ec200be2..0000000000000000 +--- a/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c ++++ /dev/null +@@ -1,54 +0,0 @@ +-/* vfork ABI-compatibility entry points for libpthread. +- Copyright (C) 2014-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +- +-/* libpthread used to have its own vfork implementation that differed +- from libc's only in having a pointless micro-optimization. There +- is no longer any use to having a separate copy in libpthread, but +- the historical ABI requires it. For static linking, there is no +- need to provide anything here--the libc version will be linked in. +- For shared library ABI compatibility, there must be __vfork and +- vfork symbols in libpthread.so. */ +- +-#if HAVE_IFUNC +-# include +-#elif (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \ +- || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)) +- +-/* Thankfully, on AArch64 we can rely on the compiler generating +- a tail call here. */ +- +-extern void __libc_vfork (void); +- +-void +-vfork_compat (void) +-{ +- __libc_vfork (); +-} +- +-# if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) +-compat_symbol (libpthread, vfork_compat, vfork, GLIBC_2_0); +-# endif +- +-# if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20) +-strong_alias (vfork_compat, vfork_compat2) +-compat_symbol (libpthread, vfork_compat2, __vfork, GLIBC_2_1_2); +-# endif +- +-#endif +diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +index b413007ccbd2b7b3..2d9b958efa99feb8 100644 +--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -155,7 +154,7 @@ GLIBC_2.1 sem_wait F + GLIBC_2.1.1 sem_close F + GLIBC_2.1.1 sem_open F + GLIBC_2.1.1 sem_unlink F +-GLIBC_2.1.2 __vfork F ++GLIBC_2.1.2 __libpthread_version_placeholder F + GLIBC_2.11 pthread_sigqueue F + GLIBC_2.12 pthread_getname_np F + GLIBC_2.12 pthread_mutex_consistent F +diff --git a/sysdeps/unix/sysv/linux/alpha/pt-vfork.S b/sysdeps/unix/sysv/linux/alpha/pt-vfork.S +deleted file mode 100644 +index 7ecaa78dd0eda2fe..0000000000000000 +--- a/sysdeps/unix/sysv/linux/alpha/pt-vfork.S ++++ /dev/null +@@ -1,43 +0,0 @@ +-/* vfork ABI-compatibility entry points for libpthread. +- Copyright (C) 2014-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +- +-/* libpthread used to have its own vfork implementation that differed +- from libc's only in having a pointless micro-optimization. There +- is no longer any use to having a separate copy in libpthread, but +- the historical ABI requires it. For static linking, there is no +- need to provide anything here--the libc version will be linked in. +- For shared library ABI compatibility, there must be __vfork and +- vfork symbols in libpthread.so. */ +- +-#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \ +- || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)) +- +-#include +- +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) +-compat_symbol (libpthread, __libc_vfork, vfork, GLIBC_2_0); +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20) +-strong_alias (__libc_vfork, __vfork_compat) +-compat_symbol (libpthread, __vfork_compat, __vfork, GLIBC_2_1_2); +-#endif +diff --git a/sysdeps/unix/sysv/linux/arm/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/libpthread.abilist +index af82a4c632988185..ee3d0290d01f184e 100644 +--- a/sysdeps/unix/sysv/linux/arm/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/arm/libpthread.abilist +@@ -74,7 +74,6 @@ GLIBC_2.4 __read F + GLIBC_2.4 __res_state F + GLIBC_2.4 __send F + GLIBC_2.4 __sigaction F +-GLIBC_2.4 __vfork F + GLIBC_2.4 __wait F + GLIBC_2.4 __write F + GLIBC_2.4 _pthread_cleanup_pop F +@@ -239,7 +238,6 @@ GLIBC_2.4 siglongjmp F + GLIBC_2.4 sigwait F + GLIBC_2.4 system F + GLIBC_2.4 tcdrain F +-GLIBC_2.4 vfork F + GLIBC_2.4 wait F + GLIBC_2.4 waitpid F + GLIBC_2.4 write F +diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +index bcba07f57558174f..e9b3be6ac8e8f367 100644 +--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +@@ -46,7 +46,6 @@ GLIBC_2.2 __read F + GLIBC_2.2 __res_state F + GLIBC_2.2 __send F + GLIBC_2.2 __sigaction F +-GLIBC_2.2 __vfork F + GLIBC_2.2 __wait F + GLIBC_2.2 __write F + GLIBC_2.2 _pthread_cleanup_pop F +@@ -192,7 +191,6 @@ GLIBC_2.2 siglongjmp F + GLIBC_2.2 sigwait F + GLIBC_2.2 system F + GLIBC_2.2 tcdrain F +-GLIBC_2.2 vfork F + GLIBC_2.2 wait F + GLIBC_2.2 waitpid F + GLIBC_2.2 write F +diff --git a/sysdeps/unix/sysv/linux/hppa/localplt.data b/sysdeps/unix/sysv/linux/hppa/localplt.data +index 5f3475de191778f6..867413f0c54d3d71 100644 +--- a/sysdeps/unix/sysv/linux/hppa/localplt.data ++++ b/sysdeps/unix/sysv/linux/hppa/localplt.data +@@ -10,7 +10,6 @@ libc.so: __sigsetjmp + libc.so: _IO_funlockfile + libc.so: __errno_location + libm.so: matherr +-libpthread.so: __errno_location + # The main malloc is interposed into the dynamic linker, for + # allocations after the initial link (when dlopen is used). + ld.so: malloc +diff --git a/sysdeps/unix/sysv/linux/hppa/pt-vfork.S b/sysdeps/unix/sysv/linux/hppa/pt-vfork.S +deleted file mode 100644 +index 45f7620d90cb5b8f..0000000000000000 +--- a/sysdeps/unix/sysv/linux/hppa/pt-vfork.S ++++ /dev/null +@@ -1,82 +0,0 @@ +-/* Copyright (C) 2005-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library. If not, see +- . */ +- +-#include +-#define _ERRNO_H 1 +-#include +-#include +- +-/* Clone the calling process, but without copying the whole address space. +- The calling process is suspended until the new process exits or is +- replaced by a call to `execve'. Return -1 for errors, 0 to the new process, +- and the process ID of the new process to the old process. */ +- +-.Lthread_start: ASM_LINE_SEP +- +- /* r26, r25, r24, r23 are free since vfork has no arguments */ +-ENTRY(__vfork) +- /* We must not create a frame. When the child unwinds to call +- exec it will clobber the same frame that the parent +- needs to unwind. */ +- +- /* Save the PIC register. */ +-#ifdef PIC +- copy %r19, %r25 /* parent */ +-#endif +- +- /* Syscall saves and restores all register states */ +- ble 0x100(%sr2,%r0) +- ldi __NR_vfork,%r20 +- +- /* Check for error */ +- ldi -4096,%r1 +- comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */ +- b,n .Lerror +- +- /* Return, and DO NOT restore rp. The child may have called +- functions that updated the frame's rp. This works because +- the kernel ensures rp is preserved across the vfork +- syscall. */ +- bv,n %r0(%rp) +- +-.Lerror: +- /* Now we need a stack to call a function. We are assured +- that there is no child now, so it's safe to create +- a frame. */ +- stw %rp, -20(%sp) +- .cfi_offset 2, -20 +- stwm %r3, 64(%sp) +- .cfi_def_cfa_offset -64 +- .cfi_offset 3, 0 +- stw %sp, -4(%sp) +- +- sub %r0,%ret0,%r3 +- SYSCALL_ERROR_HANDLER +- /* Restore the PIC register (in delay slot) on error */ +-#ifdef PIC +- copy %r25, %r19 /* parent */ +-#else +- nop +-#endif +- /* Write syscall return into errno location */ +- stw %r3, 0(%ret0) +- ldw -84(%sp), %rp +- bv %r0(%rp) +- ldwm -64(%sp), %r3 +-PSEUDO_END (__vfork) +-libc_hidden_def (__vfork) +-weak_alias (__vfork, vfork) +diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist +index bece86d24624ea26..7199aae573649f49 100644 +--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -155,7 +154,7 @@ GLIBC_2.1 sem_wait F + GLIBC_2.1.1 sem_close F + GLIBC_2.1.1 sem_open F + GLIBC_2.1.1 sem_unlink F +-GLIBC_2.1.2 __vfork F ++GLIBC_2.1.2 __libpthread_version_placeholder F + GLIBC_2.11 pthread_sigqueue F + GLIBC_2.12 pthread_getname_np F + GLIBC_2.12 pthread_mutex_consistent F +diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +index ccc94498268a5c74..e8a65642caec7ff1 100644 +--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +@@ -46,7 +46,6 @@ GLIBC_2.2 __read F + GLIBC_2.2 __res_state F + GLIBC_2.2 __send F + GLIBC_2.2 __sigaction F +-GLIBC_2.2 __vfork F + GLIBC_2.2 __wait F + GLIBC_2.2 __write F + GLIBC_2.2 _pthread_cleanup_pop F +@@ -192,7 +191,6 @@ GLIBC_2.2 siglongjmp F + GLIBC_2.2 sigwait F + GLIBC_2.2 system F + GLIBC_2.2 tcdrain F +-GLIBC_2.2 vfork F + GLIBC_2.2 wait F + GLIBC_2.2 waitpid F + GLIBC_2.2 write F +diff --git a/sysdeps/unix/sysv/linux/ia64/pt-vfork.S b/sysdeps/unix/sysv/linux/ia64/pt-vfork.S +deleted file mode 100644 +index 61f3e387b455d731..0000000000000000 +--- a/sysdeps/unix/sysv/linux/ia64/pt-vfork.S ++++ /dev/null +@@ -1,48 +0,0 @@ +-/* vfork ABI-compatibility entry points for libpthread. IA64 version. +- Copyright (C) 2014-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +- +-/* libpthread used to have its own vfork implementation that differed +- from libc's only in having a pointless micro-optimization. There +- is no longer any use to having a separate copy in libpthread, but +- the historical ABI requires it. For static linking, there is no +- need to provide anything here--the libc version will be linked in. +- For shared library ABI compatibility, there must be __vfork and +- vfork symbols in libpthread.so. */ +- +-#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \ +- || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)) +- +-LOCAL_LEAF (vfork_compat) +- br __libc_vfork +- ;; +-END (vfork_compat) +- +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) +-weak_alias (vfork_compat, vfork) +-compat_symbol (libpthread, vfork_compat, vfork, GLIBC_2_0); +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20) +-strong_alias (vfork_compat, __vfork_compat) +-compat_symbol (libpthread, __vfork_compat, __vfork, GLIBC_2_1_2); +-#endif +diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +index af82a4c632988185..ee3d0290d01f184e 100644 +--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +@@ -74,7 +74,6 @@ GLIBC_2.4 __read F + GLIBC_2.4 __res_state F + GLIBC_2.4 __send F + GLIBC_2.4 __sigaction F +-GLIBC_2.4 __vfork F + GLIBC_2.4 __wait F + GLIBC_2.4 __write F + GLIBC_2.4 _pthread_cleanup_pop F +@@ -239,7 +238,6 @@ GLIBC_2.4 siglongjmp F + GLIBC_2.4 sigwait F + GLIBC_2.4 system F + GLIBC_2.4 tcdrain F +-GLIBC_2.4 vfork F + GLIBC_2.4 wait F + GLIBC_2.4 waitpid F + GLIBC_2.4 write F +diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +index bece86d24624ea26..7199aae573649f49 100644 +--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -155,7 +154,7 @@ GLIBC_2.1 sem_wait F + GLIBC_2.1.1 sem_close F + GLIBC_2.1.1 sem_open F + GLIBC_2.1.1 sem_unlink F +-GLIBC_2.1.2 __vfork F ++GLIBC_2.1.2 __libpthread_version_placeholder F + GLIBC_2.11 pthread_sigqueue F + GLIBC_2.12 pthread_getname_np F + GLIBC_2.12 pthread_mutex_consistent F +diff --git a/sysdeps/unix/sysv/linux/m68k/pt-vfork.c b/sysdeps/unix/sysv/linux/m68k/pt-vfork.c +deleted file mode 100644 +index 5fbc6526aa2af493..0000000000000000 +--- a/sysdeps/unix/sysv/linux/m68k/pt-vfork.c ++++ /dev/null +@@ -1 +0,0 @@ +-#include +diff --git a/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist +index 5067375d237a0c9f..e0fbe6848f7945bd 100644 +--- a/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/microblaze/libpthread.abilist +@@ -45,7 +45,6 @@ GLIBC_2.18 __read F + GLIBC_2.18 __res_state F + GLIBC_2.18 __send F + GLIBC_2.18 __sigaction F +-GLIBC_2.18 __vfork F + GLIBC_2.18 __wait F + GLIBC_2.18 __write F + GLIBC_2.18 _pthread_cleanup_pop F +@@ -218,7 +217,6 @@ GLIBC_2.18 siglongjmp F + GLIBC_2.18 sigwait F + GLIBC_2.18 system F + GLIBC_2.18 tcdrain F +-GLIBC_2.18 vfork F + GLIBC_2.18 wait F + GLIBC_2.18 waitpid F + GLIBC_2.18 write F +diff --git a/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S b/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S +deleted file mode 100644 +index 74bc1cdf7455f597..0000000000000000 +--- a/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S ++++ /dev/null +@@ -1,49 +0,0 @@ +-/* vfork ABI-compatibility entry points for libpthread. +- Copyright (C) 2014-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +- +-/* libpthread used to have its own vfork implementation that differed +- from libc's only in having a pointless micro-optimization. There +- is no longer any use to having a separate copy in libpthread, but +- the historical ABI requires it. For static linking, there is no +- need to provide anything here--the libc version will be linked in. +- For shared library ABI compatibility, there must be __vfork and +- vfork symbols in libpthread.so. +- +- As of GCC 7, microblaze can *not* rely on the compiler to generate +- a tail call from this vfork to __libc_vfork. */ +- +-#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \ +- || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)) +- +-ENTRY (vfork_compat) +- bri __libc_vfork@PLT +-END (vfork_compat) +- +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) +-compat_symbol (libpthread, vfork_compat, vfork, GLIBC_2_0) +-#endif +- +-#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20) +-strong_alias (vfork_compat, vfork_compat2) +-compat_symbol (libpthread, vfork_compat2, __vfork, GLIBC_2_1_2) +-#endif +diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +index 02144967c638cdbe..f60b22efb5b5f683 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -140,7 +139,6 @@ GLIBC_2.2 __pthread_rwlock_unlock F + GLIBC_2.2 __pthread_rwlock_wrlock F + GLIBC_2.2 __pwrite64 F + GLIBC_2.2 __res_state F +-GLIBC_2.2 __vfork F + GLIBC_2.2 lseek64 F + GLIBC_2.2 open64 F + GLIBC_2.2 pread F +diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist +index 02144967c638cdbe..f60b22efb5b5f683 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -140,7 +139,6 @@ GLIBC_2.2 __pthread_rwlock_unlock F + GLIBC_2.2 __pthread_rwlock_wrlock F + GLIBC_2.2 __pwrite64 F + GLIBC_2.2 __res_state F +-GLIBC_2.2 __vfork F + GLIBC_2.2 lseek64 F + GLIBC_2.2 open64 F + GLIBC_2.2 pread F +diff --git a/sysdeps/unix/sysv/linux/mips/pt-vfork.S b/sysdeps/unix/sysv/linux/mips/pt-vfork.S +deleted file mode 100644 +index 65cc3823ac872b35..0000000000000000 +--- a/sysdeps/unix/sysv/linux/mips/pt-vfork.S ++++ /dev/null +@@ -1 +0,0 @@ +-#include +diff --git a/sysdeps/unix/sysv/linux/nios2/pt-vfork.S b/sysdeps/unix/sysv/linux/nios2/pt-vfork.S +deleted file mode 100644 +index 147427a42d2d74a7..0000000000000000 +--- a/sysdeps/unix/sysv/linux/nios2/pt-vfork.S ++++ /dev/null +@@ -1 +0,0 @@ +-# Nios2 does not require a stub for vfork in libpthread. +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +index 09e8447b06f828be..c7d9b7898640730d 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -155,7 +154,7 @@ GLIBC_2.1 sem_wait F + GLIBC_2.1.1 sem_close F + GLIBC_2.1.1 sem_open F + GLIBC_2.1.1 sem_unlink F +-GLIBC_2.1.2 __vfork F ++GLIBC_2.1.2 __libpthread_version_placeholder F + GLIBC_2.11 pthread_sigqueue F + GLIBC_2.12 pthread_getname_np F + GLIBC_2.12 pthread_mutex_consistent F +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist +index 9a9e4cee85b18a35..6945b7cbe4c2bde8 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist +@@ -45,7 +45,6 @@ GLIBC_2.17 __read F + GLIBC_2.17 __res_state F + GLIBC_2.17 __send F + GLIBC_2.17 __sigaction F +-GLIBC_2.17 __vfork F + GLIBC_2.17 __wait F + GLIBC_2.17 __write F + GLIBC_2.17 _pthread_cleanup_pop F +@@ -216,7 +215,6 @@ GLIBC_2.17 siglongjmp F + GLIBC_2.17 sigwait F + GLIBC_2.17 system F + GLIBC_2.17 tcdrain F +-GLIBC_2.17 vfork F + GLIBC_2.17 wait F + GLIBC_2.17 waitpid F + GLIBC_2.17 write F +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist +index 8300958d4721d6a6..3500cce6c1124996 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist +@@ -68,7 +68,6 @@ GLIBC_2.3 __read F + GLIBC_2.3 __res_state F + GLIBC_2.3 __send F + GLIBC_2.3 __sigaction F +-GLIBC_2.3 __vfork F + GLIBC_2.3 __wait F + GLIBC_2.3 __write F + GLIBC_2.3 _pthread_cleanup_pop F +@@ -214,7 +213,6 @@ GLIBC_2.3 siglongjmp F + GLIBC_2.3 sigwait F + GLIBC_2.3 system F + GLIBC_2.3 tcdrain F +-GLIBC_2.3 vfork F + GLIBC_2.3 wait F + GLIBC_2.3 waitpid F + GLIBC_2.3 write F +diff --git a/sysdeps/unix/sysv/linux/riscv/pt-vfork.S b/sysdeps/unix/sysv/linux/riscv/pt-vfork.S +deleted file mode 100644 +index 1cc8931700702e65..0000000000000000 +--- a/sysdeps/unix/sysv/linux/riscv/pt-vfork.S ++++ /dev/null +@@ -1 +0,0 @@ +-/* Not needed. */ +diff --git a/sysdeps/unix/sysv/linux/s390/pt-vfork.S b/sysdeps/unix/sysv/linux/s390/pt-vfork.S +deleted file mode 100644 +index 65cc3823ac872b35..0000000000000000 +--- a/sysdeps/unix/sysv/linux/s390/pt-vfork.S ++++ /dev/null +@@ -1 +0,0 @@ +-#include +diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +index d05468f3b2732e92..f093634d7edce2f2 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -155,7 +154,7 @@ GLIBC_2.1 sem_wait F + GLIBC_2.1.1 sem_close F + GLIBC_2.1.1 sem_open F + GLIBC_2.1.1 sem_unlink F +-GLIBC_2.1.2 __vfork F ++GLIBC_2.1.2 __libpthread_version_placeholder F + GLIBC_2.11 pthread_sigqueue F + GLIBC_2.12 pthread_getname_np F + GLIBC_2.12 pthread_mutex_consistent F +diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +index e8161aa747402b72..47204f166c29a773 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +@@ -48,7 +48,6 @@ GLIBC_2.2 __read F + GLIBC_2.2 __res_state F + GLIBC_2.2 __send F + GLIBC_2.2 __sigaction F +-GLIBC_2.2 __vfork F + GLIBC_2.2 __wait F + GLIBC_2.2 __write F + GLIBC_2.2 _pthread_cleanup_pop F +@@ -194,7 +193,6 @@ GLIBC_2.2 siglongjmp F + GLIBC_2.2 sigwait F + GLIBC_2.2 system F + GLIBC_2.2 tcdrain F +-GLIBC_2.2 vfork F + GLIBC_2.2 wait F + GLIBC_2.2 waitpid F + GLIBC_2.2 write F +diff --git a/sysdeps/unix/sysv/linux/sh/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/libpthread.abilist +index bcba07f57558174f..e9b3be6ac8e8f367 100644 +--- a/sysdeps/unix/sysv/linux/sh/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/sh/libpthread.abilist +@@ -46,7 +46,6 @@ GLIBC_2.2 __read F + GLIBC_2.2 __res_state F + GLIBC_2.2 __send F + GLIBC_2.2 __sigaction F +-GLIBC_2.2 __vfork F + GLIBC_2.2 __wait F + GLIBC_2.2 __write F + GLIBC_2.2 _pthread_cleanup_pop F +@@ -192,7 +191,6 @@ GLIBC_2.2 siglongjmp F + GLIBC_2.2 sigwait F + GLIBC_2.2 system F + GLIBC_2.2 tcdrain F +-GLIBC_2.2 vfork F + GLIBC_2.2 wait F + GLIBC_2.2 waitpid F + GLIBC_2.2 write F +diff --git a/sysdeps/unix/sysv/linux/sh/pt-vfork.S b/sysdeps/unix/sysv/linux/sh/pt-vfork.S +deleted file mode 100644 +index 65cc3823ac872b35..0000000000000000 +--- a/sysdeps/unix/sysv/linux/sh/pt-vfork.S ++++ /dev/null +@@ -1 +0,0 @@ +-#include +diff --git a/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/sysdeps/unix/sysv/linux/sparc/pt-vfork.S +deleted file mode 100644 +index 65cc3823ac872b35..0000000000000000 +--- a/sysdeps/unix/sysv/linux/sparc/pt-vfork.S ++++ /dev/null +@@ -1 +0,0 @@ +-#include +diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +index b413007ccbd2b7b3..2d9b958efa99feb8 100644 +--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +@@ -114,7 +114,6 @@ GLIBC_2.0 siglongjmp F + GLIBC_2.0 sigwait F + GLIBC_2.0 system F + GLIBC_2.0 tcdrain F +-GLIBC_2.0 vfork F + GLIBC_2.0 wait F + GLIBC_2.0 waitpid F + GLIBC_2.0 write F +@@ -155,7 +154,7 @@ GLIBC_2.1 sem_wait F + GLIBC_2.1.1 sem_close F + GLIBC_2.1.1 sem_open F + GLIBC_2.1.1 sem_unlink F +-GLIBC_2.1.2 __vfork F ++GLIBC_2.1.2 __libpthread_version_placeholder F + GLIBC_2.11 pthread_sigqueue F + GLIBC_2.12 pthread_getname_np F + GLIBC_2.12 pthread_mutex_consistent F +diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +index ccc94498268a5c74..e8a65642caec7ff1 100644 +--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +@@ -46,7 +46,6 @@ GLIBC_2.2 __read F + GLIBC_2.2 __res_state F + GLIBC_2.2 __send F + GLIBC_2.2 __sigaction F +-GLIBC_2.2 __vfork F + GLIBC_2.2 __wait F + GLIBC_2.2 __write F + GLIBC_2.2 _pthread_cleanup_pop F +@@ -192,7 +191,6 @@ GLIBC_2.2 siglongjmp F + GLIBC_2.2 sigwait F + GLIBC_2.2 system F + GLIBC_2.2 tcdrain F +-GLIBC_2.2 vfork F + GLIBC_2.2 wait F + GLIBC_2.2 waitpid F + GLIBC_2.2 write F +diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +index 931c8277a859999e..4fbb72ffb37ba689 100644 +--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +@@ -46,7 +46,6 @@ GLIBC_2.2.5 __read F + GLIBC_2.2.5 __res_state F + GLIBC_2.2.5 __send F + GLIBC_2.2.5 __sigaction F +-GLIBC_2.2.5 __vfork F + GLIBC_2.2.5 __wait F + GLIBC_2.2.5 __write F + GLIBC_2.2.5 _pthread_cleanup_pop F +@@ -193,7 +192,6 @@ GLIBC_2.2.5 siglongjmp F + GLIBC_2.2.5 sigwait F + GLIBC_2.2.5 system F + GLIBC_2.2.5 tcdrain F +-GLIBC_2.2.5 vfork F + GLIBC_2.2.5 wait F + GLIBC_2.2.5 waitpid F + GLIBC_2.2.5 write F +diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist +index c09c9b015a66f8f9..eec4b99b8bb69d74 100644 +--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist ++++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist +@@ -45,7 +45,6 @@ GLIBC_2.16 __read F + GLIBC_2.16 __res_state F + GLIBC_2.16 __send F + GLIBC_2.16 __sigaction F +-GLIBC_2.16 __vfork F + GLIBC_2.16 __wait F + GLIBC_2.16 __write F + GLIBC_2.16 _pthread_cleanup_pop F +@@ -216,7 +215,6 @@ GLIBC_2.16 siglongjmp F + GLIBC_2.16 sigwait F + GLIBC_2.16 system F + GLIBC_2.16 tcdrain F +-GLIBC_2.16 vfork F + GLIBC_2.16 wait F + GLIBC_2.16 waitpid F + GLIBC_2.16 write F diff --git a/SOURCES/glibc-rh1748197-3.patch b/SOURCES/glibc-rh1748197-3.patch new file mode 100644 index 0000000..dbc4b09 --- /dev/null +++ b/SOURCES/glibc-rh1748197-3.patch @@ -0,0 +1,51 @@ +commit f289e656ec8221756519a601042bc9fbe1b310fb +Author: Florian Weimer +Date: Fri Feb 8 10:21:56 2019 +0100 + + rt: Turn forwards from librt to libc into compat symbols [BZ #24194] + + As the result of commit 6e6249d0b461b952d0f544792372663feb6d792a + ("BZ#14743: Move clock_* symbols from librt to libc."), in glibc 2.17, + clock_gettime, clock_getres, clock_settime, clock_getcpuclockid, + clock_nanosleep were added to libc, and the file rt/clock-compat.c + was added with forwarders to the actual implementations in libc. + These forwarders were wrapped in + + #if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17) + + so that they are not present for newer architectures (such as + powerpc64le) with a 2.17 or later ABI baseline. But the forwarders + were not marked as compatibility symbols. As a result, on older + architectures, historic configure checks such as + + AC_CHECK_LIB(rt, clock_gettime) + + still cause linking against librt, even though this is completely + unnecessary. It also creates a needless porting hazard because + architectures behave differently when it comes to symbol availability. + + Reviewed-by: Carlos O'Donell + +diff --git a/rt/clock-compat.c b/rt/clock-compat.c +index f816973c05c29d5d..11e71aa89019b173 100644 +--- a/rt/clock-compat.c ++++ b/rt/clock-compat.c +@@ -30,14 +30,16 @@ + #if HAVE_IFUNC + # undef INIT_ARCH + # define INIT_ARCH() +-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) ++# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \ ++ compat_symbol (librt, name, name, GLIBC_2_2); + #else + # define COMPAT_REDIRECT(name, proto, arglist) \ + int \ + name proto \ + { \ + return __##name arglist; \ +- } ++ } \ ++ compat_symbol (librt, name, name, GLIBC_2_2); + #endif + + COMPAT_REDIRECT (clock_getres, diff --git a/SOURCES/glibc-rh1748197-4.patch b/SOURCES/glibc-rh1748197-4.patch new file mode 100644 index 0000000..795f673 --- /dev/null +++ b/SOURCES/glibc-rh1748197-4.patch @@ -0,0 +1,256 @@ +commit b06f4c0094d3c68be39ada0ed26ae99d51f48013 +Author: Wilco Dijkstra +Date: Fri Feb 1 12:19:42 2019 +0000 + + Cleanup clock_*time includes + + Clock_gettime, settime and getres implementations are unncessarily + complex due to using defines and C file inclusion. Simplify the + code by replacing the redundant defines and removing the inclusion, + making it much easier to understand. No functional changes. + + * sysdeps/posix/clock_getres.c (__clock_getres): Cleanup. + * sysdeps/unix/clock_gettime.c (__clock_gettime): Cleanup. + * sysdeps/unix/clock_settime.c (__clock_settime): Cleanup. + * sysdeps/unix/sysv/linux/clock_getres.c (__clock_getres): Cleanup. + * sysdeps/unix/sysv/linux/clock_gettime.c (__clock_gettime): Cleanup. + * sysdeps/unix/sysv/linux/clock_settime.c (__clock_settime): Cleanup. + +diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c +index e7924e0891b0a476..43228c381e6a73f1 100644 +--- a/sysdeps/posix/clock_getres.c ++++ b/sysdeps/posix/clock_getres.c +@@ -82,20 +82,11 @@ __clock_getres (clockid_t clock_id, struct timespec *res) + + switch (clock_id) + { +-#ifdef SYSDEP_GETRES +- SYSDEP_GETRES; +-#endif +- +-#ifndef HANDLED_REALTIME + case CLOCK_REALTIME: + retval = realtime_getres (res); + break; +-#endif /* handled REALTIME */ + + default: +-#ifdef SYSDEP_GETRES_CPU +- SYSDEP_GETRES_CPU; +-#endif + #if HP_TIMING_AVAIL + if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1)) + == CLOCK_THREAD_CPUTIME_ID) +@@ -105,7 +96,7 @@ __clock_getres (clockid_t clock_id, struct timespec *res) + __set_errno (EINVAL); + break; + +-#if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME ++#if HP_TIMING_AVAIL + case CLOCK_PROCESS_CPUTIME_ID: + case CLOCK_THREAD_CPUTIME_ID: + retval = hp_timing_getres (res); +diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c +index 96df78ab1ed09c04..f19fdf7e5f310973 100644 +--- a/sysdeps/unix/clock_gettime.c ++++ b/sysdeps/unix/clock_gettime.c +@@ -95,11 +95,6 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp) + + switch (clock_id) + { +-#ifdef SYSDEP_GETTIME +- SYSDEP_GETTIME; +-#endif +- +-#ifndef HANDLED_REALTIME + case CLOCK_REALTIME: + { + struct timeval tv; +@@ -108,12 +103,8 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp) + TIMEVAL_TO_TIMESPEC (&tv, tp); + } + break; +-#endif + + default: +-#ifdef SYSDEP_GETTIME_CPU +- SYSDEP_GETTIME_CPU (clock_id, tp); +-#endif + #if HP_TIMING_AVAIL + if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1)) + == CLOCK_THREAD_CPUTIME_ID) +@@ -123,7 +114,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp) + __set_errno (EINVAL); + break; + +-#if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME ++#if HP_TIMING_AVAIL + case CLOCK_PROCESS_CPUTIME_ID: + retval = hp_timing_gettime (clock_id, tp); + break; +diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c +index 38813eddf7b66ca1..9d5857e61b966b44 100644 +--- a/sysdeps/unix/clock_settime.c ++++ b/sysdeps/unix/clock_settime.c +@@ -21,7 +21,7 @@ + #include + + +-#if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME ++#if HP_TIMING_AVAIL + /* Clock frequency of the processor. We make it a 64-bit variable + because some jokers are already playing with processors with more + than 4GHz. */ +@@ -84,29 +84,15 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp) + + switch (clock_id) + { +-#define HANDLE_REALTIME \ +- do { \ +- struct timeval tv; \ +- TIMESPEC_TO_TIMEVAL (&tv, tp); \ +- \ +- retval = __settimeofday (&tv, NULL); \ +- } while (0) +- +-#ifdef SYSDEP_SETTIME +- SYSDEP_SETTIME; +-#endif +- +-#ifndef HANDLED_REALTIME + case CLOCK_REALTIME: +- HANDLE_REALTIME; ++ { ++ struct timeval tv; ++ TIMESPEC_TO_TIMEVAL (&tv, tp); ++ retval = __settimeofday (&tv, NULL); ++ } + break; +-#endif + + default: +-#ifdef SYSDEP_SETTIME_CPU +- SYSDEP_SETTIME_CPU; +-#endif +-#ifndef HANDLED_CPUTIME + # if HP_TIMING_AVAIL + if (CPUCLOCK_WHICH (clock_id) == CLOCK_PROCESS_CPUTIME_ID + || CPUCLOCK_WHICH (clock_id) == CLOCK_THREAD_CPUTIME_ID) +@@ -117,7 +103,6 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp) + __set_errno (EINVAL); + retval = -1; + } +-#endif + break; + } + +diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c +index 5d94f59afee80fa9..2517e66910a79d93 100644 +--- a/sysdeps/unix/sysv/linux/clock_getres.c ++++ b/sysdeps/unix/sysv/linux/clock_getres.c +@@ -26,26 +26,10 @@ + #endif + #include + +-#define SYSCALL_GETRES \ +- retval = INLINE_VSYSCALL (clock_getres, 2, clock_id, res); \ +- break +- +-/* The REALTIME and MONOTONIC clock are definitely supported in the +- kernel. */ +-#define SYSDEP_GETRES \ +- SYSDEP_GETRES_CPUTIME \ +- case CLOCK_REALTIME: \ +- case CLOCK_MONOTONIC: \ +- case CLOCK_MONOTONIC_RAW: \ +- case CLOCK_REALTIME_COARSE: \ +- case CLOCK_MONOTONIC_COARSE: \ +- SYSCALL_GETRES +- +-/* We handled the REALTIME clock here. */ +-#define HANDLED_REALTIME 1 +-#define HANDLED_CPUTIME 1 +- +-#define SYSDEP_GETRES_CPU SYSCALL_GETRES +-#define SYSDEP_GETRES_CPUTIME /* Default catches them too. */ +- +-#include ++/* Get resolution of clock. */ ++int ++__clock_getres (clockid_t clock_id, struct timespec *res) ++{ ++ return INLINE_VSYSCALL (clock_getres, 2, clock_id, res); ++} ++weak_alias (__clock_getres, clock_getres) +diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c +index d837fa36b1b901e5..dadfc518b74baea0 100644 +--- a/sysdeps/unix/sysv/linux/clock_gettime.c ++++ b/sysdeps/unix/sysv/linux/clock_gettime.c +@@ -26,22 +26,11 @@ + #endif + #include + +-/* The REALTIME and MONOTONIC clock are definitely supported in the +- kernel. */ +-#define SYSDEP_GETTIME \ +- SYSDEP_GETTIME_CPUTIME; \ +- case CLOCK_REALTIME: \ +- case CLOCK_MONOTONIC: \ +- retval = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); \ +- break +- +-/* We handled the REALTIME clock here. */ +-#define HANDLED_REALTIME 1 +-#define HANDLED_CPUTIME 1 +- +-#define SYSDEP_GETTIME_CPU(clock_id, tp) \ +- retval = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); \ +- break +-#define SYSDEP_GETTIME_CPUTIME /* Default catches them too. */ +- +-#include ++/* Get current value of CLOCK and store it in TP. */ ++int ++__clock_gettime (clockid_t clock_id, struct timespec *tp) ++{ ++ return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); ++} ++weak_alias (__clock_gettime, clock_gettime) ++libc_hidden_def (__clock_gettime) +diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c +index 5f3f22f74b3e745c..c71461a4f6deac5a 100644 +--- a/sysdeps/unix/sysv/linux/clock_settime.c ++++ b/sysdeps/unix/sysv/linux/clock_settime.c +@@ -21,18 +21,17 @@ + + #include "kernel-posix-cpu-timers.h" + +- +-/* The REALTIME clock is definitely supported in the kernel. */ +-#define SYSDEP_SETTIME \ +- case CLOCK_REALTIME: \ +- retval = INLINE_SYSCALL (clock_settime, 2, clock_id, tp); \ +- break +- +-/* We handled the REALTIME clock here. */ +-#define HANDLED_REALTIME 1 +- +-#define HANDLED_CPUTIME 1 +-#define SYSDEP_SETTIME_CPU \ +- retval = INLINE_SYSCALL (clock_settime, 2, clock_id, tp) +- +-#include ++/* Set CLOCK to value TP. */ ++int ++__clock_settime (clockid_t clock_id, const struct timespec *tp) ++{ ++ /* Make sure the time cvalue is OK. */ ++ if (tp->tv_nsec < 0 || tp->tv_nsec >= 1000000000) ++ { ++ __set_errno (EINVAL); ++ return -1; ++ } ++ ++ return INLINE_SYSCALL_CALL (clock_settime, clock_id, tp); ++} ++weak_alias (__clock_settime, clock_settime) diff --git a/SOURCES/glibc-rh1748197-5.patch b/SOURCES/glibc-rh1748197-5.patch new file mode 100644 index 0000000..4a98157 --- /dev/null +++ b/SOURCES/glibc-rh1748197-5.patch @@ -0,0 +1,735 @@ +commit 38cc11daa43b11b12a7774405accee1007de1adf +Author: Adhemerval Zanella +Date: Wed Jan 16 16:22:29 2019 +0000 + + nptl: Remove pthread_clock_gettime pthread_clock_settime + + This patch removes CLOCK_THREAD_CPUTIME_ID and CLOCK_PROCESS_CPUTIME_ID support + from clock_gettime and clock_settime generic implementation. For Linux, kernel + already provides supports through the syscall and Hurd HTL lacks + __pthread_clock_gettime and __pthread_clock_settime internal implementation. + + As described in clock_gettime man-page [1] on 'Historical note for SMP + system', implementing CLOCK_{THREAD,PROCESS}_CPUTIME_ID with timer registers + is error-prone and susceptible to timing and accurary issues that the libc + can not deal without kernel support. + + This allows removes unused code which, however, still incur in some runtime + overhead in thread creation (the struct pthread cpuclock_offset + initialization). + + If hurd eventually wants to support them it should either either implement as + a kernel facility (or something related due its architecture) or in system + specific implementation. + + Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. I also + checked on a i686-gnu build. + + * nptl/Makefile (libpthread-routines): Remove pthread_clock_gettime and + pthread_clock_settime. + * nptl/pthreadP.h (__find_thread_by_id): Remove prototype. + * elf/dl-support.c [!HP_TIMING_NOAVAIL] (_dl_cpuclock_offset): Remove. + (_dl_non_dynamic_init): Remove _dl_cpuclock_offset setting. + * elf/rtld.c (_dl_start_final): Likewise. + * nptl/allocatestack.c (__find_thread_by_id): Remove function. + * sysdeps/generic/ldsodefs.h [!HP_TIMING_NOAVAIL] (_dl_cpuclock_offset): + Remove. + * sysdeps/mach/hurd/dl-sysdep.c [!HP_TIMING_NOAVAIL] + (_dl_cpuclock_offset): Remove. + * nptl/descr.h (struct pthread): Rename cpuclock_offset to + cpuclock_offset_ununsed. + * nptl/nptl-init.c (__pthread_initialize_minimal_internal): Remove + cpuclock_offset set. + * nptl/pthread_create.c (START_THREAD_DEFN): Likewise. + * sysdeps/nptl/fork.c (__libc_fork): Likewise. + * nptl/pthread_clock_gettime.c: Remove file. + * nptl/pthread_clock_settime.c: Likewise. + * sysdeps/unix/clock_gettime.c (hp_timing_gettime): Remove function. + [HP_TIMING_AVAIL] (realtime_gettime): Remove CLOCK_THREAD_CPUTIME_ID + and CLOCK_PROCESS_CPUTIME_ID support. + * sysdeps/unix/clock_settime.c (hp_timing_gettime): Likewise. + [HP_TIMING_AVAIL] (realtime_gettime): Likewise. + * sysdeps/posix/clock_getres.c (hp_timing_getres): Likewise. + [HP_TIMING_AVAIL] (__clock_getres): Likewise. + * sysdeps/unix/clock_nanosleep.c (CPUCLOCK_P, INVALID_CLOCK_P): + Likewise. + (__clock_nanosleep): Remove CPUCLOCK_P and INVALID_CLOCK_P usage. + + [1] http://man7.org/linux/man-pages/man2/clock_gettime.2.html + +Conflicts: + nptl/pthread_clock_gettime.c + nptl/pthread_clock_settime.c + (Removal after copyright year update upstream.) + +diff --git a/elf/dl-support.c b/elf/dl-support.c +index c8439fcc53d126f3..ef5455b91c17ca30 100644 +--- a/elf/dl-support.c ++++ b/elf/dl-support.c +@@ -127,11 +127,6 @@ void *_dl_random; + #include + #include + +-/* Initial value of the CPU clock. */ +-#ifndef HP_TIMING_NONAVAIL +-hp_timing_t _dl_cpuclock_offset; +-#endif +- + void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls; + + size_t _dl_pagesize = EXEC_PAGESIZE; +@@ -312,9 +307,6 @@ _dl_non_dynamic_init (void) + _dl_main_map.l_phdr = GL(dl_phdr); + _dl_main_map.l_phnum = GL(dl_phnum); + +- if (HP_SMALL_TIMING_AVAIL) +- HP_TIMING_NOW (_dl_cpuclock_offset); +- + _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1; + + /* Set up the data structures for the system-supplied DSO early, +diff --git a/elf/rtld.c b/elf/rtld.c +index 0aa1a2a19f649e16..e107bd14f9478a90 100644 +--- a/elf/rtld.c ++++ b/elf/rtld.c +@@ -401,8 +401,6 @@ _dl_start_final (void *arg, struct dl_start_final_info *info) + # endif + #endif + +- HP_TIMING_NOW (GL(dl_cpuclock_offset)); +- + /* Initialize the stack end variable. */ + __libc_stack_end = __builtin_frame_address (0); + +diff --git a/nptl/Makefile b/nptl/Makefile +index 447dce0590295c9c..d6b37b6efd3b7d78 100644 +--- a/nptl/Makefile ++++ b/nptl/Makefile +@@ -109,7 +109,6 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ + pthread_once \ + old_pthread_atfork \ + pthread_getcpuclockid \ +- pthread_clock_gettime pthread_clock_settime \ + shm-directory \ + sem_init sem_destroy \ + sem_open sem_close sem_unlink \ +diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c +index d0971a97fdbe098e..5fa45b19987717e1 100644 +--- a/nptl/allocatestack.c ++++ b/nptl/allocatestack.c +@@ -964,54 +964,6 @@ __reclaim_stacks (void) + } + + +-#if HP_TIMING_AVAIL +-# undef __find_thread_by_id +-/* Find a thread given the thread ID. */ +-attribute_hidden +-struct pthread * +-__find_thread_by_id (pid_t tid) +-{ +- struct pthread *result = NULL; +- +- lll_lock (stack_cache_lock, LLL_PRIVATE); +- +- /* Iterate over the list with system-allocated threads first. */ +- list_t *runp; +- list_for_each (runp, &stack_used) +- { +- struct pthread *curp; +- +- curp = list_entry (runp, struct pthread, list); +- +- if (curp->tid == tid) +- { +- result = curp; +- goto out; +- } +- } +- +- /* Now the list with threads using user-allocated stacks. */ +- list_for_each (runp, &__stack_user) +- { +- struct pthread *curp; +- +- curp = list_entry (runp, struct pthread, list); +- +- if (curp->tid == tid) +- { +- result = curp; +- goto out; +- } +- } +- +- out: +- lll_unlock (stack_cache_lock, LLL_PRIVATE); +- +- return result; +-} +-#endif +- +- + #ifdef SIGSETXID + static void + setxid_mark_thread (struct xid_command *cmdp, struct pthread *t) +diff --git a/nptl/descr.h b/nptl/descr.h +index 9c01e1b9863b178c..c3b81d8b27839502 100644 +--- a/nptl/descr.h ++++ b/nptl/descr.h +@@ -343,8 +343,7 @@ struct pthread + unsigned int setxid_futex; + + #if HP_TIMING_AVAIL +- /* Offset of the CPU clock at start thread start time. */ +- hp_timing_t cpuclock_offset; ++ hp_timing_t cpuclock_offset_ununsed; + #endif + + /* If the thread waits to join another one the ID of the latter is +diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c +index 907411d5bca2af79..098bc059f4771ef2 100644 +--- a/nptl/nptl-init.c ++++ b/nptl/nptl-init.c +@@ -275,9 +275,6 @@ __pthread_initialize_minimal_internal (void) + THREAD_SETMEM (pd, user_stack, true); + if (LLL_LOCK_INITIALIZER != 0) + THREAD_SETMEM (pd, lock, LLL_LOCK_INITIALIZER); +-#if HP_TIMING_AVAIL +- THREAD_SETMEM (pd, cpuclock_offset, GL(dl_cpuclock_offset)); +-#endif + + /* Initialize the robust mutex data. */ + { +diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h +index 19efe1e35feed5be..00be8f92793e8710 100644 +--- a/nptl/pthreadP.h ++++ b/nptl/pthreadP.h +@@ -406,16 +406,6 @@ extern int __pthread_multiple_threads attribute_hidden; + extern int *__libc_multiple_threads_ptr attribute_hidden; + #endif + +-/* Find a thread given its TID. */ +-extern struct pthread *__find_thread_by_id (pid_t tid) attribute_hidden +-#ifdef SHARED +-; +-#else +-weak_function; +-#define __find_thread_by_id(tid) \ +- (__find_thread_by_id ? (__find_thread_by_id) (tid) : (struct pthread *) NULL) +-#endif +- + extern void __pthread_init_static_tls (struct link_map *) attribute_hidden; + + extern size_t __pthread_get_minstack (const pthread_attr_t *attr); +diff --git a/nptl/pthread_clock_gettime.c b/nptl/pthread_clock_gettime.c +deleted file mode 100644 +index 6bc75cfe3f1ff856..0000000000000000 +--- a/nptl/pthread_clock_gettime.c ++++ /dev/null +@@ -1,67 +0,0 @@ +-/* Copyright (C) 2001-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public License as +- published by the Free Software Foundation; either version 2.1 of the +- License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; see the file COPYING.LIB. If +- not, see . */ +- +-#include +-#include +-#include +-#include "pthreadP.h" +- +- +-#if HP_TIMING_AVAIL +-int +-__pthread_clock_gettime (clockid_t clock_id, hp_timing_t freq, +- struct timespec *tp) +-{ +- hp_timing_t tsc; +- +- /* Get the current counter. */ +- HP_TIMING_NOW (tsc); +- +- /* This is the ID of the thread we are looking for. */ +- pid_t tid = ((unsigned int) clock_id) >> CLOCK_IDFIELD_SIZE; +- +- /* Compute the offset since the start time of the process. */ +- if (tid == 0 || tid == THREAD_GETMEM (THREAD_SELF, tid)) +- /* Our own clock. */ +- tsc -= THREAD_GETMEM (THREAD_SELF, cpuclock_offset); +- else +- { +- /* This is more complicated. We have to locate the thread based +- on the ID. This means walking the list of existing +- threads. */ +- struct pthread *thread = __find_thread_by_id (tid); +- if (thread == NULL) +- { +- __set_errno (EINVAL); +- return -1; +- } +- +- /* There is a race here. The thread might terminate and the stack +- become unusable. But this is the user's problem. */ +- tsc -= thread->cpuclock_offset; +- } +- +- /* Compute the seconds. */ +- tp->tv_sec = tsc / freq; +- +- /* And the nanoseconds. This computation should be stable until +- we get machines with about 16GHz frequency. */ +- tp->tv_nsec = ((tsc % freq) * 1000000000ull) / freq; +- +- return 0; +-} +-#endif +diff --git a/nptl/pthread_clock_settime.c b/nptl/pthread_clock_settime.c +deleted file mode 100644 +index 29d35c64cfa817a3..0000000000000000 +--- a/nptl/pthread_clock_settime.c ++++ /dev/null +@@ -1,54 +0,0 @@ +-/* Copyright (C) 2001-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public License as +- published by the Free Software Foundation; either version 2.1 of the +- License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; see the file COPYING.LIB. If +- not, see . */ +- +-#include +-#include +-#include +-#include "pthreadP.h" +- +- +-#if HP_TIMING_AVAIL +-int +-__pthread_clock_settime (clockid_t clock_id, hp_timing_t offset) +-{ +- /* This is the ID of the thread we are looking for. */ +- pid_t tid = ((unsigned int) clock_id) >> CLOCK_IDFIELD_SIZE; +- +- /* Compute the offset since the start time of the process. */ +- if (tid == 0 || tid == THREAD_GETMEM (THREAD_SELF, tid)) +- /* Our own clock. */ +- THREAD_SETMEM (THREAD_SELF, cpuclock_offset, offset); +- else +- { +- /* This is more complicated. We have to locate the thread based +- on the ID. This means walking the list of existing +- threads. */ +- struct pthread *thread = __find_thread_by_id (tid); +- if (thread == NULL) +- { +- __set_errno (EINVAL); +- return -1; +- } +- +- /* There is a race here. The thread might terminate and the stack +- become unusable. But this is the user's problem. */ +- thread->cpuclock_offset = offset; +- } +- +- return 0; +-} +-#endif +diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c +index fe75d04113b8aa3f..f58a15cd1c7bbb6f 100644 +--- a/nptl/pthread_create.c ++++ b/nptl/pthread_create.c +@@ -379,13 +379,6 @@ START_THREAD_DEFN + { + struct pthread *pd = START_THREAD_SELF; + +-#if HP_TIMING_AVAIL +- /* Remember the time when the thread was started. */ +- hp_timing_t now; +- HP_TIMING_NOW (now); +- THREAD_SETMEM (pd, cpuclock_offset, now); +-#endif +- + /* Initialize resolver state pointer. */ + __resp = &pd->res; + +diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h +index c6b7e61badbfd513..f0185ce0d16c0f69 100644 +--- a/sysdeps/generic/ldsodefs.h ++++ b/sysdeps/generic/ldsodefs.h +@@ -359,11 +359,6 @@ struct rtld_global + /* The object to be initialized first. */ + EXTERN struct link_map *_dl_initfirst; + +-#if HP_SMALL_TIMING_AVAIL +- /* Start time on CPU clock. */ +- EXTERN hp_timing_t _dl_cpuclock_offset; +-#endif +- + /* Map of shared object to be profiled. */ + EXTERN struct link_map *_dl_profile_map; + +diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c +index b72913d3baaed1d9..7bd1d70c96c229e0 100644 +--- a/sysdeps/mach/hurd/dl-sysdep.c ++++ b/sysdeps/mach/hurd/dl-sysdep.c +@@ -62,10 +62,6 @@ int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion + void *__libc_stack_end = NULL; + rtld_hidden_data_def(__libc_stack_end) + +-#if HP_TIMING_AVAIL +-hp_timing_t _dl_cpuclock_offset; +-#endif +- + /* TODO: Initialize. */ + void *_dl_random attribute_relro = NULL; + +@@ -246,10 +242,6 @@ unfmh(); /* XXX */ + /* Initialize frequently used global variable. */ + GLRO(dl_pagesize) = __getpagesize (); + +-#if HP_TIMING_AVAIL +- HP_TIMING_NOW (_dl_cpuclock_offset); +-#endif +- + fmh(); /* XXX */ + + /* See hurd/hurdstartup.c; this deals with getting information +diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c +index 1a9429b579cd346e..37db30f3d1e846b6 100644 +--- a/sysdeps/nptl/fork.c ++++ b/sysdeps/nptl/fork.c +@@ -83,14 +83,6 @@ __libc_fork (void) + if (__fork_generation_pointer != NULL) + *__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR; + +-#if HP_TIMING_AVAIL +- /* The CPU clock of the thread and process have to be set to zero. */ +- hp_timing_t now; +- HP_TIMING_NOW (now); +- THREAD_SETMEM (self, cpuclock_offset, now); +- GL(dl_cpuclock_offset) = now; +-#endif +- + #ifdef __NR_set_robust_list + /* Initialize the robust mutex list setting in the kernel which has + been reset during the fork. We do not check for errors because if +diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c +index 43228c381e6a73f1..5b0d8eb8a1a0593e 100644 +--- a/sysdeps/posix/clock_getres.c ++++ b/sysdeps/posix/clock_getres.c +@@ -24,37 +24,6 @@ + #include + + +-#if HP_TIMING_AVAIL +-static long int nsec; /* Clock frequency of the processor. */ +- +-static int +-hp_timing_getres (struct timespec *res) +-{ +- if (__glibc_unlikely (nsec == 0)) +- { +- hp_timing_t freq; +- +- /* This can only happen if we haven't initialized the `nsec' +- variable yet. Do this now. We don't have to protect this +- code against multiple execution since all of them should +- lead to the same result. */ +- freq = __get_clockfreq (); +- if (__glibc_unlikely (freq == 0)) +- /* Something went wrong. */ +- return -1; +- +- nsec = MAX (UINT64_C (1000000000) / freq, 1); +- } +- +- /* Fill in the values. +- The seconds are always zero (unless we have a 1Hz machine). */ +- res->tv_sec = 0; +- res->tv_nsec = nsec; +- +- return 0; +-} +-#endif +- + static inline int + realtime_getres (struct timespec *res) + { +@@ -87,21 +56,8 @@ __clock_getres (clockid_t clock_id, struct timespec *res) + break; + + default: +-#if HP_TIMING_AVAIL +- if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1)) +- == CLOCK_THREAD_CPUTIME_ID) +- retval = hp_timing_getres (res); +- else +-#endif +- __set_errno (EINVAL); +- break; +- +-#if HP_TIMING_AVAIL +- case CLOCK_PROCESS_CPUTIME_ID: +- case CLOCK_THREAD_CPUTIME_ID: +- retval = hp_timing_getres (res); ++ __set_errno (EINVAL); + break; +-#endif + } + + return retval; +diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c +index f19fdf7e5f310973..f3ebbe15ccc2e95e 100644 +--- a/sysdeps/unix/clock_gettime.c ++++ b/sysdeps/unix/clock_gettime.c +@@ -24,57 +24,6 @@ + #include + + +-#if HP_TIMING_AVAIL +-/* Clock frequency of the processor. We make it a 64-bit variable +- because some jokers are already playing with processors with more +- than 4GHz. */ +-static hp_timing_t freq; +- +- +-/* This function is defined in the thread library. */ +-extern int __pthread_clock_gettime (clockid_t clock_id, hp_timing_t freq, +- struct timespec *tp) +- __attribute__ ((__weak__)); +- +-static int +-hp_timing_gettime (clockid_t clock_id, struct timespec *tp) +-{ +- hp_timing_t tsc; +- +- if (__glibc_unlikely (freq == 0)) +- { +- /* This can only happen if we haven't initialized the `freq' +- variable yet. Do this now. We don't have to protect this +- code against multiple execution since all of them should +- lead to the same result. */ +- freq = __get_clockfreq (); +- if (__glibc_unlikely (freq == 0)) +- /* Something went wrong. */ +- return -1; +- } +- +- if (clock_id != CLOCK_PROCESS_CPUTIME_ID +- && __pthread_clock_gettime != NULL) +- return __pthread_clock_gettime (clock_id, freq, tp); +- +- /* Get the current counter. */ +- HP_TIMING_NOW (tsc); +- +- /* Compute the offset since the start time of the process. */ +- tsc -= GL(dl_cpuclock_offset); +- +- /* Compute the seconds. */ +- tp->tv_sec = tsc / freq; +- +- /* And the nanoseconds. This computation should be stable until +- we get machines with about 16GHz frequency. */ +- tp->tv_nsec = ((tsc % freq) * UINT64_C (1000000000)) / freq; +- +- return 0; +-} +-#endif +- +- + static inline int + realtime_gettime (struct timespec *tp) + { +@@ -105,20 +54,8 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp) + break; + + default: +-#if HP_TIMING_AVAIL +- if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1)) +- == CLOCK_THREAD_CPUTIME_ID) +- retval = hp_timing_gettime (clock_id, tp); +- else +-#endif +- __set_errno (EINVAL); +- break; +- +-#if HP_TIMING_AVAIL +- case CLOCK_PROCESS_CPUTIME_ID: +- retval = hp_timing_gettime (clock_id, tp); ++ __set_errno (EINVAL); + break; +-#endif + } + + return retval; +diff --git a/sysdeps/unix/clock_nanosleep.c b/sysdeps/unix/clock_nanosleep.c +index 97b3d6b6ab9e4581..13dd0f4b905ec631 100644 +--- a/sysdeps/unix/clock_nanosleep.c ++++ b/sysdeps/unix/clock_nanosleep.c +@@ -19,23 +19,8 @@ + #include + #include + #include +-#include + #include + +-#if HP_TIMING_AVAIL +-# define CPUCLOCK_P(clock) \ +- ((clock) == CLOCK_PROCESS_CPUTIME_ID \ +- || ((clock) & ((1 << CLOCK_IDFIELD_SIZE) - 1)) == CLOCK_THREAD_CPUTIME_ID) +-#else +-# define CPUCLOCK_P(clock) 0 +-#endif +- +-#ifndef INVALID_CLOCK_P +-# define INVALID_CLOCK_P(cl) \ +- ((cl) < CLOCK_REALTIME || (cl) > CLOCK_THREAD_CPUTIME_ID) +-#endif +- +- + /* This implementation assumes that these is only a `nanosleep' system + call. So we have to remap all other activities. */ + int +@@ -51,14 +36,7 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, + if (clock_id == CLOCK_THREAD_CPUTIME_ID) + return EINVAL; /* POSIX specifies EINVAL for this case. */ + +-#ifdef SYSDEP_NANOSLEEP +- SYSDEP_NANOSLEEP; +-#endif +- +- if (CPUCLOCK_P (clock_id)) +- return ENOTSUP; +- +- if (INVALID_CLOCK_P (clock_id)) ++ if (clock_id < CLOCK_REALTIME || clock_id > CLOCK_THREAD_CPUTIME_ID) + return EINVAL; + + /* If we got an absolute time, remap it. */ +@@ -71,7 +49,7 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, + assert (sizeof (sec) >= sizeof (now.tv_sec)); + + /* Get the current time for this clock. */ +- if (__builtin_expect (__clock_gettime (clock_id, &now), 0) != 0) ++ if (__clock_gettime (clock_id, &now) != 0) + return errno; + + /* Compute the difference. */ +@@ -90,12 +68,12 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, + /* Make sure we are not modifying the struct pointed to by REM. */ + rem = NULL; + } +- else if (__builtin_expect (flags, 0) != 0) ++ else if (flags != 0) + return EINVAL; + else if (clock_id != CLOCK_REALTIME) + /* Not supported. */ + return ENOTSUP; + +- return __builtin_expect (__nanosleep (req, rem), 0) ? errno : 0; ++ return __nanosleep (req, rem), 0 ? errno : 0; + } + weak_alias (__clock_nanosleep, clock_nanosleep) +diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c +index 9d5857e61b966b44..4f5640f67047cef6 100644 +--- a/sysdeps/unix/clock_settime.c ++++ b/sysdeps/unix/clock_settime.c +@@ -21,59 +21,11 @@ + #include + + +-#if HP_TIMING_AVAIL +-/* Clock frequency of the processor. We make it a 64-bit variable +- because some jokers are already playing with processors with more +- than 4GHz. */ +-static hp_timing_t freq; +- +- +-/* This function is defined in the thread library. */ +-extern void __pthread_clock_settime (clockid_t clock_id, hp_timing_t offset) +- __attribute__ ((__weak__)); +- +- +-static int +-hp_timing_settime (clockid_t clock_id, const struct timespec *tp) +-{ +- hp_timing_t tsc; +- hp_timing_t usertime; +- +- /* First thing is to get the current time. */ +- HP_TIMING_NOW (tsc); +- +- if (__glibc_unlikely (freq == 0)) +- { +- /* This can only happen if we haven't initialized the `freq' +- variable yet. Do this now. We don't have to protect this +- code against multiple execution since all of them should lead +- to the same result. */ +- freq = __get_clockfreq (); +- if (__glibc_unlikely (freq == 0)) +- /* Something went wrong. */ +- return -1; +- } +- +- /* Convert the user-provided time into CPU ticks. */ +- usertime = tp->tv_sec * freq + (tp->tv_nsec * freq) / 1000000000ull; +- +- /* Determine the offset and use it as the new base value. */ +- if (clock_id == CLOCK_PROCESS_CPUTIME_ID +- || __pthread_clock_settime == NULL) +- GL(dl_cpuclock_offset) = tsc - usertime; +- else +- __pthread_clock_settime (clock_id, tsc - usertime); +- +- return 0; +-} +-#endif +- +- + /* Set CLOCK to value TP. */ + int + __clock_settime (clockid_t clock_id, const struct timespec *tp) + { +- int retval; ++ int retval = -1; + + /* Make sure the time cvalue is OK. */ + if (tp->tv_nsec < 0 || tp->tv_nsec >= 1000000000) +@@ -93,16 +45,7 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp) + break; + + default: +-# if HP_TIMING_AVAIL +- if (CPUCLOCK_WHICH (clock_id) == CLOCK_PROCESS_CPUTIME_ID +- || CPUCLOCK_WHICH (clock_id) == CLOCK_THREAD_CPUTIME_ID) +- retval = hp_timing_settime (clock_id, tp); +- else +-# endif +- { +- __set_errno (EINVAL); +- retval = -1; +- } ++ __set_errno (EINVAL); + break; + } + diff --git a/SOURCES/glibc-rh1748197-6.patch b/SOURCES/glibc-rh1748197-6.patch new file mode 100644 index 0000000..65b59c9 --- /dev/null +++ b/SOURCES/glibc-rh1748197-6.patch @@ -0,0 +1,745 @@ +commit 6e8ba7fd574f530afb9681f21604475d5756d773 +Author: Adhemerval Zanella +Date: Fri Feb 8 16:53:40 2019 +0000 + + Remove __get_clockfreq + + With clock_getres, clock_gettime, and clock_settime refactor to remove the + generic CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID support through + hp-timing, there is no usage of internal __get_clockfreq. This patch removes + both generic and Linux implementation.. + + Checked with a build against aarch64-linux-gnu, i686-linux-gnu, ia64-linux-gnu, + sparc64-linux-gnu, powerpc-linux-gnu-power4. + + * include/libc-internal.h (__get_clockfreq): Remove prototype. + * rt/Makefile (clock-routines): Remove get_clockfreq. + * rt/get_clockfreq.c: Remove file. + * sysdeps/unix/sysv/linux/i386/get_clockfreq.c: Likewise. + * sysdeps/unix/sysv/linux/ia64/get_clockfreq.c: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Move code to ... + * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c: ... here. + +Conflicts: + rt/get_clockfreq.c + sysdeps/unix/sysv/linux/i386/get_clockfreq.c + sysdeps/unix/sysv/linux/ia64/get_clockfreq.c + sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c + (Removal after copyright year change upstream.) + sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c + (Likewise. Missing backport of aa0e46636a5b71 ("Break + further lines before not after operators.").) + +diff --git a/include/libc-internal.h b/include/libc-internal.h +index 2167990c52bd708b..2ec07d9355db1808 100644 +--- a/include/libc-internal.h ++++ b/include/libc-internal.h +@@ -36,9 +36,6 @@ libc_hidden_proto (__profile_frequency) + extern void __cyg_profile_func_enter (void *this_fn, void *call_site); + extern void __cyg_profile_func_exit (void *this_fn, void *call_site); + +-/* Get frequency of the system processor. */ +-extern hp_timing_t __get_clockfreq (void); +- + /* Free all allocated resources. */ + extern void __libc_freeres (void); + libc_hidden_proto (__libc_freeres) +diff --git a/rt/Makefile b/rt/Makefile +index 6d6b896ee9817c5c..14f38ef74d262188 100644 +--- a/rt/Makefile ++++ b/rt/Makefile +@@ -28,7 +28,7 @@ aio-routines := aio_cancel aio_error aio_fsync aio_misc aio_read \ + aio_read64 aio_return aio_suspend aio_write \ + aio_write64 lio_listio lio_listio64 aio_sigqueue \ + aio_notify +-clock-routines := get_clockfreq clock_getcpuclockid \ ++clock-routines := clock_getcpuclockid \ + clock_getres clock_gettime clock_settime \ + clock_nanosleep + timer-routines := timer_create timer_delete timer_getoverr \ +diff --git a/rt/get_clockfreq.c b/rt/get_clockfreq.c +deleted file mode 100644 +index e695a6018c0b8322..0000000000000000 +--- a/rt/get_clockfreq.c ++++ /dev/null +@@ -1,27 +0,0 @@ +-/* Get frequency of the system processor. +- Copyright (C) 2000-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +- +-hp_timing_t +-__get_clockfreq (void) +-{ +- /* There is no generic way to find this out since we have in general +- no counter register either. */ +- return 0; +-} +diff --git a/sysdeps/unix/sysv/linux/i386/get_clockfreq.c b/sysdeps/unix/sysv/linux/i386/get_clockfreq.c +deleted file mode 100644 +index 633f186be80f10b0..0000000000000000 +--- a/sysdeps/unix/sysv/linux/i386/get_clockfreq.c ++++ /dev/null +@@ -1,88 +0,0 @@ +-/* Get frequency of the system processor. i386/Linux version. +- Copyright (C) 2000-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +-#include +-#include +- +-hp_timing_t +-__get_clockfreq (void) +-{ +- /* We read the information from the /proc filesystem. It contains at +- least one line like +- cpu MHz : 497.840237 +- or also +- cpu MHz : 497.841 +- We search for this line and convert the number in an integer. */ +- static hp_timing_t result; +- int fd; +- +- /* If this function was called before, we know the result. */ +- if (result != 0) +- return result; +- +- fd = __open ("/proc/cpuinfo", O_RDONLY); +- if (__glibc_likely (fd != -1)) +- { +- /* XXX AFAIK the /proc filesystem can generate "files" only up +- to a size of 4096 bytes. */ +- char buf[4096]; +- ssize_t n; +- +- n = __read (fd, buf, sizeof buf); +- if (__builtin_expect (n, 1) > 0) +- { +- char *mhz = memmem (buf, n, "cpu MHz", 7); +- +- if (__glibc_likely (mhz != NULL)) +- { +- char *endp = buf + n; +- int seen_decpoint = 0; +- int ndigits = 0; +- +- /* Search for the beginning of the string. */ +- while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n') +- ++mhz; +- +- while (mhz < endp && *mhz != '\n') +- { +- if (*mhz >= '0' && *mhz <= '9') +- { +- result *= 10; +- result += *mhz - '0'; +- if (seen_decpoint) +- ++ndigits; +- } +- else if (*mhz == '.') +- seen_decpoint = 1; +- +- ++mhz; +- } +- +- /* Compensate for missing digits at the end. */ +- while (ndigits++ < 6) +- result *= 10; +- } +- } +- +- __close (fd); +- } +- +- return result; +-} +diff --git a/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c b/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c +deleted file mode 100644 +index f9d683a90247ac60..0000000000000000 +--- a/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c ++++ /dev/null +@@ -1,87 +0,0 @@ +-/* Get frequency of the system processor. IA-64/Linux version. +- Copyright (C) 2001-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +-#include +-#include +- +- +-hp_timing_t +-__get_clockfreq (void) +-{ +- /* We read the information from the /proc filesystem. It contains at +- least one line like +- itc MHz : 733.390988 +- We search for this line and convert the number in an integer. */ +- static hp_timing_t result; +- int fd; +- +- /* If this function was called before, we know the result. */ +- if (result != 0) +- return result; +- +- fd = __open ("/proc/cpuinfo", O_RDONLY); +- if (__builtin_expect (fd != -1, 1)) +- { +- /* XXX AFAIK the /proc filesystem can generate "files" only up +- to a size of 4096 bytes. */ +- char buf[4096]; +- ssize_t n; +- +- n = __read (fd, buf, sizeof buf); +- if (__builtin_expect (n, 1) > 0) +- { +- char *mhz = memmem (buf, n, "itc MHz", 7); +- +- if (__builtin_expect (mhz != NULL, 1)) +- { +- char *endp = buf + n; +- int seen_decpoint = 0; +- int ndigits = 0; +- +- /* Search for the beginning of the string. */ +- while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n') +- ++mhz; +- +- while (mhz < endp && *mhz != '\n') +- { +- if (*mhz >= '0' && *mhz <= '9') +- { +- result *= 10; +- result += *mhz - '0'; +- if (seen_decpoint) +- ++ndigits; +- } +- else if (*mhz == '.') +- seen_decpoint = 1; +- +- ++mhz; +- } +- +- /* Compensate for missing digits at the end. */ +- while (ndigits++ < 6) +- result *= 10; +- } +- } +- +- __close (fd); +- } +- +- return result; +-} +diff --git a/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c b/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c +deleted file mode 100644 +index 3a2216021bfb5408..0000000000000000 +--- a/sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c ++++ /dev/null +@@ -1,107 +0,0 @@ +-/* Get frequency of the system processor. powerpc/Linux version. +- Copyright (C) 2000-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-hp_timing_t +-__get_clockfreq (void) +-{ +- hp_timing_t result = 0L; +- +-#ifdef SHARED +- /* The vDSO does not return an error (it clear cr0.so on returning). */ +- INTERNAL_SYSCALL_DECL (err); +- result = +- INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK (get_tbfreq, err, uint64_t, 0); +-#else +- /* We read the information from the /proc filesystem. /proc/cpuinfo +- contains at least one line like: +- timebase : 33333333 +- We search for this line and convert the number into an integer. */ +- int fd = __open_nocancel ("/proc/cpuinfo", O_RDONLY); +- if (__glibc_likely (fd != -1)) +- return result; +- +- /* The timebase will be in the 1st 1024 bytes for systems with up +- to 8 processors. If the first read returns less then 1024 +- bytes read, we have the whole cpuinfo and can start the scan. +- Otherwise we will have to read more to insure we have the +- timebase value in the scan. */ +- char buf[1024]; +- ssize_t n; +- +- n = __read_nocancel (fd, buf, sizeof (buf)); +- if (n == sizeof (buf)) +- { +- /* We are here because the 1st read returned exactly sizeof +- (buf) bytes. This implies that we are not at EOF and may +- not have read the timebase value yet. So we need to read +- more bytes until we know we have EOF. We copy the lower +- half of buf to the upper half and read sizeof (buf)/2 +- bytes into the lower half of buf and repeat until we +- reach EOF. We can assume that the timebase will be in +- the last 512 bytes of cpuinfo, so two 512 byte half_bufs +- will be sufficient to contain the timebase and will +- handle the case where the timebase spans the half_buf +- boundry. */ +- const ssize_t half_buf = sizeof (buf) / 2; +- while (n >= half_buf) +- { +- memcpy (buf, buf + half_buf, half_buf); +- n = __read_nocancel (fd, buf + half_buf, half_buf); +- } +- if (n >= 0) +- n += half_buf; +- } +- __close_nocancel (fd); +- +- if (__glibc_likely (n > 0)) +- { +- char *mhz = memmem (buf, n, "timebase", 7); +- +- if (__glibc_likely (mhz != NULL)) +- { +- char *endp = buf + n; +- +- /* Search for the beginning of the string. */ +- while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n') +- ++mhz; +- +- while (mhz < endp && *mhz != '\n') +- { +- if (*mhz >= '0' && *mhz <= '9') +- { +- result *= 10; +- result += *mhz - '0'; +- } +- +- ++mhz; +- } +- } +- } +-#endif +- +- return result; +-} +diff --git a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c +index 6435e1f31529c7de..1177ccbc8faeafe7 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c ++++ b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c +@@ -17,11 +17,90 @@ + . */ + + #include ++#include ++ + #include ++#include ++#include + + uint64_t + __get_timebase_freq (void) + { +- return (uint64_t) __get_clockfreq (); ++ hp_timing_t result = 0L; ++ ++#ifdef SHARED ++ /* The vDSO does not return an error (it clear cr0.so on returning). */ ++ INTERNAL_SYSCALL_DECL (err); ++ result = ++ INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK (get_tbfreq, err, uint64_t, 0); ++#else ++ /* We read the information from the /proc filesystem. /proc/cpuinfo ++ contains at least one line like: ++ timebase : 33333333 ++ We search for this line and convert the number into an integer. */ ++ int fd = __open_nocancel ("/proc/cpuinfo", O_RDONLY); ++ if (__glibc_likely (fd != -1)) ++ return result; ++ ++ /* The timebase will be in the 1st 1024 bytes for systems with up ++ to 8 processors. If the first read returns less then 1024 ++ bytes read, we have the whole cpuinfo and can start the scan. ++ Otherwise we will have to read more to insure we have the ++ timebase value in the scan. */ ++ char buf[1024]; ++ ssize_t n; ++ ++ n = __read_nocancel (fd, buf, sizeof (buf)); ++ if (n == sizeof (buf)) ++ { ++ /* We are here because the 1st read returned exactly sizeof ++ (buf) bytes. This implies that we are not at EOF and may ++ not have read the timebase value yet. So we need to read ++ more bytes until we know we have EOF. We copy the lower ++ half of buf to the upper half and read sizeof (buf)/2 ++ bytes into the lower half of buf and repeat until we ++ reach EOF. We can assume that the timebase will be in ++ the last 512 bytes of cpuinfo, so two 512 byte half_bufs ++ will be sufficient to contain the timebase and will ++ handle the case where the timebase spans the half_buf ++ boundry. */ ++ const ssize_t half_buf = sizeof (buf) / 2; ++ while (n >= half_buf) ++ { ++ memcpy (buf, buf + half_buf, half_buf); ++ n = __read_nocancel (fd, buf + half_buf, half_buf); ++ } ++ if (n >= 0) ++ n += half_buf; ++ } ++ __close_nocancel (fd); ++ ++ if (__glibc_likely (n > 0)) ++ { ++ char *mhz = memmem (buf, n, "timebase", 7); ++ ++ if (__glibc_likely (mhz != NULL)) ++ { ++ char *endp = buf + n; ++ ++ /* Search for the beginning of the string. */ ++ while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n') ++ ++mhz; ++ ++ while (mhz < endp && *mhz != '\n') ++ { ++ if (*mhz >= '0' && *mhz <= '9') ++ { ++ result *= 10; ++ result += *mhz - '0'; ++ } ++ ++ ++mhz; ++ } ++ } ++ } ++#endif ++ ++ return result; + } + weak_alias (__get_timebase_freq, __ppc_get_timebase_freq) +diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c b/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c +deleted file mode 100644 +index 6838a77a769ddae8..0000000000000000 +--- a/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c ++++ /dev/null +@@ -1,250 +0,0 @@ +-/* Get frequency of the system processor. sparc64 version. +- Copyright (C) 2001-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-static hp_timing_t +-__get_clockfreq_via_cpuinfo (void) +-{ +- hp_timing_t result; +- int fd; +- +- result = 0; +- +- fd = __open ("/proc/cpuinfo", O_RDONLY); +- if (fd != -1) +- { +- char buf[8192]; +- ssize_t n; +- +- n = __read (fd, buf, sizeof buf); +- if (n > 0) +- { +- char *mhz = memmem (buf, n, "Cpu0ClkTck", 7); +- +- if (mhz != NULL) +- { +- char *endp = buf + n; +- +- /* Search for the beginning of the string. */ +- while (mhz < endp +- && (*mhz < '0' || *mhz > '9') +- && (*mhz < 'a' || *mhz > 'f') +- && *mhz != '\n') +- ++mhz; +- +- while (mhz < endp && *mhz != '\n') +- { +- if ((*mhz >= '0' && *mhz <= '9') || +- (*mhz >= 'a' && *mhz <= 'f')) +- { +- result <<= 4; +- if (*mhz >= '0' && *mhz <= '9') +- result += *mhz - '0'; +- else +- result += (*mhz - 'a') + 10; +- } +- ++mhz; +- } +- } +- } +- +- __close (fd); +- } +- +- return result; +-} +- +-static hp_timing_t +-__get_clockfreq_via_proc_openprom (void) +-{ +- hp_timing_t result; +- int obp_fd; +- +- result = 0; +- +- obp_fd = __open ("/proc/openprom", O_RDONLY); +- if (obp_fd != -1) +- { +- unsigned long int buf[4096 / sizeof (unsigned long int)]; +- struct dirent64 *dirp = (struct dirent64 *) buf; +- ssize_t len; +- +- while ((len = __getdents64 (obp_fd, (char *) dirp, sizeof (buf))) > 0) +- { +- struct dirent64 *this_dirp = dirp; +- +- while (len > 0) +- { +- char node[strlen ("/proc/openprom/") +- + _D_ALLOC_NAMLEN (this_dirp) +- + strlen ("/clock-frequency")]; +- char *prop; +- int fd; +- +- /* Note that +- strlen("/clock-frequency") > strlen("/device_type") +- */ +- __stpcpy (prop = __stpcpy (__stpcpy (node, "/proc/openprom/"), +- this_dirp->d_name), +- "/device_type"); +- fd = __open (node, O_RDONLY); +- if (fd != -1) +- { +- char type_string[128]; +- int ret; +- +- ret = __read (fd, type_string, sizeof (type_string)); +- if (ret > 0 && strncmp (type_string, "'cpu'", 5) == 0) +- { +- int clkfreq_fd; +- +- __stpcpy (prop, "/clock-frequency"); +- clkfreq_fd = __open (node, O_RDONLY); +- if (clkfreq_fd != -1) +- { +- if (__read (clkfreq_fd, type_string, +- sizeof (type_string)) > 0) +- result = (hp_timing_t) +- strtoumax (type_string, NULL, 16); +- __close (clkfreq_fd); +- } +- } +- __close (fd); +- } +- +- if (result != 0) +- break; +- +- len -= this_dirp->d_reclen; +- this_dirp = (struct dirent64 *) +- ((char *) this_dirp + this_dirp->d_reclen); +- } +- if (result != 0) +- break; +- } +- __close (obp_fd); +- } +- +- return result; +-} +- +-static void set_obp_int (struct openpromio *op, int val) +-{ +- char *cp = op->oprom_array; +- int *ip = (int *) cp; +- +- *ip = val; +-} +- +-static int get_obp_int (struct openpromio *op) +-{ +- char *cp = op->oprom_array; +- int *ip = (int *) cp; +- +- return *ip; +-} +- +-static hp_timing_t +-__get_clockfreq_via_dev_openprom (void) +-{ +- hp_timing_t result; +- int obp_dev_fd; +- +- result = 0; +- +- obp_dev_fd = __open ("/dev/openprom", O_RDONLY); +- if (obp_dev_fd != -1) +- { +- char obp_buf[8192]; +- struct openpromio *obp_cmd = (struct openpromio *)obp_buf; +- int ret; +- +- obp_cmd->oprom_size = +- sizeof (obp_buf) - sizeof (unsigned int); +- set_obp_int (obp_cmd, 0); +- ret = __ioctl (obp_dev_fd, OPROMCHILD, (char *) obp_cmd); +- if (ret == 0) +- { +- int cur_node = get_obp_int (obp_cmd); +- +- while (cur_node != 0 && cur_node != -1) +- { +- obp_cmd->oprom_size = sizeof (obp_buf) - sizeof (unsigned int); +- strcpy (obp_cmd->oprom_array, "device_type"); +- ret = __ioctl (obp_dev_fd, OPROMGETPROP, (char *) obp_cmd); +- if (ret == 0 +- && strncmp (obp_cmd->oprom_array, "cpu", 3) == 0) +- { +- obp_cmd->oprom_size = (sizeof (obp_buf) +- - sizeof (unsigned int)); +- strcpy (obp_cmd->oprom_array, "clock-frequency"); +- ret = __ioctl (obp_dev_fd, OPROMGETPROP, (char *) obp_cmd); +- if (ret == 0) +- result = (hp_timing_t) get_obp_int (obp_cmd); +- } +- obp_cmd->oprom_size = sizeof (obp_buf) - sizeof (unsigned int); +- set_obp_int (obp_cmd, cur_node); +- ret = __ioctl (obp_dev_fd, OPROMNEXT, (char *) obp_cmd); +- if (ret < 0) +- break; +- cur_node = get_obp_int (obp_cmd); +- } +- } +- } +- +- return result; +-} +- +-hp_timing_t +-__get_clockfreq (void) +-{ +- static hp_timing_t result; +- +- /* If this function was called before, we know the result. */ +- if (result != 0) +- return result; +- +- /* We first read the information from the /proc/cpuinfo file. +- It contains at least one line like +- Cpu0ClkTick : 000000002cb41780 +- We search for this line and convert the number in an integer. */ +- result = __get_clockfreq_via_cpuinfo (); +- if (result != 0) +- return result; +- +- /* If that did not work, try to find an OpenPROM node +- with device_type equal to 'cpu' using /dev/openprom +- and fetch the clock-frequency property from there. */ +- result = __get_clockfreq_via_dev_openprom (); +- if (result != 0) +- return result; +- +- /* Finally, try the same lookup as above but using /proc/openprom. */ +- result = __get_clockfreq_via_proc_openprom (); +- +- return result; +-} diff --git a/SOURCES/glibc-rh1748197-7.patch b/SOURCES/glibc-rh1748197-7.patch new file mode 100644 index 0000000..805da52 --- /dev/null +++ b/SOURCES/glibc-rh1748197-7.patch @@ -0,0 +1,1335 @@ +commit 7b5af2d8f2a2b858319a792678b15a0db08764c7 +Author: Zack Weinberg +Date: Wed Sep 4 08:18:57 2019 +0200 + + Finish move of clock_* functions to libc. [BZ #24959] + + In glibc 2.17, the functions clock_getcpuclockid, clock_getres, + clock_gettime, clock_nanosleep, and clock_settime were moved from + librt.so to libc.so, leaving compatibility stubs behind. Now that the + dynamic linker no longer insists on finding versioned symbols in the + same library that originally defined them, we do not need the stubs + anymore, and this means we don't need GLIBC_PRIVATE __-prefix aliases + for most of the functions anymore either. (clock_gettime still needs + one.) For ports added before 2.17, libc.so needs to provide two + symbol versions for each, the default at GLIBC_2.17 plus a compat + version matching what librt had. + + While I'm at it, move the clock_*.c files and their tests from rt/ to + time/. + + Conflicts: + rt/clock-compat.c + (Removal after copyright year update upstream.) + sysdeps/unix/sysv/linux/arm/be/libc.abilist + sysdeps/unix/sysv/linux/arm/le/librt.abilist + sysdeps/unix/sysv/linux/microblaze/le/librt.abilist + sysdeps/unix/sysv/linux/sh/be/libc.abilist + sysdeps/unix/sysv/linux/sh/le/librt.abilist + (These ABI lists were split into be/le variants upstream. + The choice of files here reflects the decision of the Git + rename detection for the source of the unsplit ABI list + update.) + time/Makefile + (Missing tests downstream.) + +diff --git a/include/time.h b/include/time.h +index 23d2580528b02490..832ee6896e1ca537 100644 +--- a/include/time.h ++++ b/include/time.h +@@ -16,12 +16,10 @@ libc_hidden_proto (localtime) + libc_hidden_proto (strftime) + libc_hidden_proto (strptime) + +-extern __typeof (clock_getres) __clock_getres; + extern __typeof (clock_gettime) __clock_gettime; + libc_hidden_proto (__clock_gettime) + extern __typeof (clock_settime) __clock_settime; +-extern __typeof (clock_nanosleep) __clock_nanosleep; +-extern __typeof (clock_getcpuclockid) __clock_getcpuclockid; ++libc_hidden_proto (__clock_settime) + + /* Now define the internal interfaces. */ + struct tm; +diff --git a/rt/Makefile b/rt/Makefile +index 14f38ef74d262188..de53133cedc778f6 100644 +--- a/rt/Makefile ++++ b/rt/Makefile +@@ -28,9 +28,6 @@ aio-routines := aio_cancel aio_error aio_fsync aio_misc aio_read \ + aio_read64 aio_return aio_suspend aio_write \ + aio_write64 lio_listio lio_listio64 aio_sigqueue \ + aio_notify +-clock-routines := clock_getcpuclockid \ +- clock_getres clock_gettime clock_settime \ +- clock_nanosleep + timer-routines := timer_create timer_delete timer_getoverr \ + timer_gettime timer_settime + shm-routines := shm_open shm_unlink +@@ -38,22 +35,18 @@ mq-routines := mq_open mq_close mq_unlink mq_getattr mq_setattr \ + mq_notify mq_send mq_receive mq_timedsend \ + mq_timedreceive + +-routines = $(clock-routines) +- + librt-routines = $(aio-routines) \ + $(timer-routines) \ +- $(shm-routines) $(mq-routines) \ +- clock-compat ++ $(shm-routines) $(mq-routines) + +-tests := tst-shm tst-clock tst-clock_nanosleep tst-timer tst-timer2 \ ++tests := tst-shm tst-timer tst-timer2 \ + tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \ + tst-aio7 tst-aio8 tst-aio9 tst-aio10 \ + tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \ + tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \ + tst-timer3 tst-timer4 tst-timer5 \ +- tst-cpuclock1 tst-cpuclock2 \ +- tst-cputimer1 tst-cputimer2 tst-cputimer3 \ +- tst-clock2 tst-shm-cancel ++ tst-cpuclock2 tst-cputimer1 tst-cputimer2 tst-cputimer3 \ ++ tst-shm-cancel + + extra-libs := librt + extra-libs-others := $(extra-libs) +diff --git a/rt/Versions b/rt/Versions +index 91e3fd2a204ded9c..84d1345420dc4dc4 100644 +--- a/rt/Versions ++++ b/rt/Versions +@@ -1,15 +1,3 @@ +-libc { +- GLIBC_2.17 { +- # c* +- clock_getres; clock_gettime; clock_settime; clock_getcpuclockid; +- clock_nanosleep; +- } +- GLIBC_PRIVATE { +- __clock_getres; __clock_gettime; __clock_settime; __clock_getcpuclockid; +- __clock_nanosleep; +- } +-} +- + librt { + GLIBC_2.1 { + # AIO functions. +@@ -18,10 +6,6 @@ librt { + aio_suspend64; aio_write; aio_write64; lio_listio; lio_listio64; + } + GLIBC_2.2 { +- # These have moved to libc and are still here only for compatibility. +- clock_getres; clock_gettime; clock_settime; clock_getcpuclockid; +- clock_nanosleep; +- + # s* + shm_open; shm_unlink; + +diff --git a/rt/clock-compat.c b/rt/clock-compat.c +deleted file mode 100644 +index 11e71aa89019b173..0000000000000000 +--- a/rt/clock-compat.c ++++ /dev/null +@@ -1,63 +0,0 @@ +-/* ABI compatibility redirects for clock_* symbols in librt. +- Copyright (C) 2012-2018 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- . */ +- +-#include +- +-/* The clock_* symbols were originally defined in librt and so +- are part of its ABI. As of 2.17, they have moved to libc. +- So we supply definitions for librt that just redirect to +- their libc counterparts. */ +- +-#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17) +- +-#include +- +-#if HAVE_IFUNC +-# undef INIT_ARCH +-# define INIT_ARCH() +-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \ +- compat_symbol (librt, name, name, GLIBC_2_2); +-#else +-# define COMPAT_REDIRECT(name, proto, arglist) \ +- int \ +- name proto \ +- { \ +- return __##name arglist; \ +- } \ +- compat_symbol (librt, name, name, GLIBC_2_2); +-#endif +- +-COMPAT_REDIRECT (clock_getres, +- (clockid_t clock_id, struct timespec *res), +- (clock_id, res)) +-COMPAT_REDIRECT (clock_gettime, +- (clockid_t clock_id, struct timespec *tp), +- (clock_id, tp)) +-COMPAT_REDIRECT (clock_settime, +- (clockid_t clock_id, const struct timespec *tp), +- (clock_id, tp)) +-COMPAT_REDIRECT (clock_getcpuclockid, +- (pid_t pid, clockid_t *clock_id), +- (pid, clock_id)) +-COMPAT_REDIRECT (clock_nanosleep, +- (clockid_t clock_id, int flags, +- const struct timespec *req, +- struct timespec *rem), +- (clock_id, flags, req, rem)) +- +-#endif +diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist +index e3fc05137b18194b..f89ef9a43251c164 100644 +--- a/sysdeps/mach/hurd/i386/libc.abilist ++++ b/sysdeps/mach/hurd/i386/libc.abilist +@@ -711,6 +711,11 @@ GLIBC_2.2.6 clntudp_bufcreate F + GLIBC_2.2.6 clntudp_create F + GLIBC_2.2.6 clntunix_create F + GLIBC_2.2.6 clock F ++GLIBC_2.2.6 clock_getcpuclockid F ++GLIBC_2.2.6 clock_getres F ++GLIBC_2.2.6 clock_gettime F ++GLIBC_2.2.6 clock_nanosleep F ++GLIBC_2.2.6 clock_settime F + GLIBC_2.2.6 close F + GLIBC_2.2.6 closedir F + GLIBC_2.2.6 closelog F +diff --git a/sysdeps/mach/hurd/i386/librt.abilist b/sysdeps/mach/hurd/i386/librt.abilist +index d5fe32b3a9917254..3726e41f06cc500c 100644 +--- a/sysdeps/mach/hurd/i386/librt.abilist ++++ b/sysdeps/mach/hurd/i386/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.2.6 aio_suspend F + GLIBC_2.2.6 aio_suspend64 F + GLIBC_2.2.6 aio_write F + GLIBC_2.2.6 aio_write64 F +-GLIBC_2.2.6 clock_getcpuclockid F +-GLIBC_2.2.6 clock_getres F +-GLIBC_2.2.6 clock_gettime F +-GLIBC_2.2.6 clock_nanosleep F +-GLIBC_2.2.6 clock_settime F + GLIBC_2.2.6 lio_listio F + GLIBC_2.2.6 lio_listio64 F + GLIBC_2.2.6 shm_open F +diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c +index 5b0d8eb8a1a0593e..7408197420b14aad 100644 +--- a/sysdeps/posix/clock_getres.c ++++ b/sysdeps/posix/clock_getres.c +@@ -22,7 +22,7 @@ + #include + #include + #include +- ++#include + + static inline int + realtime_getres (struct timespec *res) +@@ -62,4 +62,11 @@ __clock_getres (clockid_t clock_id, struct timespec *res) + + return retval; + } +-weak_alias (__clock_getres, clock_getres) ++ ++versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17); ++/* clock_getres moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_getres, __clock_getres_2); ++compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c +index f3ebbe15ccc2e95e..3ad8ea87bb7d379b 100644 +--- a/sysdeps/unix/clock_gettime.c ++++ b/sysdeps/unix/clock_gettime.c +@@ -17,24 +17,9 @@ + . */ + + #include +-#include + #include + #include +-#include +-#include +- +- +-static inline int +-realtime_gettime (struct timespec *tp) +-{ +- struct timeval tv; +- int retval = __gettimeofday (&tv, NULL); +- if (retval == 0) +- /* Convert into `timespec'. */ +- TIMEVAL_TO_TIMESPEC (&tv, tp); +- return retval; +-} +- ++#include + + /* Get current value of CLOCK and store it in TP. */ + int +@@ -60,5 +45,12 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp) + + return retval; + } +-weak_alias (__clock_gettime, clock_gettime) + libc_hidden_def (__clock_gettime) ++ ++versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17); ++/* clock_gettime moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_gettime, __clock_gettime_2); ++compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/clock_nanosleep.c b/sysdeps/unix/clock_nanosleep.c +index 13dd0f4b905ec631..6513e2d64614c561 100644 +--- a/sysdeps/unix/clock_nanosleep.c ++++ b/sysdeps/unix/clock_nanosleep.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + /* This implementation assumes that these is only a `nanosleep' system + call. So we have to remap all other activities. */ +@@ -76,4 +77,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, + + return __nanosleep (req, rem), 0 ? errno : 0; + } +-weak_alias (__clock_nanosleep, clock_nanosleep) ++ ++versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17); ++/* clock_nanosleep moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_nanosleep, __clock_nanosleep_2); ++compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c +index 4f5640f67047cef6..123b6f44ee3831d9 100644 +--- a/sysdeps/unix/clock_settime.c ++++ b/sysdeps/unix/clock_settime.c +@@ -18,8 +18,7 @@ + #include + #include + #include +-#include +- ++#include + + /* Set CLOCK to value TP. */ + int +@@ -51,4 +50,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp) + + return retval; + } +-weak_alias (__clock_settime, clock_settime) ++libc_hidden_def (__clock_settime) ++ ++versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17); ++/* clock_settime moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_settime, __clock_settime_2); ++compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist +index e22b91655dd5f7e0..77f0432d0f1f5aab 100644 +--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist ++++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist +@@ -1863,6 +1863,11 @@ GLIBC_2.2 __xpg_sigpause F + GLIBC_2.2 _flushlbf F + GLIBC_2.2 _res_hconf D 0x48 + GLIBC_2.2 bind_textdomain_codeset F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 dcngettext F + GLIBC_2.2 dngettext F + GLIBC_2.2 fgetpos F +diff --git a/sysdeps/unix/sysv/linux/alpha/librt.abilist b/sysdeps/unix/sysv/linux/alpha/librt.abilist +index d7a049cf600e2966..71f86e03ce67fd19 100644 +--- a/sysdeps/unix/sysv/linux/alpha/librt.abilist ++++ b/sysdeps/unix/sysv/linux/alpha/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist +index a231812eea6dc556..e748ec28912ce773 100644 +--- a/sysdeps/unix/sysv/linux/arm/libc.abilist ++++ b/sysdeps/unix/sysv/linux/arm/libc.abilist +@@ -759,6 +759,11 @@ GLIBC_2.4 clntudp_bufcreate F + GLIBC_2.4 clntudp_create F + GLIBC_2.4 clntunix_create F + GLIBC_2.4 clock F ++GLIBC_2.4 clock_getcpuclockid F ++GLIBC_2.4 clock_getres F ++GLIBC_2.4 clock_gettime F ++GLIBC_2.4 clock_nanosleep F ++GLIBC_2.4 clock_settime F + GLIBC_2.4 clone F + GLIBC_2.4 close F + GLIBC_2.4 closedir F +diff --git a/sysdeps/unix/sysv/linux/arm/librt.abilist b/sysdeps/unix/sysv/linux/arm/librt.abilist +index cfbbd2755765e720..3c0647b2516bb51d 100644 +--- a/sysdeps/unix/sysv/linux/arm/librt.abilist ++++ b/sysdeps/unix/sysv/linux/arm/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F + GLIBC_2.4 aio_suspend64 F + GLIBC_2.4 aio_write F + GLIBC_2.4 aio_write64 F +-GLIBC_2.4 clock_getcpuclockid F +-GLIBC_2.4 clock_getres F +-GLIBC_2.4 clock_gettime F +-GLIBC_2.4 clock_nanosleep F +-GLIBC_2.4 clock_settime F + GLIBC_2.4 lio_listio F + GLIBC_2.4 lio_listio64 F + GLIBC_2.4 mq_close F +diff --git a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c +index 190a47950eb1d177..877f4f3c7916a534 100644 +--- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c ++++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c +@@ -20,6 +20,7 @@ + #include + #include + #include "kernel-posix-cpu-timers.h" ++#include + + int + __clock_getcpuclockid (pid_t pid, clockid_t *clock_id) +@@ -45,4 +46,11 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id) + else + return INTERNAL_SYSCALL_ERRNO (r, err); + } +-weak_alias (__clock_getcpuclockid, clock_getcpuclockid) ++ ++versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17); ++/* clock_getcpuclockid moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_getcpuclockid, __clock_getcpuclockid_2); ++compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c +index 2517e66910a79d93..1fbb638097ba4a80 100644 +--- a/sysdeps/unix/sysv/linux/clock_getres.c ++++ b/sysdeps/unix/sysv/linux/clock_getres.c +@@ -26,10 +26,19 @@ + #endif + #include + ++#include ++ + /* Get resolution of clock. */ + int + __clock_getres (clockid_t clock_id, struct timespec *res) + { + return INLINE_VSYSCALL (clock_getres, 2, clock_id, res); + } +-weak_alias (__clock_getres, clock_getres) ++ ++versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17); ++/* clock_getres moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_getres, __clock_getres_2); ++compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c +index dadfc518b74baea0..3f8feb37a1795306 100644 +--- a/sysdeps/unix/sysv/linux/clock_gettime.c ++++ b/sysdeps/unix/sysv/linux/clock_gettime.c +@@ -26,11 +26,20 @@ + #endif + #include + ++#include ++ + /* Get current value of CLOCK and store it in TP. */ + int + __clock_gettime (clockid_t clock_id, struct timespec *tp) + { + return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); + } +-weak_alias (__clock_gettime, clock_gettime) + libc_hidden_def (__clock_gettime) ++ ++versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17); ++/* clock_gettime moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_gettime, __clock_gettime_2); ++compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c +index 93d5d6ef120ca9ef..a90da63069b7f0f8 100644 +--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c ++++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c +@@ -21,6 +21,7 @@ + #include + #include "kernel-posix-cpu-timers.h" + ++#include + + /* We can simply use the syscall. The CPU clocks are not supported + with this function. */ +@@ -51,4 +52,11 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, + return (INTERNAL_SYSCALL_ERROR_P (r, err) + ? INTERNAL_SYSCALL_ERRNO (r, err) : 0); + } +-weak_alias (__clock_nanosleep, clock_nanosleep) ++ ++versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17); ++/* clock_nanosleep moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_nanosleep, __clock_nanosleep_2); ++compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c +index c71461a4f6deac5a..21efc6c982c084b4 100644 +--- a/sysdeps/unix/sysv/linux/clock_settime.c ++++ b/sysdeps/unix/sysv/linux/clock_settime.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "kernel-posix-cpu-timers.h" + +@@ -34,4 +35,12 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp) + + return INLINE_SYSCALL_CALL (clock_settime, clock_id, tp); + } +-weak_alias (__clock_settime, clock_settime) ++libc_hidden_def (__clock_settime) ++ ++versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17); ++/* clock_settime moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_settime, __clock_settime_2); ++compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2); ++#endif +diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist +index 24b11b15c0e71140..d34f040d85cc5bb2 100644 +--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist ++++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist +@@ -615,6 +615,11 @@ GLIBC_2.2 clntudp_bufcreate F + GLIBC_2.2 clntudp_create F + GLIBC_2.2 clntunix_create F + GLIBC_2.2 clock F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 clone F + GLIBC_2.2 close F + GLIBC_2.2 closedir F +diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist +index 595f1b712a4e8d70..bb03781dcc04d219 100644 +--- a/sysdeps/unix/sysv/linux/hppa/librt.abilist ++++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist +index 9762c81365b0abcd..48e838fc2813df0d 100644 +--- a/sysdeps/unix/sysv/linux/i386/libc.abilist ++++ b/sysdeps/unix/sysv/linux/i386/libc.abilist +@@ -1869,6 +1869,11 @@ GLIBC_2.2 _flushlbf F + GLIBC_2.2 _res_hconf D 0x30 + GLIBC_2.2 alphasort64 F + GLIBC_2.2 bind_textdomain_codeset F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 dcngettext F + GLIBC_2.2 dngettext F + GLIBC_2.2 fgetpos F +diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist +index 595f1b712a4e8d70..bb03781dcc04d219 100644 +--- a/sysdeps/unix/sysv/linux/i386/librt.abilist ++++ b/sysdeps/unix/sysv/linux/i386/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist +index 50c94adff93b5bb4..e9fe0697b784be64 100644 +--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist +@@ -627,6 +627,11 @@ GLIBC_2.2 clntudp_bufcreate F + GLIBC_2.2 clntudp_create F + GLIBC_2.2 clntunix_create F + GLIBC_2.2 clock F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 close F + GLIBC_2.2 closedir F + GLIBC_2.2 closelog F +diff --git a/sysdeps/unix/sysv/linux/ia64/librt.abilist b/sysdeps/unix/sysv/linux/ia64/librt.abilist +index 804622a14abd8ea9..08384c906518837d 100644 +--- a/sysdeps/unix/sysv/linux/ia64/librt.abilist ++++ b/sysdeps/unix/sysv/linux/ia64/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +index f57be98e494d0701..98f07b79918d1c17 100644 +--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist ++++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +@@ -748,6 +748,11 @@ GLIBC_2.4 clntudp_bufcreate F + GLIBC_2.4 clntudp_create F + GLIBC_2.4 clntunix_create F + GLIBC_2.4 clock F ++GLIBC_2.4 clock_getcpuclockid F ++GLIBC_2.4 clock_getres F ++GLIBC_2.4 clock_gettime F ++GLIBC_2.4 clock_nanosleep F ++GLIBC_2.4 clock_settime F + GLIBC_2.4 clone F + GLIBC_2.4 close F + GLIBC_2.4 closedir F +diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist +index cfbbd2755765e720..3c0647b2516bb51d 100644 +--- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist ++++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.4 aio_suspend F + GLIBC_2.4 aio_suspend64 F + GLIBC_2.4 aio_write F + GLIBC_2.4 aio_write64 F +-GLIBC_2.4 clock_getcpuclockid F +-GLIBC_2.4 clock_getres F +-GLIBC_2.4 clock_gettime F +-GLIBC_2.4 clock_nanosleep F +-GLIBC_2.4 clock_settime F + GLIBC_2.4 lio_listio F + GLIBC_2.4 lio_listio64 F + GLIBC_2.4 mq_close F +diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +index ddc7ebca673a466c..6a60d7876120f2f2 100644 +--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist ++++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +@@ -1825,6 +1825,11 @@ GLIBC_2.2 _flushlbf F + GLIBC_2.2 _res_hconf D 0x30 + GLIBC_2.2 alphasort64 F + GLIBC_2.2 bind_textdomain_codeset F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 dcngettext F + GLIBC_2.2 dngettext F + GLIBC_2.2 fgetpos F +diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist +index 595f1b712a4e8d70..bb03781dcc04d219 100644 +--- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist ++++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/microblaze/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/librt.abilist +index fb85d8729e1bc69d..889dfbc0eef5e75a 100644 +--- a/sysdeps/unix/sysv/linux/microblaze/librt.abilist ++++ b/sysdeps/unix/sysv/linux/microblaze/librt.abilist +@@ -14,11 +14,6 @@ GLIBC_2.18 aio_suspend F + GLIBC_2.18 aio_suspend64 F + GLIBC_2.18 aio_write F + GLIBC_2.18 aio_write64 F +-GLIBC_2.18 clock_getcpuclockid F +-GLIBC_2.18 clock_getres F +-GLIBC_2.18 clock_gettime F +-GLIBC_2.18 clock_nanosleep F +-GLIBC_2.18 clock_settime F + GLIBC_2.18 lio_listio F + GLIBC_2.18 lio_listio64 F + GLIBC_2.18 mq_close F +diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +index dda9797e0ea736f6..34a24582ca7a4a08 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +@@ -1612,6 +1612,11 @@ GLIBC_2.2 capget F + GLIBC_2.2 capset F + GLIBC_2.2 cbc_crypt F + GLIBC_2.2 clntunix_create F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 creat64 F + GLIBC_2.2 dcngettext F + GLIBC_2.2 des_setparity F +diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist +index 84837c8a2ef02e1b..1539c1cef92bccfd 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F + GLIBC_2.2 aio_suspend64 F + GLIBC_2.2 aio_write F + GLIBC_2.2 aio_write64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 lio_listio F + GLIBC_2.2 lio_listio64 F + GLIBC_2.2 shm_open F +diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +index 42e930d56595083e..176a57298a45d492 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +@@ -1610,6 +1610,11 @@ GLIBC_2.2 capget F + GLIBC_2.2 capset F + GLIBC_2.2 cbc_crypt F + GLIBC_2.2 clntunix_create F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 creat64 F + GLIBC_2.2 dcngettext F + GLIBC_2.2 des_setparity F +diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist +index 84837c8a2ef02e1b..1539c1cef92bccfd 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F + GLIBC_2.2 aio_suspend64 F + GLIBC_2.2 aio_write F + GLIBC_2.2 aio_write64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 lio_listio F + GLIBC_2.2 lio_listio64 F + GLIBC_2.2 shm_open F +diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +index f89b44f3a14d0f85..5a66ffd67e5cf364 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +@@ -1611,6 +1611,11 @@ GLIBC_2.2 capget F + GLIBC_2.2 capset F + GLIBC_2.2 cbc_crypt F + GLIBC_2.2 clntunix_create F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 creat64 F + GLIBC_2.2 dcngettext F + GLIBC_2.2 des_setparity F +diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +index 1486af11d755d37e..a817f33695a5230f 100644 +--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +@@ -1607,6 +1607,11 @@ GLIBC_2.2 capget F + GLIBC_2.2 capset F + GLIBC_2.2 cbc_crypt F + GLIBC_2.2 clntunix_create F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 creat64 F + GLIBC_2.2 dcngettext F + GLIBC_2.2 des_setparity F +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +index 45839ed25b0fde5f..d5e121b76e583f4c 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +@@ -1830,6 +1830,11 @@ GLIBC_2.2 __xstat64 F + GLIBC_2.2 _flushlbf F + GLIBC_2.2 _res_hconf D 0x30 + GLIBC_2.2 bind_textdomain_codeset F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 dcngettext F + GLIBC_2.2 dngettext F + GLIBC_2.2 fgetpos F +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist +index 595f1b712a4e8d70..bb03781dcc04d219 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +index 344e5ae87c5d76b2..3dfddbddb3a11180 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +@@ -1834,6 +1834,11 @@ GLIBC_2.2 __xstat64 F + GLIBC_2.2 _flushlbf F + GLIBC_2.2 _res_hconf D 0x30 + GLIBC_2.2 bind_textdomain_codeset F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 dcngettext F + GLIBC_2.2 dngettext F + GLIBC_2.2 fgetpos F +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist +index 8c1781adf49a7432..06ce341194a37dd4 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist +@@ -670,6 +670,11 @@ GLIBC_2.3 clntudp_bufcreate F + GLIBC_2.3 clntudp_create F + GLIBC_2.3 clntunix_create F + GLIBC_2.3 clock F ++GLIBC_2.3 clock_getcpuclockid F ++GLIBC_2.3 clock_getres F ++GLIBC_2.3 clock_gettime F ++GLIBC_2.3 clock_nanosleep F ++GLIBC_2.3 clock_settime F + GLIBC_2.3 clone F + GLIBC_2.3 close F + GLIBC_2.3 closedir F +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist +index e76b7eb49566718b..6a5bd96963e67109 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.3 aio_suspend F + GLIBC_2.3 aio_suspend64 F + GLIBC_2.3 aio_write F + GLIBC_2.3 aio_write64 F +-GLIBC_2.3 clock_getcpuclockid F +-GLIBC_2.3 clock_getres F +-GLIBC_2.3 clock_gettime F +-GLIBC_2.3 clock_nanosleep F +-GLIBC_2.3 clock_settime F + GLIBC_2.3 lio_listio F + GLIBC_2.3 lio_listio64 F + GLIBC_2.3 shm_open F +diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +index 3a5ec2a1e47b5da5..02ff949c33197774 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist ++++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +@@ -1829,6 +1829,11 @@ GLIBC_2.2 _flushlbf F + GLIBC_2.2 _res_hconf D 0x30 + GLIBC_2.2 alphasort64 F + GLIBC_2.2 bind_textdomain_codeset F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 dcngettext F + GLIBC_2.2 dngettext F + GLIBC_2.2 fgetpos F +diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist +index 595f1b712a4e8d70..bb03781dcc04d219 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist ++++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +index 3b5465558b72f166..96693d41df267e1b 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +@@ -632,6 +632,11 @@ GLIBC_2.2 clntudp_bufcreate F + GLIBC_2.2 clntudp_create F + GLIBC_2.2 clntunix_create F + GLIBC_2.2 clock F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 clone F + GLIBC_2.2 close F + GLIBC_2.2 closedir F +diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist +index 41be3bb84b6e4df0..5905498a488359d7 100644 +--- a/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist ++++ b/sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.2 aio_suspend F + GLIBC_2.2 aio_suspend64 F + GLIBC_2.2 aio_write F + GLIBC_2.2 aio_write64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 lio_listio F + GLIBC_2.2 lio_listio64 F + GLIBC_2.2 shm_open F +diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist +index 1f4e648baade9c47..b126bda07a9cc58c 100644 +--- a/sysdeps/unix/sysv/linux/sh/libc.abilist ++++ b/sysdeps/unix/sysv/linux/sh/libc.abilist +@@ -618,6 +618,11 @@ GLIBC_2.2 clntudp_bufcreate F + GLIBC_2.2 clntudp_create F + GLIBC_2.2 clntunix_create F + GLIBC_2.2 clock F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 clone F + GLIBC_2.2 close F + GLIBC_2.2 closedir F +diff --git a/sysdeps/unix/sysv/linux/sh/librt.abilist b/sysdeps/unix/sysv/linux/sh/librt.abilist +index 595f1b712a4e8d70..bb03781dcc04d219 100644 +--- a/sysdeps/unix/sysv/linux/sh/librt.abilist ++++ b/sysdeps/unix/sysv/linux/sh/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +index d308ac8b0527cb3f..63b78d80b333d4b4 100644 +--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist ++++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +@@ -1826,6 +1826,11 @@ GLIBC_2.2 __xstat64 F + GLIBC_2.2 _flushlbf F + GLIBC_2.2 _res_hconf D 0x30 + GLIBC_2.2 bind_textdomain_codeset F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 dcngettext F + GLIBC_2.2 dngettext F + GLIBC_2.2 fgetpos F +diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist +index cb874f41477109c3..38f0aad791793010 100644 +--- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist ++++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +index 6731ebfc2877c5c6..a899eb6a92215b47 100644 +--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +@@ -660,6 +660,11 @@ GLIBC_2.2 clntudp_bufcreate F + GLIBC_2.2 clntudp_create F + GLIBC_2.2 clntunix_create F + GLIBC_2.2 clock F ++GLIBC_2.2 clock_getcpuclockid F ++GLIBC_2.2 clock_getres F ++GLIBC_2.2 clock_gettime F ++GLIBC_2.2 clock_nanosleep F ++GLIBC_2.2 clock_settime F + GLIBC_2.2 clone F + GLIBC_2.2 close F + GLIBC_2.2 closedir F +diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist +index d7a049cf600e2966..71f86e03ce67fd19 100644 +--- a/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist ++++ b/sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist +@@ -15,11 +15,6 @@ GLIBC_2.1 aio_write F + GLIBC_2.1 aio_write64 F + GLIBC_2.1 lio_listio F + GLIBC_2.1 lio_listio64 F +-GLIBC_2.2 clock_getcpuclockid F +-GLIBC_2.2 clock_getres F +-GLIBC_2.2 clock_gettime F +-GLIBC_2.2 clock_nanosleep F +-GLIBC_2.2 clock_settime F + GLIBC_2.2 shm_open F + GLIBC_2.2 shm_unlink F + GLIBC_2.2 timer_create F +diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +index 816e4a742632ad44..0ebb018e2089c70a 100644 +--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +@@ -621,6 +621,11 @@ GLIBC_2.2.5 clntudp_bufcreate F + GLIBC_2.2.5 clntudp_create F + GLIBC_2.2.5 clntunix_create F + GLIBC_2.2.5 clock F ++GLIBC_2.2.5 clock_getcpuclockid F ++GLIBC_2.2.5 clock_getres F ++GLIBC_2.2.5 clock_gettime F ++GLIBC_2.2.5 clock_nanosleep F ++GLIBC_2.2.5 clock_settime F + GLIBC_2.2.5 clone F + GLIBC_2.2.5 close F + GLIBC_2.2.5 closedir F +diff --git a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist +index e2e8b60bf8e29f55..95e3f22daa06b237 100644 +--- a/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist ++++ b/sysdeps/unix/sysv/linux/x86_64/64/librt.abilist +@@ -13,11 +13,6 @@ GLIBC_2.2.5 aio_suspend F + GLIBC_2.2.5 aio_suspend64 F + GLIBC_2.2.5 aio_write F + GLIBC_2.2.5 aio_write64 F +-GLIBC_2.2.5 clock_getcpuclockid F +-GLIBC_2.2.5 clock_getres F +-GLIBC_2.2.5 clock_gettime F +-GLIBC_2.2.5 clock_nanosleep F +-GLIBC_2.2.5 clock_settime F + GLIBC_2.2.5 lio_listio F + GLIBC_2.2.5 lio_listio64 F + GLIBC_2.2.5 shm_open F +diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +index 6fee16a850adc7b8..0b6b3fa98183e5af 100644 +--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist ++++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +@@ -660,6 +660,11 @@ GLIBC_2.16 clntudp_create F + GLIBC_2.16 clntunix_create F + GLIBC_2.16 clock F + GLIBC_2.16 clock_adjtime F ++GLIBC_2.16 clock_getcpuclockid F ++GLIBC_2.16 clock_getres F ++GLIBC_2.16 clock_gettime F ++GLIBC_2.16 clock_nanosleep F ++GLIBC_2.16 clock_settime F + GLIBC_2.16 clone F + GLIBC_2.16 close F + GLIBC_2.16 closedir F +diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist +index 94e84e4dcfaa85dc..66969fb9ab887756 100644 +--- a/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist ++++ b/sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist +@@ -14,11 +14,6 @@ GLIBC_2.16 aio_suspend F + GLIBC_2.16 aio_suspend64 F + GLIBC_2.16 aio_write F + GLIBC_2.16 aio_write64 F +-GLIBC_2.16 clock_getcpuclockid F +-GLIBC_2.16 clock_getres F +-GLIBC_2.16 clock_gettime F +-GLIBC_2.16 clock_nanosleep F +-GLIBC_2.16 clock_settime F + GLIBC_2.16 lio_listio F + GLIBC_2.16 lio_listio64 F + GLIBC_2.16 mq_close F +diff --git a/time/Makefile b/time/Makefile +index ec3e39dcea75ee51..6a68481a5de1b148 100644 +--- a/time/Makefile ++++ b/time/Makefile +@@ -36,14 +36,18 @@ routines := offtime asctime clock ctime ctime_r difftime \ + stime dysize timegm ftime \ + getdate strptime strptime_l \ + strftime wcsftime strftime_l wcsftime_l \ +- timespec_get ++ timespec_get \ ++ clock_getcpuclockid clock_getres \ ++ clock_gettime clock_settime clock_nanosleep ++ + aux := era alt_digit lc-time-cleanup + + tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ + tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \ + tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \ + tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \ +- tst-tzname tst-y2039 ++ tst-tzname tst-y2039 \ ++ tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 + + include ../Rules + +diff --git a/time/Versions b/time/Versions +index fd838181e4f0969d..8788e192ce358d77 100644 +--- a/time/Versions ++++ b/time/Versions +@@ -49,6 +49,10 @@ libc { + GLIBC_2.2 { + # w* + wcsftime; ++ ++ # c*; actually in librt in version 2.2, moved to libc in 2.17 ++ clock_getres; clock_gettime; clock_settime; clock_getcpuclockid; ++ clock_nanosleep; + } + GLIBC_2.3 { + # these internal names are used by libstdc++ +@@ -65,4 +69,13 @@ libc { + GLIBC_2.16 { + timespec_get; + } ++ GLIBC_2.17 { ++ # c* ++ clock_getres; clock_gettime; clock_settime; clock_getcpuclockid; ++ clock_nanosleep; ++ } ++ GLIBC_PRIVATE { ++ # same as clock_gettime; used in other libraries ++ __clock_gettime; ++ } + } +diff --git a/rt/clock_getcpuclockid.c b/time/clock_getcpuclockid.c +similarity index 75% +rename from rt/clock_getcpuclockid.c +rename to time/clock_getcpuclockid.c +index 6bc42a0863d92d5a..81b86241f7adc6c9 100644 +--- a/rt/clock_getcpuclockid.c ++++ b/time/clock_getcpuclockid.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + int + __clock_getcpuclockid (pid_t pid, clockid_t *clock_id) +@@ -37,4 +38,10 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id) + return ENOENT; + #endif + } +-weak_alias (__clock_getcpuclockid, clock_getcpuclockid) ++versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17); ++/* clock_getcpuclockid moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_getcpuclockid, __clock_getcpuclockid_2); ++compat_symbol (libc, __clock_getcpuclockid_2, clock_getcpuclockid, GLIBC_2_2); ++#endif +diff --git a/rt/clock_getres.c b/time/clock_getres.c +similarity index 73% +rename from rt/clock_getres.c +rename to time/clock_getres.c +index 816f7b2a907e27ce..e8315393e560b186 100644 +--- a/rt/clock_getres.c ++++ b/time/clock_getres.c +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + /* Get resolution of clock. */ + int +@@ -26,5 +27,13 @@ __clock_getres (clockid_t clock_id, struct timespec *res) + __set_errno (ENOSYS); + return -1; + } +-weak_alias (__clock_getres, clock_getres) ++ ++versioned_symbol (libc, __clock_getres, clock_getres, GLIBC_2_17); ++/* clock_getres moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_getres, __clock_getres_2); ++compat_symbol (libc, __clock_getres_2, clock_getres, GLIBC_2_2); ++#endif ++ + stub_warning (clock_getres) +diff --git a/rt/clock_gettime.c b/time/clock_gettime.c +similarity index 74% +rename from rt/clock_gettime.c +rename to time/clock_gettime.c +index 30a012473f5bc821..4a5f808845351156 100644 +--- a/rt/clock_gettime.c ++++ b/time/clock_gettime.c +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + /* Get current value of CLOCK and store it in TP. */ + int +@@ -26,6 +27,14 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp) + __set_errno (ENOSYS); + return -1; + } +-weak_alias (__clock_gettime, clock_gettime) + libc_hidden_def (__clock_gettime) ++ ++versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17); ++/* clock_gettime moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_gettime, __clock_gettime_2); ++compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2); ++#endif ++ + stub_warning (clock_gettime) +diff --git a/rt/clock_nanosleep.c b/time/clock_nanosleep.c +similarity index 76% +rename from rt/clock_nanosleep.c +rename to time/clock_nanosleep.c +index 15aa6f7c4f22e197..a314b169a9455e0d 100644 +--- a/rt/clock_nanosleep.c ++++ b/time/clock_nanosleep.c +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + int + __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, +@@ -33,5 +34,13 @@ __clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req, + /* Not implemented. */ + return ENOSYS; + } +-weak_alias (__clock_nanosleep, clock_nanosleep) ++ ++versioned_symbol (libc, __clock_nanosleep, clock_nanosleep, GLIBC_2_17); ++/* clock_nanosleep moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_nanosleep, __clock_nanosleep_2); ++compat_symbol (libc, __clock_nanosleep_2, clock_nanosleep, GLIBC_2_2); ++#endif ++ + stub_warning (clock_nanosleep) +diff --git a/rt/clock_settime.c b/time/clock_settime.c +similarity index 71% +rename from rt/clock_settime.c +rename to time/clock_settime.c +index 0b6d4b2a2a0dc46c..2091239448e307f2 100644 +--- a/rt/clock_settime.c ++++ b/time/clock_settime.c +@@ -18,6 +18,7 @@ + + #include + #include ++#include + + /* Set CLOCK to value TP. */ + int +@@ -26,5 +27,14 @@ __clock_settime (clockid_t clock_id, const struct timespec *tp) + __set_errno (ENOSYS); + return -1; + } +-weak_alias (__clock_settime, clock_settime) ++libc_hidden_def (__clock_settime) ++ ++versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17); ++/* clock_settime moved to libc in version 2.17; ++ old binaries may expect the symbol version it had in librt. */ ++#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17) ++strong_alias (__clock_settime, __clock_settime_2); ++compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2); ++#endif ++ + stub_warning (clock_settime) +diff --git a/rt/tst-clock.c b/time/tst-clock.c +similarity index 100% +rename from rt/tst-clock.c +rename to time/tst-clock.c +diff --git a/rt/tst-clock2.c b/time/tst-clock2.c +similarity index 100% +rename from rt/tst-clock2.c +rename to time/tst-clock2.c +diff --git a/rt/tst-clock_nanosleep.c b/time/tst-clock_nanosleep.c +similarity index 100% +rename from rt/tst-clock_nanosleep.c +rename to time/tst-clock_nanosleep.c +diff --git a/rt/tst-cpuclock1.c b/time/tst-cpuclock1.c +similarity index 100% +rename from rt/tst-cpuclock1.c +rename to time/tst-cpuclock1.c diff --git a/SOURCES/glibc-rh1780204-29.patch b/SOURCES/glibc-rh1780204-29.patch new file mode 100644 index 0000000..cf88bee --- /dev/null +++ b/SOURCES/glibc-rh1780204-29.patch @@ -0,0 +1,160 @@ +From af123aa95091d3d2d1b4ff027cf806ca1721d29d Mon Sep 17 00:00:00 2001 +From: Stefan Liebler +Date: Wed, 11 Dec 2019 15:09:14 +0100 +Subject: [PATCH 01/28] Always use wordsize-64 version of s_nearbyint.c. + +This patch replaces s_nearbyint.c in sysdeps/dbl-64 with the one in +sysdeps/dbl-64/wordsize-64 and removes the latter one. +The code is not changed except changes in code style. + +Also adjusted the include path in x86_64 file. + +Reviewed-by: Adhemerval Zanella +--- + sysdeps/ieee754/dbl-64/s_nearbyint.c | 38 ++++++-------- + sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c | 65 ------------------------ + sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c | 2 +- + 3 files changed, 17 insertions(+), 88 deletions(-) + delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c + +Note: tweaked by DJ for backport; some portions handled by glibc-rh1780204-07.patch + +diff -rupN a/sysdeps/ieee754/dbl-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/s_nearbyint.c +--- a/sysdeps/ieee754/dbl-64/s_nearbyint.c 2020-04-09 21:17:04.281854809 -0400 ++++ b/sysdeps/ieee754/dbl-64/s_nearbyint.c 2020-04-09 21:28:13.380741798 -0400 +@@ -10,10 +10,6 @@ + * ==================================================== + */ + +-#if defined(LIBM_SCCS) && !defined(lint) +-static char rcsid[] = "$NetBSD: s_rint.c,v 1.8 1995/05/10 20:48:04 jtc Exp $"; +-#endif +- + /* + * rint(x) + * Return x rounded to integral value according to the prevailing +@@ -44,35 +40,33 @@ __nearbyint (double x) + -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ + }; + fenv_t env; +- int32_t i0, j0, sx; +- double w, t; +- GET_HIGH_WORD (i0, x); +- sx = (i0 >> 31) & 1; +- j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; +- if (j0 < 52) ++ int64_t i0, sx; ++ int32_t j0; ++ EXTRACT_WORDS64 (i0, x); ++ sx = (i0 >> 63) & 1; ++ j0 = ((i0 >> 52) & 0x7ff) - 0x3ff; ++ if (__glibc_likely (j0 < 52)) + { + if (j0 < 0) + { + libc_feholdexcept (&env); +- w = TWO52[sx] + math_opt_barrier (x); +- t = w - TWO52[sx]; ++ double w = TWO52[sx] + math_opt_barrier (x); ++ double t = w - TWO52[sx]; + math_force_eval (t); + libc_fesetenv (&env); +- GET_HIGH_WORD (i0, t); +- SET_HIGH_WORD (t, (i0 & 0x7fffffff) | (sx << 31)); +- return t; ++ return copysign (t, x); + } + } + else + { + if (j0 == 0x400) +- return x + x; /* inf or NaN */ ++ return x + x; /* inf or NaN */ + else +- return x; /* x is integral */ ++ return x; /* x is integral */ + } + libc_feholdexcept (&env); +- w = TWO52[sx] + math_opt_barrier (x); +- t = w - TWO52[sx]; ++ double w = TWO52[sx] + math_opt_barrier (x); ++ double t = w - TWO52[sx]; + math_force_eval (t); + libc_fesetenv (&env); + return t; +diff -rupN a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c +--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c 2018-08-01 01:10:47.000000000 -0400 ++++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c 1969-12-31 19:00:00.000000000 -0500 +@@ -1,64 +0,0 @@ +-/* Adapted for use as nearbyint by Ulrich Drepper . */ +-/* +- * ==================================================== +- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. +- * +- * Developed at SunPro, a Sun Microsystems, Inc. business. +- * Permission to use, copy, modify, and distribute this +- * software is freely granted, provided that this notice +- * is preserved. +- * ==================================================== +- */ +- +-/* +- * rint(x) +- * Return x rounded to integral value according to the prevailing +- * rounding mode. +- * Method: +- * Using floating addition. +- * Exception: +- * Inexact flag raised if x not equal to rint(x). +- */ +- +-#include +-#include +-#include +-#include +-#include +- +-static const double +-TWO52[2]={ +- 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ +- -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ +-}; +- +-double +-__nearbyint(double x) +-{ +- fenv_t env; +- int64_t i0,sx; +- int32_t j0; +- EXTRACT_WORDS64(i0,x); +- sx = (i0>>63)&1; +- j0 = ((i0>>52)&0x7ff)-0x3ff; +- if(__builtin_expect(j0<52, 1)) { +- if(j0<0) { +- libc_feholdexcept (&env); +- double w = TWO52[sx] + math_opt_barrier (x); +- double t = w-TWO52[sx]; +- math_force_eval (t); +- libc_fesetenv (&env); +- return __copysign (t, x); +- } +- } else { +- if(j0==0x400) return x+x; /* inf or NaN */ +- else return x; /* x is integral */ +- } +- libc_feholdexcept (&env); +- double w = TWO52[sx] + math_opt_barrier (x); +- double t = w-TWO52[sx]; +- math_force_eval (t); +- libc_fesetenv (&env); +- return t; +-} +-libm_alias_double (__nearbyint, nearbyint) +diff -rupN a/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c b/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c +--- a/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c 2018-08-01 01:10:47.000000000 -0400 ++++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c 2020-04-09 21:28:13.205735274 -0400 +@@ -1,3 +1,3 @@ + #undef __nearbyint + #define __nearbyint __nearbyint_c +-#include ++#include diff --git a/SPECS/glibc.spec b/SPECS/glibc.spec index f9149e6..a4791e9 100644 --- a/SPECS/glibc.spec +++ b/SPECS/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.28 %define glibcversion 2.28 -%define glibcrelease 121%{?dist} +%define glibcrelease 123%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -474,6 +474,14 @@ Patch340: glibc-rh1642150-1.patch Patch341: glibc-rh1642150-2.patch Patch342: glibc-rh1642150-3.patch Patch343: glibc-rh1774115.patch +Patch344: glibc-rh1780204-29.patch +Patch345: glibc-rh1748197-1.patch +Patch346: glibc-rh1748197-2.patch +Patch347: glibc-rh1748197-3.patch +Patch348: glibc-rh1748197-4.patch +Patch349: glibc-rh1748197-5.patch +Patch350: glibc-rh1748197-6.patch +Patch351: glibc-rh1748197-7.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2373,6 +2381,13 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog +* Thu Apr 23 2020 Florian Weimer - 2.28-123 +- Reduce IFUNC resolver usage in libpthread and librt (#1748197) + +* Thu Apr 9 2020 DJ Delorie - 2.28-122 +- Math library optimizations for IBM Z (#1780204) +- Additional patch for s_nearbyint.c + * Wed Apr 8 2020 Florian Weimer - 2.28-121 - elf: Assign TLS modid later during dlopen (#1774115)