Attachment '2008-05-21-libc-hppa.diff'
Download 1 ? linuxthreads
2 ? linuxthreads-head
3 ? linuxthreads_db
4 ? ports
5 Index: ChangeLog
6 ===================================================================
7 RCS file: /cvs/glibc/libc/ChangeLog,v
8 retrieving revision 1.11218
9 diff -u -p -r1.11218 ChangeLog
10 --- ChangeLog 21 May 2008 09:29:04 -0000 1.11218
11 +++ ChangeLog 22 May 2008 13:00:04 -0000
12 @@ -1,3 +1,9 @@
13 +2008-05-20 Carlos O'Donell <carlos@systemhalted.org>
14 +
15 + * test-skeleton.c [!TEST_DIRECT]: Define TEST_DIRECT.
16 + (main): Set direct to TEST_DIRECT. Emit warning if TEST_DIRECT
17 + is 1 and OPT_DIRECT is handled.
18 +
19 2008-05-08 David S. Miller <davem@davemloft.net>
20
21 * sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S: Use
22 Index: test-skeleton.c
23 ===================================================================
24 RCS file: /cvs/glibc/libc/test-skeleton.c,v
25 retrieving revision 1.30
26 diff -u -p -r1.30 test-skeleton.c
27 --- test-skeleton.c 23 Dec 2005 01:03:28 -0000 1.30
28 +++ test-skeleton.c 22 May 2008 13:00:04 -0000
29 @@ -43,6 +43,16 @@
30 # define TEST_DATA_LIMIT (64 << 20) /* Data limit (bytes) to run with. */
31 #endif
32
33 +/* If TEST_DIRECT is defined to 1, then the test function is
34 + always called directly, using the 'direct' command line
35 + option will result in a warning. If TEST_DIRECT is defined
36 + as 0, then the test function is called after a fork, and
37 + may be called directly if the 'direct' command line option
38 + is used. */
39 +#ifndef TEST_DIRECT
40 +# define TEST_DIRECT 0
41 +#endif
42 +
43 #define OPT_DIRECT 1000
44 #define OPT_TESTDIR 1001
45
46 @@ -193,7 +203,7 @@ timeout_handler (int sig __attribute__ (
47 int
48 main (int argc, char *argv[])
49 {
50 - int direct = 0; /* Directly call the test function? */
51 + int direct = TEST_DIRECT; /* Directly call the test function? */
52 int status;
53 int opt;
54 unsigned int timeoutfactor = 1;
55 @@ -212,6 +222,8 @@ main (int argc, char *argv[])
56 case '?':
57 exit (1);
58 case OPT_DIRECT:
59 + if (direct)
60 + fprintf (stderr, "Warning: This test always runs directly.\n");
61 direct = 1;
62 break;
63 case OPT_TESTDIR:
64 Index: bits/atomic.h
65 ===================================================================
66 RCS file: /cvs/glibc/libc/bits/atomic.h,v
67 retrieving revision 1.2
68 diff -u -p -r1.2 atomic.h
69 --- bits/atomic.h 22 Mar 2003 23:00:14 -0000 1.2
70 +++ bits/atomic.h 22 May 2008 13:00:04 -0000
71 @@ -23,6 +23,7 @@
72 /* We have by default no support for atomic operations. So define
73 them non-atomic. If this is a problem somebody will have to come
74 up with real definitions. */
75 +#error Architecture support for atomic operations required.
76
77 /* The only basic operation needed is compare and exchange. */
78 #define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
79 Index: elf/rtld.c
80 ===================================================================
81 RCS file: /cvs/glibc/libc/elf/rtld.c,v
82 retrieving revision 1.375
83 diff -u -p -r1.375 rtld.c
84 --- elf/rtld.c 8 Mar 2008 07:29:40 -0000 1.375
85 +++ elf/rtld.c 22 May 2008 13:00:05 -0000
86 @@ -383,14 +383,14 @@ _dl_start (void *arg)
87 know it is available. We do not have to clear the memory if we
88 do not have to use the temporary bootstrap_map. Global variables
89 are initialized to zero by default. */
90 -#ifndef DONT_USE_BOOTSTRAP_MAP
91 +#if !defined DONT_USE_BOOTSTRAP_MAP
92 # ifdef HAVE_BUILTIN_MEMSET
93 __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
94 # else
95 - for (size_t cnt = 0;
96 - cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
97 - ++cnt)
98 - bootstrap_map.l_info[cnt] = 0;
99 + /* Clear the whole bootstrap_map structure */
100 + for (char *cnt = (char *)&(bootstrap_map);
101 + cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
102 + *cnt++ = '\0');
103 # endif
104 # if USE___THREAD
105 bootstrap_map.l_tls_modid = 0;
106 @@ -808,8 +808,8 @@ do_preload (char *fname, struct link_map
107 if (__builtin_expect (err_str != NULL, 0))
108 {
109 _dl_error_printf ("\
110 -ERROR: ld.so: object '%s' from %s cannot be preloaded: ignored.\n",
111 - fname, where);
112 +ERROR: ld.so: object '%s' from %s cannot be preloaded: %s; ignored.\n",
113 + fname, where, err_str);
114 /* No need to call free, this is still before
115 the libc's malloc is used. */
116 }
117 Index: include/atomic.h
118 ===================================================================
119 RCS file: /cvs/glibc/libc/include/atomic.h,v
120 retrieving revision 1.21
121 diff -u -p -r1.21 atomic.h
122 --- include/atomic.h 21 Dec 2006 21:44:00 -0000 1.21
123 +++ include/atomic.h 22 May 2008 13:00:06 -0000
124 @@ -174,7 +174,7 @@
125 __typeof (*(mem)) __atg5_value = (newvalue); \
126 \
127 do \
128 - __atg5_oldval = *__atg5_memp; \
129 + __atg5_oldval = *(volatile __typeof (mem))__atg5_memp; \
130 while (__builtin_expect \
131 (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
132 __atg5_oldval), 0)); \
133 @@ -195,7 +195,7 @@
134 __typeof (*(mem)) __atg6_value = (value); \
135 \
136 do \
137 - __atg6_oldval = *__atg6_memp; \
138 + __atg6_oldval = *(volatile __typeof (mem))__atg6_memp; \
139 while (__builtin_expect \
140 (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
141 __atg6_oldval \
142 @@ -213,7 +213,7 @@
143 __typeof (*(mem)) __atg7_value = (value); \
144 \
145 do \
146 - __atg7_oldv = *__atg7_memp; \
147 + __atg7_oldv = *(volatile __typeof (mem))__atg7_memp; \
148 while (__builtin_expect \
149 (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
150 __atg7_oldv \
151 @@ -231,7 +231,7 @@
152 __typeof (mem) __atg8_memp = (mem); \
153 __typeof (*(mem)) __atg8_value = (value); \
154 do { \
155 - __atg8_oldval = *__atg8_memp; \
156 + __atg8_oldval = *(volatile __typeof (mem))__atg8_memp; \
157 if (__atg8_oldval >= __atg8_value) \
158 break; \
159 } while (__builtin_expect \
160 @@ -248,7 +248,7 @@
161 __typeof (mem) __atg9_memp = (mem); \
162 __typeof (*(mem)) __atg9_value = (value); \
163 do { \
164 - __atg9_oldv = *__atg9_memp; \
165 + __atg9_oldv = *(volatile __typeof (mem))__atg9_memp; \
166 if (__atg9_oldv >= __atg9_value) \
167 break; \
168 } while (__builtin_expect \
169 @@ -266,7 +266,7 @@
170 __typeof (mem) __atg10_memp = (mem); \
171 __typeof (*(mem)) __atg10_value = (value); \
172 do { \
173 - __atg10_oldval = *__atg10_memp; \
174 + __atg10_oldval = *(volatile __typeof (mem))__atg10_memp; \
175 if (__atg10_oldval <= __atg10_value) \
176 break; \
177 } while (__builtin_expect \
178 @@ -350,7 +350,7 @@
179 \
180 do \
181 { \
182 - __atg11_oldval = *__atg11_memp; \
183 + __atg11_oldval = *(volatile __typeof (mem))__atg11_memp; \
184 if (__builtin_expect (__atg11_oldval <= 0, 0)) \
185 break; \
186 } \
187 @@ -389,7 +389,7 @@
188 __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
189 \
190 do \
191 - __atg14_old = (*__atg14_memp); \
192 + __atg14_old = (*(volatile __typeof (mem))__atg14_memp); \
193 while (__builtin_expect \
194 (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
195 __atg14_old | __atg14_mask,\
196 @@ -407,7 +407,7 @@
197 __typeof (*(mem)) __atg15_mask = (mask); \
198 \
199 do \
200 - __atg15_old = (*__atg15_memp); \
201 + __atg15_old = (*(volatile __typeof (mem))__atg15_memp); \
202 while (__builtin_expect \
203 (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
204 __atg15_old & __atg15_mask, \
205 @@ -423,7 +423,7 @@
206 __typeof (*(mem)) __atg16_mask = (mask); \
207 \
208 do \
209 - __atg16_old = (*__atg16_memp); \
210 + __atg16_old = (*(volatile __typeof (mem))__atg16_memp); \
211 while (__builtin_expect \
212 (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
213 __atg16_old & __atg16_mask,\
214 @@ -441,7 +441,7 @@
215 __typeof (*(mem)) __atg17_mask = (mask); \
216 \
217 do \
218 - __atg17_old = (*__atg17_memp); \
219 + __atg17_old = (*(volatile __typeof (mem))__atg17_memp); \
220 while (__builtin_expect \
221 (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
222 __atg17_old | __atg17_mask, \
223 @@ -457,7 +457,7 @@
224 __typeof (*(mem)) __atg18_mask = (mask); \
225 \
226 do \
227 - __atg18_old = (*__atg18_memp); \
228 + __atg18_old = (*(volatile __typeof (mem))__atg18_memp); \
229 while (__builtin_expect \
230 (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
231 __atg18_old | __atg18_mask,\
232 @@ -473,7 +473,7 @@
233 __typeof (*(mem)) __atg19_mask = (mask); \
234 \
235 do \
236 - __atg19_old = (*__atg19_memp); \
237 + __atg19_old = (*(volatile __typeof (mem))__atg19_memp); \
238 while (__builtin_expect \
239 (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
240 __atg19_old | __atg19_mask,\
241 Index: math/Makefile
242 ===================================================================
243 RCS file: /cvs/glibc/libc/math/Makefile,v
244 retrieving revision 1.130
245 diff -u -p -r1.130 Makefile
246 --- math/Makefile 12 Jul 2007 18:10:35 -0000 1.130
247 +++ math/Makefile 22 May 2008 13:00:06 -0000
248 @@ -91,13 +91,17 @@ distribute += $(filter-out $(generated),
249 tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
250 test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
251 bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int test-tgmath2
252 -# We do the `long double' tests only if this data type is available and
253 -# distinct from `double'.
254 +# We do the `long double' tests only if this data type is available.
255 test-longdouble-yes = test-ldouble test-ildoubl
256 distribute += $(test-longdouble-yes:=.c)
257
258 +ifeq ($(long-double-fcts),yes)
259 +# If we have distinct types then enable testing.
260 +test-long-double-fcts = yes
261 +endif
262 +
263 ifneq (no,$(PERL))
264 -libm-tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
265 +libm-tests = test-float test-double $(test-longdouble-$(test-long-double-fcts)) \
266 test-ifloat test-idouble
267 libm-tests.o = $(addsuffix .o,$(libm-tests))
268
269 @@ -171,11 +175,15 @@ math-CPPFLAGS += -D__NO_MATH_INLINES -D_
270 ifneq ($(long-double-fcts),yes)
271 # The `double' and `long double' types are the same on this machine.
272 # We won't compile the `long double' code at all. Tell the `double' code
273 -# to define aliases for the `FUNCl' names. To avoid type conflicts in
274 -# defining those aliases, tell <math.h> to declare the `FUNCl' names with
275 -# `double' instead of `long double'.
276 +# to define aliases for the `FUNCl' names.
277 +ifeq ($(header-long-double-fcts),yes)
278 +math-CPPFLAGS += -DNO_LONG_DOUBLE
279 +else
280 +# To avoid type conflicts in defining those aliases, tell <math.h> to
281 +# declare the `FUNCl' names with `double' instead of `long double'.
282 math-CPPFLAGS += -DNO_LONG_DOUBLE -D_Mlong_double_=double
283 endif
284 +endif
285
286 # The fdlibm code generates a lot of these warnings but is otherwise clean.
287 override CFLAGS += -Wno-uninitialized
288 Index: nptl/ChangeLog
289 ===================================================================
290 RCS file: /cvs/glibc/libc/nptl/ChangeLog,v
291 retrieving revision 1.1066
292 diff -u -p -r1.1066 ChangeLog
293 --- nptl/ChangeLog 21 May 2008 06:47:47 -0000 1.1066
294 +++ nptl/ChangeLog 22 May 2008 13:00:09 -0000
295 @@ -1,3 +1,11 @@
296 +2008-05-20 Carlos O'Donell <carlos@systemhalted.org>
297 +
298 + * tst-fork1.c: Include "../test-skeleton.c"
299 + (main): Rename to...
300 + (do_test): ... this.
301 + (TEST_FUNCTION): Define.
302 + * tst-fork2.c: Likewise.
303 +
304 2008-05-20 Jakub Jelinek <jakub@redhat.com>
305 David S. Miller <davem@davemloft.net>
306
307 Index: nptl/pthread_barrier_wait.c
308 ===================================================================
309 RCS file: /cvs/glibc/libc/nptl/pthread_barrier_wait.c,v
310 retrieving revision 1.3
311 diff -u -p -r1.3 pthread_barrier_wait.c
312 --- nptl/pthread_barrier_wait.c 1 Aug 2007 04:18:50 -0000 1.3
313 +++ nptl/pthread_barrier_wait.c 22 May 2008 13:00:09 -0000
314 @@ -64,7 +64,7 @@ pthread_barrier_wait (barrier)
315 do
316 lll_futex_wait (&ibarrier->curr_event, event,
317 ibarrier->private ^ FUTEX_PRIVATE_FLAG);
318 - while (event == ibarrier->curr_event);
319 + while (event == *(volatile unsigned int *)&ibarrier->curr_event);
320 }
321
322 /* Make sure the init_count is stored locally or in a register. */
323 Index: nptl/tst-fork1.c
324 ===================================================================
325 RCS file: /cvs/glibc/libc/nptl/tst-fork1.c,v
326 retrieving revision 1.2
327 diff -u -p -r1.2 tst-fork1.c
328 --- nptl/tst-fork1.c 7 Mar 2004 10:23:37 -0000 1.2
329 +++ nptl/tst-fork1.c 22 May 2008 13:00:09 -0000
330 @@ -65,8 +65,8 @@ thread_function (void * arg)
331 #define N 5
332 static const int t[N] = { 7, 6, 5, 4, 3 };
333
334 -int
335 -main (void)
336 +static int
337 +do_test (void)
338 {
339 pthread_t th[N];
340 int i;
341 @@ -118,3 +118,7 @@ main (void)
342
343 return result;
344 }
345 +
346 +#define TEST_DIRECT 1
347 +#define TEST_FUNCTION do_test ()
348 +#include "../test-skeleton.c"
349 Index: nptl/tst-fork2.c
350 ===================================================================
351 RCS file: /cvs/glibc/libc/nptl/tst-fork2.c,v
352 retrieving revision 1.1
353 diff -u -p -r1.1 tst-fork2.c
354 --- nptl/tst-fork2.c 2 Dec 2002 08:07:18 -0000 1.1
355 +++ nptl/tst-fork2.c 22 May 2008 13:00:09 -0000
356 @@ -42,8 +42,8 @@ tf (void *arg)
357 }
358
359
360 -int
361 -main (void)
362 +static int
363 +do_test (void)
364 {
365 initial_pid = getpid ();
366
367 @@ -88,3 +88,7 @@ main (void)
368
369 return status;
370 }
371 +
372 +#define TEST_DIRECT 1
373 +#define TEST_FUNCTION do_test ()
374 +#include "../test-skeleton.c"
375 Index: nptl/sysdeps/pthread/Makefile
376 ===================================================================
377 RCS file: /cvs/glibc/libc/nptl/sysdeps/pthread/Makefile,v
378 retrieving revision 1.8
379 diff -u -p -r1.8 Makefile
380 --- nptl/sysdeps/pthread/Makefile 28 Feb 2006 07:09:41 -0000 1.8
381 +++ nptl/sysdeps/pthread/Makefile 22 May 2008 13:00:09 -0000
382 @@ -41,7 +41,9 @@ endif
383
384 ifeq ($(have-forced-unwind),yes)
385 tests += tst-mqueue8x
386 +ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
387 CFLAGS-tst-mqueue8x.c += -fexceptions
388 +LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s)
389 endif
390 endif
391
392 Index: stdio-common/Makefile
393 ===================================================================
394 RCS file: /cvs/glibc/libc/stdio-common/Makefile,v
395 retrieving revision 1.111
396 diff -u -p -r1.111 Makefile
397 --- stdio-common/Makefile 10 Dec 2007 01:43:13 -0000 1.111
398 +++ stdio-common/Makefile 22 May 2008 13:00:13 -0000
399 @@ -79,7 +79,7 @@ $(objpfx)tst-printf.out: $(objpfx)tst-pr
400 $(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
401 endif
402
403 -CFLAGS-vfprintf.c = -Wno-uninitialized
404 +CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
405 CFLAGS-vfwprintf.c = -Wno-uninitialized
406 CFLAGS-tst-printf.c = -Wno-format
407 CFLAGS-tstdiomisc.c = -Wno-format
408 Index: sysdeps/generic/dl-lookupcfg.h
409 ===================================================================
410 RCS file: /cvs/glibc/libc/sysdeps/generic/dl-lookupcfg.h,v
411 retrieving revision 1.6
412 diff -u -p -r1.6 dl-lookupcfg.h
413 --- sysdeps/generic/dl-lookupcfg.h 7 Feb 2005 22:48:54 -0000 1.6
414 +++ sysdeps/generic/dl-lookupcfg.h 22 May 2008 13:00:14 -0000
415 @@ -27,3 +27,5 @@
416 #define DL_FIXUP_VALUE_CODE_ADDR(value) (value)
417 #define DL_FIXUP_VALUE_ADDR(value) (value)
418 #define DL_FIXUP_ADDR_VALUE(addr) (addr)
419 +
420 +#error hppa-linux needs lookup function support.
421 Index: sysdeps/generic/framestate.c
422 ===================================================================
423 RCS file: /cvs/glibc/libc/sysdeps/generic/framestate.c,v
424 retrieving revision 1.4
425 diff -u -p -r1.4 framestate.c
426 --- sysdeps/generic/framestate.c 21 Feb 2004 09:07:05 -0000 1.4
427 +++ sysdeps/generic/framestate.c 22 May 2008 13:00:14 -0000
428 @@ -25,6 +25,10 @@
429 #include <unwind-dw2.c>
430 #undef __frame_state_for
431
432 +#ifndef LIBGCC_S_SO
433 +#define LIBGCC_S_SO "libgcc_s.so.1"
434 +#endif
435 +
436 typedef struct frame_state * (*framesf)(void *pc, struct frame_state *);
437 struct frame_state *__frame_state_for (void *pc,
438 struct frame_state *frame_state);
439 @@ -36,7 +40,7 @@ __frame_state_for (void *pc, struct fram
440
441 if (frame_state_for == NULL)
442 {
443 - void *handle = __libc_dlopen ("libgcc_s.so.1");
444 + void *handle = __libc_dlopen (LIBGCC_S_SO);
445
446 if (handle == NULL
447 || (frame_state_for
448 Index: sysdeps/unix/sysv/linux/getcwd.c
449 ===================================================================
450 RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/getcwd.c,v
451 retrieving revision 1.24
452 diff -u -p -r1.24 getcwd.c
453 --- sysdeps/unix/sysv/linux/getcwd.c 2 Apr 2006 17:58:28 -0000 1.24
454 +++ sysdeps/unix/sysv/linux/getcwd.c 22 May 2008 13:00:16 -0000
455 @@ -31,6 +31,9 @@
456
457 #include <kernel-features.h>
458
459 +#ifndef MAX
460 +# define MAX(a, b) ((a) < (b) ? (b) : (a))
461 +#endif
462
463 /* If we compile the file for use in ld.so we don't need the feature
464 that getcwd() allocates the buffers itself. */
465 Index: sysdeps/unix/sysv/linux/posix_fadvise.c
466 ===================================================================
467 RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/posix_fadvise.c,v
468 retrieving revision 1.3
469 diff -u -p -r1.3 posix_fadvise.c
470 --- sysdeps/unix/sysv/linux/posix_fadvise.c 17 Aug 2003 00:36:22 -0000 1.3
471 +++ sysdeps/unix/sysv/linux/posix_fadvise.c 22 May 2008 13:00:16 -0000
472 @@ -35,6 +35,19 @@ posix_fadvise (int fd, off_t offset, off
473 return INTERNAL_SYSCALL_ERRNO (ret, err);
474 return 0;
475 #else
476 +# ifdef __NR_fadvise64_64
477 + INTERNAL_SYSCALL_DECL (err);
478 + int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
479 + __LONG_LONG_PAIR ((long) (offset >> 31),
480 + (long) offset),
481 + __LONG_LONG_PAIR ((long) (len >> 31),
482 + (long) len),
483 + advise);
484 + if (INTERNAL_SYSCALL_ERROR_P (ret, err))
485 + return INTERNAL_SYSCALL_ERRNO (ret, err);
486 + return 0;
487 +# else
488 return ENOSYS;
489 +# endif
490 #endif
491 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.- [get | view] (2008-05-22 13:01:20, 17.9 KB) [[attachment:2008-05-21-libc-hppa.diff]]
- [get | view] (2008-05-22 13:01:30, 4.0 KB) [[attachment:2008-05-21-ports-hppa.diff]]
You are not allowed to attach a file to this page.