|
|
981dc9 |
commit f289e656ec8221756519a601042bc9fbe1b310fb
|
|
|
981dc9 |
Author: Florian Weimer <fweimer@redhat.com>
|
|
|
981dc9 |
Date: Fri Feb 8 10:21:56 2019 +0100
|
|
|
981dc9 |
|
|
|
981dc9 |
rt: Turn forwards from librt to libc into compat symbols [BZ #24194]
|
|
|
981dc9 |
|
|
|
981dc9 |
As the result of commit 6e6249d0b461b952d0f544792372663feb6d792a
|
|
|
981dc9 |
("BZ#14743: Move clock_* symbols from librt to libc."), in glibc 2.17,
|
|
|
981dc9 |
clock_gettime, clock_getres, clock_settime, clock_getcpuclockid,
|
|
|
981dc9 |
clock_nanosleep were added to libc, and the file rt/clock-compat.c
|
|
|
981dc9 |
was added with forwarders to the actual implementations in libc.
|
|
|
981dc9 |
These forwarders were wrapped in
|
|
|
981dc9 |
|
|
|
981dc9 |
#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
|
|
|
981dc9 |
|
|
|
981dc9 |
so that they are not present for newer architectures (such as
|
|
|
981dc9 |
powerpc64le) with a 2.17 or later ABI baseline. But the forwarders
|
|
|
981dc9 |
were not marked as compatibility symbols. As a result, on older
|
|
|
981dc9 |
architectures, historic configure checks such as
|
|
|
981dc9 |
|
|
|
981dc9 |
AC_CHECK_LIB(rt, clock_gettime)
|
|
|
981dc9 |
|
|
|
981dc9 |
still cause linking against librt, even though this is completely
|
|
|
981dc9 |
unnecessary. It also creates a needless porting hazard because
|
|
|
981dc9 |
architectures behave differently when it comes to symbol availability.
|
|
|
981dc9 |
|
|
|
981dc9 |
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
|
981dc9 |
|
|
|
981dc9 |
diff --git a/rt/clock-compat.c b/rt/clock-compat.c
|
|
|
981dc9 |
index f816973c05c29d5d..11e71aa89019b173 100644
|
|
|
981dc9 |
--- a/rt/clock-compat.c
|
|
|
981dc9 |
+++ b/rt/clock-compat.c
|
|
|
981dc9 |
@@ -30,14 +30,16 @@
|
|
|
981dc9 |
#if HAVE_IFUNC
|
|
|
981dc9 |
# undef INIT_ARCH
|
|
|
981dc9 |
# define INIT_ARCH()
|
|
|
981dc9 |
-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name)
|
|
|
981dc9 |
+# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \
|
|
|
981dc9 |
+ compat_symbol (librt, name, name, GLIBC_2_2);
|
|
|
981dc9 |
#else
|
|
|
981dc9 |
# define COMPAT_REDIRECT(name, proto, arglist) \
|
|
|
981dc9 |
int \
|
|
|
981dc9 |
name proto \
|
|
|
981dc9 |
{ \
|
|
|
981dc9 |
return __##name arglist; \
|
|
|
981dc9 |
- }
|
|
|
981dc9 |
+ } \
|
|
|
981dc9 |
+ compat_symbol (librt, name, name, GLIBC_2_2);
|
|
|
981dc9 |
#endif
|
|
|
981dc9 |
|
|
|
981dc9 |
COMPAT_REDIRECT (clock_getres,
|