Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/glibc/2.16.0: 0020_all_glibc-tweak-rfc1918-lookup.patch 0052_all_glibc-2.14-resolv-hp-assert.patch 0068_all_glibc-2.16-glibc-revert-fseek-on-fclose.patch 0070_all_glibc-2.16-sunrpc-bootstrap.patch 0080_all_glibc-2.16-revert-x86_64-eagain-pthread_cond_wait.patch 0085_all_glibc-disable-ldconfig.patch 1005_all_glibc-sigaction.patch 1008_all_glibc-2.16-fortify.patch 1030_all_glibc-manual-no-perl.patch 1040_all_2.3.3-localedef-fix-trampoline.patch 1055_all_glibc-resolv-dynamic.patch 1070_all_glibc-fadvise64_64.patch 1095_all_glibc-2.14-assume-pipe2-dup3.patch 1503_hppa_glibc-2.7-hppa-nptl-carlos.patch 1505_hppa_glibc-2.11-hppa-nptl.patch 1506_all_hppa-prlimit64.patch 1530_all_glibc-m68k-sys-user.patch 3000_all_2.3.6-dl_execstack-PaX-support.patch 3010_all_2.3.3_pre20040117-pt_pax.patch 3020_all_glibc-tests-sandbox-libdl-paths.patch 5063_all_glibc-dont-build-timezone.patch 6022_alpha_alpha-add-fdatasync-support.patch 6120_all _ppc-glibc-2.9-at omic.patch 6230_all_arm-glibc-hardened.patch 6250_all_glibc-2.14-arm-unaligned-reloc.patch 6305_all_glibc-2.11-s390-older-binutils.patch 6600_mips_librt-mips.patch 6605_all_glibc-2.4-fpu-cw-mips.patch README.history
Date: Tue, 03 Jul 2012 20:06:22
Message-Id: 20120703200610.633872004B@flycatcher.gentoo.org
1 vapier 12/07/03 20:06:10
2
3 Added: 0020_all_glibc-tweak-rfc1918-lookup.patch
4 0052_all_glibc-2.14-resolv-hp-assert.patch
5 0068_all_glibc-2.16-glibc-revert-fseek-on-fclose.patch
6 0070_all_glibc-2.16-sunrpc-bootstrap.patch
7 0080_all_glibc-2.16-revert-x86_64-eagain-pthread_cond_wait.patch
8 0085_all_glibc-disable-ldconfig.patch
9 1005_all_glibc-sigaction.patch
10 1008_all_glibc-2.16-fortify.patch
11 1030_all_glibc-manual-no-perl.patch
12 1040_all_2.3.3-localedef-fix-trampoline.patch
13 1055_all_glibc-resolv-dynamic.patch
14 1070_all_glibc-fadvise64_64.patch
15 1095_all_glibc-2.14-assume-pipe2-dup3.patch
16 1503_hppa_glibc-2.7-hppa-nptl-carlos.patch
17 1505_hppa_glibc-2.11-hppa-nptl.patch
18 1506_all_hppa-prlimit64.patch
19 1530_all_glibc-m68k-sys-user.patch
20 3000_all_2.3.6-dl_execstack-PaX-support.patch
21 3010_all_2.3.3_pre20040117-pt_pax.patch
22 3020_all_glibc-tests-sandbox-libdl-paths.patch
23 5063_all_glibc-dont-build-timezone.patch
24 6022_alpha_alpha-add-fdatasync-support.patch
25 6120_all_ppc-glibc-2.9-atomic.patch
26 6230_all_arm-glibc-hardened.patch
27 6250_all_glibc-2.14-arm-unaligned-reloc.patch
28 6305_all_glibc-2.11-s390-older-binutils.patch
29 6600_mips_librt-mips.patch
30 6605_all_glibc-2.4-fpu-cw-mips.patch README.history
31 Log:
32 initial 2.16.0 patchset based on last 2.15 patchset
33
34 Revision Changes Path
35 1.1 src/patchsets/glibc/2.16.0/0020_all_glibc-tweak-rfc1918-lookup.patch
36
37 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0020_all_glibc-tweak-rfc1918-lookup.patch?rev=1.1&view=markup
38 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0020_all_glibc-tweak-rfc1918-lookup.patch?rev=1.1&content-type=text/plain
39
40 Index: 0020_all_glibc-tweak-rfc1918-lookup.patch
41 ===================================================================
42 http://bugs.gentoo.org/315977
43
44 diff --git a/posix/gai.conf b/posix/gai.conf
45 index 195287e..efba67b 100644
46 --- a/posix/gai.conf
47 +++ b/posix/gai.conf
48 @@ -56,9 +56,7 @@
49 #
50 # scopev4 <mask> <value>
51 # Add another rule to the RFC 3484 scope table for IPv4 addresses.
52 -# By default the scope IDs described in section 3.2 in RFC 3484 are
53 -# used. Changing these defaults should hardly ever be necessary.
54 -# The defaults are equivalent to:
55 +# The definitions in RFC 3484 are equivalent to:
56 #
57 #scopev4 ::ffff:169.254.0.0/112 2
58 #scopev4 ::ffff:127.0.0.0/104 2
59 @@ -72,6 +70,6 @@
60 # have the same scope and are therefore not sorted first. To change
61 # this use only these rules:
62 #
63 -#scopev4 ::ffff:169.254.0.0/112 2
64 -#scopev4 ::ffff:127.0.0.0/104 2
65 -#scopev4 ::ffff:0.0.0.0/96 14
66 +scopev4 ::ffff:169.254.0.0/112 2
67 +scopev4 ::ffff:127.0.0.0/104 2
68 +scopev4 ::ffff:0.0.0.0/96 14
69
70
71
72 1.1 src/patchsets/glibc/2.16.0/0052_all_glibc-2.14-resolv-hp-assert.patch
73
74 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0052_all_glibc-2.14-resolv-hp-assert.patch?rev=1.1&view=markup
75 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0052_all_glibc-2.14-resolv-hp-assert.patch?rev=1.1&content-type=text/plain
76
77 Index: 0052_all_glibc-2.14-resolv-hp-assert.patch
78 ===================================================================
79 https://bugs.gentoo.org/391673
80 http://sourceware.org/bugzilla/show_bug.cgi?id=13013
81
82 2011-07-21 Aurelien Jarno <aurel32@××××××.org>
83
84 * resolv/res_query.c(__libc_res_nquery): Assign hp and hp2
85 depending n and resplen2 to catch cases where answer
86 equals answerp2.
87
88 diff --git a/resolv/res_query.c b/resolv/res_query.c
89 index 2f7cfaa..405fa68 100644
90 --- a/resolv/res_query.c
91 +++ b/resolv/res_query.c
92 @@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp,
93 int *resplen2)
94 {
95 HEADER *hp = (HEADER *) answer;
96 + HEADER *hp2;
97 int n, use_malloc = 0;
98 u_int oflags = statp->_flags;
99
100 @@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp,
101 /* __libc_res_nsend might have reallocated the buffer. */
102 hp = (HEADER *) *answerp;
103
104 - /* We simplify the following tests by assigning HP to HP2. It
105 - is easy to verify that this is the same as ignoring all
106 - tests of HP2. */
107 - HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp;
108 -
109 - if (n < (int) sizeof (HEADER) && answerp2 != NULL
110 - && *resplen2 > (int) sizeof (HEADER))
111 + /* We simplify the following tests by assigning HP to HP2 or
112 + vice versa. It is easy to verify that this is the same as
113 + ignoring all tests of HP or HP2. */
114 + if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER))
115 {
116 - /* Special case of partial answer. */
117 - assert (hp != hp2);
118 - hp = hp2;
119 + hp2 = hp;
120 }
121 - else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER)
122 - && n > (int) sizeof (HEADER))
123 + else
124 {
125 - /* Special case of partial answer. */
126 - assert (hp != hp2);
127 - hp2 = hp;
128 + hp2 = (HEADER *) *answerp2;
129 + if (n < (int) sizeof (HEADER))
130 + {
131 + hp = hp2;
132 + }
133 }
134
135 + /* Make sure both hp and hp2 are defined */
136 + assert((hp != NULL) && (hp2 != NULL));
137 +
138 if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
139 && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) {
140 #ifdef DEBUG
141
142
143
144 1.1 src/patchsets/glibc/2.16.0/0068_all_glibc-2.16-glibc-revert-fseek-on-fclose.patch
145
146 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0068_all_glibc-2.16-glibc-revert-fseek-on-fclose.patch?rev=1.1&view=markup
147 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0068_all_glibc-2.16-glibc-revert-fseek-on-fclose.patch?rev=1.1&content-type=text/plain
148
149 Index: 0068_all_glibc-2.16-glibc-revert-fseek-on-fclose.patch
150 ===================================================================
151 https://bugs.gentoo.org/370413
152 http://sourceware.org/bugzilla/show_bug.cgi?id=12724
153 https://bugzilla.novell.com/show_bug.cgi?id=711829
154 http://redmine.ruby-lang.org/issues/5108
155
156 This reverts the following patch from upstream PR 12724,
157 which can cause surprising changes in fclose behaviour when multiple
158 file handles refer to the same file (fclose on one changes file position
159 on the other).
160 See bnc #711829.
161
162 git diff -R 'fcabc0f8b185f9e0a9289720be5ede6c39b3bf21^!'
163
164 2011-05-13 Ulrich Drepper <drepper@×××××.com>
165
166 [BZ #12724]
167 * libio/fileops.c (_IO_new_file_close_it): Always flush when
168 currently writing and seek to current position when not.
169 * libio/Makefile (tests): Add bug-fclose1.
170 * libio/bug-fclose1.c: New file.
171
172 2011-05-12 Ulrich Drepper <drepper@×××××.com>
173
174 [BZ #12511]
175 diff --git b/libio/Makefile a/libio/Makefile
176 index ec30904..83b9458 100644
177 --- b/libio/Makefile
178 +++ a/libio/Makefile
179 @@ -58,7 +58,7 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
180 tst-memstream1 tst-memstream2 \
181 tst-wmemstream1 tst-wmemstream2 \
182 bug-memstream1 bug-wmemstream1 \
183 - tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos bug-fclose1
184 + tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos
185 test-srcs = test-freopen
186
187 all: # Make this the default target; it will be defined in Rules.
188 diff --git b/libio/bug-fclose1.c a/libio/bug-fclose1.c
189 deleted file mode 100644
190 index f1e09f5..0000000
191 --- b/libio/bug-fclose1.c
192 +++ /dev/null
193 @@ -1,132 +0,0 @@
194 -// BZ #12724
195 -
196 -static void do_prepare (void);
197 -#define PREPARE(argc, argv) do_prepare ()
198 -static int do_test (void);
199 -#define TEST_FUNCTION do_test()
200 -#include "../test-skeleton.c"
201 -
202 -
203 -static int fd;
204 -
205 -
206 -static void
207 -do_prepare (void)
208 -{
209 - fd = create_temp_file ("bug-fclose1.", NULL);
210 - if (fd == -1)
211 - {
212 - printf ("cannot create temporary file: %m\n");
213 - exit (1);
214 - }
215 -}
216 -
217 -
218 -static int
219 -do_test (void)
220 -{
221 - static const char pattern[] = "hello world";
222 -
223 - /* Prepare a seekable file. */
224 - if (write (fd, pattern, sizeof pattern) != sizeof pattern)
225 - {
226 - printf ("cannot write pattern: %m\n");
227 - return 1;
228 - }
229 - if (lseek (fd, 1, SEEK_SET) != 1)
230 - {
231 - printf ("cannot seek after write: %m\n");
232 - return 1;
233 - }
234 -
235 - /* Create an output stream visiting the file; when it is closed, all
236 - other file descriptors visiting the file must see the new file
237 - position. */
238 - int fd2 = dup (fd);
239 - if (fd2 < 0)
240 - {
241 - printf ("cannot duplicate descriptor for writing: %m\n");
242 - return 1;
243 - }
244 - FILE *f = fdopen (fd2, "w");
245 - if (f == NULL)
246 - {
247 - printf ("first fdopen failed: %m\n");
248 - return 1;
249 - }
250 - if (fputc (pattern[1], f) != pattern[1])
251 - {
252 - printf ("fputc failed: %m\n");
253 - return 1;
254 - }
255 - if (fclose (f) != 0)
256 - {
257 - printf ("first fclose failed: %m\n");
258 - return 1;
259 - }
260 - errno = 0;
261 - if (lseek (fd2, 0, SEEK_CUR) != -1)
262 - {
263 - printf ("lseek after fclose after write did not fail\n");
264 - return 1;
265 - }
266 - if (errno != EBADF)
267 - {
268 - printf ("lseek after fclose after write did not fail with EBADF: %m\n");
269 - return 1;
270 - }
271 - off_t o = lseek (fd, 0, SEEK_CUR);
272 - if (o != 2)
273 - {
274 - printf ("\
275 -lseek on original descriptor after first fclose returned %ld, expected 2\n",
276 - (long int) o);
277 - return 1;
278 - }
279 -
280 - /* Likewise for an input stream. */
281 - fd2 = dup (fd);
282 - if (fd2 < 0)
283 - {
284 - printf ("cannot duplicate descriptor for reading: %m\n");
285 - return 1;
286 - }
287 - f = fdopen (fd2, "r");
288 - if (f == NULL)
289 - {
290 - printf ("second fdopen failed: %m\n");
291 - return 1;
292 - }
293 - char c = fgetc (f);
294 - if (c != pattern[2])
295 - {
296 - printf ("getc returned %c, expected %c\n", c, pattern[2]);
297 - return 1;
298 - }
299 - if (fclose (f) != 0)
300 - {
301 - printf ("second fclose failed: %m\n");
302 - return 1;
303 - }
304 - errno = 0;
305 - if (lseek (fd2, 0, SEEK_CUR) != -1)
306 - {
307 - printf ("lseek after fclose after read did not fail\n");
308 - return 1;
309 - }
310 - if (errno != EBADF)
311 - {
312 - printf ("lseek after fclose after read did not fail with EBADF: %m\n");
313 - return 1;
314 - }
315 - o = lseek (fd, 0, SEEK_CUR);
316 - if (o != 3)
317 - {
318 - printf ("\
319 -lseek on original descriptor after second fclose returned %ld, expected 3\n",
320 - (long int) o);
321 - return 1;
322 - }
323 -
324 - return 0;
325 -}
326 Index: glibc-2.14/libio/fileops.c
327 ===================================================================
328 --- glibc-2.14.orig/libio/fileops.c
329 +++ glibc-2.14/libio/fileops.c
330 @@ -160,21 +160,13 @@ int
331 _IO_new_file_close_it (fp)
332 _IO_FILE *fp;
333 {
334 + int write_status;
335 if (!_IO_file_is_open (fp))
336 return EOF;
337
338 - int write_status;
339 - if (_IO_in_put_mode (fp))
340 + if ((fp->_flags & _IO_NO_WRITES) == 0
341 + && (fp->_flags & _IO_CURRENTLY_PUTTING) != 0)
342 write_status = _IO_do_flush (fp);
343 - else if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
344 - && !_IO_in_backup (fp))
345 - {
346 - off64_t o = _IO_SEEKOFF (fp, 0, _IO_seek_cur, 0);
347 - if (o == WEOF)
348 - write_status = EOF;
349 - else
350 - write_status = _IO_SYSSEEK (fp, o, SEEK_SET) < 0 ? EOF : 0;
351 - }
352 else
353 write_status = 0;
354
355
356
357
358 1.1 src/patchsets/glibc/2.16.0/0070_all_glibc-2.16-sunrpc-bootstrap.patch
359
360 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0070_all_glibc-2.16-sunrpc-bootstrap.patch?rev=1.1&view=markup
361 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0070_all_glibc-2.16-sunrpc-bootstrap.patch?rev=1.1&content-type=text/plain
362
363 Index: 0070_all_glibc-2.16-sunrpc-bootstrap.patch
364 ===================================================================
365 From 4d7d27be3006994e81b3312d0d9196c64c25a162 Mon Sep 17 00:00:00 2001
366 From: Mike Frysinger <vapier@g.o>
367 Date: Tue, 3 Jul 2012 15:22:05 -0400
368 Subject: [PATCH] sunrpc: fix rpc bootstrap builds
369
370 If you build & install glibc w/rpc disabled, you no longer have headers in
371 /usr/include/rpc/ (this is expected). But if you try to build glibc w/rpc
372 enabled, this gets into a bad state due to the new rpc helpers that get
373 cross-compiled:
374
375 $ make
376 ...
377 x86_64-pc-linux-gnu-gcc -m32 -D_RPC_THREAD_SAFE_ -D_GNU_SOURCE -DIS_IN_build \
378 -include $objdir/config.h rpc_clntout.c -o $objdir/sunrpc/cross-rpc_clntout.o \
379 -MMD -MP -MF $objdir/sunrpc/cross-rpc_clntout.o.dt -MT $objdir/sunrpc/cross-rpc_clntout.o -c
380 rpc_clntout.c:34:23: fatal error: rpc/types.h: No such file or directory
381 compilation terminated.
382 make: *** [$objdir/sunrpc/cross-rpc_clntout.o] Error 1
383
384 Signed-off-by: Mike Frysinger <vapier@g.o>
385
386 2012-07-03 Mike Frysinger <vapier@g.o>
387
388 * sunrpc/rpc_clntout.c: Change <rpc/types.h> to "rpc/types.h".
389 ---
390 sunrpc/rpc_clntout.c | 2 +-
391 1 file changed, 1 insertion(+), 1 deletion(-)
392
393 diff --git a/sunrpc/rpc_clntout.c b/sunrpc/rpc_clntout.c
394 index ec040c7..ce4d2a4 100644
395 --- a/sunrpc/rpc_clntout.c
396 +++ b/sunrpc/rpc_clntout.c
397 @@ -31,7 +31,7 @@
398 */
399 #include <stdio.h>
400 #include <string.h>
401 -#include <rpc/types.h>
402 +#include "rpc/types.h"
403 #include "rpc_parse.h"
404 #include "rpc_util.h"
405 #include "proto.h"
406 --
407 1.7.9.7
408
409
410
411
412 1.1 src/patchsets/glibc/2.16.0/0080_all_glibc-2.16-revert-x86_64-eagain-pthread_cond_wait.patch
413
414 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0080_all_glibc-2.16-revert-x86_64-eagain-pthread_cond_wait.patch?rev=1.1&view=markup
415 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0080_all_glibc-2.16-revert-x86_64-eagain-pthread_cond_wait.patch?rev=1.1&content-type=text/plain
416
417 Index: 0080_all_glibc-2.16-revert-x86_64-eagain-pthread_cond_wait.patch
418 ===================================================================
419 http://sourceware.org/ml/libc-alpha/2012-01/msg00002.html
420
421 The following patch:
422 Has been reported as causing numerous problems in Fedora & Debian. I
423 don't think anyone has done any serious analysis of the issue, but the
424 patch has been pulled from both distributions because of the
425 instability it's introduced.
426
427 https://bugzilla.redhat.com/show_bug.cgi?id=769421
428 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651899
429
430
431 commit c5a0802a682dba23f92d47f0f99775aebfbe2539
432 Author: Andreas Schwab <schwab@××××××.com>
433 Date: Mon Nov 28 13:38:19 2011 +0100
434
435 Handle EAGAIN from FUTEX_WAIT_REQUEUE_PI
436
437 2011-11-28 Andreas Schwab <schwab@××××××.com>
438
439 * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Handle
440 EAGAIN from FUTEX_WAIT_REQUEUE_PI.
441 * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
442
443 diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
444 index 54590b7..53970d7 100644
445 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
446 +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
447 @@ -134,7 +134,6 @@ __pthread_cond_wait:
448 cmpl $PI_BIT, %eax
449 jne 18f
450
451 -90:
452 movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
453 movl %ebp, %edx
454 xorl %esi, %esi
455 @@ -148,9 +147,6 @@ __pthread_cond_wait:
456 sete 16(%esp)
457 je 19f
458
459 - cmpl $-EAGAIN, %eax
460 - je 91f
461 -
462 /* Normal and PI futexes dont mix. Use normal futex functions only
463 if the kernel does not support the PI futex functions. */
464 cmpl $-ENOSYS, %eax
465 @@ -395,78 +391,6 @@ __pthread_cond_wait:
466 #endif
467 call __lll_unlock_wake
468 jmp 11b
469 -
470 -91:
471 -.LcleanupSTART2:
472 - /* FUTEX_WAIT_REQUEUE_PI returned EAGAIN. We need to
473 - call it again. */
474 -
475 - /* Get internal lock. */
476 - movl $1, %edx
477 - xorl %eax, %eax
478 - LOCK
479 -#if cond_lock == 0
480 - cmpxchgl %edx, (%ebx)
481 -#else
482 - cmpxchgl %edx, cond_lock(%ebx)
483 -#endif
484 - jz 92f
485 -
486 -#if cond_lock == 0
487 - movl %ebx, %edx
488 -#else
489 - leal cond_lock(%ebx), %edx
490 -#endif
491 -#if (LLL_SHARED-LLL_PRIVATE) > 255
492 - xorl %ecx, %ecx
493 -#endif
494 - cmpl $-1, dep_mutex(%ebx)
495 - setne %cl
496 - subl $1, %ecx
497 - andl $(LLL_SHARED-LLL_PRIVATE), %ecx
498 -#if LLL_PRIVATE != 0
499 - addl $LLL_PRIVATE, %ecx
500 -#endif
501 - call __lll_lock_wait
502 -
503 -92:
504 - /* Increment the cond_futex value again, so it can be used as a new
505 - expected value. */
506 - addl $1, cond_futex(%ebx)
507 - movl cond_futex(%ebx), %ebp
508 -
509 - /* Unlock. */
510 - LOCK
511 -#if cond_lock == 0
512 - subl $1, (%ebx)
513 -#else
514 - subl $1, cond_lock(%ebx)
515 -#endif
516 - je 93f
517 -#if cond_lock == 0
518 - movl %ebx, %eax
519 -#else
520 - leal cond_lock(%ebx), %eax
521 -#endif
522 -#if (LLL_SHARED-LLL_PRIVATE) > 255
523 - xorl %ecx, %ecx
524 -#endif
525 - cmpl $-1, dep_mutex(%ebx)
526 - setne %cl
527 - subl $1, %ecx
528 - andl $(LLL_SHARED-LLL_PRIVATE), %ecx
529 -#if LLL_PRIVATE != 0
530 - addl $LLL_PRIVATE, %ecx
531 -#endif
532 - call __lll_unlock_wake
533 -
534 -93:
535 - /* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
536 - xorl %ecx, %ecx
537 - movl dep_mutex(%ebx), %edi
538 - jmp 90b
539 -.LcleanupEND2:
540 -
541 .size __pthread_cond_wait, .-__pthread_cond_wait
542 versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
543 GLIBC_2_3_2)
544 @@ -639,10 +563,6 @@ __condvar_w_cleanup:
545 .long .LcleanupEND-.Lsub_cond_futex
546 .long __condvar_w_cleanup-.LSTARTCODE
547 .uleb128 0
548 - .long .LcleanupSTART2-.LSTARTCODE
549 - .long .LcleanupEND2-.LcleanupSTART2
550 - .long __condvar_w_cleanup-.LSTARTCODE
551 - .uleb128 0
552 .long .LcallUR-.LSTARTCODE
553 .long .LENDCODE-.LcallUR
554 .long 0
555 diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
556 index d837d15..7535baa 100644
557 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
558 +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
559 @@ -23,7 +23,6 @@
560 #include <lowlevelcond.h>
561 #include <tcb-offsets.h>
562 #include <pthread-pi-defines.h>
563 -#include <pthread-errnos.h>
564 #include <stap-probe.h>
565
566 #include <kernel-features.h>
567 @@ -134,14 +133,11 @@ __pthread_cond_wait:
568 cmpl $PI_BIT, %eax
569 jne 61f
570
571 -90:
572 movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
573 movl $SYS_futex, %eax
574 syscall
575
576 movl $1, %r8d
577 - cmpq $-EAGAIN, %rax
578 - je 91f
579 #ifdef __ASSUME_REQUEUE_PI
580 jmp 62f
581 #else
582 @@ -328,70 +324,6 @@ __pthread_cond_wait:
583
584 13: movq %r10, %rax
585 jmp 14b
586 -
587 -91:
588 -.LcleanupSTART2:
589 - /* FUTEX_WAIT_REQUEUE_PI returned EAGAIN. We need to
590 - call it again. */
591 - movq 8(%rsp), %rdi
592 -
593 - /* Get internal lock. */
594 - movl $1, %esi
595 - xorl %eax, %eax
596 - LOCK
597 -#if cond_lock == 0
598 - cmpxchgl %esi, (%rdi)
599 -#else
600 - cmpxchgl %esi, cond_lock(%rdi)
601 -#endif
602 - jz 92f
603 -
604 -#if cond_lock != 0
605 - addq $cond_lock, %rdi
606 -#endif
607 - LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
608 - movl $LLL_PRIVATE, %eax
609 - movl $LLL_SHARED, %esi
610 - cmovne %eax, %esi
611 - callq __lll_lock_wait
612 -#if cond_lock != 0
613 - subq $cond_lock, %rdi
614 -#endif
615 -92:
616 - /* Increment the cond_futex value again, so it can be used as a new
617 - expected value. */
618 - incl cond_futex(%rdi)
619 - movl cond_futex(%rdi), %edx
620 -
621 - /* Release internal lock. */
622 - LOCK
623 -#if cond_lock == 0
624 - decl (%rdi)
625 -#else
626 - decl cond_lock(%rdi)
627 -#endif
628 - jz 93f
629 -
630 -#if cond_lock != 0
631 - addq $cond_lock, %rdi
632 -#endif
633 - LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
634 - movl $LLL_PRIVATE, %eax
635 - movl $LLL_SHARED, %esi
636 - cmovne %eax, %esi
637 - /* The call preserves %rdx. */
638 - callq __lll_unlock_wake
639 -#if cond_lock != 0
640 - subq $cond_lock, %rdi
641 -#endif
642 -93:
643 - /* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
644 - xorq %r10, %r10
645 - mov dep_mutex(%rdi), %R8_LP
646 - leaq cond_futex(%rdi), %rdi
647 - jmp 90b
648 -.LcleanupEND2:
649 -
650 .size __pthread_cond_wait, .-__pthread_cond_wait
651 versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
652 GLIBC_2_3_2)
653 @@ -544,15 +476,11 @@ __condvar_cleanup1:
654 .uleb128 .LcleanupSTART-.LSTARTCODE
655 .uleb128 .LcleanupEND-.LcleanupSTART
656 .uleb128 __condvar_cleanup1-.LSTARTCODE
657 - .uleb128 0
658 - .uleb128 .LcleanupSTART2-.LSTARTCODE
659 - .uleb128 .LcleanupEND2-.LcleanupSTART2
660 - .uleb128 __condvar_cleanup1-.LSTARTCODE
661 - .uleb128 0
662 + .uleb128 0
663 .uleb128 .LcallUR-.LSTARTCODE
664 .uleb128 .LENDCODE-.LcallUR
665 .uleb128 0
666 - .uleb128 0
667 + .uleb128 0
668 .Lcstend:
669
670
671
672
673
674 1.1 src/patchsets/glibc/2.16.0/0085_all_glibc-disable-ldconfig.patch
675
676 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0085_all_glibc-disable-ldconfig.patch?rev=1.1&view=markup
677 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/0085_all_glibc-disable-ldconfig.patch?rev=1.1&content-type=text/plain
678
679 Index: 0085_all_glibc-disable-ldconfig.patch
680 ===================================================================
681 do not bother running ldconfig on DESTDIR. it wants to write the temp cache
682 file outside of the chroot. doesnt matter anyways as we wont use the cache
683 results (portage will rebuild cache), so running ldconfig is simply a waste
684 of time.
685
686 --- a/Makefile
687 +++ b/Makefile
688 @@ -117,4 +117,5 @@
689
690 install:
691 +dont-bother-with-destdir:
692 -test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
693 $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
694
695
696
697 1.1 src/patchsets/glibc/2.16.0/1005_all_glibc-sigaction.patch
698
699 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1005_all_glibc-sigaction.patch?rev=1.1&view=markup
700 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1005_all_glibc-sigaction.patch?rev=1.1&content-type=text/plain
701
702 Index: 1005_all_glibc-sigaction.patch
703 ===================================================================
704 http://bugs.gentoo.org/283470
705
706 work around ... not entirely sure what is going on here.
707
708 2011-03-01 squeezy <vina@××××××××××.eu>
709
710 #283470
711 * sysdeps/unix/sysv/linux/x86_64/sigaction.c fix the __restore_rt symbol
712
713 --- libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
714 +++ libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
715 @@ -40,7 +40,7 @@
716
717 /* Using the hidden attribute here does not change the code but it
718 helps to avoid warnings. */
719 -extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
720 +extern void restore_rt (void) asm ("__restore_rt") __attribute__((__visibility__("hidden")));
721
722
723 /* If ACT is not NULL, change the action for SIG to *ACT.
724
725
726
727 1.1 src/patchsets/glibc/2.16.0/1008_all_glibc-2.16-fortify.patch
728
729 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1008_all_glibc-2.16-fortify.patch?rev=1.1&view=markup
730 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1008_all_glibc-2.16-fortify.patch?rev=1.1&content-type=text/plain
731
732 Index: 1008_all_glibc-2.16-fortify.patch
733 ===================================================================
734 the fortify/optimization check does not play well with our default gcc specs
735
736 http://sourceware.org/ml/libc-alpha/2012-06/msg00068.html
737
738 --- a/include/features.h
739 +++ b/include/features.h
740 @@ -325,10 +325,11 @@
741 # define __USE_REENTRANT 1
742 #endif
743
744 +#if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
745 +# undef _FORTIFY_SOURCE
746 +#endif
747 #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0
748 -# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
749 -# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
750 -# elif !__GNUC_PREREQ (4, 1)
751 +# if !__GNUC_PREREQ (4, 1)
752 # warning _FORTIFY_SOURCE requires GCC 4.1 or later
753 # elif _FORTIFY_SOURCE > 1
754 # define __USE_FORTIFY_LEVEL 2
755
756
757
758 1.1 src/patchsets/glibc/2.16.0/1030_all_glibc-manual-no-perl.patch
759
760 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1030_all_glibc-manual-no-perl.patch?rev=1.1&view=markup
761 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1030_all_glibc-manual-no-perl.patch?rev=1.1&content-type=text/plain
762
763 Index: 1030_all_glibc-manual-no-perl.patch
764 ===================================================================
765 If we're using a cvs snapshot which updates the source files, and
766 perl isn't installed yet, then we can't regen the docs. Not a big
767 deal, so just whine a little and continue on our merry way.
768
769 http://bugs.gentoo.org/60132
770
771 --- libc/manual/Makefile
772 +++ libc/manual/Makefile
773 @@ -108,9 +108,14 @@
774 $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
775 $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
776 $(dir)/libm-test-ulps))
777 +ifneq ($(PERL),no)
778 pwd=`pwd`; \
779 $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
780 $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
781 +else
782 + echo "Unable to rebuild math docs, no perl installed"
783 + touch libm-err.texi
784 +endif
785 touch $@
786
787 # Generate a file with the version number.
788
789
790
791 1.1 src/patchsets/glibc/2.16.0/1040_all_2.3.3-localedef-fix-trampoline.patch
792
793 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1040_all_2.3.3-localedef-fix-trampoline.patch?rev=1.1&view=markup
794 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1040_all_2.3.3-localedef-fix-trampoline.patch?rev=1.1&content-type=text/plain
795
796 Index: 1040_all_2.3.3-localedef-fix-trampoline.patch
797 ===================================================================
798 #! /bin/sh -e
799
800 # DP: Description: Fix localedef segfault when run under exec-shield,
801 # PaX or similar. (#231438, #198099)
802 # DP: Dpatch Author: James Troup <james@××××××.org>
803 # DP: Patch Author: (probably) Jakub Jelinek <jakub@××××××.com>
804 # DP: Upstream status: Unknown
805 # DP: Status Details: Unknown
806 # DP: Date: 2004-03-16
807
808 if [ $# -ne 2 ]; then
809 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
810 exit 1
811 fi
812 case "$1" in
813 -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
814 -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
815 *)
816 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
817 exit 1
818 esac
819 exit 0
820
821 --- glibc-2.3.3-net/locale/programs/3level.h 16 Jun 2003 07:19:09 -0000 1.1.1.5
822 +++ glibc-2.3.3-redhat/locale/programs/3level.h 16 Jun 2003 09:32:40 -0000 1.4
823 @@ -204,6 +204,42 @@ CONCAT(TABLE,_iterate) (struct TABLE *t,
824 }
825 }
826 }
827 +
828 +/* GCC ATM seems to do a poor job with pointers to nested functions passed
829 + to inlined functions. Help it a little bit with this hack. */
830 +#define wchead_table_iterate(tp, fn) \
831 +do \
832 + { \
833 + struct wchead_table *t = (tp); \
834 + uint32_t index1; \
835 + for (index1 = 0; index1 < t->level1_size; index1++) \
836 + { \
837 + uint32_t lookup1 = t->level1[index1]; \
838 + if (lookup1 != ((uint32_t) ~0)) \
839 + { \
840 + uint32_t lookup1_shifted = lookup1 << t->q; \
841 + uint32_t index2; \
842 + for (index2 = 0; index2 < (1 << t->q); index2++) \
843 + { \
844 + uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
845 + if (lookup2 != ((uint32_t) ~0)) \
846 + { \
847 + uint32_t lookup2_shifted = lookup2 << t->p; \
848 + uint32_t index3; \
849 + for (index3 = 0; index3 < (1 << t->p); index3++) \
850 + { \
851 + struct element_t *lookup3 \
852 + = t->level3[index3 + lookup2_shifted]; \
853 + if (lookup3 != NULL) \
854 + fn ((((index1 << t->q) + index2) << t->p) + index3, \
855 + lookup3); \
856 + } \
857 + } \
858 + } \
859 + } \
860 + } \
861 + } while (0)
862 +
863 #endif
864
865 #ifndef NO_FINALIZE
866
867
868
869 1.1 src/patchsets/glibc/2.16.0/1055_all_glibc-resolv-dynamic.patch
870
871 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1055_all_glibc-resolv-dynamic.patch?rev=1.1&view=markup
872 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1055_all_glibc-resolv-dynamic.patch?rev=1.1&content-type=text/plain
873
874 Index: 1055_all_glibc-resolv-dynamic.patch
875 ===================================================================
876 ripped from SuSE
877
878 if /etc/resolv.conf is updated, then make sure applications
879 already running get the updated information.
880
881 http://bugs.gentoo.org/177416
882
883 --- libc/resolv/res_libc.c
884 +++ libc/resolv/res_libc.c
885 @@ -22,6 +22,7 @@
886 #include <arpa/nameser.h>
887 #include <resolv.h>
888 #include <bits/libc-lock.h>
889 +#include <sys/stat.h>
890
891
892 /* The following bit is copied from res_data.c (where it is #ifdef'ed
893 @@ -101,6 +102,20 @@
894 __res_maybe_init (res_state resp, int preinit)
895 {
896 if (resp->options & RES_INIT) {
897 + static time_t last_mtime, last_check;
898 + time_t now;
899 + struct stat statbuf;
900 +
901 + time (&now);
902 + if (now != last_check) {
903 + last_check = now;
904 + if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
905 + last_mtime = statbuf.st_mtime;
906 + atomicinclock (lock);
907 + atomicinc (__res_initstamp);
908 + atomicincunlock (lock);
909 + }
910 + }
911 if (__res_initstamp != resp->_u._ext.initstamp) {
912 if (resp->nscount > 0) {
913 __res_nclose (resp);
914
915
916
917 1.1 src/patchsets/glibc/2.16.0/1070_all_glibc-fadvise64_64.patch
918
919 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1070_all_glibc-fadvise64_64.patch?rev=1.1&view=markup
920 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1070_all_glibc-fadvise64_64.patch?rev=1.1&content-type=text/plain
921
922 Index: 1070_all_glibc-fadvise64_64.patch
923 ===================================================================
924 ripped from Debian
925
926 ---
927 sysdeps/unix/sysv/linux/posix_fadvise.c | 13 +++++++++++++
928 1 file changed, 13 insertions(+)
929
930 --- a/sysdeps/unix/sysv/linux/posix_fadvise.c
931 +++ b/sysdeps/unix/sysv/linux/posix_fadvise.c
932 @@ -35,6 +35,19 @@
933 return INTERNAL_SYSCALL_ERRNO (ret, err);
934 return 0;
935 #else
936 +# ifdef __NR_fadvise64_64
937 + INTERNAL_SYSCALL_DECL (err);
938 + int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
939 + __LONG_LONG_PAIR ((long) (offset >> 31),
940 + (long) offset),
941 + __LONG_LONG_PAIR ((long) (len >> 31),
942 + (long) len),
943 + advise);
944 + if (INTERNAL_SYSCALL_ERROR_P (ret, err))
945 + return INTERNAL_SYSCALL_ERRNO (ret, err);
946 + return 0;
947 +# else
948 return ENOSYS;
949 +# endif
950 #endif
951 }
952
953
954
955 1.1 src/patchsets/glibc/2.16.0/1095_all_glibc-2.14-assume-pipe2-dup3.patch
956
957 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1095_all_glibc-2.14-assume-pipe2-dup3.patch?rev=1.1&view=markup
958 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1095_all_glibc-2.14-assume-pipe2-dup3.patch?rev=1.1&content-type=text/plain
959
960 Index: 1095_all_glibc-2.14-assume-pipe2-dup3.patch
961 ===================================================================
962 http://bugs.gentoo.org/250342
963 http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
964
965 we cant assume sock_cloexec and pipe2 are bound together as the former defines
966 are found in glibc only while the latter are a combo of kernel headers and
967 glibc. so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
968 inside of glibc, we hit a problem. for example:
969
970 #include <grp.h>
971 #include <stdio.h>
972 main()
973 {
974 getgrnam("portage");
975 if (!popen("ls", "r"))
976 perror("popen()");
977 }
978
979 getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
980 __have_sock_cloexec and __have_pipe2 to true. but if glibc was built against
981 older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
982 stub for it. so popen() will always fail as glibc assumes pipe2() works.
983
984 --- a/include/unistd.h
985 +++ b/include/unistd.h
986 @@ -167,10 +167,7 @@
987 extern int __pause_nocancel (void) attribute_hidden;
988
989 extern int __have_sock_cloexec;
990 -/* At lot of other functionality became available at the same time as
991 - SOCK_CLOEXEC. Avoid defining separate variables for all of them
992 - unless it is really necessary. */
993 -#define __have_pipe2 __have_sock_cloexec
994 -#define __have_dup3 __have_sock_cloexec
995 +extern int __have_pipe2;
996 +extern int __have_dup3;
997
998 #endif
999 --- a/socket/have_sock_cloexec.c
1000 +++ b/socket/have_sock_cloexec.c
1001 @@ -16,9 +16,18 @@
1002 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1003 02111-1307 USA. */
1004
1005 +#include <fcntl.h>
1006 #include <sys/socket.h>
1007 #include <kernel-features.h>
1008
1009 #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
1010 int __have_sock_cloexec;
1011 #endif
1012 +
1013 +#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
1014 +int __have_pipe2;
1015 +#endif
1016 +
1017 +#if defined O_CLOEXEC && !defined __ASSUME_DUP3
1018 +int __have_dup3;
1019 +#endif
1020
1021
1022
1023 1.1 src/patchsets/glibc/2.16.0/1503_hppa_glibc-2.7-hppa-nptl-carlos.patch
1024
1025 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1503_hppa_glibc-2.7-hppa-nptl-carlos.patch?rev=1.1&view=markup
1026 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1503_hppa_glibc-2.7-hppa-nptl-carlos.patch?rev=1.1&content-type=text/plain
1027
1028 Index: 1503_hppa_glibc-2.7-hppa-nptl-carlos.patch
1029 ===================================================================
1030 --- elf/rtld.c.orig
1031 +++ elf/rtld.c
1032 @@ -379,14 +379,14 @@
1033 know it is available. We do not have to clear the memory if we
1034 do not have to use the temporary bootstrap_map. Global variables
1035 are initialized to zero by default. */
1036 -#ifndef DONT_USE_BOOTSTRAP_MAP
1037 +#if !defined DONT_USE_BOOTSTRAP_MAP
1038 # ifdef HAVE_BUILTIN_MEMSET
1039 __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
1040 # else
1041 - for (size_t cnt = 0;
1042 - cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
1043 - ++cnt)
1044 - bootstrap_map.l_info[cnt] = 0;
1045 + /* Clear the whole bootstrap_map structure */
1046 + for (char *cnt = (char *)&(bootstrap_map);
1047 + cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
1048 + *cnt++ = '\0');
1049 # endif
1050 # if USE___THREAD
1051 bootstrap_map.l_tls_modid = 0;
1052 --- include/atomic.h.orig
1053 +++ include/atomic.h
1054 @@ -174,7 +174,7 @@
1055 __typeof (*(mem)) __atg5_value = (newvalue); \
1056 \
1057 do \
1058 - __atg5_oldval = *__atg5_memp; \
1059 + __atg5_oldval = *(volatile __typeof (mem))__atg5_memp; \
1060 while (__builtin_expect \
1061 (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
1062 __atg5_oldval), 0)); \
1063 @@ -195,7 +195,7 @@
1064 __typeof (*(mem)) __atg6_value = (value); \
1065 \
1066 do \
1067 - __atg6_oldval = *__atg6_memp; \
1068 + __atg6_oldval = *(volatile __typeof (mem))__atg6_memp; \
1069 while (__builtin_expect \
1070 (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
1071 __atg6_oldval \
1072 @@ -213,7 +213,7 @@
1073 __typeof (*(mem)) __atg7_value = (value); \
1074 \
1075 do \
1076 - __atg7_oldv = *__atg7_memp; \
1077 + __atg7_oldv = *(volatile __typeof (mem))__atg7_memp; \
1078 while (__builtin_expect \
1079 (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
1080 __atg7_oldv \
1081 @@ -231,7 +231,7 @@
1082 __typeof (mem) __atg8_memp = (mem); \
1083 __typeof (*(mem)) __atg8_value = (value); \
1084 do { \
1085 - __atg8_oldval = *__atg8_memp; \
1086 + __atg8_oldval = *(volatile __typeof (mem))__atg8_memp; \
1087 if (__atg8_oldval >= __atg8_value) \
1088 break; \
1089 } while (__builtin_expect \
1090 @@ -248,7 +248,7 @@
1091 __typeof (mem) __atg9_memp = (mem); \
1092 __typeof (*(mem)) __atg9_value = (value); \
1093 do { \
1094 - __atg9_oldv = *__atg9_memp; \
1095 + __atg9_oldv = *(volatile __typeof (mem))__atg9_memp; \
1096 if (__atg9_oldv >= __atg9_value) \
1097 break; \
1098 } while (__builtin_expect \
1099 @@ -266,7 +266,7 @@
1100 __typeof (mem) __atg10_memp = (mem); \
1101 __typeof (*(mem)) __atg10_value = (value); \
1102 do { \
1103 - __atg10_oldval = *__atg10_memp; \
1104 + __atg10_oldval = *(volatile __typeof (mem))__atg10_memp; \
1105 if (__atg10_oldval <= __atg10_value) \
1106 break; \
1107 } while (__builtin_expect \
1108 @@ -350,7 +350,7 @@
1109 \
1110 do \
1111 { \
1112 - __atg11_oldval = *__atg11_memp; \
1113 + __atg11_oldval = *(volatile __typeof (mem))__atg11_memp; \
1114 if (__builtin_expect (__atg11_oldval <= 0, 0)) \
1115 break; \
1116 } \
1117 @@ -389,7 +389,7 @@
1118 __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
1119 \
1120 do \
1121 - __atg14_old = (*__atg14_memp); \
1122 + __atg14_old = (*(volatile __typeof (mem))__atg14_memp); \
1123 while (__builtin_expect \
1124 (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
1125 __atg14_old | __atg14_mask,\
1126 @@ -407,7 +407,7 @@
1127 __typeof (*(mem)) __atg15_mask = (mask); \
1128 \
1129 do \
1130 - __atg15_old = (*__atg15_memp); \
1131 + __atg15_old = (*(volatile __typeof (mem))__atg15_memp); \
1132 while (__builtin_expect \
1133 (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
1134 __atg15_old & __atg15_mask, \
1135 @@ -423,7 +423,7 @@
1136 __typeof (*(mem)) __atg16_mask = (mask); \
1137 \
1138 do \
1139 - __atg16_old = (*__atg16_memp); \
1140 + __atg16_old = (*(volatile __typeof (mem))__atg16_memp); \
1141 while (__builtin_expect \
1142 (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
1143 __atg16_old & __atg16_mask,\
1144 @@ -441,7 +441,7 @@
1145 __typeof (*(mem)) __atg17_mask = (mask); \
1146 \
1147 do \
1148 - __atg17_old = (*__atg17_memp); \
1149 + __atg17_old = (*(volatile __typeof (mem))__atg17_memp); \
1150 while (__builtin_expect \
1151 (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
1152 __atg17_old | __atg17_mask, \
1153 @@ -457,7 +457,7 @@
1154 __typeof (*(mem)) __atg18_mask = (mask); \
1155 \
1156 do \
1157 - __atg18_old = (*__atg18_memp); \
1158 + __atg18_old = (*(volatile __typeof (mem))__atg18_memp); \
1159 while (__builtin_expect \
1160 (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
1161 __atg18_old | __atg18_mask,\
1162 @@ -473,7 +473,7 @@
1163 __typeof (*(mem)) __atg19_mask = (mask); \
1164 \
1165 do \
1166 - __atg19_old = (*__atg19_memp); \
1167 + __atg19_old = (*(volatile __typeof (mem))__atg19_memp); \
1168 while (__builtin_expect \
1169 (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
1170 __atg19_old | __atg19_mask,\
1171 --- nptl/Makefile.orig
1172 +++ nptl/Makefile
1173 @@ -263,9 +263,9 @@
1174 # Files which must not be linked with libpthread.
1175 tests-nolibpthread = tst-unload
1176
1177 -# This sets the stack resource limit to 1023kb, which is not a multiple
1178 -# of the page size since every architecture's page size is > 1k.
1179 -tst-oddstacklimit-ENV = ; ulimit -s 1023;
1180 +# This sets the stack resource limit to 8193kb, which is not a multiple
1181 +# of the page size since every architecture's page size is 4096 bytes.
1182 +tst-oddstacklimit-ENV = ; ulimit -s 8193;
1183
1184 distribute = eintr.c tst-cleanup4aux.c
1185
1186 @@ -424,6 +424,35 @@
1187 CFLAGS-tst-cleanupx4.c += -fexceptions
1188 CFLAGS-tst-oncex3.c += -fexceptions
1189 CFLAGS-tst-oncex4.c += -fexceptions
1190 +
1191 +ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
1192 +LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
1193 +LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
1194 +LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
1195 +LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
1196 +LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
1197 +LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
1198 +LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
1199 +LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
1200 +LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
1201 +LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
1202 +LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
1203 +LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
1204 +LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
1205 +LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
1206 +LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
1207 +LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
1208 +LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
1209 +LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
1210 +LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
1211 +LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
1212 +LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
1213 +LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
1214 +LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
1215 +LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
1216 +LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
1217 +LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
1218 +
1219 CFLAGS-tst-align.c += $(stack-align-test-flags)
1220 CFLAGS-tst-align3.c += $(stack-align-test-flags)
1221 CFLAGS-tst-initializers1.c = -W -Wall -Werror
1222 --- nptl.orig/pthread_barrier_wait.c
1223 +++ nptl/pthread_barrier_wait.c
1224 @@ -64,7 +64,7 @@
1225 do
1226 lll_futex_wait (&ibarrier->curr_event, event,
1227 ibarrier->private ^ FUTEX_PRIVATE_FLAG);
1228 - while (event == ibarrier->curr_event);
1229 + while (event == *(volatile unsigned int *)&ibarrier->curr_event);
1230 }
1231
1232 /* Make sure the init_count is stored locally or in a register. */
1233 --- nptl/sysdeps/pthread/Makefile.orig
1234 +++ nptl/sysdeps/pthread/Makefile
1235 @@ -41,7 +41,9 @@
1236
1237 ifeq ($(have-forced-unwind),yes)
1238 tests += tst-mqueue8x
1239 +ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
1240 CFLAGS-tst-mqueue8x.c += -fexceptions
1241 +LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s)
1242 endif
1243 endif
1244
1245 --- stdio-common/Makefile.orig
1246 +++ stdio-common/Makefile
1247 @@ -79,7 +79,7 @@
1248 $(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
1249 endif
1250
1251 -CFLAGS-vfprintf.c = -Wno-uninitialized
1252 +CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
1253 CFLAGS-vfwprintf.c = -Wno-uninitialized
1254 CFLAGS-tst-printf.c = -Wno-format
1255 CFLAGS-tstdiomisc.c = -Wno-format
1256 --- sunrpc/clnt_udp.c.orig
1257 +++ sunrpc/clnt_udp.c
1258 @@ -419,7 +419,7 @@
1259 while (inlen < 0 && errno == EINTR);
1260 if (inlen < 0)
1261 {
1262 - if (errno == EWOULDBLOCK)
1263 + if (errno == EWOULDBLOCK || errno == EAGAIN)
1264 continue;
1265 cu->cu_error.re_errno = errno;
1266 return (cu->cu_error.re_status = RPC_CANTRECV);
1267
1268
1269
1270 1.1 src/patchsets/glibc/2.16.0/1505_hppa_glibc-2.11-hppa-nptl.patch
1271
1272 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1505_hppa_glibc-2.11-hppa-nptl.patch?rev=1.1&view=markup
1273 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1505_hppa_glibc-2.11-hppa-nptl.patch?rev=1.1&content-type=text/plain
1274
1275 Index: 1505_hppa_glibc-2.11-hppa-nptl.patch
1276 ===================================================================
1277 http://bugs.gentoo.org/301642
1278
1279 --- a/elf/dl-fptr.c 2010-07-25 21:58:31.241131107 +0200
1280 +++ b/elf/dl-fptr.c 2010-07-25 22:00:54.323726976 +0200
1281 @@ -56,7 +56,8 @@
1282 }
1283 local =
1284 {
1285 - .root = &local.boot_table,
1286 + /* Address of .boot_table is not known until runtime. */
1287 + .root = 0,
1288 .npages = 2,
1289 .boot_table =
1290 {
1291 @@ -93,6 +94,17 @@
1292 return new_table;
1293 }
1294
1295 +/* Must call _dl_fptr_init before using any other function. */
1296 +void
1297 +_dl_fptr_init (void)
1298 +{
1299 + struct local *l;
1300 +
1301 + ELF_MACHINE_LOAD_ADDRESS (l, local);
1302 + /* Initialize root once. */
1303 + if (__builtin_expect (l->root == 0, 0))
1304 + l->root = &l->boot_table;
1305 +}
1306
1307 static ElfW(Addr)
1308 make_fdesc (ElfW(Addr) ip, ElfW(Addr) gp)
1309 --- a/nptl/allocatestack.c 2010-07-25 21:58:30.669136153 +0200
1310 +++ b/nptl/allocatestack.c 2010-07-25 21:59:05.528795435 +0200
1311 @@ -354,6 +354,15 @@
1312 if (__builtin_expect (attr->flags & ATTR_FLAG_STACKADDR, 0))
1313 {
1314 uintptr_t adj;
1315 +#if _STACK_GROWS_DOWN
1316 + char * stackaddr = (char *) attr->stackaddr;
1317 +#else
1318 + /* Assume the same layout as the _STACK_GROWS_DOWN case,
1319 + with struct pthread at the top of the stack block.
1320 + Later we adjust the guard location and stack address
1321 + to match the _STACK_GROWS_UP case. */
1322 + char * stackaddr = (char *) attr->stackaddr + attr->stacksize;
1323 +#endif
1324
1325 /* If the user also specified the size of the stack make sure it
1326 is large enough. */
1327 @@ -363,11 +372,11 @@
1328
1329 /* Adjust stack size for alignment of the TLS block. */
1330 #if TLS_TCB_AT_TP
1331 - adj = ((uintptr_t) attr->stackaddr - TLS_TCB_SIZE)
1332 + adj = ((uintptr_t) stackaddr - TLS_TCB_SIZE)
1333 & __static_tls_align_m1;
1334 assert (size > adj + TLS_TCB_SIZE);
1335 #elif TLS_DTV_AT_TP
1336 - adj = ((uintptr_t) attr->stackaddr - __static_tls_size)
1337 + adj = ((uintptr_t) stackaddr - __static_tls_size)
1338 & __static_tls_align_m1;
1339 assert (size > adj);
1340 #endif
1341 @@ -377,10 +386,10 @@
1342 the stack. It is the user's responsibility to do this if it
1343 is wanted. */
1344 #if TLS_TCB_AT_TP
1345 - pd = (struct pthread *) ((uintptr_t) attr->stackaddr
1346 + pd = (struct pthread *) ((uintptr_t) stackaddr
1347 - TLS_TCB_SIZE - adj);
1348 #elif TLS_DTV_AT_TP
1349 - pd = (struct pthread *) (((uintptr_t) attr->stackaddr
1350 + pd = (struct pthread *) (((uintptr_t) stackaddr
1351 - __static_tls_size - adj)
1352 - TLS_PRE_TCB_SIZE);
1353 #endif
1354 @@ -392,7 +401,7 @@
1355 pd->specific[0] = pd->specific_1stblock;
1356
1357 /* Remember the stack-related values. */
1358 - pd->stackblock = (char *) attr->stackaddr - size;
1359 + pd->stackblock = (char *) stackaddr - size;
1360 pd->stackblock_size = size;
1361
1362 /* This is a user-provided stack. It will not be queued in the
1363 @@ -617,7 +626,7 @@
1364 char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
1365 #elif _STACK_GROWS_DOWN
1366 char *guard = mem;
1367 -# elif _STACK_GROWS_UP
1368 +#elif _STACK_GROWS_UP
1369 char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1);
1370 #endif
1371 if (mprotect (guard, guardsize, PROT_NONE) != 0)
1372 @@ -716,7 +725,6 @@
1373 *stack = stacktop;
1374 #elif _STACK_GROWS_UP
1375 *stack = pd->stackblock;
1376 - assert (*stack > 0);
1377 #endif
1378
1379 return 0;
1380 --- a/nptl/pthread_attr_getstack.c 2010-07-25 21:58:30.717135358 +0200
1381 +++ b/nptl/pthread_attr_getstack.c 2010-07-25 21:59:05.532796982 +0200
1382 @@ -33,7 +33,11 @@
1383 iattr = (struct pthread_attr *) attr;
1384
1385 /* Store the result. */
1386 +#ifdef _STACK_GROWS_DOWN
1387 *stackaddr = (char *) iattr->stackaddr - iattr->stacksize;
1388 +#else
1389 + *stackaddr = (char *) iattr->stackaddr;
1390 +#endif
1391 *stacksize = iattr->stacksize;
1392
1393 return 0;
1394 --- a/nptl/pthread_attr_setstack.c 2010-07-25 21:58:30.717135358 +0200
1395 +++ b/nptl/pthread_attr_setstack.c 2010-07-25 21:59:05.532796982 +0200
1396 @@ -48,7 +48,11 @@
1397 #endif
1398
1399 iattr->stacksize = stacksize;
1400 +#if _STACK_GROWS_DOWN
1401 iattr->stackaddr = (char *) stackaddr + stacksize;
1402 +#else
1403 + iattr->stackaddr = (char *) stackaddr;
1404 +#endif
1405 iattr->flags |= ATTR_FLAG_STACKADDR;
1406
1407 return 0;
1408 @@ -81,7 +85,11 @@
1409 # endif
1410
1411 iattr->stacksize = stacksize;
1412 +#if _STACK_GROWS_DOWN
1413 iattr->stackaddr = (char *) stackaddr + stacksize;
1414 +#else
1415 + iattr->stackaddr = (char *) stackaddr;
1416 +#endif
1417 iattr->flags |= ATTR_FLAG_STACKADDR;
1418
1419 return 0;
1420 --- a/nptl/pthread_create.c 2010-07-25 21:58:30.713135617 +0200
1421 +++ b/nptl/pthread_create.c 2010-07-25 21:59:05.536794818 +0200
1422 @@ -383,12 +383,18 @@
1423 #ifdef _STACK_GROWS_DOWN
1424 char *sp = CURRENT_STACK_FRAME;
1425 size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1;
1426 -#else
1427 -# error "to do"
1428 -#endif
1429 assert (freesize < pd->stackblock_size);
1430 if (freesize > PTHREAD_STACK_MIN)
1431 madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
1432 +#else
1433 + char *sp = CURRENT_STACK_FRAME;
1434 + size_t freesize = ((char *) pd->stackblock + pd->stackblock_size - sp)
1435 + & ~pagesize_m1;
1436 + void *freeblock = (void *) (sp + PTHREAD_STACK_MIN);
1437 + assert (freesize < pd->stackblock_size);
1438 + if (freesize > PTHREAD_STACK_MIN)
1439 + madvise (freeblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
1440 +#endif
1441
1442 /* If the thread is detached free the TCB. */
1443 if (IS_DETACHED (pd))
1444 --- a/nptl/pthread_getattr_np.c 2010-07-25 21:58:30.713135617 +0200
1445 +++ b/nptl/pthread_getattr_np.c 2010-07-25 21:59:05.536794818 +0200
1446 @@ -61,7 +62,11 @@
1447 if (__builtin_expect (thread->stackblock != NULL, 1))
1448 {
1449 iattr->stacksize = thread->stackblock_size;
1450 +#ifdef _STACK_GROWS_DOWN
1451 iattr->stackaddr = (char *) thread->stackblock + iattr->stacksize;
1452 +#else
1453 + iattr->stackaddr = (char *) thread->stackblock;
1454 +#endif
1455 }
1456 else
1457 {
1458 @@ -110,13 +115,21 @@
1459 {
1460 /* Found the entry. Now we have the info we need. */
1461 iattr->stacksize = rl.rlim_cur;
1462 +#ifdef _STACK_GROWS_DOWN
1463 iattr->stackaddr = (void *) to;
1464
1465 /* The limit might be too high. */
1466 if ((size_t) iattr->stacksize
1467 > (size_t) iattr->stackaddr - last_to)
1468 iattr->stacksize = (size_t) iattr->stackaddr - last_to;
1469 +#else
1470 + iattr->stackaddr = (void *) from;
1471
1472 + /* The limit might be too high. */
1473 + if ((size_t) iattr->stacksize
1474 + > to - (size_t) iattr->stackaddr)
1475 + iattr->stacksize = to - (size_t) iattr->stackaddr;
1476 +#endif
1477 /* We succeed and no need to look further. */
1478 ret = 0;
1479 break;
1480
1481 2010-02-09 Carlos O'Donell <carlos@××××××××××××.com>
1482
1483 * sysdeps/hppa/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC):
1484 Call _dl_fptr_init.
1485
1486 --- a/ports/sysdeps/hppa/dl-machine.h 2010-07-25 21:58:30.189140390 +0200
1487 +++ b/ports/sysdeps/hppa/dl-machine.h 2010-07-25 22:02:25.502848298 +0200
1488 @@ -64,7 +64,8 @@
1489 }
1490
1491 #define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
1492 - __hppa_init_bootstrap_fdesc_table (&bootstrap_map);
1493 + __hppa_init_bootstrap_fdesc_table (&bootstrap_map); \
1494 + _dl_fptr_init();
1495
1496 /* Return nonzero iff ELF header is compatible with the running host. */
1497 static inline int
1498 --- a/sysdeps/generic/dl-fptr.h 2010-07-25 21:58:30.525138223 +0200
1499 +++ b/sysdeps/generic/dl-fptr.h 2010-07-25 22:00:54.323726976 +0200
1500 @@ -40,6 +40,9 @@
1501
1502 extern ElfW(Addr) _dl_boot_fptr_table [];
1503
1504 +/* Must be called before any other function. */
1505 +extern void _dl_fptr_init (void);
1506 +
1507 extern ElfW(Addr) _dl_make_fptr (struct link_map *, const ElfW(Sym) *,
1508 ElfW(Addr));
1509
1510
1511
1512
1513 1.1 src/patchsets/glibc/2.16.0/1506_all_hppa-prlimit64.patch
1514
1515 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1506_all_hppa-prlimit64.patch?rev=1.1&view=markup
1516 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1506_all_hppa-prlimit64.patch?rev=1.1&content-type=text/plain
1517
1518 Index: 1506_all_hppa-prlimit64.patch
1519 ===================================================================
1520 From dac3a9c0e6d6b127beda1fe4799abe2ffe0cfd4c Mon Sep 17 00:00:00 2001
1521 From: Mike Frysinger <vapier@g.o>
1522 Date: Thu, 12 Apr 2012 18:58:35 -0400
1523 Subject: [PATCH] hppa: add missing prlimit64 symbol
1524
1525 All other arches have this in their syscall list. Looks like hppa
1526 is missing it though and breaks one or two apps that try to call it.
1527
1528 URL: https://bugs.gentoo.org/411745
1529 Signed-off-by: Mike Frysinger <vapier@g.o>
1530
1531 2012-04-12 Mike Frysinger <vapier@g.o>
1532
1533 * sysdeps/unix/sysv/linux/hppa/syscalls.list: Add prlimit64.
1534 ---
1535 sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 +
1536 1 files changed, 1 insertions(+), 0 deletions(-)
1537
1538 diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
1539 index 0f7537c..1b6b311 100644
1540 --- a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
1541 +++ b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
1542 @@ -35,3 +35,4 @@ socketpair - socketpair i:iiif __socketpair socketpair
1543
1544 setrlimit - setrlimit i:ip __setrlimit setrlimit
1545 getrlimit - getrlimit i:ip __getrlimit getrlimit
1546 +prlimit64 EXTRA prlimit64 i:iipp prlimit64
1547 --
1548 1.7.8.5
1549
1550
1551
1552
1553 1.1 src/patchsets/glibc/2.16.0/1530_all_glibc-m68k-sys-user.patch
1554
1555 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1530_all_glibc-m68k-sys-user.patch?rev=1.1&view=markup
1556 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/1530_all_glibc-m68k-sys-user.patch?rev=1.1&content-type=text/plain
1557
1558 Index: 1530_all_glibc-m68k-sys-user.patch
1559 ===================================================================
1560 copied from kernel as it is sanitized now
1561
1562 --- libc/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
1563 +++ libc/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
1564 @@ -0,0 +1,87 @@
1565 +#ifndef _SYS_USER_H
1566 +#define _SYS_USER_H
1567 +
1568 +/* Core file format: The core file is written in such a way that gdb
1569 + can understand it and provide useful information to the user (under
1570 + linux we use the 'trad-core' bfd). There are quite a number of
1571 + obstacles to being able to view the contents of the floating point
1572 + registers, and until these are solved you will not be able to view the
1573 + contents of them. Actually, you can read in the core file and look at
1574 + the contents of the user struct to find out what the floating point
1575 + registers contain.
1576 + The actual file contents are as follows:
1577 + UPAGE: 1 page consisting of a user struct that tells gdb what is present
1578 + in the file. Directly after this is a copy of the task_struct, which
1579 + is currently not used by gdb, but it may come in useful at some point.
1580 + All of the registers are stored as part of the upage. The upage should
1581 + always be only one page.
1582 + DATA: The data area is stored. We use current->end_text to
1583 + current->brk to pick up all of the user variables, plus any memory
1584 + that may have been malloced. No attempt is made to determine if a page
1585 + is demand-zero or if a page is totally unused, we just cover the entire
1586 + range. All of the addresses are rounded in such a way that an integral
1587 + number of pages is written.
1588 + STACK: We need the stack information in order to get a meaningful
1589 + backtrace. We need to write the data from (esp) to
1590 + current->start_stack, so we round each of these off in order to be able
1591 + to write an integer number of pages.
1592 + The minimum core file size is 3 pages, or 12288 bytes.
1593 +*/
1594 +
1595 +struct user_m68kfp_struct {
1596 + unsigned long fpregs[8*3]; /* fp0-fp7 registers */
1597 + unsigned long fpcntl[3]; /* fp control regs */
1598 +};
1599 +
1600 +/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
1601 + is still the layout used by user (the new pt_regs doesn't have
1602 + all registers). */
1603 +struct user_regs_struct {
1604 + long d1,d2,d3,d4,d5,d6,d7;
1605 + long a0,a1,a2,a3,a4,a5,a6;
1606 + long d0;
1607 + long usp;
1608 + long orig_d0;
1609 + short stkadj;
1610 + short sr;
1611 + long pc;
1612 + short fmtvec;
1613 + short __fill;
1614 +};
1615 +
1616 +
1617 +/* When the kernel dumps core, it starts by dumping the user struct -
1618 + this will be used by gdb to figure out where the data and stack segments
1619 + are within the file, and what virtual addresses to use. */
1620 +struct user{
1621 +/* We start with the registers, to mimic the way that "memory" is returned
1622 + from the ptrace(3,...) function. */
1623 + struct user_regs_struct regs; /* Where the registers are actually stored */
1624 +/* ptrace does not yet supply these. Someday.... */
1625 + int u_fpvalid; /* True if math co-processor being used. */
1626 + /* for this mess. Not yet used. */
1627 + struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */
1628 +/* The rest of this junk is to help gdb figure out what goes where */
1629 + unsigned long int u_tsize; /* Text segment size (pages). */
1630 + unsigned long int u_dsize; /* Data segment size (pages). */
1631 + unsigned long int u_ssize; /* Stack segment size (pages). */
1632 + unsigned long start_code; /* Starting virtual address of text. */
1633 + unsigned long start_stack; /* Starting virtual address of stack area.
1634 + This is actually the bottom of the stack,
1635 + the top of the stack is always found in the
1636 + esp register. */
1637 + long int signal; /* Signal that caused the core dump. */
1638 + int reserved; /* No longer used */
1639 + struct user_regs_struct *u_ar0;
1640 + /* Used by gdb to help find the values for */
1641 + /* the registers. */
1642 + struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */
1643 + unsigned long magic; /* To uniquely identify a core file */
1644 + char u_comm[32]; /* User command that was responsible */
1645 +};
1646 +#define NBPG 4096
1647 +#define UPAGES 1
1648 +#define HOST_TEXT_START_ADDR (u.start_code)
1649 +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
1650 +
1651 +#endif
1652
1653
1654
1655 1.1 src/patchsets/glibc/2.16.0/3000_all_2.3.6-dl_execstack-PaX-support.patch
1656
1657 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/3000_all_2.3.6-dl_execstack-PaX-support.patch?rev=1.1&view=markup
1658 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/3000_all_2.3.6-dl_execstack-PaX-support.patch?rev=1.1&content-type=text/plain
1659
1660 Index: 3000_all_2.3.6-dl_execstack-PaX-support.patch
1661 ===================================================================
1662 With latest versions of glibc, a lot of apps failed on a PaX enabled
1663 system with:
1664 cannot enable executable stack as shared object requires: Permission denied
1665
1666 This is due to PaX 'exec-protecting' the stack, and ld.so then trying
1667 to make the stack executable due to some libraries not containing the
1668 PT_GNU_STACK section. Bug #32960. <azarah@g.o> (12 Nov 2003).
1669
1670 Patch also NPTL. Bug #116086. <kevquinn@g.o> (20 Dec 2005).
1671
1672 --- sysdeps/unix/sysv/linux/dl-execstack.c
1673 +++ sysdeps/unix/sysv/linux/dl-execstack.c
1674 @@ -63,7 +63,10 @@
1675 else
1676 # endif
1677 {
1678 - result = errno;
1679 + if (errno == EACCES) /* PAX is enabled */
1680 + result = 0;
1681 + else
1682 + result = errno;
1683 goto out;
1684 }
1685 }
1686 @@ -89,7 +92,12 @@
1687 page -= size;
1688 else
1689 {
1690 - if (errno != ENOMEM) /* Unexpected failure mode. */
1691 + if (errno == EACCES) /* PAX is enabled */
1692 + {
1693 + result = 0;
1694 + goto out;
1695 + }
1696 + else if (errno != ENOMEM) /* Unexpected failure mode. */
1697 {
1698 result = errno;
1699 goto out;
1700 @@ -115,7 +123,12 @@
1701 page += size;
1702 else
1703 {
1704 - if (errno != ENOMEM) /* Unexpected failure mode. */
1705 + if (errno == EACCES) /* PAX is enabled */
1706 + {
1707 + result = 0;
1708 + goto out;
1709 + }
1710 + else if (errno != ENOMEM) /* Unexpected failure mode. */
1711 {
1712 result = errno;
1713 goto out;
1714 --- nptl/allocatestack.c
1715 +++ nptl/allocatestack.c
1716 @@ -279,7 +279,8 @@
1717 size_t len = pd->stackblock_size - pd->guardsize;
1718 #endif
1719 if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
1720 - return errno;
1721 + if (errno != EACCES) /* PAX is enabled */
1722 + return errno;
1723
1724 return 0;
1725 }
1726
1727
1728
1729 1.1 src/patchsets/glibc/2.16.0/3010_all_2.3.3_pre20040117-pt_pax.patch
1730
1731 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/3010_all_2.3.3_pre20040117-pt_pax.patch?rev=1.1&view=markup
1732 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/3010_all_2.3.3_pre20040117-pt_pax.patch?rev=1.1&content-type=text/plain
1733
1734 Index: 3010_all_2.3.3_pre20040117-pt_pax.patch
1735 ===================================================================
1736 --- elf/elf.h
1737 +++ elf/elf.h
1738 @@ -568,6 +568,7 @@
1739 #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
1740 #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
1741 #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
1742 +#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
1743 #define PT_LOSUNW 0x6ffffffa
1744 #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
1745 #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
1746 @@ -581,6 +582,18 @@
1747 #define PF_X (1 << 0) /* Segment is executable */
1748 #define PF_W (1 << 1) /* Segment is writable */
1749 #define PF_R (1 << 2) /* Segment is readable */
1750 +#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
1751 +#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
1752 +#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
1753 +#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
1754 +#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
1755 +#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
1756 +#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
1757 +#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
1758 +#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
1759 +#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
1760 +#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
1761 +#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
1762 #define PF_MASKOS 0x0ff00000 /* OS-specific */
1763 #define PF_MASKPROC 0xf0000000 /* Processor-specific */
1764
1765
1766
1767
1768 1.1 src/patchsets/glibc/2.16.0/3020_all_glibc-tests-sandbox-libdl-paths.patch
1769
1770 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/3020_all_glibc-tests-sandbox-libdl-paths.patch?rev=1.1&view=markup
1771 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/3020_all_glibc-tests-sandbox-libdl-paths.patch?rev=1.1&content-type=text/plain
1772
1773 Index: 3020_all_glibc-tests-sandbox-libdl-paths.patch
1774 ===================================================================
1775 when glibc runs its tests, it does so by invoking the local library loader.
1776 in Gentoo, we build/run inside of our "sandbox" which itself is linked against
1777 libdl (so that it can load libraries and pull out symbols). the trouble
1778 is that when you upgrade from an older glibc to the new one, often times
1779 internal symbols change name or abi. this is normally OK as you cannot use
1780 libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
1781 we always say "keep all of the glibc libraries from the same build". but
1782 when glibc runs its tests, it uses dynamic paths to point to its new local
1783 copies of libraries. if the test doesnt use libdl, then glibc doesnt add
1784 its path, and when sandbox triggers the loading of libdl, glibc does so
1785 from the host system system. this gets us into the case of all libraries
1786 are from the locally compiled version of glibc except for libdl.so.
1787
1788 Fix by Wormo
1789
1790 http://bugs.gentoo.org/56898
1791
1792 --- libc/grp/tst_fgetgrent.sh
1793 +++ libc/grp/tst_fgetgrent.sh
1794 @@ -24,7 +24,8 @@
1795 rtld_installed_name=$1; shift
1796
1797 testout=${common_objpfx}/grp/tst_fgetgrent.out
1798 -library_path=${common_objpfx}
1799 +# make sure libdl is also in path in case sandbox is in use
1800 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1801
1802 result=0
1803
1804 --- libc/iconvdata/run-iconv-test.sh
1805 +++ libc/iconvdata/run-iconv-test.sh
1806 @@ -34,7 +34,7 @@
1807 export GCONV_PATH
1808
1809 # We have to have some directories in the library path.
1810 -LIBPATH=$codir:$codir/iconvdata
1811 +LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
1812
1813 # How the start the iconv(1) program.
1814 ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
1815 --- libc/iconvdata/tst-table.sh
1816 +++ libc/iconvdata/tst-table.sh
1817 @@ -59,8 +59,11 @@
1818 irreversible=${charset}.irreversible
1819 fi
1820
1821 +# make sure libdl is also in path in case sandbox is in use
1822 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1823 +
1824 # iconv in one direction.
1825 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
1826 +${common_objpfx}elf/ld.so --library-path $library_path \
1827 ${objpfx}tst-table-from ${charset} \
1828 > ${objpfx}tst-${charset}.table
1829
1830 --- libc/intl/tst-codeset.sh
1831 +++ libc/intl/tst-codeset.sh
1832 @@ -37,6 +37,9 @@
1833 LOCPATH=${common_objpfx}localedata
1834 export LOCPATH
1835
1836 +# make sure libdl is also in path in case sandbox is in use
1837 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1838 +
1839 ${common_objpfx}elf/ld.so --library-path $common_objpfx \
1840 ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
1841
1842 --- libc/intl/tst-gettext.sh
1843 +++ libc/intl/tst-gettext.sh
1844 @@ -51,9 +51,12 @@
1845 LOCPATH=${common_objpfx}localedata
1846 export LOCPATH
1847
1848 +# make sure libdl is also in path in case sandbox is in use
1849 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1850 +
1851 # Now run the test.
1852 MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
1853 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
1854 +${common_objpfx}elf/ld.so --library-path $library_path \
1855 ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
1856
1857 exit $?
1858 --- libc/intl/tst-gettext2.sh
1859 +++ libc/intl/tst-gettext2.sh
1860 @@ -65,8 +65,11 @@
1861 LOCPATH=${objpfx}domaindir
1862 export LOCPATH
1863
1864 +# make sure libdl is also in path in case sandbox is in use
1865 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1866 +
1867 # Now run the test.
1868 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
1869 +${common_objpfx}elf/ld.so --library-path $library_path \
1870 ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
1871 cmp ${objpfx}tst-gettext2.out - <<EOF
1872 String1 - Lang1: 1st string
1873 --- libc/intl/tst-translit.sh
1874 +++ libc/intl/tst-translit.sh
1875 @@ -36,7 +36,10 @@
1876 LOCPATH=${common_objpfx}localedata
1877 export LOCPATH
1878
1879 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
1880 +# make sure libdl is also in path in case sandbox is in use
1881 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1882 +
1883 +${common_objpfx}elf/ld.so --library-path $library_path \
1884 ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
1885
1886 exit $?
1887 --- libc/malloc/tst-mtrace.sh
1888 +++ libc/malloc/tst-mtrace.sh
1889 @@ -24,9 +24,12 @@
1890 status=0
1891 trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
1892
1893 +# make sure libdl is also in path in case sandbox is in use
1894 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1895 +
1896 MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
1897 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
1898 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
1899 +${common_objpfx}elf/ld.so --library-path $library_path \
1900 ${common_objpfx}malloc/tst-mtrace || status=1
1901
1902 if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
1903 --- libc/nptl/tst-tls6.sh
1904 +++ libc/nptl/tst-tls6.sh
1905 @@ -5,8 +5,8 @@
1906 rtld_installed_name=$1; shift
1907 logfile=$common_objpfx/nptl/tst-tls6.out
1908
1909 -# We have to find libc and nptl
1910 -library_path=${common_objpfx}:${common_objpfx}nptl
1911 +# We have to find libc and nptl (also libdl in case sandbox is in use)
1912 +library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
1913 tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
1914 ${common_objpfx}/nptl/tst-tls5"
1915
1916 --- libc/posix/globtest.sh
1917 +++ libc/posix/globtest.sh
1918 @@ -18,7 +18,7 @@
1919 esac
1920
1921 # We have to find the libc and the NSS modules.
1922 -library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
1923 +library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
1924
1925 # Since we use `sort' we must make sure to use the same locale everywhere.
1926 LC_ALL=C
1927 --- libc/posix/tst-getconf.sh
1928 +++ libc/posix/tst-getconf.sh
1929 @@ -10,7 +10,10 @@
1930 else
1931 rtld_installed_name=$1; shift
1932 runit() {
1933 - ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
1934 +
1935 + # make sure libdl is also in path in case sandbox is in use
1936 + library_path=${common_objpfx}:${common_objpfx}/dlfcn
1937 + ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
1938 }
1939 fi
1940
1941 --- libc/posix/wordexp-tst.sh
1942 +++ libc/posix/wordexp-tst.sh
1943 @@ -19,8 +19,11 @@
1944 "
1945 export IFS
1946
1947 +# make sure libdl is also in path in case sandbox is in use
1948 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
1949 +
1950 failed=0
1951 -${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
1952 +${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
1953 ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
1954 cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
1955 wordexp returned 0
1956
1957
1958
1959 1.1 src/patchsets/glibc/2.16.0/5063_all_glibc-dont-build-timezone.patch
1960
1961 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/5063_all_glibc-dont-build-timezone.patch?rev=1.1&view=markup
1962 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/5063_all_glibc-dont-build-timezone.patch?rev=1.1&content-type=text/plain
1963
1964 Index: 5063_all_glibc-dont-build-timezone.patch
1965 ===================================================================
1966 timezone data has been split into the package sys-libs/timezone-data
1967
1968 --- glibc/Makeconfig
1969 +++ glibc/Makeconfig
1970 @@ -922,1 +922,1 @@
1971 - crypt nss localedata timezone rt conform debug \
1972 + crypt nss localedata rt conform debug \
1973
1974
1975
1976 1.1 src/patchsets/glibc/2.16.0/6022_alpha_alpha-add-fdatasync-support.patch
1977
1978 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6022_alpha_alpha-add-fdatasync-support.patch?rev=1.1&view=markup
1979 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6022_alpha_alpha-add-fdatasync-support.patch?rev=1.1&content-type=text/plain
1980
1981 Index: 6022_alpha_alpha-add-fdatasync-support.patch
1982 ===================================================================
1983 2009-07-25 Aurelien Jarno <aurelien@×××××××.net>
1984
1985 * sysdeps/unix/sysv/linux/kernel-features.h: define
1986 __ASSUME_FDATASYNC.
1987 * sysdeps/unix/sysv/linux/fdatasync.c: New file.
1988 * sysdeps/unix/sysv/linux/Makefile: compile fdatasync.c with
1989 -fexceptions.
1990 * sysdeps/unix/sysv/linux/syscalls.list: Remove fdatasync.
1991
1992 ---
1993 sysdeps/unix/sysv/linux/Makefile | 1
1994 sysdeps/unix/sysv/linux/fdatasync.c | 69 ++++++++++++++++++++++++++++++
1995 sysdeps/unix/sysv/linux/kernel-features.h | 6 ++
1996 sysdeps/unix/sysv/linux/syscalls.list | 1
1997 4 files changed, 76 insertions(+), 1 deletion(-)
1998
1999 --- a/sysdeps/unix/sysv/linux/kernel-features.h
2000 +++ b/sysdeps/unix/sysv/linux/kernel-features.h
2001 @@ -474,6 +474,12 @@
2002 # define __ASSUME_FUTEX_LOCK_PI 1
2003 #endif
2004
2005 +/* Support for fsyncdata syscall was added in 2.6.22 on alpha, but it
2006 + was already present in 2.0 kernels on other architectures. */
2007 +#if (!defined __alpha || __LINUX_KERNEL_VERSION >= 0x020616)
2008 +# define __ASSUME_FDATASYNC 1
2009 +#endif
2010 +
2011 /* Support for utimensat syscall was added in 2.6.22, on SH
2012 only after 2.6.22-rc1. */
2013 #if __LINUX_KERNEL_VERSION >= 0x020616 \
2014 --- /dev/null
2015 +++ b/sysdeps/unix/sysv/linux/fdatasync.c
2016 @@ -0,0 +1,69 @@
2017 +/* fdatasync -- synchronize at least the data part of a file with
2018 + the underlying media. Linux version.
2019 +
2020 + Copyright (C) 2007 Free Software Foundation, Inc.
2021 + This file is part of the GNU C Library.
2022 +
2023 + The GNU C Library is free software; you can redistribute it and/or
2024 + modify it under the terms of the GNU Lesser General Public
2025 + License as published by the Free Software Foundation; either
2026 + version 2.1 of the License, or (at your option) any later version.
2027 +
2028 + The GNU C Library is distributed in the hope that it will be useful,
2029 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2030 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2031 + Lesser General Public License for more details.
2032 +
2033 + You should have received a copy of the GNU Lesser General Public
2034 + License along with the GNU C Library; if not, write to the Free
2035 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2036 + 02111-1307 USA. */
2037 +
2038 +#include <errno.h>
2039 +#include <unistd.h>
2040 +
2041 +#include <sysdep-cancel.h>
2042 +#include <sys/syscall.h>
2043 +#include <bp-checks.h>
2044 +
2045 +#include <kernel-features.h>
2046 +
2047 +#if defined __NR_fdatasync && !defined __ASSUME_FDATASYNC
2048 +static int __have_no_fdatasync;
2049 +#endif
2050 +
2051 +static int
2052 +do_fdatasync (int fd)
2053 +{
2054 +#ifdef __ASSUME_FDATASYNC
2055 + return INLINE_SYSCALL (fdatasync, 1, fd);
2056 +#elif defined __NR_fdatasync
2057 + if (!__builtin_expect (__have_no_fdatasync, 0))
2058 + {
2059 + int result = INLINE_SYSCALL (fdatasync, 1, fd);
2060 + if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
2061 + return result;
2062 +
2063 + __have_no_fdatasync = 1;
2064 + }
2065 +#endif
2066 + return INLINE_SYSCALL (fsync, 1, fd);
2067 +}
2068 +
2069 +int
2070 +__fdatasync (int fd)
2071 +{
2072 + if (SINGLE_THREAD_P)
2073 + return do_fdatasync (fd);
2074 +
2075 + int oldtype = LIBC_CANCEL_ASYNC ();
2076 +
2077 + int result = do_fdatasync (fd);
2078 +
2079 + LIBC_CANCEL_RESET (oldtype);
2080 +
2081 + return result;
2082 +}
2083 +
2084 +weak_alias (__fdatasync, fdatasync)
2085 +
2086 --- a/sysdeps/unix/sysv/linux/syscalls.list
2087 +++ b/sysdeps/unix/sysv/linux/syscalls.list
2088 @@ -11,7 +11,6 @@
2089 epoll_create1 EXTRA epoll_create1 i:i epoll_create1
2090 epoll_ctl EXTRA epoll_ctl i:iiip epoll_ctl
2091 epoll_wait EXTRA epoll_wait Ci:ipii epoll_wait
2092 -fdatasync - fdatasync Ci:i fdatasync
2093 flock - flock i:ii __flock flock
2094 fork - fork i: __libc_fork __fork fork
2095 get_kernel_syms EXTRA get_kernel_syms i:p get_kernel_syms
2096 --- a/sysdeps/unix/sysv/linux/Makefile
2097 +++ b/sysdeps/unix/sysv/linux/Makefile
2098 @@ -17,6 +17,7 @@
2099 eventfd eventfd_read eventfd_write
2100
2101
2102 +CFLAGS-fdatasync.c = -fexceptions
2103 CFLAGS-gethostid.c = -fexceptions
2104
2105 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
2106
2107
2108
2109 1.1 src/patchsets/glibc/2.16.0/6120_all_ppc-glibc-2.9-atomic.patch
2110
2111 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6120_all_ppc-glibc-2.9-atomic.patch?rev=1.1&view=markup
2112 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6120_all_ppc-glibc-2.9-atomic.patch?rev=1.1&content-type=text/plain
2113
2114 Index: 6120_all_ppc-glibc-2.9-atomic.patch
2115 ===================================================================
2116 http://sourceware.org/ml/libc-alpha/2011-07/msg00041.html
2117
2118 sniped from suse
2119
2120 Index: sysdeps/powerpc/bits/atomic.h
2121 ===================================================================
2122 RCS file: /cvs/glibc/libc/sysdeps/powerpc/bits/atomic.h,v
2123 retrieving revision 1.17
2124 diff -u -a -p -r1.17 atomic.h
2125 --- a/sysdeps/powerpc/bits/atomic.h 26 Mar 2007 20:15:28 -0000 1.17
2126 +++ b/sysdeps/powerpc/bits/atomic.h 31 May 2008 08:50:56 -0000
2127 @@ -85,14 +85,14 @@ typedef uintmax_t uatomic_max_t;
2128 __typeof (*(mem)) __tmp; \
2129 __typeof (mem) __memp = (mem); \
2130 __asm __volatile ( \
2131 - "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
2132 + "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
2133 " cmpw %0,%2\n" \
2134 " bne 2f\n" \
2135 - " stwcx. %3,0,%1\n" \
2136 + " stwcx. %3,%y1\n" \
2137 " bne- 1b\n" \
2138 "2: " __ARCH_ACQ_INSTR \
2139 - : "=&r" (__tmp) \
2140 - : "b" (__memp), "r" (oldval), "r" (newval) \
2141 + : "=&r" (__tmp), "+Z" (*__memp) \
2142 + : "r" (oldval), "r" (newval) \
2143 : "cr0", "memory"); \
2144 __tmp; \
2145 })
2146 @@ -102,14 +102,14 @@ typedef uintmax_t uatomic_max_t;
2147 __typeof (*(mem)) __tmp; \
2148 __typeof (mem) __memp = (mem); \
2149 __asm __volatile (__ARCH_REL_INSTR "\n" \
2150 - "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
2151 + "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
2152 " cmpw %0,%2\n" \
2153 " bne 2f\n" \
2154 - " stwcx. %3,0,%1\n" \
2155 + " stwcx. %3,%y1\n" \
2156 " bne- 1b\n" \
2157 "2: " \
2158 - : "=&r" (__tmp) \
2159 - : "b" (__memp), "r" (oldval), "r" (newval) \
2160 + : "=&r" (__tmp), "+Z" (__memp) \
2161 + : "r" (oldval), "r" (newval) \
2162 : "cr0", "memory"); \
2163 __tmp; \
2164 })
2165 @@ -118,12 +118,12 @@ typedef uintmax_t uatomic_max_t;
2166 ({ \
2167 __typeof (*mem) __val; \
2168 __asm __volatile ( \
2169 - "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
2170 - " stwcx. %3,0,%2\n" \
2171 + "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
2172 + " stwcx. %2,%y1\n" \
2173 " bne- 1b\n" \
2174 " " __ARCH_ACQ_INSTR \
2175 - : "=&r" (__val), "=m" (*mem) \
2176 - : "b" (mem), "r" (value), "m" (*mem) \
2177 + : "=&r" (__val), "+Z" (*mem) \
2178 + : "r" (value) \
2179 : "cr0", "memory"); \
2180 __val; \
2181 })
2182 @@ -132,11 +132,11 @@ typedef uintmax_t uatomic_max_t;
2183 ({ \
2184 __typeof (*mem) __val; \
2185 __asm __volatile (__ARCH_REL_INSTR "\n" \
2186 - "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
2187 - " stwcx. %3,0,%2\n" \
2188 + "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
2189 + " stwcx. %2,%y1\n" \
2190 " bne- 1b" \
2191 - : "=&r" (__val), "=m" (*mem) \
2192 - : "b" (mem), "r" (value), "m" (*mem) \
2193 + : "=&r" (__val), "+Z" (*mem) \
2194 + : "r" (value) \
2195 : "cr0", "memory"); \
2196 __val; \
2197 })
2198 @@ -144,12 +144,12 @@ typedef uintmax_t uatomic_max_t;
2199 #define __arch_atomic_exchange_and_add_32(mem, value) \
2200 ({ \
2201 __typeof (*mem) __val, __tmp; \
2202 - __asm __volatile ("1: lwarx %0,0,%3\n" \
2203 - " add %1,%0,%4\n" \
2204 - " stwcx. %1,0,%3\n" \
2205 + __asm __volatile ("1: lwarx %0,%y2\n" \
2206 + " add %1,%0,%3\n" \
2207 + " stwcx. %1,%y2\n" \
2208 " bne- 1b" \
2209 - : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
2210 - : "b" (mem), "r" (value), "m" (*mem) \
2211 + : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
2212 + : "r" (value) \
2213 : "cr0", "memory"); \
2214 __val; \
2215 })
2216 @@ -157,12 +157,12 @@ typedef uintmax_t uatomic_max_t;
2217 #define __arch_atomic_increment_val_32(mem) \
2218 ({ \
2219 __typeof (*(mem)) __val; \
2220 - __asm __volatile ("1: lwarx %0,0,%2\n" \
2221 + __asm __volatile ("1: lwarx %0,%y1\n" \
2222 " addi %0,%0,1\n" \
2223 - " stwcx. %0,0,%2\n" \
2224 + " stwcx. %0,%y1\n" \
2225 " bne- 1b" \
2226 - : "=&b" (__val), "=m" (*mem) \
2227 - : "b" (mem), "m" (*mem) \
2228 + : "=&b" (__val), "+Z" (*mem) \
2229 + : \
2230 : "cr0", "memory"); \
2231 __val; \
2232 })
2233 @@ -170,27 +170,27 @@ typedef uintmax_t uatomic_max_t;
2234 #define __arch_atomic_decrement_val_32(mem) \
2235 ({ \
2236 __typeof (*(mem)) __val; \
2237 - __asm __volatile ("1: lwarx %0,0,%2\n" \
2238 + __asm __volatile ("1: lwarx %0,%y1\n" \
2239 " subi %0,%0,1\n" \
2240 - " stwcx. %0,0,%2\n" \
2241 + " stwcx. %0,%y1\n" \
2242 " bne- 1b" \
2243 - : "=&b" (__val), "=m" (*mem) \
2244 - : "b" (mem), "m" (*mem) \
2245 + : "=&b" (__val), "+Z" (*mem) \
2246 + : \
2247 : "cr0", "memory"); \
2248 __val; \
2249 })
2250
2251 #define __arch_atomic_decrement_if_positive_32(mem) \
2252 ({ int __val, __tmp; \
2253 - __asm __volatile ("1: lwarx %0,0,%3\n" \
2254 + __asm __volatile ("1: lwarx %0,%y2\n" \
2255 " cmpwi 0,%0,0\n" \
2256 " addi %1,%0,-1\n" \
2257 " ble 2f\n" \
2258 - " stwcx. %1,0,%3\n" \
2259 + " stwcx. %1,%y2\n" \
2260 " bne- 1b\n" \
2261 "2: " __ARCH_ACQ_INSTR \
2262 - : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
2263 - : "b" (mem), "m" (*mem) \
2264 + : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
2265 + : \
2266 : "cr0", "memory"); \
2267 __val; \
2268 })
2269 Index: sysdeps/powerpc/powerpc32/bits/atomic.h
2270 ===================================================================
2271 RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc32/bits/atomic.h,v
2272 retrieving revision 1.6
2273 diff -u -a -p -r1.6 atomic.h
2274 --- a/sysdeps/powerpc/powerpc32/bits/atomic.h 26 Mar 2007 20:15:45 -0000 1.6
2275 +++ b/sysdeps/powerpc/powerpc32/bits/atomic.h 31 May 2008 08:50:56 -0000
2276 @@ -44,14 +44,14 @@
2277 ({ \
2278 unsigned int __tmp; \
2279 __asm __volatile ( \
2280 - "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
2281 + "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
2282 " subf. %0,%2,%0\n" \
2283 " bne 2f\n" \
2284 - " stwcx. %3,0,%1\n" \
2285 + " stwcx. %3,%y1\n" \
2286 " bne- 1b\n" \
2287 "2: " __ARCH_ACQ_INSTR \
2288 - : "=&r" (__tmp) \
2289 - : "b" (mem), "r" (oldval), "r" (newval) \
2290 + : "=&r" (__tmp), "+Z" (*(mem)) \
2291 + : "r" (oldval), "r" (newval) \
2292 : "cr0", "memory"); \
2293 __tmp != 0; \
2294 })
2295 @@ -60,14 +60,14 @@
2296 ({ \
2297 unsigned int __tmp; \
2298 __asm __volatile (__ARCH_REL_INSTR "\n" \
2299 - "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
2300 + "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
2301 " subf. %0,%2,%0\n" \
2302 " bne 2f\n" \
2303 - " stwcx. %3,0,%1\n" \
2304 + " stwcx. %3,%y1\n" \
2305 " bne- 1b\n" \
2306 "2: " \
2307 - : "=&r" (__tmp) \
2308 - : "b" (mem), "r" (oldval), "r" (newval) \
2309 + : "=&r" (__tmp), "+Z" (*(mem)) \
2310 + : "r" (oldval), "r" (newval) \
2311 : "cr0", "memory"); \
2312 __tmp != 0; \
2313 })
2314 Index: sysdeps/powerpc/powerpc64/bits/atomic.h
2315 ===================================================================
2316 RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc64/bits/atomic.h,v
2317 retrieving revision 1.8
2318 diff -u -a -p -r1.8 atomic.h
2319 --- a/sysdeps/powerpc/powerpc64/bits/atomic.h 26 Mar 2007 20:16:03 -0000 1.8
2320 +++ b/sysdeps/powerpc/powerpc64/bits/atomic.h 31 May 2008 08:50:56 -0000
2321 @@ -44,14 +44,14 @@
2322 ({ \
2323 unsigned int __tmp, __tmp2; \
2324 __asm __volatile (" clrldi %1,%1,32\n" \
2325 - "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
2326 + "1: lwarx %0,%y2" MUTEX_HINT_ACQ "\n" \
2327 " subf. %0,%1,%0\n" \
2328 " bne 2f\n" \
2329 - " stwcx. %4,0,%2\n" \
2330 + " stwcx. %4,%y2\n" \
2331 " bne- 1b\n" \
2332 "2: " __ARCH_ACQ_INSTR \
2333 - : "=&r" (__tmp), "=r" (__tmp2) \
2334 - : "b" (mem), "1" (oldval), "r" (newval) \
2335 + : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
2336 + : "1" (oldval), "r" (newval) \
2337 : "cr0", "memory"); \
2338 __tmp != 0; \
2339 })
2340 @@ -61,14 +61,14 @@
2341 unsigned int __tmp, __tmp2; \
2342 __asm __volatile (__ARCH_REL_INSTR "\n" \
2343 " clrldi %1,%1,32\n" \
2344 - "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
2345 + "1: lwarx %0,%y2" MUTEX_HINT_REL "\n" \
2346 " subf. %0,%1,%0\n" \
2347 " bne 2f\n" \
2348 - " stwcx. %4,0,%2\n" \
2349 + " stwcx. %4,%y2\n" \
2350 " bne- 1b\n" \
2351 "2: " \
2352 - : "=&r" (__tmp), "=r" (__tmp2) \
2353 - : "b" (mem), "1" (oldval), "r" (newval) \
2354 + : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
2355 + : "1" (oldval), "r" (newval) \
2356 : "cr0", "memory"); \
2357 __tmp != 0; \
2358 })
2359 @@ -82,14 +82,14 @@
2360 ({ \
2361 unsigned long __tmp; \
2362 __asm __volatile ( \
2363 - "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
2364 + "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
2365 " subf. %0,%2,%0\n" \
2366 " bne 2f\n" \
2367 - " stdcx. %3,0,%1\n" \
2368 + " stdcx. %3,%y1\n" \
2369 " bne- 1b\n" \
2370 "2: " __ARCH_ACQ_INSTR \
2371 - : "=&r" (__tmp) \
2372 - : "b" (mem), "r" (oldval), "r" (newval) \
2373 + : "=&r" (__tmp), "+Z" (*(mem)) \
2374 + : "r" (oldval), "r" (newval) \
2375 : "cr0", "memory"); \
2376 __tmp != 0; \
2377 })
2378 @@ -98,14 +98,14 @@
2379 ({ \
2380 unsigned long __tmp; \
2381 __asm __volatile (__ARCH_REL_INSTR "\n" \
2382 - "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
2383 + "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
2384 " subf. %0,%2,%0\n" \
2385 " bne 2f\n" \
2386 - " stdcx. %3,0,%1\n" \
2387 + " stdcx. %3,%y1\n" \
2388 " bne- 1b\n" \
2389 "2: " \
2390 - : "=&r" (__tmp) \
2391 - : "b" (mem), "r" (oldval), "r" (newval) \
2392 + : "=&r" (__tmp), "+Z" (*(mem)) \
2393 + : "r" (oldval), "r" (newval) \
2394 : "cr0", "memory"); \
2395 __tmp != 0; \
2396 })
2397 @@ -115,14 +115,14 @@
2398 __typeof (*(mem)) __tmp; \
2399 __typeof (mem) __memp = (mem); \
2400 __asm __volatile ( \
2401 - "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
2402 + "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
2403 " cmpd %0,%2\n" \
2404 " bne 2f\n" \
2405 - " stdcx. %3,0,%1\n" \
2406 + " stdcx. %3,%y1\n" \
2407 " bne- 1b\n" \
2408 "2: " __ARCH_ACQ_INSTR \
2409 - : "=&r" (__tmp) \
2410 - : "b" (__memp), "r" (oldval), "r" (newval) \
2411 + : "=&r" (__tmp), "+Z" (*__memp) \
2412 + : "r" (oldval), "r" (newval) \
2413 : "cr0", "memory"); \
2414 __tmp; \
2415 })
2416 @@ -132,14 +132,14 @@
2417 __typeof (*(mem)) __tmp; \
2418 __typeof (mem) __memp = (mem); \
2419 __asm __volatile (__ARCH_REL_INSTR "\n" \
2420 - "1: ldarx %0,0,%1" MUTEX_HINT_REL "\n" \
2421 + "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
2422 " cmpd %0,%2\n" \
2423 " bne 2f\n" \
2424 - " stdcx. %3,0,%1\n" \
2425 + " stdcx. %3,%y1\n" \
2426 " bne- 1b\n" \
2427 "2: " \
2428 - : "=&r" (__tmp) \
2429 - : "b" (__memp), "r" (oldval), "r" (newval) \
2430 + : "=&r" (__tmp), "+Z" (*__memp) \
2431 + : "r" (oldval), "r" (newval) \
2432 : "cr0", "memory"); \
2433 __tmp; \
2434 })
2435 @@ -148,12 +148,12 @@
2436 ({ \
2437 __typeof (*mem) __val; \
2438 __asm __volatile (__ARCH_REL_INSTR "\n" \
2439 - "1: ldarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
2440 - " stdcx. %3,0,%2\n" \
2441 + "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
2442 + " stdcx. %2,%y1\n" \
2443 " bne- 1b\n" \
2444 " " __ARCH_ACQ_INSTR \
2445 - : "=&r" (__val), "=m" (*mem) \
2446 - : "b" (mem), "r" (value), "m" (*mem) \
2447 + : "=&r" (__val), "+Z" (*(mem)) \
2448 + : "r" (value) \
2449 : "cr0", "memory"); \
2450 __val; \
2451 })
2452 @@ -162,11 +162,11 @@
2453 ({ \
2454 __typeof (*mem) __val; \
2455 __asm __volatile (__ARCH_REL_INSTR "\n" \
2456 - "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
2457 - " stdcx. %3,0,%2\n" \
2458 + "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
2459 + " stdcx. %2,%y1\n" \
2460 " bne- 1b" \
2461 - : "=&r" (__val), "=m" (*mem) \
2462 - : "b" (mem), "r" (value), "m" (*mem) \
2463 + : "=&r" (__val), "+Z" (*(mem)) \
2464 + : "r" (value) \
2465 : "cr0", "memory"); \
2466 __val; \
2467 })
2468 @@ -174,12 +174,12 @@
2469 #define __arch_atomic_exchange_and_add_64(mem, value) \
2470 ({ \
2471 __typeof (*mem) __val, __tmp; \
2472 - __asm __volatile ("1: ldarx %0,0,%3\n" \
2473 - " add %1,%0,%4\n" \
2474 - " stdcx. %1,0,%3\n" \
2475 + __asm __volatile ("1: ldarx %0,%y2\n" \
2476 + " add %1,%0,%3\n" \
2477 + " stdcx. %1,%y2\n" \
2478 " bne- 1b" \
2479 - : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
2480 - : "b" (mem), "r" (value), "m" (*mem) \
2481 + : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
2482 + : "r" (value) \
2483 : "cr0", "memory"); \
2484 __val; \
2485 })
2486 @@ -187,12 +187,12 @@
2487 #define __arch_atomic_increment_val_64(mem) \
2488 ({ \
2489 __typeof (*(mem)) __val; \
2490 - __asm __volatile ("1: ldarx %0,0,%2\n" \
2491 + __asm __volatile ("1: ldarx %0,%y1\n" \
2492 " addi %0,%0,1\n" \
2493 - " stdcx. %0,0,%2\n" \
2494 + " stdcx. %0,%y1\n" \
2495 " bne- 1b" \
2496 - : "=&b" (__val), "=m" (*mem) \
2497 - : "b" (mem), "m" (*mem) \
2498 + : "=&b" (__val), "+Z" (*(mem)) \
2499 + : \
2500 : "cr0", "memory"); \
2501 __val; \
2502 })
2503 @@ -200,27 +200,27 @@
2504 #define __arch_atomic_decrement_val_64(mem) \
2505 ({ \
2506 __typeof (*(mem)) __val; \
2507 - __asm __volatile ("1: ldarx %0,0,%2\n" \
2508 + __asm __volatile ("1: ldarx %0,%y1\n" \
2509 " subi %0,%0,1\n" \
2510 - " stdcx. %0,0,%2\n" \
2511 + " stdcx. %0,%y1\n" \
2512 " bne- 1b" \
2513 - : "=&b" (__val), "=m" (*mem) \
2514 - : "b" (mem), "m" (*mem) \
2515 + : "=&b" (__val), "+Z" (*(mem)) \
2516 + : \
2517 : "cr0", "memory"); \
2518 __val; \
2519 })
2520
2521 #define __arch_atomic_decrement_if_positive_64(mem) \
2522 ({ int __val, __tmp; \
2523 - __asm __volatile ("1: ldarx %0,0,%3\n" \
2524 + __asm __volatile ("1: ldarx %0,%y2\n" \
2525 " cmpdi 0,%0,0\n" \
2526 " addi %1,%0,-1\n" \
2527 " ble 2f\n" \
2528 - " stdcx. %1,0,%3\n" \
2529 + " stdcx. %1,%y2\n" \
2530 " bne- 1b\n" \
2531 "2: " __ARCH_ACQ_INSTR \
2532 - : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
2533 - : "b" (mem), "m" (*mem) \
2534 + : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
2535 + : \
2536 : "cr0", "memory"); \
2537 __val; \
2538 })
2539
2540
2541
2542 1.1 src/patchsets/glibc/2.16.0/6230_all_arm-glibc-hardened.patch
2543
2544 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6230_all_arm-glibc-hardened.patch?rev=1.1&view=markup
2545 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6230_all_arm-glibc-hardened.patch?rev=1.1&content-type=text/plain
2546
2547 Index: 6230_all_arm-glibc-hardened.patch
2548 ===================================================================
2549 patch by David Lamparter to fix build errors for hardened/arm systems.
2550 the logic in setjmp/__longjmp incorrectly tie to "PIC" to figure out
2551 whether the code is going into a shared library when it should be using
2552 "SHARED". otherwise, building static PIC code goes wrong.
2553
2554 https://bugs.gentoo.org/336914
2555 http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
2556
2557 --- ports/sysdeps/arm/setjmp.S
2558 +++ ports/sysdeps/arm/setjmp.S
2559 @@ -37,7 +37,7 @@
2560 add a3, a3, a4
2561 ldr a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
2562 #else
2563 -#ifdef PIC
2564 +#ifdef SHARED
2565 ldr a3, 1f
2566 ldr a4, Lrtld_global_ro
2567 0: add a3, pc, a3
2568 @@ -84,7 +84,7 @@
2569 Lrtld_local_ro:
2570 .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
2571 #else
2572 -#ifdef PIC
2573 +#ifdef SHARED
2574 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
2575 Lrtld_global_ro:
2576 .long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
2577 --- ports/sysdeps/arm/__longjmp.S
2578 +++ ports/sysdeps/arm/__longjmp.S
2579 @@ -43,7 +43,7 @@
2580 add a2, a2, a3
2581 ldr a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
2582 #else
2583 -#ifdef PIC
2584 +#ifdef SHARED
2585 ldr a2, 1f
2586 ldr a3, Lrtld_global_ro
2587 0: add a2, pc, a2
2588 @@ -87,7 +87,7 @@
2589 Lrtld_local_ro:
2590 .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
2591 #else
2592 -#ifdef PIC
2593 +#ifdef SHARED
2594 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
2595 Lrtld_global_ro:
2596 .long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
2597
2598
2599
2600 1.1 src/patchsets/glibc/2.16.0/6250_all_glibc-2.14-arm-unaligned-reloc.patch
2601
2602 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6250_all_glibc-2.14-arm-unaligned-reloc.patch?rev=1.1&view=markup
2603 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6250_all_glibc-2.14-arm-unaligned-reloc.patch?rev=1.1&content-type=text/plain
2604
2605 Index: 6250_all_glibc-2.14-arm-unaligned-reloc.patch
2606 ===================================================================
2607 https://bugs.gentoo.org/394237
2608
2609 --- a/ports/sysdeps/arm/dl-machine.h
2610 +++ b/ports/sysdeps/arm/dl-machine.h
2611 @@ -413,6 +413,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
2612 break;
2613 case R_ARM_ABS32:
2614 {
2615 + struct unaligned
2616 + {
2617 + Elf32_Addr x;
2618 + } __attribute__((packed, may_alias));
2619 # ifndef RTLD_BOOTSTRAP
2620 /* This is defined in rtld.c, but nowhere in the static
2621 libc.a; make the reference weak so static programs can
2622 @@ -431,7 +436,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
2623 used while loading those libraries. */
2624 value -= map->l_addr + refsym->st_value;
2625 # endif
2626 - *reloc_addr += value;
2627 + /* Support relocations on mis-aligned offsets. */
2628 + ((struct unaligned *) reloc_addr)->x += value;
2629 break;
2630 }
2631 case R_ARM_TLS_DESC:
2632
2633
2634
2635 1.1 src/patchsets/glibc/2.16.0/6305_all_glibc-2.11-s390-older-binutils.patch
2636
2637 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6305_all_glibc-2.11-s390-older-binutils.patch?rev=1.1&view=markup
2638 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6305_all_glibc-2.11-s390-older-binutils.patch?rev=1.1&content-type=text/plain
2639
2640 Index: 6305_all_glibc-2.11-s390-older-binutils.patch
2641 ===================================================================
2642 http://sourceware.org/ml/libc-alpha/2011-03/msg00038.html
2643
2644 From: "Andreas Krebbel" <krebbel@××××××××××××××.com>
2645 Date: Fri, 18 Mar 2011 11:20:22 +0100
2646 To: libc-alpha@××××××××××.org
2647 Cc: aurelien@×××××××.net
2648 Subject: [PATCH] S/390: UTF conversion modules - use .insn to avoid 'as' errors
2649
2650 Hi,
2651
2652 the attached patch fixes the problem mentioned by Aurelien in:
2653 http://sources.redhat.com/ml/libc-alpha/2011-03/msg00000.html
2654
2655 The UTF conversion modules detect at runtime whether the conversion
2656 instructions can be used or not. So 'as' should not reject them when
2657 building for a lower CPU level. On the other hand it should
2658 nevertheless be possible to build the modules optimizing for a higher
2659 CPU level without as rejecting new instructions. One way is to
2660 introduce -march=all in 'as' in order to basically disable the
2661 instruction checks. I've committed a patch to binutils introducing
2662 -march=all so that it can be used in the future:
2663
2664 http://sourceware.org/ml/binutils/2011-03/msg00355.html
2665
2666 But we cannot use that option right now since it would bind glibc
2667 build to upstream binutils. For now I don't see a way around
2668 replacing the mnemonics with .insn .
2669
2670 Done with the attached patch. I've verified that the same binary code
2671 is generated for the modules.
2672
2673 Bye,
2674
2675 -Andreas-
2676
2677
2678 2011-03-18 Andreas Krebbel <Andreas.Krebbel@××××××.com>
2679
2680 * sysdeps/s390/s390-64/utf16-utf32-z9.c: Replace UTF conversion
2681 mnemonics with .insn.
2682 * sysdeps/s390/s390-64/utf8-utf16-z9.c: Likewise.
2683 * sysdeps/s390/s390-64/utf8-utf32-z9.c: Likewise.
2684
2685 Index: glibc/sysdeps/s390/s390-64/utf16-utf32-z9.c
2686 ===================================================================
2687 --- glibc.orig/sysdeps/s390/s390-64/utf16-utf32-z9.c
2688 +++ glibc/sysdeps/s390/s390-64/utf16-utf32-z9.c
2689 @@ -208,7 +208,8 @@ gconv_end (struct __gconv_step *data)
2690 until this gets resolved. */ \
2691 if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */ \
2692 { \
2693 - HARDWARE_CONVERT ("cu24 %0, %1, 1"); \
2694 + /* cu24 %0, %1, 1 */ \
2695 + HARDWARE_CONVERT (".insn rrf,0xb9b10000,%0,%1,1,0"); \
2696 if (inptr != inend) \
2697 { \
2698 /* Check if the third byte is \
2699 @@ -278,7 +279,8 @@ gconv_end (struct __gconv_step *data)
2700 { \
2701 if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
2702 { \
2703 - HARDWARE_CONVERT ("cu42 %0, %1"); \
2704 + /* cu42 %0, %1 */ \
2705 + HARDWARE_CONVERT (".insn rre,0xb9b30000,%0,%1"); \
2706 \
2707 if (inptr != inend) \
2708 { \
2709 Index: glibc/sysdeps/s390/s390-64/utf8-utf16-z9.c
2710 ===================================================================
2711 --- glibc.orig/sysdeps/s390/s390-64/utf8-utf16-z9.c
2712 +++ glibc/sysdeps/s390/s390-64/utf8-utf16-z9.c
2713 @@ -186,7 +186,8 @@ gconv_end (struct __gconv_step *data)
2714 { \
2715 if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
2716 { \
2717 - HARDWARE_CONVERT ("cu12 %0, %1, 1"); \
2718 + /* cu12 %0, %1, 1 */ \
2719 + HARDWARE_CONVERT (".insn rrf,0xb2a70000,%0,%1,1,0"); \
2720 \
2721 if (inptr != inend) \
2722 { \
2723 @@ -194,7 +195,7 @@ gconv_end (struct __gconv_step *data)
2724 for (i = 1; inptr + i < inend; ++i) \
2725 if ((inptr[i] & 0xc0) != 0x80) \
2726 break; \
2727 - \
2728 + \
2729 if (__builtin_expect (inptr + i == inend, 1)) \
2730 { \
2731 result = __GCONV_INCOMPLETE_INPUT; \
2732 @@ -350,7 +351,8 @@ gconv_end (struct __gconv_step *data)
2733 until this gets resolved. */ \
2734 if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */ \
2735 { \
2736 - HARDWARE_CONVERT ("cu21 %0, %1, 1"); \
2737 + /* cu21 %0, %1, 1 */ \
2738 + HARDWARE_CONVERT (".insn rrf,0xb2a60000,%0,%1,1,0"); \
2739 if (inptr != inend) \
2740 { \
2741 /* Check if the third byte is \
2742 Index: glibc/sysdeps/s390/s390-64/utf8-utf32-z9.c
2743 ===================================================================
2744 --- glibc.orig/sysdeps/s390/s390-64/utf8-utf32-z9.c
2745 +++ glibc/sysdeps/s390/s390-64/utf8-utf32-z9.c
2746 @@ -190,7 +190,8 @@ gconv_end (struct __gconv_step *data)
2747 { \
2748 if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
2749 { \
2750 - HARDWARE_CONVERT ("cu14 %0, %1, 1"); \
2751 + /* cu14 %0, %1, 1 */ \
2752 + HARDWARE_CONVERT (".insn rrf,0xb9b00000,%0,%1,1,0"); \
2753 \
2754 if (inptr != inend) \
2755 { \
2756 @@ -417,7 +418,8 @@ gconv_end (struct __gconv_step *data)
2757 { \
2758 if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
2759 { \
2760 - HARDWARE_CONVERT ("cu41 %0, %1"); \
2761 + /* cu41 %0, %1 */ \
2762 + HARDWARE_CONVERT (".insn rre,0xb9b20000,%0,%1"); \
2763 \
2764 if (inptr != inend) \
2765 { \
2766
2767
2768
2769 1.1 src/patchsets/glibc/2.16.0/6600_mips_librt-mips.patch
2770
2771 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6600_mips_librt-mips.patch?rev=1.1&view=markup
2772 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6600_mips_librt-mips.patch?rev=1.1&content-type=text/plain
2773
2774 Index: 6600_mips_librt-mips.patch
2775 ===================================================================
2776 we kind of screwed ourselves into a corner by having the clock symbols
2777 exported only with the glibc-2.0 version ... this patch fixes the
2778 export so all new binaries built against librt will use the correct
2779 glibc-2.2 symbol version
2780
2781 one day, we'll just drop this on the floor (maybe after 2006.1)
2782
2783 --- ports/sysdeps/unix/sysv/linux/mips/Versions
2784 +++ ports/sysdeps/unix/sysv/linux/mips/Versions
2785 @@ -34,3 +34,9 @@
2786 _test_and_set;
2787 }
2788 }
2789 +librt {
2790 + GLIBC_2.0 {
2791 + # c*
2792 + clock_gettime; clock_settime;
2793 + }
2794 +}
2795 --- Versions.def
2796 +++ Versions.def
2797 @@ -90,6 +90,7 @@
2798 GLIBC_PRIVATE
2799 }
2800 librt {
2801 + GLIBC_2.0
2802 GLIBC_2.1
2803 GLIBC_2.2
2804 GLIBC_2.3
2805 --- sysdeps/unix/clock_gettime.c
2806 +++ sysdeps/unix/clock_gettime.c
2807 @@ -23,6 +23,7 @@
2808 #include <sys/time.h>
2809 #include <libc-internal.h>
2810 #include <ldsodefs.h>
2811 +#include <shlib-compat.h>
2812
2813
2814 #if HP_TIMING_AVAIL
2815 @@ -90,7 +91,7 @@
2816
2817 /* Get current value of CLOCK and store it in TP. */
2818 int
2819 -clock_gettime (clockid_t clock_id, struct timespec *tp)
2820 +__clock_gettime (clockid_t clock_id, struct timespec *tp)
2821 {
2822 int retval = -1;
2823 struct timeval tv;
2824 @@ -131,4 +132,10 @@
2825
2826 return retval;
2827 }
2828 -librt_hidden_def (clock_gettime)
2829 +versioned_symbol (librt, __clock_gettime, clock_gettime, GLIBC_2_2);
2830 +librt_hidden_ver (__clock_gettime, clock_gettime)
2831 +
2832 +#if defined __mips__ && defined SHARED
2833 +strong_alias (__clock_gettime, __mips_clock_gettime)
2834 +compat_symbol (librt, __mips_clock_gettime, clock_gettime, GLIBC_2_0);
2835 +#endif
2836 --- sysdeps/unix/clock_settime.c
2837 +++ sysdeps/unix/clock_settime.c
2838 @@ -21,6 +21,7 @@
2839 #include <sys/time.h>
2840 #include <libc-internal.h>
2841 #include <ldsodefs.h>
2842 +#include <shlib-compat.h>
2843
2844
2845 #if HP_TIMING_AVAIL
2846 @@ -38,7 +39,7 @@
2847
2848 /* Set CLOCK to value TP. */
2849 int
2850 -clock_settime (clockid_t clock_id, const struct timespec *tp)
2851 +__clock_settime (clockid_t clock_id, const struct timespec *tp)
2852 {
2853 int retval;
2854
2855 @@ -123,3 +124,9 @@
2856
2857 return retval;
2858 }
2859 +versioned_symbol (librt, __clock_settime, clock_settime, GLIBC_2_2);
2860 +
2861 +#if defined __mips__ && defined SHARED
2862 +strong_alias (__clock_settime, __mips_clock_settime)
2863 +compat_symbol (librt, __mips_clock_settime, clock_settime, GLIBC_2_0);
2864 +#endif
2865
2866
2867
2868 1.1 src/patchsets/glibc/2.16.0/6605_all_glibc-2.4-fpu-cw-mips.patch
2869
2870 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6605_all_glibc-2.4-fpu-cw-mips.patch?rev=1.1&view=markup
2871 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/6605_all_glibc-2.4-fpu-cw-mips.patch?rev=1.1&content-type=text/plain
2872
2873 Index: 6605_all_glibc-2.4-fpu-cw-mips.patch
2874 ===================================================================
2875 http://sourceware.org/ml/libc-alpha/2002-10/msg00392.html
2876
2877 --- ports/sysdeps/mips/fpu_control.h
2878 +++ ports/sysdeps/mips/fpu_control.h
2879 @@ -74,7 +74,7 @@
2880 #define _FPU_RC_UP 0x2
2881 #define _FPU_RC_DOWN 0x3
2882
2883 -#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */
2884 +#define _FPU_RESERVED 0xfebc0000 /* Reserved bits in cw */
2885
2886
2887 /* The fdlibm code requires strict IEEE double precision arithmetic,
2888
2889
2890
2891 1.1 src/patchsets/glibc/2.16.0/README.history
2892
2893 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/README.history?rev=1.1&view=markup
2894 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.16.0/README.history?rev=1.1&content-type=text/plain
2895
2896 Index: README.history
2897 ===================================================================
2898 1 03 Jun 2012
2899 + 0020_all_glibc-tweak-rfc1918-lookup.patch
2900 + 0052_all_glibc-2.14-resolv-hp-assert.patch
2901 + 0068_all_glibc-2.16-glibc-revert-fseek-on-fclose.patch
2902 + 0070_all_glibc-2.16-sunrpc-bootstrap.patch
2903 + 0080_all_glibc-2.16-revert-x86_64-eagain-pthread_cond_wait.patch
2904 + 0085_all_glibc-disable-ldconfig.patch
2905 + 1005_all_glibc-sigaction.patch
2906 + 1008_all_glibc-2.16-fortify.patch
2907 + 1030_all_glibc-manual-no-perl.patch
2908 + 1040_all_2.3.3-localedef-fix-trampoline.patch
2909 + 1055_all_glibc-resolv-dynamic.patch
2910 + 1070_all_glibc-fadvise64_64.patch
2911 + 1095_all_glibc-2.14-assume-pipe2-dup3.patch
2912 + 1503_hppa_glibc-2.7-hppa-nptl-carlos.patch
2913 + 1505_hppa_glibc-2.11-hppa-nptl.patch
2914 + 1506_all_hppa-prlimit64.patch
2915 + 1530_all_glibc-m68k-sys-user.patch
2916 + 3000_all_2.3.6-dl_execstack-PaX-support.patch
2917 + 3010_all_2.3.3_pre20040117-pt_pax.patch
2918 + 3020_all_glibc-tests-sandbox-libdl-paths.patch
2919 + 5063_all_glibc-dont-build-timezone.patch
2920 + 6022_alpha_alpha-add-fdatasync-support.patch
2921 + 6120_all_ppc-glibc-2.9-atomic.patch
2922 + 6230_all_arm-glibc-hardened.patch
2923 + 6250_all_glibc-2.14-arm-unaligned-reloc.patch
2924 + 6305_all_glibc-2.11-s390-older-binutils.patch
2925 + 6600_mips_librt-mips.patch
2926 + 6605_all_glibc-2.4-fpu-cw-mips.patch