patches/glibc/2.6/210-lll_lock_t.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@748
     1
Patch provided bu Ioannis E. VENETIS
yann@748
     2
yann@748
     3
Using:
yann@748
     4
yann@748
     5
typedef int lll_lock_t;
yann@748
     6
yann@748
     7
creates problems during compilation. Since glibc 2.7 got rid of the 'typedef' and
yann@748
     8
uses directly 'int', we do the same here.
yann@748
     9
yann@748
    10
diff -Naur glibc-2.6/nptl/allocatestack.c glibc-2.6.new/nptl/allocatestack.c
yann@748
    11
--- glibc-2.6/nptl/allocatestack.c	2006-08-23 20:39:47.000000000 +0300
yann@748
    12
+++ glibc-2.6.new/nptl/allocatestack.c	2008-07-27 20:56:19.000000000 +0300
yann@748
    13
@@ -103,7 +103,7 @@
yann@748
    14
 static size_t stack_cache_actsize;
yann@748
    15
 
yann@748
    16
 /* Mutex protecting this variable.  */
yann@748
    17
-static lll_lock_t stack_cache_lock = LLL_LOCK_INITIALIZER;
yann@748
    18
+static int stack_cache_lock = LLL_LOCK_INITIALIZER;
yann@748
    19
 
yann@748
    20
 /* List of queued stack frames.  */
yann@748
    21
 static LIST_HEAD (stack_cache);
yann@748
    22
diff -Naur glibc-2.6/nptl/descr.h glibc-2.6.new/nptl/descr.h
yann@748
    23
--- glibc-2.6/nptl/descr.h	2006-09-24 20:10:55.000000000 +0300
yann@748
    24
+++ glibc-2.6.new/nptl/descr.h	2008-07-27 20:54:41.000000000 +0300
yann@748
    25
@@ -304,10 +304,10 @@
yann@748
    26
   int parent_cancelhandling;
yann@748
    27
 
yann@748
    28
   /* Lock to synchronize access to the descriptor.  */
yann@748
    29
-  lll_lock_t lock;
yann@748
    30
+  int lock;
yann@748
    31
 
yann@748
    32
   /* Lock for synchronizing setxid calls.  */
yann@748
    33
-  lll_lock_t setxid_futex;
yann@748
    34
+  int setxid_futex;
yann@748
    35
 
yann@748
    36
 #if HP_TIMING_AVAIL
yann@748
    37
   /* Offset of the CPU clock at start thread start time.  */
yann@748
    38
diff -Naur glibc-2.6/nptl/pthread_attr_init.c glibc-2.6.new/nptl/pthread_attr_init.c
yann@748
    39
--- glibc-2.6/nptl/pthread_attr_init.c	2004-03-19 01:56:31.000000000 +0200
yann@748
    40
+++ glibc-2.6.new/nptl/pthread_attr_init.c	2008-07-27 20:55:03.000000000 +0300
yann@748
    41
@@ -27,7 +27,7 @@
yann@748
    42
 
yann@748
    43
 
yann@748
    44
 struct pthread_attr *__attr_list;
yann@748
    45
-lll_lock_t __attr_list_lock = LLL_LOCK_INITIALIZER;
yann@748
    46
+int __attr_list_lock = LLL_LOCK_INITIALIZER;
yann@748
    47
 
yann@748
    48
 
yann@748
    49
 int
yann@748
    50
diff -Naur glibc-2.6/nptl/pthreadP.h glibc-2.6.new/nptl/pthreadP.h
yann@748
    51
--- glibc-2.6/nptl/pthreadP.h	2006-08-23 20:42:52.000000000 +0300
yann@748
    52
+++ glibc-2.6.new/nptl/pthreadP.h	2008-07-27 20:56:40.000000000 +0300
yann@748
    53
@@ -143,7 +143,7 @@
yann@748
    54
 
yann@748
    55
 /* Attribute handling.  */
yann@748
    56
 extern struct pthread_attr *__attr_list attribute_hidden;
yann@748
    57
-extern lll_lock_t __attr_list_lock attribute_hidden;
yann@748
    58
+extern int __attr_list_lock attribute_hidden;
yann@748
    59
 
yann@748
    60
 /* First available RT signal.  */
yann@748
    61
 extern int __current_sigrtmin attribute_hidden;
yann@748
    62
diff -Naur glibc-2.6/nptl/semaphoreP.h glibc-2.6.new/nptl/semaphoreP.h
yann@748
    63
--- glibc-2.6/nptl/semaphoreP.h	2006-05-11 20:08:37.000000000 +0300
yann@748
    64
+++ glibc-2.6.new/nptl/semaphoreP.h	2008-07-27 20:55:42.000000000 +0300
yann@748
    65
@@ -48,7 +48,7 @@
yann@748
    66
 extern void *__sem_mappings attribute_hidden;
yann@748
    67
 
yann@748
    68
 /* Lock to protect the search tree.  */
