|
| 1 | +This patch can be dropped when we are building with glibc 2.30+. |
| 2 | + |
| 3 | +commit 6e41ef56c9baab719a02f1377b1e7ce7bff61e73 |
| 4 | +Author: Florian Weimer < [email protected]> |
| 5 | +Date: Fri Feb 8 10:21:56 2019 +0100 |
| 6 | + |
| 7 | + rt: Turn forwards from librt to libc into compat symbols [BZ #24194] |
| 8 | + |
| 9 | + As the result of commit 6e6249d0b461b952d0f544792372663feb6d792a |
| 10 | + ("BZ#14743: Move clock_* symbols from librt to libc."), in glibc 2.17, |
| 11 | + clock_gettime, clock_getres, clock_settime, clock_getcpuclockid, |
| 12 | + clock_nanosleep were added to libc, and the file rt/clock-compat.c |
| 13 | + was added with forwarders to the actual implementations in libc. |
| 14 | + These forwarders were wrapped in |
| 15 | + |
| 16 | + #if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17) |
| 17 | + |
| 18 | + so that they are not present for newer architectures (such as |
| 19 | + powerpc64le) with a 2.17 or later ABI baseline. But the forwarders |
| 20 | + were not marked as compatibility symbols. As a result, on older |
| 21 | + architectures, historic configure checks such as |
| 22 | + |
| 23 | + AC_CHECK_LIB(rt, clock_gettime) |
| 24 | + |
| 25 | + still cause linking against librt, even though this is completely |
| 26 | + unnecessary. It also creates a needless porting hazard because |
| 27 | + architectures behave differently when it comes to symbol availability. |
| 28 | + |
| 29 | + Reviewed-by: Carlos O'Donell < [email protected]> |
| 30 | + |
| 31 | +diff --git a/rt/clock-compat.c b/rt/clock-compat.c |
| 32 | +index f816973c05..11e71aa890 100644 |
| 33 | +--- a/rt/clock-compat.c |
| 34 | ++++ b/rt/clock-compat.c |
| 35 | +@@ -30,14 +30,16 @@ |
| 36 | + #if HAVE_IFUNC |
| 37 | + # undef INIT_ARCH |
| 38 | + # define INIT_ARCH() |
| 39 | +-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) |
| 40 | ++# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \ |
| 41 | ++ compat_symbol (librt, name, name, GLIBC_2_2); |
| 42 | + #else |
| 43 | + # define COMPAT_REDIRECT(name, proto, arglist) \ |
| 44 | + int \ |
| 45 | + name proto \ |
| 46 | + { \ |
| 47 | + return __##name arglist; \ |
| 48 | +- } |
| 49 | ++ } \ |
| 50 | ++ compat_symbol (librt, name, name, GLIBC_2_2); |
| 51 | + #endif |
| 52 | + |
| 53 | + COMPAT_REDIRECT (clock_getres, |
0 commit comments