3 diff -durN glibc-2.13.orig/elf/rtld.c glibc-2.13/elf/rtld.c
4 --- glibc-2.13.orig/elf/rtld.c 2009-04-17 02:00:08.000000000 +0200
5 +++ glibc-2.13/elf/rtld.c 2009-11-13 00:50:26.000000000 +0100
7 know it is available. We do not have to clear the memory if we
8 do not have to use the temporary bootstrap_map. Global variables
9 are initialized to zero by default. */
10 -#ifndef DONT_USE_BOOTSTRAP_MAP
11 +#if !defined DONT_USE_BOOTSTRAP_MAP
12 # ifdef HAVE_BUILTIN_MEMSET
13 __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
15 - for (size_t cnt = 0;
16 - cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
18 - bootstrap_map.l_info[cnt] = 0;
19 + /* Clear the whole bootstrap_map structure */
20 + for (char *cnt = (char *)&(bootstrap_map);
21 + cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
25 bootstrap_map.l_tls_modid = 0;
26 diff -durN glibc-2.13.orig/include/atomic.h glibc-2.13/include/atomic.h
27 --- glibc-2.13.orig/include/atomic.h 2009-02-09 00:49:53.000000000 +0100
28 +++ glibc-2.13/include/atomic.h 2009-11-13 00:50:26.000000000 +0100
30 __typeof (*(mem)) __atg5_value = (newvalue); \
33 - __atg5_oldval = *__atg5_memp; \
34 + __atg5_oldval = *(volatile __typeof (mem))__atg5_memp; \
35 while (__builtin_expect \
36 (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
37 __atg5_oldval), 0)); \
39 __typeof (*(mem)) __atg6_value = (value); \
42 - __atg6_oldval = *__atg6_memp; \
43 + __atg6_oldval = *(volatile __typeof (mem))__atg6_memp; \
44 while (__builtin_expect \
45 (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
48 __typeof (*(mem)) __atg7_value = (value); \
51 - __atg7_oldv = *__atg7_memp; \
52 + __atg7_oldv = *(volatile __typeof (mem))__atg7_memp; \
53 while (__builtin_expect \
54 (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
57 __typeof (mem) __atg8_memp = (mem); \
58 __typeof (*(mem)) __atg8_value = (value); \
60 - __atg8_oldval = *__atg8_memp; \
61 + __atg8_oldval = *(volatile __typeof (mem))__atg8_memp; \
62 if (__atg8_oldval >= __atg8_value) \
64 } while (__builtin_expect \
66 __typeof (mem) __atg9_memp = (mem); \
67 __typeof (*(mem)) __atg9_value = (value); \
69 - __atg9_oldv = *__atg9_memp; \
70 + __atg9_oldv = *(volatile __typeof (mem))__atg9_memp; \
71 if (__atg9_oldv >= __atg9_value) \
73 } while (__builtin_expect \
75 __typeof (mem) __atg10_memp = (mem); \
76 __typeof (*(mem)) __atg10_value = (value); \
78 - __atg10_oldval = *__atg10_memp; \
79 + __atg10_oldval = *(volatile __typeof (mem))__atg10_memp; \
80 if (__atg10_oldval <= __atg10_value) \
82 } while (__builtin_expect \
87 - __atg11_oldval = *__atg11_memp; \
88 + __atg11_oldval = *(volatile __typeof (mem))__atg11_memp; \
89 if (__builtin_expect (__atg11_oldval <= 0, 0)) \
93 __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
96 - __atg14_old = (*__atg14_memp); \
97 + __atg14_old = (*(volatile __typeof (mem))__atg14_memp); \
98 while (__builtin_expect \
99 (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
100 __atg14_old | __atg14_mask,\
102 __typeof (*(mem)) __atg15_mask = (mask); \
105 - __atg15_old = (*__atg15_memp); \
106 + __atg15_old = (*(volatile __typeof (mem))__atg15_memp); \
107 while (__builtin_expect \
108 (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
109 __atg15_old & __atg15_mask, \
111 __typeof (*(mem)) __atg16_mask = (mask); \
114 - __atg16_old = (*__atg16_memp); \
115 + __atg16_old = (*(volatile __typeof (mem))__atg16_memp); \
116 while (__builtin_expect \
117 (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
118 __atg16_old & __atg16_mask,\
120 __typeof (*(mem)) __atg17_mask = (mask); \
123 - __atg17_old = (*__atg17_memp); \
124 + __atg17_old = (*(volatile __typeof (mem))__atg17_memp); \
125 while (__builtin_expect \
126 (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
127 __atg17_old | __atg17_mask, \
129 __typeof (*(mem)) __atg18_mask = (mask); \
132 - __atg18_old = (*__atg18_memp); \
133 + __atg18_old = (*(volatile __typeof (mem))__atg18_memp); \
134 while (__builtin_expect \
135 (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
136 __atg18_old | __atg18_mask,\
138 __typeof (*(mem)) __atg19_mask = (mask); \
141 - __atg19_old = (*__atg19_memp); \
142 + __atg19_old = (*(volatile __typeof (mem))__atg19_memp); \
143 while (__builtin_expect \
144 (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
145 __atg19_old | __atg19_mask,\
146 diff -durN glibc-2.13.orig/nptl/Makefile glibc-2.13/nptl/Makefile
147 --- glibc-2.13.orig/nptl/Makefile 2008-11-12 14:38:23.000000000 +0100
148 +++ glibc-2.13/nptl/Makefile 2009-11-13 00:50:26.000000000 +0100
150 # Files which must not be linked with libpthread.
151 tests-nolibpthread = tst-unload
153 -# This sets the stack resource limit to 1023kb, which is not a multiple
154 -# of the page size since every architecture's page size is > 1k.
155 -tst-oddstacklimit-ENV = ; ulimit -s 1023;
156 +# This sets the stack resource limit to 8193kb, which is not a multiple
157 +# of the page size since every architecture's page size is 4096 bytes.
158 +tst-oddstacklimit-ENV = ; ulimit -s 8193;
160 distribute = eintr.c tst-cleanup4aux.c
163 CFLAGS-tst-cleanupx4.c += -fexceptions
164 CFLAGS-tst-oncex3.c += -fexceptions
165 CFLAGS-tst-oncex4.c += -fexceptions
167 +ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
168 +LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
169 +LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
170 +LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
171 +LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
172 +LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
173 +LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
174 +LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
175 +LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
176 +LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
177 +LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
178 +LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
179 +LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
180 +LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
181 +LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
182 +LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
183 +LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
184 +LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
185 +LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
186 +LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
187 +LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
188 +LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
189 +LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
190 +LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
191 +LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
192 +LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
193 +LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
195 CFLAGS-tst-align.c += $(stack-align-test-flags)
196 CFLAGS-tst-align3.c += $(stack-align-test-flags)
197 CFLAGS-tst-initializers1.c = -W -Wall -Werror
198 diff -durN glibc-2.13.orig/nptl/pthread_barrier_wait.c glibc-2.13/nptl/pthread_barrier_wait.c
199 --- glibc-2.13.orig/nptl/pthread_barrier_wait.c 2007-08-01 06:18:50.000000000 +0200
200 +++ glibc-2.13/nptl/pthread_barrier_wait.c 2009-11-13 00:50:26.000000000 +0100
203 lll_futex_wait (&ibarrier->curr_event, event,
204 ibarrier->private ^ FUTEX_PRIVATE_FLAG);
205 - while (event == ibarrier->curr_event);
206 + while (event == *(volatile unsigned int *)&ibarrier->curr_event);
209 /* Make sure the init_count is stored locally or in a register. */
210 diff -durN glibc-2.13.orig/nptl/sysdeps/pthread/Makefile glibc-2.13/nptl/sysdeps/pthread/Makefile
211 --- glibc-2.13.orig/nptl/sysdeps/pthread/Makefile 2006-02-28 08:09:41.000000000 +0100
212 +++ glibc-2.13/nptl/sysdeps/pthread/Makefile 2009-11-13 00:50:26.000000000 +0100
215 ifeq ($(have-forced-unwind),yes)
216 tests += tst-mqueue8x
217 +ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
218 CFLAGS-tst-mqueue8x.c += -fexceptions
219 +LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s)
223 diff -durN glibc-2.13.orig/stdio-common/Makefile glibc-2.13/stdio-common/Makefile
224 --- glibc-2.13.orig/stdio-common/Makefile 2009-04-11 07:29:56.000000000 +0200
225 +++ glibc-2.13/stdio-common/Makefile 2009-11-13 00:50:26.000000000 +0100
227 $(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
230 -CFLAGS-vfprintf.c = -Wno-uninitialized
231 +CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
232 CFLAGS-vfwprintf.c = -Wno-uninitialized
233 CFLAGS-tst-printf.c = -Wno-format
234 CFLAGS-tstdiomisc.c = -Wno-format
235 diff -durN glibc-2.13.orig/sunrpc/clnt_udp.c glibc-2.13/sunrpc/clnt_udp.c
236 --- glibc-2.13.orig/sunrpc/clnt_udp.c 2008-07-26 10:42:44.000000000 +0200
237 +++ glibc-2.13/sunrpc/clnt_udp.c 2009-11-13 00:50:26.000000000 +0100
239 while (inlen < 0 && errno == EINTR);
242 - if (errno == EWOULDBLOCK)
243 + if (errno == EWOULDBLOCK || errno == EAGAIN)
245 cu->cu_error.re_errno = errno;
246 return (cu->cu_error.re_status = RPC_CANTRECV);