libc/glibc: update patchset, add ports patchset
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 03 00:20:04 2011 +0200 (2011-05-03)
changeset 24377657175fcb8c
parent 2436 c3e0c65b7b93
child 2438 2ba5655f6297
libc/glibc: update patchset, add ports patchset

Patchset provided by "Ioannis E. Venetis" <venetis@mail.capsl.udel.edu>
http://sourceware.org/ml/crossgcc/2011-04/msg00072.html
http://sourceware.org/ml/crossgcc/2011-04/msg00073.html

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
patches/glibc/2.12.1/920-make-382.patch
patches/glibc/ports-2.12.1/100-respect-env-CPPFLAGS.patch
patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch
patches/glibc/ports-2.12.1/140-disable-ldconfig.patch
patches/glibc/ports-2.12.1/150-queue-header-updates.patch
patches/glibc/ports-2.12.1/160-manual-no-perl.patch
patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch
patches/glibc/ports-2.12.1/180-resolv-dynamic.patch
patches/glibc/ports-2.12.1/190-localedef-mmap.patch
patches/glibc/ports-2.12.1/200-fadvise64_64.patch
patches/glibc/ports-2.12.1/220-section-comments.patch
patches/glibc/ports-2.12.1/230-no-inline-gmon.patch
patches/glibc/ports-2.12.1/240-check_native-headers.patch
patches/glibc/ports-2.12.1/250-fix-pr631.patch
patches/glibc/ports-2.12.1/260-assume-pipe2.patch
patches/glibc/ports-2.12.1/270-china.patch
patches/glibc/ports-2.12.1/280-new-valencian-locale.patch
patches/glibc/ports-2.12.1/300-nscd-one-fork.patch
patches/glibc/ports-2.12.1/310-hppa-nptl-carlos.patch
patches/glibc/ports-2.12.1/330-m68k-sys-user.patch
patches/glibc/ports-2.12.1/340-dl_execstack-PaX-support.patch
patches/glibc/ports-2.12.1/350-pre20040117-pt_pax.patch
patches/glibc/ports-2.12.1/360-tests-sandbox-libdl-paths.patch
patches/glibc/ports-2.12.1/370-fnmatch.patch
patches/glibc/ports-2.12.1/380-dont-build-timezone.patch
patches/glibc/ports-2.12.1/400-alpha-xstat.patch
patches/glibc/ports-2.12.1/430-alpha-creat.patch
patches/glibc/ports-2.12.1/440-alpha-cache-shape.patch
patches/glibc/ports-2.12.1/460-alpha-fix-gcc-4.1-warnings.patch
patches/glibc/ports-2.12.1/490-alpha_alpha-add-fdatasync-support.patch
patches/glibc/ports-2.12.1/530-alpha-fix-rtld-fPIC.patch
patches/glibc/ports-2.12.1/560-ppc-atomic.patch
patches/glibc/ports-2.12.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch
patches/glibc/ports-2.12.1/580-nptl-lowlevellock.patch
patches/glibc/ports-2.12.1/610-fpu-cw-mips.patch
patches/glibc/ports-2.12.1/630-mips_shn_undef-hack.patch
patches/glibc/ports-2.12.1/640-alpha-atfcts.patch
patches/glibc/ports-2.12.1/650-syslog.patch
patches/glibc/ports-2.12.1/660-debug-readlink_chk-readklinkat_chk.patch
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.12.1/920-make-382.patch	Tue May 03 00:20:04 2011 +0200
     1.3 @@ -0,0 +1,15 @@
     1.4 +http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=blob_plain;f=source/base/glibc/make-3.82-fix.patch;hb=8217c32ecc2e14962847ba3d8a272eb64a3dba4f
     1.5 +
     1.6 +--- glibc-2.10.1.OLD/manual/Makefile
     1.7 ++++ glibc-2.10.1.NEW/manual/Makefile
     1.8 +@@ -232,7 +232,9 @@
     1.9 + .PHONY: stubs
    1.10 + stubs: $(objpfx)stubs
    1.11 + endif
    1.12 +-$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
    1.13 ++$(objpfx)stubs ../po/manual.pot:
    1.14 ++	touch $@
    1.15 ++$(objpfx)stamp%:
    1.16 + 	$(make-target-directory)
    1.17 + 	touch $@
    1.18 + 
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/glibc/ports-2.12.1/100-respect-env-CPPFLAGS.patch	Tue May 03 00:20:04 2011 +0200
     2.3 @@ -0,0 +1,25 @@
     2.4 +Respect environment CPPFLAGS when we run ./configure so we can inject
     2.5 +random -D things without having to set CFLAGS/ASFLAGS
     2.6 +
     2.7 +diff -durN glibc-2.12.1.orig/Makeconfig glibc-2.12.1/Makeconfig
     2.8 +--- glibc-2.12.1.orig/Makeconfig	2009-05-09 23:57:56.000000000 +0200
     2.9 ++++ glibc-2.12.1/Makeconfig	2009-11-13 00:49:41.000000000 +0100
    2.10 +@@ -697,6 +697,7 @@
    2.11 + 	   $(foreach lib,$(libof-$(basename $(@F))) \
    2.12 + 		         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
    2.13 + 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
    2.14 ++CPPFLAGS += $(CPPFLAGS-config)
    2.15 + override CFLAGS	= -std=gnu99 $(gnu89-inline-CFLAGS) \
    2.16 + 		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
    2.17 + 		  $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
    2.18 +diff -durN glibc-2.12.1.orig/config.make.in glibc-2.12.1/config.make.in
    2.19 +--- glibc-2.12.1.orig/config.make.in	2009-05-09 17:59:38.000000000 +0200
    2.20 ++++ glibc-2.12.1/config.make.in	2009-11-13 00:49:41.000000000 +0100
    2.21 +@@ -107,6 +107,7 @@
    2.22 + CXX = @CXX@
    2.23 + BUILD_CC = @BUILD_CC@
    2.24 + CFLAGS = @CFLAGS@
    2.25 ++CPPFLAGS-config = @CPPFLAGS@
    2.26 + ASFLAGS-config = @ASFLAGS_config@
    2.27 + AR = @AR@
    2.28 + RANLIB = @RANLIB@
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch	Tue May 03 00:20:04 2011 +0200
     3.3 @@ -0,0 +1,55 @@
     3.4 +revert cfi additions to clone on i386/x86_64 to workaround problems in
     3.5 +gcc's unwinder code.  this is not a bug in glibc, it triggers problems
     3.6 +elsewhere.  this cfi code does not gain us a whole lot anyways.
     3.7 +
     3.8 +http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
     3.9 +
    3.10 +Index: sysdeps/unix/sysv/linux/i386/clone.S
    3.11 +===================================================================
    3.12 +RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/clone.S,v
    3.13 +retrieving revision 1.27
    3.14 +retrieving revision 1.26
    3.15 +diff -u -p -r1.27 -r1.26
    3.16 +
    3.17 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2.12.1/sysdeps/unix/sysv/linux/i386/clone.S
    3.18 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/clone.S	2006-12-04 00:12:36.000000000 +0100
    3.19 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/i386/clone.S	2009-11-13 00:49:45.000000000 +0100
    3.20 +@@ -120,9 +120,6 @@
    3.21 + 	ret
    3.22 + 
    3.23 + L(thread_start):
    3.24 +-	cfi_startproc;
    3.25 +-	/* Clearing frame pointer is insufficient, use CFI.  */
    3.26 +-	cfi_undefined (eip);
    3.27 + 	/* Note: %esi is zero.  */
    3.28 + 	movl	%esi,%ebp	/* terminate the stack frame */
    3.29 + #ifdef RESET_PID
    3.30 +@@ -155,7 +152,6 @@
    3.31 + 	jmp	L(haspid)
    3.32 + 	.previous
    3.33 + #endif
    3.34 +-	cfi_endproc;
    3.35 + 
    3.36 + 	cfi_startproc
    3.37 + PSEUDO_END (BP_SYM (__clone))
    3.38 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S glibc-2.12.1/sysdeps/unix/sysv/linux/x86_64/clone.S
    3.39 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S	2006-12-04 00:12:36.000000000 +0100
    3.40 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/x86_64/clone.S	2009-11-13 00:49:45.000000000 +0100
    3.41 +@@ -89,9 +89,6 @@
    3.42 + 	ret
    3.43 + 
    3.44 + L(thread_start):
    3.45 +-	cfi_startproc;
    3.46 +-	/* Clearing frame pointer is insufficient, use CFI.  */
    3.47 +-	cfi_undefined (rip);
    3.48 + 	/* Clear the frame pointer.  The ABI suggests this be done, to mark
    3.49 + 	   the outermost frame obviously.  */
    3.50 + 	xorl	%ebp, %ebp
    3.51 +@@ -116,7 +113,6 @@
    3.52 + 	/* Call exit with return value from function call. */
    3.53 + 	movq	%rax, %rdi
    3.54 + 	call	HIDDEN_JUMPTARGET (_exit)
    3.55 +-	cfi_endproc;
    3.56 + 
    3.57 + 	cfi_startproc;
    3.58 + PSEUDO_END (BP_SYM (__clone))
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/patches/glibc/ports-2.12.1/140-disable-ldconfig.patch	Tue May 03 00:20:04 2011 +0200
     4.3 @@ -0,0 +1,16 @@
     4.4 +do not bother running ldconfig on DESTDIR.  it wants to write the temp cache
     4.5 +file outside of the chroot.  doesnt matter anyways as we wont use the cache
     4.6 +results (portage will rebuild cache), so running ldconfig is simply a waste
     4.7 +of time.
     4.8 +
     4.9 +diff -durN glibc-2.12.1.orig/Makefile glibc-2.12.1/Makefile
    4.10 +--- glibc-2.12.1.orig/Makefile	2009-04-23 20:23:03.000000000 +0200
    4.11 ++++ glibc-2.12.1/Makefile	2009-11-13 00:49:49.000000000 +0100
    4.12 +@@ -116,6 +116,7 @@
    4.13 + 	rm -f $(symbolic-link-list)
    4.14 + 
    4.15 + install:
    4.16 ++dont-bother-with-destdir:
    4.17 + 	-test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
    4.18 + 	  $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
    4.19 + 				       $(slibdir) $(libdir)
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/patches/glibc/ports-2.12.1/150-queue-header-updates.patch	Tue May 03 00:20:04 2011 +0200
     5.3 @@ -0,0 +1,85 @@
     5.4 +grab some updates from FreeBSD
     5.5 +
     5.6 +http://bugs.gentoo.org/201979
     5.7 +
     5.8 +diff -durN glibc-2.12.1.orig/misc/sys/queue.h glibc-2.12.1/misc/sys/queue.h
     5.9 +
    5.10 +diff -durN glibc-2.12.1.orig/misc/sys/queue.h glibc-2.12.1/misc/sys/queue.h
    5.11 +--- glibc-2.12.1.orig/misc/sys/queue.h	2008-03-05 06:50:30.000000000 +0100
    5.12 ++++ glibc-2.12.1/misc/sys/queue.h	2009-11-13 00:49:51.000000000 +0100
    5.13 +@@ -136,6 +136,11 @@
    5.14 + 		(var);							\
    5.15 + 		(var) = ((var)->field.le_next))
    5.16 + 
    5.17 ++#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
    5.18 ++	for ((var) = LIST_FIRST((head));				\
    5.19 ++	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
    5.20 ++	    (var) = (tvar))
    5.21 ++
    5.22 + /*
    5.23 +  * List access methods.
    5.24 +  */
    5.25 +@@ -197,6 +202,16 @@
    5.26 + #define	SLIST_FOREACH(var, head, field)					\
    5.27 + 	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
    5.28 + 
    5.29 ++#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
    5.30 ++	for ((var) = SLIST_FIRST((head));				\
    5.31 ++	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
    5.32 ++	    (var) = (tvar))
    5.33 ++
    5.34 ++#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
    5.35 ++	for ((varp) = &SLIST_FIRST((head));				\
    5.36 ++	    ((var) = *(varp)) != NULL;					\
    5.37 ++	    (varp) = &SLIST_NEXT((var), field))
    5.38 ++
    5.39 + /*
    5.40 +  * Singly-linked List access methods.
    5.41 +  */
    5.42 +@@ -242,6 +257,12 @@
    5.43 + 	(head)->stqh_last = &(elm)->field.stqe_next;			\
    5.44 + } while (/*CONSTCOND*/0)
    5.45 + 
    5.46 ++#define	STAILQ_LAST(head, type, field)					\
    5.47 ++	(STAILQ_EMPTY((head)) ?						\
    5.48 ++		NULL :							\
    5.49 ++	        ((struct type *)(void *)				\
    5.50 ++		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
    5.51 ++
    5.52 + #define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
    5.53 + 	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
    5.54 + 		(head)->stqh_last = &(elm)->field.stqe_next;		\
    5.55 +@@ -271,6 +292,11 @@
    5.56 + 		(var);							\
    5.57 + 		(var) = ((var)->field.stqe_next))
    5.58 + 
    5.59 ++#define STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
    5.60 ++	for ((var) = STAILQ_FIRST((head));				\
    5.61 ++		(var) && ((tvar) = STAILQ_NEXT((var), field), 1);	\
    5.62 ++		(var) = (tvar))
    5.63 ++
    5.64 + #define	STAILQ_CONCAT(head1, head2) do {				\
    5.65 + 	if (!STAILQ_EMPTY((head2))) {					\
    5.66 + 		*(head1)->stqh_last = (head2)->stqh_first;		\
    5.67 +@@ -437,11 +463,21 @@
    5.68 + 		(var);							\
    5.69 + 		(var) = ((var)->field.tqe_next))
    5.70 + 
    5.71 ++#define TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
    5.72 ++	for ((var) = TAILQ_FIRST((head));				\
    5.73 ++		(var) && ((tvar) = TAILQ_NEXT((var), field), 1);	\
    5.74 ++		(var) = (tvar))
    5.75 ++
    5.76 + #define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
    5.77 + 	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
    5.78 + 		(var);							\
    5.79 + 		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
    5.80 + 
    5.81 ++#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	\
    5.82 ++	for ((var) = TAILQ_LAST((head), headname);			\
    5.83 ++		(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
    5.84 ++		(var) = (tvar))
    5.85 ++
    5.86 + #define	TAILQ_CONCAT(head1, head2, field) do {				\
    5.87 + 	if (!TAILQ_EMPTY(head2)) {					\
    5.88 + 		*(head1)->tqh_last = (head2)->tqh_first;		\
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/patches/glibc/ports-2.12.1/160-manual-no-perl.patch	Tue May 03 00:20:04 2011 +0200
     6.3 @@ -0,0 +1,24 @@
     6.4 +If we're using a cvs snapshot which updates the source files, and
     6.5 +perl isn't installed yet, then we can't regen the docs.  Not a big
     6.6 +deal, so just whine a little and continue on our merry way.
     6.7 +
     6.8 +http://bugs.gentoo.org/60132
     6.9 +
    6.10 +diff -durN glibc-2.12.1.orig/manual/Makefile glibc-2.12.1/manual/Makefile
    6.11 +--- glibc-2.12.1.orig/manual/Makefile	2006-01-08 07:43:47.000000000 +0100
    6.12 ++++ glibc-2.12.1/manual/Makefile	2009-11-13 00:49:54.000000000 +0100
    6.13 +@@ -104,9 +104,14 @@
    6.14 + libm-err.texi: stamp-libm-err
    6.15 + stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
    6.16 + 						     $(dir)/libm-test-ulps))
    6.17 ++ifneq ($(PERL),no)
    6.18 + 	pwd=`pwd`; \
    6.19 + 	$(PERL) $< $$pwd/.. > libm-err-tmp
    6.20 + 	$(move-if-change) libm-err-tmp libm-err.texi
    6.21 ++else
    6.22 ++	echo "Unable to rebuild math docs, no perl installed"
    6.23 ++	touch libm-err.texi
    6.24 ++endif
    6.25 + 	touch $@
    6.26 + 
    6.27 + # Generate Texinfo files from the C source for the example programs.
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch	Tue May 03 00:20:04 2011 +0200
     7.3 @@ -0,0 +1,69 @@
     7.4 +#! /bin/sh -e
     7.5 +
     7.6 +# DP: Description: Fix localedef segfault when run under exec-shield,
     7.7 +#        PaX or similar. (#231438, #198099)
     7.8 +# DP: Dpatch Author: James Troup <james@nocrew.org>
     7.9 +# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
    7.10 +# DP: Upstream status: Unknown
    7.11 +# DP: Status Details: Unknown
    7.12 +# DP: Date: 2004-03-16
    7.13 +
    7.14 +if [ $# -ne 2 ]; then
    7.15 +    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    7.16 +    exit 1
    7.17 +fi
    7.18 +case "$1" in
    7.19 +    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
    7.20 +    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
    7.21 +    *)
    7.22 +	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    7.23 +	exit 1
    7.24 +esac
    7.25 +exit 0
    7.26 +
    7.27 +diff -durN glibc-2.12.1.orig/locale/programs/3level.h glibc-2.12.1/locale/programs/3level.h
    7.28 +--- glibc-2.12.1.orig/locale/programs/3level.h	2007-07-16 02:54:59.000000000 +0200
    7.29 ++++ glibc-2.12.1/locale/programs/3level.h	2009-11-13 00:49:56.000000000 +0100
    7.30 +@@ -203,6 +203,42 @@
    7.31 + 	}
    7.32 +     }
    7.33 + }
    7.34 ++
    7.35 ++/* GCC ATM seems to do a poor job with pointers to nested functions passed
    7.36 ++   to inlined functions.  Help it a little bit with this hack.  */
    7.37 ++#define wchead_table_iterate(tp, fn) \
    7.38 ++do									      \
    7.39 ++  {									      \
    7.40 ++    struct wchead_table *t = (tp);					      \
    7.41 ++    uint32_t index1;							      \
    7.42 ++    for (index1 = 0; index1 < t->level1_size; index1++)			      \
    7.43 ++      {									      \
    7.44 ++	uint32_t lookup1 = t->level1[index1];				      \
    7.45 ++	if (lookup1 != ((uint32_t) ~0))					      \
    7.46 ++	  {								      \
    7.47 ++	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
    7.48 ++	    uint32_t index2;						      \
    7.49 ++	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
    7.50 ++	      {								      \
    7.51 ++		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
    7.52 ++		if (lookup2 != ((uint32_t) ~0))				      \
    7.53 ++		  {							      \
    7.54 ++		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
    7.55 ++		    uint32_t index3;					      \
    7.56 ++		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
    7.57 ++		      {							      \
    7.58 ++			struct element_t *lookup3			      \
    7.59 ++			  = t->level3[index3 + lookup2_shifted];	      \
    7.60 ++			if (lookup3 != NULL)				      \
    7.61 ++			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
    7.62 ++			      lookup3);					      \
    7.63 ++		      }							      \
    7.64 ++		  }							      \
    7.65 ++	      }								      \
    7.66 ++	  }								      \
    7.67 ++      }									      \
    7.68 ++  } while (0)
    7.69 ++
    7.70 + #endif
    7.71 + 
    7.72 + #ifndef NO_FINALIZE
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/patches/glibc/ports-2.12.1/180-resolv-dynamic.patch	Tue May 03 00:20:04 2011 +0200
     8.3 @@ -0,0 +1,39 @@
     8.4 +ripped from SuSE
     8.5 +
     8.6 +if /etc/resolv.conf is updated, then make sure applications
     8.7 +already running get the updated information.
     8.8 +
     8.9 +http://bugs.gentoo.org/177416
    8.10 +
    8.11 +diff -durN glibc-2.12.1.orig/resolv/res_libc.c glibc-2.12.1/resolv/res_libc.c
    8.12 +--- glibc-2.12.1.orig/resolv/res_libc.c	2009-02-07 05:27:42.000000000 +0100
    8.13 ++++ glibc-2.12.1/resolv/res_libc.c	2009-11-13 00:49:59.000000000 +0100
    8.14 +@@ -22,6 +22,7 @@
    8.15 + #include <arpa/nameser.h>
    8.16 + #include <resolv.h>
    8.17 + #include <bits/libc-lock.h>
    8.18 ++#include <sys/stat.h>
    8.19 + 
    8.20 + 
    8.21 + /* The following bit is copied from res_data.c (where it is #ifdef'ed
    8.22 +@@ -95,6 +96,20 @@
    8.23 + __res_maybe_init (res_state resp, int preinit)
    8.24 + {
    8.25 + 	if (resp->options & RES_INIT) {
    8.26 ++		static time_t last_mtime, last_check;
    8.27 ++		time_t now;
    8.28 ++		struct stat statbuf;
    8.29 ++		
    8.30 ++		time (&now);
    8.31 ++		if (now != last_check) {
    8.32 ++			last_check = now;
    8.33 ++			if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
    8.34 ++				last_mtime = statbuf.st_mtime;
    8.35 ++				atomicinclock (lock);
    8.36 ++				atomicinc (__res_initstamp);
    8.37 ++				atomicincunlock (lock);
    8.38 ++			}
    8.39 ++		}
    8.40 + 		if (__res_initstamp != resp->_u._ext.initstamp) {
    8.41 + 			if (resp->nscount > 0)
    8.42 + 				__res_iclose (resp, true);
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/patches/glibc/ports-2.12.1/190-localedef-mmap.patch	Tue May 03 00:20:04 2011 +0200
     9.3 @@ -0,0 +1,39 @@
     9.4 +sniped from Debian
     9.5 +http://bugs.gentoo.org/289615
     9.6 +
     9.7 +2009-10-27  Aurelien Jarno  <aurelien@aurel32.net>
     9.8 +
     9.9 +	* locale/programs/locarchive.c: use MMAP_SHARED to reserve memory
    9.10 +	used later with MMAP_FIXED | MMAP_SHARED to cope with different
    9.11 +	alignment restrictions.
    9.12 +
    9.13 +diff -durN glibc-2.12.1.orig/locale/programs/locarchive.c glibc-2.12.1/locale/programs/locarchive.c
    9.14 +--- glibc-2.12.1.orig/locale/programs/locarchive.c	2009-04-27 16:07:47.000000000 +0200
    9.15 ++++ glibc-2.12.1/locale/programs/locarchive.c	2009-11-13 00:50:01.000000000 +0100
    9.16 +@@ -134,7 +134,7 @@
    9.17 +   size_t reserved = RESERVE_MMAP_SIZE;
    9.18 +   int xflags = 0;
    9.19 +   if (total < reserved
    9.20 +-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
    9.21 ++      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
    9.22 + 		       -1, 0)) != MAP_FAILED))
    9.23 +     xflags = MAP_FIXED;
    9.24 +   else
    9.25 +@@ -396,7 +396,7 @@
    9.26 +   size_t reserved = RESERVE_MMAP_SIZE;
    9.27 +   int xflags = 0;
    9.28 +   if (total < reserved
    9.29 +-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
    9.30 ++      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
    9.31 + 		       -1, 0)) != MAP_FAILED))
    9.32 +     xflags = MAP_FIXED;
    9.33 +   else
    9.34 +@@ -614,7 +614,7 @@
    9.35 +   int xflags = 0;
    9.36 +   void *p;
    9.37 +   if (st.st_size < reserved
    9.38 +-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
    9.39 ++      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
    9.40 + 		       -1, 0)) != MAP_FAILED))
    9.41 +     xflags = MAP_FIXED;
    9.42 +   else
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/patches/glibc/ports-2.12.1/200-fadvise64_64.patch	Tue May 03 00:20:04 2011 +0200
    10.3 @@ -0,0 +1,28 @@
    10.4 +ripped from Debian
    10.5 +
    10.6 + sysdeps/unix/sysv/linux/posix_fadvise.c |   13 +++++++++++++
    10.7 + 1 file changed, 13 insertions(+)
    10.8 +
    10.9 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2.12.1/sysdeps/unix/sysv/linux/posix_fadvise.c
   10.10 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/posix_fadvise.c	2003-08-17 02:36:22.000000000 +0200
   10.11 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/posix_fadvise.c	2009-11-13 00:50:03.000000000 +0100
   10.12 +@@ -35,6 +35,19 @@
   10.13 +     return INTERNAL_SYSCALL_ERRNO (ret, err);
   10.14 +   return 0;
   10.15 + #else
   10.16 ++# ifdef __NR_fadvise64_64
   10.17 ++  INTERNAL_SYSCALL_DECL (err);  
   10.18 ++  int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
   10.19 ++			      __LONG_LONG_PAIR ((long) (offset >> 31),
   10.20 ++						(long) offset),
   10.21 ++			      __LONG_LONG_PAIR ((long) (len >> 31),
   10.22 ++						(long) len),
   10.23 ++			      advise);
   10.24 ++  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
   10.25 ++    return INTERNAL_SYSCALL_ERRNO (ret, err);
   10.26 ++  return 0;
   10.27 ++# else
   10.28 +   return ENOSYS;
   10.29 ++# endif
   10.30 + #endif
   10.31 + }
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/patches/glibc/ports-2.12.1/220-section-comments.patch	Tue May 03 00:20:04 2011 +0200
    11.3 @@ -0,0 +1,24 @@
    11.4 +http://sources.redhat.com/ml/binutils/2004-04/msg00665.html
    11.5 +
    11.6 +fixes building on some architectures (like m68k/arm/cris/etc...) because
    11.7 +it does the right thing
    11.8 +
    11.9 +diff -durN glibc-2.12.1.orig/include/libc-symbols.h glibc-2.12.1/include/libc-symbols.h
   11.10 +--- glibc-2.12.1.orig/include/libc-symbols.h	2009-03-14 00:51:46.000000000 +0100
   11.11 ++++ glibc-2.12.1/include/libc-symbols.h	2009-11-13 00:50:07.000000000 +0100
   11.12 +@@ -239,12 +239,12 @@
   11.13 + #  define __make_section_unallocated(section_string)
   11.14 + # endif
   11.15 + 
   11.16 +-/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
   11.17 ++/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
   11.18 +    section attributes on what looks like a comment to the assembler.  */
   11.19 + # ifdef HAVE_SECTION_QUOTES
   11.20 +-#  define __sec_comment "\"\n\t#\""
   11.21 ++#  define __sec_comment "\"\n#APP\n\t#\""
   11.22 + # else
   11.23 +-#  define __sec_comment "\n\t#"
   11.24 ++#  define __sec_comment "\n#APP\n\t#"
   11.25 + # endif
   11.26 + # define link_warning(symbol, msg) \
   11.27 +   __make_section_unallocated (".gnu.warning." #symbol) \
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/patches/glibc/ports-2.12.1/230-no-inline-gmon.patch	Tue May 03 00:20:04 2011 +0200
    12.3 @@ -0,0 +1,36 @@
    12.4 +http://bugs.gentoo.org/196245
    12.5 +http://sourceware.org/ml/libc-alpha/2006-05/msg00017.html
    12.6 +
    12.7 +Attached is a patch to add __attribute__ ((noinline)) to
    12.8 +call_gmon_start.
    12.9 +
   12.10 +Without this patch, the sec script that processed initfini.s removes a
   12.11 +part of inlined call_gmon_start, causing undefined label errors.
   12.12 +
   12.13 +This patch solves the problem by forcing gcc not to inline
   12.14 +call_gmon_start with __attribute__ ((noinline)).
   12.15 +
   12.16 +Tested by building for arm-none-lixux-gnueabi.  OK to apply?
   12.17 +
   12.18 +Kazu Hirata
   12.19 +
   12.20 +2006-05-07  Kazu Hirata  &lt;kazu@codesourcery.com&gt;
   12.21 +
   12.22 +	* sysdeps/generic/initfini.c (call_gmon_start): Add
   12.23 +	__attribute__ ((noinline)).
   12.24 +
   12.25 +Index: sysdeps/generic/initfini.c
   12.26 +===================================================================
   12.27 +
   12.28 +diff -durN glibc-2.12.1.orig/sysdeps/generic/initfini.c glibc-2.12.1/sysdeps/generic/initfini.c
   12.29 +--- glibc-2.12.1.orig/sysdeps/generic/initfini.c	2007-06-17 20:02:40.000000000 +0200
   12.30 ++++ glibc-2.12.1/sysdeps/generic/initfini.c	2009-11-13 00:50:09.000000000 +0100
   12.31 +@@ -70,7 +70,7 @@
   12.32 + /* The beginning of _init:  */
   12.33 + asm ("\n/*@_init_PROLOG_BEGINS*/");
   12.34 + 
   12.35 +-static void
   12.36 ++static void __attribute__ ((noinline))
   12.37 + call_gmon_start(void)
   12.38 + {
   12.39 +   extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/patches/glibc/ports-2.12.1/240-check_native-headers.patch	Tue May 03 00:20:04 2011 +0200
    13.3 @@ -0,0 +1,17 @@
    13.4 +many ports hit this warning:
    13.5 +../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
    13.6 +../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
    13.7 +
    13.8 +snipped from suse
    13.9 +
   13.10 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/check_native.c glibc-2.12.1/sysdeps/unix/sysv/linux/check_native.c
   13.11 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/check_native.c	2007-11-24 04:12:17.000000000 +0100
   13.12 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/check_native.c	2009-11-13 00:50:11.000000000 +0100
   13.13 +@@ -23,6 +23,7 @@
   13.14 + #include <stddef.h>
   13.15 + #include <stdint.h>
   13.16 + #include <stdlib.h>
   13.17 ++#include <string.h>
   13.18 + #include <time.h>
   13.19 + #include <unistd.h>
   13.20 + #include <net/if.h>
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/patches/glibc/ports-2.12.1/250-fix-pr631.patch	Tue May 03 00:20:04 2011 +0200
    14.3 @@ -0,0 +1,45 @@
    14.4 +From dank@kegel.com
    14.5 +Wed Jun 15 09:12:43 PDT 2005
    14.6 +
    14.7 +Fixes
    14.8 +
    14.9 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
   14.10 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
   14.11 +... 53 lines deleted ...
   14.12 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
   14.13 +collect2: ld returned 1 exit status
   14.14 +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
   14.15 +
   14.16 +when building glibc with --enable-static-nss.
   14.17 +
   14.18 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
   14.19 +
   14.20 +diff -durN glibc-2.12.1.orig/Makeconfig glibc-2.12.1/Makeconfig
   14.21 +--- glibc-2.12.1.orig/Makeconfig	2009-11-13 00:49:41.000000000 +0100
   14.22 ++++ glibc-2.12.1/Makeconfig	2009-11-13 00:50:13.000000000 +0100
   14.23 +@@ -531,7 +531,7 @@
   14.24 + 
   14.25 + # The static libraries.
   14.26 + ifeq (yes,$(build-static))
   14.27 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
   14.28 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
   14.29 + else
   14.30 + ifeq (yes,$(build-shared))
   14.31 + # We can try to link the programs with lib*_pic.a...
   14.32 +diff -durN glibc-2.12.1.orig/elf/Makefile glibc-2.12.1/elf/Makefile
   14.33 +--- glibc-2.12.1.orig/elf/Makefile	2009-01-31 01:20:55.000000000 +0100
   14.34 ++++ glibc-2.12.1/elf/Makefile	2009-11-13 00:50:13.000000000 +0100
   14.35 +@@ -146,6 +146,13 @@
   14.36 + install-bin-script = ldd
   14.37 + endif
   14.38 + 
   14.39 ++ifeq (yes,$(build-static-nss))
   14.40 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
   14.41 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
   14.42 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
   14.43 ++	     $(resolvobjdir)/libresolv.a
   14.44 ++endif
   14.45 ++
   14.46 + others		= sprof sln
   14.47 + install-bin	= sprof
   14.48 + others-static   = sln
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/patches/glibc/ports-2.12.1/260-assume-pipe2.patch	Tue May 03 00:20:04 2011 +0200
    15.3 @@ -0,0 +1,40 @@
    15.4 +http://bugs.gentoo.org/250342
    15.5 +http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
    15.6 +
    15.7 +we cant assume sock_cloexec and pipe2 are bound together as the former defines
    15.8 +are found in glibc only while the latter are a combo of kernel headers and
    15.9 +glibc.  so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
   15.10 +inside of glibc, we hit a problem.  for example:
   15.11 +
   15.12 +#include <grp.h>
   15.13 +#include <stdio.h>
   15.14 +main()
   15.15 +{
   15.16 +	getgrnam("portage");
   15.17 +	if (!popen("ls", "r"))
   15.18 +		perror("popen()");
   15.19 +}
   15.20 +
   15.21 +getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
   15.22 +__have_sock_cloexec and __have_pipe2 to true.  but if glibc was built against
   15.23 +older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
   15.24 +stub for it.  so popen() will always fail as glibc assumes pipe2() works.
   15.25 +
   15.26 +diff -durN glibc-2.12.1.orig/socket/have_sock_cloexec.c glibc-2.12.1/socket/have_sock_cloexec.c
   15.27 +--- glibc-2.12.1.orig/socket/have_sock_cloexec.c	2008-07-25 18:46:23.000000000 +0200
   15.28 ++++ glibc-2.12.1/socket/have_sock_cloexec.c	2009-11-13 00:50:15.000000000 +0100
   15.29 +@@ -16,9 +16,14 @@
   15.30 +    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   15.31 +    02111-1307 USA.  */
   15.32 + 
   15.33 ++#include <fcntl.h>
   15.34 + #include <sys/socket.h>
   15.35 + #include <kernel-features.h>
   15.36 + 
   15.37 + #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
   15.38 + int __have_sock_cloexec;
   15.39 + #endif
   15.40 ++
   15.41 ++#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
   15.42 ++int __have_pipe2;
   15.43 ++#endif
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/patches/glibc/ports-2.12.1/270-china.patch	Tue May 03 00:20:04 2011 +0200
    16.3 @@ -0,0 +1,32 @@
    16.4 +
    16.5 +
    16.6 +diff -durN glibc-2.12.1.orig/localedata/locales/zh_TW glibc-2.12.1/localedata/locales/zh_TW
    16.7 +--- glibc-2.12.1.orig/localedata/locales/zh_TW	2004-11-01 00:42:28.000000000 +0100
    16.8 ++++ glibc-2.12.1/localedata/locales/zh_TW	2009-11-13 00:50:17.000000000 +0100
    16.9 +@@ -1,7 +1,7 @@
   16.10 + comment_char %
   16.11 + escape_char /
   16.12 + %
   16.13 +-% Chinese language locale for Taiwan R.O.C.
   16.14 ++% Chinese language locale for Taiwan
   16.15 + % charmap: BIG5-CP950
   16.16 + %
   16.17 + % Original Author:
   16.18 +@@ -17,7 +17,7 @@
   16.19 + % Reference:	http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
   16.20 + 
   16.21 + LC_IDENTIFICATION
   16.22 +-title      "Chinese locale for Taiwan R.O.C."
   16.23 ++title      "Chinese locale for Taiwan"
   16.24 + source     ""
   16.25 + address    ""
   16.26 + contact    ""
   16.27 +@@ -25,7 +25,7 @@
   16.28 + tel        ""
   16.29 + fax        ""
   16.30 + language   "Chinese"
   16.31 +-territory  "Taiwan R.O.C."
   16.32 ++territory  "Taiwan"
   16.33 + revision   "0.2"
   16.34 + date       "2000-08-02"
   16.35 + %
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/patches/glibc/ports-2.12.1/280-new-valencian-locale.patch	Tue May 03 00:20:04 2011 +0200
    17.3 @@ -0,0 +1,115 @@
    17.4 +http://bugs.gentoo.org/show_bug.cgi?id=131815
    17.5 +http://sourceware.org/bugzilla/show_bug.cgi?id=2522
    17.6 +
    17.7 +diff -durN glibc-2.12.1.orig/localedata/SUPPORTED glibc-2.12.1/localedata/SUPPORTED
    17.8 +--- glibc-2.12.1.orig/localedata/SUPPORTED	2009-04-18 10:43:52.000000000 +0200
    17.9 ++++ glibc-2.12.1/localedata/SUPPORTED	2009-11-13 00:50:20.000000000 +0100
   17.10 +@@ -72,6 +72,8 @@
   17.11 + ca_ES.UTF-8/UTF-8 \
   17.12 + ca_ES/ISO-8859-1 \
   17.13 + ca_ES@euro/ISO-8859-15 \
   17.14 ++ca_ES.UTF-8@valencia/UTF-8 \
   17.15 ++ca_ES@valencia/ISO-8859-15 \
   17.16 + ca_FR.UTF-8/UTF-8 \
   17.17 + ca_FR/ISO-8859-15 \
   17.18 + ca_IT.UTF-8/UTF-8 \
   17.19 +diff -durN glibc-2.12.1.orig/localedata/locales/ca_ES@valencia glibc-2.12.1/localedata/locales/ca_ES@valencia
   17.20 +--- glibc-2.12.1.orig/localedata/locales/ca_ES@valencia	1970-01-01 01:00:00.000000000 +0100
   17.21 ++++ glibc-2.12.1/localedata/locales/ca_ES@valencia	2009-11-13 00:50:20.000000000 +0100
   17.22 +@@ -0,0 +1,96 @@
   17.23 ++comment_char %
   17.24 ++escape_char  /
   17.25 ++%
   17.26 ++% Valencian (southern Catalan) locale for Spain with Euro
   17.27 ++%
   17.28 ++% Note that this locale is almost the same as ca_ES@euro.  The point of having
   17.29 ++% a separate locale is only for PO translations, which have a lot of social
   17.30 ++% support and are very appreciated by the Valencian-speaking community.
   17.31 ++%
   17.32 ++% Contact: Jordi Mallach
   17.33 ++% Email: jordi@gnu.org
   17.34 ++% Tel:
   17.35 ++% Fax:
   17.36 ++% Language: ca
   17.37 ++% Territory: ES
   17.38 ++% Option: euro
   17.39 ++% Revision: 1.0
   17.40 ++% Date: 2006-04-06
   17.41 ++% Application: general
   17.42 ++% Users: general
   17.43 ++% Repertoiremap: mnemonic,ds
   17.44 ++% Charset: ISO-8859-15
   17.45 ++% Distribution and use is free, also
   17.46 ++% for commercial purposes.
   17.47 ++
   17.48 ++LC_IDENTIFICATION
   17.49 ++title      "Valencian (southern Catalan) locale for Spain with Euro"
   17.50 ++source     ""
   17.51 ++address    ""
   17.52 ++contact    "Jordi Mallach"
   17.53 ++email      "jordi@gnu.org"
   17.54 ++tel        ""
   17.55 ++fax        ""
   17.56 ++language   "Catalan"
   17.57 ++territory  "Spain"
   17.58 ++revision   "1.0"
   17.59 ++date       "2006-04-06"
   17.60 ++%
   17.61 ++category  "ca_ES@valencia:2006";LC_IDENTIFICATION
   17.62 ++category  "ca_ES@valencia:2006";LC_CTYPE
   17.63 ++category  "ca_ES@valencia:2006";LC_COLLATE
   17.64 ++category  "ca_ES@valencia:2006";LC_MONETARY
   17.65 ++category  "ca_ES@valencia:2006";LC_NUMERIC
   17.66 ++category  "ca_ES@valencia:2006";LC_TIME
   17.67 ++category  "ca_ES@valencia:2006";LC_MESSAGES
   17.68 ++category  "ca_ES@valencia:2006";LC_PAPER
   17.69 ++category  "ca_ES@valencia:2006";LC_NAME
   17.70 ++category  "ca_ES@valencia:2006";LC_ADDRESS
   17.71 ++category  "ca_ES@valencia:2006";LC_TELEPHONE
   17.72 ++category  "ca_ES@valencia:2006";LC_MEASUREMENT
   17.73 ++
   17.74 ++END LC_IDENTIFICATION
   17.75 ++
   17.76 ++LC_CTYPE
   17.77 ++copy "i18n"
   17.78 ++END LC_CTYPE
   17.79 ++
   17.80 ++LC_COLLATE
   17.81 ++copy "ca_ES"
   17.82 ++END LC_COLLATE
   17.83 ++
   17.84 ++LC_MONETARY
   17.85 ++copy "ca_ES"
   17.86 ++END LC_MONETARY
   17.87 ++
   17.88 ++LC_NUMERIC
   17.89 ++copy "ca_ES"
   17.90 ++END LC_NUMERIC
   17.91 ++
   17.92 ++LC_TIME
   17.93 ++copy "ca_ES"
   17.94 ++END LC_TIME
   17.95 ++
   17.96 ++LC_MESSAGES
   17.97 ++copy "ca_ES"
   17.98 ++END LC_MESSAGES
   17.99 ++
  17.100 ++LC_PAPER
  17.101 ++copy "ca_ES"
  17.102 ++END LC_PAPER
  17.103 ++
  17.104 ++LC_NAME
  17.105 ++copy "ca_ES"
  17.106 ++END LC_NAME
  17.107 ++
  17.108 ++LC_ADDRESS
  17.109 ++copy "ca_ES"
  17.110 ++END LC_ADDRESS
  17.111 ++
  17.112 ++LC_TELEPHONE
  17.113 ++copy "ca_ES"
  17.114 ++END LC_TELEPHONE
  17.115 ++
  17.116 ++LC_MEASUREMENT
  17.117 ++copy "ca_ES"
  17.118 ++END LC_MEASUREMENT
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/patches/glibc/ports-2.12.1/300-nscd-one-fork.patch	Tue May 03 00:20:04 2011 +0200
    18.3 @@ -0,0 +1,40 @@
    18.4 +only fork one to assist in stop-start-daemon assumptions about daemon behavior
    18.5 +
    18.6 +http://bugs.gentoo.org/190785
    18.7 +
    18.8 +diff -durN glibc-2.12.1.orig/nscd/nscd.c glibc-2.12.1/nscd/nscd.c
    18.9 +--- glibc-2.12.1.orig/nscd/nscd.c	2009-02-06 21:10:27.000000000 +0100
   18.10 ++++ glibc-2.12.1/nscd/nscd.c	2009-11-13 00:50:24.000000000 +0100
   18.11 +@@ -182,6 +182,9 @@
   18.12 +       if (pid != 0)
   18.13 + 	exit (0);
   18.14 + 
   18.15 ++       if (write_pid (_PATH_NSCDPID) < 0)
   18.16 ++	dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
   18.17 ++
   18.18 +       int nullfd = open (_PATH_DEVNULL, O_RDWR);
   18.19 +       if (nullfd != -1)
   18.20 + 	{
   18.21 +@@ -231,12 +234,6 @@
   18.22 + 	for (i = min_close_fd; i < getdtablesize (); i++)
   18.23 + 	  close (i);
   18.24 + 
   18.25 +-      pid = fork ();
   18.26 +-      if (pid == -1)
   18.27 +-	error (EXIT_FAILURE, errno, _("cannot fork"));
   18.28 +-      if (pid != 0)
   18.29 +-	exit (0);
   18.30 +-
   18.31 +       setsid ();
   18.32 + 
   18.33 +       if (chdir ("/") != 0)
   18.34 +@@ -245,9 +242,6 @@
   18.35 + 
   18.36 +       openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
   18.37 + 
   18.38 +-      if (write_pid (_PATH_NSCDPID) < 0)
   18.39 +-	dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
   18.40 +-
   18.41 +       if (!init_logfile ())
   18.42 + 	dbg_log (_("Could not create log file"));
   18.43 + 
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/patches/glibc/ports-2.12.1/310-hppa-nptl-carlos.patch	Tue May 03 00:20:04 2011 +0200
    19.3 @@ -0,0 +1,246 @@
    19.4 +
    19.5 +
    19.6 +diff -durN glibc-2.12.1.orig/elf/rtld.c glibc-2.12.1/elf/rtld.c
    19.7 +--- glibc-2.12.1.orig/elf/rtld.c	2009-04-17 02:00:08.000000000 +0200
    19.8 ++++ glibc-2.12.1/elf/rtld.c	2009-11-13 00:50:26.000000000 +0100
    19.9 +@@ -390,14 +390,14 @@
   19.10 +      know it is available.  We do not have to clear the memory if we
   19.11 +      do not have to use the temporary bootstrap_map.  Global variables
   19.12 +      are initialized to zero by default.  */
   19.13 +-#ifndef DONT_USE_BOOTSTRAP_MAP
   19.14 ++#if !defined DONT_USE_BOOTSTRAP_MAP
   19.15 + # ifdef HAVE_BUILTIN_MEMSET
   19.16 +   __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
   19.17 + # else
   19.18 +-  for (size_t cnt = 0;
   19.19 +-       cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
   19.20 +-       ++cnt)
   19.21 +-    bootstrap_map.l_info[cnt] = 0;
   19.22 ++  /* Clear the whole bootstrap_map structure */
   19.23 ++  for (char *cnt = (char *)&(bootstrap_map);
   19.24 ++       cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
   19.25 ++       *cnt++ = '\0');
   19.26 + # endif
   19.27 + # if USE___THREAD
   19.28 +   bootstrap_map.l_tls_modid = 0;
   19.29 +diff -durN glibc-2.12.1.orig/include/atomic.h glibc-2.12.1/include/atomic.h
   19.30 +--- glibc-2.12.1.orig/include/atomic.h	2009-02-09 00:49:53.000000000 +0100
   19.31 ++++ glibc-2.12.1/include/atomic.h	2009-11-13 00:50:26.000000000 +0100
   19.32 +@@ -185,7 +185,7 @@
   19.33 +      __typeof (*(mem)) __atg5_value = (newvalue);			      \
   19.34 + 									      \
   19.35 +      do									      \
   19.36 +-       __atg5_oldval = *__atg5_memp;					      \
   19.37 ++       __atg5_oldval = *(volatile __typeof (mem))__atg5_memp;		      \
   19.38 +      while (__builtin_expect						      \
   19.39 + 	    (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
   19.40 + 						   __atg5_oldval), 0));	      \
   19.41 +@@ -206,7 +206,7 @@
   19.42 +      __typeof (*(mem)) __atg6_value = (value);				      \
   19.43 + 									      \
   19.44 +      do									      \
   19.45 +-       __atg6_oldval = *__atg6_memp;					      \
   19.46 ++       __atg6_oldval = *(volatile __typeof (mem))__atg6_memp;		      \
   19.47 +      while (__builtin_expect						      \
   19.48 + 	    (atomic_compare_and_exchange_bool_acq (__atg6_memp,		      \
   19.49 + 						   __atg6_oldval	      \
   19.50 +@@ -224,7 +224,7 @@
   19.51 +      __typeof (*(mem)) __atg7_value = (value);				      \
   19.52 + 									      \
   19.53 +      do									      \
   19.54 +-       __atg7_oldv = *__atg7_memp;					      \
   19.55 ++       __atg7_oldv = *(volatile __typeof (mem))__atg7_memp;		      \
   19.56 +      while (__builtin_expect						      \
   19.57 + 	    (catomic_compare_and_exchange_bool_acq (__atg7_memp,	      \
   19.58 + 						    __atg7_oldv		      \
   19.59 +@@ -242,7 +242,7 @@
   19.60 +     __typeof (mem) __atg8_memp = (mem);					      \
   19.61 +     __typeof (*(mem)) __atg8_value = (value);				      \
   19.62 +     do {								      \
   19.63 +-      __atg8_oldval = *__atg8_memp;					      \
   19.64 ++      __atg8_oldval = *(volatile __typeof (mem))__atg8_memp;		      \
   19.65 +       if (__atg8_oldval >= __atg8_value)				      \
   19.66 + 	break;								      \
   19.67 +     } while (__builtin_expect						      \
   19.68 +@@ -259,7 +259,7 @@
   19.69 +     __typeof (mem) __atg9_memp = (mem);					      \
   19.70 +     __typeof (*(mem)) __atg9_value = (value);				      \
   19.71 +     do {								      \
   19.72 +-      __atg9_oldv = *__atg9_memp;					      \
   19.73 ++      __atg9_oldv = *(volatile __typeof (mem))__atg9_memp;		      \
   19.74 +       if (__atg9_oldv >= __atg9_value)					      \
   19.75 + 	break;								      \
   19.76 +     } while (__builtin_expect						      \
   19.77 +@@ -277,7 +277,7 @@
   19.78 +     __typeof (mem) __atg10_memp = (mem);				      \
   19.79 +     __typeof (*(mem)) __atg10_value = (value);				      \
   19.80 +     do {								      \
   19.81 +-      __atg10_oldval = *__atg10_memp;					      \
   19.82 ++      __atg10_oldval = *(volatile __typeof (mem))__atg10_memp;		      \
   19.83 +       if (__atg10_oldval <= __atg10_value)				      \
   19.84 + 	break;								      \
   19.85 +     } while (__builtin_expect						      \
   19.86 +@@ -361,7 +361,7 @@
   19.87 + 									      \
   19.88 +      do									      \
   19.89 +        {								      \
   19.90 +-	 __atg11_oldval = *__atg11_memp;				      \
   19.91 ++	 __atg11_oldval = *(volatile __typeof (mem))__atg11_memp;	      \
   19.92 + 	 if (__builtin_expect (__atg11_oldval <= 0, 0))			      \
   19.93 + 	   break;							      \
   19.94 +        }								      \
   19.95 +@@ -400,7 +400,7 @@
   19.96 +      __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit));	      \
   19.97 + 									      \
   19.98 +      do									      \
   19.99 +-       __atg14_old = (*__atg14_memp);					      \
  19.100 ++       __atg14_old = (*(volatile __typeof (mem))__atg14_memp);		      \
  19.101 +      while (__builtin_expect						      \
  19.102 + 	    (atomic_compare_and_exchange_bool_acq (__atg14_memp,	      \
  19.103 + 						   __atg14_old | __atg14_mask,\
  19.104 +@@ -418,7 +418,7 @@
  19.105 +     __typeof (*(mem)) __atg15_mask = (mask);				      \
  19.106 + 									      \
  19.107 +     do									      \
  19.108 +-      __atg15_old = (*__atg15_memp);					      \
  19.109 ++      __atg15_old = (*(volatile __typeof (mem))__atg15_memp);		      \
  19.110 +     while (__builtin_expect						      \
  19.111 + 	   (atomic_compare_and_exchange_bool_acq (__atg15_memp,		      \
  19.112 + 						  __atg15_old & __atg15_mask, \
  19.113 +@@ -450,7 +450,7 @@
  19.114 +      __typeof (*(mem)) __atg16_mask = (mask);				      \
  19.115 + 									      \
  19.116 +      do									      \
  19.117 +-       __atg16_old = (*__atg16_memp);					      \
  19.118 ++       __atg16_old = (*(volatile __typeof (mem))__atg16_memp);		      \
  19.119 +      while (__builtin_expect						      \
  19.120 + 	    (atomic_compare_and_exchange_bool_acq (__atg16_memp,	      \
  19.121 + 						   __atg16_old & __atg16_mask,\
  19.122 +@@ -468,7 +468,7 @@
  19.123 +     __typeof (*(mem)) __atg17_mask = (mask);				      \
  19.124 + 									      \
  19.125 +     do									      \
  19.126 +-      __atg17_old = (*__atg17_memp);					      \
  19.127 ++      __atg17_old = (*(volatile __typeof (mem))__atg17_memp);		      \
  19.128 +     while (__builtin_expect						      \
  19.129 + 	   (atomic_compare_and_exchange_bool_acq (__atg17_memp,		      \
  19.130 + 						  __atg17_old | __atg17_mask, \
  19.131 +@@ -484,7 +484,7 @@
  19.132 +     __typeof (*(mem)) __atg18_mask = (mask);				      \
  19.133 + 									      \
  19.134 +     do									      \
  19.135 +-      __atg18_old = (*__atg18_memp);					      \
  19.136 ++      __atg18_old = (*(volatile __typeof (mem))__atg18_memp);		      \
  19.137 +     while (__builtin_expect						      \
  19.138 + 	   (catomic_compare_and_exchange_bool_acq (__atg18_memp,	      \
  19.139 + 						   __atg18_old | __atg18_mask,\
  19.140 +@@ -500,7 +500,7 @@
  19.141 +      __typeof (*(mem)) __atg19_mask = (mask);				      \
  19.142 + 									      \
  19.143 +      do									      \
  19.144 +-       __atg19_old = (*__atg19_memp);					      \
  19.145 ++       __atg19_old = (*(volatile __typeof (mem))__atg19_memp);		      \
  19.146 +      while (__builtin_expect						      \
  19.147 + 	    (atomic_compare_and_exchange_bool_acq (__atg19_memp,	      \
  19.148 + 						   __atg19_old | __atg19_mask,\
  19.149 +diff -durN glibc-2.12.1.orig/nptl/Makefile glibc-2.12.1/nptl/Makefile
  19.150 +--- glibc-2.12.1.orig/nptl/Makefile	2008-11-12 14:38:23.000000000 +0100
  19.151 ++++ glibc-2.12.1/nptl/Makefile	2009-11-13 00:50:26.000000000 +0100
  19.152 +@@ -264,9 +264,9 @@
  19.153 + # Files which must not be linked with libpthread.
  19.154 + tests-nolibpthread = tst-unload
  19.155 + 
  19.156 +-# This sets the stack resource limit to 1023kb, which is not a multiple
  19.157 +-# of the page size since every architecture's page size is > 1k.
  19.158 +-tst-oddstacklimit-ENV = ; ulimit -s 1023;
  19.159 ++# This sets the stack resource limit to 8193kb, which is not a multiple
  19.160 ++# of the page size since every architecture's page size is 4096 bytes.
  19.161 ++tst-oddstacklimit-ENV = ; ulimit -s 8193;
  19.162 + 
  19.163 + distribute = eintr.c tst-cleanup4aux.c
  19.164 + 
  19.165 +@@ -425,6 +425,35 @@
  19.166 + CFLAGS-tst-cleanupx4.c += -fexceptions
  19.167 + CFLAGS-tst-oncex3.c += -fexceptions
  19.168 + CFLAGS-tst-oncex4.c += -fexceptions
  19.169 ++
  19.170 ++ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
  19.171 ++LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
  19.172 ++LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
  19.173 ++LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
  19.174 ++LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
  19.175 ++LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
  19.176 ++LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
  19.177 ++LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
  19.178 ++LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
  19.179 ++LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
  19.180 ++LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
  19.181 ++LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
  19.182 ++LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
  19.183 ++LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
  19.184 ++LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
  19.185 ++LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
  19.186 ++LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
  19.187 ++LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
  19.188 ++LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
  19.189 ++LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
  19.190 ++LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
  19.191 ++LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
  19.192 ++LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
  19.193 ++LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
  19.194 ++LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
  19.195 ++LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
  19.196 ++LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
  19.197 ++
  19.198 + CFLAGS-tst-align.c += $(stack-align-test-flags)
  19.199 + CFLAGS-tst-align3.c += $(stack-align-test-flags)
  19.200 + CFLAGS-tst-initializers1.c = -W -Wall -Werror
  19.201 +diff -durN glibc-2.12.1.orig/nptl/pthread_barrier_wait.c glibc-2.12.1/nptl/pthread_barrier_wait.c
  19.202 +--- glibc-2.12.1.orig/nptl/pthread_barrier_wait.c	2007-08-01 06:18:50.000000000 +0200
  19.203 ++++ glibc-2.12.1/nptl/pthread_barrier_wait.c	2009-11-13 00:50:26.000000000 +0100
  19.204 +@@ -64,7 +64,7 @@
  19.205 +       do
  19.206 + 	lll_futex_wait (&ibarrier->curr_event, event,
  19.207 + 			ibarrier->private ^ FUTEX_PRIVATE_FLAG);
  19.208 +-      while (event == ibarrier->curr_event);
  19.209 ++      while (event == *(volatile unsigned int *)&ibarrier->curr_event);
  19.210 +     }
  19.211 + 
  19.212 +   /* Make sure the init_count is stored locally or in a register.  */
  19.213 +diff -durN glibc-2.12.1.orig/nptl/sysdeps/pthread/Makefile glibc-2.12.1/nptl/sysdeps/pthread/Makefile
  19.214 +--- glibc-2.12.1.orig/nptl/sysdeps/pthread/Makefile	2006-02-28 08:09:41.000000000 +0100
  19.215 ++++ glibc-2.12.1/nptl/sysdeps/pthread/Makefile	2009-11-13 00:50:26.000000000 +0100
  19.216 +@@ -33,7 +33,9 @@
  19.217 + 
  19.218 + ifeq ($(have-forced-unwind),yes)
  19.219 + tests += tst-mqueue8x
  19.220 ++ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
  19.221 + CFLAGS-tst-mqueue8x.c += -fexceptions
  19.222 ++LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s) 
  19.223 + endif
  19.224 + endif
  19.225 + 
  19.226 +diff -durN glibc-2.12.1.orig/stdio-common/Makefile glibc-2.12.1/stdio-common/Makefile
  19.227 +--- glibc-2.12.1.orig/stdio-common/Makefile	2009-04-11 07:29:56.000000000 +0200
  19.228 ++++ glibc-2.12.1/stdio-common/Makefile	2009-11-13 00:50:26.000000000 +0100
  19.229 +@@ -82,7 +82,7 @@
  19.230 + 	$(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
  19.231 + endif
  19.232 + 
  19.233 +-CFLAGS-vfprintf.c = -Wno-uninitialized
  19.234 ++CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
  19.235 + CFLAGS-vfwprintf.c = -Wno-uninitialized
  19.236 + CFLAGS-tst-printf.c = -Wno-format
  19.237 + CFLAGS-tstdiomisc.c = -Wno-format
  19.238 +diff -durN glibc-2.12.1.orig/sunrpc/clnt_udp.c glibc-2.12.1/sunrpc/clnt_udp.c
  19.239 +--- glibc-2.12.1.orig/sunrpc/clnt_udp.c	2008-07-26 10:42:44.000000000 +0200
  19.240 ++++ glibc-2.12.1/sunrpc/clnt_udp.c	2009-11-13 00:50:26.000000000 +0100
  19.241 +@@ -456,7 +456,7 @@
  19.242 +       while (inlen < 0 && errno == EINTR);
  19.243 +       if (inlen < 0)
  19.244 + 	{
  19.245 +-	  if (errno == EWOULDBLOCK)
  19.246 ++	  if (errno == EWOULDBLOCK || errno == EAGAIN)
  19.247 + 	    continue;
  19.248 + 	  cu->cu_error.re_errno = errno;
  19.249 + 	  return (cu->cu_error.re_status = RPC_CANTRECV);
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/patches/glibc/ports-2.12.1/330-m68k-sys-user.patch	Tue May 03 00:20:04 2011 +0200
    20.3 @@ -0,0 +1,97 @@
    20.4 +copied from kernel as it is sanitized now
    20.5 +
    20.6 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h
    20.7 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h	2009-05-16 10:36:20.000000000 +0200
    20.8 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h	2009-11-13 00:50:31.000000000 +0100
    20.9 +@@ -1,3 +1,90 @@
   20.10 ++#ifndef _SYS_USER_H
   20.11 ++#define _SYS_USER_H
   20.12 ++
   20.13 ++/* Core file format: The core file is written in such a way that gdb
   20.14 ++   can understand it and provide useful information to the user (under
   20.15 ++   linux we use the 'trad-core' bfd).  There are quite a number of
   20.16 ++   obstacles to being able to view the contents of the floating point
   20.17 ++   registers, and until these are solved you will not be able to view the
   20.18 ++   contents of them.  Actually, you can read in the core file and look at
   20.19 ++   the contents of the user struct to find out what the floating point
   20.20 ++   registers contain.
   20.21 ++   The actual file contents are as follows:
   20.22 ++   UPAGE: 1 page consisting of a user struct that tells gdb what is present
   20.23 ++   in the file.  Directly after this is a copy of the task_struct, which
   20.24 ++   is currently not used by gdb, but it may come in useful at some point.
   20.25 ++   All of the registers are stored as part of the upage.  The upage should
   20.26 ++   always be only one page.
   20.27 ++   DATA: The data area is stored.  We use current->end_text to
   20.28 ++   current->brk to pick up all of the user variables, plus any memory
   20.29 ++   that may have been malloced.  No attempt is made to determine if a page
   20.30 ++   is demand-zero or if a page is totally unused, we just cover the entire
   20.31 ++   range.  All of the addresses are rounded in such a way that an integral
   20.32 ++   number of pages is written.
   20.33 ++   STACK: We need the stack information in order to get a meaningful
   20.34 ++   backtrace.  We need to write the data from (esp) to
   20.35 ++   current->start_stack, so we round each of these off in order to be able
   20.36 ++   to write an integer number of pages.
   20.37 ++   The minimum core file size is 3 pages, or 12288 bytes.
   20.38 ++*/
   20.39 ++
   20.40 ++struct user_m68kfp_struct {
   20.41 ++	unsigned long  fpregs[8*3];	/* fp0-fp7 registers */
   20.42 ++	unsigned long  fpcntl[3];	/* fp control regs */
   20.43 ++};
   20.44 ++
   20.45 ++/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
   20.46 ++   is still the layout used by user (the new pt_regs doesn't have
   20.47 ++   all registers). */
   20.48 ++struct user_regs_struct {
   20.49 ++	long d1,d2,d3,d4,d5,d6,d7;
   20.50 ++	long a0,a1,a2,a3,a4,a5,a6;
   20.51 ++	long d0;
   20.52 ++	long usp;
   20.53 ++	long orig_d0;
   20.54 ++	short stkadj;
   20.55 ++	short sr;
   20.56 ++	long pc;
   20.57 ++	short fmtvec;
   20.58 ++	short __fill;
   20.59 ++};
   20.60 ++
   20.61 ++
   20.62 ++/* When the kernel dumps core, it starts by dumping the user struct -
   20.63 ++   this will be used by gdb to figure out where the data and stack segments
   20.64 ++   are within the file, and what virtual addresses to use. */
   20.65 ++struct user{
   20.66 ++/* We start with the registers, to mimic the way that "memory" is returned
   20.67 ++   from the ptrace(3,...) function.  */
   20.68 ++  struct user_regs_struct regs;	/* Where the registers are actually stored */
   20.69 ++/* ptrace does not yet supply these.  Someday.... */
   20.70 ++  int u_fpvalid;		/* True if math co-processor being used. */
   20.71 ++                                /* for this mess. Not yet used. */
   20.72 ++  struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */
   20.73 ++/* The rest of this junk is to help gdb figure out what goes where */
   20.74 ++  unsigned long int u_tsize;	/* Text segment size (pages). */
   20.75 ++  unsigned long int u_dsize;	/* Data segment size (pages). */
   20.76 ++  unsigned long int u_ssize;	/* Stack segment size (pages). */
   20.77 ++  unsigned long start_code;     /* Starting virtual address of text. */
   20.78 ++  unsigned long start_stack;	/* Starting virtual address of stack area.
   20.79 ++				   This is actually the bottom of the stack,
   20.80 ++				   the top of the stack is always found in the
   20.81 ++				   esp register.  */
   20.82 ++  long int signal;		/* Signal that caused the core dump. */
   20.83 ++  int reserved;			/* No longer used */
   20.84 ++  struct user_regs_struct *u_ar0;
   20.85 ++				/* Used by gdb to help find the values for */
   20.86 ++				/* the registers. */
   20.87 ++  struct user_m68kfp_struct* u_fpstate;	/* Math Co-processor pointer. */
   20.88 ++  unsigned long magic;		/* To uniquely identify a core file */
   20.89 ++  char u_comm[32];		/* User command that was responsible */
   20.90 ++};
   20.91 ++#define NBPG 4096
   20.92 ++#define UPAGES 1
   20.93 ++#define HOST_TEXT_START_ADDR (u.start_code)
   20.94 ++#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
   20.95 ++
   20.96 ++#endif
   20.97 + /* Copyright (C) 2008 Free Software Foundation, Inc.
   20.98 +    This file is part of the GNU C Library.
   20.99 + 
  20.100 +diff -durN glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.12.1/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/patches/glibc/ports-2.12.1/340-dl_execstack-PaX-support.patch	Tue May 03 00:20:04 2011 +0200
    21.3 @@ -0,0 +1,66 @@
    21.4 +	With latest versions of glibc, a lot of apps failed on a PaX enabled
    21.5 +	system with:
    21.6 +		 cannot enable executable stack as shared object requires: Permission denied
    21.7 +	
    21.8 +	This is due to PaX 'exec-protecting' the stack, and ld.so then trying
    21.9 +	to make the stack executable due to some libraries not containing the
   21.10 +	PT_GNU_STACK section.  Bug #32960.  <azarah@gentoo.org> (12 Nov 2003).
   21.11 +
   21.12 +	Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
   21.13 +
   21.14 +diff -durN glibc-2.12.1.orig/nptl/allocatestack.c glibc-2.12.1/nptl/allocatestack.c
   21.15 +--- glibc-2.12.1.orig/nptl/allocatestack.c	2009-01-29 21:34:16.000000000 +0100
   21.16 ++++ glibc-2.12.1/nptl/allocatestack.c	2009-11-13 00:50:33.000000000 +0100
   21.17 +@@ -329,7 +329,8 @@
   21.18 + # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
   21.19 + #endif
   21.20 +   if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
   21.21 +-    return errno;
   21.22 ++    if (errno != EACCES) /* PAX is enabled */
   21.23 ++    	return errno;
   21.24 + 
   21.25 +   return 0;
   21.26 + }
   21.27 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2.12.1/sysdeps/unix/sysv/linux/dl-execstack.c
   21.28 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/dl-execstack.c	2006-01-08 09:21:15.000000000 +0100
   21.29 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/dl-execstack.c	2009-11-13 00:50:33.000000000 +0100
   21.30 +@@ -63,7 +63,10 @@
   21.31 +       else
   21.32 + # endif
   21.33 + 	{
   21.34 +-	  result = errno;
   21.35 ++	  if (errno == EACCES)  /* PAX is enabled */
   21.36 ++	    result = 0;
   21.37 ++	  else
   21.38 ++	    result = errno;
   21.39 + 	  goto out;
   21.40 + 	}
   21.41 +     }
   21.42 +@@ -89,7 +92,12 @@
   21.43 + 	page -= size;
   21.44 +       else
   21.45 + 	{
   21.46 +-	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
   21.47 ++	  if (errno == EACCES)		/* PAX is enabled */
   21.48 ++	    {
   21.49 ++	      result = 0;
   21.50 ++	      goto out;
   21.51 ++	    }
   21.52 ++	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
   21.53 + 	    {
   21.54 + 	      result = errno;
   21.55 + 	      goto out;
   21.56 +@@ -115,7 +123,12 @@
   21.57 + 	page += size;
   21.58 +       else
   21.59 + 	{
   21.60 +-	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
   21.61 ++	  if (errno == EACCES)		/* PAX is enabled */
   21.62 ++	    {
   21.63 ++	      result = 0;
   21.64 ++	      goto out;
   21.65 ++	    }
   21.66 ++	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
   21.67 + 	    {
   21.68 + 	      result = errno;
   21.69 + 	      goto out;
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/patches/glibc/ports-2.12.1/350-pre20040117-pt_pax.patch	Tue May 03 00:20:04 2011 +0200
    22.3 @@ -0,0 +1,32 @@
    22.4 +
    22.5 +
    22.6 +diff -durN glibc-2.12.1.orig/elf/elf.h glibc-2.12.1/elf/elf.h
    22.7 +--- glibc-2.12.1.orig/elf/elf.h	2009-04-15 02:15:54.000000000 +0200
    22.8 ++++ glibc-2.12.1/elf/elf.h	2009-11-13 00:50:35.000000000 +0100
    22.9 +@@ -580,6 +580,7 @@
   22.10 + #define PT_GNU_EH_FRAME	0x6474e550	/* GCC .eh_frame_hdr segment */
   22.11 + #define PT_GNU_STACK	0x6474e551	/* Indicates stack executability */
   22.12 + #define PT_GNU_RELRO	0x6474e552	/* Read-only after relocation */
   22.13 ++#define PT_PAX_FLAGS	0x65041580	/* Indicates PaX flag markings */
   22.14 + #define PT_LOSUNW	0x6ffffffa
   22.15 + #define PT_SUNWBSS	0x6ffffffa	/* Sun Specific segment */
   22.16 + #define PT_SUNWSTACK	0x6ffffffb	/* Stack segment */
   22.17 +@@ -593,6 +594,18 @@
   22.18 + #define PF_X		(1 << 0)	/* Segment is executable */
   22.19 + #define PF_W		(1 << 1)	/* Segment is writable */
   22.20 + #define PF_R		(1 << 2)	/* Segment is readable */
   22.21 ++#define PF_PAGEEXEC	(1 << 4)	/* Enable  PAGEEXEC */
   22.22 ++#define PF_NOPAGEEXEC	(1 << 5)	/* Disable PAGEEXEC */
   22.23 ++#define PF_SEGMEXEC	(1 << 6)	/* Enable  SEGMEXEC */
   22.24 ++#define PF_NOSEGMEXEC	(1 << 7)	/* Disable SEGMEXEC */
   22.25 ++#define PF_MPROTECT	(1 << 8)	/* Enable  MPROTECT */
   22.26 ++#define PF_NOMPROTECT	(1 << 9)	/* Disable MPROTECT */
   22.27 ++#define PF_RANDEXEC	(1 << 10)	/* Enable  RANDEXEC */
   22.28 ++#define PF_NORANDEXEC	(1 << 11)	/* Disable RANDEXEC */
   22.29 ++#define PF_EMUTRAMP	(1 << 12)	/* Enable  EMUTRAMP */
   22.30 ++#define PF_NOEMUTRAMP	(1 << 13)	/* Disable EMUTRAMP */
   22.31 ++#define PF_RANDMMAP	(1 << 14)	/* Enable  RANDMMAP */
   22.32 ++#define PF_NORANDMMAP	(1 << 15)	/* Disable RANDMMAP */
   22.33 + #define PF_MASKOS	0x0ff00000	/* OS-specific */
   22.34 + #define PF_MASKPROC	0xf0000000	/* Processor-specific */
   22.35 + 
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/patches/glibc/ports-2.12.1/360-tests-sandbox-libdl-paths.patch	Tue May 03 00:20:04 2011 +0200
    23.3 @@ -0,0 +1,193 @@
    23.4 +when glibc runs its tests, it does so by invoking the local library loader.
    23.5 +in Gentoo, we build/run inside of our "sandbox" which itself is linked against
    23.6 +libdl (so that it can load libraries and pull out symbols).  the trouble
    23.7 +is that when you upgrade from an older glibc to the new one, often times
    23.8 +internal symbols change name or abi.  this is normally OK as you cannot use
    23.9 +libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
   23.10 +we always say "keep all of the glibc libraries from the same build".  but
   23.11 +when glibc runs its tests, it uses dynamic paths to point to its new local
   23.12 +copies of libraries.  if the test doesnt use libdl, then glibc doesnt add
   23.13 +its path, and when sandbox triggers the loading of libdl, glibc does so
   23.14 +from the host system system.  this gets us into the case of all libraries
   23.15 +are from the locally compiled version of glibc except for libdl.so.
   23.16 +
   23.17 +Fix by Wormo
   23.18 +
   23.19 +http://bugs.gentoo.org/56898
   23.20 +
   23.21 +diff -durN glibc-2.12.1.orig/grp/tst_fgetgrent.sh glibc-2.12.1/grp/tst_fgetgrent.sh
   23.22 +--- glibc-2.12.1.orig/grp/tst_fgetgrent.sh	2001-07-06 06:54:46.000000000 +0200
   23.23 ++++ glibc-2.12.1/grp/tst_fgetgrent.sh	2009-11-13 00:50:37.000000000 +0100
   23.24 +@@ -24,7 +24,8 @@
   23.25 + rtld_installed_name=$1; shift
   23.26 + 
   23.27 + testout=${common_objpfx}/grp/tst_fgetgrent.out
   23.28 +-library_path=${common_objpfx}
   23.29 ++# make sure libdl is also in path in case sandbox is in use
   23.30 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   23.31 + 
   23.32 + result=0
   23.33 + 
   23.34 +diff -durN glibc-2.12.1.orig/iconvdata/run-iconv-test.sh glibc-2.12.1/iconvdata/run-iconv-test.sh
   23.35 +--- glibc-2.12.1.orig/iconvdata/run-iconv-test.sh	2008-05-15 03:59:44.000000000 +0200
   23.36 ++++ glibc-2.12.1/iconvdata/run-iconv-test.sh	2009-11-13 00:50:37.000000000 +0100
   23.37 +@@ -34,7 +34,7 @@
   23.38 + export GCONV_PATH
   23.39 + 
   23.40 + # We have to have some directories in the library path.
   23.41 +-LIBPATH=$codir:$codir/iconvdata
   23.42 ++LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
   23.43 + 
   23.44 + # How the start the iconv(1) program.
   23.45 + ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
   23.46 +diff -durN glibc-2.12.1.orig/iconvdata/tst-table.sh glibc-2.12.1/iconvdata/tst-table.sh
   23.47 +--- glibc-2.12.1.orig/iconvdata/tst-table.sh	2002-04-24 23:39:35.000000000 +0200
   23.48 ++++ glibc-2.12.1/iconvdata/tst-table.sh	2009-11-13 00:50:37.000000000 +0100
   23.49 +@@ -59,8 +59,11 @@
   23.50 +   irreversible=${charset}.irreversible
   23.51 + fi
   23.52 + 
   23.53 ++# make sure libdl is also in path in case sandbox is in use
   23.54 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   23.55 ++
   23.56 + # iconv in one direction.
   23.57 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
   23.58 ++${common_objpfx}elf/ld.so --library-path $library_path \
   23.59 + ${objpfx}tst-table-from ${charset} \
   23.60 +   > ${objpfx}tst-${charset}.table
   23.61 + 
   23.62 +diff -durN glibc-2.12.1.orig/intl/tst-codeset.sh glibc-2.12.1/intl/tst-codeset.sh
   23.63 +--- glibc-2.12.1.orig/intl/tst-codeset.sh	2005-04-06 04:18:35.000000000 +0200
   23.64 ++++ glibc-2.12.1/intl/tst-codeset.sh	2009-11-13 00:50:37.000000000 +0100
   23.65 +@@ -37,6 +37,9 @@
   23.66 + LOCPATH=${common_objpfx}localedata
   23.67 + export LOCPATH
   23.68 + 
   23.69 ++# make sure libdl is also in path in case sandbox is in use
   23.70 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   23.71 ++
   23.72 + ${common_objpfx}elf/ld.so --library-path $common_objpfx \
   23.73 + ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
   23.74 + 
   23.75 +diff -durN glibc-2.12.1.orig/intl/tst-gettext.sh glibc-2.12.1/intl/tst-gettext.sh
   23.76 +--- glibc-2.12.1.orig/intl/tst-gettext.sh	2004-08-15 21:28:18.000000000 +0200
   23.77 ++++ glibc-2.12.1/intl/tst-gettext.sh	2009-11-13 00:50:37.000000000 +0100
   23.78 +@@ -51,9 +51,12 @@
   23.79 + LOCPATH=${common_objpfx}localedata
   23.80 + export LOCPATH
   23.81 + 
   23.82 ++# make sure libdl is also in path in case sandbox is in use
   23.83 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   23.84 ++
   23.85 + # Now run the test.
   23.86 + MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
   23.87 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
   23.88 ++${common_objpfx}elf/ld.so --library-path $library_path \
   23.89 + ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
   23.90 + 
   23.91 + exit $?
   23.92 +diff -durN glibc-2.12.1.orig/intl/tst-gettext2.sh glibc-2.12.1/intl/tst-gettext2.sh
   23.93 +--- glibc-2.12.1.orig/intl/tst-gettext2.sh	2005-05-04 19:54:48.000000000 +0200
   23.94 ++++ glibc-2.12.1/intl/tst-gettext2.sh	2009-11-13 00:50:37.000000000 +0100
   23.95 +@@ -65,8 +65,11 @@
   23.96 + LOCPATH=${objpfx}domaindir
   23.97 + export LOCPATH
   23.98 + 
   23.99 ++# make sure libdl is also in path in case sandbox is in use
  23.100 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  23.101 ++
  23.102 + # Now run the test.
  23.103 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
  23.104 ++${common_objpfx}elf/ld.so --library-path $library_path \
  23.105 + ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
  23.106 + cmp ${objpfx}tst-gettext2.out - <<EOF
  23.107 + String1 - Lang1: 1st string
  23.108 +diff -durN glibc-2.12.1.orig/intl/tst-translit.sh glibc-2.12.1/intl/tst-translit.sh
  23.109 +--- glibc-2.12.1.orig/intl/tst-translit.sh	2005-05-04 19:56:10.000000000 +0200
  23.110 ++++ glibc-2.12.1/intl/tst-translit.sh	2009-11-13 00:50:37.000000000 +0100
  23.111 +@@ -36,7 +36,10 @@
  23.112 + LOCPATH=${common_objpfx}localedata
  23.113 + export LOCPATH
  23.114 + 
  23.115 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
  23.116 ++# make sure libdl is also in path in case sandbox is in use
  23.117 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  23.118 ++
  23.119 ++${common_objpfx}elf/ld.so --library-path $library_path \
  23.120 + ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
  23.121 + 
  23.122 + exit $?
  23.123 +diff -durN glibc-2.12.1.orig/malloc/tst-mtrace.sh glibc-2.12.1/malloc/tst-mtrace.sh
  23.124 +--- glibc-2.12.1.orig/malloc/tst-mtrace.sh	2005-10-15 01:40:35.000000000 +0200
  23.125 ++++ glibc-2.12.1/malloc/tst-mtrace.sh	2009-11-13 00:50:37.000000000 +0100
  23.126 +@@ -24,9 +24,12 @@
  23.127 + status=0
  23.128 + trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
  23.129 + 
  23.130 ++# make sure libdl is also in path in case sandbox is in use
  23.131 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  23.132 ++
  23.133 + MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
  23.134 + LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
  23.135 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
  23.136 ++${common_objpfx}elf/ld.so --library-path $library_path \
  23.137 +   ${common_objpfx}malloc/tst-mtrace || status=1
  23.138 + 
  23.139 + if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
  23.140 +diff -durN glibc-2.12.1.orig/nptl/tst-tls6.sh glibc-2.12.1/nptl/tst-tls6.sh
  23.141 +--- glibc-2.12.1.orig/nptl/tst-tls6.sh	2003-09-03 00:02:59.000000000 +0200
  23.142 ++++ glibc-2.12.1/nptl/tst-tls6.sh	2009-11-13 00:50:37.000000000 +0100
  23.143 +@@ -5,8 +5,8 @@
  23.144 + rtld_installed_name=$1; shift
  23.145 + logfile=$common_objpfx/nptl/tst-tls6.out
  23.146 + 
  23.147 +-# We have to find libc and nptl
  23.148 +-library_path=${common_objpfx}:${common_objpfx}nptl
  23.149 ++# We have to find libc and nptl (also libdl in case sandbox is in use)
  23.150 ++library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
  23.151 + tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
  23.152 + 	  ${common_objpfx}/nptl/tst-tls5"
  23.153 + 
  23.154 +diff -durN glibc-2.12.1.orig/posix/globtest.sh glibc-2.12.1/posix/globtest.sh
  23.155 +--- glibc-2.12.1.orig/posix/globtest.sh	2008-12-06 07:05:39.000000000 +0100
  23.156 ++++ glibc-2.12.1/posix/globtest.sh	2009-11-13 00:50:37.000000000 +0100
  23.157 +@@ -18,7 +18,7 @@
  23.158 + esac
  23.159 + 
  23.160 + # We have to find the libc and the NSS modules.
  23.161 +-library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
  23.162 ++library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
  23.163 + 
  23.164 + # Since we use `sort' we must make sure to use the same locale everywhere.
  23.165 + LC_ALL=C
  23.166 +diff -durN glibc-2.12.1.orig/posix/tst-getconf.sh glibc-2.12.1/posix/tst-getconf.sh
  23.167 +--- glibc-2.12.1.orig/posix/tst-getconf.sh	2002-09-01 13:11:25.000000000 +0200
  23.168 ++++ glibc-2.12.1/posix/tst-getconf.sh	2009-11-13 00:50:37.000000000 +0100
  23.169 +@@ -10,7 +10,10 @@
  23.170 + else
  23.171 +   rtld_installed_name=$1; shift
  23.172 +   runit() {
  23.173 +-    ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
  23.174 ++    
  23.175 ++  # make sure libdl is also in path in case sandbox is in use
  23.176 ++  library_path=${common_objpfx}:${common_objpfx}/dlfcn
  23.177 ++    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
  23.178 +   }
  23.179 + fi
  23.180 + 
  23.181 +diff -durN glibc-2.12.1.orig/posix/wordexp-tst.sh glibc-2.12.1/posix/wordexp-tst.sh
  23.182 +--- glibc-2.12.1.orig/posix/wordexp-tst.sh	2000-10-20 18:23:30.000000000 +0200
  23.183 ++++ glibc-2.12.1/posix/wordexp-tst.sh	2009-11-13 00:50:37.000000000 +0100
  23.184 +@@ -19,8 +19,11 @@
  23.185 + "
  23.186 + export IFS
  23.187 + 
  23.188 ++# make sure libdl is also in path in case sandbox is in use
  23.189 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  23.190 ++
  23.191 + failed=0
  23.192 +-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
  23.193 ++${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
  23.194 + ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
  23.195 + cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
  23.196 + wordexp returned 0
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/patches/glibc/ports-2.12.1/370-fnmatch.patch	Tue May 03 00:20:04 2011 +0200
    24.3 @@ -0,0 +1,62 @@
    24.4 +http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
    24.5 +
    24.6 +When fnmatch detects an invalid multibyte character it should fall back to
    24.7 +single byte matching, so that "*" has a chance to match such a string.
    24.8 +
    24.9 +Andreas.
   24.10 +
   24.11 +2005-04-12  Andreas Schwab  <schwab@suse.de>
   24.12 +
   24.13 +	* posix/fnmatch.c (fnmatch): If conversion to wide character
   24.14 +	fails fall back to single byte matching.
   24.15 +
   24.16 +Index: posix/fnmatch.c
   24.17 +===================================================================
   24.18 +
   24.19 +diff -durN glibc-2.12.1.orig/posix/fnmatch.c glibc-2.12.1/posix/fnmatch.c
   24.20 +--- glibc-2.12.1.orig/posix/fnmatch.c	2007-07-28 22:35:00.000000000 +0200
   24.21 ++++ glibc-2.12.1/posix/fnmatch.c	2009-11-13 00:50:39.000000000 +0100
   24.22 +@@ -327,6 +327,7 @@
   24.23 + # if HANDLE_MULTIBYTE
   24.24 +   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
   24.25 +     {
   24.26 ++      const char *orig_pattern = pattern;
   24.27 +       mbstate_t ps;
   24.28 +       size_t n;
   24.29 +       const char *p;
   24.30 +@@ -382,10 +383,8 @@
   24.31 + 	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
   24.32 + 	  n = mbsrtowcs (wstring, &p, n + 1, &ps);
   24.33 + 	  if (__builtin_expect (n == (size_t) -1, 0))
   24.34 +-	    /* Something wrong.
   24.35 +-	       XXX Do we have to set `errno' to something which mbsrtows hasn't
   24.36 +-	       already done?  */
   24.37 +-	    return -1;
   24.38 ++	    /* Something wrong.  Fall back to single byte matching.  */
   24.39 ++	    goto try_singlebyte;
   24.40 + 	  if (p)
   24.41 + 	    {
   24.42 + 	      memset (&ps, '\0', sizeof (ps));
   24.43 +@@ -397,10 +396,8 @@
   24.44 + 	prepare_wstring:
   24.45 + 	  n = mbsrtowcs (NULL, &string, 0, &ps);
   24.46 + 	  if (__builtin_expect (n == (size_t) -1, 0))
   24.47 +-	    /* Something wrong.
   24.48 +-	       XXX Do we have to set `errno' to something which mbsrtows hasn't
   24.49 +-	       already done?  */
   24.50 +-	    return -1;
   24.51 ++	    /* Something wrong.  Fall back to single byte matching.  */
   24.52 ++	    goto try_singlebyte;
   24.53 + 	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
   24.54 + 	  assert (mbsinit (&ps));
   24.55 + 	  (void) mbsrtowcs (wstring, &string, n + 1, &ps);
   24.56 +@@ -408,6 +405,9 @@
   24.57 + 
   24.58 +       return internal_fnwmatch (wpattern, wstring, wstring + n,
   24.59 + 				flags & FNM_PERIOD, flags, NULL);
   24.60 ++
   24.61 ++    try_singlebyte:
   24.62 ++      pattern = orig_pattern;
   24.63 +     }
   24.64 + # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
   24.65 + 
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/patches/glibc/ports-2.12.1/380-dont-build-timezone.patch	Tue May 03 00:20:04 2011 +0200
    25.3 @@ -0,0 +1,14 @@
    25.4 +timezone data has been split into the package sys-libs/timezone-data
    25.5 +
    25.6 +diff -durN glibc-2.12.1.orig/Makeconfig glibc-2.12.1/Makeconfig
    25.7 +--- glibc-2.12.1.orig/Makeconfig	2009-11-13 00:50:13.000000000 +0100
    25.8 ++++ glibc-2.12.1/Makeconfig	2009-11-13 00:50:41.000000000 +0100
    25.9 +@@ -944,7 +944,7 @@
   25.10 + 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
   25.11 + 	      grp pwd posix io termios resource misc socket sysvipc gmon    \
   25.12 + 	      gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
   25.13 +-	      crypt nss localedata timezone rt conform debug		    \
   25.14 ++	      crypt nss localedata rt conform debug		    \
   25.15 + 	      $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
   25.16 + 
   25.17 + ifndef avoid-generated
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/patches/glibc/ports-2.12.1/400-alpha-xstat.patch	Tue May 03 00:20:04 2011 +0200
    26.3 @@ -0,0 +1,15 @@
    26.4 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h
    26.5 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h	2009-05-09 08:54:20.000000000 +0200
    26.6 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h	2009-11-13 00:50:45.000000000 +0100
    26.7 +@@ -386,6 +386,11 @@
    26.8 + # define __ASSUME_GETDENTS32_D_TYPE	1
    26.9 + #endif
   26.10 + 
   26.11 ++/* Starting with version 2.6.4, alpha stat64 syscalls are available.  */
   26.12 ++#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
   26.13 ++# define __ASSUME_STAT64_SYSCALL	1
   26.14 ++#endif
   26.15 ++
   26.16 + /* Starting with version 2.5.3, the initial location returned by `brk'
   26.17 +    after exec is always rounded up to the next page.  */
   26.18 + #if __LINUX_KERNEL_VERSION >= 132355
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/patches/glibc/ports-2.12.1/430-alpha-creat.patch	Tue May 03 00:20:04 2011 +0200
    27.3 @@ -0,0 +1,14 @@
    27.4 +alpha does not have a __NR_creat
    27.5 +
    27.6 +http://bugs.gentoo.org/227275
    27.7 +http://sourceware.org/bugzilla/show_bug.cgi?id=6650
    27.8 +
    27.9 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c glibc-2.12.1/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
   27.10 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c	2007-11-10 20:34:26.000000000 +0100
   27.11 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/wordsize-64/creat64.c	2009-11-13 00:50:51.000000000 +0100
   27.12 +@@ -1 +1,5 @@
   27.13 + /* Defined as alias for the syscall.  */
   27.14 ++#include <sysdep.h>
   27.15 ++#ifndef __NR_creat
   27.16 ++#include "../../../../../io/creat64.c"
   27.17 ++#endif
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/patches/glibc/ports-2.12.1/440-alpha-cache-shape.patch	Tue May 03 00:20:04 2011 +0200
    28.3 @@ -0,0 +1,13 @@
    28.4 +older verisons of glibc would build dl-sysdep as shared-only and dl-support as
    28.5 +static-only.  alpha hooks in a cache variable via dl-auxv.h.  newer versions of
    28.6 +glibc build dl-sysdep as both shared and static which means we now have symbol
    28.7 +duplication for static builds with dl-sysdep and dl-support.  since dl-sysdep
    28.8 +is both shared/static, there is no point in hooking dl-support anymore, so we
    28.9 +can punt it.
   28.10 +
   28.11 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c
   28.12 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c	2009-05-16 10:36:20.000000000 +0200
   28.13 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c	2009-11-13 00:50:53.000000000 +0100
   28.14 +@@ -1,2 +1,1 @@
   28.15 +-#include "dl-auxv.h"
   28.16 + #include <elf/dl-support.c>
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/patches/glibc/ports-2.12.1/460-alpha-fix-gcc-4.1-warnings.patch	Tue May 03 00:20:04 2011 +0200
    29.3 @@ -0,0 +1,56 @@
    29.4 +2006-05-30  Falk Hueffner <falk@debian.org>
    29.5 +
    29.6 +	* sysdeps/unix/sysv/linux/alpha/ioperm.c: force the architecture
    29.7 +	  to ev6 in assembly code.
    29.8 +
    29.9 +{standard input}: Assembler messages:
   29.10 +{standard input}:341: Error: macro requires $at register while noat in effect
   29.11 +{standard input}:374: Error: macro requires $at register while noat in effect
   29.12 +{standard input}:438: Error: macro requires $at register while noat in effect
   29.13 +{standard input}:471: Error: macro requires $at register while noat in effect
   29.14 +make[3]: *** [/tmp/buildd/glibc-2.3.6/build-tree/alpha-libc/misc/ioperm.o] Error 1
   29.15 +
   29.16 +Hrm. gcc puts .arch ev4 into the .s, and this overrides -mev6 for as.
   29.17 +I cannot really think of anything better than
   29.18 +
   29.19 + ports/sysdeps/unix/sysv/linux/alpha/ioperm.c |    8 ++++----
   29.20 + 1 file changed, 4 insertions(+), 4 deletions(-)
   29.21 +
   29.22 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c
   29.23 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c	2009-05-16 10:36:20.000000000 +0200
   29.24 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c	2009-11-13 00:50:57.000000000 +0100
   29.25 +@@ -178,13 +178,13 @@
   29.26 + static inline void
   29.27 + stb_mb(unsigned char val, unsigned long addr)
   29.28 + {
   29.29 +-  __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
   29.30 ++  __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
   29.31 + }
   29.32 + 
   29.33 + static inline void
   29.34 + stw_mb(unsigned short val, unsigned long addr)
   29.35 + {
   29.36 +-  __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
   29.37 ++  __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
   29.38 + }
   29.39 + 
   29.40 + static inline void
   29.41 +@@ -356,7 +356,7 @@
   29.42 +   unsigned long int addr = dense_port_to_cpu_addr (port);
   29.43 +   unsigned char r;
   29.44 + 
   29.45 +-  __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
   29.46 ++  __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
   29.47 +   return r;
   29.48 + }
   29.49 + 
   29.50 +@@ -366,7 +366,7 @@
   29.51 +   unsigned long int addr = dense_port_to_cpu_addr (port);
   29.52 +   unsigned short r;
   29.53 + 
   29.54 +-  __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
   29.55 ++  __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
   29.56 +   return r;
   29.57 + }
   29.58 + 
   29.59 +diff -durN glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.12.1/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/patches/glibc/ports-2.12.1/490-alpha_alpha-add-fdatasync-support.patch	Tue May 03 00:20:04 2011 +0200
    30.3 @@ -0,0 +1,126 @@
    30.4 +2009-07-25  Aurelien Jarno  <aurelien@aurel32.net>
    30.5 +
    30.6 +	* sysdeps/unix/sysv/linux/kernel-features.h: define 
    30.7 +	__ASSUME_FDATASYNC. 
    30.8 +	* sysdeps/unix/sysv/linux/fdatasync.c: New file.
    30.9 +	* sysdeps/unix/sysv/linux/Makefile: compile fdatasync.c with
   30.10 +	-fexceptions.
   30.11 +	* sysdeps/unix/sysv/linux/syscalls.list: Remove fdatasync.
   30.12 +
   30.13 + sysdeps/unix/sysv/linux/Makefile          |    1 
   30.14 + sysdeps/unix/sysv/linux/fdatasync.c       |   69 ++++++++++++++++++++++++++++++
   30.15 + sysdeps/unix/sysv/linux/kernel-features.h |    6 ++
   30.16 + sysdeps/unix/sysv/linux/syscalls.list     |    1 
   30.17 + 4 files changed, 76 insertions(+), 1 deletion(-)
   30.18 +
   30.19 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/Makefile glibc-2.12.1/sysdeps/unix/sysv/linux/Makefile
   30.20 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/Makefile	2009-03-02 17:15:13.000000000 +0100
   30.21 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/Makefile	2009-11-13 00:51:04.000000000 +0100
   30.22 +@@ -20,6 +20,7 @@
   30.23 + 		   setfsuid setfsgid makedev epoll_pwait signalfd \
   30.24 + 		   eventfd eventfd_read eventfd_write
   30.25 + 
   30.26 ++CFLAGS-fdatasync.c = -fexceptions
   30.27 + CFLAGS-gethostid.c = -fexceptions
   30.28 + 
   30.29 + sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
   30.30 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/fdatasync.c glibc-2.12.1/sysdeps/unix/sysv/linux/fdatasync.c
   30.31 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/fdatasync.c	1970-01-01 01:00:00.000000000 +0100
   30.32 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/fdatasync.c	2009-11-13 00:51:04.000000000 +0100
   30.33 +@@ -0,0 +1,69 @@
   30.34 ++/* fdatasync -- synchronize at least the data part of a file with 
   30.35 ++   the underlying media. Linux version. 
   30.36 ++
   30.37 ++   Copyright (C) 2007 Free Software Foundation, Inc.
   30.38 ++   This file is part of the GNU C Library.
   30.39 ++
   30.40 ++   The GNU C Library is free software; you can redistribute it and/or
   30.41 ++   modify it under the terms of the GNU Lesser General Public
   30.42 ++   License as published by the Free Software Foundation; either
   30.43 ++   version 2.1 of the License, or (at your option) any later version.
   30.44 ++
   30.45 ++   The GNU C Library is distributed in the hope that it will be useful,
   30.46 ++   but WITHOUT ANY WARRANTY; without even the implied warranty of
   30.47 ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   30.48 ++   Lesser General Public License for more details.
   30.49 ++
   30.50 ++   You should have received a copy of the GNU Lesser General Public
   30.51 ++   License along with the GNU C Library; if not, write to the Free
   30.52 ++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   30.53 ++   02111-1307 USA.  */
   30.54 ++
   30.55 ++#include <errno.h>
   30.56 ++#include <unistd.h>
   30.57 ++
   30.58 ++#include <sysdep-cancel.h>
   30.59 ++#include <sys/syscall.h>
   30.60 ++#include <bp-checks.h>
   30.61 ++
   30.62 ++#include <kernel-features.h>
   30.63 ++
   30.64 ++#if defined __NR_fdatasync && !defined __ASSUME_FDATASYNC
   30.65 ++static int __have_no_fdatasync;
   30.66 ++#endif
   30.67 ++
   30.68 ++static int
   30.69 ++do_fdatasync (int fd)
   30.70 ++{
   30.71 ++#ifdef __ASSUME_FDATASYNC
   30.72 ++  return INLINE_SYSCALL (fdatasync, 1, fd);
   30.73 ++#elif defined __NR_fdatasync
   30.74 ++  if (!__builtin_expect (__have_no_fdatasync, 0))
   30.75 ++    {
   30.76 ++      int result = INLINE_SYSCALL (fdatasync, 1, fd);
   30.77 ++      if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
   30.78 ++	return result;
   30.79 ++
   30.80 ++      __have_no_fdatasync = 1;
   30.81 ++    }
   30.82 ++#endif
   30.83 ++  return INLINE_SYSCALL (fsync, 1, fd);
   30.84 ++}
   30.85 ++
   30.86 ++int
   30.87 ++__fdatasync (int fd)
   30.88 ++{
   30.89 ++  if (SINGLE_THREAD_P)
   30.90 ++    return do_fdatasync (fd);
   30.91 ++
   30.92 ++  int oldtype = LIBC_CANCEL_ASYNC ();
   30.93 ++
   30.94 ++  int result = do_fdatasync (fd);
   30.95 ++
   30.96 ++  LIBC_CANCEL_RESET (oldtype);
   30.97 ++
   30.98 ++  return result;
   30.99 ++}
  30.100 ++
  30.101 ++weak_alias (__fdatasync, fdatasync)
  30.102 ++
  30.103 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h
  30.104 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h	2009-11-13 00:50:45.000000000 +0100
  30.105 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h	2009-11-13 00:51:04.000000000 +0100
  30.106 +@@ -459,6 +459,12 @@
  30.107 + # define __ASSUME_FUTEX_LOCK_PI	1
  30.108 + #endif
  30.109 + 
  30.110 ++/* Support for fsyncdata syscall was added in 2.6.22 on alpha, but it
  30.111 ++   was already present in 2.0 kernels on other architectures.  */
  30.112 ++#if (!defined __alpha || __LINUX_KERNEL_VERSION >= 0x020616)
  30.113 ++# define __ASSUME_FDATASYNC	1
  30.114 ++#endif
  30.115 ++
  30.116 + /* Support for utimensat syscall was added in 2.6.22, on SH
  30.117 +    only after 2.6.22-rc1.  */
  30.118 + #if __LINUX_KERNEL_VERSION >= 0x020616 \
  30.119 +diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/syscalls.list glibc-2.12.1/sysdeps/unix/sysv/linux/syscalls.list
  30.120 +--- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/syscalls.list	2008-08-02 01:29:08.000000000 +0200
  30.121 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/syscalls.list	2009-11-13 00:51:04.000000000 +0100
  30.122 +@@ -11,7 +11,6 @@
  30.123 + epoll_create1	EXTRA	epoll_create1	i:i	epoll_create1
  30.124 + epoll_ctl	EXTRA	epoll_ctl	i:iiip	epoll_ctl
  30.125 + epoll_wait	EXTRA	epoll_wait	Ci:ipii	epoll_wait
  30.126 +-fdatasync	-	fdatasync	Ci:i	fdatasync
  30.127 + flock		-	flock		i:ii	__flock		flock
  30.128 + fork		-	fork		i:	__libc_fork	__fork fork
  30.129 + get_kernel_syms	EXTRA	get_kernel_syms	i:p	get_kernel_syms
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/patches/glibc/ports-2.12.1/530-alpha-fix-rtld-fPIC.patch	Tue May 03 00:20:04 2011 +0200
    31.3 @@ -0,0 +1,21 @@
    31.4 +2009-05-26  Aurelien Jarno  <aurelien@aurel32.net>
    31.5 +
    31.6 +	* sysdeps/alpha/Makefile (CFLAGS-rtld.c): add $(PIC-ccflag).
    31.7 +
    31.8 + ports/sysdeps/alpha/Makefile |    3 ++-
    31.9 + 1 file changed, 2 insertions(+), 1 deletion(-)
   31.10 +
   31.11 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/alpha/Makefile glibc-2.12.1/glibc-ports-2.12.1/sysdeps/alpha/Makefile
   31.12 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/alpha/Makefile	2009-05-16 10:36:20.000000000 +0200
   31.13 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/alpha/Makefile	2009-11-13 00:51:13.000000000 +0100
   31.14 +@@ -35,7 +35,8 @@
   31.15 + 
   31.16 + ifeq ($(subdir),elf)
   31.17 + # The ld.so startup code cannot use literals until it self-relocates.
   31.18 +-CFLAGS-rtld.c = -mbuild-constants
   31.19 ++# It uses more than 64k for the small data area.
   31.20 ++CFLAGS-rtld.c = -mbuild-constants $(PIC-ccflag)
   31.21 + endif
   31.22 + 
   31.23 + # Build everything with full IEEE math support, and with dynamic rounding;
   31.24 +diff -durN glibc-2.12.1.orig/ports/sysdeps/alpha/Makefile glibc-2.12.1/ports/sysdeps/alpha/Makefile
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/patches/glibc/ports-2.12.1/560-ppc-atomic.patch	Tue May 03 00:20:04 2011 +0200
    32.3 @@ -0,0 +1,415 @@
    32.4 +sniped from suse
    32.5 +
    32.6 +Index: sysdeps/powerpc/bits/atomic.h
    32.7 +===================================================================
    32.8 +RCS file: /cvs/glibc/libc/sysdeps/powerpc/bits/atomic.h,v
    32.9 +retrieving revision 1.17
   32.10 +diff -u -a -p -r1.17 atomic.h
   32.11 +
   32.12 +diff -durN glibc-2.12.1.orig/sysdeps/powerpc/bits/atomic.h glibc-2.12.1/sysdeps/powerpc/bits/atomic.h
   32.13 +--- glibc-2.12.1.orig/sysdeps/powerpc/bits/atomic.h	2007-03-26 22:15:28.000000000 +0200
   32.14 ++++ glibc-2.12.1/sysdeps/powerpc/bits/atomic.h	2009-11-13 00:51:19.000000000 +0100
   32.15 +@@ -85,14 +85,14 @@
   32.16 +       __typeof (*(mem)) __tmp;						      \
   32.17 +       __typeof (mem)  __memp = (mem);					      \
   32.18 +       __asm __volatile (						      \
   32.19 +-		        "1:	lwarx	%0,0,%1" MUTEX_HINT_ACQ "\n"	      \
   32.20 ++		        "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
   32.21 + 		        "	cmpw	%0,%2\n"			      \
   32.22 + 		        "	bne	2f\n"				      \
   32.23 +-		        "	stwcx.	%3,0,%1\n"			      \
   32.24 ++		        "	stwcx.	%3,%y1\n"			      \
   32.25 + 		        "	bne-	1b\n"				      \
   32.26 + 		        "2:	" __ARCH_ACQ_INSTR			      \
   32.27 +-		        : "=&r" (__tmp)					      \
   32.28 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
   32.29 ++		        : "=&r" (__tmp), "+Z" (*__memp)			      \
   32.30 ++		        : "r" (oldval), "r" (newval)			      \
   32.31 + 		        : "cr0", "memory");				      \
   32.32 +       __tmp;								      \
   32.33 +   })
   32.34 +@@ -102,14 +102,14 @@
   32.35 +       __typeof (*(mem)) __tmp;						      \
   32.36 +       __typeof (mem)  __memp = (mem);					      \
   32.37 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
   32.38 +-		        "1:	lwarx	%0,0,%1" MUTEX_HINT_REL "\n"	      \
   32.39 ++		        "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
   32.40 + 		        "	cmpw	%0,%2\n"			      \
   32.41 + 		        "	bne	2f\n"				      \
   32.42 +-		        "	stwcx.	%3,0,%1\n"			      \
   32.43 ++		        "	stwcx.	%3,%y1\n"			      \
   32.44 + 		        "	bne-	1b\n"				      \
   32.45 + 		        "2:	"					      \
   32.46 +-		        : "=&r" (__tmp)					      \
   32.47 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
   32.48 ++		        : "=&r" (__tmp), "+Z" (__memp)			      \
   32.49 ++		        : "r" (oldval), "r" (newval)			      \
   32.50 + 		        : "cr0", "memory");				      \
   32.51 +       __tmp;								      \
   32.52 +   })
   32.53 +@@ -118,12 +118,12 @@
   32.54 +   ({									      \
   32.55 +     __typeof (*mem) __val;						      \
   32.56 +     __asm __volatile (							      \
   32.57 +-		      "1:	lwarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	      \
   32.58 +-		      "		stwcx.	%3,0,%2\n"			      \
   32.59 ++		      "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
   32.60 ++		      "		stwcx.	%2,%y1\n"			      \
   32.61 + 		      "		bne-	1b\n"				      \
   32.62 + 		      "   " __ARCH_ACQ_INSTR				      \
   32.63 +-		      : "=&r" (__val), "=m" (*mem)			      \
   32.64 +-		      : "b" (mem), "r" (value), "m" (*mem)		      \
   32.65 ++		      : "=&r" (__val), "+Z" (*mem)			      \
   32.66 ++		      : "r" (value)					      \
   32.67 + 		      : "cr0", "memory");				      \
   32.68 +     __val;								      \
   32.69 +   })
   32.70 +@@ -132,11 +132,11 @@
   32.71 +   ({									      \
   32.72 +     __typeof (*mem) __val;						      \
   32.73 +     __asm __volatile (__ARCH_REL_INSTR "\n"				      \
   32.74 +-		      "1:	lwarx	%0,0,%2" MUTEX_HINT_REL "\n"	      \
   32.75 +-		      "		stwcx.	%3,0,%2\n"			      \
   32.76 ++		      "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
   32.77 ++		      "		stwcx.	%2,%y1\n"			      \
   32.78 + 		      "		bne-	1b"				      \
   32.79 +-		      : "=&r" (__val), "=m" (*mem)			      \
   32.80 +-		      : "b" (mem), "r" (value), "m" (*mem)		      \
   32.81 ++		      : "=&r" (__val), "+Z" (*mem)			      \
   32.82 ++		      : "r" (value)					      \
   32.83 + 		      : "cr0", "memory");				      \
   32.84 +     __val;								      \
   32.85 +   })
   32.86 +@@ -144,12 +144,12 @@
   32.87 + #define __arch_atomic_exchange_and_add_32(mem, value) \
   32.88 +   ({									      \
   32.89 +     __typeof (*mem) __val, __tmp;					      \
   32.90 +-    __asm __volatile ("1:	lwarx	%0,0,%3\n"			      \
   32.91 +-		      "		add	%1,%0,%4\n"			      \
   32.92 +-		      "		stwcx.	%1,0,%3\n"			      \
   32.93 ++    __asm __volatile ("1:	lwarx	%0,%y2\n"			      \
   32.94 ++		      "		add	%1,%0,%3\n"			      \
   32.95 ++		      "		stwcx.	%1,%y2\n"			      \
   32.96 + 		      "		bne-	1b"				      \
   32.97 +-		      : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
   32.98 +-		      : "b" (mem), "r" (value), "m" (*mem)		      \
   32.99 ++		      : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem)	      \
  32.100 ++		      : "r" (value)					      \
  32.101 + 		      : "cr0", "memory");				      \
  32.102 +     __val;								      \
  32.103 +   })
  32.104 +@@ -157,12 +157,12 @@
  32.105 + #define __arch_atomic_increment_val_32(mem) \
  32.106 +   ({									      \
  32.107 +     __typeof (*(mem)) __val;						      \
  32.108 +-    __asm __volatile ("1:	lwarx	%0,0,%2\n"			      \
  32.109 ++    __asm __volatile ("1:	lwarx	%0,%y1\n"			      \
  32.110 + 		      "		addi	%0,%0,1\n"			      \
  32.111 +-		      "		stwcx.	%0,0,%2\n"			      \
  32.112 ++		      "		stwcx.	%0,%y1\n"			      \
  32.113 + 		      "		bne-	1b"				      \
  32.114 +-		      : "=&b" (__val), "=m" (*mem)			      \
  32.115 +-		      : "b" (mem), "m" (*mem)				      \
  32.116 ++		      : "=&b" (__val), "+Z" (*mem)			      \
  32.117 ++		      :							      \
  32.118 + 		      : "cr0", "memory");				      \
  32.119 +     __val;								      \
  32.120 +   })
  32.121 +@@ -170,27 +170,27 @@
  32.122 + #define __arch_atomic_decrement_val_32(mem) \
  32.123 +   ({									      \
  32.124 +     __typeof (*(mem)) __val;						      \
  32.125 +-    __asm __volatile ("1:	lwarx	%0,0,%2\n"			      \
  32.126 ++    __asm __volatile ("1:	lwarx	%0,%y1\n"			      \
  32.127 + 		      "		subi	%0,%0,1\n"			      \
  32.128 +-		      "		stwcx.	%0,0,%2\n"			      \
  32.129 ++		      "		stwcx.	%0,%y1\n"			      \
  32.130 + 		      "		bne-	1b"				      \
  32.131 +-		      : "=&b" (__val), "=m" (*mem)			      \
  32.132 +-		      : "b" (mem), "m" (*mem)				      \
  32.133 ++		      : "=&b" (__val), "+Z" (*mem)			      \
  32.134 ++		      :							      \
  32.135 + 		      : "cr0", "memory");				      \
  32.136 +     __val;								      \
  32.137 +   })
  32.138 + 
  32.139 + #define __arch_atomic_decrement_if_positive_32(mem) \
  32.140 +   ({ int __val, __tmp;							      \
  32.141 +-     __asm __volatile ("1:	lwarx	%0,0,%3\n"			      \
  32.142 ++     __asm __volatile ("1:	lwarx	%0,%y2\n"			      \
  32.143 + 		       "	cmpwi	0,%0,0\n"			      \
  32.144 + 		       "	addi	%1,%0,-1\n"			      \
  32.145 + 		       "	ble	2f\n"				      \
  32.146 +-		       "	stwcx.	%1,0,%3\n"			      \
  32.147 ++		       "	stwcx.	%1,%y2\n"			      \
  32.148 + 		       "	bne-	1b\n"				      \
  32.149 + 		       "2:	" __ARCH_ACQ_INSTR			      \
  32.150 +-		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  32.151 +-		       : "b" (mem), "m" (*mem)				      \
  32.152 ++		       : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem)	      \
  32.153 ++		       :						      \
  32.154 + 		       : "cr0", "memory");				      \
  32.155 +      __val;								      \
  32.156 +   })
  32.157 +diff -durN glibc-2.12.1.orig/sysdeps/powerpc/powerpc32/bits/atomic.h glibc-2.12.1/sysdeps/powerpc/powerpc32/bits/atomic.h
  32.158 +--- glibc-2.12.1.orig/sysdeps/powerpc/powerpc32/bits/atomic.h	2007-03-26 22:15:45.000000000 +0200
  32.159 ++++ glibc-2.12.1/sysdeps/powerpc/powerpc32/bits/atomic.h	2009-11-13 00:51:19.000000000 +0100
  32.160 +@@ -44,14 +44,14 @@
  32.161 + ({									      \
  32.162 +   unsigned int __tmp;							      \
  32.163 +   __asm __volatile (							      \
  32.164 +-		    "1:	lwarx	%0,0,%1" MUTEX_HINT_ACQ "\n"		      \
  32.165 ++		    "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"		      \
  32.166 + 		    "	subf.	%0,%2,%0\n"				      \
  32.167 + 		    "	bne	2f\n"					      \
  32.168 +-		    "	stwcx.	%3,0,%1\n"				      \
  32.169 ++		    "	stwcx.	%3,%y1\n"				      \
  32.170 + 		    "	bne-	1b\n"					      \
  32.171 + 		    "2:	" __ARCH_ACQ_INSTR				      \
  32.172 +-		    : "=&r" (__tmp)					      \
  32.173 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  32.174 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  32.175 ++		    : "r" (oldval), "r" (newval)			      \
  32.176 + 		    : "cr0", "memory");					      \
  32.177 +   __tmp != 0;								      \
  32.178 + })
  32.179 +@@ -60,14 +60,14 @@
  32.180 + ({									      \
  32.181 +   unsigned int __tmp;							      \
  32.182 +   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  32.183 +-		    "1:	lwarx	%0,0,%1" MUTEX_HINT_REL "\n"		      \
  32.184 ++		    "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"		      \
  32.185 + 		    "	subf.	%0,%2,%0\n"				      \
  32.186 + 		    "	bne	2f\n"					      \
  32.187 +-		    "	stwcx.	%3,0,%1\n"				      \
  32.188 ++		    "	stwcx.	%3,%y1\n"				      \
  32.189 + 		    "	bne-	1b\n"					      \
  32.190 + 		    "2:	"						      \
  32.191 +-		    : "=&r" (__tmp)					      \
  32.192 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  32.193 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  32.194 ++		    : "r" (oldval), "r" (newval)			      \
  32.195 + 		    : "cr0", "memory");					      \
  32.196 +   __tmp != 0;								      \
  32.197 + })
  32.198 +diff -durN glibc-2.12.1.orig/sysdeps/powerpc/powerpc64/bits/atomic.h glibc-2.12.1/sysdeps/powerpc/powerpc64/bits/atomic.h
  32.199 +--- glibc-2.12.1.orig/sysdeps/powerpc/powerpc64/bits/atomic.h	2007-03-26 22:16:03.000000000 +0200
  32.200 ++++ glibc-2.12.1/sysdeps/powerpc/powerpc64/bits/atomic.h	2009-11-13 00:51:19.000000000 +0100
  32.201 +@@ -44,14 +44,14 @@
  32.202 + ({									      \
  32.203 +   unsigned int __tmp, __tmp2;						      \
  32.204 +   __asm __volatile ("   clrldi  %1,%1,32\n"				      \
  32.205 +-		    "1:	lwarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	 	      \
  32.206 ++		    "1:	lwarx	%0,%y2" MUTEX_HINT_ACQ "\n"	 	      \
  32.207 + 		    "	subf.	%0,%1,%0\n"				      \
  32.208 + 		    "	bne	2f\n"					      \
  32.209 +-		    "	stwcx.	%4,0,%2\n"				      \
  32.210 ++		    "	stwcx.	%4,%y2\n"				      \
  32.211 + 		    "	bne-	1b\n"					      \
  32.212 + 		    "2:	" __ARCH_ACQ_INSTR				      \
  32.213 +-		    : "=&r" (__tmp), "=r" (__tmp2)			      \
  32.214 +-		    : "b" (mem), "1" (oldval), "r" (newval)		      \
  32.215 ++		    : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem))	      \
  32.216 ++		    : "1" (oldval), "r" (newval)			      \
  32.217 + 		    : "cr0", "memory");					      \
  32.218 +   __tmp != 0;								      \
  32.219 + })
  32.220 +@@ -61,14 +61,14 @@
  32.221 +   unsigned int __tmp, __tmp2;						      \
  32.222 +   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  32.223 + 		    "   clrldi  %1,%1,32\n"				      \
  32.224 +-		    "1:	lwarx	%0,0,%2" MUTEX_HINT_REL "\n"		      \
  32.225 ++		    "1:	lwarx	%0,%y2" MUTEX_HINT_REL "\n"		      \
  32.226 + 		    "	subf.	%0,%1,%0\n"				      \
  32.227 + 		    "	bne	2f\n"					      \
  32.228 +-		    "	stwcx.	%4,0,%2\n"				      \
  32.229 ++		    "	stwcx.	%4,%y2\n"				      \
  32.230 + 		    "	bne-	1b\n"					      \
  32.231 + 		    "2:	"						      \
  32.232 +-		    : "=&r" (__tmp), "=r" (__tmp2)			      \
  32.233 +-		    : "b" (mem), "1" (oldval), "r" (newval)		      \
  32.234 ++		    : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem))	      \
  32.235 ++		    : "1" (oldval), "r" (newval)			      \
  32.236 + 		    : "cr0", "memory");					      \
  32.237 +   __tmp != 0;								      \
  32.238 + })
  32.239 +@@ -82,14 +82,14 @@
  32.240 + ({									      \
  32.241 +   unsigned long	__tmp;							      \
  32.242 +   __asm __volatile (							      \
  32.243 +-		    "1:	ldarx	%0,0,%1" MUTEX_HINT_ACQ "\n"		      \
  32.244 ++		    "1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"		      \
  32.245 + 		    "	subf.	%0,%2,%0\n"				      \
  32.246 + 		    "	bne	2f\n"					      \
  32.247 +-		    "	stdcx.	%3,0,%1\n"				      \
  32.248 ++		    "	stdcx.	%3,%y1\n"				      \
  32.249 + 		    "	bne-	1b\n"					      \
  32.250 + 		    "2:	" __ARCH_ACQ_INSTR				      \
  32.251 +-		    : "=&r" (__tmp)					      \
  32.252 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  32.253 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  32.254 ++		    : "r" (oldval), "r" (newval)			      \
  32.255 + 		    : "cr0", "memory");					      \
  32.256 +   __tmp != 0;								      \
  32.257 + })
  32.258 +@@ -98,14 +98,14 @@
  32.259 + ({									      \
  32.260 +   unsigned long	__tmp;							      \
  32.261 +   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  32.262 +-		    "1:	ldarx	%0,0,%2" MUTEX_HINT_REL "\n"		      \
  32.263 ++		    "1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"		      \
  32.264 + 		    "	subf.	%0,%2,%0\n"				      \
  32.265 + 		    "	bne	2f\n"					      \
  32.266 +-		    "	stdcx.	%3,0,%1\n"				      \
  32.267 ++		    "	stdcx.	%3,%y1\n"				      \
  32.268 + 		    "	bne-	1b\n"					      \
  32.269 + 		    "2:	"						      \
  32.270 +-		    : "=&r" (__tmp)					      \
  32.271 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  32.272 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  32.273 ++		    : "r" (oldval), "r" (newval)			      \
  32.274 + 		    : "cr0", "memory");					      \
  32.275 +   __tmp != 0;								      \
  32.276 + })
  32.277 +@@ -115,14 +115,14 @@
  32.278 +       __typeof (*(mem)) __tmp;						      \
  32.279 +       __typeof (mem)  __memp = (mem);					      \
  32.280 +       __asm __volatile (						      \
  32.281 +-		        "1:	ldarx	%0,0,%1" MUTEX_HINT_ACQ "\n"	      \
  32.282 ++		        "1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
  32.283 + 		        "	cmpd	%0,%2\n"			      \
  32.284 + 		        "	bne	2f\n"				      \
  32.285 +-		        "	stdcx.	%3,0,%1\n"			      \
  32.286 ++		        "	stdcx.	%3,%y1\n"			      \
  32.287 + 		        "	bne-	1b\n"				      \
  32.288 + 		        "2:	" __ARCH_ACQ_INSTR			      \
  32.289 +-		        : "=&r" (__tmp)					      \
  32.290 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
  32.291 ++		        : "=&r" (__tmp), "+Z" (*__memp)			      \
  32.292 ++		        : "r" (oldval), "r" (newval)			      \
  32.293 + 		        : "cr0", "memory");				      \
  32.294 +       __tmp;								      \
  32.295 +   })
  32.296 +@@ -132,14 +132,14 @@
  32.297 +       __typeof (*(mem)) __tmp;						      \
  32.298 +       __typeof (mem)  __memp = (mem);					      \
  32.299 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  32.300 +-		        "1:	ldarx	%0,0,%1" MUTEX_HINT_REL "\n"	      \
  32.301 ++		        "1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
  32.302 + 		        "	cmpd	%0,%2\n"			      \
  32.303 + 		        "	bne	2f\n"				      \
  32.304 +-		        "	stdcx.	%3,0,%1\n"			      \
  32.305 ++		        "	stdcx.	%3,%y1\n"			      \
  32.306 + 		        "	bne-	1b\n"				      \
  32.307 + 		        "2:	"					      \
  32.308 +-		        : "=&r" (__tmp)					      \
  32.309 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
  32.310 ++		        : "=&r" (__tmp), "+Z" (*__memp)			      \
  32.311 ++		        : "r" (oldval), "r" (newval)			      \
  32.312 + 		        : "cr0", "memory");				      \
  32.313 +       __tmp;								      \
  32.314 +   })
  32.315 +@@ -148,12 +148,12 @@
  32.316 +     ({									      \
  32.317 +       __typeof (*mem) __val;						      \
  32.318 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  32.319 +-			"1:	ldarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	      \
  32.320 +-			"	stdcx.	%3,0,%2\n"			      \
  32.321 ++			"1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
  32.322 ++			"	stdcx.	%2,%y1\n"			      \
  32.323 + 			"	bne-	1b\n"				      \
  32.324 + 		  " " __ARCH_ACQ_INSTR					      \
  32.325 +-			: "=&r" (__val), "=m" (*mem)			      \
  32.326 +-			: "b" (mem), "r" (value), "m" (*mem)		      \
  32.327 ++			: "=&r" (__val), "+Z" (*(mem))			      \
  32.328 ++			: "r" (value)					      \
  32.329 + 			: "cr0", "memory");				      \
  32.330 +       __val;								      \
  32.331 +     })
  32.332 +@@ -162,11 +162,11 @@
  32.333 +     ({									      \
  32.334 +       __typeof (*mem) __val;						      \
  32.335 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  32.336 +-			"1:	ldarx	%0,0,%2" MUTEX_HINT_REL "\n"	      \
  32.337 +-			"	stdcx.	%3,0,%2\n"			      \
  32.338 ++			"1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
  32.339 ++			"	stdcx.	%2,%y1\n"			      \
  32.340 + 			"	bne-	1b"				      \
  32.341 +-			: "=&r" (__val), "=m" (*mem)			      \
  32.342 +-			: "b" (mem), "r" (value), "m" (*mem)		      \
  32.343 ++			: "=&r" (__val), "+Z" (*(mem))			      \
  32.344 ++			: "r" (value)					      \
  32.345 + 			: "cr0", "memory");				      \
  32.346 +       __val;								      \
  32.347 +     })
  32.348 +@@ -174,12 +174,12 @@
  32.349 + #define __arch_atomic_exchange_and_add_64(mem, value) \
  32.350 +     ({									      \
  32.351 +       __typeof (*mem) __val, __tmp;					      \
  32.352 +-      __asm __volatile ("1:	ldarx	%0,0,%3\n"			      \
  32.353 +-			"	add	%1,%0,%4\n"			      \
  32.354 +-			"	stdcx.	%1,0,%3\n"			      \
  32.355 ++      __asm __volatile ("1:	ldarx	%0,%y2\n"			      \
  32.356 ++			"	add	%1,%0,%3\n"			      \
  32.357 ++			"	stdcx.	%1,%y2\n"			      \
  32.358 + 			"	bne-	1b"				      \
  32.359 +-			: "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  32.360 +-			: "b" (mem), "r" (value), "m" (*mem)		      \
  32.361 ++			: "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem))	      \
  32.362 ++			: "r" (value)					      \
  32.363 + 			: "cr0", "memory");				      \
  32.364 +       __val;								      \
  32.365 +     })
  32.366 +@@ -187,12 +187,12 @@
  32.367 + #define __arch_atomic_increment_val_64(mem) \
  32.368 +     ({									      \
  32.369 +       __typeof (*(mem)) __val;						      \
  32.370 +-      __asm __volatile ("1:	ldarx	%0,0,%2\n"			      \
  32.371 ++      __asm __volatile ("1:	ldarx	%0,%y1\n"			      \
  32.372 + 			"	addi	%0,%0,1\n"			      \
  32.373 +-			"	stdcx.	%0,0,%2\n"			      \
  32.374 ++			"	stdcx.	%0,%y1\n"			      \
  32.375 + 			"	bne-	1b"				      \
  32.376 +-			: "=&b" (__val), "=m" (*mem)			      \
  32.377 +-			: "b" (mem), "m" (*mem)				      \
  32.378 ++			: "=&b" (__val), "+Z" (*(mem))			      \
  32.379 ++			:						      \
  32.380 + 			: "cr0", "memory");				      \
  32.381 +       __val;								      \
  32.382 +     })
  32.383 +@@ -200,27 +200,27 @@
  32.384 + #define __arch_atomic_decrement_val_64(mem) \
  32.385 +     ({									      \
  32.386 +       __typeof (*(mem)) __val;						      \
  32.387 +-      __asm __volatile ("1:	ldarx	%0,0,%2\n"			      \
  32.388 ++      __asm __volatile ("1:	ldarx	%0,%y1\n"			      \
  32.389 + 			"	subi	%0,%0,1\n"			      \
  32.390 +-			"	stdcx.	%0,0,%2\n"			      \
  32.391 ++			"	stdcx.	%0,%y1\n"			      \
  32.392 + 			"	bne-	1b"				      \
  32.393 +-			: "=&b" (__val), "=m" (*mem)			      \
  32.394 +-			: "b" (mem), "m" (*mem)				      \
  32.395 ++			: "=&b" (__val), "+Z" (*(mem))			      \
  32.396 ++			:						      \
  32.397 + 			: "cr0", "memory");				      \
  32.398 +       __val;								      \
  32.399 +     })
  32.400 + 
  32.401 + #define __arch_atomic_decrement_if_positive_64(mem) \
  32.402 +   ({ int __val, __tmp;							      \
  32.403 +-     __asm __volatile ("1:	ldarx	%0,0,%3\n"			      \
  32.404 ++     __asm __volatile ("1:	ldarx	%0,%y2\n"			      \
  32.405 + 		       "	cmpdi	0,%0,0\n"			      \
  32.406 + 		       "	addi	%1,%0,-1\n"			      \
  32.407 + 		       "	ble	2f\n"				      \
  32.408 +-		       "	stdcx.	%1,0,%3\n"			      \
  32.409 ++		       "	stdcx.	%1,%y2\n"			      \
  32.410 + 		       "	bne-	1b\n"				      \
  32.411 + 		       "2:	" __ARCH_ACQ_INSTR			      \
  32.412 +-		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  32.413 +-		       : "b" (mem), "m" (*mem)				      \
  32.414 ++		       : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem))	      \
  32.415 ++		       :						      \
  32.416 + 		       : "cr0", "memory");				      \
  32.417 +      __val;								      \
  32.418 +   })
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/patches/glibc/ports-2.12.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch	Tue May 03 00:20:04 2011 +0200
    33.3 @@ -0,0 +1,374 @@
    33.4 +http://yann.poupet.free.fr/ep93xx/
    33.5 +Add support for the Maverick Crunch FPU on Cirrus EP93XX processor series
    33.6 +
    33.7 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h
    33.8 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h	2009-05-16 10:36:20.000000000 +0200
    33.9 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h	2009-11-13 00:51:22.000000000 +0100
   33.10 +@@ -12,7 +12,7 @@
   33.11 + /* FPA floating point units are always big-endian, irrespective of the
   33.12 +    CPU endianness.  VFP floating point units use the same endianness
   33.13 +    as the rest of the system.  */
   33.14 +-#ifdef __VFP_FP__
   33.15 ++#if defined __VFP_FP__ || defined __MAVERICK__
   33.16 + #define __FLOAT_WORD_ORDER __BYTE_ORDER
   33.17 + #else
   33.18 + #define __FLOAT_WORD_ORDER __BIG_ENDIAN
   33.19 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S
   33.20 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S	2009-05-16 10:36:20.000000000 +0200
   33.21 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S	2009-11-13 00:51:22.000000000 +0100
   33.22 +@@ -30,7 +30,33 @@
   33.23 + 	movs	r0, r1		/* get the return value in place */
   33.24 + 	moveq	r0, #1		/* can't let setjmp() return zero! */
   33.25 + 
   33.26 ++#ifdef __MAVERICK__
   33.27 ++	cfldrd	mvd4,  [ip], #8
   33.28 ++	nop
   33.29 ++	cfldrd	mvd5,  [ip], #8
   33.30 ++	nop
   33.31 ++	cfldrd	mvd6,  [ip], #8
   33.32 ++	nop
   33.33 ++	cfldrd	mvd7,  [ip], #8
   33.34 ++	nop
   33.35 ++	cfldrd	mvd8,  [ip], #8
   33.36 ++	nop
   33.37 ++	cfldrd	mvd9,  [ip], #8
   33.38 ++	nop
   33.39 ++	cfldrd	mvd10, [ip], #8
   33.40 ++	nop
   33.41 ++	cfldrd	mvd11, [ip], #8
   33.42 ++	nop
   33.43 ++	cfldrd	mvd12, [ip], #8
   33.44 ++	nop
   33.45 ++	cfldrd	mvd13, [ip], #8
   33.46 ++	nop
   33.47 ++	cfldrd	mvd14, [ip], #8
   33.48 ++	nop
   33.49 ++	cfldrd	mvd15, [ip], #8
   33.50 ++#else
   33.51 + 	lfmfd	f4, 4, [ip] !	/* load the floating point regs */
   33.52 ++#endif
   33.53 + 
   33.54 + 	LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
   33.55 + END (__longjmp)
   33.56 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h
   33.57 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h	2009-05-16 10:36:20.000000000 +0200
   33.58 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h	2009-11-13 00:51:22.000000000 +0100
   33.59 +@@ -20,6 +20,45 @@
   33.60 + # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
   33.61 + #endif
   33.62 + 
   33.63 ++#if defined(__MAVERICK__)
   33.64 ++
   33.65 ++/* Define bits representing exceptions in the FPU status word.  */
   33.66 ++enum
   33.67 ++  {
   33.68 ++    FE_INVALID = 1,
   33.69 ++#define FE_INVALID FE_INVALID
   33.70 ++    FE_OVERFLOW = 4,
   33.71 ++#define FE_OVERFLOW FE_OVERFLOW
   33.72 ++    FE_UNDERFLOW = 8,
   33.73 ++#define FE_UNDERFLOW FE_UNDERFLOW
   33.74 ++    FE_INEXACT = 16,
   33.75 ++#define FE_INEXACT FE_INEXACT
   33.76 ++  };
   33.77 ++
   33.78 ++/* Amount to shift by to convert an exception to a mask bit.  */
   33.79 ++#define FE_EXCEPT_SHIFT	5
   33.80 ++
   33.81 ++/* All supported exceptions.  */
   33.82 ++#define FE_ALL_EXCEPT	\
   33.83 ++	(FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
   33.84 ++
   33.85 ++/* IEEE rounding modes.  */
   33.86 ++enum
   33.87 ++  {
   33.88 ++    FE_TONEAREST = 0,
   33.89 ++#define FE_TONEAREST    FE_TONEAREST
   33.90 ++    FE_TOWARDZERO = 0x400,
   33.91 ++#define FE_TOWARDZERO   FE_TOWARDZERO
   33.92 ++    FE_DOWNWARD = 0x800,
   33.93 ++#define FE_DOWNWARD     FE_DOWNWARD
   33.94 ++    FE_UPWARD = 0xc00,
   33.95 ++#define FE_UPWARD       FE_UPWARD
   33.96 ++  };
   33.97 ++
   33.98 ++#define FE_ROUND_MASK (FE_UPWARD)
   33.99 ++
  33.100 ++#else /* FPA */
  33.101 ++
  33.102 + /* Define bits representing exceptions in the FPU status word.  */
  33.103 + enum
  33.104 +   {
  33.105 +@@ -44,6 +83,8 @@
  33.106 +    modes exist, but you have to encode them in the actual instruction.  */
  33.107 + #define FE_TONEAREST	0
  33.108 + 
  33.109 ++#endif
  33.110 ++
  33.111 + /* Type representing exception flags. */
  33.112 + typedef unsigned long int fexcept_t;
  33.113 + 
  33.114 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h
  33.115 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h	2009-05-16 10:36:20.000000000 +0200
  33.116 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h	2009-11-13 00:51:22.000000000 +0100
  33.117 +@@ -28,7 +28,11 @@
  33.118 + #ifndef _ASM
  33.119 + /* Jump buffer contains v1-v6, sl, fp, sp and pc.  Other registers are not
  33.120 +    saved.  */
  33.121 ++#ifdef __MAVERICK__
  33.122 ++typedef int __jmp_buf[34];
  33.123 ++#else
  33.124 + typedef int __jmp_buf[22];
  33.125 + #endif
  33.126 ++#endif
  33.127 + 
  33.128 + #endif
  33.129 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c
  33.130 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c	2009-05-16 10:36:20.000000000 +0200
  33.131 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c	2009-11-13 00:51:22.000000000 +0100
  33.132 +@@ -18,9 +18,21 @@
  33.133 +    02111-1307 USA.  */
  33.134 + 
  33.135 + #include <fenv.h>
  33.136 ++#include <fpu_control.h>
  33.137 + 
  33.138 + int
  33.139 + fegetround (void)
  33.140 + {
  33.141 ++#if defined(__MAVERICK__)
  33.142 ++
  33.143 ++  unsigned long temp;
  33.144 ++
  33.145 ++  _FPU_GETCW (temp);
  33.146 ++  return temp & FE_ROUND_MASK;
  33.147 ++
  33.148 ++#else /* FPA */
  33.149 ++
  33.150 +   return FE_TONEAREST;		/* Easy. :-) */
  33.151 ++
  33.152 ++#endif
  33.153 + }
  33.154 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c
  33.155 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c	2009-05-16 10:36:20.000000000 +0200
  33.156 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c	2009-11-13 00:51:22.000000000 +0100
  33.157 +@@ -18,12 +18,28 @@
  33.158 +    02111-1307 USA.  */
  33.159 + 
  33.160 + #include <fenv.h>
  33.161 ++#include <fpu_control.h>
  33.162 + 
  33.163 + int
  33.164 + fesetround (int round)
  33.165 + {
  33.166 ++#if defined(__MAVERICK__)
  33.167 ++  unsigned long temp;
  33.168 ++
  33.169 ++  if (round & ~FE_ROUND_MASK)
  33.170 ++    return 1;
  33.171 ++
  33.172 ++  _FPU_GETCW (temp);
  33.173 ++  temp = (temp & ~FE_ROUND_MASK) | round;
  33.174 ++  _FPU_SETCW (temp);
  33.175 ++  return 0;
  33.176 ++
  33.177 ++#else /* FPA */
  33.178 ++
  33.179 +   /* We only support FE_TONEAREST, so there is no need for any work.  */
  33.180 +   return (round == FE_TONEAREST)?0:1;
  33.181 ++
  33.182 ++#endif
  33.183 + }
  33.184 + 
  33.185 + libm_hidden_def (fesetround)
  33.186 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h
  33.187 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h	2009-05-16 10:36:20.000000000 +0200
  33.188 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h	2009-11-13 00:51:22.000000000 +0100
  33.189 +@@ -1,5 +1,6 @@
  33.190 + /* FPU control word definitions.  ARM version.
  33.191 +-   Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
  33.192 ++   Copyright (C) 1996, 1997, 1998, 2000, 2005
  33.193 ++   Free Software Foundation, Inc.
  33.194 +    This file is part of the GNU C Library.
  33.195 + 
  33.196 +    The GNU C Library is free software; you can redistribute it and/or
  33.197 +@@ -20,6 +21,79 @@
  33.198 + #ifndef _FPU_CONTROL_H
  33.199 + #define _FPU_CONTROL_H
  33.200 + 
  33.201 ++#if defined(__MAVERICK__)
  33.202 ++
  33.203 ++/* DSPSC register: (from EP9312 User's Guide)
  33.204 ++ *
  33.205 ++ * bits 31..29	- DAID
  33.206 ++ * bits 28..26	- HVID
  33.207 ++ * bits 25..24	- RSVD
  33.208 ++ * bit  23	- ISAT
  33.209 ++ * bit  22	- UI
  33.210 ++ * bit  21	- INT
  33.211 ++ * bit  20	- AEXC
  33.212 ++ * bits 19..18	- SAT
  33.213 ++ * bits 17..16	- FCC
  33.214 ++ * bit  15	- V
  33.215 ++ * bit  14	- FWDEN
  33.216 ++ * bit  13	- Invalid
  33.217 ++ * bit	12	- Denorm
  33.218 ++ * bits 11..10	- RM
  33.219 ++ * bits 9..5	- IXE, UFE, OFE, RSVD, IOE
  33.220 ++ * bits 4..0	- IX, UF, OF, RSVD, IO
  33.221 ++ */
  33.222 ++
  33.223 ++/* masking of interrupts */
  33.224 ++#define _FPU_MASK_IM	(1 << 5)	/* invalid operation */
  33.225 ++#define _FPU_MASK_ZM	0		/* divide by zero */
  33.226 ++#define _FPU_MASK_OM	(1 << 7)	/* overflow */
  33.227 ++#define _FPU_MASK_UM	(1 << 8)	/* underflow */
  33.228 ++#define _FPU_MASK_PM	(1 << 9)	/* inexact */
  33.229 ++#define _FPU_MASK_DM	0		/* denormalized operation */
  33.230 ++
  33.231 ++#define _FPU_RESERVED	0xfffff000	/* These bits are reserved.  */
  33.232 ++
  33.233 ++#define _FPU_DEFAULT	0x00b00000	/* Default value.  */
  33.234 ++#define _FPU_IEEE	0x00b003a0	/* Default + exceptions enabled. */
  33.235 ++
  33.236 ++/* Type of the control word.  */
  33.237 ++typedef unsigned int fpu_control_t;
  33.238 ++
  33.239 ++/* Macros for accessing the hardware control word.  */
  33.240 ++#define _FPU_GETCW(cw) ({			\
  33.241 ++	register int __t1, __t2;		\
  33.242 ++						\
  33.243 ++	__asm__ volatile (			\
  33.244 ++	"cfmvr64l	%1, mvdx0\n\t"		\
  33.245 ++	"cfmvr64h	%2, mvdx0\n\t"		\
  33.246 ++	"cfmv32sc	mvdx0, dspsc\n\t"	\
  33.247 ++	"cfmvr64l	%0, mvdx0\n\t"		\
  33.248 ++	"cfmv64lr	mvdx0, %1\n\t"		\
  33.249 ++	"cfmv64hr	mvdx0, %2"		\
  33.250 ++	: "=r" (cw), "=r" (__t1), "=r" (__t2)	\
  33.251 ++	);					\
  33.252 ++})
  33.253 ++
  33.254 ++#define _FPU_SETCW(cw) ({			\
  33.255 ++	register int __t0, __t1, __t2;		\
  33.256 ++						\
  33.257 ++	__asm__ volatile (			\
  33.258 ++	"cfmvr64l	%1, mvdx0\n\t"		\
  33.259 ++	"cfmvr64h	%2, mvdx0\n\t"		\
  33.260 ++	"cfmv64lr	mvdx0, %0\n\t"		\
  33.261 ++	"cfmvsc32	dspsc, mvdx0\n\t"	\
  33.262 ++	"cfmv64lr	mvdx0, %1\n\t"		\
  33.263 ++	"cfmv64hr	mvdx0, %2"		\
  33.264 ++	: "=r" (__t0), "=r" (__t1), "=r" (__t2)	\
  33.265 ++	: "0" (cw)				\
  33.266 ++	);					\
  33.267 ++})
  33.268 ++
  33.269 ++/* Default control word set at startup.  */
  33.270 ++extern fpu_control_t __fpu_control;
  33.271 ++
  33.272 ++#else /* FPA */
  33.273 ++
  33.274 + /* We have a slight terminology confusion here.  On the ARM, the register
  33.275 +  * we're interested in is actually the FPU status word - the FPU control
  33.276 +  * word is something different (which is implementation-defined and only
  33.277 +@@ -99,4 +173,6 @@
  33.278 + /* Default control word set at startup.  */
  33.279 + extern fpu_control_t __fpu_control;
  33.280 + 
  33.281 ++#endif
  33.282 ++
  33.283 + #endif /* _FPU_CONTROL_H */
  33.284 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h
  33.285 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h	2009-05-16 10:36:20.000000000 +0200
  33.286 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h	2009-11-13 00:51:22.000000000 +0100
  33.287 +@@ -17,4 +17,8 @@
  33.288 +    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  33.289 +    02111-1307 USA.  */
  33.290 + 
  33.291 ++#ifdef __MAVERICK__
  33.292 ++#define __JMP_BUF_SP		32
  33.293 ++#else
  33.294 + #define __JMP_BUF_SP		20
  33.295 ++#endif
  33.296 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S
  33.297 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S	2009-05-16 10:36:20.000000000 +0200
  33.298 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S	2009-11-13 00:51:22.000000000 +0100
  33.299 +@@ -24,11 +24,41 @@
  33.300 + 
  33.301 + ENTRY (__sigsetjmp)
  33.302 + 	/* Save registers */
  33.303 ++#ifdef __MAVERICK__
  33.304 ++	cfstrd	mvd4,  [r0], #8
  33.305 ++	nop
  33.306 ++	cfstrd	mvd5,  [r0], #8
  33.307 ++	nop
  33.308 ++	cfstrd	mvd6,  [r0], #8
  33.309 ++	nop
  33.310 ++	cfstrd	mvd7,  [r0], #8
  33.311 ++	nop
  33.312 ++	cfstrd	mvd8,  [r0], #8
  33.313 ++	nop
  33.314 ++	cfstrd	mvd9,  [r0], #8
  33.315 ++	nop
  33.316 ++	cfstrd	mvd10, [r0], #8
  33.317 ++	nop
  33.318 ++	cfstrd	mvd11, [r0], #8
  33.319 ++	nop
  33.320 ++	cfstrd	mvd12, [r0], #8
  33.321 ++	nop
  33.322 ++	cfstrd	mvd13, [r0], #8
  33.323 ++	nop
  33.324 ++	cfstrd	mvd14, [r0], #8
  33.325 ++	nop
  33.326 ++	cfstrd	mvd15, [r0], #8
  33.327 ++#else
  33.328 + 	sfmea	f4, 4, [r0]!
  33.329 ++#endif
  33.330 + 	stmia	r0, {v1-v6, sl, fp, sp, lr}
  33.331 + 
  33.332 + 	/* Restore pointer to jmp_buf */
  33.333 ++#ifdef __MAVERICK__
  33.334 ++	sub	r0, r0, #96
  33.335 ++#else
  33.336 + 	sub	r0, r0, #48
  33.337 ++#endif
  33.338 + 
  33.339 + 	/* Make a tail call to __sigjmp_save; it takes the same args.  */
  33.340 + 	B	PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
  33.341 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gccframe.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gccframe.h
  33.342 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gccframe.h	2009-05-16 10:36:20.000000000 +0200
  33.343 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gccframe.h	2009-11-13 00:51:22.000000000 +0100
  33.344 +@@ -17,6 +17,10 @@
  33.345 +    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  33.346 +    02111-1307 USA.  */
  33.347 + 
  33.348 ++#ifdef __MAVERICK__
  33.349 ++#define FIRST_PSEUDO_REGISTER 43
  33.350 ++#else
  33.351 + #define FIRST_PSEUDO_REGISTER 27
  33.352 ++#endif
  33.353 + 
  33.354 + #include <sysdeps/generic/gccframe.h>
  33.355 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h
  33.356 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h	2009-05-16 10:36:20.000000000 +0200
  33.357 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h	2009-11-13 00:51:22.000000000 +0100
  33.358 +@@ -29,7 +29,7 @@
  33.359 + #if defined(__ARMEB__)
  33.360 + # define IEEE_DOUBLE_MIXED_ENDIAN 0
  33.361 + # define IEEE_DOUBLE_BIG_ENDIAN 1
  33.362 +-#elif defined(__VFP_FP__)
  33.363 ++#elif defined(__VFP_FP__) || defined(__MAVERICK__)
  33.364 + # define IEEE_DOUBLE_MIXED_ENDIAN 0
  33.365 + # define IEEE_DOUBLE_BIG_ENDIAN 0
  33.366 + #else
  33.367 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/bits/endian.h glibc-2.12.1/ports/sysdeps/arm/bits/endian.h
  33.368 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/__longjmp.S glibc-2.12.1/ports/sysdeps/arm/fpu/__longjmp.S
  33.369 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/bits/fenv.h glibc-2.12.1/ports/sysdeps/arm/fpu/bits/fenv.h
  33.370 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/bits/setjmp.h glibc-2.12.1/ports/sysdeps/arm/fpu/bits/setjmp.h
  33.371 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/fegetround.c glibc-2.12.1/ports/sysdeps/arm/fpu/fegetround.c
  33.372 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/fesetround.c glibc-2.12.1/ports/sysdeps/arm/fpu/fesetround.c
  33.373 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/fpu_control.h glibc-2.12.1/ports/sysdeps/arm/fpu/fpu_control.h
  33.374 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.12.1/ports/sysdeps/arm/fpu/jmpbuf-offsets.h
  33.375 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/setjmp.S glibc-2.12.1/ports/sysdeps/arm/fpu/setjmp.S
  33.376 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/gccframe.h glibc-2.12.1/ports/sysdeps/arm/gccframe.h
  33.377 +diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/gmp-mparam.h glibc-2.12.1/ports/sysdeps/arm/gmp-mparam.h
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/patches/glibc/ports-2.12.1/580-nptl-lowlevellock.patch	Tue May 03 00:20:04 2011 +0200
    34.3 @@ -0,0 +1,23 @@
    34.4 +fix build error on arm like on hppa:
    34.5 +
    34.6 +arm-unknown-linux-gnu-gcc ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -g -pipe -Wstrict-prototypes   -fPIC    -I../include -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/fpu -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include-fixed -isystem /usr/arm-unknown-linux-gnu/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h  -DPIC -DSHARED      -o /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -MD -MP -MF /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os.dt -MT /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -DNOT_IN_libc=1 -DIS_IN_rtld=1
    34.7 +In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21:
    34.8 +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private':
    34.9 +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: warning: implicit declaration of function 'THREAD_GETMEM'
   34.10 +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'THREAD_SELF' undeclared (first use in this function)
   34.11 +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: (Each undeclared identifier is reported only once
   34.12 +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: for each function it appears in.)
   34.13 +../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'header' undeclared (first use in this function)
   34.14 +
   34.15 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
   34.16 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h	2009-05-16 10:36:20.000000000 +0200
   34.17 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h	2009-11-13 00:51:23.000000000 +0100
   34.18 +@@ -25,6 +25,7 @@
   34.19 + #include <atomic.h>
   34.20 + #include <sysdep.h>
   34.21 + #include <kernel-features.h>
   34.22 ++#include <tls.h>		/* Need THREAD_*, and header.*.  */
   34.23 + 
   34.24 + #define FUTEX_WAIT		0
   34.25 + #define FUTEX_WAKE		1
   34.26 +diff -durN glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.12.1/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/patches/glibc/ports-2.12.1/610-fpu-cw-mips.patch	Tue May 03 00:20:04 2011 +0200
    35.3 @@ -0,0 +1,15 @@
    35.4 +http://sourceware.org/ml/libc-alpha/2002-10/msg00392.html
    35.5 +
    35.6 +diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h
    35.7 +--- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h	2009-05-16 10:36:20.000000000 +0200
    35.8 ++++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h	2009-11-13 00:51:31.000000000 +0100
    35.9 +@@ -86,7 +86,7 @@
   35.10 + #define _FPU_RC_UP      0x2
   35.11 + #define _FPU_RC_DOWN    0x3
   35.12 + 
   35.13 +-#define _FPU_RESERVED 0xfe3c0000  /* Reserved bits in cw */
   35.14 ++#define _FPU_RESERVED 0xfebc0000  /* Reserved bits in cw */
   35.15 + 
   35.16 + 
   35.17 + /* The fdlibm code requires strict IEEE double precision arithmetic,
   35.18 +diff -durN glibc-2.12.1.orig/ports/sysdeps/mips/fpu_control.h glibc-2.12.1/ports/sysdeps/mips/fpu_control.h
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/patches/glibc/ports-2.12.1/630-mips_shn_undef-hack.patch	Tue May 03 00:20:04 2011 +0200
    36.3 @@ -0,0 +1,16 @@
    36.4 +diff -durN glibc-2.12.1.orig/elf/dl-lookup.c glibc-2.12.1/elf/dl-lookup.c
    36.5 +--- glibc-2.12.1.orig/elf/dl-lookup.c	2009-03-30 23:14:32.000000000 +0200
    36.6 ++++ glibc-2.12.1/elf/dl-lookup.c	2009-11-13 00:51:36.000000000 +0100
    36.7 +@@ -301,6 +301,12 @@
    36.8 + 	      /* FALLTHROUGH */
    36.9 + 	    case STB_GLOBAL:
   36.10 +	    success:
   36.11 ++#ifdef __mips__
   36.12 ++	      /* HACK: MIPS marks its lazy evaluation stubs with SHN_UNDEF
   36.13 ++		 symbols, we skip them. */
   36.14 ++	      if (sym->st_shndx == SHN_UNDEF)
   36.15 ++		break;
   36.16 ++#endif
   36.17 + 	      /* Global definition.  Just what we need.  */
   36.18 + 	      result->s = sym;
   36.19 + 	      result->m = (struct link_map *) map;
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/patches/glibc/ports-2.12.1/640-alpha-atfcts.patch	Tue May 03 00:20:04 2011 +0200
    37.3 @@ -0,0 +1,12 @@
    37.4 +--- glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h	2010-07-27 14:34:39.000000000 +0300
    37.5 ++++ glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h.new	2011-03-10 18:54:37.686795979 +0200
    37.6 +@@ -437,7 +437,8 @@
    37.7 +    the code.  On PPC they were introduced in 2.6.17-rc1,
    37.8 +    on SH in 2.6.19-rc1.  */
    37.9 + #if __LINUX_KERNEL_VERSION >= 0x020611 \
   37.10 +-    && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613)
   37.11 ++    && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613) \
   37.12 ++    && (!defined __alpha__)
   37.13 + # define __ASSUME_ATFCTS	1
   37.14 + #endif
   37.15 + 
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/patches/glibc/ports-2.12.1/650-syslog.patch	Tue May 03 00:20:04 2011 +0200
    38.3 @@ -0,0 +1,12 @@
    38.4 +diff -durN glibc-cvs-2.9.orig/misc/syslog.c glibc-cvs-2.9/misc/syslog.c
    38.5 +--- glibc-cvs-2.9.orig/misc/syslog.c	2009-06-01 10:16:50.000000000 +0200
    38.6 ++++ glibc-cvs-2.9/misc/syslog.c	2009-06-01 10:17:20.000000000 +0200
    38.7 +@@ -152,7 +152,7 @@
    38.8 + #define	INTERNALLOG	LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
    38.9 + 	/* Check for invalid bits. */
   38.10 + 	if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
   38.11 +-		syslog(INTERNALLOG,
   38.12 ++		__syslog(INTERNALLOG,
   38.13 + 		    "syslog: unknown facility/priority: %x", pri);
   38.14 + 		pri &= LOG_PRIMASK|LOG_FACMASK;
   38.15 + 	}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/patches/glibc/ports-2.12.1/660-debug-readlink_chk-readklinkat_chk.patch	Tue May 03 00:20:04 2011 +0200
    39.3 @@ -0,0 +1,24 @@
    39.4 +diff -dur glibc-cvs-2.9.orig/debug/readlink_chk.c glibc-cvs-2.9/debug/readlink_chk.c
    39.5 +--- glibc-cvs-2.9.orig/debug/readlink_chk.c	2005-03-01 01:41:15.000000000 +0100
    39.6 ++++ glibc-cvs-2.9/debug/readlink_chk.c	2009-06-01 10:59:37.000000000 +0200
    39.7 +@@ -25,7 +25,7 @@
    39.8 + 
    39.9 + 
   39.10 + ssize_t
   39.11 +-__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
   39.12 ++__readlink_chk (const char *path, char *buf, size_t len, size_t buflen)
   39.13 + {
   39.14 +   if (len > buflen)
   39.15 +     __chk_fail ();
   39.16 +diff -dur glibc-cvs-2.9.orig/debug/readlinkat_chk.c glibc-cvs-2.9/debug/readlinkat_chk.c
   39.17 +--- glibc-cvs-2.9.orig/debug/readlinkat_chk.c	2006-04-24 18:56:12.000000000 +0200
   39.18 ++++ glibc-cvs-2.9/debug/readlinkat_chk.c	2009-06-01 11:07:26.000000000 +0200
   39.19 +@@ -21,7 +21,7 @@
   39.20 + 
   39.21 + 
   39.22 + ssize_t
   39.23 +-__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
   39.24 ++__readlinkat_chk (int fd, const char *path, char *buf, size_t len,
   39.25 + 		  size_t buflen)
   39.26 + {
   39.27 +   if (len > buflen)