yann@748
    69
-extern lll_lock_t __sem_mappings_lock attribute_hidden;
yann@748
    70
+extern int __sem_mappings_lock attribute_hidden;
yann@748
    71
 
yann@748
    72
 
yann@748
    73
 /* Initializer for mountpoint.  */
yann@748
    74
diff -Naur glibc-2.6/nptl/sem_open.c glibc-2.6.new/nptl/sem_open.c
yann@748
    75
--- glibc-2.6/nptl/sem_open.c	2006-05-11 20:09:43.000000000 +0300
yann@748
    76
+++ glibc-2.6.new/nptl/sem_open.c	2008-07-27 20:55:22.000000000 +0300
yann@748
    77
@@ -147,7 +147,7 @@
yann@748
    78
 void *__sem_mappings attribute_hidden;
yann@748
    79
 
yann@748
    80
 /* Lock to protect the search tree.  */
yann@748
    81
-lll_lock_t __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER;
yann@748
    82
+int __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER;
yann@748
    83
 
yann@748
    84
 
yann@748
    85
 /* Search for existing mapping and if possible add the one provided.  */
yann@748
    86
diff -Naur glibc-2.6/nptl/pthread_once.c glibc-2.6.new/nptl/pthread_once.c
yann@748
    87
--- glibc-2.6/nptl/pthread_once.c	2002-11-27 00:50:31.000000000 +0200
yann@748
    88
+++ glibc-2.6.new/nptl/pthread_once.c	2008-07-27 20:57:12.000000000 +0300
yann@748
    89
@@ -22,7 +22,7 @@
yann@748
    90
 
yann@748
    91
 
yann@748
    92
 
yann@748
    93
-static lll_lock_t once_lock = LLL_LOCK_INITIALIZER;
yann@748
    94
+static int once_lock = LLL_LOCK_INITIALIZER;
yann@748
    95
 
yann@748
    96
 
yann@748
    97
 int
yann@748
    98
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
yann@748
    99
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h	2006-07-29 08:06:07.000000000 +0300
yann@748
   100
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h	2008-07-27 20:59:15.000000000 +0300
yann@748
   101
@@ -230,9 +230,6 @@
yann@748
   102
 /* Our internal lock implementation is identical to the binary-compatible
yann@748
   103
    mutex implementation. */
yann@748
   104
 
yann@748
   105
-/* Type for lock object.  */
yann@748
   106
-typedef int lll_lock_t;
yann@748
   107
-
yann@748
   108
 /* Initializers for lock.  */
yann@748
   109
 #define LLL_LOCK_INITIALIZER		(0)
yann@748
   110
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
yann@748
   111
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.c glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.c
yann@748
   112
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.c	2003-12-21 01:37:13.000000000 +0200
yann@748
   113
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.c	2008-07-27 21:00:01.000000000 +0300
yann@748
   114
@@ -183,7 +183,7 @@
yann@748
   115
 	}
yann@748
   116
 
yann@748
   117
       /* Initialize the fork lock.  */
yann@748
   118
-      __fork_lock = (lll_lock_t) LLL_LOCK_INITIALIZER;
yann@748
   119
+      __fork_lock = (int) LLL_LOCK_INITIALIZER;
yann@748
   120
     }
yann@748
   121
   else
