Contents of /trunk/glibc/patches/glibc-2.22-roundup.patch
Parent Directory | Revision Log
Revision 2697 -
(show annotations)
(download)
Mon Sep 21 09:23:25 2015 UTC (8 years, 7 months ago) by niro
File size: 22288 byte(s)
Mon Sep 21 09:23:25 2015 UTC (8 years, 7 months ago) by niro
File size: 22288 byte(s)
-added roundup patch
1 | diff --git a/ChangeLog b/ChangeLog |
2 | index cb9124e..d0d2cbd 100644 |
3 | --- a/ChangeLog |
4 | +++ b/ChangeLog |
5 | @@ -1,3 +1,74 @@ |
6 | +2015-08-31 Brett Neumeier <brett@neumeier.us> |
7 | + |
8 | + [BZ #18870] |
9 | + * sysdeps/sparc/sparc32/sem_open.c: Add missing #include |
10 | + |
11 | +2015-08-28 Mike Frysinger <vapier@gentoo.org> |
12 | + |
13 | + [BZ #18887] |
14 | + * misc/Makefile (tests): Add tst-mntent-blank-corrupt and |
15 | + tst-mntent-blank-passno. |
16 | + * misc/mntent_r.c (__getmntent_r): Do not read past buffer[0]. |
17 | + * misc/tst-mntent-blank-corrupt.c: New test. |
18 | + * misc/tst-mntent-blank-passno.c: New test ripped from ... |
19 | + * misc/tst-mntent.c (do_test): ... here. |
20 | + |
21 | +2015-08-25 Roland McGrath <roland@hack.frob.com> |
22 | + |
23 | + * sysdeps/nacl/start.c (_start): Call __nacl_main instead of main |
24 | + if the weak reference is not null. |
25 | + |
26 | +2015-08-19 Andrew Senkevich <andrew.senkevich@intel.com> |
27 | + |
28 | + [BZ #18796] |
29 | + * scripts/test-installation.pl: Don't add -lmvec to build options |
30 | + if libmvec wasn't built. |
31 | + * NEWS: Mention this fix. |
32 | + |
33 | +2015-08-10 Maxim Ostapenko <m.ostapenko@partner.samsung.com> |
34 | + |
35 | + [BZ #18778] |
36 | + * elf/Makefile (tests): Add Add tst-nodelete2. |
37 | + (modules-names): Add tst-nodelete2mod. |
38 | + (tst-nodelete2mod.so-no-z-defs): New. |
39 | + ($(objpfx)tst-nodelete2): Likewise. |
40 | + ($(objpfx)tst-nodelete2.out): Likewise. |
41 | + (LDFLAGS-tst-nodelete2): Likewise. |
42 | + * elf/dl-close.c (_dl_close_worker): Move DF_1_NODELETE clearing |
43 | + out of loop through all loaded libraries. |
44 | + * elf/tst-nodelete2.c: New file. |
45 | + * elf/tst-nodelete2mod.c: Likewise. |
46 | + |
47 | +2015-08-10 Andreas Schwab <schwab@suse.de> |
48 | + |
49 | + [BZ #18781] |
50 | + * sysdeps/unix/sysv/linux/openat.c (__OPENAT) [MORE_OFLAGS]: Add |
51 | + MORE_OFLAGS to oflag. |
52 | + * io/test-lfs.c (do_test): Test openat64. |
53 | + |
54 | +2015-08-08 John David Anglin <danglin@gcc.gnu.org> |
55 | + |
56 | + [BZ #18787] |
57 | + * sysdeps/unix/sysv/linux/hppa/bits/atomic.h (_LWS_CLOBBER): Revise |
58 | + clobber registers. |
59 | + (atomic_compare_and_exchange_val_acq): Use register asms to assign |
60 | + operand registers. Use register %r20 for EAGAIN and EDEADLOCK checks. |
61 | + Cast return to __typeof (oldval). |
62 | + |
63 | +2015-08-08 Mike Frysinger <vapier@gentoo.org> |
64 | + |
65 | + * sysdeps/unix/sysv/linux/microblaze/sysdep.h: Wrap the whole file |
66 | + in _LINUX_MICROBLAZE_SYSDEP_H defines. Include sysdeps/unix/sysdep.h |
67 | + and delete sys/syscall.h include. |
68 | + |
69 | +2015-08-07 Mike Frysinger <vapier@gentoo.org> |
70 | + |
71 | + * sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Add rtld_hidden_def. |
72 | + |
73 | +2015-08-05 Zack Weinberg <zackw@panix.com> |
74 | + |
75 | + * misc/regexp.h: Update comments. |
76 | + |
77 | 2015-08-05 Carlos O'Donell <carlos@systemhalted.org> |
78 | |
79 | * version.h (RELEASE): Set to "stable". |
80 | diff --git a/NEWS b/NEWS |
81 | index 4c31de7..ce0255a 100644 |
82 | --- a/NEWS |
83 | +++ b/NEWS |
84 | @@ -5,6 +5,12 @@ See the end for copying conditions. |
85 | Please send GNU C library bug reports via <http://sourceware.org/bugzilla/> |
86 | using `glibc' in the "product" field. |
87 | |
88 | +Version 2.22.1 |
89 | + |
90 | +* The following bugs are resolved with this release: |
91 | + |
92 | + 18778, 18781, 18787, 18796, 18870, 18887. |
93 | + |
94 | Version 2.22 |
95 | |
96 | * The following bugs are resolved with this release: |
97 | @@ -84,7 +90,7 @@ Version 2.22 |
98 | release. Use of this header will trigger a deprecation warning. |
99 | Application developers should update their code to use <regex.h> instead. |
100 | |
101 | - This header was formerly part of SUSv2, but was deprecated in 1997 and |
102 | + This header was formerly part of SUS, but was deprecated in 1994 and |
103 | removed from the standard in 2001. Also, the glibc implementation |
104 | leaks memory. See BZ#18681 for more details. |
105 | |
106 | diff --git a/elf/Makefile b/elf/Makefile |
107 | index 4ceeaf8..71a18a1 100644 |
108 | --- a/elf/Makefile |
109 | +++ b/elf/Makefile |
110 | @@ -148,7 +148,8 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ |
111 | tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \ |
112 | tst-nodelete) \ |
113 | tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \ |
114 | - tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened |
115 | + tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \ |
116 | + tst-nodelete2 |
117 | # reldep9 |
118 | ifeq ($(build-hardcoded-path-in-tests),yes) |
119 | tests += tst-dlopen-aout |
120 | @@ -218,7 +219,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ |
121 | tst-initorder2d \ |
122 | tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \ |
123 | tst-array5dep tst-null-argv-lib \ |
124 | - tst-tlsalign-lib tst-nodelete-opened-lib |
125 | + tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod |
126 | ifeq (yes,$(have-protected-data)) |
127 | modules-names += tst-protected1moda tst-protected1modb |
128 | tests += tst-protected1a tst-protected1b |
129 | @@ -594,6 +595,7 @@ tst-auditmod9b.so-no-z-defs = yes |
130 | tst-nodelete-uniquemod.so-no-z-defs = yes |
131 | tst-nodelete-rtldmod.so-no-z-defs = yes |
132 | tst-nodelete-zmod.so-no-z-defs = yes |
133 | +tst-nodelete2mod.so-no-z-defs = yes |
134 | |
135 | ifeq ($(build-shared),yes) |
136 | # Build all the modules even when not actually running test programs. |
137 | @@ -1164,6 +1166,11 @@ $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \ |
138 | LDFLAGS-tst-nodelete = -rdynamic |
139 | LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete |
140 | |
141 | +$(objpfx)tst-nodelete2: $(libdl) |
142 | +$(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so |
143 | + |
144 | +LDFLAGS-tst-nodelete2 = -rdynamic |
145 | + |
146 | $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out |
147 | cmp $^ > $@; \ |
148 | $(evaluate-test) |
149 | diff --git a/elf/dl-close.c b/elf/dl-close.c |
150 | index 9105277..c897247 100644 |
151 | --- a/elf/dl-close.c |
152 | +++ b/elf/dl-close.c |
153 | @@ -144,6 +144,14 @@ _dl_close_worker (struct link_map *map, bool force) |
154 | char done[nloaded]; |
155 | struct link_map *maps[nloaded]; |
156 | |
157 | + /* Clear DF_1_NODELETE to force object deletion. We don't need to touch |
158 | + l_tls_dtor_count because forced object deletion only happens when an |
159 | + error occurs during object load. Destructor registration for TLS |
160 | + non-POD objects should not have happened till then for this |
161 | + object. */ |
162 | + if (force) |
163 | + map->l_flags_1 &= ~DF_1_NODELETE; |
164 | + |
165 | /* Run over the list and assign indexes to the link maps and enter |
166 | them into the MAPS array. */ |
167 | int idx = 0; |
168 | @@ -153,13 +161,6 @@ _dl_close_worker (struct link_map *map, bool force) |
169 | maps[idx] = l; |
170 | ++idx; |
171 | |
172 | - /* Clear DF_1_NODELETE to force object deletion. We don't need to touch |
173 | - l_tls_dtor_count because forced object deletion only happens when an |
174 | - error occurs during object load. Destructor registration for TLS |
175 | - non-POD objects should not have happened till then for this |
176 | - object. */ |
177 | - if (force) |
178 | - l->l_flags_1 &= ~DF_1_NODELETE; |
179 | } |
180 | assert (idx == nloaded); |
181 | |
182 | diff --git a/elf/tst-nodelete2.c b/elf/tst-nodelete2.c |
183 | new file mode 100644 |
184 | index 0000000..388e8af |
185 | --- /dev/null |
186 | +++ b/elf/tst-nodelete2.c |
187 | @@ -0,0 +1,37 @@ |
188 | +#include "../dlfcn/dlfcn.h" |
189 | +#include <stdio.h> |
190 | +#include <stdlib.h> |
191 | +#include <gnu/lib-names.h> |
192 | + |
193 | +static int |
194 | +do_test (void) |
195 | +{ |
196 | + int result = 0; |
197 | + |
198 | + printf ("\nOpening pthread library.\n"); |
199 | + void *pthread = dlopen (LIBPTHREAD_SO, RTLD_LAZY); |
200 | + |
201 | + /* This is a test for correct DF_1_NODELETE clearing when dlopen failure |
202 | + happens. We should clear DF_1_NODELETE for failed library only, because |
203 | + doing this for others (e.g. libpthread) might cause them to be unloaded, |
204 | + that may lead to some global references (e.g. __rtld_lock_unlock) to be |
205 | + broken. The dlopen should fail because of undefined symbols in shared |
206 | + library, that cause DF_1_NODELETE to be cleared. For libpthread, this |
207 | + flag should be set, because if not, SIGSEGV will happen in dlclose. */ |
208 | + if (dlopen ("tst-nodelete2mod.so", RTLD_NOW) != NULL) |
209 | + { |
210 | + printf ("Unique symbols test failed\n"); |
211 | + result = 1; |
212 | + } |
213 | + |
214 | + if (pthread) |
215 | + dlclose (pthread); |
216 | + |
217 | + if (result == 0) |
218 | + printf ("SUCCESS\n"); |
219 | + |
220 | + return result; |
221 | +} |
222 | + |
223 | +#define TEST_FUNCTION do_test () |
224 | +#include "../test-skeleton.c" |
225 | diff --git a/elf/tst-nodelete2mod.c b/elf/tst-nodelete2mod.c |
226 | new file mode 100644 |
227 | index 0000000..e88c756 |
228 | --- /dev/null |
229 | +++ b/elf/tst-nodelete2mod.c |
230 | @@ -0,0 +1,7 @@ |
231 | +/* Undefined symbol. */ |
232 | +extern int not_exist (void); |
233 | + |
234 | +int foo (void) |
235 | +{ |
236 | + return not_exist (); |
237 | +} |
238 | diff --git a/elf/tst-znodelete-zlib.cc b/elf/tst-znodelete-zlib.cc |
239 | deleted file mode 100644 |
240 | index 1e8f368..0000000 |
241 | --- a/elf/tst-znodelete-zlib.cc |
242 | +++ /dev/null |
243 | @@ -1,6 +0,0 @@ |
244 | -extern int not_exist (void); |
245 | - |
246 | -int foo (void) |
247 | -{ |
248 | - return not_exist (); |
249 | -} |
250 | diff --git a/io/test-lfs.c b/io/test-lfs.c |
251 | index 539c2a2..b6ebae4 100644 |
252 | --- a/io/test-lfs.c |
253 | +++ b/io/test-lfs.c |
254 | @@ -144,7 +144,7 @@ test_ftello (void) |
255 | int |
256 | do_test (int argc, char *argv[]) |
257 | { |
258 | - int ret; |
259 | + int ret, fd2; |
260 | struct stat64 statbuf; |
261 | |
262 | ret = lseek64 (fd, TWO_GB+100, SEEK_SET); |
263 | @@ -195,6 +195,25 @@ do_test (int argc, char *argv[]) |
264 | error (EXIT_FAILURE, 0, "stat reported size %lld instead of %lld.", |
265 | (long long int) statbuf.st_size, (TWO_GB + 100 + 5)); |
266 | |
267 | + fd2 = openat64 (AT_FDCWD, name, O_RDWR); |
268 | + if (fd2 == -1) |
269 | + { |
270 | + if (errno == ENOSYS) |
271 | + { |
272 | + /* Silently ignore this test. */ |
273 | + error (0, 0, "openat64 is not supported"); |
274 | + } |
275 | + else |
276 | + error (EXIT_FAILURE, errno, "openat64 failed to open big file"); |
277 | + } |
278 | + else |
279 | + { |
280 | + ret = close (fd2); |
281 | + |
282 | + if (ret == -1) |
283 | + error (EXIT_FAILURE, errno, "error closing file"); |
284 | + } |
285 | + |
286 | test_ftello (); |
287 | |
288 | return 0; |
289 | diff --git a/misc/Makefile b/misc/Makefile |
290 | index aecb0da..2f5edf6 100644 |
291 | --- a/misc/Makefile |
292 | +++ b/misc/Makefile |
293 | @@ -76,7 +76,8 @@ install-lib := libg.a |
294 | gpl2lgpl := error.c error.h |
295 | |
296 | tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \ |
297 | - tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 |
298 | + tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 \ |
299 | + tst-mntent-blank-corrupt tst-mntent-blank-passno |
300 | ifeq ($(run-built-tests),yes) |
301 | tests-special += $(objpfx)tst-error1-mem.out |
302 | endif |
303 | diff --git a/misc/mntent_r.c b/misc/mntent_r.c |
304 | index 6159873..4f26998 100644 |
305 | --- a/misc/mntent_r.c |
306 | +++ b/misc/mntent_r.c |
307 | @@ -136,7 +136,9 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz) |
308 | end_ptr = strchr (buffer, '\n'); |
309 | if (end_ptr != NULL) /* chop newline */ |
310 | { |
311 | - while (end_ptr[-1] == ' ' || end_ptr[-1] == '\t') |
312 | + /* Do not walk past the start of buffer if it's all whitespace. */ |
313 | + while (end_ptr != buffer |
314 | + && (end_ptr[-1] == ' ' || end_ptr[-1] == '\t')) |
315 | end_ptr--; |
316 | *end_ptr = '\0'; |
317 | } |
318 | diff --git a/misc/regexp.h b/misc/regexp.h |
319 | index 3460989..42394f7 100644 |
320 | --- a/misc/regexp.h |
321 | +++ b/misc/regexp.h |
322 | @@ -19,10 +19,11 @@ |
323 | #ifndef _REGEXP_H |
324 | #define _REGEXP_H 1 |
325 | |
326 | -/* The contents of this header file were standardized in the |
327 | - Single Unix Specification, Version 2 (1997) but marked as |
328 | - LEGACY; new applications were already being encouraged to |
329 | - use <regex.h> instead. POSIX.1-2001 removed this header. |
330 | +/* The contents of this header file were originally standardized in |
331 | + the Single Unix Specification, Issue 3 (1992). In Issue 4 (1994) |
332 | + the header was marked as TO BE WITHDRAWN, and new applications |
333 | + were encouraged to use <regex.h> instead. It was officially |
334 | + withdrawn from the standard in Issue 6 (aka POSIX.1-2001). |
335 | |
336 | This header is provided only for backward compatibility. |
337 | It will be removed in the next release of the GNU C Library. |
338 | diff --git a/misc/tst-mntent-blank-corrupt.c b/misc/tst-mntent-blank-corrupt.c |
339 | new file mode 100644 |
340 | index 0000000..92266a3 |
341 | --- /dev/null |
342 | +++ b/misc/tst-mntent-blank-corrupt.c |
343 | @@ -0,0 +1,45 @@ |
344 | +/* Make sure blank lines does not cause memory corruption BZ #18887. |
345 | + |
346 | + Copyright (C) 2009-2015 Free Software Foundation, Inc. |
347 | + This file is part of the GNU C Library. |
348 | + |
349 | + The GNU C Library is free software; you can redistribute it and/or |
350 | + modify it under the terms of the GNU Lesser General Public |
351 | + License as published by the Free Software Foundation; either |
352 | + version 2.1 of the License, or (at your option) any later version. |
353 | + |
354 | + The GNU C Library is distributed in the hope that it will be useful, |
355 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
356 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
357 | + Lesser General Public License for more details. |
358 | + |
359 | + You should have received a copy of the GNU Lesser General Public |
360 | + License along with the GNU C Library; if not, see |
361 | + <http://www.gnu.org/licenses/>. */ |
362 | + |
363 | +#include <mntent.h> |
364 | +#include <stdio.h> |
365 | +#include <string.h> |
366 | + |
367 | +/* Make sure blank lines don't trigger memory corruption. This doesn't happen |
368 | + for all targets though, so it's a best effort test BZ #18887. */ |
369 | +static int |
370 | +do_test (void) |
371 | +{ |
372 | + FILE *fp; |
373 | + |
374 | + fp = tmpfile (); |
375 | + fputs ("\n \n/foo\\040dir /bar\\040dir auto bind \t \n", fp); |
376 | + rewind (fp); |
377 | + |
378 | + /* The corruption happens here ... */ |
379 | + getmntent (fp); |
380 | + /* ... but trigers here. */ |
381 | + endmntent (fp); |
382 | + |
383 | + /* If the test failed, we would crash, and not hit this point. */ |
384 | + return 0; |
385 | +} |
386 | + |
387 | +#define TEST_FUNCTION do_test () |
388 | +#include "../test-skeleton.c" |
389 | diff --git a/misc/tst-mntent-blank-passno.c b/misc/tst-mntent-blank-passno.c |
390 | new file mode 100644 |
391 | index 0000000..fc04291 |
392 | --- /dev/null |
393 | +++ b/misc/tst-mntent-blank-passno.c |
394 | @@ -0,0 +1,53 @@ |
395 | +/* Make sure trailing whitespace is handled properly BZ #17273. |
396 | + |
397 | + Copyright (C) 2009-2015 Free Software Foundation, Inc. |
398 | + This file is part of the GNU C Library. |
399 | + |
400 | + The GNU C Library is free software; you can redistribute it and/or |
401 | + modify it under the terms of the GNU Lesser General Public |
402 | + License as published by the Free Software Foundation; either |
403 | + version 2.1 of the License, or (at your option) any later version. |
404 | + |
405 | + The GNU C Library is distributed in the hope that it will be useful, |
406 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
407 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
408 | + Lesser General Public License for more details. |
409 | + |
410 | + You should have received a copy of the GNU Lesser General Public |
411 | + License along with the GNU C Library; if not, see |
412 | + <http://www.gnu.org/licenses/>. */ |
413 | + |
414 | +#include <mntent.h> |
415 | +#include <stdio.h> |
416 | +#include <string.h> |
417 | + |
418 | +/* Check entries to make sure trailing whitespace is ignored and we return the |
419 | + correct passno value BZ #17273. */ |
420 | +static int |
421 | +do_test (void) |
422 | +{ |
423 | + int result = 0; |
424 | + FILE *fp; |
425 | + struct mntent *mnt; |
426 | + |
427 | + fp = tmpfile (); |
428 | + fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp); |
429 | + rewind (fp); |
430 | + |
431 | + mnt = getmntent (fp); |
432 | + if (strcmp (mnt->mnt_fsname, "/foo dir") != 0 |
433 | + || strcmp (mnt->mnt_dir, "/bar dir") != 0 |
434 | + || strcmp (mnt->mnt_type, "auto") != 0 |
435 | + || strcmp (mnt->mnt_opts, "bind") != 0 |
436 | + || mnt->mnt_freq != 0 |
437 | + || mnt->mnt_passno != 0) |
438 | + { |
439 | + puts ("Error while reading entry with trailing whitespaces"); |
440 | + result = 1; |
441 | + } |
442 | + |
443 | + return result; |
444 | +} |
445 | + |
446 | +#define TEST_FUNCTION do_test () |
447 | +#include "../test-skeleton.c" |
448 | diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c |
449 | index 876c89f..820b354 100644 |
450 | --- a/misc/tst-mntent.c |
451 | +++ b/misc/tst-mntent.c |
452 | @@ -73,26 +73,6 @@ main (int argc, char *argv[]) |
453 | puts ("Error while reading written entry back in"); |
454 | result = 1; |
455 | } |
456 | - |
457 | - /* Part III: Entry with whitespaces at the end of a line. */ |
458 | - rewind (fp); |
459 | - |
460 | - fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp); |
461 | - |
462 | - rewind (fp); |
463 | - |
464 | - mnt = getmntent (fp); |
465 | - |
466 | - if (strcmp (mnt->mnt_fsname, "/foo dir") != 0 |
467 | - || strcmp (mnt->mnt_dir, "/bar dir") != 0 |
468 | - || strcmp (mnt->mnt_type, "auto") != 0 |
469 | - || strcmp (mnt->mnt_opts, "bind") != 0 |
470 | - || mnt->mnt_freq != 0 |
471 | - || mnt->mnt_passno != 0) |
472 | - { |
473 | - puts ("Error while reading entry with trailing whitespaces"); |
474 | - result = 1; |
475 | - } |
476 | } |
477 | |
478 | return result; |
479 | diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl |
480 | index cac1562..79b2b3e 100755 |
481 | --- a/scripts/test-installation.pl |
482 | +++ b/scripts/test-installation.pl |
483 | @@ -80,16 +80,25 @@ arglist: while (@ARGV) { |
484 | # We expect none or one argument. |
485 | if ($#ARGV == -1) { |
486 | $soversions="soversions.mk"; |
487 | + $config="config.make"; |
488 | } elsif ($#ARGV == 0) { |
489 | if (-d $ARGV[0]) { |
490 | $soversions = "$ARGV[0]/soversions.mk"; |
491 | + $config = "$ARGV[0]/config.make"; |
492 | } else { |
493 | - $soversions = $ARGV[0]; |
494 | + $soversions = $dir = $ARGV[0]; |
495 | + $dir =~ s!/?[^/]*/*$!!; |
496 | + $config = $dir . "/config.make"; |
497 | } |
498 | } else { |
499 | die "Wrong number of arguments."; |
500 | } |
501 | |
502 | +if (system ("grep -q \"build-mathvec = yes\" $config") == 0) { |
503 | + $build_mathvec = 1; |
504 | +} else { |
505 | + $build_mathvec = 0; |
506 | +} |
507 | |
508 | # Read names and versions of all shared libraries that are part of |
509 | # glibc |
510 | @@ -111,6 +120,8 @@ while (<SOVERSIONS>) { |
511 | # - libthread_db since it contains unresolved references |
512 | # - it's just a test NSS module |
513 | # - We don't provide the libgcc so we don't test it |
514 | + # - libmvec if it wasn't built |
515 | + next if ($build_mathvec == 0 && $name eq "mvec"); |
516 | if ($name ne "nss_ldap" && $name ne "db1" |
517 | && !($name =~/^nss1_/) && $name ne "thread_db" |
518 | && $name ne "nss_test1" && $name ne "libgcc_s") { |
519 | diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c |
520 | index b707c19..89d8baf 100644 |
521 | --- a/sysdeps/hppa/dl-symaddr.c |
522 | +++ b/sysdeps/hppa/dl-symaddr.c |
523 | @@ -33,3 +33,4 @@ _dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref) |
524 | else |
525 | return (void *) value; |
526 | } |
527 | +rtld_hidden_def (_dl_symbol_address) |
528 | diff --git a/sysdeps/nacl/start.c b/sysdeps/nacl/start.c |
529 | index a4b6dd3..8e8bc1a 100644 |
530 | --- a/sysdeps/nacl/start.c |
531 | +++ b/sysdeps/nacl/start.c |
532 | @@ -44,6 +44,10 @@ |
533 | /* The application defines this, of course. */ |
534 | extern int main (int argc, char **argv, char **envp); |
535 | |
536 | +/* But maybe it defines this too, in which case it takes precedence. */ |
537 | +extern int __nacl_main (int argc, char **argv, char **envp) |
538 | + __attribute__ ((weak)); |
539 | + |
540 | /* These are defined in libc. */ |
541 | extern int __libc_csu_init (int argc, char **argv, char **envp); |
542 | extern void __libc_csu_fini (void); |
543 | @@ -59,7 +63,7 @@ _start (uint32_t info[]) |
544 | { |
545 | /* The generic code actually assumes that envp follows argv. */ |
546 | |
547 | - __libc_start_main (&main, |
548 | + __libc_start_main (&__nacl_main ?: &main, |
549 | nacl_startup_argc (info), |
550 | nacl_startup_argv (info), |
551 | nacl_startup_auxv (info), |
552 | diff --git a/sysdeps/sparc/sparc32/sem_open.c b/sysdeps/sparc/sparc32/sem_open.c |
553 | index 16cb9ad..59df2d7 100644 |
554 | --- a/sysdeps/sparc/sparc32/sem_open.c |
555 | +++ b/sysdeps/sparc/sparc32/sem_open.c |
556 | @@ -29,6 +29,7 @@ |
557 | #include <sys/mman.h> |
558 | #include <sys/stat.h> |
559 | #include "semaphoreP.h" |
560 | +#include <futex-internal.h> |
561 | #include <shm-directory.h> |
562 | |
563 | |
564 | diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h |
565 | index abde83e..6e73504 100644 |
566 | --- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h |
567 | +++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h |
568 | @@ -56,42 +56,41 @@ typedef uintmax_t uatomic_max_t; |
569 | #define _LWS "0xb0" |
570 | #define _LWS_CAS "0" |
571 | /* Note r31 is the link register. */ |
572 | -#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" |
573 | +#define _LWS_CLOBBER "r1", "r23", "r22", "r20", "r31", "memory" |
574 | /* String constant for -EAGAIN. */ |
575 | #define _ASM_EAGAIN "-11" |
576 | /* String constant for -EDEADLOCK. */ |
577 | #define _ASM_EDEADLOCK "-45" |
578 | |
579 | #if __ASSUME_LWS_CAS |
580 | -/* The only basic operation needed is compare and exchange. */ |
581 | +/* The only basic operation needed is compare and exchange. The mem |
582 | + pointer must be word aligned. */ |
583 | # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ |
584 | ({ \ |
585 | - volatile int lws_errno; \ |
586 | - __typeof__ (*mem) lws_ret; \ |
587 | - asm volatile( \ |
588 | + register long lws_errno asm("r21"); \ |
589 | + register unsigned long lws_ret asm("r28"); \ |
590 | + register unsigned long lws_mem asm("r26") = (unsigned long)(mem); \ |
591 | + register unsigned long lws_old asm("r25") = (unsigned long)(oldval);\ |
592 | + register unsigned long lws_new asm("r24") = (unsigned long)(newval);\ |
593 | + __asm__ __volatile__( \ |
594 | "0: \n\t" \ |
595 | - "copy %2, %%r26 \n\t" \ |
596 | - "copy %3, %%r25 \n\t" \ |
597 | - "copy %4, %%r24 \n\t" \ |
598 | "ble " _LWS "(%%sr2, %%r0) \n\t" \ |
599 | "ldi " _LWS_CAS ", %%r20 \n\t" \ |
600 | - "ldi " _ASM_EAGAIN ", %%r24 \n\t" \ |
601 | - "cmpb,=,n %%r24, %%r21, 0b \n\t" \ |
602 | + "ldi " _ASM_EAGAIN ", %%r20 \n\t" \ |
603 | + "cmpb,=,n %%r20, %%r21, 0b \n\t" \ |
604 | "nop \n\t" \ |
605 | - "ldi " _ASM_EDEADLOCK ", %%r25 \n\t" \ |
606 | - "cmpb,=,n %%r25, %%r21, 0b \n\t" \ |
607 | + "ldi " _ASM_EDEADLOCK ", %%r20 \n\t" \ |
608 | + "cmpb,=,n %%r20, %%r21, 0b \n\t" \ |
609 | "nop \n\t" \ |
610 | - "stw %%r28, %0 \n\t" \ |
611 | - "stw %%r21, %1 \n\t" \ |
612 | - : "=m" (lws_ret), "=m" (lws_errno) \ |
613 | - : "r" (mem), "r" (oldval), "r" (newval) \ |
614 | + : "=r" (lws_ret), "=r" (lws_errno) \ |
615 | + : "r" (lws_mem), "r" (lws_old), "r" (lws_new) \ |
616 | : _LWS_CLOBBER \ |
617 | ); \ |
618 | \ |
619 | - if(lws_errno == -EFAULT || lws_errno == -ENOSYS) \ |
620 | + if (lws_errno == -EFAULT || lws_errno == -ENOSYS) \ |
621 | ABORT_INSTRUCTION; \ |
622 | \ |
623 | - lws_ret; \ |
624 | + (__typeof (oldval)) lws_ret; \ |
625 | }) |
626 | |
627 | # define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \ |
628 | diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h |
629 | index 83c0340..9d5c542 100644 |
630 | --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h |
631 | +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h |
632 | @@ -16,8 +16,11 @@ |
633 | License along with the GNU C Library; if not, see |
634 | <http://www.gnu.org/licenses/>. */ |
635 | |
636 | +#ifndef _LINUX_MICROBLAZE_SYSDEP_H |
637 | +#define _LINUX_MICROBLAZE_SYSDEP_H 1 |
638 | + |
639 | +#include <sysdeps/unix/sysdep.h> |
640 | #include <sysdeps/microblaze/sysdep.h> |
641 | -#include <sys/syscall.h> |
642 | |
643 | /* Defines RTLD_PRIVATE_ERRNO. */ |
644 | #include <dl-sysdep.h> |
645 | @@ -305,3 +308,5 @@ SYSCALL_ERROR_LABEL_DCL: \ |
646 | # define PTR_DEMANGLE(var) (void) (var) |
647 | |
648 | #endif /* not __ASSEMBLER__ */ |
649 | + |
650 | +#endif /* _LINUX_MICROBLAZE_SYSDEP_H */ |
651 | diff --git a/sysdeps/unix/sysv/linux/openat.c b/sysdeps/unix/sysv/linux/openat.c |
652 | index 6777123..ad8e31d 100644 |
653 | --- a/sysdeps/unix/sysv/linux/openat.c |
654 | +++ b/sysdeps/unix/sysv/linux/openat.c |
655 | @@ -68,6 +68,11 @@ __OPENAT (int fd, const char *file, int oflag, ...) |
656 | va_end (arg); |
657 | } |
658 | |
659 | + /* We have to add the O_LARGEFILE flag for openat64. */ |
660 | +#ifdef MORE_OFLAGS |
661 | + oflag |= MORE_OFLAGS; |
662 | +#endif |
663 | + |
664 | return SYSCALL_CANCEL (openat, fd, file, oflag, mode); |
665 | } |
666 | libc_hidden_def (__OPENAT) |