patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch
author Cody Schafer <dev@codyps.com>
Fri May 09 19:13:49 2014 -0700 (2014-05-09)
changeset 3312 4876ff97e039
parent 1201 c9967a6e3b25
permissions -rw-r--r--
cc/gcc: allow CC_EXTRA_CONFIG_ARRAY on baremetal

The final bare-metal compiler is built using the core backend.
Currently the core uses the CC_CORE_EXTRA_CONFIG_ARRAY variable.

While this works as supposed to, this can leave the user puzzled
in the menuconfig, since all he can see is the core options, not
the final options.

Only show the core options if any of the core passes are needed,
and use the final options in the core-backend if we're issuing
the bare-metal compiler.

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