patches/glibc/ports-2.10.1/600-mips_librt-mips.patch
changeset 1625 fde082da9813
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/ports-2.10.1/600-mips_librt-mips.patch	Fri Nov 13 21:37:18 2009 +0100
     1.3 @@ -0,0 +1,94 @@
     1.4 +we kind of screwed ourselves into a corner by having the clock symbols
     1.5 +exported only with the glibc-2.0 version ... this patch fixes the
     1.6 +export so all new binaries built against librt will use the correct
     1.7 +glibc-2.2 symbol version
     1.8 +
     1.9 +one day, we'll just drop this on the floor (maybe after 2006.1)
    1.10 +
    1.11 +diff -durN glibc-2.10.1.orig/Versions.def glibc-2.10.1/Versions.def
    1.12 +--- glibc-2.10.1.orig/Versions.def	2008-12-03 05:19:06.000000000 +0100
    1.13 ++++ glibc-2.10.1/Versions.def	2009-11-13 00:51:27.000000000 +0100
    1.14 +@@ -98,6 +98,7 @@
    1.15 +   GLIBC_PRIVATE
    1.16 + }
    1.17 + librt {
    1.18 ++  GLIBC_2.0
    1.19 +   GLIBC_2.1
    1.20 +   GLIBC_2.2
    1.21 +   GLIBC_2.3
    1.22 +diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions
    1.23 +--- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions	2009-05-16 10:36:20.000000000 +0200
    1.24 ++++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions	2009-11-13 00:51:27.000000000 +0100
    1.25 +@@ -35,3 +35,9 @@
    1.26 +     _test_and_set;
    1.27 +   }
    1.28 + }
    1.29 ++librt {
    1.30 ++  GLIBC_2.0 {
    1.31 ++    # c*
    1.32 ++    clock_gettime; clock_settime;
    1.33 ++  }
    1.34 ++}
    1.35 +diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/mips/Versions glibc-2.10.1/ports/sysdeps/unix/sysv/linux/mips/Versions
    1.36 +diff -durN glibc-2.10.1.orig/sysdeps/unix/clock_gettime.c glibc-2.10.1/sysdeps/unix/clock_gettime.c
    1.37 +--- glibc-2.10.1.orig/sysdeps/unix/clock_gettime.c	2007-07-28 22:36:04.000000000 +0200
    1.38 ++++ glibc-2.10.1/sysdeps/unix/clock_gettime.c	2009-11-13 00:51:27.000000000 +0100
    1.39 +@@ -23,6 +23,7 @@
    1.40 + #include <sys/time.h>
    1.41 + #include <libc-internal.h>
    1.42 + #include <ldsodefs.h>
    1.43 ++#include <shlib-compat.h>
    1.44 + 
    1.45 + 
    1.46 + #if HP_TIMING_AVAIL
    1.47 +@@ -90,7 +91,7 @@
    1.48 + 
    1.49 + /* Get current value of CLOCK and store it in TP.  */
    1.50 + int
    1.51 +-clock_gettime (clockid_t clock_id, struct timespec *tp)
    1.52 ++__clock_gettime (clockid_t clock_id, struct timespec *tp)
    1.53 + {
    1.54 +   int retval = -1;
    1.55 + 
    1.56 +@@ -133,4 +134,10 @@
    1.57 + 
    1.58 +   return retval;
    1.59 + }
    1.60 +-librt_hidden_def (clock_gettime)
    1.61 ++versioned_symbol (librt, __clock_gettime, clock_gettime, GLIBC_2_2);
    1.62 ++librt_hidden_ver (__clock_gettime, clock_gettime)
    1.63 ++
    1.64 ++#if defined __mips__ && defined SHARED
    1.65 ++strong_alias (__clock_gettime, __mips_clock_gettime)
    1.66 ++compat_symbol (librt, __mips_clock_gettime, clock_gettime, GLIBC_2_0);
    1.67 ++#endif
    1.68 +diff -durN glibc-2.10.1.orig/sysdeps/unix/clock_settime.c glibc-2.10.1/sysdeps/unix/clock_settime.c
    1.69 +--- glibc-2.10.1.orig/sysdeps/unix/clock_settime.c	2007-08-14 05:19:33.000000000 +0200
    1.70 ++++ glibc-2.10.1/sysdeps/unix/clock_settime.c	2009-11-13 00:51:27.000000000 +0100
    1.71 +@@ -21,6 +21,7 @@
    1.72 + #include <sys/time.h>
    1.73 + #include <libc-internal.h>
    1.74 + #include <ldsodefs.h>
    1.75 ++#include <shlib-compat.h>
    1.76 + 
    1.77 + 
    1.78 + #if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME
    1.79 +@@ -73,7 +74,7 @@
    1.80 + 
    1.81 + /* Set CLOCK to value TP.  */
    1.82 + int
    1.83 +-clock_settime (clockid_t clock_id, const struct timespec *tp)
    1.84 ++__clock_settime (clockid_t clock_id, const struct timespec *tp)
    1.85 + {
    1.86 +   int retval;
    1.87 + 
    1.88 +@@ -125,3 +126,9 @@
    1.89 + 
    1.90 +   return retval;
    1.91 + }
    1.92 ++versioned_symbol (librt, __clock_settime, clock_settime, GLIBC_2_2);
    1.93 ++
    1.94 ++#if defined __mips__ && defined SHARED
    1.95 ++strong_alias (__clock_settime, __mips_clock_settime)
    1.96 ++compat_symbol (librt, __mips_clock_settime, clock_settime, GLIBC_2_0);
    1.97 ++#endif