patches/glibc/ports-2.10.1/600-mips_librt-mips.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740 c57458bb354d
permissions -rw-r--r--
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
yann@1625
     1
we kind of screwed ourselves into a corner by having the clock symbols
yann@1625
     2
exported only with the glibc-2.0 version ... this patch fixes the
yann@1625
     3
export so all new binaries built against librt will use the correct
yann@1625
     4
glibc-2.2 symbol version
yann@1625
     5
yann@1625
     6
one day, we'll just drop this on the floor (maybe after 2006.1)
yann@1625
     7
yann@1625
     8
diff -durN glibc-2.10.1.orig/Versions.def glibc-2.10.1/Versions.def
yann@1625
     9
--- glibc-2.10.1.orig/Versions.def	2008-12-03 05:19:06.000000000 +0100
yann@1625
    10
+++ glibc-2.10.1/Versions.def	2009-11-13 00:51:27.000000000 +0100
yann@1625
    11
@@ -98,6 +98,7 @@
yann@1625
    12
   GLIBC_PRIVATE
yann@1625
    13
 }
yann@1625
    14
 librt {
yann@1625
    15
+  GLIBC_2.0
yann@1625
    16
   GLIBC_2.1
yann@1625
    17
   GLIBC_2.2
yann@1625
    18
   GLIBC_2.3
yann@1625
    19
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
yann@1625
    20
--- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions	2009-05-16 10:36:20.000000000 +0200
yann@1625
    21
+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions	2009-11-13 00:51:27.000000000 +0100
yann@1625
    22
@@ -35,3 +35,9 @@
yann@1625
    23
     _test_and_set;
yann@1625
    24
   }
yann@1625
    25
 }
yann@1625
    26
+librt {
yann@1625
    27
+  GLIBC_2.0 {
yann@1625
    28
+    # c*
yann@1625
    29
+    clock_gettime; clock_settime;
yann@1625
    30
+  }
yann@1625
    31
+}
yann@1625
    32
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
yann@1625
    33
diff -durN glibc-2.10.1.orig/sysdeps/unix/clock_gettime.c glibc-2.10.1/sysdeps/unix/clock_gettime.c
yann@1625
    34
--- glibc-2.10.1.orig/sysdeps/unix/clock_gettime.c	2007-07-28 22:36:04.000000000 +0200
yann@1625
    35
+++ glibc-2.10.1/sysdeps/unix/clock_gettime.c	2009-11-13 00:51:27.000000000 +0100
yann@1625
    36
@@ -23,6 +23,7 @@
yann@1625
    37
 #include <sys/time.h>
yann@1625
    38
 #include <libc-internal.h>
yann@1625
    39
 #include <ldsodefs.h>
yann@1625
    40
+#include <shlib-compat.h>
yann@1625
    41
 
yann@1625
    42
 
yann@1625
    43
 #if HP_TIMING_AVAIL
yann@1625
    44
@@ -90,7 +91,7 @@
yann@1625
    45
 
yann@1625
    46
 /* Get current value of CLOCK and store it in TP.  */
yann@1625
    47
 int
yann@1625
    48
-clock_gettime (clockid_t clock_id, struct timespec *tp)
yann@1625
    49
+__clock_gettime (clockid_t clock_id, struct timespec *tp)
yann@1625
    50
 {
yann@1625
    51
   int retval = -1;
yann@1625
    52
 
yann@1625
    53
@@ -133,4 +134,10 @@
yann@1625
    54
 
yann@1625
    55
   return retval;
yann@1625
    56
 }
yann@1625
    57
-librt_hidden_def (clock_gettime)
yann@1625
    58
+versioned_symbol (librt, __clock_gettime, clock_gettime, GLIBC_2_2);
yann@1625
    59
+librt_hidden_ver (__clock_gettime, clock_gettime)
yann@1625
    60
+
yann@1625
    61
+#if defined __mips__ && defined SHARED
yann@1625
    62
+strong_alias (__clock_gettime, __mips_clock_gettime)
yann@1625
    63
+compat_symbol (librt, __mips_clock_gettime, clock_gettime, GLIBC_2_0);
yann@1625
    64
+#endif
yann@1625
    65
diff -durN glibc-2.10.1.orig/sysdeps/unix/clock_settime.c glibc-2.10.1/sysdeps/unix/clock_settime.c
yann@1625
    66
--- glibc-2.10.1.orig/sysdeps/unix/clock_settime.c	2007-08-14 05:19:33.000000000 +0200
yann@1625
    67
+++ glibc-2.10.1/sysdeps/unix/clock_settime.c	2009-11-13 00:51:27.000000000 +0100
yann@1625
    68
@@ -21,6 +21,7 @@
yann@1625
    69
 #include <sys/time.h>
yann@1625
    70
 #include <libc-internal.h>
yann@1625
    71
 #include <ldsodefs.h>
yann@1625
    72
+#include <shlib-compat.h>
yann@1625
    73
 
yann@1625
    74
 
yann@1625
    75
 #if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME
yann@1625
    76
@@ -73,7 +74,7 @@
yann@1625
    77
 
yann@1625
    78
 /* Set CLOCK to value TP.  */
yann@1625
    79
 int
yann@1625
    80
-clock_settime (clockid_t clock_id, const struct timespec *tp)
yann@1625
    81
+__clock_settime (clockid_t clock_id, const struct timespec *tp)
yann@1625
    82
 {
yann@1625
    83
   int retval;
yann@1625
    84
 
yann@1625
    85
@@ -125,3 +126,9 @@
yann@1625
    86
 
yann@1625
    87
   return retval;
yann@1625
    88
 }
yann@1625
    89
+versioned_symbol (librt, __clock_settime, clock_settime, GLIBC_2_2);
yann@1625
    90
+
yann@1625
    91
+#if defined __mips__ && defined SHARED
yann@1625
    92
+strong_alias (__clock_settime, __mips_clock_settime)
yann@1625
    93
+compat_symbol (librt, __mips_clock_settime, clock_settime, GLIBC_2_0);
yann@1625
    94
+#endif