1 |
vapier 14/02/08 14:57:21 |
2 |
|
3 |
Added: 00_all_0001-disable-ldconfig-during-install.patch |
4 |
00_all_0002-workaround-crash-when-handling-signals-in-static-PIE.patch |
5 |
00_all_0003-make-fortify-logic-checks-less-angry.patch |
6 |
00_all_0004-Fix-localedef-segfault-when-run-under-exec-shield-Pa.patch |
7 |
00_all_0005-reload-etc-resolv.conf-when-it-has-changed.patch |
8 |
00_all_0006-nptl-support-thread-stacks-that-grow-up.patch |
9 |
00_all_0007-rtld-do-not-ignore-arch-specific-CFLAGS.patch |
10 |
00_all_0008-nptl-handle-EAGAIN-with-some-futex-operations.patch |
11 |
00_all_0009-gentoo-support-running-tests-under-sandbox.patch |
12 |
00_all_0010-gentoo-disable-building-in-timezone-subdir.patch |
13 |
00_all_0011-arm-fix-PIC-vs-SHARED-typos.patch |
14 |
README.history |
15 |
Log: |
16 |
initial 2.19 patchset based on last 2.18 patchset |
17 |
|
18 |
Revision Changes Path |
19 |
1.1 src/patchsets/glibc/2.19/00_all_0001-disable-ldconfig-during-install.patch |
20 |
|
21 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0001-disable-ldconfig-during-install.patch?rev=1.1&view=markup |
22 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0001-disable-ldconfig-during-install.patch?rev=1.1&content-type=text/plain |
23 |
|
24 |
Index: 00_all_0001-disable-ldconfig-during-install.patch |
25 |
=================================================================== |
26 |
From 9ef157813274d285e99c238f433b9be92b48ac88 Mon Sep 17 00:00:00 2001 |
27 |
From: Mike Frysinger <vapier@g.o> |
28 |
Date: Sat, 4 May 2013 14:07:11 -0400 |
29 |
Subject: [PATCH 01/11] disable ldconfig during install |
30 |
|
31 |
do not bother running ldconfig on DESTDIR. it wants to write the temp cache |
32 |
file outside of the chroot. doesnt matter anyways as we wont use the cache |
33 |
results (portage will rebuild cache), so running ldconfig is simply a waste |
34 |
of time. |
35 |
|
36 |
http://sourceware.org/ml/libc-alpha/2012-08/msg00118.html |
37 |
https://bugs.gentoo.org/431038 |
38 |
--- |
39 |
Makefile | 1 + |
40 |
1 file changed, 1 insertion(+) |
41 |
|
42 |
diff --git a/Makefile b/Makefile |
43 |
index 51d4690..65f6cbe 100644 |
44 |
--- a/Makefile |
45 |
+++ b/Makefile |
46 |
@@ -105,6 +105,7 @@ install-symbolic-link: subdir_install |
47 |
rm -f $(symbolic-link-list) |
48 |
|
49 |
install: |
50 |
+dont-bother-with-destdir: |
51 |
-test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \ |
52 |
$(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \ |
53 |
$(slibdir) $(libdir) |
54 |
-- |
55 |
1.8.5.4 |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
1.1 src/patchsets/glibc/2.19/00_all_0002-workaround-crash-when-handling-signals-in-static-PIE.patch |
61 |
|
62 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0002-workaround-crash-when-handling-signals-in-static-PIE.patch?rev=1.1&view=markup |
63 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0002-workaround-crash-when-handling-signals-in-static-PIE.patch?rev=1.1&content-type=text/plain |
64 |
|
65 |
Index: 00_all_0002-workaround-crash-when-handling-signals-in-static-PIE.patch |
66 |
=================================================================== |
67 |
From cca855811394c527a7de8dc45abc7d65dd9e1745 Mon Sep 17 00:00:00 2001 |
68 |
From: Mike Frysinger <vapier@g.o> |
69 |
Date: Sat, 4 May 2013 14:10:41 -0400 |
70 |
Subject: [PATCH 02/11] workaround crash when handling signals in static PIEs |
71 |
|
72 |
work around ... not entirely sure what is going on here. |
73 |
|
74 |
2011-03-01 squeezy <vina@××××××××××.eu> |
75 |
|
76 |
* sysdeps/unix/sysv/linux/x86_64/sigaction.c fix the __restore_rt symbol |
77 |
|
78 |
http://bugs.gentoo.org/283470 |
79 |
--- |
80 |
sysdeps/unix/sysv/linux/x86_64/sigaction.c | 2 +- |
81 |
1 file changed, 1 insertion(+), 1 deletion(-) |
82 |
|
83 |
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/sysdeps/unix/sysv/linux/x86_64/sigaction.c |
84 |
index ab23985..3f48a26 100644 |
85 |
--- a/sysdeps/unix/sysv/linux/x86_64/sigaction.c |
86 |
+++ b/sysdeps/unix/sysv/linux/x86_64/sigaction.c |
87 |
@@ -39,7 +39,7 @@ |
88 |
|
89 |
/* Using the hidden attribute here does not change the code but it |
90 |
helps to avoid warnings. */ |
91 |
-extern void restore_rt (void) asm ("__restore_rt") attribute_hidden; |
92 |
+extern void restore_rt (void) asm ("__restore_rt") __attribute__((__visibility__("hidden"))); |
93 |
|
94 |
|
95 |
/* If ACT is not NULL, change the action for SIG to *ACT. |
96 |
-- |
97 |
1.8.5.4 |
98 |
|
99 |
|
100 |
|
101 |
|
102 |
1.1 src/patchsets/glibc/2.19/00_all_0003-make-fortify-logic-checks-less-angry.patch |
103 |
|
104 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0003-make-fortify-logic-checks-less-angry.patch?rev=1.1&view=markup |
105 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0003-make-fortify-logic-checks-less-angry.patch?rev=1.1&content-type=text/plain |
106 |
|
107 |
Index: 00_all_0003-make-fortify-logic-checks-less-angry.patch |
108 |
=================================================================== |
109 |
From 0371345ce892d174f344d0f912419f4a5b3c8954 Mon Sep 17 00:00:00 2001 |
110 |
From: Mike Frysinger <vapier@g.o> |
111 |
Date: Sat, 4 May 2013 14:12:58 -0400 |
112 |
Subject: [PATCH 03/11] make fortify logic checks less angry |
113 |
|
114 |
the fortify/optimization check does not play well with our default gcc specs |
115 |
|
116 |
http://sourceware.org/ml/libc-alpha/2012-06/msg00068.html |
117 |
--- |
118 |
include/features.h | 7 ++++--- |
119 |
1 file changed, 4 insertions(+), 3 deletions(-) |
120 |
|
121 |
diff --git a/include/features.h b/include/features.h |
122 |
index 21173a2..46638ca 100644 |
123 |
--- a/include/features.h |
124 |
+++ b/include/features.h |
125 |
@@ -336,10 +336,11 @@ |
126 |
# define __USE_REENTRANT 1 |
127 |
#endif |
128 |
|
129 |
+#if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 |
130 |
+# undef _FORTIFY_SOURCE |
131 |
+#endif |
132 |
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 |
133 |
-# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 |
134 |
-# warning _FORTIFY_SOURCE requires compiling with optimization (-O) |
135 |
-# elif !__GNUC_PREREQ (4, 1) |
136 |
+# if !__GNUC_PREREQ (4, 1) |
137 |
# warning _FORTIFY_SOURCE requires GCC 4.1 or later |
138 |
# elif _FORTIFY_SOURCE > 1 |
139 |
# define __USE_FORTIFY_LEVEL 2 |
140 |
-- |
141 |
1.8.5.4 |
142 |
|
143 |
|
144 |
|
145 |
|
146 |
1.1 src/patchsets/glibc/2.19/00_all_0004-Fix-localedef-segfault-when-run-under-exec-shield-Pa.patch |
147 |
|
148 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0004-Fix-localedef-segfault-when-run-under-exec-shield-Pa.patch?rev=1.1&view=markup |
149 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0004-Fix-localedef-segfault-when-run-under-exec-shield-Pa.patch?rev=1.1&content-type=text/plain |
150 |
|
151 |
Index: 00_all_0004-Fix-localedef-segfault-when-run-under-exec-shield-Pa.patch |
152 |
=================================================================== |
153 |
From ce3e26b03abb5d1f20117fa3e80b31bfee53ee33 Mon Sep 17 00:00:00 2001 |
154 |
From: Jakub Jelinek <jakub@××××××.com> |
155 |
Date: Fri, 16 Aug 2013 14:52:25 -0400 |
156 |
Subject: [PATCH 04/11] Fix localedef segfault when run under exec-shield, PaX |
157 |
or similar |
158 |
|
159 |
http://bugs.debian.org/198099 |
160 |
http://bugs.debian.org/231438 |
161 |
--- |
162 |
locale/programs/3level.h | 36 ++++++++++++++++++++++++++++++++++++ |
163 |
1 file changed, 36 insertions(+) |
164 |
|
165 |
diff --git a/locale/programs/3level.h b/locale/programs/3level.h |
166 |
index c83cdf2..1d4553e 100644 |
167 |
--- a/locale/programs/3level.h |
168 |
+++ b/locale/programs/3level.h |
169 |
@@ -204,6 +204,42 @@ CONCAT(TABLE,_iterate) (struct TABLE *t, |
170 |
} |
171 |
} |
172 |
} |
173 |
+ |
174 |
+/* GCC ATM seems to do a poor job with pointers to nested functions passed |
175 |
+ to inlined functions. Help it a little bit with this hack. */ |
176 |
+#define wchead_table_iterate(tp, fn) \ |
177 |
+do \ |
178 |
+ { \ |
179 |
+ struct wchead_table *t = (tp); \ |
180 |
+ uint32_t index1; \ |
181 |
+ for (index1 = 0; index1 < t->level1_size; index1++) \ |
182 |
+ { \ |
183 |
+ uint32_t lookup1 = t->level1[index1]; \ |
184 |
+ if (lookup1 != ((uint32_t) ~0)) \ |
185 |
+ { \ |
186 |
+ uint32_t lookup1_shifted = lookup1 << t->q; \ |
187 |
+ uint32_t index2; \ |
188 |
+ for (index2 = 0; index2 < (1 << t->q); index2++) \ |
189 |
+ { \ |
190 |
+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \ |
191 |
+ if (lookup2 != ((uint32_t) ~0)) \ |
192 |
+ { \ |
193 |
+ uint32_t lookup2_shifted = lookup2 << t->p; \ |
194 |
+ uint32_t index3; \ |
195 |
+ for (index3 = 0; index3 < (1 << t->p); index3++) \ |
196 |
+ { \ |
197 |
+ struct element_t *lookup3 \ |
198 |
+ = t->level3[index3 + lookup2_shifted]; \ |
199 |
+ if (lookup3 != NULL) \ |
200 |
+ fn ((((index1 << t->q) + index2) << t->p) + index3, \ |
201 |
+ lookup3); \ |
202 |
+ } \ |
203 |
+ } \ |
204 |
+ } \ |
205 |
+ } \ |
206 |
+ } \ |
207 |
+ } while (0) |
208 |
+ |
209 |
#endif |
210 |
|
211 |
#ifndef NO_ADD_LOCALE |
212 |
-- |
213 |
1.8.5.4 |
214 |
|
215 |
|
216 |
|
217 |
|
218 |
1.1 src/patchsets/glibc/2.19/00_all_0005-reload-etc-resolv.conf-when-it-has-changed.patch |
219 |
|
220 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0005-reload-etc-resolv.conf-when-it-has-changed.patch?rev=1.1&view=markup |
221 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0005-reload-etc-resolv.conf-when-it-has-changed.patch?rev=1.1&content-type=text/plain |
222 |
|
223 |
Index: 00_all_0005-reload-etc-resolv.conf-when-it-has-changed.patch |
224 |
=================================================================== |
225 |
From 6a714e48586aa7f21d2eeef9195cee57c9ebaa60 Mon Sep 17 00:00:00 2001 |
226 |
From: Thorsten Kukuk <kukuk@××××.de> |
227 |
Date: Fri, 16 Aug 2013 14:54:23 -0400 |
228 |
Subject: [PATCH 05/11] reload /etc/resolv.conf when it has changed |
229 |
|
230 |
if /etc/resolv.conf is updated, then make sure applications |
231 |
already running get the updated information. |
232 |
|
233 |
ripped from SuSE |
234 |
|
235 |
http://bugs.gentoo.org/177416 |
236 |
--- |
237 |
resolv/res_libc.c | 15 +++++++++++++++ |
238 |
1 file changed, 15 insertions(+) |
239 |
|
240 |
diff --git a/resolv/res_libc.c b/resolv/res_libc.c |
241 |
index ee3fa21..f30b3a9 100644 |
242 |
--- a/resolv/res_libc.c |
243 |
+++ b/resolv/res_libc.c |
244 |
@@ -22,6 +22,7 @@ |
245 |
#include <arpa/nameser.h> |
246 |
#include <resolv.h> |
247 |
#include <bits/libc-lock.h> |
248 |
+#include <sys/stat.h> |
249 |
|
250 |
|
251 |
/* The following bit is copied from res_data.c (where it is #ifdef'ed |
252 |
@@ -95,6 +96,20 @@ int |
253 |
__res_maybe_init (res_state resp, int preinit) |
254 |
{ |
255 |
if (resp->options & RES_INIT) { |
256 |
+ static time_t last_mtime, last_check; |
257 |
+ time_t now; |
258 |
+ struct stat statbuf; |
259 |
+ |
260 |
+ time (&now); |
261 |
+ if (now != last_check) { |
262 |
+ last_check = now; |
263 |
+ if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) { |
264 |
+ last_mtime = statbuf.st_mtime; |
265 |
+ atomicinclock (lock); |
266 |
+ atomicinc (__res_initstamp); |
267 |
+ atomicincunlock (lock); |
268 |
+ } |
269 |
+ } |
270 |
if (__res_initstamp != resp->_u._ext.initstamp) { |
271 |
if (resp->nscount > 0) |
272 |
__res_iclose (resp, true); |
273 |
-- |
274 |
1.8.5.4 |
275 |
|
276 |
|
277 |
|
278 |
|
279 |
1.1 src/patchsets/glibc/2.19/00_all_0006-nptl-support-thread-stacks-that-grow-up.patch |
280 |
|
281 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0006-nptl-support-thread-stacks-that-grow-up.patch?rev=1.1&view=markup |
282 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0006-nptl-support-thread-stacks-that-grow-up.patch?rev=1.1&content-type=text/plain |
283 |
|
284 |
Index: 00_all_0006-nptl-support-thread-stacks-that-grow-up.patch |
285 |
=================================================================== |
286 |
From a5760bbb50f3dbfd1e4051a54aae35060cdd639b Mon Sep 17 00:00:00 2001 |
287 |
From: Carlos O'Donell <carlos@××××××××××××.org> |
288 |
Date: Fri, 16 Aug 2013 14:57:59 -0400 |
289 |
Subject: [PATCH 06/11] nptl: support thread stacks that grow up |
290 |
|
291 |
http://bugs.gentoo.org/301642 |
292 |
--- |
293 |
nptl/allocatestack.c | 22 +++++++++++++++------- |
294 |
nptl/pthread_attr_getstack.c | 4 ++++ |
295 |
nptl/pthread_attr_setstack.c | 8 ++++++++ |
296 |
nptl/pthread_create.c | 21 +++++++++++++++++---- |
297 |
nptl/pthread_getattr_np.c | 13 +++++++++++-- |
298 |
5 files changed, 55 insertions(+), 13 deletions(-) |
299 |
|
300 |
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c |
301 |
index 13eca47..ad6d8a9 100644 |
302 |
--- a/nptl/allocatestack.c |
303 |
+++ b/nptl/allocatestack.c |
304 |
@@ -371,6 +371,15 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, |
305 |
if (__builtin_expect (attr->flags & ATTR_FLAG_STACKADDR, 0)) |
306 |
{ |
307 |
uintptr_t adj; |
308 |
+#if _STACK_GROWS_DOWN |
309 |
+ char * stackaddr = (char *) attr->stackaddr; |
310 |
+#else |
311 |
+ /* Assume the same layout as the _STACK_GROWS_DOWN case, |
312 |
+ with struct pthread at the top of the stack block. |
313 |
+ Later we adjust the guard location and stack address |
314 |
+ to match the _STACK_GROWS_UP case. */ |
315 |
+ char * stackaddr = (char *) attr->stackaddr + attr->stacksize; |
316 |
+#endif |
317 |
|
318 |
/* If the user also specified the size of the stack make sure it |
319 |
is large enough. */ |
320 |
@@ -380,11 +389,11 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, |
321 |
|
322 |
/* Adjust stack size for alignment of the TLS block. */ |
323 |
#if TLS_TCB_AT_TP |
324 |
- adj = ((uintptr_t) attr->stackaddr - TLS_TCB_SIZE) |
325 |
+ adj = ((uintptr_t) stackaddr - TLS_TCB_SIZE) |
326 |
& __static_tls_align_m1; |
327 |
assert (size > adj + TLS_TCB_SIZE); |
328 |
#elif TLS_DTV_AT_TP |
329 |
- adj = ((uintptr_t) attr->stackaddr - __static_tls_size) |
330 |
+ adj = ((uintptr_t) stackaddr - __static_tls_size) |
331 |
& __static_tls_align_m1; |
332 |
assert (size > adj); |
333 |
#endif |
334 |
@@ -394,10 +403,10 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, |
335 |
the stack. It is the user's responsibility to do this if it |
336 |
is wanted. */ |
337 |
#if TLS_TCB_AT_TP |
338 |
- pd = (struct pthread *) ((uintptr_t) attr->stackaddr |
339 |
+ pd = (struct pthread *) ((uintptr_t) stackaddr |
340 |
- TLS_TCB_SIZE - adj); |
341 |
#elif TLS_DTV_AT_TP |
342 |
- pd = (struct pthread *) (((uintptr_t) attr->stackaddr |
343 |
+ pd = (struct pthread *) (((uintptr_t) stackaddr |
344 |
- __static_tls_size - adj) |
345 |
- TLS_PRE_TCB_SIZE); |
346 |
#endif |
347 |
@@ -409,7 +418,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, |
348 |
pd->specific[0] = pd->specific_1stblock; |
349 |
|
350 |
/* Remember the stack-related values. */ |
351 |
- pd->stackblock = (char *) attr->stackaddr - size; |
352 |
+ pd->stackblock = (char *) stackaddr - size; |
353 |
pd->stackblock_size = size; |
354 |
|
355 |
/* This is a user-provided stack. It will not be queued in the |
356 |
@@ -635,7 +644,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, |
357 |
char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1); |
358 |
#elif _STACK_GROWS_DOWN |
359 |
char *guard = mem; |
360 |
-# elif _STACK_GROWS_UP |
361 |
+#elif _STACK_GROWS_UP |
362 |
char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1); |
363 |
#endif |
364 |
if (mprotect (guard, guardsize, PROT_NONE) != 0) |
365 |
@@ -731,7 +740,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, |
366 |
*stack = stacktop; |
367 |
#elif _STACK_GROWS_UP |
368 |
*stack = pd->stackblock; |
369 |
- assert (*stack > 0); |
370 |
#endif |
371 |
|
372 |
return 0; |
373 |
diff --git a/nptl/pthread_attr_getstack.c b/nptl/pthread_attr_getstack.c |
374 |
index 3f4fd8d..4c1a098 100644 |
375 |
--- a/nptl/pthread_attr_getstack.c |
376 |
+++ b/nptl/pthread_attr_getstack.c |
377 |
@@ -32,7 +32,11 @@ __pthread_attr_getstack (attr, stackaddr, stacksize) |
378 |
iattr = (struct pthread_attr *) attr; |
379 |
|
380 |
/* Store the result. */ |
381 |
+#ifdef _STACK_GROWS_DOWN |
382 |
*stackaddr = (char *) iattr->stackaddr - iattr->stacksize; |
383 |
+#else |
384 |
+ *stackaddr = (char *) iattr->stackaddr; |
385 |
+#endif |
386 |
*stacksize = iattr->stacksize; |
387 |
|
388 |
return 0; |
389 |
diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c |
390 |
index 19a5b54..4785501 100644 |
391 |
--- a/nptl/pthread_attr_setstack.c |
392 |
+++ b/nptl/pthread_attr_setstack.c |
393 |
@@ -48,7 +48,11 @@ __pthread_attr_setstack (attr, stackaddr, stacksize) |
394 |
#endif |
395 |
|
396 |
iattr->stacksize = stacksize; |
397 |
+#if _STACK_GROWS_DOWN |
398 |
iattr->stackaddr = (char *) stackaddr + stacksize; |
399 |
+#else |
400 |
+ iattr->stackaddr = (char *) stackaddr; |
401 |
+#endif |
402 |
iattr->flags |= ATTR_FLAG_STACKADDR; |
403 |
|
404 |
return 0; |
405 |
@@ -81,7 +85,11 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, |
406 |
# endif |
407 |
|
408 |
iattr->stacksize = stacksize; |
409 |
+#if _STACK_GROWS_DOWN |
410 |
iattr->stackaddr = (char *) stackaddr + stacksize; |
411 |
+#else |
412 |
+ iattr->stackaddr = (char *) stackaddr; |
413 |
+#endif |
414 |
iattr->flags |= ATTR_FLAG_STACKADDR; |
415 |
|
416 |
return 0; |
417 |
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c |
418 |
index 9d7f52f..72945cb 100644 |
419 |
--- a/nptl/pthread_create.c |
420 |
+++ b/nptl/pthread_create.c |
421 |
@@ -401,13 +401,26 @@ start_thread (void *arg) |
422 |
#ifdef _STACK_GROWS_DOWN |
423 |
char *sp = CURRENT_STACK_FRAME; |
424 |
size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1; |
425 |
-#else |
426 |
-# error "to do" |
427 |
-#endif |
428 |
assert (freesize < pd->stackblock_size); |
429 |
if (freesize > PTHREAD_STACK_MIN) |
430 |
__madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED); |
431 |
- |
432 |
+#else |
433 |
+ /* Page aligned start of memory to free (higher than or equal |
434 |
+ to current sp plus the minimum stack size). */ |
435 |
+ void *freeblock = (void*)((size_t)(CURRENT_STACK_FRAME |
436 |
+ + PTHREAD_STACK_MIN |
437 |
+ + pagesize_m1) |
438 |
+ & ~pagesize_m1); |
439 |
+ char *free_end = (char *) (((uintptr_t) pd - pd->guardsize) & ~pagesize_m1); |
440 |
+ /* Is there any space to free? */ |
441 |
+ if (free_end > (char *)freeblock) |
442 |
+ { |
443 |
+ size_t freesize = (size_t)(free_end - (char *)freeblock); |
444 |
+ assert (freesize < pd->stackblock_size); |
445 |
+ __madvise (freeblock, freesize, MADV_DONTNEED); |
446 |
+ } |
447 |
+#endif |
448 |
+ |
449 |
/* If the thread is detached free the TCB. */ |
450 |
if (IS_DETACHED (pd)) |
451 |
/* Free the TCB. */ |
452 |
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c |
453 |
index e79f282..2ec2748 100644 |
454 |
--- a/nptl/pthread_getattr_np.c |
455 |
+++ b/nptl/pthread_getattr_np.c |
456 |
@@ -60,7 +60,11 @@ pthread_getattr_np (thread_id, attr) |
457 |
if (__builtin_expect (thread->stackblock != NULL, 1)) |
458 |
{ |
459 |
iattr->stacksize = thread->stackblock_size; |
460 |
+#ifdef _STACK_GROWS_DOWN |
461 |
iattr->stackaddr = (char *) thread->stackblock + iattr->stacksize; |
462 |
+#else |
463 |
+ iattr->stackaddr = (char *) thread->stackblock; |
464 |
+#endif |
465 |
} |
466 |
else |
467 |
{ |
468 |
@@ -129,12 +133,17 @@ pthread_getattr_np (thread_id, attr) |
469 |
stack extension request. */ |
470 |
iattr->stacksize = (iattr->stacksize |
471 |
& -(intptr_t) GLRO(dl_pagesize)); |
472 |
- |
473 |
+#if _STACK_GROWS_DOWN |
474 |
/* The limit might be too high. */ |
475 |
if ((size_t) iattr->stacksize |
476 |
> (size_t) iattr->stackaddr - last_to) |
477 |
iattr->stacksize = (size_t) iattr->stackaddr - last_to; |
478 |
- |
479 |
+#else |
480 |
+ /* The limit might be too high. */ |
481 |
+ if ((size_t) iattr->stacksize |
482 |
+ > to - (size_t) iattr->stackaddr) |
483 |
+ iattr->stacksize = to - (size_t) iattr->stackaddr; |
484 |
+#endif |
485 |
/* We succeed and no need to look further. */ |
486 |
ret = 0; |
487 |
break; |
488 |
-- |
489 |
1.8.5.4 |
490 |
|
491 |
|
492 |
|
493 |
|
494 |
1.1 src/patchsets/glibc/2.19/00_all_0007-rtld-do-not-ignore-arch-specific-CFLAGS.patch |
495 |
|
496 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0007-rtld-do-not-ignore-arch-specific-CFLAGS.patch?rev=1.1&view=markup |
497 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0007-rtld-do-not-ignore-arch-specific-CFLAGS.patch?rev=1.1&content-type=text/plain |
498 |
|
499 |
Index: 00_all_0007-rtld-do-not-ignore-arch-specific-CFLAGS.patch |
500 |
=================================================================== |
501 |
From 2a6098d40483e825eebc18f74203b0b1d1c6e6c8 Mon Sep 17 00:00:00 2001 |
502 |
From: Guy Martin <gmsoft@×××××××××.be> |
503 |
Date: Fri, 16 Aug 2013 15:00:05 -0400 |
504 |
Subject: [PATCH 07/11] rtld: do not ignore arch-specific CFLAGS |
505 |
|
506 |
https://bugs.gentoo.org/452184 |
507 |
http://sourceware.org/bugzilla/show_bug.cgi?id=15005 |
508 |
http://sourceware.org/ml/libc-alpha/2013-01/msg00247.html |
509 |
--- |
510 |
elf/Makefile | 2 +- |
511 |
1 file changed, 1 insertion(+), 1 deletion(-) |
512 |
|
513 |
diff --git a/elf/Makefile b/elf/Makefile |
514 |
index 4c58fc9..56900d2 100644 |
515 |
--- a/elf/Makefile |
516 |
+++ b/elf/Makefile |
517 |
@@ -421,7 +421,7 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ |
518 |
-D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 |
519 |
CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) |
520 |
CFLAGS-cache.c = $(SYSCONF-FLAGS) |
521 |
-CFLAGS-rtld.c = $(SYSCONF-FLAGS) |
522 |
+CFLAGS-rtld.c += $(SYSCONF-FLAGS) |
523 |
|
524 |
CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ |
525 |
-DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld) |
526 |
-- |
527 |
1.8.5.4 |
528 |
|
529 |
|
530 |
|
531 |
|
532 |
1.1 src/patchsets/glibc/2.19/00_all_0008-nptl-handle-EAGAIN-with-some-futex-operations.patch |
533 |
|
534 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0008-nptl-handle-EAGAIN-with-some-futex-operations.patch?rev=1.1&view=markup |
535 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0008-nptl-handle-EAGAIN-with-some-futex-operations.patch?rev=1.1&content-type=text/plain |
536 |
|
537 |
Index: 00_all_0008-nptl-handle-EAGAIN-with-some-futex-operations.patch |
538 |
=================================================================== |
539 |
From 8f1bdcb971a624a08796dae3ad01a9eb7552ba24 Mon Sep 17 00:00:00 2001 |
540 |
From: Carlos O'Donell <carlos@××××××××××××.org> |
541 |
Date: Fri, 16 Aug 2013 15:00:53 -0400 |
542 |
Subject: [PATCH 08/11] nptl: handle EAGAIN with some futex operations |
543 |
|
544 |
https://bugs.gentoo.org/452184 |
545 |
--- |
546 |
nptl/pthread_mutex_trylock.c | 3 ++- |
547 |
nptl/sysdeps/unix/sysv/linux/sem_timedwait.c | 2 +- |
548 |
nptl/sysdeps/unix/sysv/linux/sem_wait.c | 4 ++-- |
549 |
3 files changed, 5 insertions(+), 4 deletions(-) |
550 |
|
551 |
diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c |
552 |
index 4d5f75d..4bf19ec 100644 |
553 |
--- a/nptl/pthread_mutex_trylock.c |
554 |
+++ b/nptl/pthread_mutex_trylock.c |
555 |
@@ -260,7 +260,8 @@ __pthread_mutex_trylock (mutex) |
556 |
private), 0, 0); |
557 |
|
558 |
if (INTERNAL_SYSCALL_ERROR_P (e, __err) |
559 |
- && INTERNAL_SYSCALL_ERRNO (e, __err) == EWOULDBLOCK) |
560 |
+ && ((INTERNAL_SYSCALL_ERRNO (e, __err) == EWOULDBLOCK) |
561 |
+ || (INTERNAL_SYSCALL_ERRNO (e, __err) == EAGAIN))) |
562 |
{ |
563 |
THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL); |
564 |
|
565 |
diff --git a/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c b/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c |
566 |
index 7dfe51d..f96f625 100644 |
567 |
--- a/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c |
568 |
+++ b/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c |
569 |
@@ -94,7 +94,7 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime) |
570 |
rt.tv_sec = sec; |
571 |
rt.tv_nsec = nsec; |
572 |
err = do_futex_timed_wait(isem, &rt); |
573 |
- if (err != 0 && err != -EWOULDBLOCK) |
574 |
+ if (err != 0 && err != -EWOULDBLOCK && err != -EAGAIN) |
575 |
{ |
576 |
__set_errno (-err); |
577 |
err = -1; |
578 |
diff --git a/nptl/sysdeps/unix/sysv/linux/sem_wait.c b/nptl/sysdeps/unix/sysv/linux/sem_wait.c |
579 |
index 7d586cf..6f2a89f 100644 |
580 |
--- a/nptl/sysdeps/unix/sysv/linux/sem_wait.c |
581 |
+++ b/nptl/sysdeps/unix/sysv/linux/sem_wait.c |
582 |
@@ -67,7 +67,7 @@ __new_sem_wait (sem_t *sem) |
583 |
while (1) |
584 |
{ |
585 |
err = do_futex_wait(isem); |
586 |
- if (err != 0 && err != -EWOULDBLOCK) |
587 |
+ if (err != 0 && err != -EWOULDBLOCK && err != -EAGAIN) |
588 |
{ |
589 |
__set_errno (-err); |
590 |
err = -1; |
591 |
@@ -112,7 +112,7 @@ __old_sem_wait (sem_t *sem) |
592 |
/* Disable asynchronous cancellation. */ |
593 |
__pthread_disable_asynccancel (oldtype); |
594 |
} |
595 |
- while (err == 0 || err == -EWOULDBLOCK); |
596 |
+ while (err == 0 || err == -EWOULDBLOCK || err == -EAGAIN); |
597 |
|
598 |
__set_errno (-err); |
599 |
return -1; |
600 |
-- |
601 |
1.8.5.4 |
602 |
|
603 |
|
604 |
|
605 |
|
606 |
1.1 src/patchsets/glibc/2.19/00_all_0009-gentoo-support-running-tests-under-sandbox.patch |
607 |
|
608 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0009-gentoo-support-running-tests-under-sandbox.patch?rev=1.1&view=markup |
609 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0009-gentoo-support-running-tests-under-sandbox.patch?rev=1.1&content-type=text/plain |
610 |
|
611 |
Index: 00_all_0009-gentoo-support-running-tests-under-sandbox.patch |
612 |
=================================================================== |
613 |
From 6d981a99c35fbbfdf90ff188c5dd6d1ac46b9353 Mon Sep 17 00:00:00 2001 |
614 |
From: "Stephanie J. Lockwood-Childs" <wormo@g.o> |
615 |
Date: Fri, 16 Aug 2013 15:03:41 -0400 |
616 |
Subject: [PATCH 09/11] gentoo: support running tests under sandbox |
617 |
|
618 |
when glibc runs its tests, it does so by invoking the local library loader. |
619 |
in Gentoo, we build/run inside of our "sandbox" which itself is linked against |
620 |
libdl (so that it can load libraries and pull out symbols). the trouble |
621 |
is that when you upgrade from an older glibc to the new one, often times |
622 |
internal symbols change name or abi. this is normally OK as you cannot use |
623 |
libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so |
624 |
we always say "keep all of the glibc libraries from the same build". but |
625 |
when glibc runs its tests, it uses dynamic paths to point to its new local |
626 |
copies of libraries. if the test doesnt use libdl, then glibc doesnt add |
627 |
its path, and when sandbox triggers the loading of libdl, glibc does so |
628 |
from the host system system. this gets us into the case of all libraries |
629 |
are from the locally compiled version of glibc except for libdl.so. |
630 |
|
631 |
http://bugs.gentoo.org/56898 |
632 |
--- |
633 |
Makeconfig | 2 +- |
634 |
iconvdata/run-iconv-test.sh | 2 +- |
635 |
nptl/tst-tls6.sh | 2 +- |
636 |
3 files changed, 3 insertions(+), 3 deletions(-) |
637 |
|
638 |
diff --git a/Makeconfig b/Makeconfig |
639 |
index 1908f27..d3f6023 100644 |
640 |
--- a/Makeconfig |
641 |
+++ b/Makeconfig |
642 |
@@ -612,7 +612,7 @@ comma = , |
643 |
sysdep-library-path = \ |
644 |
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\ |
645 |
$(filter -Wl$(comma)-rpath-link=%,\ |
646 |
- $(sysdep-LDFLAGS))))) |
647 |
+ $(sysdep-LDFLAGS)))) $(common-objpfx)/dlfcn) |
648 |
# $(run-via-rtld-prefix) is a command that, when prepended to the name |
649 |
# of a program built with the newly built library, produces a command |
650 |
# that, executed on the host for which the library is built, runs that |
651 |
diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh |
652 |
index e23f60d..b722415 100755 |
653 |
--- a/iconvdata/run-iconv-test.sh |
654 |
+++ b/iconvdata/run-iconv-test.sh |
655 |
@@ -35,7 +35,7 @@ GCONV_PATH=$codir/iconvdata |
656 |
export GCONV_PATH |
657 |
|
658 |
# We have to have some directories in the library path. |
659 |
-LIBPATH=$codir:$codir/iconvdata |
660 |
+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn |
661 |
|
662 |
# How the start the iconv(1) program. |
663 |
ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \ |
664 |
diff --git a/nptl/tst-tls6.sh b/nptl/tst-tls6.sh |
665 |
index 5a897fe..ba47568 100755 |
666 |
--- a/nptl/tst-tls6.sh |
667 |
+++ b/nptl/tst-tls6.sh |
668 |
@@ -25,7 +25,7 @@ test_wrapper_env=$1; shift |
669 |
logfile=$common_objpfx/nptl/tst-tls6.out |
670 |
|
671 |
# We have to find libc and nptl |
672 |
-library_path=${common_objpfx}:${common_objpfx}nptl |
673 |
+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn |
674 |
tst_tls5="${test_via_rtld_prefix} ${common_objpfx}/nptl/tst-tls5" |
675 |
|
676 |
LC_ALL=C |
677 |
-- |
678 |
1.8.5.4 |
679 |
|
680 |
|
681 |
|
682 |
|
683 |
1.1 src/patchsets/glibc/2.19/00_all_0010-gentoo-disable-building-in-timezone-subdir.patch |
684 |
|
685 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0010-gentoo-disable-building-in-timezone-subdir.patch?rev=1.1&view=markup |
686 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0010-gentoo-disable-building-in-timezone-subdir.patch?rev=1.1&content-type=text/plain |
687 |
|
688 |
Index: 00_all_0010-gentoo-disable-building-in-timezone-subdir.patch |
689 |
=================================================================== |
690 |
From b4edac208dde06c49553aaec6ec877b52b7c4649 Mon Sep 17 00:00:00 2001 |
691 |
From: Mike Frysinger <vapier@g.o> |
692 |
Date: Fri, 16 Aug 2013 15:05:26 -0400 |
693 |
Subject: [PATCH 10/11] gentoo: disable building in timezone subdir |
694 |
|
695 |
We've split this out into the package sys-libs/timezone-data |
696 |
--- |
697 |
Makeconfig | 2 +- |
698 |
1 file changed, 1 insertion(+), 1 deletion(-) |
699 |
|
700 |
diff --git a/Makeconfig b/Makeconfig |
701 |
index d3f6023..ea4d2f1 100644 |
702 |
--- a/Makeconfig |
703 |
+++ b/Makeconfig |
704 |
@@ -1032,7 +1032,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ |
705 |
stdlib stdio-common libio malloc string wcsmbs time dirent \ |
706 |
grp pwd posix io termios resource misc socket sysvipc gmon \ |
707 |
gnulib iconv iconvdata wctype manual shadow gshadow po argp \ |
708 |
- crypt localedata timezone rt conform debug \ |
709 |
+ crypt localedata rt conform debug \ |
710 |
$(add-on-subdirs) dlfcn elf |
711 |
|
712 |
ifndef avoid-generated |
713 |
-- |
714 |
1.8.5.4 |
715 |
|
716 |
|
717 |
|
718 |
|
719 |
1.1 src/patchsets/glibc/2.19/00_all_0011-arm-fix-PIC-vs-SHARED-typos.patch |
720 |
|
721 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0011-arm-fix-PIC-vs-SHARED-typos.patch?rev=1.1&view=markup |
722 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0011-arm-fix-PIC-vs-SHARED-typos.patch?rev=1.1&content-type=text/plain |
723 |
|
724 |
Index: 00_all_0011-arm-fix-PIC-vs-SHARED-typos.patch |
725 |
=================================================================== |
726 |
From b76e856d84e14d5ece6988fee589aff26d6ac2f2 Mon Sep 17 00:00:00 2001 |
727 |
From: David Lamparter <equinox-gentoo@××××××.net> |
728 |
Date: Fri, 16 Aug 2013 15:06:34 -0400 |
729 |
Subject: [PATCH 11/11] arm: fix PIC vs SHARED typos |
730 |
|
731 |
the logic in setjmp/__longjmp incorrectly tie to "PIC" to figure out |
732 |
whether the code is going into a shared library when it should be using |
733 |
"SHARED". otherwise, building static PIC code goes wrong. |
734 |
|
735 |
https://bugs.gentoo.org/336914 |
736 |
http://sourceware.org/ml/libc-ports/2011-09/msg00018.html |
737 |
|
738 |
2011-09-19 David Lamparter <equinox-gentoo@××××××.net> |
739 |
|
740 |
* sysdeps/arm/eabi/setjmp.S: Change PIC to SHARED. |
741 |
* sysdeps/arm/eabi/__longjmp.S: Likewise |
742 |
--- |
743 |
ports/sysdeps/arm/__longjmp.S | 4 ++-- |
744 |
ports/sysdeps/arm/setjmp.S | 4 ++-- |
745 |
2 files changed, 4 insertions(+), 4 deletions(-) |
746 |
|
747 |
diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S |
748 |
index 27c57a1..c2efe12 100644 |
749 |
--- a/ports/sysdeps/arm/__longjmp.S |
750 |
+++ b/ports/sysdeps/arm/__longjmp.S |
751 |
@@ -73,7 +73,7 @@ ENTRY (__longjmp) |
752 |
add a2, a2, a3 |
753 |
ldr a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] |
754 |
# else |
755 |
-# ifdef PIC |
756 |
+# ifdef SHARED |
757 |
ldr a2, 1f |
758 |
ldr a3, .Lrtld_global_ro |
759 |
0: add a2, pc, a2 |
760 |
@@ -126,7 +126,7 @@ ENTRY (__longjmp) |
761 |
.Lrtld_local_ro: |
762 |
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) |
763 |
# else |
764 |
-# ifdef PIC |
765 |
+# ifdef SHARED |
766 |
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS |
767 |
.Lrtld_global_ro: |
768 |
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT) |
769 |
diff --git a/ports/sysdeps/arm/setjmp.S b/ports/sysdeps/arm/setjmp.S |
770 |
index b0b45ed..54e5de4 100644 |
771 |
--- a/ports/sysdeps/arm/setjmp.S |
772 |
+++ b/ports/sysdeps/arm/setjmp.S |
773 |
@@ -54,7 +54,7 @@ ENTRY (__sigsetjmp) |
774 |
add a3, a3, a4 |
775 |
ldr a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] |
776 |
# else |
777 |
-# ifdef PIC |
778 |
+# ifdef SHARED |
779 |
ldr a3, 1f |
780 |
ldr a4, .Lrtld_global_ro |
781 |
0: add a3, pc, a3 |
782 |
@@ -110,7 +110,7 @@ ENTRY (__sigsetjmp) |
783 |
.Lrtld_local_ro: |
784 |
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF) |
785 |
# else |
786 |
-# ifdef PIC |
787 |
+# ifdef SHARED |
788 |
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS |
789 |
.Lrtld_global_ro: |
790 |
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT) |
791 |
-- |
792 |
1.8.5.4 |
793 |
|
794 |
|
795 |
|
796 |
|
797 |
1.1 src/patchsets/glibc/2.19/README.history |
798 |
|
799 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/README.history?rev=1.1&view=markup |
800 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/README.history?rev=1.1&content-type=text/plain |
801 |
|
802 |
Index: README.history |
803 |
=================================================================== |
804 |
1 08 Feb 2014 |
805 |
+ 00_all_0001-disable-ldconfig-during-install.patch |
806 |
+ 00_all_0002-workaround-crash-when-handling-signals-in-static-PIE.patch |
807 |
+ 00_all_0003-make-fortify-logic-checks-less-angry.patch |
808 |
+ 00_all_0004-Fix-localedef-segfault-when-run-under-exec-shield-Pa.patch |
809 |
+ 00_all_0005-reload-etc-resolv.conf-when-it-has-changed.patch |
810 |
+ 00_all_0006-nptl-support-thread-stacks-that-grow-up.patch |
811 |
+ 00_all_0007-rtld-do-not-ignore-arch-specific-CFLAGS.patch |
812 |
+ 00_all_0008-nptl-handle-EAGAIN-with-some-futex-operations.patch |
813 |
+ 00_all_0009-gentoo-support-running-tests-under-sandbox.patch |
814 |
+ 00_all_0010-gentoo-disable-building-in-timezone-subdir.patch |
815 |
+ 00_all_0011-arm-fix-PIC-vs-SHARED-typos.patch |