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.17: 0085_all_glibc-disable-ldconfig.patch 1005_all_glibc-sigaction.patch 1008_all_glibc-2.16-fortify.patch 1040_all_2.3.3-localedef-fix-trampoline.patch 1055_all_glibc-resolv-dynamic.patch 1505_all_glibc-nptl-stack-grows-up.patch 3020_all_glibc-tests-sandbox-libdl-paths.patch 5063_all_glibc-dont-build-timezone.patch 6230_all_arm-glibc-hardened.patch 6600_mips_librt-mips.patch README.history
Date: Tue, 25 Dec 2012 20:14:44
Message-Id: 20121225201434.908542171D@flycatcher.gentoo.org
1 vapier 12/12/25 20:14:34
2
3 Added: 0085_all_glibc-disable-ldconfig.patch
4 1005_all_glibc-sigaction.patch
5 1008_all_glibc-2.16-fortify.patch
6 1040_all_2.3.3-localedef-fix-trampoline.patch
7 1055_all_glibc-resolv-dynamic.patch
8 1505_all_glibc-nptl-stack-grows-up.patch
9 3020_all_glibc-tests-sandbox-libdl-paths.patch
10 5063_all_glibc-dont-build-timezone.patch
11 6230_all_arm-glibc-hardened.patch
12 6600_mips_librt-mips.patch README.history
13 Log:
14 initial 2.17 patchset based on last 2.16.0 patchset
15
16 Revision Changes Path
17 1.1 src/patchsets/glibc/2.17/0085_all_glibc-disable-ldconfig.patch
18
19 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/0085_all_glibc-disable-ldconfig.patch?rev=1.1&view=markup
20 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/0085_all_glibc-disable-ldconfig.patch?rev=1.1&content-type=text/plain
21
22 Index: 0085_all_glibc-disable-ldconfig.patch
23 ===================================================================
24 http://sourceware.org/ml/libc-alpha/2012-08/msg00118.html
25 https://bugs.gentoo.org/431038
26
27 do not bother running ldconfig on DESTDIR. it wants to write the temp cache
28 file outside of the chroot. doesnt matter anyways as we wont use the cache
29 results (portage will rebuild cache), so running ldconfig is simply a waste
30 of time.
31
32 --- a/Makefile
33 +++ b/Makefile
34 @@ -117,4 +117,5 @@
35
36 install:
37 +dont-bother-with-destdir:
38 -test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
39 $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
40
41
42
43 1.1 src/patchsets/glibc/2.17/1005_all_glibc-sigaction.patch
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1005_all_glibc-sigaction.patch?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1005_all_glibc-sigaction.patch?rev=1.1&content-type=text/plain
47
48 Index: 1005_all_glibc-sigaction.patch
49 ===================================================================
50 http://bugs.gentoo.org/283470
51
52 work around ... not entirely sure what is going on here.
53
54 2011-03-01 squeezy <vina@××××××××××.eu>
55
56 #283470
57 * sysdeps/unix/sysv/linux/x86_64/sigaction.c fix the __restore_rt symbol
58
59 --- libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
60 +++ libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
61 @@ -40,7 +40,7 @@
62
63 /* Using the hidden attribute here does not change the code but it
64 helps to avoid warnings. */
65 -extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
66 +extern void restore_rt (void) asm ("__restore_rt") __attribute__((__visibility__("hidden")));
67
68
69 /* If ACT is not NULL, change the action for SIG to *ACT.
70
71
72
73 1.1 src/patchsets/glibc/2.17/1008_all_glibc-2.16-fortify.patch
74
75 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1008_all_glibc-2.16-fortify.patch?rev=1.1&view=markup
76 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1008_all_glibc-2.16-fortify.patch?rev=1.1&content-type=text/plain
77
78 Index: 1008_all_glibc-2.16-fortify.patch
79 ===================================================================
80 the fortify/optimization check does not play well with our default gcc specs
81
82 http://sourceware.org/ml/libc-alpha/2012-06/msg00068.html
83
84 --- a/include/features.h
85 +++ b/include/features.h
86 @@ -325,10 +325,11 @@
87 # define __USE_REENTRANT 1
88 #endif
89
90 +#if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
91 +# undef _FORTIFY_SOURCE
92 +#endif
93 #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0
94 -# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
95 -# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
96 -# elif !__GNUC_PREREQ (4, 1)
97 +# if !__GNUC_PREREQ (4, 1)
98 # warning _FORTIFY_SOURCE requires GCC 4.1 or later
99 # elif _FORTIFY_SOURCE > 1
100 # define __USE_FORTIFY_LEVEL 2
101
102
103
104 1.1 src/patchsets/glibc/2.17/1040_all_2.3.3-localedef-fix-trampoline.patch
105
106 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1040_all_2.3.3-localedef-fix-trampoline.patch?rev=1.1&view=markup
107 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1040_all_2.3.3-localedef-fix-trampoline.patch?rev=1.1&content-type=text/plain
108
109 Index: 1040_all_2.3.3-localedef-fix-trampoline.patch
110 ===================================================================
111 #! /bin/sh -e
112
113 # DP: Description: Fix localedef segfault when run under exec-shield,
114 # PaX or similar. (#231438, #198099)
115 # DP: Dpatch Author: James Troup <james@××××××.org>
116 # DP: Patch Author: (probably) Jakub Jelinek <jakub@××××××.com>
117 # DP: Upstream status: Unknown
118 # DP: Status Details: Unknown
119 # DP: Date: 2004-03-16
120
121 if [ $# -ne 2 ]; then
122 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
123 exit 1
124 fi
125 case "$1" in
126 -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
127 -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
128 *)
129 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
130 exit 1
131 esac
132 exit 0
133
134 --- glibc-2.3.3-net/locale/programs/3level.h 16 Jun 2003 07:19:09 -0000 1.1.1.5
135 +++ glibc-2.3.3-redhat/locale/programs/3level.h 16 Jun 2003 09:32:40 -0000 1.4
136 @@ -204,6 +204,42 @@ CONCAT(TABLE,_iterate) (struct TABLE *t,
137 }
138 }
139 }
140 +
141 +/* GCC ATM seems to do a poor job with pointers to nested functions passed
142 + to inlined functions. Help it a little bit with this hack. */
143 +#define wchead_table_iterate(tp, fn) \
144 +do \
145 + { \
146 + struct wchead_table *t = (tp); \
147 + uint32_t index1; \
148 + for (index1 = 0; index1 < t->level1_size; index1++) \
149 + { \
150 + uint32_t lookup1 = t->level1[index1]; \
151 + if (lookup1 != ((uint32_t) ~0)) \
152 + { \
153 + uint32_t lookup1_shifted = lookup1 << t->q; \
154 + uint32_t index2; \
155 + for (index2 = 0; index2 < (1 << t->q); index2++) \
156 + { \
157 + uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
158 + if (lookup2 != ((uint32_t) ~0)) \
159 + { \
160 + uint32_t lookup2_shifted = lookup2 << t->p; \
161 + uint32_t index3; \
162 + for (index3 = 0; index3 < (1 << t->p); index3++) \
163 + { \
164 + struct element_t *lookup3 \
165 + = t->level3[index3 + lookup2_shifted]; \
166 + if (lookup3 != NULL) \
167 + fn ((((index1 << t->q) + index2) << t->p) + index3, \
168 + lookup3); \
169 + } \
170 + } \
171 + } \
172 + } \
173 + } \
174 + } while (0)
175 +
176 #endif
177
178 #ifndef NO_FINALIZE
179
180
181
182 1.1 src/patchsets/glibc/2.17/1055_all_glibc-resolv-dynamic.patch
183
184 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1055_all_glibc-resolv-dynamic.patch?rev=1.1&view=markup
185 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1055_all_glibc-resolv-dynamic.patch?rev=1.1&content-type=text/plain
186
187 Index: 1055_all_glibc-resolv-dynamic.patch
188 ===================================================================
189 ripped from SuSE
190
191 if /etc/resolv.conf is updated, then make sure applications
192 already running get the updated information.
193
194 http://bugs.gentoo.org/177416
195
196 --- libc/resolv/res_libc.c
197 +++ libc/resolv/res_libc.c
198 @@ -22,6 +22,7 @@
199 #include <arpa/nameser.h>
200 #include <resolv.h>
201 #include <bits/libc-lock.h>
202 +#include <sys/stat.h>
203
204
205 /* The following bit is copied from res_data.c (where it is #ifdef'ed
206 @@ -101,6 +102,20 @@
207 __res_maybe_init (res_state resp, int preinit)
208 {
209 if (resp->options & RES_INIT) {
210 + static time_t last_mtime, last_check;
211 + time_t now;
212 + struct stat statbuf;
213 +
214 + time (&now);
215 + if (now != last_check) {
216 + last_check = now;
217 + if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
218 + last_mtime = statbuf.st_mtime;
219 + atomicinclock (lock);
220 + atomicinc (__res_initstamp);
221 + atomicincunlock (lock);
222 + }
223 + }
224 if (__res_initstamp != resp->_u._ext.initstamp) {
225 if (resp->nscount > 0) {
226 __res_nclose (resp);
227
228
229
230 1.1 src/patchsets/glibc/2.17/1505_all_glibc-nptl-stack-grows-up.patch
231
232 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1505_all_glibc-nptl-stack-grows-up.patch?rev=1.1&view=markup
233 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/1505_all_glibc-nptl-stack-grows-up.patch?rev=1.1&content-type=text/plain
234
235 Index: 1505_all_glibc-nptl-stack-grows-up.patch
236 ===================================================================
237 http://bugs.gentoo.org/301642
238
239 --- a/nptl/allocatestack.c 2010-07-25 21:58:30.669136153 +0200
240 +++ b/nptl/allocatestack.c 2010-07-25 21:59:05.528795435 +0200
241 @@ -354,6 +354,15 @@
242 if (__builtin_expect (attr->flags & ATTR_FLAG_STACKADDR, 0))
243 {
244 uintptr_t adj;
245 +#if _STACK_GROWS_DOWN
246 + char * stackaddr = (char *) attr->stackaddr;
247 +#else
248 + /* Assume the same layout as the _STACK_GROWS_DOWN case,
249 + with struct pthread at the top of the stack block.
250 + Later we adjust the guard location and stack address
251 + to match the _STACK_GROWS_UP case. */
252 + char * stackaddr = (char *) attr->stackaddr + attr->stacksize;
253 +#endif
254
255 /* If the user also specified the size of the stack make sure it
256 is large enough. */
257 @@ -363,11 +372,11 @@
258
259 /* Adjust stack size for alignment of the TLS block. */
260 #if TLS_TCB_AT_TP
261 - adj = ((uintptr_t) attr->stackaddr - TLS_TCB_SIZE)
262 + adj = ((uintptr_t) stackaddr - TLS_TCB_SIZE)
263 & __static_tls_align_m1;
264 assert (size > adj + TLS_TCB_SIZE);
265 #elif TLS_DTV_AT_TP
266 - adj = ((uintptr_t) attr->stackaddr - __static_tls_size)
267 + adj = ((uintptr_t) stackaddr - __static_tls_size)
268 & __static_tls_align_m1;
269 assert (size > adj);
270 #endif
271 @@ -377,10 +386,10 @@
272 the stack. It is the user's responsibility to do this if it
273 is wanted. */
274 #if TLS_TCB_AT_TP
275 - pd = (struct pthread *) ((uintptr_t) attr->stackaddr
276 + pd = (struct pthread *) ((uintptr_t) stackaddr
277 - TLS_TCB_SIZE - adj);
278 #elif TLS_DTV_AT_TP
279 - pd = (struct pthread *) (((uintptr_t) attr->stackaddr
280 + pd = (struct pthread *) (((uintptr_t) stackaddr
281 - __static_tls_size - adj)
282 - TLS_PRE_TCB_SIZE);
283 #endif
284 @@ -392,7 +401,7 @@
285 pd->specific[0] = pd->specific_1stblock;
286
287 /* Remember the stack-related values. */
288 - pd->stackblock = (char *) attr->stackaddr - size;
289 + pd->stackblock = (char *) stackaddr - size;
290 pd->stackblock_size = size;
291
292 /* This is a user-provided stack. It will not be queued in the
293 @@ -617,7 +626,7 @@
294 char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
295 #elif _STACK_GROWS_DOWN
296 char *guard = mem;
297 -# elif _STACK_GROWS_UP
298 +#elif _STACK_GROWS_UP
299 char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1);
300 #endif
301 if (mprotect (guard, guardsize, PROT_NONE) != 0)
302 @@ -716,7 +725,6 @@
303 *stack = stacktop;
304 #elif _STACK_GROWS_UP
305 *stack = pd->stackblock;
306 - assert (*stack > 0);
307 #endif
308
309 return 0;
310 --- a/nptl/pthread_attr_getstack.c 2010-07-25 21:58:30.717135358 +0200
311 +++ b/nptl/pthread_attr_getstack.c 2010-07-25 21:59:05.532796982 +0200
312 @@ -33,7 +33,11 @@
313 iattr = (struct pthread_attr *) attr;
314
315 /* Store the result. */
316 +#ifdef _STACK_GROWS_DOWN
317 *stackaddr = (char *) iattr->stackaddr - iattr->stacksize;
318 +#else
319 + *stackaddr = (char *) iattr->stackaddr;
320 +#endif
321 *stacksize = iattr->stacksize;
322
323 return 0;
324 --- a/nptl/pthread_attr_setstack.c 2010-07-25 21:58:30.717135358 +0200
325 +++ b/nptl/pthread_attr_setstack.c 2010-07-25 21:59:05.532796982 +0200
326 @@ -48,7 +48,11 @@
327 #endif
328
329 iattr->stacksize = stacksize;
330 +#if _STACK_GROWS_DOWN
331 iattr->stackaddr = (char *) stackaddr + stacksize;
332 +#else
333 + iattr->stackaddr = (char *) stackaddr;
334 +#endif
335 iattr->flags |= ATTR_FLAG_STACKADDR;
336
337 return 0;
338 @@ -81,7 +85,11 @@
339 # endif
340
341 iattr->stacksize = stacksize;
342 +#if _STACK_GROWS_DOWN
343 iattr->stackaddr = (char *) stackaddr + stacksize;
344 +#else
345 + iattr->stackaddr = (char *) stackaddr;
346 +#endif
347 iattr->flags |= ATTR_FLAG_STACKADDR;
348
349 return 0;
350 --- a/nptl/pthread_create.c 2010-07-25 21:58:30.713135617 +0200
351 +++ b/nptl/pthread_create.c 2010-07-25 21:59:05.536794818 +0200
352 @@ -394,13 +394,26 @@ start_thread (void *arg)
353 #ifdef _STACK_GROWS_DOWN
354 char *sp = CURRENT_STACK_FRAME;
355 size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1;
356 -#else
357 -# error "to do"
358 -#endif
359 assert (freesize < pd->stackblock_size);
360 if (freesize > PTHREAD_STACK_MIN)
361 __madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
362 -
363 +#else
364 + /* Page aligned start of memory to free (higher than or equal
365 + to current sp plus the minimum stack size). */
366 + void *freeblock = (void*)((size_t)(CURRENT_STACK_FRAME
367 + + PTHREAD_STACK_MIN
368 + + pagesize_m1)
369 + & ~pagesize_m1);
370 + char *free_end = (char *) (((uintptr_t) pd - pd->guardsize) & ~pagesize_m1);
371 + /* Is there any space to free? */
372 + if (free_end > (char *)freeblock)
373 + {
374 + size_t freesize = (size_t)(free_end - (char *)freeblock);
375 + assert (freesize < pd->stackblock_size);
376 + __madvise (freeblock, freesize, MADV_DONTNEED);
377 + }
378 +#endif
379 +
380 /* If the thread is detached free the TCB. */
381 if (IS_DETACHED (pd))
382 /* Free the TCB. */
383 --- a/nptl/pthread_getattr_np.c 2010-07-25 21:58:30.713135617 +0200
384 +++ b/nptl/pthread_getattr_np.c 2010-07-25 21:59:05.536794818 +0200
385 @@ -61,7 +62,11 @@
386 if (__builtin_expect (thread->stackblock != NULL, 1))
387 {
388 iattr->stacksize = thread->stackblock_size;
389 +#ifdef _STACK_GROWS_DOWN
390 iattr->stackaddr = (char *) thread->stackblock + iattr->stacksize;
391 +#else
392 + iattr->stackaddr = (char *) thread->stackblock;
393 +#endif
394 }
395 else
396 {
397 @@ -129,12 +133,17 @@ pthread_getattr_np (thread_id, attr)
398 stack extension request. */
399 iattr->stacksize = (iattr->stacksize
400 & -(intptr_t) GLRO(dl_pagesize));
401 -
402 +#if _STACK_GROWS_DOWN
403 /* The limit might be too high. */
404 if ((size_t) iattr->stacksize
405 > (size_t) iattr->stackaddr - last_to)
406 iattr->stacksize = (size_t) iattr->stackaddr - last_to;
407 -
408 +#else
409 + /* The limit might be too high. */
410 + if ((size_t) iattr->stacksize
411 + > to - (size_t) iattr->stackaddr)
412 + iattr->stacksize = to - (size_t) iattr->stackaddr;
413 +#endif
414 /* We succeed and no need to look further. */
415 ret = 0;
416 break;
417
418
419
420 1.1 src/patchsets/glibc/2.17/3020_all_glibc-tests-sandbox-libdl-paths.patch
421
422 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/3020_all_glibc-tests-sandbox-libdl-paths.patch?rev=1.1&view=markup
423 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/3020_all_glibc-tests-sandbox-libdl-paths.patch?rev=1.1&content-type=text/plain
424
425 Index: 3020_all_glibc-tests-sandbox-libdl-paths.patch
426 ===================================================================
427 when glibc runs its tests, it does so by invoking the local library loader.
428 in Gentoo, we build/run inside of our "sandbox" which itself is linked against
429 libdl (so that it can load libraries and pull out symbols). the trouble
430 is that when you upgrade from an older glibc to the new one, often times
431 internal symbols change name or abi. this is normally OK as you cannot use
432 libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
433 we always say "keep all of the glibc libraries from the same build". but
434 when glibc runs its tests, it uses dynamic paths to point to its new local
435 copies of libraries. if the test doesnt use libdl, then glibc doesnt add
436 its path, and when sandbox triggers the loading of libdl, glibc does so
437 from the host system system. this gets us into the case of all libraries
438 are from the locally compiled version of glibc except for libdl.so.
439
440 Fix by Wormo
441
442 http://bugs.gentoo.org/56898
443
444 --- a/iconvdata/run-iconv-test.sh
445 +++ b/iconvdata/run-iconv-test.sh
446 @@ -34,7 +34,7 @@
447 export GCONV_PATH
448
449 # We have to have some directories in the library path.
450 -LIBPATH=$codir:$codir/iconvdata
451 +LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
452
453 # How the start the iconv(1) program.
454 ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
455 --- a/nptl/tst-tls6.sh
456 +++ b/nptl/tst-tls6.sh
457 @@ -5,8 +5,8 @@
458 rtld_installed_name=$1; shift
459 logfile=$common_objpfx/nptl/tst-tls6.out
460
461 -# We have to find libc and nptl
462 -library_path=${common_objpfx}:${common_objpfx}nptl
463 +# We have to find libc and nptl (also libdl in case sandbox is in use)
464 +library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
465 tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
466 ${common_objpfx}/nptl/tst-tls5"
467
468 --- a/Makeconfig
469 +++ b/Makeconfig
470 @@ -593,7 +593,7 @@ comma = ,
471 sysdep-library-path = \
472 $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
473 $(filter -Wl$(comma)-rpath-link=%,\
474 - $(sysdep-LDFLAGS)))))
475 + $(sysdep-LDFLAGS)))) $(common-objpfx)/dlfcn)
476 # $(run-via-rtld-prefix) is a command that, when prepended to the name
477 # of a program built with the newly built library, produces a command
478 # that, executed on the host for which the library is built, runs that
479
480
481
482 1.1 src/patchsets/glibc/2.17/5063_all_glibc-dont-build-timezone.patch
483
484 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/5063_all_glibc-dont-build-timezone.patch?rev=1.1&view=markup
485 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/5063_all_glibc-dont-build-timezone.patch?rev=1.1&content-type=text/plain
486
487 Index: 5063_all_glibc-dont-build-timezone.patch
488 ===================================================================
489 timezone data has been split into the package sys-libs/timezone-data
490
491 --- glibc/Makeconfig
492 +++ glibc/Makeconfig
493 @@ -922,1 +922,1 @@
494 - crypt nss localedata timezone rt conform debug \
495 + crypt nss localedata rt conform debug \
496
497
498
499 1.1 src/patchsets/glibc/2.17/6230_all_arm-glibc-hardened.patch
500
501 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/6230_all_arm-glibc-hardened.patch?rev=1.1&view=markup
502 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/6230_all_arm-glibc-hardened.patch?rev=1.1&content-type=text/plain
503
504 Index: 6230_all_arm-glibc-hardened.patch
505 ===================================================================
506 patch by David Lamparter to fix build errors for hardened/arm systems.
507 the logic in setjmp/__longjmp incorrectly tie to "PIC" to figure out
508 whether the code is going into a shared library when it should be using
509 "SHARED". otherwise, building static PIC code goes wrong.
510
511 https://bugs.gentoo.org/336914
512 http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
513
514 --- a/ports/sysdeps/arm/setjmp.S
515 +++ b/ports/sysdeps/arm/setjmp.S
516 @@ -37,7 +37,7 @@
517 add a3, a3, a4
518 ldr a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
519 # else
520 -# ifdef PIC
521 +# ifdef SHARED
522 ldr a3, 1f
523 ldr a4, .Lrtld_global_ro
524 0: add a3, pc, a3
525 @@ -84,7 +84,7 @@
526 .Lrtld_local_ro:
527 .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
528 # else
529 -# ifdef PIC
530 +# ifdef SHARED
531 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
532 .Lrtld_global_ro:
533 .long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
534 --- a/ports/sysdeps/arm/__longjmp.S
535 +++ b/ports/sysdeps/arm/__longjmp.S
536 @@ -43,7 +43,7 @@
537 add a2, a2, a3
538 ldr a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
539 # else
540 -# ifdef PIC
541 +# ifdef SHARED
542 ldr a2, 1f
543 ldr a3, .Lrtld_global_ro
544 0: add a2, pc, a2
545 @@ -87,7 +87,7 @@
546 .Lrtld_local_ro:
547 .long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
548 # else
549 -# ifdef PIC
550 +# ifdef SHARED
551 1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
552 .Lrtld_global_ro:
553 .long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
554
555
556
557 1.1 src/patchsets/glibc/2.17/6600_mips_librt-mips.patch
558
559 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/6600_mips_librt-mips.patch?rev=1.1&view=markup
560 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/6600_mips_librt-mips.patch?rev=1.1&content-type=text/plain
561
562 Index: 6600_mips_librt-mips.patch
563 ===================================================================
564 we kind of screwed ourselves into a corner by having the clock symbols
565 exported only with the glibc-2.0 version ... this patch fixes the
566 export so all new binaries built against librt will use the correct
567 glibc-2.2 symbol version
568
569 one day, we'll just drop this on the floor (maybe after 2006.1)
570
571 --- a/ports/sysdeps/unix/sysv/linux/mips/Versions
572 +++ b/ports/sysdeps/unix/sysv/linux/mips/Versions
573 @@ -34,3 +34,9 @@
574 _test_and_set;
575 }
576 }
577 +librt {
578 + GLIBC_2.0 {
579 + # c*
580 + clock_gettime; clock_settime;
581 + }
582 +}
583 --- a/Versions.def
584 +++ b/Versions.def
585 @@ -90,6 +90,7 @@
586 GLIBC_PRIVATE
587 }
588 librt {
589 + GLIBC_2.0
590 GLIBC_2.1
591 GLIBC_2.2
592 GLIBC_2.3
593 --- a/sysdeps/unix/clock_gettime.c
594 +++ b/sysdeps/unix/clock_gettime.c
595 @@ -23,6 +23,7 @@
596 #include <sys/time.h>
597 #include <libc-internal.h>
598 #include <ldsodefs.h>
599 +#include <shlib-compat.h>
600
601
602 #if HP_TIMING_AVAIL
603 @@ -90,7 +91,7 @@
604
605 /* Get current value of CLOCK and store it in TP. */
606 int
607 -clock_gettime (clockid_t clock_id, struct timespec *tp)
608 +__clock_gettime (clockid_t clock_id, struct timespec *tp)
609 {
610 int retval = -1;
611 struct timeval tv;
612 @@ -131,4 +132,10 @@
613
614 return retval;
615 }
616 -librt_hidden_def (clock_gettime)
617 +versioned_symbol (librt, __clock_gettime, clock_gettime, GLIBC_2_2);
618 +librt_hidden_ver (__clock_gettime, clock_gettime)
619 +
620 +#if defined __mips__ && defined SHARED
621 +strong_alias (__clock_gettime, __mips_clock_gettime)
622 +compat_symbol (librt, __mips_clock_gettime, clock_gettime, GLIBC_2_0);
623 +#endif
624 --- a/sysdeps/unix/clock_settime.c
625 +++ b/sysdeps/unix/clock_settime.c
626 @@ -21,6 +21,7 @@
627 #include <sys/time.h>
628 #include <libc-internal.h>
629 #include <ldsodefs.h>
630 +#include <shlib-compat.h>
631
632
633 #if HP_TIMING_AVAIL
634 @@ -38,7 +39,7 @@
635
636 /* Set CLOCK to value TP. */
637 int
638 -clock_settime (clockid_t clock_id, const struct timespec *tp)
639 +__clock_settime (clockid_t clock_id, const struct timespec *tp)
640 {
641 int retval;
642
643 @@ -123,3 +124,9 @@
644
645 return retval;
646 }
647 +versioned_symbol (librt, __clock_settime, clock_settime, GLIBC_2_2);
648 +
649 +#if defined __mips__ && defined SHARED
650 +strong_alias (__clock_settime, __mips_clock_settime)
651 +compat_symbol (librt, __mips_clock_settime, clock_settime, GLIBC_2_0);
652 +#endif
653
654
655
656 1.1 src/patchsets/glibc/2.17/README.history
657
658 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/README.history?rev=1.1&view=markup
659 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.17/README.history?rev=1.1&content-type=text/plain
660
661 Index: README.history
662 ===================================================================
663 1 25 Dec 2012
664 + 0085_all_glibc-disable-ldconfig.patch
665 + 1005_all_glibc-sigaction.patch
666 + 1008_all_glibc-2.16-fortify.patch
667 + 1040_all_2.3.3-localedef-fix-trampoline.patch
668 + 1055_all_glibc-resolv-dynamic.patch
669 + 1505_all_glibc-nptl-stack-grows-up.patch
670 + 3020_all_glibc-tests-sandbox-libdl-paths.patch
671 + 5063_all_glibc-dont-build-timezone.patch
672 + 6230_all_arm-glibc-hardened.patch
673 + 6600_mips_librt-mips.patch