]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
rt: Turn forwards from librt to libc into compat symbols [BZ #24194]
authorFlorian Weimer <fweimer@redhat.com>
Fri, 8 Feb 2019 09:21:56 +0000 (10:21 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 8 Feb 2019 09:43:17 +0000 (10:43 +0100)
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 <carlos@redhat.com>
ChangeLog
NEWS
rt/clock-compat.c

index 29f4ac31e1eac7345e0a3bcd7c1fd9943237be88..20ff76ab62d4e0b506afb6e04ca8067a31018790 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-07  Florian Weimer  <fweimer@redhat.com>
+
+       * rt/clock-compat.c (COMPAT_REDIRECT): Turn librt forwarders into
+       compatibility symbols.
+
 2019-02-07  Stefan Liebler  <stli@linux.ibm.com>
 
        [BZ #24180]
diff --git a/NEWS b/NEWS
index e14008d7adf32ddab367848eb5e236500114fea7..45792f62a99be9c3c60a591fe54a5f49156655fa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,11 @@ Major new features:
 
 Deprecated and removed features, and other changes affecting compatibility:
 
-  [Add deprecations, removals and changes affecting compatibility here]
+* The functions clock_gettime, clock_getres, clock_settime,
+  clock_getcpuclockid, clock_nanosleep were removed from the librt library
+  for new applications (on architectures which had them).  Instead, the
+  definitions in libc will be used automatically, which have been available
+  since glibc 2.17.
 
 Changes to build and runtime requirements:
 
index c603f40b69af0e0f253d6fb82cb6c742029abbf7..d8ced3cdc1fe324cb0a8e083c84a725d1b5b9e98 100644 (file)
 #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,