]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - glibc/patches/glibc-2.10.1-localedef_trampoline-1.patch
Change file layout of the makefiles.
[people/arne_f/ipfire-3.x.git] / glibc / patches / glibc-2.10.1-localedef_trampoline-1.patch
1 Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
2 Date: 2007-05-05
3 Initial Package Version: 2.5
4 Upstream Status: Rejected - http://sources.redhat.com/bugzilla/show_bug.cgi?id=3333
5 Origin: Fedora's glibc-fedora.patch (via glibc-2.5.90-21)
6 Description: Avoid segmentation faults, or kills, on PaX and Exe-Shield kernels,
7 and some non-x86 architectures.
8
9 * Sun Jun 01 2003 Jakub Jelinek <jakub@redhat.com> 2.3.2-46
10 - avoid using trampolines in localedef
11
12 This patch is also known as:
13 local-localedef-fix-trampoline.diff (Debian)
14 1040_all_2.3.3-localedef-fix-trampoline.patch (Gentoo)
15
16 Also see:
17 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231438
18
19 diff -Naur glibc-2.5.orig/locale/programs/3level.h glibc-2.5/locale/programs/3level.h
20 --- glibc-2.5.orig/locale/programs/3level.h 2005-12-07 05:47:27.000000000 +0000
21 +++ glibc-2.5/locale/programs/3level.h 2006-10-11 08:05:00.000000000 +0000
22 @@ -202,6 +202,42 @@
23 }
24 }
25 }
26 +
27 +/* GCC ATM seems to do a poor job with pointers to nested functions passed
28 + to inlined functions. Help it a little bit with this hack. */
29 +#define wchead_table_iterate(tp, fn) \
30 +do \
31 + { \
32 + struct wchead_table *t = (tp); \
33 + uint32_t index1; \
34 + for (index1 = 0; index1 < t->level1_size; index1++) \
35 + { \
36 + uint32_t lookup1 = t->level1[index1]; \
37 + if (lookup1 != ((uint32_t) ~0)) \
38 + { \
39 + uint32_t lookup1_shifted = lookup1 << t->q; \
40 + uint32_t index2; \
41 + for (index2 = 0; index2 < (1 << t->q); index2++) \
42 + { \
43 + uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
44 + if (lookup2 != ((uint32_t) ~0)) \
45 + { \
46 + uint32_t lookup2_shifted = lookup2 << t->p; \
47 + uint32_t index3; \
48 + for (index3 = 0; index3 < (1 << t->p); index3++) \
49 + { \
50 + struct element_t *lookup3 \
51 + = t->level3[index3 + lookup2_shifted]; \
52 + if (lookup3 != NULL) \
53 + fn ((((index1 << t->q) + index2) << t->p) + index3, \
54 + lookup3); \
55 + } \
56 + } \
57 + } \
58 + } \
59 + } \
60 + } while (0)
61 +
62 #endif
63
64 #ifndef NO_FINALIZE