patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 02 18:28:10 2011 +0200 (2011-08-02)
changeset 2590 b64cfb67944e
parent 1201 c9967a6e3b25
permissions -rw-r--r--
scripts/functions: svn retrieval first tries the mirror for tarballs

The svn download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via svn.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard svn retrieval will kick in.

Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1201
     1
Original patch from: gentoo/src/patchsets/glibc/2.9/1040_all_2.3.3-localedef-fix-trampoline.patch
yann@1201
     2
yann@1201
     3
-= BEGIN original header =-
yann@1201
     4
#! /bin/sh -e
yann@1201
     5
yann@1201
     6
# DP: Description: Fix localedef segfault when run under exec-shield,
yann@1201
     7
#        PaX or similar. (#231438, #198099)
yann@1201
     8
# DP: Dpatch Author: James Troup <james@nocrew.org>
yann@1201
     9
# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
yann@1201
    10
# DP: Upstream status: Unknown
yann@1201
    11
# DP: Status Details: Unknown
yann@1201
    12
# DP: Date: 2004-03-16
yann@1201
    13
yann@1201
    14
if [ $# -ne 2 ]; then
yann@1201
    15
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
yann@1201
    16
    exit 1
yann@1201
    17
fi
yann@1201
    18
case "$1" in
yann@1201
    19
    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
yann@1201
    20
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
yann@1201
    21
    *)
yann@1201
    22
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
yann@1201
    23
	exit 1
yann@1201
    24
esac
yann@1201
    25
exit 0
yann@1201
    26
yann@1201
    27
-= END original header =-
yann@1201
    28
yann@1201
    29
diff -durN glibc-2_9.orig/locale/programs/3level.h glibc-2_9/locale/programs/3level.h
yann@1201
    30
--- glibc-2_9.orig/locale/programs/3level.h	2007-07-16 02:54:59.000000000 +0200
yann@1201
    31
+++ glibc-2_9/locale/programs/3level.h	2009-02-02 22:00:54.000000000 +0100
yann@1201
    32
@@ -203,6 +203,42 @@
yann@1201
    33
 	}
yann@1201
    34
     }
yann@1201
    35
 }
yann@1201
    36
+
yann@1201
    37
+/* GCC ATM seems to do a poor job with pointers to nested functions passed
yann@1201
    38
+   to inlined functions.  Help it a little bit with this hack.  */
yann@1201
    39
+#define wchead_table_iterate(tp, fn) \
yann@1201
    40
+do									      \
yann@1201
    41
+  {									      \
yann@1201
    42
+    struct wchead_table *t = (tp);					      \
yann@1201
    43
+    uint32_t index1;							      \
yann@1201
    44
+    for (index1 = 0; index1 < t->level1_size; index1++)			      \
yann@1201
    45
+      {									      \
yann@1201
    46
+	uint32_t lookup1 = t->level1[index1];				      \
yann@1201
    47
+	if (lookup1 != ((uint32_t) ~0))					      \
yann@1201
    48
+	  {								      \
yann@1201
    49
+	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
yann@1201
    50
+	    uint32_t index2;						      \
yann@1201
    51
+	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
yann@1201
    52
+	      {								      \
yann@1201
    53
+		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
yann@1201
    54
+		if (lookup2 != ((uint32_t) ~0))				      \
yann@1201
    55
+		  {							      \
yann@1201
    56
+		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
yann@1201
    57
+		    uint32_t index3;					      \
yann@1201
    58
+		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
yann@1201
    59
+		      {							      \
yann@1201
    60
+			struct element_t *lookup3			      \
yann@1201
    61
+			  = t->level3[index3 + lookup2_shifted];	      \
yann@1201
    62
+			if (lookup3 != NULL)				      \
yann@1201
    63
+			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
yann@1201
    64
+			      lookup3);					      \
yann@1201
    65
+		      }							      \
yann@1201
    66
+		  }							      \
yann@1201
    67
+	      }								      \
yann@1201
    68
+	  }								      \
yann@1201
    69
+      }									      \
yann@1201
    70
+  } while (0)
yann@1201
    71
+
yann@1201
    72
 #endif
yann@1201
    73
 
yann@1201
    74
 #ifndef NO_FINALIZE