yann@748
   122
     {
yann@748
   123
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.h
yann@748
   124
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.h	2006-05-15 23:19:43.000000000 +0300
yann@748
   125
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.h	2008-07-27 20:58:49.000000000 +0300
yann@748
   126
@@ -26,7 +26,7 @@
yann@748
   127
 extern unsigned long int *__fork_generation_pointer attribute_hidden;
yann@748
   128
 
yann@748
   129
 /* Lock to protect allocation and deallocation of fork handlers.  */
yann@748
   130
-extern lll_lock_t __fork_lock attribute_hidden;
yann@748
   131
+extern int __fork_lock attribute_hidden;
yann@748
   132
 
yann@748
   133
 /* Elements of the fork handler lists.  */
yann@748
   134
 struct fork_handler
yann@748
   135
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
yann@748
   136
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h	2006-09-05 17:44:25.000000000 +0300
yann@748
   137
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h	2008-07-27 21:00:19.000000000 +0300
yann@748
   138
@@ -436,9 +436,6 @@
yann@748
   139
 /* We have a separate internal lock implementation which is not tied
yann@748
   140
    to binary compatibility.  */
yann@748
   141
 
yann@748
   142
-/* Type for lock object.  */
yann@748
   143
-typedef int lll_lock_t;
yann@748
   144
-
yann@748
   145
 /* Initializers for lock.  */
yann@748
   146
 #define LLL_LOCK_INITIALIZER		(0)
yann@748
   147
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
yann@748
   148
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
yann@748
   149
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h	2006-07-29 08:06:07.000000000 +0300
yann@748
   150
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h	2008-07-27 20:58:16.000000000 +0300
yann@748
   151
@@ -223,9 +223,6 @@
yann@748
   152
 /* We have a separate internal lock implementation which is not tied
yann@748
   153
    to binary compatibility.  We can use the lll_mutex_*.  */
yann@748
   154
 
yann@748
   155
-/* Type for lock object.  */
yann@748
   156
-typedef int lll_lock_t;
yann@748
   157
-
yann@748
   158
 extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
yann@748
   159
 
yann@748
   160
 /* Initializers for lock.  */
yann@748
   161
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
yann@748
   162
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h	2006-07-29 08:06:07.000000000 +0300
yann@748
   163
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h	2008-07-27 21:00:36.000000000 +0300
yann@748
   164
@@ -254,9 +254,6 @@
yann@748
   165
 /* Our internal lock implementation is identical to the binary-compatible
yann@748
   166
    mutex implementation. */
yann@748
   167
 
yann@748
   168
-/* Type for lock object.  */
yann@748
   169
-typedef int lll_lock_t;
yann@748
   170
-
yann@748
   171
 /* Initializers for lock.  */
yann@748
   172
 #define LLL_LOCK_INITIALIZER		(0)
yann@748
   173
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
yann@748
   174
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/register-atfork.c glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/register-atfork.c
yann@748
   175
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/register-atfork.c	2005-12-22 00:17:21.000000000 +0200
yann@748
   176
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/register-atfork.c	2008-07-27 21:00:55.000000000 +0300
yann@748
   177
@@ -24,7 +24,7 @@
yann@748
   178
 
yann@748
   179
 
yann@748
   180
 /* Lock to protect allocation and deallocation of fork handlers.  */
yann@748
   181
-lll_lock_t __fork_lock = LLL_LOCK_INITIALIZER;
yann@748
   182
+int __fork_lock = LLL_LOCK_INITIALIZER;
yann@748
   183
 
yann@748
   184
 
yann@748
   185
 /* Number of pre-allocated handler entries.  */
yann@748
   186
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
yann@748
   187
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h	2006-07-29 08:06:07.000000000 +0300
yann@748
   188
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h	2008-07-27 21:01:14.000000000 +0300
yann@748
   189
@@ -309,9 +309,6 @@
yann@748
   190
 /* We have a separate internal lock implementation which is not tied
yann@748
   191
    to binary compatibility.  We can use the lll_mutex_*.  */
yann@748
   192
 
yann@748
   193
-/* Type for lock object.  */
yann@748
   194
-typedef int lll_lock_t;
yann@748
   195
-
yann@748
   196
 /* Initializers for lock.  */
yann@748
   197
 #define LLL_LOCK_INITIALIZER		(0)
yann@748
   198
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
yann@748
   199
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
yann@748
   200
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h	2006-07-29 08:06:06.000000000 +0300
yann@748
   201
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h	2008-07-27 20:58:00.000000000 +0300
yann@748
   202
@@ -278,9 +278,6 @@
yann@748
   203
 /* We have a separate internal lock implementation which is not tied
yann@748
   204
    to binary compatibility.  */
yann@748
   205
 
yann@748
   206
-/* Type for lock object.  */
yann@748
   207
-typedef int lll_lock_t;
yann@748
   208
-
yann@748
   209
 /* Initializers for lock.  */
yann@748
   210
 #define LLL_LOCK_INITIALIZER		(0)
yann@748
   211
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)
yann@748
   212
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
yann@748
   213
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h	2006-07-29 08:06:06.000000000 +0300
yann@748
   214
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h	2008-07-27 20:59:39.000000000 +0300
yann@748
   215
@@ -237,9 +237,6 @@
yann@748
   216
 /* We have a separate internal lock implementation which is not tied
yann@748
   217
    to binary compatibility.  We can use the lll_mutex_*.  */
yann@748
   218
 
yann@748
   219
-/* Type for lock object.  */
yann@748
   220
-typedef int lll_lock_t;
yann@748
   221
-
yann@748
   222
 extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
yann@748
   223
 
yann@748
   224
 /* Initializers for lock.  */
yann@748
   225
diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
yann@748
   226
--- glibc-2.6/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h	2006-09-05 17:45:34.000000000 +0300
yann@748
   227
+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h	2008-07-27 20:58:33.000000000 +0300
yann@748
   228
@@ -446,9 +446,6 @@
yann@748
   229
 /* We have a separate internal lock implementation which is not tied
yann@748
   230
    to binary compatibility.  */
yann@748
   231
 
yann@748
   232
-/* Type for lock object.  */
yann@748
   233
-typedef int lll_lock_t;
yann@748
   234
-
yann@748
   235
 /* Initializers for lock.  */
yann@748
   236
 #define LLL_LOCK_INITIALIZER		(0)
yann@748
   237
 #define LLL_LOCK_INITIALIZER_LOCKED	(1)