Update the newlib devel branch with stuf from /trunk. newlib
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Apr 19 16:17:11 2009 +0000 (2009-04-19)
branchnewlib
changeset 1365c4d124ed9f8e
parent 1364 9227d2a2c080
child 1366 5e5d1e6f55d3
Update the newlib devel branch with stuf from /trunk.

-------- diffstat follows --------
/devel/newlib/configure | 8 4 4 0
/devel/newlib/scripts/build/kernel/linux.sh | 2 1 1 0
/devel/newlib/scripts/build/cc/gcc.sh | 34 22 12 0 +
/devel/newlib/scripts/build/debug/300-gdb.sh | 52 45 7 0 +
/devel/newlib/scripts/build/libc/uClibc.sh | 6 3 3 0
/devel/newlib/scripts/build/mpfr.sh | 2 1 1 0
/devel/newlib/scripts/crosstool-NG.sh.in | 20 18 2 0 +
/devel/newlib/scripts/functions | 44 34 10 0 +
/devel/newlib/patches/glibc/2_9/500-ppc-glibc-2.9-atomic.patch | 414 0 414 0 ----------
/devel/newlib/patches/glibc/2_9/140-regex-BZ9697.patch | 111 0 111 0 ---
/devel/newlib/patches/glibc/2_9/190-queue-header-updates.patch | 89 0 89 0 --
/devel/newlib/patches/glibc/2_9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch | 249 0 249 0 ------
/devel/newlib/patches/glibc/2_9/450-alpha-glibc-2.5-no-page-header.patch | 32 0 32 0 -
/devel/newlib/patches/glibc/2_9/330-2.3.3-china.patch | 35 0 35 0 -
/devel/newlib/patches/glibc/2_9/270-ldbl-nexttowardf.patch | 68 0 68 0 --
/devel/newlib/patches/glibc/2_9/410-2.9-fnmatch.patch | 64 0 64 0 --
/devel/newlib/patches/glibc/2_9/340-new-valencian-locale.patch | 120 0 120 0 ---
/devel/newlib/patches/glibc/2_9/350-2.4-undefine-__i686.patch | 47 0 47 0 -
/devel/newlib/patches/glibc/2_9/160-i386-x86_64-revert-clone-cfi.patch | 53 0 53 0 -
/devel/newlib/patches/glibc/2_9/150-regex-BZ697.patch | 28 0 28 0 -
/devel/newlib/patches/glibc/2_9/420-dont-build-timezone.patch | 19 0 19 0 -
/devel/newlib/patches/glibc/2_9/290-no-inline-gmon.patch | 38 0 38 0 -
/devel/newlib/patches/glibc/2_9/280-section-comments.patch | 29 0 29 0 -
/devel/newlib/patches/glibc/2_9/180-math-tests.patch | 72 0 72 0 --
/devel/newlib/patches/glibc/2_9/250-resolv-dynamic.patch | 44 0 44 0 -
/devel/newlib/patches/glibc/2_9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch | 35 0 35 0 -
/devel/newlib/patches/glibc/2_9/300-2.9-check_native-headers.patch | 22 0 22 0 -
/devel/newlib/patches/glibc/2_9/130-add_prio-macros.patch | 26 0 26 0 -
/devel/newlib/patches/glibc/2_9/310-2.3.6-fix-pr631.patch | 50 0 50 0 -
/devel/newlib/patches/glibc/2_9/510-sh-no-asm-user-header.patch | 70 0 70 0 --
/devel/newlib/patches/glibc/2_9/260-fadvise64_64.patch | 30 0 30 0 -
/devel/newlib/patches/glibc/2_9/440-alpha-glibc-2.4-xstat.patch | 249 0 249 0 ------
/devel/newlib/patches/glibc/2_9/170-2.10-dns-no-gethostbyname4.patch | 35 0 35 0 -
/devel/newlib/patches/glibc/2_9/230-2.3.3-localedef-fix-trampoline.patch | 74 0 74 0 --
/devel/newlib/patches/glibc/2_9/480-alpha-glibc-2.8-cache-shape.patch | 18 0 18 0 -
/devel/newlib/patches/glibc/2_9/360-2.8-nscd-one-fork.patch | 45 0 45 0 -
/devel/newlib/patches/glibc/2_9/210-2.9-strlen-hack.patch | 109 0 109 0 ---
/devel/newlib/patches/glibc/2_9/320-2.9-assume-pipe2.patch | 59 0 59 0 -
/devel/newlib/patches/glibc/2_9/100-ssp-compat.patch | 193 0 193 0 -----
/devel/newlib/patches/glibc/2_9/110-respect-env-CPPFLAGS.patch | 30 0 30 0 -
/devel/newlib/patches/glibc/2_9/220-manual-no-perl.patch | 29 0 29 0 -
/devel/newlib/patches/glibc/2_9/390-2.3.3_pre20040117-pt_pax.patch | 35 0 35 0 -
/devel/newlib/patches/glibc/2_9/460-alpha-glibc-2.5-no-asm-elf-header.patch | 38 0 38 0 -
/devel/newlib/patches/glibc/2_9/400-tests-sandbox-libdl-paths.patch | 198 0 198 0 -----
/devel/newlib/patches/glibc/2_9/520-sh-no-asm-elf-header.patch | 27 0 27 0 -
/devel/newlib/patches/glibc/2_9/240-i386-LOAD_PIC_REG.patch | 23 0 23 0 -
/devel/newlib/patches/glibc/2_9/200-awk-in-C-locale.patch | 23 0 23 0 -
/devel/newlib/patches/glibc/2_9/430-2.7-cross-compile-nptl.patch | 57 0 57 0 -
/devel/newlib/patches/glibc/2_9/380-2.3.6-dl_execstack-PaX-support.patch | 71 0 71 0 --
/devel/newlib/patches/glibc/2_9/490-ptr-mangling.patch | 114 0 114 0 ---
/devel/newlib/patches/glibc/2_9/470-alpha-glibc-2.8-creat.patch | 19 0 19 0 -
/devel/newlib/patches/glibc/ports-2_9/100-arm_linux_tls.patch | 14 0 14 0 -
/devel/newlib/patches/uClibc/0.9.30.1/140-gnu89-inline.patch | 2 1 1 0
/devel/newlib/docs/known-issues.txt | 16 15 1 0 +
/devel/newlib/docs/overview.txt | 2 1 1 0
/devel/newlib/samples/armeb-unknown-linux-uclibc/uClibc-0.9.30.config | 243 0 243 0 ------
/devel/newlib/samples/armeb-unknown-linux-uclibc/crosstool.config | 78 55 23 0 +-
/devel/newlib/samples/sh4-unknown-linux-gnu/crosstool.config | 35 18 17 0 +
/devel/newlib/samples/x86_64-unknown-linux-gnu/crosstool.config | 104 68 36 0 +--
/devel/newlib/samples/arm-unknown-elf/crosstool.config | 54 47 7 0 +
/devel/newlib/samples/armeb-unknown-eabi/crosstool.config | 54 47 7 0 +
/devel/newlib/samples/arm-unknown-linux-gnueabi/crosstool.config | 113 73 40 0 +--
/devel/newlib/samples/ia64-unknown-linux-gnu/crosstool.config | 91 61 30 0 +-
/devel/newlib/samples/x86_64-unknown-linux-uclibc/uClibc-0.9.30.config | 245 0 245 0 ------
/devel/newlib/samples/x86_64-unknown-linux-uclibc/crosstool.config | 78 55 23 0 +-
/devel/newlib/samples/armeb-unknown-linux-gnueabi/crosstool.config | 105 69 36 0 +--
/devel/newlib/samples/powerpc-e500v2-linux-gnuspe/crosstool.config | 96 63 33 0 +-
/devel/newlib/samples/i686-nptl-linux-gnu/crosstool.config | 78 48 30 0 +-
/devel/newlib/samples/arm-unknown-linux-gnu/crosstool.config | 105 69 36 0 +--
/devel/newlib/samples/powerpc-unknown-linux-gnu/crosstool.config | 103 67 36 0 +-
/devel/newlib/samples/mips-unknown-linux-uclibc/uClibc-0.9.30.config | 254 0 254 0 ------
/devel/newlib/samples/mips-unknown-linux-uclibc/crosstool.config | 77 54 23 0 +-
/devel/newlib/samples/arm-unknown-linux-uclibcgnueabi/uClibc-0.9.30.config | 253 0 253 0 ------
/devel/newlib/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 78 55 23 0 +-
/devel/newlib/samples/arm-iphone-linux-gnueabi/crosstool.config | 84 57 27 0 +-
/devel/newlib/samples/armeb-unknown-linux-gnu/crosstool.config | 105 69 36 0 +--
/devel/newlib/samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config | 104 68 36 0 +--
/devel/newlib/samples/i586-geode-linux-uclibc/uClibc-0.9.30.config | 263 0 263 0 ------
/devel/newlib/samples/i586-geode-linux-uclibc/crosstool.config | 78 55 23 0 +-
/devel/newlib/samples/arm-unknown-linux-uclibc/uClibc-0.9.30.config | 253 0 253 0 ------
/devel/newlib/samples/arm-unknown-linux-uclibc/crosstool.config | 78 55 23 0 +-
/devel/newlib/samples/powerpc-unknown-linux-uclibc/uClibc-0.9.30.config | 248 0 248 0 ------
/devel/newlib/samples/powerpc-unknown-linux-uclibc/crosstool.config | 77 54 23 0 +-
/devel/newlib/samples/mips-unknown-elf/crosstool.config | 54 47 7 0 +
/devel/newlib/samples/powerpc-405-linux-gnu/crosstool.config | 104 68 36 0 +--
/devel/newlib/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 26 13 13 0
/devel/newlib/samples/arm-unknown-eabi/crosstool.config | 54 47 7 0 +
/devel/newlib/samples/mipsel-unknown-linux-gnu/crosstool.config | 104 68 36 0 +--
/devel/newlib/samples/powerpc64-unknown-linux-gnu/crosstool.config | 75 49 26 0 +-
/devel/newlib/samples/alphaev56-unknown-linux-gnu/crosstool.config | 94 63 31 0 +-
/devel/newlib/samples/powerpc-860-linux-gnu/crosstool.config | 102 67 35 0 +-
/devel/newlib/config/kernel/linux.in | 87 46 41 0 +-
/devel/newlib/config/cc/gcc.in | 35 30 5 0 +
/devel/newlib/config/debug/gdb.in | 2 1 1 0
94 files changed, 1851 insertions(+), 5813 deletions(-)
config/cc/gcc.in
config/debug/gdb.in
config/kernel/linux.in
configure
docs/known-issues.txt
docs/overview.txt
patches/gcc/4.2.1/300-libstdc++-nostdlib-linking.patch
patches/glibc/2.9/100-ssp-compat.patch
patches/glibc/2.9/110-respect-env-CPPFLAGS.patch
patches/glibc/2.9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
patches/glibc/2.9/130-add_prio-macros.patch
patches/glibc/2.9/140-regex-BZ9697.patch
patches/glibc/2.9/150-regex-BZ697.patch
patches/glibc/2.9/160-i386-x86_64-revert-clone-cfi.patch
patches/glibc/2.9/170-2.10-dns-no-gethostbyname4.patch
patches/glibc/2.9/180-math-tests.patch
patches/glibc/2.9/190-queue-header-updates.patch
patches/glibc/2.9/200-awk-in-C-locale.patch
patches/glibc/2.9/210-2.9-strlen-hack.patch
patches/glibc/2.9/220-manual-no-perl.patch
patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch
patches/glibc/2.9/240-i386-LOAD_PIC_REG.patch
patches/glibc/2.9/250-resolv-dynamic.patch
patches/glibc/2.9/260-fadvise64_64.patch
patches/glibc/2.9/270-ldbl-nexttowardf.patch
patches/glibc/2.9/280-section-comments.patch
patches/glibc/2.9/290-no-inline-gmon.patch
patches/glibc/2.9/300-2.9-check_native-headers.patch
patches/glibc/2.9/310-2.3.6-fix-pr631.patch
patches/glibc/2.9/320-2.9-assume-pipe2.patch
patches/glibc/2.9/330-2.3.3-china.patch
patches/glibc/2.9/340-new-valencian-locale.patch
patches/glibc/2.9/350-2.4-undefine-__i686.patch
patches/glibc/2.9/360-2.8-nscd-one-fork.patch
patches/glibc/2.9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch
patches/glibc/2.9/380-2.3.6-dl_execstack-PaX-support.patch
patches/glibc/2.9/390-2.3.3_pre20040117-pt_pax.patch
patches/glibc/2.9/400-tests-sandbox-libdl-paths.patch
patches/glibc/2.9/410-2.9-fnmatch.patch
patches/glibc/2.9/420-dont-build-timezone.patch
patches/glibc/2.9/430-2.7-cross-compile-nptl.patch
patches/glibc/2.9/440-alpha-glibc-2.4-xstat.patch
patches/glibc/2.9/450-alpha-glibc-2.5-no-page-header.patch
patches/glibc/2.9/460-alpha-glibc-2.5-no-asm-elf-header.patch
patches/glibc/2.9/470-alpha-glibc-2.8-creat.patch
patches/glibc/2.9/480-alpha-glibc-2.8-cache-shape.patch
patches/glibc/2.9/490-ptr-mangling.patch
patches/glibc/2.9/500-ppc-glibc-2.9-atomic.patch
patches/glibc/2.9/510-sh-no-asm-user-header.patch
patches/glibc/2.9/520-sh-no-asm-elf-header.patch
patches/glibc/2.9/530-powerpc-8xx-CPU15-errata.patch
patches/glibc/2_9/100-ssp-compat.patch
patches/glibc/2_9/110-respect-env-CPPFLAGS.patch
patches/glibc/2_9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
patches/glibc/2_9/130-add_prio-macros.patch
patches/glibc/2_9/140-regex-BZ9697.patch
patches/glibc/2_9/150-regex-BZ697.patch
patches/glibc/2_9/160-i386-x86_64-revert-clone-cfi.patch
patches/glibc/2_9/170-2.10-dns-no-gethostbyname4.patch
patches/glibc/2_9/180-math-tests.patch
patches/glibc/2_9/190-queue-header-updates.patch
patches/glibc/2_9/200-awk-in-C-locale.patch
patches/glibc/2_9/210-2.9-strlen-hack.patch
patches/glibc/2_9/220-manual-no-perl.patch
patches/glibc/2_9/230-2.3.3-localedef-fix-trampoline.patch
patches/glibc/2_9/240-i386-LOAD_PIC_REG.patch
patches/glibc/2_9/250-resolv-dynamic.patch
patches/glibc/2_9/260-fadvise64_64.patch
patches/glibc/2_9/270-ldbl-nexttowardf.patch
patches/glibc/2_9/280-section-comments.patch
patches/glibc/2_9/290-no-inline-gmon.patch
patches/glibc/2_9/300-2.9-check_native-headers.patch
patches/glibc/2_9/310-2.3.6-fix-pr631.patch
patches/glibc/2_9/320-2.9-assume-pipe2.patch
patches/glibc/2_9/330-2.3.3-china.patch
patches/glibc/2_9/340-new-valencian-locale.patch
patches/glibc/2_9/350-2.4-undefine-__i686.patch
patches/glibc/2_9/360-2.8-nscd-one-fork.patch
patches/glibc/2_9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch
patches/glibc/2_9/380-2.3.6-dl_execstack-PaX-support.patch
patches/glibc/2_9/390-2.3.3_pre20040117-pt_pax.patch
patches/glibc/2_9/400-tests-sandbox-libdl-paths.patch
patches/glibc/2_9/410-2.9-fnmatch.patch
patches/glibc/2_9/420-dont-build-timezone.patch
patches/glibc/2_9/430-2.7-cross-compile-nptl.patch
patches/glibc/2_9/440-alpha-glibc-2.4-xstat.patch
patches/glibc/2_9/450-alpha-glibc-2.5-no-page-header.patch
patches/glibc/2_9/460-alpha-glibc-2.5-no-asm-elf-header.patch
patches/glibc/2_9/470-alpha-glibc-2.8-creat.patch
patches/glibc/2_9/480-alpha-glibc-2.8-cache-shape.patch
patches/glibc/2_9/490-ptr-mangling.patch
patches/glibc/2_9/500-ppc-glibc-2.9-atomic.patch
patches/glibc/2_9/510-sh-no-asm-user-header.patch
patches/glibc/2_9/520-sh-no-asm-elf-header.patch
patches/glibc/ports-2.9/100-arm_linux_tls.patch
patches/glibc/ports-2_9/100-arm_linux_tls.patch
patches/uClibc/0.9.30.1/140-gnu89-inline.patch
patches/uClibc/0.9.30.1/150-64bit-strtouq.patch
patches/uClibc/0.9.30.1/160-c99-ldbl-math.patch
patches/uClibc/0.9.30.1/170-dl-sysdep-inline.patch
samples/alphaev56-unknown-linux-gnu/crosstool.config
samples/arm-iphone-linux-gnueabi/crosstool.config
samples/arm-unknown-eabi/crosstool.config
samples/arm-unknown-elf/crosstool.config
samples/arm-unknown-linux-gnu/crosstool.config
samples/arm-unknown-linux-gnueabi/crosstool.config
samples/arm-unknown-linux-uclibc/crosstool.config
samples/arm-unknown-linux-uclibc/uClibc-0.9.30.1.config
samples/arm-unknown-linux-uclibc/uClibc-0.9.30.config
samples/arm-unknown-linux-uclibcgnueabi/crosstool.config
samples/arm-unknown-linux-uclibcgnueabi/uClibc-0.9.30.1.config
samples/arm-unknown-linux-uclibcgnueabi/uClibc-0.9.30.config
samples/armeb-unknown-eabi/crosstool.config
samples/armeb-unknown-linux-gnu/crosstool.config
samples/armeb-unknown-linux-gnueabi/crosstool.config
samples/armeb-unknown-linux-uclibc/crosstool.config
samples/armeb-unknown-linux-uclibc/uClibc-0.9.30.1.config
samples/armeb-unknown-linux-uclibc/uClibc-0.9.30.config
samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config
samples/i586-geode-linux-uclibc/crosstool.config
samples/i586-geode-linux-uclibc/uClibc-0.9.30.1.config
samples/i586-geode-linux-uclibc/uClibc-0.9.30.config
samples/i686-nptl-linux-gnu/crosstool.config
samples/ia64-unknown-linux-gnu/crosstool.config
samples/mips-unknown-elf/crosstool.config
samples/mips-unknown-linux-uclibc/crosstool.config
samples/mips-unknown-linux-uclibc/uClibc-0.9.30.1.config
samples/mips-unknown-linux-uclibc/uClibc-0.9.30.config
samples/mipsel-unknown-linux-gnu/crosstool.config
samples/powerpc-405-linux-gnu/crosstool.config
samples/powerpc-860-linux-gnu/crosstool.config
samples/powerpc-e500v2-linux-gnuspe/crosstool.config
samples/powerpc-unknown-linux-gnu/crosstool.config
samples/powerpc-unknown-linux-uclibc/crosstool.config
samples/powerpc-unknown-linux-uclibc/uClibc-0.9.30.1.config
samples/powerpc-unknown-linux-uclibc/uClibc-0.9.30.config
samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config
samples/powerpc64-unknown-linux-gnu/crosstool.config
samples/sh4-unknown-linux-gnu/crosstool.config
samples/x86_64-unknown-linux-gnu/crosstool.config
samples/x86_64-unknown-linux-uclibc/crosstool.config
samples/x86_64-unknown-linux-uclibc/uClibc-0.9.30.1.config
samples/x86_64-unknown-linux-uclibc/uClibc-0.9.30.config
scripts/build/cc/gcc.sh
scripts/build/debug/300-gdb.sh
scripts/build/kernel/linux.sh
scripts/build/libc/uClibc.sh
scripts/build/mpfr.sh
scripts/crosstool-NG.sh.in
scripts/functions
     1.1 --- a/config/cc/gcc.in	Sat Apr 11 19:03:02 2009 +0000
     1.2 +++ b/config/cc/gcc.in	Sun Apr 19 16:17:11 2009 +0000
     1.3 @@ -112,10 +112,39 @@
     1.4      depends on EXPERIMENTAL
     1.5      select CC_GCC_4_3_or_later
     1.6  
     1.7 +config CC_V_4_4_0
     1.8 +    bool
     1.9 +    prompt "4.4.0 snapshot"
    1.10 +    depends on EXPERIMENTAL
    1.11 +    select CC_GCC_4_3_or_later
    1.12 +    select CC_GCC_4_4_snapshot
    1.13 +
    1.14  # CT_INSERT_VERSION_ABOVE
    1.15  # Don't remove above line!
    1.16  endchoice
    1.17  
    1.18 +config CC_GCC_4_3_or_later
    1.19 +    bool
    1.20 +    default n
    1.21 +    select GMP_MPFR
    1.22 +
    1.23 +config CC_GCC_4_4_snapshot
    1.24 +    bool
    1.25 +    default n
    1.26 +
    1.27 +config CC_GCC_4_4_snapshot_date
    1.28 +    string
    1.29 +    prompt "Snapshot date"
    1.30 +    depends on CC_GCC_4_4_snapshot
    1.31 +    help
    1.32 +      Enter the snapshot date in the form YYYYMMDD.
    1.33 +      Snapshots are made every friday, at around 22:30 GMT+1,
    1.34 +      so look at your calendar to find a suitable date.
    1.35 +      
    1.36 +      Also, know that crosstool-NG does *not* carry any patch
    1.37 +      for the gcc-4.4 snapshots. So, you may have to answer
    1.38 +      'y' to CUSTOM_PATCH, and set CUSTOM_PATCH_DIR adequately.
    1.39 +
    1.40  config CC_VERSION
    1.41      string
    1.42      default "3.2.3" if CC_V_3_2_3
    1.43 @@ -138,14 +167,10 @@
    1.44      default "4.3.1" if CC_V_4_3_1
    1.45      default "4.3.2" if CC_V_4_3_2
    1.46      default "4.3.3" if CC_V_4_3_3
    1.47 +    default "4.4-" if CC_V_4_4_0
    1.48  # CT_INSERT_VERSION_STRING_ABOVE
    1.49  # Don't remove above line!
    1.50  
    1.51 -config CC_GCC_4_3_or_later
    1.52 -    bool
    1.53 -    default n
    1.54 -    select GMP_MPFR
    1.55 -
    1.56  config CC_CXA_ATEXIT
    1.57      bool
    1.58      prompt "Use __cxa_atexit"
     2.1 --- a/config/debug/gdb.in	Sat Apr 11 19:03:02 2009 +0000
     2.2 +++ b/config/debug/gdb.in	Sun Apr 19 16:17:11 2009 +0000
     2.3 @@ -150,7 +150,7 @@
     2.4  
     2.5  if GDB_NATIVE
     2.6  
     2.7 -comment "Native gdb needs the ncurses library on the target"
     2.8 +comment "Native gdb needs a native ncurses library"
     2.9  
    2.10  choice
    2.11      bool
     3.1 --- a/config/kernel/linux.in	Sat Apr 11 19:03:02 2009 +0000
     3.2 +++ b/config/kernel/linux.in	Sun Apr 19 16:17:11 2009 +0000
     3.3 @@ -69,41 +69,10 @@
     3.4      prompt "2.6.25.20 (OBSOLETE)"
     3.5      depends on OBSOLETE
     3.6  
     3.7 -config KERNEL_V_2_6_26
     3.8 -    bool
     3.9 -    prompt "2.6.26"
    3.10 -
    3.11 -config KERNEL_V_2_6_26_1
    3.12 -    bool
    3.13 -    prompt "2.6.26.1"
    3.14 -
    3.15 -config KERNEL_V_2_6_26_2
    3.16 -    bool
    3.17 -    prompt "2.6.26.2"
    3.18 -
    3.19 -config KERNEL_V_2_6_26_3
    3.20 -    bool
    3.21 -    prompt "2.6.26.3"
    3.22 -
    3.23 -config KERNEL_V_2_6_26_4
    3.24 -    bool
    3.25 -    prompt "2.6.26.4"
    3.26 -
    3.27 -config KERNEL_V_2_6_26_5
    3.28 -    bool
    3.29 -    prompt "2.6.26.5"
    3.30 -
    3.31 -config KERNEL_V_2_6_26_6
    3.32 -    bool
    3.33 -    prompt "2.6.26.6"
    3.34 -
    3.35 -config KERNEL_V_2_6_26_7
    3.36 -    bool
    3.37 -    prompt "2.6.26.7"
    3.38 -
    3.39  config KERNEL_V_2_6_26_8
    3.40      bool
    3.41 -    prompt "2.6.26.8"
    3.42 +    prompt "2.6.26.8 (OBSOLETE)"
    3.43 +    depends on OBSOLETE
    3.44  
    3.45  config KERNEL_V_2_6_27
    3.46      bool
    3.47 @@ -185,6 +154,14 @@
    3.48      bool
    3.49      prompt "2.6.27.19"
    3.50  
    3.51 +config KERNEL_V_2_6_27_20
    3.52 +    bool
    3.53 +    prompt "2.6.27.20"
    3.54 +
    3.55 +config KERNEL_V_2_6_27_21
    3.56 +    bool
    3.57 +    prompt "2.6.27.21"
    3.58 +
    3.59  config KERNEL_V_2_6_28
    3.60      bool
    3.61      prompt "2.6.28"
    3.62 @@ -217,12 +194,35 @@
    3.63      bool
    3.64      prompt "2.6.28.7"
    3.65  
    3.66 +config KERNEL_V_2_6_28_8
    3.67 +    bool
    3.68 +    prompt "2.6.28.8"
    3.69 +
    3.70 +config KERNEL_V_2_6_28_9
    3.71 +    bool
    3.72 +    prompt "2.6.28.9"
    3.73 +
    3.74 +config KERNEL_V_2_6_29
    3.75 +    bool
    3.76 +    prompt "2.6.29"
    3.77 +
    3.78 +config KERNEL_V_2_6_29_1
    3.79 +    bool
    3.80 +    prompt "2.6.29.1"
    3.81 +
    3.82  # CT_INSERT_VERSION_ABOVE
    3.83  # Don't remove above line!
    3.84 +
    3.85 +config KERNEL_V_select
    3.86 +    bool
    3.87 +    prompt "Other version (EXPERIMENTAL)"
    3.88 +    depends on EXPERIMENTAL
    3.89 +
    3.90  endchoice
    3.91  
    3.92  config KERNEL_VERSION
    3.93      string
    3.94 +    prompt "Kernel version" if KERNEL_V_select
    3.95      default "2.6.18.8" if KERNEL_V_2_6_18_8
    3.96      default "2.6.19.7" if KERNEL_V_2_6_19_7
    3.97      default "2.6.20.21" if KERNEL_V_2_6_20_21
    3.98 @@ -231,14 +231,6 @@
    3.99      default "2.6.23.17" if KERNEL_V_2_6_23_17
   3.100      default "2.6.24.7" if KERNEL_V_2_6_24_7
   3.101      default "2.6.25.20" if KERNEL_V_2_6_25_20
   3.102 -    default "2.6.26" if KERNEL_V_2_6_26
   3.103 -    default "2.6.26.1" if KERNEL_V_2_6_26_1
   3.104 -    default "2.6.26.2" if KERNEL_V_2_6_26_2
   3.105 -    default "2.6.26.3" if KERNEL_V_2_6_26_3
   3.106 -    default "2.6.26.4" if KERNEL_V_2_6_26_4
   3.107 -    default "2.6.26.5" if KERNEL_V_2_6_26_5
   3.108 -    default "2.6.26.6" if KERNEL_V_2_6_26_6
   3.109 -    default "2.6.26.7" if KERNEL_V_2_6_26_7
   3.110      default "2.6.26.8" if KERNEL_V_2_6_26_8
   3.111      default "2.6.27" if KERNEL_V_2_6_27
   3.112      default "2.6.27.1" if KERNEL_V_2_6_27_1
   3.113 @@ -260,6 +252,8 @@
   3.114      default "2.6.27.17" if KERNEL_V_2_6_27_17
   3.115      default "2.6.27.18" if KERNEL_V_2_6_27_18
   3.116      default "2.6.27.19" if KERNEL_V_2_6_27_19
   3.117 +    default "2.6.27.20" if KERNEL_V_2_6_27_20
   3.118 +    default "2.6.27.21" if KERNEL_V_2_6_27_21
   3.119      default "2.6.28" if KERNEL_V_2_6_28
   3.120      default "2.6.28.1" if KERNEL_V_2_6_28_1
   3.121      default "2.6.28.2" if KERNEL_V_2_6_28_2
   3.122 @@ -268,8 +262,19 @@
   3.123      default "2.6.28.5" if KERNEL_V_2_6_28_5
   3.124      default "2.6.28.6" if KERNEL_V_2_6_28_6
   3.125      default "2.6.28.7" if KERNEL_V_2_6_28_7
   3.126 +    default "2.6.28.8" if KERNEL_V_2_6_28_8
   3.127 +    default "2.6.28.9" if KERNEL_V_2_6_28_9
   3.128 +    default "2.6.29" if KERNEL_V_2_6_29
   3.129 +    default "2.6.29.1" if KERNEL_V_2_6_29_1
   3.130  # CT_INSERT_VERSION_STRING_ABOVE
   3.131  # Don't remove above line!
   3.132 +    help
   3.133 +      Enter here the kernel version you want to use, if it is
   3.134 +      not listed above. Something like V.P.S or V.P.S.E, where:
   3.135 +        V: VERSION
   3.136 +        P: PATCHLEVEL
   3.137 +        S: SUBLEVEL
   3.138 +        E: EXTRAVERSION
   3.139  
   3.140  choice
   3.141      bool
     4.1 --- a/configure	Sat Apr 11 19:03:02 2009 +0000
     4.2 +++ b/configure	Sun Apr 19 16:17:11 2009 +0000
     4.3 @@ -143,7 +143,7 @@
     4.4              echo
     4.5          done
     4.6          echo "Either you are missing entirely the needed tool,"
     4.7 -        echo "or the version you have is tool old."
     4.8 +        echo "or the version you have is too old."
     4.9          if [ -n "${var_name}" ]; then
    4.10              echo "You can give the path to this tool using: --with-${var_name}=PATH"
    4.11          fi
    4.12 @@ -294,7 +294,7 @@
    4.13  fi
    4.14  if [ -z "${grep}" ]; then
    4.15      echo "Either you are missing entirely the needed tool,"
    4.16 -    echo "or the version you have is tool old."
    4.17 +    echo "or the version you have is too old."
    4.18      echo "You can give the path to this tool using: --with-grep=PATH"
    4.19      do_error "Bailing out..."
    4.20  fi
    4.21 @@ -308,7 +308,7 @@
    4.22          echo "not found"
    4.23      else
    4.24          echo "${sed}"
    4.25 -        printf "Checking wether '${sed}' supports -i and -e... "
    4.26 +        printf "Checking whether '${sed}' supports -i and -e... "
    4.27          touch .ct-ng.sed.test
    4.28          if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
    4.29              echo "yes"
    4.30 @@ -321,7 +321,7 @@
    4.31  fi
    4.32  if [ -z "${sed}" ]; then
    4.33      echo "Either you are missing entirely the needed tool,"
    4.34 -    echo "or the version you have is tool old."
    4.35 +    echo "or the version you have is too old."
    4.36      echo "You can give the path to this tool using: --with-sed=PATH"
    4.37      do_error "Bailing out..."
    4.38  fi
     5.1 --- a/docs/known-issues.txt	Sat Apr 11 19:03:02 2009 +0000
     5.2 +++ b/docs/known-issues.txt	Sun Apr 19 16:17:11 2009 +0000
     5.3 @@ -75,7 +75,7 @@
     5.4  
     5.5  --------------------------------
     5.6  Symptoms:
     5.7 -  The extract and/or path steps fail under cygwin.
     5.8 +  The extract and/or path steps fail under Cygwin.
     5.9  
    5.10  Explanations:
    5.11    This is not related to crosstool-NG. Mounts under Cygwin are by default not
    5.12 @@ -90,3 +90,17 @@
    5.13    None.
    5.14  
    5.15  --------------------------------
    5.16 +Symptoms:
    5.17 +  uClibc fails to build under Cygwin.
    5.18 +
    5.19 +Explanations:
    5.20 +  With uClibc, it is possible to build a cross-ldd. Unfortunately, it is
    5.21 +  not (currently) possible to build this cross-ldd under Cygwin.
    5.22 +
    5.23 +Fix:
    5.24 +  None so far.
    5.25 +
    5.26 +Workaround:
    5.27 +  Disable the cross-ldd build.
    5.28 +
    5.29 +--------------------------------
     6.1 --- a/docs/overview.txt	Sat Apr 11 19:03:02 2009 +0000
     6.2 +++ b/docs/overview.txt	Sun Apr 19 16:17:11 2009 +0000
     6.3 @@ -168,7 +168,7 @@
     6.4  
     6.5    ./configure --prefix=/usr
     6.6    make
     6.7 -  make DESDTDIR=/packaging/place install
     6.8 +  make DESTDIR=/packaging/place install
     6.9  
    6.10  Shell completion |
    6.11  -----------------+
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/patches/gcc/4.2.1/300-libstdc++-nostdlib-linking.patch	Sun Apr 19 16:17:11 2009 +0000
     7.3 @@ -0,0 +1,21 @@
     7.4 +On 20090401, Ted Jordan writes:
     7.5 + The generated libtool for building libstdc++ adds the -nostdlib option to the
     7.6 + g++ command for linking but doesn't add -lgcc.  This causes a "hidden symbol"
     7.7 + error when linking against the libstdc++ shared object.  This patch adds gcc
     7.8 + to the list of libraries linked against when linking libstdc++.
     7.9 +
    7.10 +Index: gcc-4.2.1/ltcf-cxx.sh
    7.11 +===================================================================
    7.12 +--- gcc-4.2.1.orig/ltcf-cxx.sh	2005-07-15 21:30:53.000000000 -0500
    7.13 ++++ gcc-4.2.1/ltcf-cxx.sh	2009-04-02 09:30:34.000000000 -0500
    7.14 +@@ -78,8 +78,8 @@
    7.15 +   # to be the same.
    7.16 + 
    7.17 +   if test "$with_gnu_ld" = yes; then
    7.18 +-    archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
    7.19 +-    archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    7.20 ++    archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -lgcc ${wl}-soname $wl$soname -o $lib'
    7.21 ++    archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -lgcc ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    7.22 + 
    7.23 +     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
    7.24 +     export_dynamic_flag_spec='${wl}--export-dynamic'
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/patches/glibc/2.9/100-ssp-compat.patch	Sun Apr 19 16:17:11 2009 +0000
     8.3 @@ -0,0 +1,193 @@
     8.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0010_all_glibc-2.7-ssp-compat.patch
     8.5 +
     8.6 +-= BEGIN original header =-
     8.7 +Add backwards compat support for gcc-3.x ssp ... older ssp versions
     8.8 +used __guard and __stack_smash_handler symbols while gcc-4.1 and newer
     8.9 +uses __stack_chk_guard and __stack_chk_fail.
    8.10 +
    8.11 +-= END original header =-
    8.12 +
    8.13 +diff -durN glibc-2_9.orig/Versions.def glibc-2_9/Versions.def
    8.14 +--- glibc-2_9.orig/Versions.def	2008-08-01 19:13:40.000000000 +0200
    8.15 ++++ glibc-2_9/Versions.def	2009-02-02 22:00:33.000000000 +0100
    8.16 +@@ -113,6 +113,9 @@
    8.17 +   GLIBC_2.0
    8.18 +   GLIBC_2.1
    8.19 +   GLIBC_2.3
    8.20 ++%ifdef ENABLE_OLD_SSP_COMPAT
    8.21 ++  GLIBC_2.3.2
    8.22 ++%endif
    8.23 +   GLIBC_2.4
    8.24 +   GLIBC_PRIVATE
    8.25 + }
    8.26 +diff -durN glibc-2_9.orig/config.h.in glibc-2_9/config.h.in
    8.27 +--- glibc-2_9.orig/config.h.in	2007-03-26 22:40:08.000000000 +0200
    8.28 ++++ glibc-2_9/config.h.in	2009-02-02 22:00:32.000000000 +0100
    8.29 +@@ -42,6 +42,9 @@
    8.30 +    assembler instructions per line.  Default is `;'  */
    8.31 + #undef ASM_LINE_SEP
    8.32 + 
    8.33 ++/* Define if we want to enable support for old ssp symbols */
    8.34 ++#undef	ENABLE_OLD_SSP_COMPAT
    8.35 ++
    8.36 + /* Define if not using ELF, but `.init' and `.fini' sections are available.  */
    8.37 + #undef	HAVE_INITFINI
    8.38 + 
    8.39 +diff -durN glibc-2_9.orig/configure glibc-2_9/configure
    8.40 +--- glibc-2_9.orig/configure	2008-11-11 10:50:11.000000000 +0100
    8.41 ++++ glibc-2_9/configure	2009-02-02 22:00:32.000000000 +0100
    8.42 +@@ -1380,6 +1380,9 @@
    8.43 +   --enable-kernel=VERSION compile for compatibility with kernel not older than
    8.44 +                           VERSION
    8.45 +   --enable-all-warnings   enable all useful warnings gcc can issue
    8.46 ++  --disable-old-ssp-compat
    8.47 ++                          enable support for older ssp symbols
    8.48 ++                          [default=no]
    8.49 + 
    8.50 + Optional Packages:
    8.51 +   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    8.52 +@@ -6470,6 +6473,20 @@
    8.53 + echo "${ECHO_T}$libc_cv_ssp" >&6; }
    8.54 + 
    8.55 + 
    8.56 ++# Check whether --enable-old-ssp-compat or --disable-old-ssp-compat was given.
    8.57 ++if test "${enable_old_ssp_compat+set}" = set; then
    8.58 ++  enableval="$enable_old_ssp_compat"
    8.59 ++  enable_old_ssp_compat=$enableval
    8.60 ++else
    8.61 ++  enable_old_ssp_compat=no
    8.62 ++fi;
    8.63 ++if test "x$enable_old_ssp_compat" = "xyes"; then
    8.64 ++  cat >>confdefs.h <<\_ACEOF
    8.65 ++#define ENABLE_OLD_SSP_COMPAT 1
    8.66 ++_ACEOF
    8.67 ++
    8.68 ++fi
    8.69 ++
    8.70 + { echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5
    8.71 + echo $ECHO_N "checking for -fgnu89-inline... $ECHO_C" >&6; }
    8.72 + if test "${libc_cv_gnu89_inline+set}" = set; then
    8.73 +diff -durN glibc-2_9.orig/configure.in glibc-2_9/configure.in
    8.74 +--- glibc-2_9.orig/configure.in	2008-11-11 10:50:11.000000000 +0100
    8.75 ++++ glibc-2_9/configure.in	2009-02-02 22:00:32.000000000 +0100
    8.76 +@@ -1647,6 +1647,15 @@
    8.77 + rm -f conftest*])
    8.78 + AC_SUBST(libc_cv_ssp)
    8.79 + 
    8.80 ++AC_ARG_ENABLE([old-ssp-compat],
    8.81 ++	      AC_HELP_STRING([--enable-old-ssp-compat],
    8.82 ++	                     [enable support for older ssp symbols @<:@default=no@:>@]),
    8.83 ++	      [enable_old_ssp_compat=$enableval],
    8.84 ++	      [enable_old_ssp_compat=no])
    8.85 ++if test "x$enable_old_ssp_compat" = "xyes"; then
    8.86 ++  AC_DEFINE(ENABLE_OLD_SSP_COMPAT)
    8.87 ++fi
    8.88 ++
    8.89 + AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
    8.90 + cat > conftest.c <<EOF
    8.91 + int foo;
    8.92 +diff -durN glibc-2_9.orig/csu/Versions glibc-2_9/csu/Versions
    8.93 +--- glibc-2_9.orig/csu/Versions	2006-10-28 01:11:41.000000000 +0200
    8.94 ++++ glibc-2_9/csu/Versions	2009-02-02 22:00:32.000000000 +0100
    8.95 +@@ -17,6 +17,12 @@
    8.96 +     # New special glibc functions.
    8.97 +     gnu_get_libc_release; gnu_get_libc_version;
    8.98 +   }
    8.99 ++  GLIBC_2.3.2 {
   8.100 ++%ifdef ENABLE_OLD_SSP_COMPAT
   8.101 ++    # global objects and functions for the old propolice patch in gcc
   8.102 ++    __guard;
   8.103 ++%endif
   8.104 ++  }
   8.105 +   GLIBC_PRIVATE {
   8.106 + %if HAVE___THREAD
   8.107 +     # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
   8.108 +diff -durN glibc-2_9.orig/csu/libc-start.c glibc-2_9/csu/libc-start.c
   8.109 +--- glibc-2_9.orig/csu/libc-start.c	2007-08-21 00:27:50.000000000 +0200
   8.110 ++++ glibc-2_9/csu/libc-start.c	2009-02-02 22:00:32.000000000 +0100
   8.111 +@@ -37,6 +37,9 @@
   8.112 + uintptr_t __stack_chk_guard attribute_relro;
   8.113 + # endif
   8.114 + #endif
   8.115 ++#ifdef ENABLE_OLD_SSP_COMPAT
   8.116 ++uintptr_t __guard attribute_relro;
   8.117 ++#endif
   8.118 + 
   8.119 + #ifdef HAVE_PTR_NTHREADS
   8.120 + /* We need atomic operations.  */
   8.121 +@@ -141,6 +144,9 @@
   8.122 + 
   8.123 +   /* Set up the stack checker's canary.  */
   8.124 +   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
   8.125 ++#ifdef ENABLE_OLD_SSP_COMPAT
   8.126 ++  __guard = stack_chk_guard;
   8.127 ++#endif
   8.128 + # ifdef THREAD_SET_STACK_GUARD
   8.129 +   THREAD_SET_STACK_GUARD (stack_chk_guard);
   8.130 + # else
   8.131 +diff -durN glibc-2_9.orig/debug/Versions glibc-2_9/debug/Versions
   8.132 +--- glibc-2_9.orig/debug/Versions	2008-03-05 07:53:41.000000000 +0100
   8.133 ++++ glibc-2_9/debug/Versions	2009-02-02 22:00:32.000000000 +0100
   8.134 +@@ -10,6 +10,12 @@
   8.135 +     # These are to support some gcc features.
   8.136 +     __cyg_profile_func_enter; __cyg_profile_func_exit;
   8.137 +   }
   8.138 ++%ifdef ENABLE_OLD_SSP_COMPAT
   8.139 ++  GLIBC_2.3.2 {
   8.140 ++    # backwards ssp compat support; alias to __stack_chk_fail
   8.141 ++    __stack_smash_handler;
   8.142 ++  }
   8.143 ++%endif
   8.144 +   GLIBC_2.3.4 {
   8.145 +     __chk_fail;
   8.146 +     __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk; __stpcpy_chk;
   8.147 +diff -durN glibc-2_9.orig/debug/stack_chk_fail.c glibc-2_9/debug/stack_chk_fail.c
   8.148 +--- glibc-2_9.orig/debug/stack_chk_fail.c	2007-05-25 01:47:08.000000000 +0200
   8.149 ++++ glibc-2_9/debug/stack_chk_fail.c	2009-02-02 22:00:32.000000000 +0100
   8.150 +@@ -28,3 +28,7 @@
   8.151 + {
   8.152 +   __fortify_fail ("stack smashing detected");
   8.153 + }
   8.154 ++
   8.155 ++#ifdef ENABLE_OLD_SSP_COMPAT
   8.156 ++strong_alias (__stack_chk_fail, __stack_smash_handler)
   8.157 ++#endif
   8.158 +diff -durN glibc-2_9.orig/elf/Versions glibc-2_9/elf/Versions
   8.159 +--- glibc-2_9.orig/elf/Versions	2008-03-08 06:42:26.000000000 +0100
   8.160 ++++ glibc-2_9/elf/Versions	2009-02-02 22:00:33.000000000 +0100
   8.161 +@@ -43,6 +43,12 @@
   8.162 +     # runtime interface to TLS
   8.163 +     __tls_get_addr;
   8.164 +   }
   8.165 ++%ifdef ENABLE_OLD_SSP_COMPAT
   8.166 ++  GLIBC_2.3.2 {
   8.167 ++    # backwards ssp compat support
   8.168 ++    __guard;
   8.169 ++  }
   8.170 ++%endif
   8.171 +   GLIBC_2.4 {
   8.172 +     # stack canary
   8.173 +     __stack_chk_guard;
   8.174 +diff -durN glibc-2_9.orig/elf/rtld.c glibc-2_9/elf/rtld.c
   8.175 +--- glibc-2_9.orig/elf/rtld.c	2008-08-14 19:01:56.000000000 +0200
   8.176 ++++ glibc-2_9/elf/rtld.c	2009-02-02 22:00:32.000000000 +0100
   8.177 +@@ -89,6 +89,9 @@
   8.178 +    in thread local area.  */
   8.179 + uintptr_t __stack_chk_guard attribute_relro;
   8.180 + #endif
   8.181 ++#ifdef ENABLE_OLD_SSP_COMPAT
   8.182 ++uintptr_t __guard attribute_relro;
   8.183 ++#endif
   8.184 + 
   8.185 + /* Only exported for architectures that don't store the pointer guard
   8.186 +    value in thread local area.  */
   8.187 +@@ -842,6 +845,9 @@
   8.188 + {
   8.189 +   /* Set up the stack checker's canary.  */
   8.190 +   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
   8.191 ++#ifdef ENABLE_OLD_SSP_COMPAT
   8.192 ++  __guard = stack_chk_guard;
   8.193 ++#endif
   8.194 + #ifdef THREAD_SET_STACK_GUARD
   8.195 +   THREAD_SET_STACK_GUARD (stack_chk_guard);
   8.196 + #else
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/patches/glibc/2.9/110-respect-env-CPPFLAGS.patch	Sun Apr 19 16:17:11 2009 +0000
     9.3 @@ -0,0 +1,30 @@
     9.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0030_all_glibc-respect-env-CPPFLAGS.patch
     9.5 +
     9.6 +-= BEGIN original header =-
     9.7 +Respect environment CPPFLAGS when we run ./configure so we can inject
     9.8 +random -D things without having to set CFLAGS/ASFLAGS
     9.9 +
    9.10 +-= END original header =-
    9.11 +
    9.12 +diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
    9.13 +--- glibc-2_9.orig/Makeconfig	2008-08-18 11:42:17.000000000 +0200
    9.14 ++++ glibc-2_9/Makeconfig	2009-02-02 22:00:35.000000000 +0100
    9.15 +@@ -673,6 +673,7 @@
    9.16 + 	   $(foreach lib,$(libof-$(basename $(@F))) \
    9.17 + 		         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
    9.18 + 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
    9.19 ++CPPFLAGS += $(CPPFLAGS-config)
    9.20 + override CFLAGS	= -std=gnu99 $(gnu89-inline-CFLAGS) \
    9.21 + 		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
    9.22 + 		  $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
    9.23 +diff -durN glibc-2_9.orig/config.make.in glibc-2_9/config.make.in
    9.24 +--- glibc-2_9.orig/config.make.in	2008-08-18 11:42:17.000000000 +0200
    9.25 ++++ glibc-2_9/config.make.in	2009-02-02 22:00:35.000000000 +0100
    9.26 +@@ -97,6 +97,7 @@
    9.27 + CXX = @CXX@
    9.28 + BUILD_CC = @BUILD_CC@
    9.29 + CFLAGS = @CFLAGS@
    9.30 ++CPPFLAGS-config = @CPPFLAGS@
    9.31 + ASFLAGS-config = @ASFLAGS_config@
    9.32 + AR = @AR@
    9.33 + RANLIB = @RANLIB@
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/patches/glibc/2.9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch	Sun Apr 19 16:17:11 2009 +0000
    10.3 @@ -0,0 +1,35 @@
    10.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
    10.5 +
    10.6 +-= BEGIN original header =-
    10.7 +http://sourceware.org/ml/libc-alpha/2009-01/msg00000.html
    10.8 +
    10.9 +From 8ad7030880eaa18dcabf8e284e79026301fd3fa4 Mon Sep 17 00:00:00 2001
   10.10 +From: Ulrich Drepper <drepper@redhat.com>
   10.11 +Date: Thu, 8 Jan 2009 00:02:38 +0000
   10.12 +Subject: [PATCH] (_nss_dns_gethostbyaddr2_r): Check and adjust the buffer alignment.
   10.13 +
   10.14 +-= END original header =-
   10.15 +
   10.16 +diff -durN glibc-2_9.orig/resolv/nss_dns/dns-host.c glibc-2_9/resolv/nss_dns/dns-host.c
   10.17 +--- glibc-2_9.orig/resolv/nss_dns/dns-host.c	2008-11-12 08:52:20.000000000 +0100
   10.18 ++++ glibc-2_9/resolv/nss_dns/dns-host.c	2009-02-02 22:00:36.000000000 +0100
   10.19 +@@ -364,6 +364,19 @@
   10.20 +   int n, status;
   10.21 +   int olderr = errno;
   10.22 + 
   10.23 ++ uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
   10.24 ++ buffer += pad;
   10.25 ++ buflen = buflen > pad ? buflen - pad : 0;
   10.26 ++
   10.27 ++ if (__builtin_expect (buflen < sizeof (struct host_data), 0))
   10.28 ++   {
   10.29 ++     *errnop = ERANGE;
   10.30 ++     *h_errnop = NETDB_INTERNAL;
   10.31 ++     return NSS_STATUS_TRYAGAIN;
   10.32 ++   }
   10.33 ++
   10.34 ++ host_data = (struct host_data *) buffer;
   10.35 ++
   10.36 +   if (__res_maybe_init (&_res, 0) == -1)
   10.37 +     return NSS_STATUS_UNAVAIL;
   10.38 + 
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/patches/glibc/2.9/130-add_prio-macros.patch	Sun Apr 19 16:17:11 2009 +0000
    11.3 @@ -0,0 +1,26 @@
    11.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0051_all_glibc-2.9-add_prio-macros.patch
    11.5 +
    11.6 +-= BEGIN original header =-
    11.7 +http://sourceware.org/ml/libc-alpha/2009-01/msg00003.html
    11.8 +
    11.9 +From a1737958e074e8f990760acc8abeb0c23715a859 Mon Sep 17 00:00:00 2001
   11.10 +From: Roland McGrath <roland@gnu.org>
   11.11 +Date: Sat, 3 Jan 2009 21:04:01 +0000
   11.12 +Subject: [PATCH] 2009-01-03  Samuel Thibault  <samuel.thibault@ens-lyon.org>
   11.13 +
   11.14 +	* bits/resource.h (PRIO_PROCESS, PRIO_PGRP, PRIO_USER): Add macros.
   11.15 +-= END original header =-
   11.16 +
   11.17 +diff -durN glibc-2_9.orig/bits/resource.h glibc-2_9/bits/resource.h
   11.18 +--- glibc-2_9.orig/bits/resource.h	2006-03-05 23:48:10.000000000 +0100
   11.19 ++++ glibc-2_9/bits/resource.h	2009-02-02 22:00:38.000000000 +0100
   11.20 +@@ -185,6 +185,9 @@
   11.21 + enum __priority_which
   11.22 +   {
   11.23 +     PRIO_PROCESS = 0,           /* WHO is a process ID.  */
   11.24 ++#define PRIO_PROCESS PRIO_PROCESS
   11.25 +     PRIO_PGRP = 1,              /* WHO is a process group ID.  */
   11.26 ++#define PRIO_PGRP PRIO_PGRP
   11.27 +     PRIO_USER = 2               /* WHO is a user ID.  */
   11.28 ++#define PRIO_USER PRIO_USER
   11.29 +   };
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/patches/glibc/2.9/140-regex-BZ9697.patch	Sun Apr 19 16:17:11 2009 +0000
    12.3 @@ -0,0 +1,111 @@
    12.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0052_all_glibc-2.9-regex-BZ9697.patch
    12.5 +
    12.6 +-= BEGIN original header =-
    12.7 +http://sourceware.org/ml/libc-alpha/2009-01/msg00005.html
    12.8 +
    12.9 +From ea8ca0dfcbf2721bcf2c08ce3c01d5764b827572 Mon Sep 17 00:00:00 2001
   12.10 +From: Ulrich Drepper <drepper@redhat.com>
   12.11 +Date: Thu, 8 Jan 2009 00:42:28 +0000
   12.12 +Subject: [PATCH] (re_compile_fastmap_iter): Rewrite COMPLEX_BRACKET handling.
   12.13 +
   12.14 +-= END original header =-
   12.15 +
   12.16 +diff -durN glibc-2_9.orig/posix/regcomp.c glibc-2_9/posix/regcomp.c
   12.17 +--- glibc-2_9.orig/posix/regcomp.c	2008-05-15 05:07:21.000000000 +0200
   12.18 ++++ glibc-2_9/posix/regcomp.c	2009-02-02 22:00:41.000000000 +0100
   12.19 +@@ -350,47 +350,67 @@
   12.20 + #ifdef RE_ENABLE_I18N
   12.21 +       else if (type == COMPLEX_BRACKET)
   12.22 + 	{
   12.23 +-	  int i;
   12.24 + 	  re_charset_t *cset = dfa->nodes[node].opr.mbcset;
   12.25 +-	  if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes
   12.26 +-	      || cset->nranges || cset->nchar_classes)
   12.27 +-	    {
   12.28 ++	  int i;
   12.29 ++
   12.30 + # ifdef _LIBC
   12.31 +-	      if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0)
   12.32 ++	  /* See if we have to try all bytes which start multiple collation
   12.33 ++	     elements.
   12.34 ++	     e.g. In da_DK, we want to catch 'a' since "aa" is a valid
   12.35 ++		  collation element, and don't catch 'b' since 'b' is
   12.36 ++		  the only collation element which starts from 'b' (and
   12.37 ++		  it is caught by SIMPLE_BRACKET).  */
   12.38 ++	      if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
   12.39 ++		  && (cset->ncoll_syms || cset->nranges))
   12.40 + 		{
   12.41 +-		  /* In this case we want to catch the bytes which are
   12.42 +-		     the first byte of any collation elements.
   12.43 +-		     e.g. In da_DK, we want to catch 'a' since "aa"
   12.44 +-			  is a valid collation element, and don't catch
   12.45 +-			  'b' since 'b' is the only collation element
   12.46 +-			  which starts from 'b'.  */
   12.47 + 		  const int32_t *table = (const int32_t *)
   12.48 + 		    _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
   12.49 + 		  for (i = 0; i < SBC_MAX; ++i)
   12.50 + 		    if (table[i] < 0)
   12.51 + 		      re_set_fastmap (fastmap, icase, i);
   12.52 + 		}
   12.53 +-# else
   12.54 +-	      if (dfa->mb_cur_max > 1)
   12.55 +-		for (i = 0; i < SBC_MAX; ++i)
   12.56 +-		  if (__btowc (i) == WEOF)
   12.57 +-		    re_set_fastmap (fastmap, icase, i);
   12.58 +-# endif /* not _LIBC */
   12.59 +-	    }
   12.60 +-	  for (i = 0; i < cset->nmbchars; ++i)
   12.61 ++# endif /* _LIBC */
   12.62 ++
   12.63 ++	  /* See if we have to start the match at all multibyte characters,
   12.64 ++	     i.e. where we would not find an invalid sequence.  This only
   12.65 ++	     applies to multibyte character sets; for single byte character
   12.66 ++	     sets, the SIMPLE_BRACKET again suffices.  */
   12.67 ++	  if (dfa->mb_cur_max > 1
   12.68 ++	      && (cset->nchar_classes || cset->non_match
   12.69 ++# ifdef _LIBC
   12.70 ++		  || cset->nequiv_classes
   12.71 ++# endif /* _LIBC */
   12.72 ++		 ))
   12.73 + 	    {
   12.74 +-	      char buf[256];
   12.75 +-	      mbstate_t state;
   12.76 +-	      memset (&state, '\0', sizeof (state));
   12.77 +-	      if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
   12.78 +-		re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
   12.79 +-	      if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
   12.80 ++	      unsigned char c = 0;
   12.81 ++	      do
   12.82 + 		{
   12.83 +-		  if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
   12.84 +-		      != (size_t) -1)
   12.85 +-		    re_set_fastmap (fastmap, 0, *(unsigned char *) buf);
   12.86 ++		  mbstate_t mbs;
   12.87 ++		  memset (&mbs, 0, sizeof (mbs));
   12.88 ++		  if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2)
   12.89 ++		    re_set_fastmap (fastmap, false, (int) c);
   12.90 + 		}
   12.91 ++	      while (++c != 0);
   12.92 + 	    }
   12.93 ++
   12.94 ++	  else
   12.95 ++	    {
   12.96 ++	      /* ... Else catch all bytes which can start the mbchars.  */
   12.97 ++	      for (i = 0; i < cset->nmbchars; ++i)
   12.98 ++		{
   12.99 ++		  char buf[256];
  12.100 ++		  mbstate_t state;
  12.101 ++		  memset (&state, '\0', sizeof (state));
  12.102 ++		  if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
  12.103 ++		    re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
  12.104 ++		  if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
  12.105 ++		    {
  12.106 ++		      if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
  12.107 ++			  != (size_t) -1)
  12.108 ++			re_set_fastmap (fastmap, false, *(unsigned char *) buf);
  12.109 ++		    }
  12.110 ++ 		}
  12.111 ++ 	    }
  12.112 + 	}
  12.113 + #endif /* RE_ENABLE_I18N */
  12.114 +       else if (type == OP_PERIOD
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/patches/glibc/2.9/150-regex-BZ697.patch	Sun Apr 19 16:17:11 2009 +0000
    13.3 @@ -0,0 +1,28 @@
    13.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0053_all_glibc-2.9-regex-BZ697.patch
    13.5 +
    13.6 +-= BEGIN original header =-
    13.7 +http://sourceware.org/ml/libc-alpha/2009-01/msg00006.html
    13.8 +
    13.9 +From 37bdc055ceeb6b1144c07448a7210d9ab3fbb2f5 Mon Sep 17 00:00:00 2001
   13.10 +From: Ulrich Drepper <drepper@redhat.com>
   13.11 +Date: Thu, 8 Jan 2009 00:47:05 +0000
   13.12 +Subject: [PATCH] (prune_impossible_nodes): Handle sifted_states[0] being NULL also if
   13.13 + there are no backreferences.
   13.14 +
   13.15 +-= END original header =-
   13.16 +
   13.17 +diff -durN glibc-2_9.orig/posix/regexec.c glibc-2_9/posix/regexec.c
   13.18 +--- glibc-2_9.orig/posix/regexec.c	2007-10-12 19:47:13.000000000 +0200
   13.19 ++++ glibc-2_9/posix/regexec.c	2009-02-02 22:00:43.000000000 +0100
   13.20 +@@ -1004,6 +1004,11 @@
   13.21 +       re_node_set_free (&sctx.limits);
   13.22 +       if (BE (ret != REG_NOERROR, 0))
   13.23 + 	goto free_return;
   13.24 ++      if (sifted_states[0] == NULL)
   13.25 ++	{
   13.26 ++	  ret = REG_NOMATCH;
   13.27 ++	  goto free_return;
   13.28 ++	}
   13.29 +     }
   13.30 +   re_free (mctx->state_log);
   13.31 +   mctx->state_log = sifted_states;
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/patches/glibc/2.9/160-i386-x86_64-revert-clone-cfi.patch	Sun Apr 19 16:17:11 2009 +0000
    14.3 @@ -0,0 +1,53 @@
    14.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0070_all_glibc-i386-x86_64-revert-clone-cfi.patch
    14.5 +
    14.6 +-= BEGIN original header =-
    14.7 +revert cfi additions to clone on i386/x86_64 to workaround problems in
    14.8 +gcc's unwinder code.  this is not a bug in glibc, it triggers problems
    14.9 +elsewhere.  this cfi code does not gain us a whole lot anyways.
   14.10 +
   14.11 +http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
   14.12 +
   14.13 +-= END original header =-
   14.14 +
   14.15 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2_9/sysdeps/unix/sysv/linux/i386/clone.S
   14.16 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/i386/clone.S	2006-12-04 00:12:36.000000000 +0100
   14.17 ++++ glibc-2_9/sysdeps/unix/sysv/linux/i386/clone.S	2009-02-02 22:00:45.000000000 +0100
   14.18 +@@ -120,9 +120,6 @@
   14.19 + 	ret
   14.20 + 
   14.21 + L(thread_start):
   14.22 +-	cfi_startproc;
   14.23 +-	/* Clearing frame pointer is insufficient, use CFI.  */
   14.24 +-	cfi_undefined (eip);
   14.25 + 	/* Note: %esi is zero.  */
   14.26 + 	movl	%esi,%ebp	/* terminate the stack frame */
   14.27 + #ifdef RESET_PID
   14.28 +@@ -155,7 +152,6 @@
   14.29 + 	jmp	L(haspid)
   14.30 + 	.previous
   14.31 + #endif
   14.32 +-	cfi_endproc;
   14.33 + 
   14.34 + 	cfi_startproc
   14.35 + PSEUDO_END (BP_SYM (__clone))
   14.36 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/x86_64/clone.S glibc-2_9/sysdeps/unix/sysv/linux/x86_64/clone.S
   14.37 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/x86_64/clone.S	2006-12-04 00:12:36.000000000 +0100
   14.38 ++++ glibc-2_9/sysdeps/unix/sysv/linux/x86_64/clone.S	2009-02-02 22:00:45.000000000 +0100
   14.39 +@@ -89,9 +89,6 @@
   14.40 + 	ret
   14.41 + 
   14.42 + L(thread_start):
   14.43 +-	cfi_startproc;
   14.44 +-	/* Clearing frame pointer is insufficient, use CFI.  */
   14.45 +-	cfi_undefined (rip);
   14.46 + 	/* Clear the frame pointer.  The ABI suggests this be done, to mark
   14.47 + 	   the outermost frame obviously.  */
   14.48 + 	xorl	%ebp, %ebp
   14.49 +@@ -116,7 +113,6 @@
   14.50 + 	/* Call exit with return value from function call. */
   14.51 + 	movq	%rax, %rdi
   14.52 + 	call	HIDDEN_JUMPTARGET (_exit)
   14.53 +-	cfi_endproc;
   14.54 + 
   14.55 + 	cfi_startproc;
   14.56 + PSEUDO_END (BP_SYM (__clone))
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/patches/glibc/2.9/170-2.10-dns-no-gethostbyname4.patch	Sun Apr 19 16:17:11 2009 +0000
    15.3 @@ -0,0 +1,35 @@
    15.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0080_all_glibc-2.10-dns-no-gethostbyname4.patch
    15.5 +
    15.6 +-= BEGIN original header =-
    15.7 +http://sourceware.org/bugzilla/show_bug.cgi?id=7060
    15.8 +http://bugs.gentoo.org/250468
    15.9 +
   15.10 +The gethostbyname4() lookup method is problematic since it fires out both
   15.11 +the A and AAAA DNS queries in parallel and over the same socket. This
   15.12 +should work in theory, but it turns out that many cheap DSL modems and
   15.13 +similar devices have buggy DNS servers - if the AAAA query arrives too
   15.14 +quickly after the A query, the server will generate only a single reply
   15.15 +with the A query id but returning an error for the AAAA query; we get
   15.16 +stuck waiting for the second reply.
   15.17 +
   15.18 +For gethostbyname4() users affected, disabling IPv6 in the system might
   15.19 +work around the issue, unfortunately it only helps with applications
   15.20 +using AI_ADDRCONFIG (e.g. Firefox); some (notably e.g. Pidgin) neglect
   15.21 +to do that.
   15.22 +
   15.23 +Real fix should be using separate ports for the A and AAAA queries.
   15.24 +
   15.25 +-= END original header =-
   15.26 +
   15.27 +diff -durN glibc-2_9.orig/resolv/Versions glibc-2_9/resolv/Versions
   15.28 +--- glibc-2_9.orig/resolv/Versions	2008-08-01 19:15:34.000000000 +0200
   15.29 ++++ glibc-2_9/resolv/Versions	2009-02-02 22:00:46.000000000 +0100
   15.30 +@@ -102,7 +102,7 @@
   15.31 +     _nss_dns_gethostbyname_r; _nss_dns_getnetbyaddr_r;
   15.32 +     _nss_dns_getnetbyname_r; _nss_dns_getcanonname_r;
   15.33 +     _nss_dns_gethostbyaddr2_r;
   15.34 +-    _nss_dns_gethostbyname4_r;
   15.35 ++#    _nss_dns_gethostbyname4_r;
   15.36 +   }
   15.37 + }
   15.38 + 
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/patches/glibc/2.9/180-math-tests.patch	Sun Apr 19 16:17:11 2009 +0000
    16.3 @@ -0,0 +1,72 @@
    16.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0090_all_glibc-math-tests.patch
    16.5 +
    16.6 +-= BEGIN original header =-
    16.7 +From: "Joseph S. Myers" <joseph at codesourcery dot com>
    16.8 +To: libc-alpha at sourceware dot org
    16.9 +Date: Tue, 15 Jul 2008 14:43:04 +0000 (UTC)
   16.10 +Subject: expm1 ulps
   16.11 +
   16.12 +If you test glibc on i686 with GCC 4.3, you get a test-ildoubl failure:
   16.13 +
   16.14 +Failure: Test: expm1 (1) == M_El - 1.0
   16.15 +Result:
   16.16 + is:          1.71828182845904523532e+00   0xd.bf0a8b14576953500000p-3
   16.17 + should be:   1.71828182845904523543e+00   0xd.bf0a8b14576953600000p-3
   16.18 + difference:  1.08420217248550443401e-19   0x8.00000000000000000000p-66
   16.19 + ulp       :  1.0000
   16.20 + max.ulp   :  0.0000
   16.21 +Maximal error of `expm1'
   16.22 + is      : 1 ulp
   16.23 + accepted: 0 ulp
   16.24 +
   16.25 +What happens is that the inline expansion of expm1l uses __builtin_expm1l,
   16.26 +and GCC 4.3 optimizes calls to __builtin_expm1l with constant argument to
   16.27 +a correctly rounded result using MPFR.  The result returned is thus the
   16.28 +value of e-1 rounded once to long double precision.  However, the test
   16.29 +expects M_El - 1.0, and the result of rounding e to long double precision,
   16.30 +then subtracting 1, differs in the last place from the result of rounding
   16.31 +e-1 to long double precision (the latter has smaller exponent, and the
   16.32 +last bit is 1).
   16.33 +
   16.34 +There are two obvious approaches possible to fixing this.  The first patch
   16.35 +below changes the expectation to a decimal expansion for e-1 (taken from
   16.36 +that of M_El) rather than doing arithmetic in the expected value.  This in
   16.37 +turn requires ulps to be set for the out-of-line version of expm1.  It
   16.38 +might also need ulps to be set for the inline version for older compilers
   16.39 +if they should continue to pass the test, and possibly for other targets.
   16.40 +The second patch below takes the alternative approach of keeping the
   16.41 +existing expectation (which has the wrong bit in the last place) and
   16.42 +setting ulps for the inline expansion of expm1, which avoids the risk of
   16.43 +breaking the test for other targets.
   16.44 +
   16.45 +2008-07-15  Joseph Myers  <joseph@codesourcery.com>
   16.46 +
   16.47 +        * sysdeps/i386/fpu/libm-test-ulps: Add inline long double ulps for
   16.48 +        expm1.
   16.49 +
   16.50 +-= END original header =-
   16.51 +
   16.52 +diff -durN glibc-2_9.orig/sysdeps/i386/fpu/libm-test-ulps glibc-2_9/sysdeps/i386/fpu/libm-test-ulps
   16.53 +--- glibc-2_9.orig/sysdeps/i386/fpu/libm-test-ulps	2006-01-15 18:59:37.000000000 +0100
   16.54 ++++ glibc-2_9/sysdeps/i386/fpu/libm-test-ulps	2009-02-02 22:00:47.000000000 +0100
   16.55 +@@ -453,6 +453,10 @@
   16.56 + ildouble: 8
   16.57 + ldouble: 8
   16.58 + 
   16.59 ++# expm1
   16.60 ++Test "expm1 (1) == M_El - 1.0":
   16.61 ++ildouble: 1
   16.62 ++
   16.63 + # gamma
   16.64 + Test "gamma (-0.5) == log(2*sqrt(pi))":
   16.65 + double: 1
   16.66 +@@ -1134,6 +1138,9 @@
   16.67 + ildouble: 8
   16.68 + ldouble: 8
   16.69 + 
   16.70 ++Function: "expm1":
   16.71 ++ildouble: 1
   16.72 ++
   16.73 + Function: "gamma":
   16.74 + double: 1
   16.75 + idouble: 1
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/patches/glibc/2.9/190-queue-header-updates.patch	Sun Apr 19 16:17:11 2009 +0000
    17.3 @@ -0,0 +1,89 @@
    17.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1010_all_glibc-queue-header-updates.patch
    17.5 +
    17.6 +-= BEGIN original header =-
    17.7 +grab some updates from FreeBSD
    17.8 +
    17.9 +http://bugs.gentoo.org/201979
   17.10 +
   17.11 +-= END original header =-
   17.12 +
   17.13 +diff -durN glibc-2_9.orig/misc/sys/queue.h glibc-2_9/misc/sys/queue.h
   17.14 +--- glibc-2_9.orig/misc/sys/queue.h	2008-03-05 06:50:30.000000000 +0100
   17.15 ++++ glibc-2_9/misc/sys/queue.h	2009-02-02 22:00:48.000000000 +0100
   17.16 +@@ -136,6 +136,11 @@
   17.17 + 		(var);							\
   17.18 + 		(var) = ((var)->field.le_next))
   17.19 + 
   17.20 ++#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
   17.21 ++	for ((var) = LIST_FIRST((head));				\
   17.22 ++	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
   17.23 ++	    (var) = (tvar))
   17.24 ++
   17.25 + /*
   17.26 +  * List access methods.
   17.27 +  */
   17.28 +@@ -197,6 +202,16 @@
   17.29 + #define	SLIST_FOREACH(var, head, field)					\
   17.30 + 	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
   17.31 + 
   17.32 ++#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
   17.33 ++	for ((var) = SLIST_FIRST((head));				\
   17.34 ++	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
   17.35 ++	    (var) = (tvar))
   17.36 ++
   17.37 ++#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
   17.38 ++	for ((varp) = &SLIST_FIRST((head));				\
   17.39 ++	    ((var) = *(varp)) != NULL;					\
   17.40 ++	    (varp) = &SLIST_NEXT((var), field))
   17.41 ++
   17.42 + /*
   17.43 +  * Singly-linked List access methods.
   17.44 +  */
   17.45 +@@ -242,6 +257,12 @@
   17.46 + 	(head)->stqh_last = &(elm)->field.stqe_next;			\
   17.47 + } while (/*CONSTCOND*/0)
   17.48 + 
   17.49 ++#define	STAILQ_LAST(head, type, field)					\
   17.50 ++	(STAILQ_EMPTY((head)) ?						\
   17.51 ++		NULL :							\
   17.52 ++	        ((struct type *)(void *)				\
   17.53 ++		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
   17.54 ++
   17.55 + #define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
   17.56 + 	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
   17.57 + 		(head)->stqh_last = &(elm)->field.stqe_next;		\
   17.58 +@@ -286,6 +307,11 @@
   17.59 + #define	STAILQ_FIRST(head)	((head)->stqh_first)
   17.60 + #define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
   17.61 + 
   17.62 ++#define	STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
   17.63 ++	for ((var) = STAILQ_FIRST((head));				\
   17.64 ++	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
   17.65 ++	    (var) = (tvar))
   17.66 ++
   17.67 + 
   17.68 + /*
   17.69 +  * Simple queue definitions.
   17.70 +@@ -437,11 +463,22 @@
   17.71 + 		(var);							\
   17.72 + 		(var) = ((var)->field.tqe_next))
   17.73 + 
   17.74 ++#define	TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
   17.75 ++	for ((var) = TAILQ_FIRST((head));				\
   17.76 ++	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
   17.77 ++	    (var) = (tvar))
   17.78 ++
   17.79 + #define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
   17.80 + 	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
   17.81 + 		(var);							\
   17.82 + 		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
   17.83 + 
   17.84 ++#define	TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	\
   17.85 ++	for ((var) = TAILQ_LAST((head), headname);			\
   17.86 ++	    (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
   17.87 ++	    (var) = (tvar))
   17.88 ++
   17.89 ++
   17.90 + #define	TAILQ_CONCAT(head1, head2, field) do {				\
   17.91 + 	if (!TAILQ_EMPTY(head2)) {					\
   17.92 + 		*(head1)->tqh_last = (head2)->tqh_first;		\
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/patches/glibc/2.9/200-awk-in-C-locale.patch	Sun Apr 19 16:17:11 2009 +0000
    18.3 @@ -0,0 +1,23 @@
    18.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1018_all_glibc-awk-in-C-locale.patch
    18.5 +
    18.6 +-= BEGIN original header =-
    18.7 +http://bugs.gentoo.org/252802
    18.8 +
    18.9 +2008-12-29  Mike Frysinger  <vapier@gentoo.org>
   18.10 +
   18.11 +	* iconvdata/Makefile (iconv-rules): Use LC_ALL=C when running awk script.
   18.12 +
   18.13 +-= END original header =-
   18.14 +
   18.15 +diff -durN glibc-2_9.orig/iconvdata/Makefile glibc-2_9/iconvdata/Makefile
   18.16 +--- glibc-2_9.orig/iconvdata/Makefile	2008-05-15 03:54:31.000000000 +0200
   18.17 ++++ glibc-2_9/iconvdata/Makefile	2009-02-02 22:00:50.000000000 +0100
   18.18 +@@ -286,7 +286,7 @@
   18.19 + 	{ echo $(filter-out lib%, $(modules)); \
   18.20 + 	  echo 8bit $(gen-8bit-modules); \
   18.21 + 	  echo 8bit-gap $(gen-8bit-gap-modules); } | \
   18.22 +-	$(AWK) 'NR == 1 { \
   18.23 ++	LC_ALL=C $(AWK) 'NR == 1 { \
   18.24 + 		  for (i = 1; i <= NF; i++) { \
   18.25 + 		    printf "%s-routines := %s\n", $$i, tolower($$i); \
   18.26 + 		    printf "%s-map := gconv.map\n", $$i; \
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/patches/glibc/2.9/210-2.9-strlen-hack.patch	Sun Apr 19 16:17:11 2009 +0000
    19.3 @@ -0,0 +1,109 @@
    19.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1020_all_glibc-2.9-strlen-hack.patch
    19.5 +
    19.6 +-= BEGIN original header =-
    19.7 +http://sourceware.org/bugzilla/show_bug.cgi?id=5807
    19.8 +http://www.cl.cam.ac.uk/~am21/progtricks.html
    19.9 +
   19.10 +-= END original header =-
   19.11 +
   19.12 +diff -durN glibc-2_9.orig/string/strlen.c glibc-2_9/string/strlen.c
   19.13 +--- glibc-2_9.orig/string/strlen.c	2005-12-14 12:09:07.000000000 +0100
   19.14 ++++ glibc-2_9/string/strlen.c	2009-02-02 22:00:51.000000000 +0100
   19.15 +@@ -32,7 +32,7 @@
   19.16 + {
   19.17 +   const char *char_ptr;
   19.18 +   const unsigned long int *longword_ptr;
   19.19 +-  unsigned long int longword, magic_bits, himagic, lomagic;
   19.20 ++  unsigned long int longword, himagic, lomagic;
   19.21 + 
   19.22 +   /* Handle the first few characters by reading one character at a time.
   19.23 +      Do this until CHAR_PTR is aligned on a longword boundary.  */
   19.24 +@@ -42,28 +42,14 @@
   19.25 +     if (*char_ptr == '\0')
   19.26 +       return char_ptr - str;
   19.27 + 
   19.28 +-  /* All these elucidatory comments refer to 4-byte longwords,
   19.29 +-     but the theory applies equally well to 8-byte longwords.  */
   19.30 +-
   19.31 +   longword_ptr = (unsigned long int *) char_ptr;
   19.32 + 
   19.33 +-  /* Bits 31, 24, 16, and 8 of this number are zero.  Call these bits
   19.34 +-     the "holes."  Note that there is a hole just to the left of
   19.35 +-     each byte, with an extra at the end:
   19.36 +-
   19.37 +-     bits:  01111110 11111110 11111110 11111111
   19.38 +-     bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
   19.39 +-
   19.40 +-     The 1-bits make sure that carries propagate to the next 0-bit.
   19.41 +-     The 0-bits provide holes for carries to fall into.  */
   19.42 +-  magic_bits = 0x7efefeffL;
   19.43 +   himagic = 0x80808080L;
   19.44 +   lomagic = 0x01010101L;
   19.45 +   if (sizeof (longword) > 4)
   19.46 +     {
   19.47 +       /* 64-bit version of the magic.  */
   19.48 +       /* Do the shift in two steps to avoid a warning if long has 32 bits.  */
   19.49 +-      magic_bits = ((0x7efefefeL << 16) << 16) | 0xfefefeffL;
   19.50 +       himagic = ((himagic << 16) << 16) | himagic;
   19.51 +       lomagic = ((lomagic << 16) << 16) | lomagic;
   19.52 +     }
   19.53 +@@ -75,56 +61,12 @@
   19.54 +      if *any of the four* bytes in the longword in question are zero.  */
   19.55 +   for (;;)
   19.56 +     {
   19.57 +-      /* We tentatively exit the loop if adding MAGIC_BITS to
   19.58 +-	 LONGWORD fails to change any of the hole bits of LONGWORD.
   19.59 +-
   19.60 +-	 1) Is this safe?  Will it catch all the zero bytes?
   19.61 +-	 Suppose there is a byte with all zeros.  Any carry bits
   19.62 +-	 propagating from its left will fall into the hole at its
   19.63 +-	 least significant bit and stop.  Since there will be no
   19.64 +-	 carry from its most significant bit, the LSB of the
   19.65 +-	 byte to the left will be unchanged, and the zero will be
   19.66 +-	 detected.
   19.67 +-
   19.68 +-	 2) Is this worthwhile?  Will it ignore everything except
   19.69 +-	 zero bytes?  Suppose every byte of LONGWORD has a bit set
   19.70 +-	 somewhere.  There will be a carry into bit 8.  If bit 8
   19.71 +-	 is set, this will carry into bit 16.  If bit 8 is clear,
   19.72 +-	 one of bits 9-15 must be set, so there will be a carry
   19.73 +-	 into bit 16.  Similarly, there will be a carry into bit
   19.74 +-	 24.  If one of bits 24-30 is set, there will be a carry
   19.75 +-	 into bit 31, so all of the hole bits will be changed.
   19.76 +-
   19.77 +-	 The one misfire occurs when bits 24-30 are clear and bit
   19.78 +-	 31 is set; in this case, the hole at bit 31 is not
   19.79 +-	 changed.  If we had access to the processor carry flag,
   19.80 +-	 we could close this loophole by putting the fourth hole
   19.81 +-	 at bit 32!
   19.82 +-
   19.83 +-	 So it ignores everything except 128's, when they're aligned
   19.84 +-	 properly.  */
   19.85 +-
   19.86 +       longword = *longword_ptr++;
   19.87 + 
   19.88 +-      if (
   19.89 +-#if 0
   19.90 +-	  /* Add MAGIC_BITS to LONGWORD.  */
   19.91 +-	  (((longword + magic_bits)
   19.92 +-
   19.93 +-	    /* Set those bits that were unchanged by the addition.  */
   19.94 +-	    ^ ~longword)
   19.95 +-
   19.96 +-	   /* Look at only the hole bits.  If any of the hole bits
   19.97 +-	      are unchanged, most likely one of the bytes was a
   19.98 +-	      zero.  */
   19.99 +-	   & ~magic_bits)
  19.100 +-#else
  19.101 +-	  ((longword - lomagic) & himagic)
  19.102 +-#endif
  19.103 +-	  != 0)
  19.104 ++      /* This hack taken from Alan Mycroft's HAKMEMC postings.
  19.105 ++         See: http://www.cl.cam.ac.uk/~am21/progtricks.html */
  19.106 ++      if (((longword - lomagic) & ~longword & himagic) != 0)
  19.107 + 	{
  19.108 +-	  /* Which of the bytes was the zero?  If none of them were, it was
  19.109 +-	     a misfire; continue the search.  */
  19.110 + 
  19.111 + 	  const char *cp = (const char *) (longword_ptr - 1);
  19.112 + 
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/patches/glibc/2.9/220-manual-no-perl.patch	Sun Apr 19 16:17:11 2009 +0000
    20.3 @@ -0,0 +1,29 @@
    20.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1030_all_glibc-manual-no-perl.patch
    20.5 +
    20.6 +-= BEGIN original header =-
    20.7 +If we're using a cvs snapshot which updates the source files, and
    20.8 +perl isn't installed yet, then we can't regen the docs.  Not a big
    20.9 +deal, so just whine a little and continue on our merry way.
   20.10 +
   20.11 +http://bugs.gentoo.org/60132
   20.12 +
   20.13 +-= END original header =-
   20.14 +
   20.15 +diff -durN glibc-2_9.orig/manual/Makefile glibc-2_9/manual/Makefile
   20.16 +--- glibc-2_9.orig/manual/Makefile	2006-01-08 07:43:47.000000000 +0100
   20.17 ++++ glibc-2_9/manual/Makefile	2009-02-02 22:00:53.000000000 +0100
   20.18 +@@ -104,9 +104,14 @@
   20.19 + libm-err.texi: stamp-libm-err
   20.20 + stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
   20.21 + 						     $(dir)/libm-test-ulps))
   20.22 ++ifneq ($(PERL),no)
   20.23 + 	pwd=`pwd`; \
   20.24 + 	$(PERL) $< $$pwd/.. > libm-err-tmp
   20.25 + 	$(move-if-change) libm-err-tmp libm-err.texi
   20.26 ++else
   20.27 ++	echo "Unable to rebuild math docs, no perl installed"
   20.28 ++	touch libm-err.texi
   20.29 ++endif
   20.30 + 	touch $@
   20.31 + 
   20.32 + # Generate Texinfo files from the C source for the example programs.
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch	Sun Apr 19 16:17:11 2009 +0000
    21.3 @@ -0,0 +1,74 @@
    21.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1040_all_2.3.3-localedef-fix-trampoline.patch
    21.5 +
    21.6 +-= BEGIN original header =-
    21.7 +#! /bin/sh -e
    21.8 +
    21.9 +# DP: Description: Fix localedef segfault when run under exec-shield,
   21.10 +#        PaX or similar. (#231438, #198099)
   21.11 +# DP: Dpatch Author: James Troup <james@nocrew.org>
   21.12 +# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
   21.13 +# DP: Upstream status: Unknown
   21.14 +# DP: Status Details: Unknown
   21.15 +# DP: Date: 2004-03-16
   21.16 +
   21.17 +if [ $# -ne 2 ]; then
   21.18 +    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
   21.19 +    exit 1
   21.20 +fi
   21.21 +case "$1" in
   21.22 +    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
   21.23 +    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
   21.24 +    *)
   21.25 +	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
   21.26 +	exit 1
   21.27 +esac
   21.28 +exit 0
   21.29 +
   21.30 +-= END original header =-
   21.31 +
   21.32 +diff -durN glibc-2_9.orig/locale/programs/3level.h glibc-2_9/locale/programs/3level.h
   21.33 +--- glibc-2_9.orig/locale/programs/3level.h	2007-07-16 02:54:59.000000000 +0200
   21.34 ++++ glibc-2_9/locale/programs/3level.h	2009-02-02 22:00:54.000000000 +0100
   21.35 +@@ -203,6 +203,42 @@
   21.36 + 	}
   21.37 +     }
   21.38 + }
   21.39 ++
   21.40 ++/* GCC ATM seems to do a poor job with pointers to nested functions passed
   21.41 ++   to inlined functions.  Help it a little bit with this hack.  */
   21.42 ++#define wchead_table_iterate(tp, fn) \
   21.43 ++do									      \
   21.44 ++  {									      \
   21.45 ++    struct wchead_table *t = (tp);					      \
   21.46 ++    uint32_t index1;							      \
   21.47 ++    for (index1 = 0; index1 < t->level1_size; index1++)			      \
   21.48 ++      {									      \
   21.49 ++	uint32_t lookup1 = t->level1[index1];				      \
   21.50 ++	if (lookup1 != ((uint32_t) ~0))					      \
   21.51 ++	  {								      \
   21.52 ++	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
   21.53 ++	    uint32_t index2;						      \
   21.54 ++	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
   21.55 ++	      {								      \
   21.56 ++		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
   21.57 ++		if (lookup2 != ((uint32_t) ~0))				      \
   21.58 ++		  {							      \
   21.59 ++		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
   21.60 ++		    uint32_t index3;					      \
   21.61 ++		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
   21.62 ++		      {							      \
   21.63 ++			struct element_t *lookup3			      \
   21.64 ++			  = t->level3[index3 + lookup2_shifted];	      \
   21.65 ++			if (lookup3 != NULL)				      \
   21.66 ++			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
   21.67 ++			      lookup3);					      \
   21.68 ++		      }							      \
   21.69 ++		  }							      \
   21.70 ++	      }								      \
   21.71 ++	  }								      \
   21.72 ++      }									      \
   21.73 ++  } while (0)
   21.74 ++
   21.75 + #endif
   21.76 + 
   21.77 + #ifndef NO_FINALIZE
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/patches/glibc/2.9/240-i386-LOAD_PIC_REG.patch	Sun Apr 19 16:17:11 2009 +0000
    22.3 @@ -0,0 +1,23 @@
    22.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1050_all_glibc-i386-LOAD_PIC_REG.patch
    22.5 +
    22.6 +-= BEGIN original header =-
    22.7 +From e41177ea18a77a7f62328293b4fd49ae17482e77 Mon Sep 17 00:00:00 2001
    22.8 +From: Ulrich Drepper <drepper@redhat.com>
    22.9 +Date: Sat, 6 Dec 2008 00:15:17 +0000
   22.10 +Subject: [PATCH] (_dl_tlsdesc_dynamic): Use LOAD_PIC_REG instead of doing things manually.
   22.11 +
   22.12 +-= END original header =-
   22.13 +
   22.14 +diff -durN glibc-2_9.orig/sysdeps/i386/dl-tlsdesc.S glibc-2_9/sysdeps/i386/dl-tlsdesc.S
   22.15 +--- glibc-2_9.orig/sysdeps/i386/dl-tlsdesc.S	2008-05-13 07:33:06.000000000 +0200
   22.16 ++++ glibc-2_9/sysdeps/i386/dl-tlsdesc.S	2009-02-02 22:00:56.000000000 +0100
   22.17 +@@ -128,8 +128,7 @@
   22.18 + .Lslow:
   22.19 + 	cfi_adjust_cfa_offset (28)
   22.20 + 	movl	%ebx, 16(%esp)
   22.21 +-	call	__i686.get_pc_thunk.bx
   22.22 +-	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
   22.23 ++	LOAD_PIC_REG (bx)
   22.24 + 	call	___tls_get_addr@PLT
   22.25 + 	movl	16(%esp), %ebx
   22.26 + 	jmp	.Lret
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/patches/glibc/2.9/250-resolv-dynamic.patch	Sun Apr 19 16:17:11 2009 +0000
    23.3 @@ -0,0 +1,44 @@
    23.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1055_all_glibc-resolv-dynamic.patch
    23.5 +
    23.6 +-= BEGIN original header =-
    23.7 +ripped from SuSE
    23.8 +
    23.9 +if /etc/resolv.conf is updated, then make sure applications
   23.10 +already running get the updated information.
   23.11 +
   23.12 +http://bugs.gentoo.org/177416
   23.13 +
   23.14 +-= END original header =-
   23.15 +
   23.16 +diff -durN glibc-2_9.orig/resolv/res_libc.c glibc-2_9/resolv/res_libc.c
   23.17 +--- glibc-2_9.orig/resolv/res_libc.c	2006-10-11 10:59:28.000000000 +0200
   23.18 ++++ glibc-2_9/resolv/res_libc.c	2009-02-02 22:00:57.000000000 +0100
   23.19 +@@ -22,6 +22,7 @@
   23.20 + #include <arpa/nameser.h>
   23.21 + #include <resolv.h>
   23.22 + #include <bits/libc-lock.h>
   23.23 ++#include <sys/stat.h>
   23.24 + 
   23.25 + 
   23.26 + /* The following bit is copied from res_data.c (where it is #ifdef'ed
   23.27 +@@ -95,6 +96,20 @@
   23.28 + __res_maybe_init (res_state resp, int preinit)
   23.29 + {
   23.30 + 	if (resp->options & RES_INIT) {
   23.31 ++		static time_t last_mtime, last_check;
   23.32 ++		time_t now;
   23.33 ++		struct stat statbuf;
   23.34 ++		
   23.35 ++		time (&now);
   23.36 ++		if (now != last_check) {
   23.37 ++			last_check = now;
   23.38 ++			if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
   23.39 ++				last_mtime = statbuf.st_mtime;
   23.40 ++				atomicinclock (lock);
   23.41 ++				atomicinc (__res_initstamp);
   23.42 ++				atomicincunlock (lock);
   23.43 ++			}
   23.44 ++		}
   23.45 + 		if (__res_initstamp != resp->_u._ext.initstamp) {
   23.46 + 			if (resp->nscount > 0) {
   23.47 + 				__res_iclose (resp, true);
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/patches/glibc/2.9/260-fadvise64_64.patch	Sun Apr 19 16:17:11 2009 +0000
    24.3 @@ -0,0 +1,30 @@
    24.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1070_all_glibc-fadvise64_64.patch
    24.5 +
    24.6 +-= BEGIN original header =-
    24.7 +ripped from Debian
    24.8 +
    24.9 +-= END original header =-
   24.10 +
   24.11 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c
   24.12 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c	2003-08-17 02:36:22.000000000 +0200
   24.13 ++++ glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c	2009-02-02 22:00:58.000000000 +0100
   24.14 +@@ -35,6 +35,19 @@
   24.15 +     return INTERNAL_SYSCALL_ERRNO (ret, err);
   24.16 +   return 0;
   24.17 + #else
   24.18 ++# ifdef __NR_fadvise64_64
   24.19 ++  INTERNAL_SYSCALL_DECL (err);  
   24.20 ++  int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
   24.21 ++			      __LONG_LONG_PAIR ((long) (offset >> 31),
   24.22 ++						(long) offset),
   24.23 ++			      __LONG_LONG_PAIR ((long) (len >> 31),
   24.24 ++						(long) len),
   24.25 ++			      advise);
   24.26 ++  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
   24.27 ++    return INTERNAL_SYSCALL_ERRNO (ret, err);
   24.28 ++  return 0;
   24.29 ++# else
   24.30 +   return ENOSYS;
   24.31 ++# endif
   24.32 + #endif
   24.33 + }
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/patches/glibc/2.9/270-ldbl-nexttowardf.patch	Sun Apr 19 16:17:11 2009 +0000
    25.3 @@ -0,0 +1,68 @@
    25.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1073_all_glibc-ldbl-nexttowardf.patch
    25.5 +
    25.6 +-= BEGIN original header =-
    25.7 +ripped from Debian
    25.8 +
    25.9 +this change was made to generic __nexttowardf, but not the long double version
   25.10 +
   25.11 +2008-05-05  Aurelien Jarno  <aurelien@aurel32.net>
   25.12 +
   25.13 +	* sysdeps/ieee754/ldbl-128/s_nexttowardf.c: Include float.h.
   25.14 +	(__nexttowardf): Use math_opt_barrier and
   25.15 +	math_force_eval macros.  If FLT_EVAL_METHOD is not 0, force
   25.16 +	x to float using asm.
   25.17 +
   25.18 +-= END original header =-
   25.19 +
   25.20 +diff -durN glibc-2_9.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c glibc-2_9/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
   25.21 +--- glibc-2_9.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c	1999-07-14 02:09:42.000000000 +0200
   25.22 ++++ glibc-2_9/sysdeps/ieee754/ldbl-128/s_nexttowardf.c	2009-02-02 22:00:59.000000000 +0100
   25.23 +@@ -19,7 +19,8 @@
   25.24 + #endif
   25.25 + 
   25.26 + #include "math.h"
   25.27 +-#include "math_private.h"
   25.28 ++#include <math_private.h>
   25.29 ++#include <float.h>
   25.30 + 
   25.31 + #ifdef __STDC__
   25.32 + 	float __nexttowardf(float x, long double y)
   25.33 +@@ -44,10 +45,12 @@
   25.34 + 	   return x+y;
   25.35 + 	if((long double) x==y) return y;	/* x=y, return y */
   25.36 + 	if(ix==0) {				/* x == 0 */
   25.37 +-	    float x2;
   25.38 ++	    float u;
   25.39 + 	    SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
   25.40 +-	    x2 = x*x;
   25.41 +-	    if(x2==x) return x2; else return x;	/* raise underflow flag */
   25.42 ++	    u = math_opt_barrier (x);
   25.43 ++	    u = u * u;
   25.44 ++	    math_force_eval (u);		/* raise underflow flag */
   25.45 ++	    return x;
   25.46 + 	}
   25.47 + 	if(hx>=0) {				/* x > 0 */
   25.48 + 	    if(hy<0||(ix>>23)>(iy>>48)-0x3f80
   25.49 +@@ -67,13 +70,16 @@
   25.50 + 	    }
   25.51 + 	}
   25.52 + 	hy = hx&0x7f800000;
   25.53 +-	if(hy>=0x7f800000) return x+x;	/* overflow  */
   25.54 ++	if(hy>=0x7f800000) {
   25.55 ++	  x = x+x;	/* overflow  */
   25.56 ++	  if (FLT_EVAL_METHOD != 0)
   25.57 ++	    /* Force conversion to float.  */
   25.58 ++	    asm ("" : "+m"(x));
   25.59 ++	  return x;
   25.60 ++	}
   25.61 + 	if(hy<0x00800000) {		/* underflow */
   25.62 +-	    float x2 = x*x;
   25.63 +-	    if(x2!=x) {		/* raise underflow flag */
   25.64 +-	        SET_FLOAT_WORD(x2,hx);
   25.65 +-		return x2;
   25.66 +-	    }
   25.67 ++	    float u = x*x;
   25.68 ++	    math_force_eval (u);	/* raise underflow flag */
   25.69 + 	}
   25.70 + 	SET_FLOAT_WORD(x,hx);
   25.71 + 	return x;
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/patches/glibc/2.9/280-section-comments.patch	Sun Apr 19 16:17:11 2009 +0000
    26.3 @@ -0,0 +1,29 @@
    26.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1075_all_glibc-section-comments.patch
    26.5 +
    26.6 +-= BEGIN original header =-
    26.7 +http://sources.redhat.com/ml/binutils/2004-04/msg00665.html
    26.8 +
    26.9 +fixes building on some architectures (like m68k/arm/cris/etc...) because
   26.10 +it does the right thing
   26.11 +
   26.12 +-= END original header =-
   26.13 +
   26.14 +diff -durN glibc-2_9.orig/include/libc-symbols.h glibc-2_9/include/libc-symbols.h
   26.15 +--- glibc-2_9.orig/include/libc-symbols.h	2006-11-09 16:57:12.000000000 +0100
   26.16 ++++ glibc-2_9/include/libc-symbols.h	2009-02-02 22:01:00.000000000 +0100
   26.17 +@@ -240,12 +240,12 @@
   26.18 + #  define __make_section_unallocated(section_string)
   26.19 + # endif
   26.20 + 
   26.21 +-/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
   26.22 ++/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
   26.23 +    section attributes on what looks like a comment to the assembler.  */
   26.24 + # ifdef HAVE_SECTION_QUOTES
   26.25 +-#  define __sec_comment "\"\n\t#\""
   26.26 ++#  define __sec_comment "\"\n#APP\n\t#\""
   26.27 + # else
   26.28 +-#  define __sec_comment "\n\t#"
   26.29 ++#  define __sec_comment "\n#APP\n\t#"
   26.30 + # endif
   26.31 + # define link_warning(symbol, msg) \
   26.32 +   __make_section_unallocated (".gnu.warning." #symbol) \
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/patches/glibc/2.9/290-no-inline-gmon.patch	Sun Apr 19 16:17:11 2009 +0000
    27.3 @@ -0,0 +1,38 @@
    27.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1080_all_glibc-no-inline-gmon.patch
    27.5 +
    27.6 +-= BEGIN original header =-
    27.7 +http://bugs.gentoo.org/196245
    27.8 +http://sourceware.org/ml/libc-alpha/2006-05/msg00017.html
    27.9 +
   27.10 +Attached is a patch to add __attribute__ ((noinline)) to
   27.11 +call_gmon_start.
   27.12 +
   27.13 +Without this patch, the sec script that processed initfini.s removes a
   27.14 +part of inlined call_gmon_start, causing undefined label errors.
   27.15 +
   27.16 +This patch solves the problem by forcing gcc not to inline
   27.17 +call_gmon_start with __attribute__ ((noinline)).
   27.18 +
   27.19 +Tested by building for arm-none-lixux-gnueabi.  OK to apply?
   27.20 +
   27.21 +Kazu Hirata
   27.22 +
   27.23 +2006-05-07  Kazu Hirata  &lt;kazu@codesourcery.com&gt;
   27.24 +
   27.25 +	* sysdeps/generic/initfini.c (call_gmon_start): Add
   27.26 +	__attribute__ ((noinline)).
   27.27 +
   27.28 +-= END original header =-
   27.29 +
   27.30 +diff -durN glibc-2_9.orig/sysdeps/generic/initfini.c glibc-2_9/sysdeps/generic/initfini.c
   27.31 +--- glibc-2_9.orig/sysdeps/generic/initfini.c	2007-06-17 20:02:40.000000000 +0200
   27.32 ++++ glibc-2_9/sysdeps/generic/initfini.c	2009-02-02 22:01:01.000000000 +0100
   27.33 +@@ -70,7 +70,7 @@
   27.34 + /* The beginning of _init:  */
   27.35 + asm ("\n/*@_init_PROLOG_BEGINS*/");
   27.36 + 
   27.37 +-static void
   27.38 ++static void __attribute__ ((noinline))
   27.39 + call_gmon_start(void)
   27.40 + {
   27.41 +   extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/patches/glibc/2.9/300-2.9-check_native-headers.patch	Sun Apr 19 16:17:11 2009 +0000
    28.3 @@ -0,0 +1,22 @@
    28.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1085_all_glibc-2.9-check_native-headers.patch
    28.5 +
    28.6 +-= BEGIN original header =-
    28.7 +many ports hit this warning:
    28.8 +../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
    28.9 +../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
   28.10 +
   28.11 +snipped from suse
   28.12 +
   28.13 +-= END original header =-
   28.14 +
   28.15 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/check_native.c glibc-2_9/sysdeps/unix/sysv/linux/check_native.c
   28.16 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/check_native.c	2007-11-24 04:12:17.000000000 +0100
   28.17 ++++ glibc-2_9/sysdeps/unix/sysv/linux/check_native.c	2009-02-02 22:01:03.000000000 +0100
   28.18 +@@ -23,6 +23,7 @@
   28.19 + #include <stddef.h>
   28.20 + #include <stdint.h>
   28.21 + #include <stdlib.h>
   28.22 ++#include <string.h>
   28.23 + #include <time.h>
   28.24 + #include <unistd.h>
   28.25 + #include <net/if.h>
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/patches/glibc/2.9/310-2.3.6-fix-pr631.patch	Sun Apr 19 16:17:11 2009 +0000
    29.3 @@ -0,0 +1,50 @@
    29.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1090_all_glibc-2.3.6-fix-pr631.patch
    29.5 +
    29.6 +-= BEGIN original header =-
    29.7 +From dank@kegel.com
    29.8 +Wed Jun 15 09:12:43 PDT 2005
    29.9 +
   29.10 +Fixes
   29.11 +
   29.12 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
   29.13 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
   29.14 +... 53 lines deleted ...
   29.15 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
   29.16 +collect2: ld returned 1 exit status
   29.17 +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
   29.18 +
   29.19 +when building glibc with --enable-static-nss.
   29.20 +
   29.21 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
   29.22 +
   29.23 +-= END original header =-
   29.24 +
   29.25 +diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
   29.26 +--- glibc-2_9.orig/Makeconfig	2009-02-02 22:00:36.000000000 +0100
   29.27 ++++ glibc-2_9/Makeconfig	2009-02-02 22:01:04.000000000 +0100
   29.28 +@@ -509,7 +509,7 @@
   29.29 + 
   29.30 + # The static libraries.
   29.31 + ifeq (yes,$(build-static))
   29.32 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
   29.33 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
   29.34 + else
   29.35 + ifeq (yes,$(build-shared))
   29.36 + # We can try to link the programs with lib*_pic.a...
   29.37 +diff -durN glibc-2_9.orig/elf/Makefile glibc-2_9/elf/Makefile
   29.38 +--- glibc-2_9.orig/elf/Makefile	2008-10-31 21:35:11.000000000 +0100
   29.39 ++++ glibc-2_9/elf/Makefile	2009-02-02 22:01:04.000000000 +0100
   29.40 +@@ -121,6 +121,13 @@
   29.41 + install-bin-script = ldd
   29.42 + endif
   29.43 + 
   29.44 ++ifeq (yes,$(build-static-nss))
   29.45 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
   29.46 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
   29.47 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
   29.48 ++	     $(resolvobjdir)/libresolv.a
   29.49 ++endif
   29.50 ++
   29.51 + others		= sprof sln
   29.52 + install-bin	= sprof
   29.53 + others-static   = sln
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/patches/glibc/2.9/320-2.9-assume-pipe2.patch	Sun Apr 19 16:17:11 2009 +0000
    30.3 @@ -0,0 +1,59 @@
    30.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1095_all_glibc-2.9-assume-pipe2.patch
    30.5 +
    30.6 +-= BEGIN original header =-
    30.7 +http://bugs.gentoo.org/250342
    30.8 +http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
    30.9 +
   30.10 +we cant assume sock_cloexec and pipe2 are bound together as the former defines
   30.11 +are found in glibc only while the latter are a combo of kernel headers and
   30.12 +glibc.  so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
   30.13 +inside of glibc, we hit a problem.  for example:
   30.14 +
   30.15 +#include <grp.h>
   30.16 +#include <stdio.h>
   30.17 +main()
   30.18 +{
   30.19 +	getgrnam("portage");
   30.20 +	if (!popen("ls", "r"))
   30.21 +		perror("popen()");
   30.22 +}
   30.23 +
   30.24 +getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
   30.25 +__have_sock_cloexec and __have_pipe2 to true.  but if glibc was built against
   30.26 +older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
   30.27 +stub for it.  so popen() will always fail as glibc assumes pipe2() works.
   30.28 +
   30.29 +-= END original header =-
   30.30 +
   30.31 +diff -durN glibc-2_9.orig/include/unistd.h glibc-2_9/include/unistd.h
   30.32 +--- glibc-2_9.orig/include/unistd.h	2008-07-27 20:23:17.000000000 +0200
   30.33 ++++ glibc-2_9/include/unistd.h	2009-02-02 22:01:05.000000000 +0100
   30.34 +@@ -167,9 +167,6 @@
   30.35 + extern int __pause_nocancel (void) attribute_hidden;
   30.36 + 
   30.37 + extern int __have_sock_cloexec;
   30.38 +-/* At lot of other functionality became available at the same time as
   30.39 +-   SOCK_CLOEXEC.  Avoid defining separate variables for all of them
   30.40 +-   unless it is really necessary.  */
   30.41 +-#define __have_pipe2 __have_sock_cloexec
   30.42 ++extern int __have_pipe2;
   30.43 + 
   30.44 + #endif
   30.45 +diff -durN glibc-2_9.orig/socket/have_sock_cloexec.c glibc-2_9/socket/have_sock_cloexec.c
   30.46 +--- glibc-2_9.orig/socket/have_sock_cloexec.c	2008-07-25 18:46:23.000000000 +0200
   30.47 ++++ glibc-2_9/socket/have_sock_cloexec.c	2009-02-02 22:01:05.000000000 +0100
   30.48 +@@ -16,9 +16,14 @@
   30.49 +    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   30.50 +    02111-1307 USA.  */
   30.51 + 
   30.52 ++#include <fcntl.h>
   30.53 + #include <sys/socket.h>
   30.54 + #include <kernel-features.h>
   30.55 + 
   30.56 + #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
   30.57 + int __have_sock_cloexec;
   30.58 + #endif
   30.59 ++
   30.60 ++#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
   30.61 ++int __have_pipe2;
   30.62 ++#endif
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/patches/glibc/2.9/330-2.3.3-china.patch	Sun Apr 19 16:17:11 2009 +0000
    31.3 @@ -0,0 +1,35 @@
    31.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1100_all_glibc-2.3.3-china.patch
    31.5 +
    31.6 +-= BEGIN original header =-
    31.7 +-= END original header =-
    31.8 +
    31.9 +diff -durN glibc-2_9.orig/localedata/locales/zh_TW glibc-2_9/localedata/locales/zh_TW
   31.10 +--- glibc-2_9.orig/localedata/locales/zh_TW	2004-11-01 00:42:28.000000000 +0100
   31.11 ++++ glibc-2_9/localedata/locales/zh_TW	2009-02-02 22:01:06.000000000 +0100
   31.12 +@@ -1,7 +1,7 @@
   31.13 + comment_char %
   31.14 + escape_char /
   31.15 + %
   31.16 +-% Chinese language locale for Taiwan R.O.C.
   31.17 ++% Chinese language locale for Taiwan
   31.18 + % charmap: BIG5-CP950
   31.19 + %
   31.20 + % Original Author:
   31.21 +@@ -17,7 +17,7 @@
   31.22 + % Reference:	http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
   31.23 + 
   31.24 + LC_IDENTIFICATION
   31.25 +-title      "Chinese locale for Taiwan R.O.C."
   31.26 ++title      "Chinese locale for Taiwan"
   31.27 + source     ""
   31.28 + address    ""
   31.29 + contact    ""
   31.30 +@@ -25,7 +25,7 @@
   31.31 + tel        ""
   31.32 + fax        ""
   31.33 + language   "Chinese"
   31.34 +-territory  "Taiwan R.O.C."
   31.35 ++territory  "Taiwan"
   31.36 + revision   "0.2"
   31.37 + date       "2000-08-02"
   31.38 + %
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/patches/glibc/2.9/340-new-valencian-locale.patch	Sun Apr 19 16:17:11 2009 +0000
    32.3 @@ -0,0 +1,120 @@
    32.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1103_all_glibc-new-valencian-locale.patch
    32.5 +
    32.6 +-= BEGIN original header =-
    32.7 +http://bugs.gentoo.org/show_bug.cgi?id=131815
    32.8 +http://sourceware.org/bugzilla/show_bug.cgi?id=2522
    32.9 +
   32.10 +-= END original header =-
   32.11 +
   32.12 +diff -durN glibc-2_9.orig/localedata/SUPPORTED glibc-2_9/localedata/SUPPORTED
   32.13 +--- glibc-2_9.orig/localedata/SUPPORTED	2008-09-16 23:24:57.000000000 +0200
   32.14 ++++ glibc-2_9/localedata/SUPPORTED	2009-02-02 22:01:08.000000000 +0100
   32.15 +@@ -72,6 +72,8 @@
   32.16 + ca_ES.UTF-8/UTF-8 \
   32.17 + ca_ES/ISO-8859-1 \
   32.18 + ca_ES@euro/ISO-8859-15 \
   32.19 ++ca_ES.UTF-8@valencia/UTF-8 \
   32.20 ++ca_ES@valencia/ISO-8859-15 \
   32.21 + ca_FR.UTF-8/UTF-8 \
   32.22 + ca_FR/ISO-8859-15 \
   32.23 + ca_IT.UTF-8/UTF-8 \
   32.24 +diff -durN glibc-2_9.orig/localedata/locales/ca_ES@valencia glibc-2_9/localedata/locales/ca_ES@valencia
   32.25 +--- glibc-2_9.orig/localedata/locales/ca_ES@valencia	1970-01-01 01:00:00.000000000 +0100
   32.26 ++++ glibc-2_9/localedata/locales/ca_ES@valencia	2009-02-02 22:01:08.000000000 +0100
   32.27 +@@ -0,0 +1,96 @@
   32.28 ++comment_char %
   32.29 ++escape_char  /
   32.30 ++%
   32.31 ++% Valencian (southern Catalan) locale for Spain with Euro
   32.32 ++%
   32.33 ++% Note that this locale is almost the same as ca_ES@euro.  The point of having
   32.34 ++% a separate locale is only for PO translations, which have a lot of social
   32.35 ++% support and are very appreciated by the Valencian-speaking community.
   32.36 ++%
   32.37 ++% Contact: Jordi Mallach
   32.38 ++% Email: jordi@gnu.org
   32.39 ++% Tel:
   32.40 ++% Fax:
   32.41 ++% Language: ca
   32.42 ++% Territory: ES
   32.43 ++% Option: euro
   32.44 ++% Revision: 1.0
   32.45 ++% Date: 2006-04-06
   32.46 ++% Application: general
   32.47 ++% Users: general
   32.48 ++% Repertoiremap: mnemonic,ds
   32.49 ++% Charset: ISO-8859-15
   32.50 ++% Distribution and use is free, also
   32.51 ++% for commercial purposes.
   32.52 ++
   32.53 ++LC_IDENTIFICATION
   32.54 ++title      "Valencian (southern Catalan) locale for Spain with Euro"
   32.55 ++source     ""
   32.56 ++address    ""
   32.57 ++contact    "Jordi Mallach"
   32.58 ++email      "jordi@gnu.org"
   32.59 ++tel        ""
   32.60 ++fax        ""
   32.61 ++language   "Catalan"
   32.62 ++territory  "Spain"
   32.63 ++revision   "1.0"
   32.64 ++date       "2006-04-06"
   32.65 ++%
   32.66 ++category  "ca_ES@valencia:2006";LC_IDENTIFICATION
   32.67 ++category  "ca_ES@valencia:2006";LC_CTYPE
   32.68 ++category  "ca_ES@valencia:2006";LC_COLLATE
   32.69 ++category  "ca_ES@valencia:2006";LC_MONETARY
   32.70 ++category  "ca_ES@valencia:2006";LC_NUMERIC
   32.71 ++category  "ca_ES@valencia:2006";LC_TIME
   32.72 ++category  "ca_ES@valencia:2006";LC_MESSAGES
   32.73 ++category  "ca_ES@valencia:2006";LC_PAPER
   32.74 ++category  "ca_ES@valencia:2006";LC_NAME
   32.75 ++category  "ca_ES@valencia:2006";LC_ADDRESS
   32.76 ++category  "ca_ES@valencia:2006";LC_TELEPHONE
   32.77 ++category  "ca_ES@valencia:2006";LC_MEASUREMENT
   32.78 ++
   32.79 ++END LC_IDENTIFICATION
   32.80 ++
   32.81 ++LC_CTYPE
   32.82 ++copy "i18n"
   32.83 ++END LC_CTYPE
   32.84 ++
   32.85 ++LC_COLLATE
   32.86 ++copy "ca_ES"
   32.87 ++END LC_COLLATE
   32.88 ++
   32.89 ++LC_MONETARY
   32.90 ++copy "ca_ES"
   32.91 ++END LC_MONETARY
   32.92 ++
   32.93 ++LC_NUMERIC
   32.94 ++copy "ca_ES"
   32.95 ++END LC_NUMERIC
   32.96 ++
   32.97 ++LC_TIME
   32.98 ++copy "ca_ES"
   32.99 ++END LC_TIME
  32.100 ++
  32.101 ++LC_MESSAGES
  32.102 ++copy "ca_ES"
  32.103 ++END LC_MESSAGES
  32.104 ++
  32.105 ++LC_PAPER
  32.106 ++copy "ca_ES"
  32.107 ++END LC_PAPER
  32.108 ++
  32.109 ++LC_NAME
  32.110 ++copy "ca_ES"
  32.111 ++END LC_NAME
  32.112 ++
  32.113 ++LC_ADDRESS
  32.114 ++copy "ca_ES"
  32.115 ++END LC_ADDRESS
  32.116 ++
  32.117 ++LC_TELEPHONE
  32.118 ++copy "ca_ES"
  32.119 ++END LC_TELEPHONE
  32.120 ++
  32.121 ++LC_MEASUREMENT
  32.122 ++copy "ca_ES"
  32.123 ++END LC_MEASUREMENT
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/patches/glibc/2.9/350-2.4-undefine-__i686.patch	Sun Apr 19 16:17:11 2009 +0000
    33.3 @@ -0,0 +1,47 @@
    33.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1130_all_glibc-2.4-undefine-__i686.patch
    33.5 +
    33.6 +-= BEGIN original header =-
    33.7 +If gcc is configured to generate i686 code or better by default (like 
    33.8 +when using the --with-arch=pentium3 configure option), then the __i686
    33.9 +macro will always be defined automatically and thus screw up the
   33.10 +compilation of some .S files.
   33.11 +http://bugs.gentoo.org/131108
   33.12 +http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
   33.13 +
   33.14 +2006-04-25  Mike Frysinger  <vapier@gentoo.org>
   33.15 +
   33.16 +	* sysdeps/i386/sysdep.h (__i686): Undefine.
   33.17 +
   33.18 +-= END original header =-
   33.19 +
   33.20 +diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2_9/nptl/sysdeps/pthread/pt-initfini.c
   33.21 +--- glibc-2_9.orig/nptl/sysdeps/pthread/pt-initfini.c	2007-06-17 20:02:01.000000000 +0200
   33.22 ++++ glibc-2_9/nptl/sysdeps/pthread/pt-initfini.c	2009-02-02 22:01:09.000000000 +0100
   33.23 +@@ -45,6 +45,9 @@
   33.24 + /* Embed an #include to pull in the alignment and .end directives. */
   33.25 + asm ("\n#include \"defs.h\"");
   33.26 + 
   33.27 ++/* Embed an #include to pull in asm settings. */
   33.28 ++asm ("\n#ifdef __i686__\n#include <sysdep.h>\n#endif");
   33.29 ++
   33.30 + /* The initial common code ends here. */
   33.31 + asm ("\n/*@HEADER_ENDS*/");
   33.32 + 
   33.33 +diff -durN glibc-2_9.orig/sysdeps/i386/sysdep.h glibc-2_9/sysdeps/i386/sysdep.h
   33.34 +--- glibc-2_9.orig/sysdeps/i386/sysdep.h	2006-10-28 08:44:03.000000000 +0200
   33.35 ++++ glibc-2_9/sysdeps/i386/sysdep.h	2009-02-02 22:01:09.000000000 +0100
   33.36 +@@ -18,6 +18,14 @@
   33.37 +    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   33.38 +    02111-1307 USA.  */
   33.39 + 
   33.40 ++/*
   33.41 ++ * When building for i686 targets or better, gcc automatically defines
   33.42 ++ * '__i686' to '1' for us which causes trouble when using section names
   33.43 ++ * like '__i686.get_pc_thunk.reg'.  Since we check for __i686__ in the
   33.44 ++ * code, killing '__i686' shouldn't be a problem.
   33.45 ++ */
   33.46 ++#undef __i686
   33.47 ++
   33.48 + #include <sysdeps/generic/sysdep.h>
   33.49 + 
   33.50 + #ifdef	__ASSEMBLER__
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/patches/glibc/2.9/360-2.8-nscd-one-fork.patch	Sun Apr 19 16:17:11 2009 +0000
    34.3 @@ -0,0 +1,45 @@
    34.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1160_all_glibc-2.8-nscd-one-fork.patch
    34.5 +
    34.6 +-= BEGIN original header =-
    34.7 +only fork one to assist in stop-start-daemon assumptions about daemon behavior
    34.8 +
    34.9 +http://bugs.gentoo.org/190785
   34.10 +
   34.11 +-= END original header =-
   34.12 +
   34.13 +diff -durN glibc-2_9.orig/nscd/nscd.c glibc-2_9/nscd/nscd.c
   34.14 +--- glibc-2_9.orig/nscd/nscd.c	2008-03-29 19:08:12.000000000 +0100
   34.15 ++++ glibc-2_9/nscd/nscd.c	2009-02-02 22:01:10.000000000 +0100
   34.16 +@@ -179,6 +179,9 @@
   34.17 +       if (pid != 0)
   34.18 + 	exit (0);
   34.19 + 
   34.20 ++       if (write_pid (_PATH_NSCDPID) < 0)
   34.21 ++	dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
   34.22 ++
   34.23 +       int nullfd = open (_PATH_DEVNULL, O_RDWR);
   34.24 +       if (nullfd != -1)
   34.25 + 	{
   34.26 +@@ -228,12 +231,6 @@
   34.27 + 	for (i = min_close_fd; i < getdtablesize (); i++)
   34.28 + 	  close (i);
   34.29 + 
   34.30 +-      pid = fork ();
   34.31 +-      if (pid == -1)
   34.32 +-	error (EXIT_FAILURE, errno, _("cannot fork"));
   34.33 +-      if (pid != 0)
   34.34 +-	exit (0);
   34.35 +-
   34.36 +       setsid ();
   34.37 + 
   34.38 +       if (chdir ("/") != 0)
   34.39 +@@ -242,9 +239,6 @@
   34.40 + 
   34.41 +       openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
   34.42 + 
   34.43 +-      if (write_pid (_PATH_NSCDPID) < 0)
   34.44 +-        dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
   34.45 +-
   34.46 +       if (!init_logfile ())
   34.47 + 	dbg_log (_("Could not create log file"));
   34.48 + 
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/patches/glibc/2.9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch	Sun Apr 19 16:17:11 2009 +0000
    35.3 @@ -0,0 +1,249 @@
    35.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/1503_hppa_glibc-2.7-hppa-nptl-carlos.patch
    35.5 +
    35.6 +-= BEGIN original header =-
    35.7 +-= END original header =-
    35.8 +
    35.9 +diff -durN glibc-2_9.orig/elf/rtld.c glibc-2_9/elf/rtld.c
   35.10 +--- glibc-2_9.orig/elf/rtld.c	2009-02-02 22:00:34.000000000 +0100
   35.11 ++++ glibc-2_9/elf/rtld.c	2009-02-02 22:01:12.000000000 +0100
   35.12 +@@ -386,14 +386,14 @@
   35.13 +      know it is available.  We do not have to clear the memory if we
   35.14 +      do not have to use the temporary bootstrap_map.  Global variables
   35.15 +      are initialized to zero by default.  */
   35.16 +-#ifndef DONT_USE_BOOTSTRAP_MAP
   35.17 ++#if !defined DONT_USE_BOOTSTRAP_MAP
   35.18 + # ifdef HAVE_BUILTIN_MEMSET
   35.19 +   __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
   35.20 + # else
   35.21 +-  for (size_t cnt = 0;
   35.22 +-       cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
   35.23 +-       ++cnt)
   35.24 +-    bootstrap_map.l_info[cnt] = 0;
   35.25 ++  /* Clear the whole bootstrap_map structure */
   35.26 ++  for (char *cnt = (char *)&(bootstrap_map);
   35.27 ++       cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
   35.28 ++       *cnt++ = '\0');
   35.29 + # endif
   35.30 + # if USE___THREAD
   35.31 +   bootstrap_map.l_tls_modid = 0;
   35.32 +diff -durN glibc-2_9.orig/include/atomic.h glibc-2_9/include/atomic.h
   35.33 +--- glibc-2_9.orig/include/atomic.h	2006-12-21 22:44:00.000000000 +0100
   35.34 ++++ glibc-2_9/include/atomic.h	2009-02-02 22:01:12.000000000 +0100
   35.35 +@@ -174,7 +174,7 @@
   35.36 +      __typeof (*(mem)) __atg5_value = (newvalue);			      \
   35.37 + 									      \
   35.38 +      do									      \
   35.39 +-       __atg5_oldval = *__atg5_memp;					      \
   35.40 ++       __atg5_oldval = *(volatile __typeof (mem))__atg5_memp;		      \
   35.41 +      while (__builtin_expect						      \
   35.42 + 	    (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
   35.43 + 						   __atg5_oldval), 0));	      \
   35.44 +@@ -195,7 +195,7 @@
   35.45 +      __typeof (*(mem)) __atg6_value = (value);				      \
   35.46 + 									      \
   35.47 +      do									      \
   35.48 +-       __atg6_oldval = *__atg6_memp;					      \
   35.49 ++       __atg6_oldval = *(volatile __typeof (mem))__atg6_memp;		      \
   35.50 +      while (__builtin_expect						      \
   35.51 + 	    (atomic_compare_and_exchange_bool_acq (__atg6_memp,		      \
   35.52 + 						   __atg6_oldval	      \
   35.53 +@@ -213,7 +213,7 @@
   35.54 +      __typeof (*(mem)) __atg7_value = (value);				      \
   35.55 + 									      \
   35.56 +      do									      \
   35.57 +-       __atg7_oldv = *__atg7_memp;					      \
   35.58 ++       __atg7_oldv = *(volatile __typeof (mem))__atg7_memp;		      \
   35.59 +      while (__builtin_expect						      \
   35.60 + 	    (catomic_compare_and_exchange_bool_acq (__atg7_memp,	      \
   35.61 + 						    __atg7_oldv		      \
   35.62 +@@ -231,7 +231,7 @@
   35.63 +     __typeof (mem) __atg8_memp = (mem);					      \
   35.64 +     __typeof (*(mem)) __atg8_value = (value);				      \
   35.65 +     do {								      \
   35.66 +-      __atg8_oldval = *__atg8_memp;					      \
   35.67 ++      __atg8_oldval = *(volatile __typeof (mem))__atg8_memp;		      \
   35.68 +       if (__atg8_oldval >= __atg8_value)				      \
   35.69 + 	break;								      \
   35.70 +     } while (__builtin_expect						      \
   35.71 +@@ -248,7 +248,7 @@
   35.72 +     __typeof (mem) __atg9_memp = (mem);					      \
   35.73 +     __typeof (*(mem)) __atg9_value = (value);				      \
   35.74 +     do {								      \
   35.75 +-      __atg9_oldv = *__atg9_memp;					      \
   35.76 ++      __atg9_oldv = *(volatile __typeof (mem))__atg9_memp;		      \
   35.77 +       if (__atg9_oldv >= __atg9_value)					      \
   35.78 + 	break;								      \
   35.79 +     } while (__builtin_expect						      \
   35.80 +@@ -266,7 +266,7 @@
   35.81 +     __typeof (mem) __atg10_memp = (mem);				      \
   35.82 +     __typeof (*(mem)) __atg10_value = (value);				      \
   35.83 +     do {								      \
   35.84 +-      __atg10_oldval = *__atg10_memp;					      \
   35.85 ++      __atg10_oldval = *(volatile __typeof (mem))__atg10_memp;		      \
   35.86 +       if (__atg10_oldval <= __atg10_value)				      \
   35.87 + 	break;								      \
   35.88 +     } while (__builtin_expect						      \
   35.89 +@@ -350,7 +350,7 @@
   35.90 + 									      \
   35.91 +      do									      \
   35.92 +        {								      \
   35.93 +-	 __atg11_oldval = *__atg11_memp;				      \
   35.94 ++	 __atg11_oldval = *(volatile __typeof (mem))__atg11_memp;	      \
   35.95 + 	 if (__builtin_expect (__atg11_oldval <= 0, 0))			      \
   35.96 + 	   break;							      \
   35.97 +        }								      \
   35.98 +@@ -389,7 +389,7 @@
   35.99 +      __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit));	      \
  35.100 + 									      \
  35.101 +      do									      \
  35.102 +-       __atg14_old = (*__atg14_memp);					      \
  35.103 ++       __atg14_old = (*(volatile __typeof (mem))__atg14_memp);		      \
  35.104 +      while (__builtin_expect						      \
  35.105 + 	    (atomic_compare_and_exchange_bool_acq (__atg14_memp,	      \
  35.106 + 						   __atg14_old | __atg14_mask,\
  35.107 +@@ -407,7 +407,7 @@
  35.108 +     __typeof (*(mem)) __atg15_mask = (mask);				      \
  35.109 + 									      \
  35.110 +     do									      \
  35.111 +-      __atg15_old = (*__atg15_memp);					      \
  35.112 ++      __atg15_old = (*(volatile __typeof (mem))__atg15_memp);		      \
  35.113 +     while (__builtin_expect						      \
  35.114 + 	   (atomic_compare_and_exchange_bool_acq (__atg15_memp,		      \
  35.115 + 						  __atg15_old & __atg15_mask, \
  35.116 +@@ -423,7 +423,7 @@
  35.117 +      __typeof (*(mem)) __atg16_mask = (mask);				      \
  35.118 + 									      \
  35.119 +      do									      \
  35.120 +-       __atg16_old = (*__atg16_memp);					      \
  35.121 ++       __atg16_old = (*(volatile __typeof (mem))__atg16_memp);		      \
  35.122 +      while (__builtin_expect						      \
  35.123 + 	    (atomic_compare_and_exchange_bool_acq (__atg16_memp,	      \
  35.124 + 						   __atg16_old & __atg16_mask,\
  35.125 +@@ -441,7 +441,7 @@
  35.126 +     __typeof (*(mem)) __atg17_mask = (mask);				      \
  35.127 + 									      \
  35.128 +     do									      \
  35.129 +-      __atg17_old = (*__atg17_memp);					      \
  35.130 ++      __atg17_old = (*(volatile __typeof (mem))__atg17_memp);		      \
  35.131 +     while (__builtin_expect						      \
  35.132 + 	   (atomic_compare_and_exchange_bool_acq (__atg17_memp,		      \
  35.133 + 						  __atg17_old | __atg17_mask, \
  35.134 +@@ -457,7 +457,7 @@
  35.135 +     __typeof (*(mem)) __atg18_mask = (mask);				      \
  35.136 + 									      \
  35.137 +     do									      \
  35.138 +-      __atg18_old = (*__atg18_memp);					      \
  35.139 ++      __atg18_old = (*(volatile __typeof (mem))__atg18_memp);		      \
  35.140 +     while (__builtin_expect						      \
  35.141 + 	   (catomic_compare_and_exchange_bool_acq (__atg18_memp,	      \
  35.142 + 						   __atg18_old | __atg18_mask,\
  35.143 +@@ -473,7 +473,7 @@
  35.144 +      __typeof (*(mem)) __atg19_mask = (mask);				      \
  35.145 + 									      \
  35.146 +      do									      \
  35.147 +-       __atg19_old = (*__atg19_memp);					      \
  35.148 ++       __atg19_old = (*(volatile __typeof (mem))__atg19_memp);		      \
  35.149 +      while (__builtin_expect						      \
  35.150 + 	    (atomic_compare_and_exchange_bool_acq (__atg19_memp,	      \
  35.151 + 						   __atg19_old | __atg19_mask,\
  35.152 +diff -durN glibc-2_9.orig/nptl/Makefile glibc-2_9/nptl/Makefile
  35.153 +--- glibc-2_9.orig/nptl/Makefile	2008-11-12 14:38:23.000000000 +0100
  35.154 ++++ glibc-2_9/nptl/Makefile	2009-02-02 22:01:12.000000000 +0100
  35.155 +@@ -262,9 +262,9 @@
  35.156 + # Files which must not be linked with libpthread.
  35.157 + tests-nolibpthread = tst-unload
  35.158 + 
  35.159 +-# This sets the stack resource limit to 1023kb, which is not a multiple
  35.160 +-# of the page size since every architecture's page size is > 1k.
  35.161 +-tst-oddstacklimit-ENV = ; ulimit -s 1023;
  35.162 ++# This sets the stack resource limit to 8193kb, which is not a multiple
  35.163 ++# of the page size since every architecture's page size is 4096 bytes.
  35.164 ++tst-oddstacklimit-ENV = ; ulimit -s 8193;
  35.165 + 
  35.166 + distribute = eintr.c tst-cleanup4aux.c
  35.167 + 
  35.168 +@@ -423,6 +423,35 @@
  35.169 + CFLAGS-tst-cleanupx4.c += -fexceptions
  35.170 + CFLAGS-tst-oncex3.c += -fexceptions
  35.171 + CFLAGS-tst-oncex4.c += -fexceptions
  35.172 ++
  35.173 ++ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
  35.174 ++LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
  35.175 ++LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
  35.176 ++LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
  35.177 ++LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
  35.178 ++LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
  35.179 ++LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
  35.180 ++LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
  35.181 ++LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
  35.182 ++LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
  35.183 ++LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
  35.184 ++LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
  35.185 ++LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
  35.186 ++LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
  35.187 ++LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
  35.188 ++LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
  35.189 ++LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
  35.190 ++LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
  35.191 ++LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
  35.192 ++LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
  35.193 ++LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
  35.194 ++LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
  35.195 ++LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
  35.196 ++LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
  35.197 ++LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
  35.198 ++LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
  35.199 ++LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
  35.200 ++
  35.201 + CFLAGS-tst-align.c += $(stack-align-test-flags)
  35.202 + CFLAGS-tst-align3.c += $(stack-align-test-flags)
  35.203 + CFLAGS-tst-initializers1.c = -W -Wall -Werror
  35.204 +diff -durN glibc-2_9.orig/nptl/pthread_barrier_wait.c glibc-2_9/nptl/pthread_barrier_wait.c
  35.205 +--- glibc-2_9.orig/nptl/pthread_barrier_wait.c	2007-08-01 06:18:50.000000000 +0200
  35.206 ++++ glibc-2_9/nptl/pthread_barrier_wait.c	2009-02-02 22:01:12.000000000 +0100
  35.207 +@@ -64,7 +64,7 @@
  35.208 +       do
  35.209 + 	lll_futex_wait (&ibarrier->curr_event, event,
  35.210 + 			ibarrier->private ^ FUTEX_PRIVATE_FLAG);
  35.211 +-      while (event == ibarrier->curr_event);
  35.212 ++      while (event == *(volatile unsigned int *)&ibarrier->curr_event);
  35.213 +     }
  35.214 + 
  35.215 +   /* Make sure the init_count is stored locally or in a register.  */
  35.216 +diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/Makefile glibc-2_9/nptl/sysdeps/pthread/Makefile
  35.217 +--- glibc-2_9.orig/nptl/sysdeps/pthread/Makefile	2006-02-28 08:09:41.000000000 +0100
  35.218 ++++ glibc-2_9/nptl/sysdeps/pthread/Makefile	2009-02-02 22:01:12.000000000 +0100
  35.219 +@@ -41,7 +41,9 @@
  35.220 + 
  35.221 + ifeq ($(have-forced-unwind),yes)
  35.222 + tests += tst-mqueue8x
  35.223 ++ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
  35.224 + CFLAGS-tst-mqueue8x.c += -fexceptions
  35.225 ++LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s) 
  35.226 + endif
  35.227 + endif
  35.228 + 
  35.229 +diff -durN glibc-2_9.orig/stdio-common/Makefile glibc-2_9/stdio-common/Makefile
  35.230 +--- glibc-2_9.orig/stdio-common/Makefile	2008-07-08 18:32:28.000000000 +0200
  35.231 ++++ glibc-2_9/stdio-common/Makefile	2009-02-02 22:01:12.000000000 +0100
  35.232 +@@ -80,7 +80,7 @@
  35.233 + 	$(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
  35.234 + endif
  35.235 + 
  35.236 +-CFLAGS-vfprintf.c = -Wno-uninitialized
  35.237 ++CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
  35.238 + CFLAGS-vfwprintf.c = -Wno-uninitialized
  35.239 + CFLAGS-tst-printf.c = -Wno-format
  35.240 + CFLAGS-tstdiomisc.c = -Wno-format
  35.241 +diff -durN glibc-2_9.orig/sunrpc/clnt_udp.c glibc-2_9/sunrpc/clnt_udp.c
  35.242 +--- glibc-2_9.orig/sunrpc/clnt_udp.c	2008-07-26 10:42:44.000000000 +0200
  35.243 ++++ glibc-2_9/sunrpc/clnt_udp.c	2009-02-02 22:01:12.000000000 +0100
  35.244 +@@ -462,7 +462,7 @@
  35.245 +       while (inlen < 0 && errno == EINTR);
  35.246 +       if (inlen < 0)
  35.247 + 	{
  35.248 +-	  if (errno == EWOULDBLOCK)
  35.249 ++	  if (errno == EWOULDBLOCK || errno == EAGAIN)
  35.250 + 	    continue;
  35.251 + 	  cu->cu_error.re_errno = errno;
  35.252 + 	  return (cu->cu_error.re_status = RPC_CANTRECV);
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/patches/glibc/2.9/380-2.3.6-dl_execstack-PaX-support.patch	Sun Apr 19 16:17:11 2009 +0000
    36.3 @@ -0,0 +1,71 @@
    36.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/3000_all_2.3.6-dl_execstack-PaX-support.patch
    36.5 +
    36.6 +-= BEGIN original header =-
    36.7 +	With latest versions of glibc, a lot of apps failed on a PaX enabled
    36.8 +	system with:
    36.9 +		 cannot enable executable stack as shared object requires: Permission denied
   36.10 +	
   36.11 +	This is due to PaX 'exec-protecting' the stack, and ld.so then trying
   36.12 +	to make the stack executable due to some libraries not containing the
   36.13 +	PT_GNU_STACK section.  Bug #32960.  <azarah@gentoo.org> (12 Nov 2003).
   36.14 +
   36.15 +	Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
   36.16 +
   36.17 +-= END original header =-
   36.18 +
   36.19 +diff -durN glibc-2_9.orig/nptl/allocatestack.c glibc-2_9/nptl/allocatestack.c
   36.20 +--- glibc-2_9.orig/nptl/allocatestack.c	2008-08-16 00:35:27.000000000 +0200
   36.21 ++++ glibc-2_9/nptl/allocatestack.c	2009-02-02 22:01:20.000000000 +0100
   36.22 +@@ -299,7 +299,8 @@
   36.23 + # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
   36.24 + #endif
   36.25 +   if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
   36.26 +-    return errno;
   36.27 ++    if (errno != EACCES) /* PAX is enabled */
   36.28 ++    	return errno;
   36.29 + 
   36.30 +   return 0;
   36.31 + }
   36.32 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c
   36.33 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c	2006-01-08 09:21:15.000000000 +0100
   36.34 ++++ glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c	2009-02-02 22:01:20.000000000 +0100
   36.35 +@@ -63,7 +63,10 @@
   36.36 +       else
   36.37 + # endif
   36.38 + 	{
   36.39 +-	  result = errno;
   36.40 ++	  if (errno == EACCES)  /* PAX is enabled */
   36.41 ++	    result = 0;
   36.42 ++	  else
   36.43 ++	    result = errno;
   36.44 + 	  goto out;
   36.45 + 	}
   36.46 +     }
   36.47 +@@ -89,7 +92,12 @@
   36.48 + 	page -= size;
   36.49 +       else
   36.50 + 	{
   36.51 +-	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
   36.52 ++	  if (errno == EACCES)		/* PAX is enabled */
   36.53 ++	    {
   36.54 ++	      result = 0;
   36.55 ++	      goto out;
   36.56 ++	    }
   36.57 ++	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
   36.58 + 	    {
   36.59 + 	      result = errno;
   36.60 + 	      goto out;
   36.61 +@@ -115,7 +123,12 @@
   36.62 + 	page += size;
   36.63 +       else
   36.64 + 	{
   36.65 +-	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
   36.66 ++	  if (errno == EACCES)		/* PAX is enabled */
   36.67 ++	    {
   36.68 ++	      result = 0;
   36.69 ++	      goto out;
   36.70 ++	    }
   36.71 ++	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
   36.72 + 	    {
   36.73 + 	      result = errno;
   36.74 + 	      goto out;
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/patches/glibc/2.9/390-2.3.3_pre20040117-pt_pax.patch	Sun Apr 19 16:17:11 2009 +0000
    37.3 @@ -0,0 +1,35 @@
    37.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/3010_all_2.3.3_pre20040117-pt_pax.patch
    37.5 +
    37.6 +-= BEGIN original header =-
    37.7 +-= END original header =-
    37.8 +
    37.9 +diff -durN glibc-2_9.orig/elf/elf.h glibc-2_9/elf/elf.h
   37.10 +--- glibc-2_9.orig/elf/elf.h	2008-10-01 21:41:34.000000000 +0200
   37.11 ++++ glibc-2_9/elf/elf.h	2009-02-02 22:01:21.000000000 +0100
   37.12 +@@ -571,6 +571,7 @@
   37.13 + #define PT_GNU_EH_FRAME	0x6474e550	/* GCC .eh_frame_hdr segment */
   37.14 + #define PT_GNU_STACK	0x6474e551	/* Indicates stack executability */
   37.15 + #define PT_GNU_RELRO	0x6474e552	/* Read-only after relocation */
   37.16 ++#define PT_PAX_FLAGS	0x65041580	/* Indicates PaX flag markings */
   37.17 + #define PT_LOSUNW	0x6ffffffa
   37.18 + #define PT_SUNWBSS	0x6ffffffa	/* Sun Specific segment */
   37.19 + #define PT_SUNWSTACK	0x6ffffffb	/* Stack segment */
   37.20 +@@ -584,6 +585,18 @@
   37.21 + #define PF_X		(1 << 0)	/* Segment is executable */
   37.22 + #define PF_W		(1 << 1)	/* Segment is writable */
   37.23 + #define PF_R		(1 << 2)	/* Segment is readable */
   37.24 ++#define PF_PAGEEXEC	(1 << 4)	/* Enable  PAGEEXEC */
   37.25 ++#define PF_NOPAGEEXEC	(1 << 5)	/* Disable PAGEEXEC */
   37.26 ++#define PF_SEGMEXEC	(1 << 6)	/* Enable  SEGMEXEC */
   37.27 ++#define PF_NOSEGMEXEC	(1 << 7)	/* Disable SEGMEXEC */
   37.28 ++#define PF_MPROTECT	(1 << 8)	/* Enable  MPROTECT */
   37.29 ++#define PF_NOMPROTECT	(1 << 9)	/* Disable MPROTECT */
   37.30 ++#define PF_RANDEXEC	(1 << 10)	/* Enable  RANDEXEC */
   37.31 ++#define PF_NORANDEXEC	(1 << 11)	/* Disable RANDEXEC */
   37.32 ++#define PF_EMUTRAMP	(1 << 12)	/* Enable  EMUTRAMP */
   37.33 ++#define PF_NOEMUTRAMP	(1 << 13)	/* Disable EMUTRAMP */
   37.34 ++#define PF_RANDMMAP	(1 << 14)	/* Enable  RANDMMAP */
   37.35 ++#define PF_NORANDMMAP	(1 << 15)	/* Disable RANDMMAP */
   37.36 + #define PF_MASKOS	0x0ff00000	/* OS-specific */
   37.37 + #define PF_MASKPROC	0xf0000000	/* Processor-specific */
   37.38 + 
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/patches/glibc/2.9/400-tests-sandbox-libdl-paths.patch	Sun Apr 19 16:17:11 2009 +0000
    38.3 @@ -0,0 +1,198 @@
    38.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/3020_all_glibc-tests-sandbox-libdl-paths.patch
    38.5 +
    38.6 +-= BEGIN original header =-
    38.7 +when glibc runs its tests, it does so by invoking the local library loader.
    38.8 +in Gentoo, we build/run inside of our "sandbox" which itself is linked against
    38.9 +libdl (so that it can load libraries and pull out symbols).  the trouble
   38.10 +is that when you upgrade from an older glibc to the new one, often times
   38.11 +internal symbols change name or abi.  this is normally OK as you cannot use
   38.12 +libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
   38.13 +we always say "keep all of the glibc libraries from the same build".  but
   38.14 +when glibc runs its tests, it uses dynamic paths to point to its new local
   38.15 +copies of libraries.  if the test doesnt use libdl, then glibc doesnt add
   38.16 +its path, and when sandbox triggers the loading of libdl, glibc does so
   38.17 +from the host system system.  this gets us into the case of all libraries
   38.18 +are from the locally compiled version of glibc except for libdl.so.
   38.19 +
   38.20 +Fix by Wormo
   38.21 +
   38.22 +http://bugs.gentoo.org/56898
   38.23 +
   38.24 +-= END original header =-
   38.25 +
   38.26 +diff -durN glibc-2_9.orig/grp/tst_fgetgrent.sh glibc-2_9/grp/tst_fgetgrent.sh
   38.27 +--- glibc-2_9.orig/grp/tst_fgetgrent.sh	2001-07-06 06:54:46.000000000 +0200
   38.28 ++++ glibc-2_9/grp/tst_fgetgrent.sh	2009-02-02 22:01:23.000000000 +0100
   38.29 +@@ -24,7 +24,8 @@
   38.30 + rtld_installed_name=$1; shift
   38.31 + 
   38.32 + testout=${common_objpfx}/grp/tst_fgetgrent.out
   38.33 +-library_path=${common_objpfx}
   38.34 ++# make sure libdl is also in path in case sandbox is in use
   38.35 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   38.36 + 
   38.37 + result=0
   38.38 + 
   38.39 +diff -durN glibc-2_9.orig/iconvdata/run-iconv-test.sh glibc-2_9/iconvdata/run-iconv-test.sh
   38.40 +--- glibc-2_9.orig/iconvdata/run-iconv-test.sh	2008-05-15 03:59:44.000000000 +0200
   38.41 ++++ glibc-2_9/iconvdata/run-iconv-test.sh	2009-02-02 22:01:23.000000000 +0100
   38.42 +@@ -34,7 +34,7 @@
   38.43 + export GCONV_PATH
   38.44 + 
   38.45 + # We have to have some directories in the library path.
   38.46 +-LIBPATH=$codir:$codir/iconvdata
   38.47 ++LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
   38.48 + 
   38.49 + # How the start the iconv(1) program.
   38.50 + ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
   38.51 +diff -durN glibc-2_9.orig/iconvdata/tst-table.sh glibc-2_9/iconvdata/tst-table.sh
   38.52 +--- glibc-2_9.orig/iconvdata/tst-table.sh	2002-04-24 23:39:35.000000000 +0200
   38.53 ++++ glibc-2_9/iconvdata/tst-table.sh	2009-02-02 22:01:23.000000000 +0100
   38.54 +@@ -59,8 +59,11 @@
   38.55 +   irreversible=${charset}.irreversible
   38.56 + fi
   38.57 + 
   38.58 ++# make sure libdl is also in path in case sandbox is in use
   38.59 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   38.60 ++
   38.61 + # iconv in one direction.
   38.62 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
   38.63 ++${common_objpfx}elf/ld.so --library-path $library_path \
   38.64 + ${objpfx}tst-table-from ${charset} \
   38.65 +   > ${objpfx}tst-${charset}.table
   38.66 + 
   38.67 +diff -durN glibc-2_9.orig/intl/tst-codeset.sh glibc-2_9/intl/tst-codeset.sh
   38.68 +--- glibc-2_9.orig/intl/tst-codeset.sh	2005-04-06 04:18:35.000000000 +0200
   38.69 ++++ glibc-2_9/intl/tst-codeset.sh	2009-02-02 22:01:23.000000000 +0100
   38.70 +@@ -37,6 +37,9 @@
   38.71 + LOCPATH=${common_objpfx}localedata
   38.72 + export LOCPATH
   38.73 + 
   38.74 ++# make sure libdl is also in path in case sandbox is in use
   38.75 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   38.76 ++
   38.77 + ${common_objpfx}elf/ld.so --library-path $common_objpfx \
   38.78 + ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
   38.79 + 
   38.80 +diff -durN glibc-2_9.orig/intl/tst-gettext.sh glibc-2_9/intl/tst-gettext.sh
   38.81 +--- glibc-2_9.orig/intl/tst-gettext.sh	2004-08-15 21:28:18.000000000 +0200
   38.82 ++++ glibc-2_9/intl/tst-gettext.sh	2009-02-02 22:01:23.000000000 +0100
   38.83 +@@ -51,9 +51,12 @@
   38.84 + LOCPATH=${common_objpfx}localedata
   38.85 + export LOCPATH
   38.86 + 
   38.87 ++# make sure libdl is also in path in case sandbox is in use
   38.88 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
   38.89 ++
   38.90 + # Now run the test.
   38.91 + MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
   38.92 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
   38.93 ++${common_objpfx}elf/ld.so --library-path $library_path \
   38.94 + ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
   38.95 + 
   38.96 + exit $?
   38.97 +diff -durN glibc-2_9.orig/intl/tst-gettext2.sh glibc-2_9/intl/tst-gettext2.sh
   38.98 +--- glibc-2_9.orig/intl/tst-gettext2.sh	2005-05-04 19:54:48.000000000 +0200
   38.99 ++++ glibc-2_9/intl/tst-gettext2.sh	2009-02-02 22:01:23.000000000 +0100
  38.100 +@@ -65,8 +65,11 @@
  38.101 + LOCPATH=${objpfx}domaindir
  38.102 + export LOCPATH
  38.103 + 
  38.104 ++# make sure libdl is also in path in case sandbox is in use
  38.105 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  38.106 ++
  38.107 + # Now run the test.
  38.108 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
  38.109 ++${common_objpfx}elf/ld.so --library-path $library_path \
  38.110 + ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
  38.111 + cmp ${objpfx}tst-gettext2.out - <<EOF
  38.112 + String1 - Lang1: 1st string
  38.113 +diff -durN glibc-2_9.orig/intl/tst-translit.sh glibc-2_9/intl/tst-translit.sh
  38.114 +--- glibc-2_9.orig/intl/tst-translit.sh	2005-05-04 19:56:10.000000000 +0200
  38.115 ++++ glibc-2_9/intl/tst-translit.sh	2009-02-02 22:01:23.000000000 +0100
  38.116 +@@ -36,7 +36,10 @@
  38.117 + LOCPATH=${common_objpfx}localedata
  38.118 + export LOCPATH
  38.119 + 
  38.120 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
  38.121 ++# make sure libdl is also in path in case sandbox is in use
  38.122 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  38.123 ++
  38.124 ++${common_objpfx}elf/ld.so --library-path $library_path \
  38.125 + ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
  38.126 + 
  38.127 + exit $?
  38.128 +diff -durN glibc-2_9.orig/malloc/tst-mtrace.sh glibc-2_9/malloc/tst-mtrace.sh
  38.129 +--- glibc-2_9.orig/malloc/tst-mtrace.sh	2005-10-15 01:40:35.000000000 +0200
  38.130 ++++ glibc-2_9/malloc/tst-mtrace.sh	2009-02-02 22:01:23.000000000 +0100
  38.131 +@@ -24,9 +24,12 @@
  38.132 + status=0
  38.133 + trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
  38.134 + 
  38.135 ++# make sure libdl is also in path in case sandbox is in use
  38.136 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  38.137 ++
  38.138 + MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
  38.139 + LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
  38.140 +-${common_objpfx}elf/ld.so --library-path $common_objpfx \
  38.141 ++${common_objpfx}elf/ld.so --library-path $library_path \
  38.142 +   ${common_objpfx}malloc/tst-mtrace || status=1
  38.143 + 
  38.144 + if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
  38.145 +diff -durN glibc-2_9.orig/nptl/tst-tls6.sh glibc-2_9/nptl/tst-tls6.sh
  38.146 +--- glibc-2_9.orig/nptl/tst-tls6.sh	2003-09-03 00:02:59.000000000 +0200
  38.147 ++++ glibc-2_9/nptl/tst-tls6.sh	2009-02-02 22:01:23.000000000 +0100
  38.148 +@@ -5,8 +5,8 @@
  38.149 + rtld_installed_name=$1; shift
  38.150 + logfile=$common_objpfx/nptl/tst-tls6.out
  38.151 + 
  38.152 +-# We have to find libc and nptl
  38.153 +-library_path=${common_objpfx}:${common_objpfx}nptl
  38.154 ++# We have to find libc and nptl (also libdl in case sandbox is in use)
  38.155 ++library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
  38.156 + tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
  38.157 + 	  ${common_objpfx}/nptl/tst-tls5"
  38.158 + 
  38.159 +diff -durN glibc-2_9.orig/posix/globtest.sh glibc-2_9/posix/globtest.sh
  38.160 +--- glibc-2_9.orig/posix/globtest.sh	2007-02-14 20:52:33.000000000 +0100
  38.161 ++++ glibc-2_9/posix/globtest.sh	2009-02-02 22:01:23.000000000 +0100
  38.162 +@@ -18,7 +18,7 @@
  38.163 + esac
  38.164 + 
  38.165 + # We have to find the libc and the NSS modules.
  38.166 +-library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
  38.167 ++library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
  38.168 + 
  38.169 + # Since we use `sort' we must make sure to use the same locale everywhere.
  38.170 + LC_ALL=C
  38.171 +diff -durN glibc-2_9.orig/posix/tst-getconf.sh glibc-2_9/posix/tst-getconf.sh
  38.172 +--- glibc-2_9.orig/posix/tst-getconf.sh	2002-09-01 13:11:25.000000000 +0200
  38.173 ++++ glibc-2_9/posix/tst-getconf.sh	2009-02-02 22:01:23.000000000 +0100
  38.174 +@@ -10,7 +10,10 @@
  38.175 + else
  38.176 +   rtld_installed_name=$1; shift
  38.177 +   runit() {
  38.178 +-    ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
  38.179 ++    
  38.180 ++  # make sure libdl is also in path in case sandbox is in use
  38.181 ++  library_path=${common_objpfx}:${common_objpfx}/dlfcn
  38.182 ++    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
  38.183 +   }
  38.184 + fi
  38.185 + 
  38.186 +diff -durN glibc-2_9.orig/posix/wordexp-tst.sh glibc-2_9/posix/wordexp-tst.sh
  38.187 +--- glibc-2_9.orig/posix/wordexp-tst.sh	2000-10-20 18:23:30.000000000 +0200
  38.188 ++++ glibc-2_9/posix/wordexp-tst.sh	2009-02-02 22:01:23.000000000 +0100
  38.189 +@@ -19,8 +19,11 @@
  38.190 + "
  38.191 + export IFS
  38.192 + 
  38.193 ++# make sure libdl is also in path in case sandbox is in use
  38.194 ++library_path=${common_objpfx}:${common_objpfx}/dlfcn
  38.195 ++
  38.196 + failed=0
  38.197 +-${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
  38.198 ++${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
  38.199 + ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
  38.200 + cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
  38.201 + wordexp returned 0
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/patches/glibc/2.9/410-2.9-fnmatch.patch	Sun Apr 19 16:17:11 2009 +0000
    39.3 @@ -0,0 +1,64 @@
    39.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/5021_all_2.9-fnmatch.patch
    39.5 +
    39.6 +-= BEGIN original header =-
    39.7 +http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
    39.8 +
    39.9 +When fnmatch detects an invalid multibyte character it should fall back to
   39.10 +single byte matching, so that "*" has a chance to match such a string.
   39.11 +
   39.12 +Andreas.
   39.13 +
   39.14 +2005-04-12  Andreas Schwab  <schwab@suse.de>
   39.15 +
   39.16 +	* posix/fnmatch.c (fnmatch): If conversion to wide character
   39.17 +	fails fall back to single byte matching.
   39.18 +
   39.19 +-= END original header =-
   39.20 +
   39.21 +diff -durN glibc-2_9.orig/posix/fnmatch.c glibc-2_9/posix/fnmatch.c
   39.22 +--- glibc-2_9.orig/posix/fnmatch.c	2007-07-28 22:35:00.000000000 +0200
   39.23 ++++ glibc-2_9/posix/fnmatch.c	2009-02-02 22:01:25.000000000 +0100
   39.24 +@@ -327,6 +327,7 @@
   39.25 + # if HANDLE_MULTIBYTE
   39.26 +   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
   39.27 +     {
   39.28 ++      const char *orig_pattern = pattern;
   39.29 +       mbstate_t ps;
   39.30 +       size_t n;
   39.31 +       const char *p;
   39.32 +@@ -382,10 +383,8 @@
   39.33 + 	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
   39.34 + 	  n = mbsrtowcs (wstring, &p, n + 1, &ps);
   39.35 + 	  if (__builtin_expect (n == (size_t) -1, 0))
   39.36 +-	    /* Something wrong.
   39.37 +-	       XXX Do we have to set `errno' to something which mbsrtows hasn't
   39.38 +-	       already done?  */
   39.39 +-	    return -1;
   39.40 ++	    /* Something wrong.  Fall back to single byte matching.  */
   39.41 ++	    goto try_singlebyte;
   39.42 + 	  if (p)
   39.43 + 	    {
   39.44 + 	      memset (&ps, '\0', sizeof (ps));
   39.45 +@@ -397,10 +396,8 @@
   39.46 + 	prepare_wstring:
   39.47 + 	  n = mbsrtowcs (NULL, &string, 0, &ps);
   39.48 + 	  if (__builtin_expect (n == (size_t) -1, 0))
   39.49 +-	    /* Something wrong.
   39.50 +-	       XXX Do we have to set `errno' to something which mbsrtows hasn't
   39.51 +-	       already done?  */
   39.52 +-	    return -1;
   39.53 ++	    /* Something wrong.  Fall back to single byte matching.  */
   39.54 ++	    goto try_singlebyte;
   39.55 + 	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
   39.56 + 	  assert (mbsinit (&ps));
   39.57 + 	  (void) mbsrtowcs (wstring, &string, n + 1, &ps);
   39.58 +@@ -408,6 +405,9 @@
   39.59 + 
   39.60 +       return internal_fnwmatch (wpattern, wstring, wstring + n,
   39.61 + 				flags & FNM_PERIOD, flags, NULL);
   39.62 ++
   39.63 ++    try_singlebyte:
   39.64 ++      pattern = orig_pattern;
   39.65 +     }
   39.66 + # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
   39.67 + 
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/patches/glibc/2.9/420-dont-build-timezone.patch	Sun Apr 19 16:17:11 2009 +0000
    40.3 @@ -0,0 +1,19 @@
    40.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/5063_all_glibc-dont-build-timezone.patch
    40.5 +
    40.6 +-= BEGIN original header =-
    40.7 +timezone data has been split into the package sys-libs/timezone-data
    40.8 +
    40.9 +-= END original header =-
   40.10 +
   40.11 +diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
   40.12 +--- glibc-2_9.orig/Makeconfig	2009-02-02 22:01:05.000000000 +0100
   40.13 ++++ glibc-2_9/Makeconfig	2009-02-02 22:01:27.000000000 +0100
   40.14 +@@ -919,7 +919,7 @@
   40.15 + 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
   40.16 + 	      grp pwd posix io termios resource misc socket sysvipc gmon    \
   40.17 + 	      gnulib iconv iconvdata wctype manual shadow po argp	    \
   40.18 +-	      crypt nss localedata timezone rt conform debug		    \
   40.19 ++	      crypt nss localedata rt conform debug		    \
   40.20 + 	      $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
   40.21 + 
   40.22 + ifndef avoid-generated
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/patches/glibc/2.9/430-2.7-cross-compile-nptl.patch	Sun Apr 19 16:17:11 2009 +0000
    41.3 @@ -0,0 +1,57 @@
    41.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/5070_all_glibc-2.7-cross-compile-nptl.patch
    41.5 +
    41.6 +-= BEGIN original header =-
    41.7 +A little hack for cross-compiling NPTL
    41.8 +
    41.9 +http://sourceware.org/ml/libc-alpha/2005-02/msg00043.html
   41.10 +
   41.11 +-= END original header =-
   41.12 +
   41.13 +diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/configure glibc-2_9/nptl/sysdeps/pthread/configure
   41.14 +--- glibc-2_9.orig/nptl/sysdeps/pthread/configure	2007-10-17 00:24:30.000000000 +0200
   41.15 ++++ glibc-2_9/nptl/sysdeps/pthread/configure	2009-02-02 22:01:28.000000000 +0100
   41.16 +@@ -78,6 +78,10 @@
   41.17 + fi
   41.18 + { echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
   41.19 + echo "${ECHO_T}$libc_cv_forced_unwind" >&6; }
   41.20 ++if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
   41.21 ++  echo "$as_me:$LINENO: forcing libc_cv_forced_unwind = yes for cross-compile"
   41.22 ++  libc_cv_forced_unwind=yes
   41.23 ++fi
   41.24 + if test $libc_cv_forced_unwind = yes; then
   41.25 +   cat >>confdefs.h <<\_ACEOF
   41.26 + #define HAVE_FORCED_UNWIND 1
   41.27 +@@ -141,6 +145,10 @@
   41.28 + { echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
   41.29 + echo "${ECHO_T}$libc_cv_c_cleanup" >&6; }
   41.30 +   CFLAGS="$old_CFLAGS"
   41.31 ++  if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
   41.32 ++    echo "$as_me:$LINENO: result: forcing libc_cv_c_cleanup = yes for cross-compile"
   41.33 ++    libc_cv_c_cleanup=yes
   41.34 ++  fi
   41.35 +   if test $libc_cv_c_cleanup = no; then
   41.36 +     { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5
   41.37 + echo "$as_me: error: the compiler must support C cleanup handling" >&2;}
   41.38 +diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/configure.in glibc-2_9/nptl/sysdeps/pthread/configure.in
   41.39 +--- glibc-2_9.orig/nptl/sysdeps/pthread/configure.in	2003-12-03 07:50:01.000000000 +0100
   41.40 ++++ glibc-2_9/nptl/sysdeps/pthread/configure.in	2009-02-02 22:01:28.000000000 +0100
   41.41 +@@ -28,6 +28,9 @@
   41.42 + struct _Unwind_Context *context;
   41.43 + _Unwind_GetCFA (context)],
   41.44 + libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
   41.45 ++if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
   41.46 ++  libc_cv_forced_unwind=yes
   41.47 ++fi
   41.48 + if test $libc_cv_forced_unwind = yes; then
   41.49 +   AC_DEFINE(HAVE_FORCED_UNWIND)
   41.50 + dnl Check for C cleanup handling.
   41.51 +@@ -41,6 +44,9 @@
   41.52 +   puts ("test")],
   41.53 + libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
   41.54 +   CFLAGS="$old_CFLAGS"
   41.55 ++  if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
   41.56 ++    libc_cv_c_cleanup=yes
   41.57 ++  fi
   41.58 +   if test $libc_cv_c_cleanup = no; then
   41.59 +     AC_MSG_ERROR([the compiler must support C cleanup handling])
   41.60 +   fi
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/patches/glibc/2.9/440-alpha-glibc-2.4-xstat.patch	Sun Apr 19 16:17:11 2009 +0000
    42.3 @@ -0,0 +1,249 @@
    42.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/6001_all_alpha-glibc-2.4-xstat.patch
    42.5 +
    42.6 +-= BEGIN original header =-
    42.7 +http://sources.redhat.com/bugzilla/show_bug.cgi?id=1026
    42.8 +http://sourceware.org/ml/libc-alpha/2005-02/msg00122.html
    42.9 +
   42.10 +2005-02-26  GOTO Masanori  <gotom@debian.or.jp>
   42.11 +
   42.12 +	* sysdeps/unix/sysv/linux/kernel-features.h: Define
   42.13 +	__ASSUME_STAT64_SYSCALL.
   42.14 +	* sysdeps/unix/sysv/linux/alpha/fxstat.c: Check
   42.15 +	__ASSUME_STAT64_SYSCALL.
   42.16 +	* sysdeps/unix/sysv/linux/alpha/fxstatat.c: Likewise.
   42.17 +	* sysdeps/unix/sysv/linux/alpha/lxstat.c: Likewise.
   42.18 +	* sysdeps/unix/sysv/linux/alpha/xstat.c: Likewise.
   42.19 +	* sysdeps/unix/sysv/linux/alpha/xstatconv.c: Don't define
   42.20 +	__libc_missing_axp_stat64 when it's not needed.
   42.21 +	* sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
   42.22 +
   42.23 +-= END original header =-
   42.24 +
   42.25 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstat.c
   42.26 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c	2004-03-11 03:58:44.000000000 +0100
   42.27 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstat.c	2009-02-02 22:01:30.000000000 +0100
   42.28 +@@ -35,27 +35,39 @@
   42.29 + __fxstat (int vers, int fd, struct stat *buf)
   42.30 + {
   42.31 +   INTERNAL_SYSCALL_DECL (err);
   42.32 +-  int result, errno_out;
   42.33 ++  int result;
   42.34 +   struct kernel_stat kbuf;
   42.35 + 
   42.36 ++#if __ASSUME_STAT64_SYSCALL > 0
   42.37 ++  if (vers == _STAT_VER_KERNEL64)
   42.38 ++    {
   42.39 ++      result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
   42.40 ++      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   42.41 ++	return result;
   42.42 ++      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
   42.43 ++      return -1;
   42.44 ++    }
   42.45 ++#elif defined __NR_fstat64
   42.46 +   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
   42.47 +     {
   42.48 ++      int errno_out;
   42.49 +       result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
   42.50 +       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   42.51 + 	return result;
   42.52 +       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
   42.53 +       if (errno_out != ENOSYS)
   42.54 +-	goto fail;
   42.55 ++	{
   42.56 ++	  __set_errno (errno_out);
   42.57 ++	  return -1;
   42.58 ++	}
   42.59 +       __libc_missing_axp_stat64 = 1;
   42.60 +     }
   42.61 ++#endif
   42.62 + 
   42.63 +   result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
   42.64 +   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   42.65 +     return __xstat_conv (vers, &kbuf, buf);
   42.66 +-  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
   42.67 +-  
   42.68 +- fail:
   42.69 +-  __set_errno (errno_out);
   42.70 ++  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
   42.71 +   return -1;
   42.72 + }
   42.73 + hidden_def (__fxstat)
   42.74 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstatat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstatat.c
   42.75 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstatat.c	2006-02-20 23:51:48.000000000 +0100
   42.76 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstatat.c	2009-02-02 22:01:30.000000000 +0100
   42.77 +@@ -65,6 +65,20 @@
   42.78 +   int result, errno_out;
   42.79 +   struct kernel_stat kst;
   42.80 + 
   42.81 ++#if __ASSUME_STAT64_SYSCALL > 0
   42.82 ++  if (vers == _STAT_VER_KERNEL64)
   42.83 ++    {
   42.84 ++      if (flag & AT_SYMLINK_NOFOLLOW)
   42.85 ++	result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
   42.86 ++      else
   42.87 ++	result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
   42.88 ++
   42.89 ++      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   42.90 ++	return result;
   42.91 ++      errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
   42.92 ++      goto fail;
   42.93 ++    }
   42.94 ++#elif defined __NR_stat64
   42.95 +   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
   42.96 +     {
   42.97 +       if (flag & AT_SYMLINK_NOFOLLOW)
   42.98 +@@ -79,6 +93,7 @@
   42.99 + 	goto fail;
  42.100 +       __libc_missing_axp_stat64 = 1;
  42.101 +     }
  42.102 ++#endif
  42.103 + 
  42.104 +   if (flag & AT_SYMLINK_NOFOLLOW)
  42.105 +     result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
  42.106 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/lxstat.c
  42.107 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c	2004-03-11 03:58:44.000000000 +0100
  42.108 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/lxstat.c	2009-02-02 22:01:30.000000000 +0100
  42.109 +@@ -35,27 +35,39 @@
  42.110 + __lxstat (int vers, const char *name, struct stat *buf)
  42.111 + {
  42.112 +   INTERNAL_SYSCALL_DECL (err);
  42.113 +-  int result, errno_out;
  42.114 ++  int result;
  42.115 +   struct kernel_stat kbuf;
  42.116 + 
  42.117 ++#if __ASSUME_STAT64_SYSCALL > 0
  42.118 ++  if (vers == _STAT_VER_KERNEL64)
  42.119 ++    {
  42.120 ++      result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
  42.121 ++      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  42.122 ++	return result;
  42.123 ++      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  42.124 ++      return -1;
  42.125 ++    }
  42.126 ++#elif defined __NR_lstat64
  42.127 +   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
  42.128 +     {
  42.129 ++      int errno_out;
  42.130 +       result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
  42.131 +       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  42.132 + 	return result;
  42.133 +       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  42.134 +       if (errno_out != ENOSYS)
  42.135 +-	goto fail;
  42.136 ++	{
  42.137 ++	  __set_errno (errno_out);
  42.138 ++	  return -1;
  42.139 ++	}
  42.140 +       __libc_missing_axp_stat64 = 1;
  42.141 +     }
  42.142 ++#endif
  42.143 + 
  42.144 +   result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
  42.145 +   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  42.146 +     return __xstat_conv (vers, &kbuf, buf);
  42.147 +-  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  42.148 +-  
  42.149 +- fail:
  42.150 +-  __set_errno (errno_out);
  42.151 ++  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  42.152 +   return -1;
  42.153 + }
  42.154 + hidden_def (__lxstat)
  42.155 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstat.c
  42.156 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstat.c	2004-03-11 03:58:44.000000000 +0100
  42.157 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstat.c	2009-02-02 22:01:30.000000000 +0100
  42.158 +@@ -35,27 +35,39 @@
  42.159 + __xstat (int vers, const char *name, struct stat *buf)
  42.160 + {
  42.161 +   INTERNAL_SYSCALL_DECL (err);
  42.162 +-  int result, errno_out;
  42.163 ++  int result;
  42.164 +   struct kernel_stat kbuf;
  42.165 + 
  42.166 ++#if __ASSUME_STAT64_SYSCALL > 0
  42.167 ++  if (vers == _STAT_VER_KERNEL64)
  42.168 ++    {
  42.169 ++      result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
  42.170 ++      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  42.171 ++	return result;
  42.172 ++      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  42.173 ++      return -1;
  42.174 ++    }
  42.175 ++#elif defined __NR_stat64
  42.176 +   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
  42.177 +     {
  42.178 ++      int errno_out;
  42.179 +       result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
  42.180 +       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  42.181 + 	return result;
  42.182 +       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  42.183 +       if (errno_out != ENOSYS)
  42.184 +-	goto fail;
  42.185 ++	{
  42.186 ++	  __set_errno (errno_out);
  42.187 ++	  return -1;
  42.188 ++	}
  42.189 +       __libc_missing_axp_stat64 = 1;
  42.190 +     }
  42.191 ++#endif
  42.192 + 
  42.193 +   result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
  42.194 +   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  42.195 +     return __xstat_conv (vers, &kbuf, buf);
  42.196 +-  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  42.197 +-  
  42.198 +- fail:
  42.199 +-  __set_errno (errno_out);
  42.200 ++  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  42.201 +   return -1;
  42.202 + }
  42.203 + hidden_def (__xstat)
  42.204 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.c
  42.205 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.c	2004-03-11 03:58:44.000000000 +0100
  42.206 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.c	2009-02-02 22:01:30.000000000 +0100
  42.207 +@@ -22,9 +22,14 @@
  42.208 + #include <sys/stat.h>
  42.209 + #include <kernel_stat.h>
  42.210 + #include <xstatconv.h>
  42.211 ++#include <sys/syscall.h>
  42.212 + 
  42.213 + 
  42.214 ++#ifdef __NR_stat64
  42.215 ++# if __ASSUME_STAT64_SYSCALL == 0
  42.216 + int __libc_missing_axp_stat64;
  42.217 ++# endif
  42.218 ++#endif
  42.219 + 
  42.220 + int
  42.221 + __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
  42.222 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.h
  42.223 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.h	2006-01-08 09:21:16.000000000 +0100
  42.224 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.h	2009-02-02 22:01:30.000000000 +0100
  42.225 +@@ -18,7 +18,12 @@
  42.226 +    02111-1307 USA.  */
  42.227 + 
  42.228 + #include <kernel-features.h>
  42.229 ++#include <sys/syscall.h>
  42.230 + 
  42.231 ++#ifdef __NR_stat64
  42.232 ++# if __ASSUME_STAT64_SYSCALL == 0
  42.233 + extern int __libc_missing_axp_stat64 attribute_hidden;
  42.234 ++# endif
  42.235 ++#endif
  42.236 + extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
  42.237 +   attribute_hidden;
  42.238 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2_9/sysdeps/unix/sysv/linux/kernel-features.h
  42.239 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/kernel-features.h	2008-08-01 23:51:04.000000000 +0200
  42.240 ++++ glibc-2_9/sysdeps/unix/sysv/linux/kernel-features.h	2009-02-02 22:01:30.000000000 +0100
  42.241 +@@ -395,6 +395,11 @@
  42.242 + # define __ASSUME_GETDENTS32_D_TYPE	1
  42.243 + #endif
  42.244 + 
  42.245 ++/* Starting with version 2.6.4, alpha stat64 syscalls are available.  */
  42.246 ++#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
  42.247 ++# define __ASSUME_STAT64_SYSCALL	1
  42.248 ++#endif
  42.249 ++
  42.250 + /* Starting with version 2.5.3, the initial location returned by `brk'
  42.251 +    after exec is always rounded up to the next page.  */
  42.252 + #if __LINUX_KERNEL_VERSION >= 132355
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/patches/glibc/2.9/450-alpha-glibc-2.5-no-page-header.patch	Sun Apr 19 16:17:11 2009 +0000
    43.3 @@ -0,0 +1,32 @@
    43.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/6015_all_alpha-glibc-2.5-no-page-header.patch
    43.5 +
    43.6 +-= BEGIN original header =-
    43.7 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    43.8 +
    43.9 +	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   43.10 +	from the kernel header to sys/user.h and remove the #include of
   43.11 +	sys/user.h.
   43.12 +
   43.13 +-= END original header =-
   43.14 +
   43.15 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/user.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/user.h
   43.16 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/user.h	2001-07-06 06:56:13.000000000 +0200
   43.17 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/user.h	2009-02-02 22:01:32.000000000 +0100
   43.18 +@@ -23,7 +23,6 @@
   43.19 +    only. Don't read too much into it. Don't use it for anything other
   43.20 +    than gdb/strace unless you know what you are doing. */
   43.21 + 
   43.22 +-#include <asm/page.h>
   43.23 + #include <asm/reg.h>
   43.24 + 
   43.25 + struct user
   43.26 +@@ -41,6 +40,9 @@
   43.27 +   char u_comm[32];				/* user command name */
   43.28 + };
   43.29 + 
   43.30 ++#define PAGE_SHIFT		13
   43.31 ++#define PAGE_SIZE		(1 << PAGE_SHIFT)
   43.32 ++#define PAGE_MASK		(~(PAGE_SIZE-1))
   43.33 + #define NBPG			PAGE_SIZE
   43.34 + #define UPAGES			1
   43.35 + #define HOST_TEXT_START_ADDR	(u.start_code)
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/patches/glibc/2.9/460-alpha-glibc-2.5-no-asm-elf-header.patch	Sun Apr 19 16:17:11 2009 +0000
    44.3 @@ -0,0 +1,38 @@
    44.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/6016_all_alpha-glibc-2.5-no-asm-elf-header.patch
    44.5 +
    44.6 +-= BEGIN original header =-
    44.7 +2007-03-13  Mike Frysinger  <vapier@gentoo.org>
    44.8 +
    44.9 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some defines
   44.10 +	from alpha's asm/elf.h
   44.11 +
   44.12 +-= END original header =-
   44.13 +
   44.14 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/procfs.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
   44.15 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/procfs.h	2001-07-06 06:56:13.000000000 +0200
   44.16 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/procfs.h	2009-02-02 22:01:33.000000000 +0100
   44.17 +@@ -29,10 +29,23 @@
   44.18 + #include <sys/types.h>
   44.19 + #include <sys/ucontext.h>
   44.20 + #include <sys/user.h>
   44.21 +-#include <asm/elf.h>
   44.22 + 
   44.23 + __BEGIN_DECLS
   44.24 + 
   44.25 ++/*
   44.26 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
   44.27 ++ * I have no idea why that is so.  For now, we just leave it at 33
   44.28 ++ * (32 general regs + processor status word). 
   44.29 ++ */
   44.30 ++#define ELF_NGREG	33
   44.31 ++#define ELF_NFPREG	32
   44.32 ++
   44.33 ++typedef unsigned long elf_greg_t;
   44.34 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
   44.35 ++
   44.36 ++typedef double elf_fpreg_t;
   44.37 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
   44.38 ++
   44.39 + struct elf_siginfo
   44.40 +   {
   44.41 +     int si_signo;			/* Signal number.  */
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/patches/glibc/2.9/470-alpha-glibc-2.8-creat.patch	Sun Apr 19 16:17:11 2009 +0000
    45.3 @@ -0,0 +1,19 @@
    45.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/6017_all_alpha-glibc-2.8-creat.patch
    45.5 +
    45.6 +-= BEGIN original header =-
    45.7 +alpha does not have a __NR_creat
    45.8 +
    45.9 +http://bugs.gentoo.org/227275
   45.10 +http://sourceware.org/bugzilla/show_bug.cgi?id=6650
   45.11 +
   45.12 +-= END original header =-
   45.13 +
   45.14 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c glibc-2_9/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
   45.15 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c	2007-11-10 20:34:26.000000000 +0100
   45.16 ++++ glibc-2_9/sysdeps/unix/sysv/linux/wordsize-64/creat64.c	2009-02-02 22:01:35.000000000 +0100
   45.17 +@@ -1 +1,5 @@
   45.18 + /* Defined as alias for the syscall.  */
   45.19 ++#include <sysdep.h>
   45.20 ++#ifndef __NR_creat
   45.21 ++#include "../../../../../io/creat64.c"
   45.22 ++#endif
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/patches/glibc/2.9/480-alpha-glibc-2.8-cache-shape.patch	Sun Apr 19 16:17:11 2009 +0000
    46.3 @@ -0,0 +1,18 @@
    46.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/6018_all_alpha-glibc-2.8-cache-shape.patch
    46.5 +
    46.6 +-= BEGIN original header =-
    46.7 +older verisons of glibc would build dl-sysdep as shared-only and dl-support as
    46.8 +static-only.  alpha hooks in a cache variable via dl-auxv.h.  newer versions of
    46.9 +glibc build dl-sysdep as both shared and static which means we now have symbol
   46.10 +duplication for static builds with dl-sysdep and dl-support.  since dl-sysdep
   46.11 +is both shared/static, there is no point in hooking dl-support anymore, so we
   46.12 +can punt it.
   46.13 +
   46.14 +-= END original header =-
   46.15 +
   46.16 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/dl-support.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/dl-support.c
   46.17 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/dl-support.c	2007-03-13 22:25:16.000000000 +0100
   46.18 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/dl-support.c	2009-02-02 22:01:37.000000000 +0100
   46.19 +@@ -1,2 +0,0 @@
   46.20 +-#include "dl-auxv.h"
   46.21 +-#include <elf/dl-support.c>
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/patches/glibc/2.9/490-ptr-mangling.patch	Sun Apr 19 16:17:11 2009 +0000
    47.3 @@ -0,0 +1,114 @@
    47.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/6018_all_glibc-ptr-mangling.patch
    47.5 +
    47.6 +-= BEGIN original header =-
    47.7 +http://bugs.gentoo.org/201910
    47.8 +
    47.9 +For every arch, PTR_MANGLE and PTR_DEMANGLE defines are in
   47.10 +sysdeps/unix/sysv/linux/<arch>/sysdep.h. But for alpha this is not true. The
   47.11 +defines are in sysdeps/unix/alpha/sysdep.h and unix/sysv/linux/alpha/sysdep.h
   47.12 +includes the first.
   47.13 +
   47.14 +This is a patch that fixes the issue and let alpha build, at the expense of
   47.15 +disabling MANGLING in the non PIC case, but googling showed that the issue is
   47.16 +known, and that nobody really cares about it. 
   47.17 +
   47.18 +Info from: http://sourceware.org/bugzilla/show_bug.cgi?id=5216
   47.19 +
   47.20 +-= END original header =-
   47.21 +
   47.22 +diff -durN glibc-2_9.orig/sysdeps/unix/alpha/sysdep.h glibc-2_9/sysdeps/unix/alpha/sysdep.h
   47.23 +--- glibc-2_9.orig/sysdeps/unix/alpha/sysdep.h	2006-03-03 12:21:28.000000000 +0100
   47.24 ++++ glibc-2_9/sysdeps/unix/alpha/sysdep.h	2009-02-02 22:01:39.000000000 +0100
   47.25 +@@ -397,42 +397,4 @@
   47.26 + 	_sc_ret = _sc_0, _sc_err = _sc_19;			\
   47.27 + }
   47.28 + 
   47.29 +-/* Pointer mangling support.  Note that tls access is slow enough that
   47.30 +-   we don't deoptimize things by placing the pointer check value there.  */
   47.31 +-
   47.32 +-#include <stdint.h>
   47.33 +-
   47.34 +-#if defined NOT_IN_libc && defined IS_IN_rtld
   47.35 +-# ifdef __ASSEMBLER__
   47.36 +-#  define PTR_MANGLE(dst, src, tmp)				\
   47.37 +-	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
   47.38 +-	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
   47.39 +-	xor	src, tmp, dst
   47.40 +-#  define PTR_MANGLE2(dst, src, tmp)				\
   47.41 +-	xor	src, tmp, dst
   47.42 +-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
   47.43 +-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
   47.44 +-# else
   47.45 +-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
   47.46 +-#  define PTR_MANGLE(var)	\
   47.47 +-  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
   47.48 +-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
   47.49 +-# endif
   47.50 +-#elif defined PIC
   47.51 +-# ifdef __ASSEMBLER__
   47.52 +-#  define PTR_MANGLE(dst, src, tmp)		\
   47.53 +-	ldq	tmp, __pointer_chk_guard;	\
   47.54 +-	xor	src, tmp, dst
   47.55 +-#  define PTR_MANGLE2(dst, src, tmp)		\
   47.56 +-	xor	src, tmp, dst
   47.57 +-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
   47.58 +-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
   47.59 +-# else
   47.60 +-extern uintptr_t __pointer_chk_guard attribute_relro;
   47.61 +-#  define PTR_MANGLE(var)	\
   47.62 +-	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
   47.63 +-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
   47.64 +-# endif
   47.65 +-#endif
   47.66 +-
   47.67 + #endif /* ASSEMBLER */
   47.68 +diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/sysdep.h
   47.69 +--- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h	2007-08-21 10:07:28.000000000 +0200
   47.70 ++++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sysdep.h	2009-02-02 22:01:39.000000000 +0100
   47.71 +@@ -98,4 +98,46 @@
   47.72 + 	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
   47.73 + })
   47.74 + 
   47.75 ++/* Pointer mangling support.  Note that tls access is slow enough that
   47.76 ++   we don't deoptimize things by placing the pointer check value there.  */
   47.77 ++
   47.78 ++#if defined NOT_IN_libc && defined IS_IN_rtld
   47.79 ++# ifdef __ASSEMBLER__
   47.80 ++#  define PTR_MANGLE(dst, src, tmp)                            \
   47.81 ++       ldah    tmp, __pointer_chk_guard_local($29) !gprelhigh; \
   47.82 ++       ldq     tmp, __pointer_chk_guard_local(tmp) !gprellow;  \
   47.83 ++       xor     src, tmp, dst
   47.84 ++#  define PTR_MANGLE2(dst, src, tmp)                           \
   47.85 ++       xor     src, tmp, dst
   47.86 ++#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
   47.87 ++#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
   47.88 ++# else
   47.89 ++extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
   47.90 ++#  define PTR_MANGLE(var)      \
   47.91 ++  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
   47.92 ++#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
   47.93 ++# endif
   47.94 ++#elif defined PIC
   47.95 ++# ifdef __ASSEMBLER__
   47.96 ++#  define PTR_MANGLE(dst, src, tmp)            \
   47.97 ++       ldq     tmp, __pointer_chk_guard;       \
   47.98 ++       xor     src, tmp, dst
   47.99 ++#  define PTR_MANGLE2(dst, src, tmp)           \
  47.100 ++       xor     src, tmp, dst
  47.101 ++#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  47.102 ++#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  47.103 ++# else
  47.104 ++extern uintptr_t __pointer_chk_guard attribute_relro;
  47.105 ++#  define PTR_MANGLE(var)      \
  47.106 ++       (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
  47.107 ++#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  47.108 ++# endif
  47.109 ++#else
  47.110 ++/* Pointer mangling is not yet supported for static libc on alpha.  */
  47.111 ++# ifndef __ASSEMBLER__
  47.112 ++#  define PTR_MANGLE(var)   (void) (var)
  47.113 ++#  define PTR_DEMANGLE(var) (void) (var)
  47.114 ++# endif
  47.115 ++#endif
  47.116 ++
  47.117 + #endif /* _LINUX_ALPHA_SYSDEP_H */
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/patches/glibc/2.9/500-ppc-glibc-2.9-atomic.patch	Sun Apr 19 16:17:11 2009 +0000
    48.3 @@ -0,0 +1,414 @@
    48.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/6120_all_ppc-glibc-2.9-atomic.patch
    48.5 +
    48.6 +-= BEGIN original header =-
    48.7 +sniped from suse
    48.8 +
    48.9 +-= END original header =-
   48.10 +
   48.11 +diff -durN glibc-2_9.orig/sysdeps/powerpc/bits/atomic.h glibc-2_9/sysdeps/powerpc/bits/atomic.h
   48.12 +--- glibc-2_9.orig/sysdeps/powerpc/bits/atomic.h	2007-03-26 22:15:28.000000000 +0200
   48.13 ++++ glibc-2_9/sysdeps/powerpc/bits/atomic.h	2009-02-02 22:01:40.000000000 +0100
   48.14 +@@ -85,14 +85,14 @@
   48.15 +       __typeof (*(mem)) __tmp;						      \
   48.16 +       __typeof (mem)  __memp = (mem);					      \
   48.17 +       __asm __volatile (						      \
   48.18 +-		        "1:	lwarx	%0,0,%1" MUTEX_HINT_ACQ "\n"	      \
   48.19 ++		        "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
   48.20 + 		        "	cmpw	%0,%2\n"			      \
   48.21 + 		        "	bne	2f\n"				      \
   48.22 +-		        "	stwcx.	%3,0,%1\n"			      \
   48.23 ++		        "	stwcx.	%3,%y1\n"			      \
   48.24 + 		        "	bne-	1b\n"				      \
   48.25 + 		        "2:	" __ARCH_ACQ_INSTR			      \
   48.26 +-		        : "=&r" (__tmp)					      \
   48.27 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
   48.28 ++		        : "=&r" (__tmp), "+Z" (*__memp)			      \
   48.29 ++		        : "r" (oldval), "r" (newval)			      \
   48.30 + 		        : "cr0", "memory");				      \
   48.31 +       __tmp;								      \
   48.32 +   })
   48.33 +@@ -102,14 +102,14 @@
   48.34 +       __typeof (*(mem)) __tmp;						      \
   48.35 +       __typeof (mem)  __memp = (mem);					      \
   48.36 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
   48.37 +-		        "1:	lwarx	%0,0,%1" MUTEX_HINT_REL "\n"	      \
   48.38 ++		        "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
   48.39 + 		        "	cmpw	%0,%2\n"			      \
   48.40 + 		        "	bne	2f\n"				      \
   48.41 +-		        "	stwcx.	%3,0,%1\n"			      \
   48.42 ++		        "	stwcx.	%3,%y1\n"			      \
   48.43 + 		        "	bne-	1b\n"				      \
   48.44 + 		        "2:	"					      \
   48.45 +-		        : "=&r" (__tmp)					      \
   48.46 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
   48.47 ++		        : "=&r" (__tmp), "+Z" (__memp)			      \
   48.48 ++		        : "r" (oldval), "r" (newval)			      \
   48.49 + 		        : "cr0", "memory");				      \
   48.50 +       __tmp;								      \
   48.51 +   })
   48.52 +@@ -118,12 +118,12 @@
   48.53 +   ({									      \
   48.54 +     __typeof (*mem) __val;						      \
   48.55 +     __asm __volatile (							      \
   48.56 +-		      "1:	lwarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	      \
   48.57 +-		      "		stwcx.	%3,0,%2\n"			      \
   48.58 ++		      "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
   48.59 ++		      "		stwcx.	%2,%y1\n"			      \
   48.60 + 		      "		bne-	1b\n"				      \
   48.61 + 		      "   " __ARCH_ACQ_INSTR				      \
   48.62 +-		      : "=&r" (__val), "=m" (*mem)			      \
   48.63 +-		      : "b" (mem), "r" (value), "m" (*mem)		      \
   48.64 ++		      : "=&r" (__val), "+Z" (*mem)			      \
   48.65 ++		      : "r" (value)					      \
   48.66 + 		      : "cr0", "memory");				      \
   48.67 +     __val;								      \
   48.68 +   })
   48.69 +@@ -132,11 +132,11 @@
   48.70 +   ({									      \
   48.71 +     __typeof (*mem) __val;						      \
   48.72 +     __asm __volatile (__ARCH_REL_INSTR "\n"				      \
   48.73 +-		      "1:	lwarx	%0,0,%2" MUTEX_HINT_REL "\n"	      \
   48.74 +-		      "		stwcx.	%3,0,%2\n"			      \
   48.75 ++		      "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
   48.76 ++		      "		stwcx.	%2,%y1\n"			      \
   48.77 + 		      "		bne-	1b"				      \
   48.78 +-		      : "=&r" (__val), "=m" (*mem)			      \
   48.79 +-		      : "b" (mem), "r" (value), "m" (*mem)		      \
   48.80 ++		      : "=&r" (__val), "+Z" (*mem)			      \
   48.81 ++		      : "r" (value)					      \
   48.82 + 		      : "cr0", "memory");				      \
   48.83 +     __val;								      \
   48.84 +   })
   48.85 +@@ -144,12 +144,12 @@
   48.86 + #define __arch_atomic_exchange_and_add_32(mem, value) \
   48.87 +   ({									      \
   48.88 +     __typeof (*mem) __val, __tmp;					      \
   48.89 +-    __asm __volatile ("1:	lwarx	%0,0,%3\n"			      \
   48.90 +-		      "		add	%1,%0,%4\n"			      \
   48.91 +-		      "		stwcx.	%1,0,%3\n"			      \
   48.92 ++    __asm __volatile ("1:	lwarx	%0,%y2\n"			      \
   48.93 ++		      "		add	%1,%0,%3\n"			      \
   48.94 ++		      "		stwcx.	%1,%y2\n"			      \
   48.95 + 		      "		bne-	1b"				      \
   48.96 +-		      : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
   48.97 +-		      : "b" (mem), "r" (value), "m" (*mem)		      \
   48.98 ++		      : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem)	      \
   48.99 ++		      : "r" (value)					      \
  48.100 + 		      : "cr0", "memory");				      \
  48.101 +     __val;								      \
  48.102 +   })
  48.103 +@@ -157,12 +157,12 @@
  48.104 + #define __arch_atomic_increment_val_32(mem) \
  48.105 +   ({									      \
  48.106 +     __typeof (*(mem)) __val;						      \
  48.107 +-    __asm __volatile ("1:	lwarx	%0,0,%2\n"			      \
  48.108 ++    __asm __volatile ("1:	lwarx	%0,%y1\n"			      \
  48.109 + 		      "		addi	%0,%0,1\n"			      \
  48.110 +-		      "		stwcx.	%0,0,%2\n"			      \
  48.111 ++		      "		stwcx.	%0,%y1\n"			      \
  48.112 + 		      "		bne-	1b"				      \
  48.113 +-		      : "=&b" (__val), "=m" (*mem)			      \
  48.114 +-		      : "b" (mem), "m" (*mem)				      \
  48.115 ++		      : "=&b" (__val), "+Z" (*mem)			      \
  48.116 ++		      :							      \
  48.117 + 		      : "cr0", "memory");				      \
  48.118 +     __val;								      \
  48.119 +   })
  48.120 +@@ -170,27 +170,27 @@
  48.121 + #define __arch_atomic_decrement_val_32(mem) \
  48.122 +   ({									      \
  48.123 +     __typeof (*(mem)) __val;						      \
  48.124 +-    __asm __volatile ("1:	lwarx	%0,0,%2\n"			      \
  48.125 ++    __asm __volatile ("1:	lwarx	%0,%y1\n"			      \
  48.126 + 		      "		subi	%0,%0,1\n"			      \
  48.127 +-		      "		stwcx.	%0,0,%2\n"			      \
  48.128 ++		      "		stwcx.	%0,%y1\n"			      \
  48.129 + 		      "		bne-	1b"				      \
  48.130 +-		      : "=&b" (__val), "=m" (*mem)			      \
  48.131 +-		      : "b" (mem), "m" (*mem)				      \
  48.132 ++		      : "=&b" (__val), "+Z" (*mem)			      \
  48.133 ++		      :							      \
  48.134 + 		      : "cr0", "memory");				      \
  48.135 +     __val;								      \
  48.136 +   })
  48.137 + 
  48.138 + #define __arch_atomic_decrement_if_positive_32(mem) \
  48.139 +   ({ int __val, __tmp;							      \
  48.140 +-     __asm __volatile ("1:	lwarx	%0,0,%3\n"			      \
  48.141 ++     __asm __volatile ("1:	lwarx	%0,%y2\n"			      \
  48.142 + 		       "	cmpwi	0,%0,0\n"			      \
  48.143 + 		       "	addi	%1,%0,-1\n"			      \
  48.144 + 		       "	ble	2f\n"				      \
  48.145 +-		       "	stwcx.	%1,0,%3\n"			      \
  48.146 ++		       "	stwcx.	%1,%y2\n"			      \
  48.147 + 		       "	bne-	1b\n"				      \
  48.148 + 		       "2:	" __ARCH_ACQ_INSTR			      \
  48.149 +-		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  48.150 +-		       : "b" (mem), "m" (*mem)				      \
  48.151 ++		       : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem)	      \
  48.152 ++		       :						      \
  48.153 + 		       : "cr0", "memory");				      \
  48.154 +      __val;								      \
  48.155 +   })
  48.156 +diff -durN glibc-2_9.orig/sysdeps/powerpc/powerpc32/bits/atomic.h glibc-2_9/sysdeps/powerpc/powerpc32/bits/atomic.h
  48.157 +--- glibc-2_9.orig/sysdeps/powerpc/powerpc32/bits/atomic.h	2007-03-26 22:15:45.000000000 +0200
  48.158 ++++ glibc-2_9/sysdeps/powerpc/powerpc32/bits/atomic.h	2009-02-02 22:01:40.000000000 +0100
  48.159 +@@ -44,14 +44,14 @@
  48.160 + ({									      \
  48.161 +   unsigned int __tmp;							      \
  48.162 +   __asm __volatile (							      \
  48.163 +-		    "1:	lwarx	%0,0,%1" MUTEX_HINT_ACQ "\n"		      \
  48.164 ++		    "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"		      \
  48.165 + 		    "	subf.	%0,%2,%0\n"				      \
  48.166 + 		    "	bne	2f\n"					      \
  48.167 +-		    "	stwcx.	%3,0,%1\n"				      \
  48.168 ++		    "	stwcx.	%3,%y1\n"				      \
  48.169 + 		    "	bne-	1b\n"					      \
  48.170 + 		    "2:	" __ARCH_ACQ_INSTR				      \
  48.171 +-		    : "=&r" (__tmp)					      \
  48.172 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  48.173 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  48.174 ++		    : "r" (oldval), "r" (newval)			      \
  48.175 + 		    : "cr0", "memory");					      \
  48.176 +   __tmp != 0;								      \
  48.177 + })
  48.178 +@@ -60,14 +60,14 @@
  48.179 + ({									      \
  48.180 +   unsigned int __tmp;							      \
  48.181 +   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  48.182 +-		    "1:	lwarx	%0,0,%1" MUTEX_HINT_REL "\n"		      \
  48.183 ++		    "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"		      \
  48.184 + 		    "	subf.	%0,%2,%0\n"				      \
  48.185 + 		    "	bne	2f\n"					      \
  48.186 +-		    "	stwcx.	%3,0,%1\n"				      \
  48.187 ++		    "	stwcx.	%3,%y1\n"				      \
  48.188 + 		    "	bne-	1b\n"					      \
  48.189 + 		    "2:	"						      \
  48.190 +-		    : "=&r" (__tmp)					      \
  48.191 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  48.192 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  48.193 ++		    : "r" (oldval), "r" (newval)			      \
  48.194 + 		    : "cr0", "memory");					      \
  48.195 +   __tmp != 0;								      \
  48.196 + })
  48.197 +diff -durN glibc-2_9.orig/sysdeps/powerpc/powerpc64/bits/atomic.h glibc-2_9/sysdeps/powerpc/powerpc64/bits/atomic.h
  48.198 +--- glibc-2_9.orig/sysdeps/powerpc/powerpc64/bits/atomic.h	2007-03-26 22:16:03.000000000 +0200
  48.199 ++++ glibc-2_9/sysdeps/powerpc/powerpc64/bits/atomic.h	2009-02-02 22:01:40.000000000 +0100
  48.200 +@@ -44,14 +44,14 @@
  48.201 + ({									      \
  48.202 +   unsigned int __tmp, __tmp2;						      \
  48.203 +   __asm __volatile ("   clrldi  %1,%1,32\n"				      \
  48.204 +-		    "1:	lwarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	 	      \
  48.205 ++		    "1:	lwarx	%0,%y2" MUTEX_HINT_ACQ "\n"	 	      \
  48.206 + 		    "	subf.	%0,%1,%0\n"				      \
  48.207 + 		    "	bne	2f\n"					      \
  48.208 +-		    "	stwcx.	%4,0,%2\n"				      \
  48.209 ++		    "	stwcx.	%4,%y2\n"				      \
  48.210 + 		    "	bne-	1b\n"					      \
  48.211 + 		    "2:	" __ARCH_ACQ_INSTR				      \
  48.212 +-		    : "=&r" (__tmp), "=r" (__tmp2)			      \
  48.213 +-		    : "b" (mem), "1" (oldval), "r" (newval)		      \
  48.214 ++		    : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem))	      \
  48.215 ++		    : "1" (oldval), "r" (newval)			      \
  48.216 + 		    : "cr0", "memory");					      \
  48.217 +   __tmp != 0;								      \
  48.218 + })
  48.219 +@@ -61,14 +61,14 @@
  48.220 +   unsigned int __tmp, __tmp2;						      \
  48.221 +   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  48.222 + 		    "   clrldi  %1,%1,32\n"				      \
  48.223 +-		    "1:	lwarx	%0,0,%2" MUTEX_HINT_REL "\n"		      \
  48.224 ++		    "1:	lwarx	%0,%y2" MUTEX_HINT_REL "\n"		      \
  48.225 + 		    "	subf.	%0,%1,%0\n"				      \
  48.226 + 		    "	bne	2f\n"					      \
  48.227 +-		    "	stwcx.	%4,0,%2\n"				      \
  48.228 ++		    "	stwcx.	%4,%y2\n"				      \
  48.229 + 		    "	bne-	1b\n"					      \
  48.230 + 		    "2:	"						      \
  48.231 +-		    : "=&r" (__tmp), "=r" (__tmp2)			      \
  48.232 +-		    : "b" (mem), "1" (oldval), "r" (newval)		      \
  48.233 ++		    : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem))	      \
  48.234 ++		    : "1" (oldval), "r" (newval)			      \
  48.235 + 		    : "cr0", "memory");					      \
  48.236 +   __tmp != 0;								      \
  48.237 + })
  48.238 +@@ -82,14 +82,14 @@
  48.239 + ({									      \
  48.240 +   unsigned long	__tmp;							      \
  48.241 +   __asm __volatile (							      \
  48.242 +-		    "1:	ldarx	%0,0,%1" MUTEX_HINT_ACQ "\n"		      \
  48.243 ++		    "1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"		      \
  48.244 + 		    "	subf.	%0,%2,%0\n"				      \
  48.245 + 		    "	bne	2f\n"					      \
  48.246 +-		    "	stdcx.	%3,0,%1\n"				      \
  48.247 ++		    "	stdcx.	%3,%y1\n"				      \
  48.248 + 		    "	bne-	1b\n"					      \
  48.249 + 		    "2:	" __ARCH_ACQ_INSTR				      \
  48.250 +-		    : "=&r" (__tmp)					      \
  48.251 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  48.252 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  48.253 ++		    : "r" (oldval), "r" (newval)			      \
  48.254 + 		    : "cr0", "memory");					      \
  48.255 +   __tmp != 0;								      \
  48.256 + })
  48.257 +@@ -98,14 +98,14 @@
  48.258 + ({									      \
  48.259 +   unsigned long	__tmp;							      \
  48.260 +   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  48.261 +-		    "1:	ldarx	%0,0,%2" MUTEX_HINT_REL "\n"		      \
  48.262 ++		    "1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"		      \
  48.263 + 		    "	subf.	%0,%2,%0\n"				      \
  48.264 + 		    "	bne	2f\n"					      \
  48.265 +-		    "	stdcx.	%3,0,%1\n"				      \
  48.266 ++		    "	stdcx.	%3,%y1\n"				      \
  48.267 + 		    "	bne-	1b\n"					      \
  48.268 + 		    "2:	"						      \
  48.269 +-		    : "=&r" (__tmp)					      \
  48.270 +-		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  48.271 ++		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  48.272 ++		    : "r" (oldval), "r" (newval)			      \
  48.273 + 		    : "cr0", "memory");					      \
  48.274 +   __tmp != 0;								      \
  48.275 + })
  48.276 +@@ -115,14 +115,14 @@
  48.277 +       __typeof (*(mem)) __tmp;						      \
  48.278 +       __typeof (mem)  __memp = (mem);					      \
  48.279 +       __asm __volatile (						      \
  48.280 +-		        "1:	ldarx	%0,0,%1" MUTEX_HINT_ACQ "\n"	      \
  48.281 ++		        "1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
  48.282 + 		        "	cmpd	%0,%2\n"			      \
  48.283 + 		        "	bne	2f\n"				      \
  48.284 +-		        "	stdcx.	%3,0,%1\n"			      \
  48.285 ++		        "	stdcx.	%3,%y1\n"			      \
  48.286 + 		        "	bne-	1b\n"				      \
  48.287 + 		        "2:	" __ARCH_ACQ_INSTR			      \
  48.288 +-		        : "=&r" (__tmp)					      \
  48.289 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
  48.290 ++		        : "=&r" (__tmp), "+Z" (*__memp)			      \
  48.291 ++		        : "r" (oldval), "r" (newval)			      \
  48.292 + 		        : "cr0", "memory");				      \
  48.293 +       __tmp;								      \
  48.294 +   })
  48.295 +@@ -132,14 +132,14 @@
  48.296 +       __typeof (*(mem)) __tmp;						      \
  48.297 +       __typeof (mem)  __memp = (mem);					      \
  48.298 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  48.299 +-		        "1:	ldarx	%0,0,%1" MUTEX_HINT_REL "\n"	      \
  48.300 ++		        "1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
  48.301 + 		        "	cmpd	%0,%2\n"			      \
  48.302 + 		        "	bne	2f\n"				      \
  48.303 +-		        "	stdcx.	%3,0,%1\n"			      \
  48.304 ++		        "	stdcx.	%3,%y1\n"			      \
  48.305 + 		        "	bne-	1b\n"				      \
  48.306 + 		        "2:	"					      \
  48.307 +-		        : "=&r" (__tmp)					      \
  48.308 +-		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
  48.309 ++		        : "=&r" (__tmp), "+Z" (*__memp)			      \
  48.310 ++		        : "r" (oldval), "r" (newval)			      \
  48.311 + 		        : "cr0", "memory");				      \
  48.312 +       __tmp;								      \
  48.313 +   })
  48.314 +@@ -148,12 +148,12 @@
  48.315 +     ({									      \
  48.316 +       __typeof (*mem) __val;						      \
  48.317 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  48.318 +-			"1:	ldarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	      \
  48.319 +-			"	stdcx.	%3,0,%2\n"			      \
  48.320 ++			"1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
  48.321 ++			"	stdcx.	%2,%y1\n"			      \
  48.322 + 			"	bne-	1b\n"				      \
  48.323 + 		  " " __ARCH_ACQ_INSTR					      \
  48.324 +-			: "=&r" (__val), "=m" (*mem)			      \
  48.325 +-			: "b" (mem), "r" (value), "m" (*mem)		      \
  48.326 ++			: "=&r" (__val), "+Z" (*(mem))			      \
  48.327 ++			: "r" (value)					      \
  48.328 + 			: "cr0", "memory");				      \
  48.329 +       __val;								      \
  48.330 +     })
  48.331 +@@ -162,11 +162,11 @@
  48.332 +     ({									      \
  48.333 +       __typeof (*mem) __val;						      \
  48.334 +       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  48.335 +-			"1:	ldarx	%0,0,%2" MUTEX_HINT_REL "\n"	      \
  48.336 +-			"	stdcx.	%3,0,%2\n"			      \
  48.337 ++			"1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
  48.338 ++			"	stdcx.	%2,%y1\n"			      \
  48.339 + 			"	bne-	1b"				      \
  48.340 +-			: "=&r" (__val), "=m" (*mem)			      \
  48.341 +-			: "b" (mem), "r" (value), "m" (*mem)		      \
  48.342 ++			: "=&r" (__val), "+Z" (*(mem))			      \
  48.343 ++			: "r" (value)					      \
  48.344 + 			: "cr0", "memory");				      \
  48.345 +       __val;								      \
  48.346 +     })
  48.347 +@@ -174,12 +174,12 @@
  48.348 + #define __arch_atomic_exchange_and_add_64(mem, value) \
  48.349 +     ({									      \
  48.350 +       __typeof (*mem) __val, __tmp;					      \
  48.351 +-      __asm __volatile ("1:	ldarx	%0,0,%3\n"			      \
  48.352 +-			"	add	%1,%0,%4\n"			      \
  48.353 +-			"	stdcx.	%1,0,%3\n"			      \
  48.354 ++      __asm __volatile ("1:	ldarx	%0,%y2\n"			      \
  48.355 ++			"	add	%1,%0,%3\n"			      \
  48.356 ++			"	stdcx.	%1,%y2\n"			      \
  48.357 + 			"	bne-	1b"				      \
  48.358 +-			: "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  48.359 +-			: "b" (mem), "r" (value), "m" (*mem)		      \
  48.360 ++			: "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem))	      \
  48.361 ++			: "r" (value)					      \
  48.362 + 			: "cr0", "memory");				      \
  48.363 +       __val;								      \
  48.364 +     })
  48.365 +@@ -187,12 +187,12 @@
  48.366 + #define __arch_atomic_increment_val_64(mem) \
  48.367 +     ({									      \
  48.368 +       __typeof (*(mem)) __val;						      \
  48.369 +-      __asm __volatile ("1:	ldarx	%0,0,%2\n"			      \
  48.370 ++      __asm __volatile ("1:	ldarx	%0,%y1\n"			      \
  48.371 + 			"	addi	%0,%0,1\n"			      \
  48.372 +-			"	stdcx.	%0,0,%2\n"			      \
  48.373 ++			"	stdcx.	%0,%y1\n"			      \
  48.374 + 			"	bne-	1b"				      \
  48.375 +-			: "=&b" (__val), "=m" (*mem)			      \
  48.376 +-			: "b" (mem), "m" (*mem)				      \
  48.377 ++			: "=&b" (__val), "+Z" (*(mem))			      \
  48.378 ++			:						      \
  48.379 + 			: "cr0", "memory");				      \
  48.380 +       __val;								      \
  48.381 +     })
  48.382 +@@ -200,27 +200,27 @@
  48.383 + #define __arch_atomic_decrement_val_64(mem) \
  48.384 +     ({									      \
  48.385 +       __typeof (*(mem)) __val;						      \
  48.386 +-      __asm __volatile ("1:	ldarx	%0,0,%2\n"			      \
  48.387 ++      __asm __volatile ("1:	ldarx	%0,%y1\n"			      \
  48.388 + 			"	subi	%0,%0,1\n"			      \
  48.389 +-			"	stdcx.	%0,0,%2\n"			      \
  48.390 ++			"	stdcx.	%0,%y1\n"			      \
  48.391 + 			"	bne-	1b"				      \
  48.392 +-			: "=&b" (__val), "=m" (*mem)			      \
  48.393 +-			: "b" (mem), "m" (*mem)				      \
  48.394 ++			: "=&b" (__val), "+Z" (*(mem))			      \
  48.395 ++			:						      \
  48.396 + 			: "cr0", "memory");				      \
  48.397 +       __val;								      \
  48.398 +     })
  48.399 + 
  48.400 + #define __arch_atomic_decrement_if_positive_64(mem) \
  48.401 +   ({ int __val, __tmp;							      \
  48.402 +-     __asm __volatile ("1:	ldarx	%0,0,%3\n"			      \
  48.403 ++     __asm __volatile ("1:	ldarx	%0,%y2\n"			      \
  48.404 + 		       "	cmpdi	0,%0,0\n"			      \
  48.405 + 		       "	addi	%1,%0,-1\n"			      \
  48.406 + 		       "	ble	2f\n"				      \
  48.407 +-		       "	stdcx.	%1,0,%3\n"			      \
  48.408 ++		       "	stdcx.	%1,%y2\n"			      \
  48.409 + 		       "	bne-	1b\n"				      \
  48.410 + 		       "2:	" __ARCH_ACQ_INSTR			      \
  48.411 +-		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  48.412 +-		       : "b" (mem), "m" (*mem)				      \
  48.413 ++		       : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem))	      \
  48.414 ++		       :						      \
  48.415 + 		       : "cr0", "memory");				      \
  48.416 +      __val;								      \
  48.417 +   })
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/patches/glibc/2.9/510-sh-no-asm-user-header.patch	Sun Apr 19 16:17:11 2009 +0000
    49.3 @@ -0,0 +1,70 @@
    49.4 +2007-03-13  Mike Frysinger  <vapier@gentoo.org>
    49.5 +
    49.6 +	* sysdeps/unix/sysv/linux/sh/sys/user.h: Copy Linux's asm-sh/user.h.
    49.7 +
    49.8 +--- glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/user.h
    49.9 ++++ glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/user.h
   49.10 +@@ -19,10 +19,60 @@
   49.11 + #ifndef _SYS_USER_H
   49.12 + #define _SYS_USER_H	1
   49.13 + 
   49.14 +-#include <features.h>
   49.15 ++#include <unistd.h>
   49.16 ++#include <asm/ptrace.h>
   49.17 + 
   49.18 +-#include <asm/user.h>
   49.19 ++/*
   49.20 ++ * Core file format: The core file is written in such a way that gdb
   49.21 ++ * can understand it and provide useful information to the user (under
   49.22 ++ * linux we use the `trad-core' bfd).  The file contents are as follows:
   49.23 ++ *
   49.24 ++ *  upage: 1 page consisting of a user struct that tells gdb
   49.25 ++ *	what is present in the file.  Directly after this is a
   49.26 ++ *	copy of the task_struct, which is currently not used by gdb,
   49.27 ++ *	but it may come in handy at some point.  All of the registers
   49.28 ++ *	are stored as part of the upage.  The upage should always be
   49.29 ++ *	only one page long.
   49.30 ++ *  data: The data segment follows next.  We use current->end_text to
   49.31 ++ *	current->brk to pick up all of the user variables, plus any memory
   49.32 ++ *	that may have been sbrk'ed.  No attempt is made to determine if a
   49.33 ++ *	page is demand-zero or if a page is totally unused, we just cover
   49.34 ++ *	the entire range.  All of the addresses are rounded in such a way
   49.35 ++ *	that an integral number of pages is written.
   49.36 ++ *  stack: We need the stack information in order to get a meaningful
   49.37 ++ *	backtrace.  We need to write the data from usp to
   49.38 ++ *	current->start_stack, so we round each of these in order to be able
   49.39 ++ *	to write an integer number of pages.
   49.40 ++ */
   49.41 + 
   49.42 +-#undef start_thread
   49.43 ++struct user_fpu_struct {
   49.44 ++	unsigned long fp_regs[16];
   49.45 ++	unsigned long xfp_regs[16];
   49.46 ++	unsigned long fpscr;
   49.47 ++	unsigned long fpul;
   49.48 ++};
   49.49 ++
   49.50 ++struct user {
   49.51 ++	struct pt_regs	regs;			/* entire machine state */
   49.52 ++	struct user_fpu_struct fpu;	/* Math Co-processor registers  */
   49.53 ++	int u_fpvalid;		/* True if math co-processor being used */
   49.54 ++	size_t		u_tsize;		/* text size (pages) */
   49.55 ++	size_t		u_dsize;		/* data size (pages) */
   49.56 ++	size_t		u_ssize;		/* stack size (pages) */
   49.57 ++	unsigned long	start_code;		/* text starting address */
   49.58 ++	unsigned long	start_data;		/* data starting address */
   49.59 ++	unsigned long	start_stack;		/* stack starting address */
   49.60 ++	long int	signal;			/* signal causing core dump */
   49.61 ++	struct regs *	u_ar0;			/* help gdb find registers */
   49.62 ++	struct user_fpu_struct* u_fpstate;	/* Math Co-processor pointer */
   49.63 ++	unsigned long	magic;			/* identifies a core file */
   49.64 ++	char		u_comm[32];		/* user command name */
   49.65 ++};
   49.66 ++
   49.67 ++#define NBPG			getpagesize()
   49.68 ++#define UPAGES			1
   49.69 ++#define HOST_TEXT_START_ADDR	(u.start_code)
   49.70 ++#define HOST_DATA_START_ADDR	(u.start_data)
   49.71 ++#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
   49.72 + 
   49.73 + #endif  /* sys/user.h */
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/patches/glibc/2.9/520-sh-no-asm-elf-header.patch	Sun Apr 19 16:17:11 2009 +0000
    50.3 @@ -0,0 +1,27 @@
    50.4 +2007-03-13  Mike Frysinger  <vapier@gentoo.org>
    50.5 +
    50.6 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Copy Linux's asm-sh/elf.h types.
    50.7 +
    50.8 +--- glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    50.9 ++++ glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/procfs.h
   50.10 +@@ -29,10 +29,19 @@
   50.11 + #include <sys/types.h>
   50.12 + #include <sys/ucontext.h>
   50.13 + #include <sys/user.h>
   50.14 +-#include <asm/elf.h>
   50.15 + 
   50.16 + __BEGIN_DECLS
   50.17 + 
   50.18 ++/*
   50.19 ++ * ELF register definitions...
   50.20 ++ */
   50.21 ++typedef unsigned long elf_greg_t;
   50.22 ++
   50.23 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
   50.24 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
   50.25 ++
   50.26 ++typedef struct user_fpu_struct elf_fpregset_t;
   50.27 ++
   50.28 + struct elf_siginfo
   50.29 +   {
   50.30 +     int si_signo;			/* Signal number.  */
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/patches/glibc/2.9/530-powerpc-8xx-CPU15-errata.patch	Sun Apr 19 16:17:11 2009 +0000
    51.3 @@ -0,0 +1,56 @@
    51.4 +Fix memset on PowerPC 8xx, by Nye Liu:
    51.5 +http://sourceware.org/ml/crossgcc/2008-10/msg00067.html
    51.6 +
    51.7 +Quote:
    51.8 + I am working on a powerpc 860 toolchain, but I am having problems  
    51.9 + convincing glibc to not emit code that uses the dcbz instruction (CPU15  
   51.10 + dcbX bug). The source of the problem is sysdeps/powerpc/power3/memset.S
   51.11 +
   51.12 +--- glibc-2.7/sysdeps/powerpc/powerpc32/memset.S	2007-03-26 13:09:07.000000000 -0700
   51.13 ++++ glibc-2.7/sysdeps/powerpc/powerpc32/memset.S.new	2008-10-23 20:28:52.000000000 -0700
   51.14 +@@ -112,11 +112,13 @@
   51.15 + 	clrrwi.	rALIGN, rLEN, 5
   51.16 + 	mtcrf	0x01, rLEN	/* 40th instruction from .align */
   51.17 + 
   51.18 ++#ifndef BROKEN_PPC_8xx_CPU15
   51.19 + /* Check if we can use the special case for clearing memory using dcbz.
   51.20 +    This requires that we know the correct cache line size for this
   51.21 +    processor.  Getting the __cache_line_size may require establishing GOT
   51.22 +    addressability, so branch out of line to set this up.  */
   51.23 + 	beq	cr1, L(checklinesize)
   51.24 ++#endif
   51.25 + 
   51.26 + /* Store blocks of 32-bytes (256-bits) starting on a 32-byte boundary.
   51.27 +    Can't assume that rCHR is zero or that the cache line size is either
   51.28 +@@ -158,6 +160,7 @@
   51.29 + 	add	rMEMP, rMEMP, rALIGN
   51.30 + 	b	L(medium_tail2)	/* 72nd instruction from .align */
   51.31 + 
   51.32 ++#ifndef BROKEN_PPC_8xx_CPU15
   51.33 + 	.align	5
   51.34 + 	nop
   51.35 + /* Clear cache lines of memory in 128-byte chunks.
   51.36 +@@ -191,6 +194,7 @@
   51.37 + 	bdnz	L(zloop)
   51.38 + 	beqlr	cr5
   51.39 + 	b	L(medium_tail2)
   51.40 ++#endif /* ! BROKEN_PPC_8xx_CPU15 */
   51.41 + 
   51.42 + 	.align	5
   51.43 + L(small):
   51.44 +@@ -248,6 +252,7 @@
   51.45 + 	stw	rCHR, -8(rMEMP)
   51.46 + 	blr
   51.47 + 
   51.48 ++#ifndef BROKEN_PPC_8xx_CPU15
   51.49 + L(checklinesize):
   51.50 + #ifdef SHARED
   51.51 + 	mflr	rTMP
   51.52 +@@ -329,6 +334,7 @@
   51.53 + L(handletail32):
   51.54 + 	clrrwi.	rALIGN, rLEN, 5
   51.55 + 	b	L(nondcbz)
   51.56 ++#endif /* ! BROKEN_PPC_8xx_CPU15 */
   51.57 + 
   51.58 + END (BP_SYM (memset))
   51.59 + libc_hidden_builtin_def (memset)
    52.1 --- a/patches/glibc/2_9/100-ssp-compat.patch	Sat Apr 11 19:03:02 2009 +0000
    52.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.3 @@ -1,193 +0,0 @@
    52.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0010_all_glibc-2.7-ssp-compat.patch
    52.5 -
    52.6 --= BEGIN original header =-
    52.7 -Add backwards compat support for gcc-3.x ssp ... older ssp versions
    52.8 -used __guard and __stack_smash_handler symbols while gcc-4.1 and newer
    52.9 -uses __stack_chk_guard and __stack_chk_fail.
   52.10 -
   52.11 --= END original header =-
   52.12 -
   52.13 -diff -durN glibc-2_9.orig/Versions.def glibc-2_9/Versions.def
   52.14 ---- glibc-2_9.orig/Versions.def	2008-08-01 19:13:40.000000000 +0200
   52.15 -+++ glibc-2_9/Versions.def	2009-02-02 22:00:33.000000000 +0100
   52.16 -@@ -113,6 +113,9 @@
   52.17 -   GLIBC_2.0
   52.18 -   GLIBC_2.1
   52.19 -   GLIBC_2.3
   52.20 -+%ifdef ENABLE_OLD_SSP_COMPAT
   52.21 -+  GLIBC_2.3.2
   52.22 -+%endif
   52.23 -   GLIBC_2.4
   52.24 -   GLIBC_PRIVATE
   52.25 - }
   52.26 -diff -durN glibc-2_9.orig/config.h.in glibc-2_9/config.h.in
   52.27 ---- glibc-2_9.orig/config.h.in	2007-03-26 22:40:08.000000000 +0200
   52.28 -+++ glibc-2_9/config.h.in	2009-02-02 22:00:32.000000000 +0100
   52.29 -@@ -42,6 +42,9 @@
   52.30 -    assembler instructions per line.  Default is `;'  */
   52.31 - #undef ASM_LINE_SEP
   52.32 - 
   52.33 -+/* Define if we want to enable support for old ssp symbols */
   52.34 -+#undef	ENABLE_OLD_SSP_COMPAT
   52.35 -+
   52.36 - /* Define if not using ELF, but `.init' and `.fini' sections are available.  */
   52.37 - #undef	HAVE_INITFINI
   52.38 - 
   52.39 -diff -durN glibc-2_9.orig/configure glibc-2_9/configure
   52.40 ---- glibc-2_9.orig/configure	2008-11-11 10:50:11.000000000 +0100
   52.41 -+++ glibc-2_9/configure	2009-02-02 22:00:32.000000000 +0100
   52.42 -@@ -1380,6 +1380,9 @@
   52.43 -   --enable-kernel=VERSION compile for compatibility with kernel not older than
   52.44 -                           VERSION
   52.45 -   --enable-all-warnings   enable all useful warnings gcc can issue
   52.46 -+  --disable-old-ssp-compat
   52.47 -+                          enable support for older ssp symbols
   52.48 -+                          [default=no]
   52.49 - 
   52.50 - Optional Packages:
   52.51 -   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   52.52 -@@ -6470,6 +6473,20 @@
   52.53 - echo "${ECHO_T}$libc_cv_ssp" >&6; }
   52.54 - 
   52.55 - 
   52.56 -+# Check whether --enable-old-ssp-compat or --disable-old-ssp-compat was given.
   52.57 -+if test "${enable_old_ssp_compat+set}" = set; then
   52.58 -+  enableval="$enable_old_ssp_compat"
   52.59 -+  enable_old_ssp_compat=$enableval
   52.60 -+else
   52.61 -+  enable_old_ssp_compat=no
   52.62 -+fi;
   52.63 -+if test "x$enable_old_ssp_compat" = "xyes"; then
   52.64 -+  cat >>confdefs.h <<\_ACEOF
   52.65 -+#define ENABLE_OLD_SSP_COMPAT 1
   52.66 -+_ACEOF
   52.67 -+
   52.68 -+fi
   52.69 -+
   52.70 - { echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5
   52.71 - echo $ECHO_N "checking for -fgnu89-inline... $ECHO_C" >&6; }
   52.72 - if test "${libc_cv_gnu89_inline+set}" = set; then
   52.73 -diff -durN glibc-2_9.orig/configure.in glibc-2_9/configure.in
   52.74 ---- glibc-2_9.orig/configure.in	2008-11-11 10:50:11.000000000 +0100
   52.75 -+++ glibc-2_9/configure.in	2009-02-02 22:00:32.000000000 +0100
   52.76 -@@ -1647,6 +1647,15 @@
   52.77 - rm -f conftest*])
   52.78 - AC_SUBST(libc_cv_ssp)
   52.79 - 
   52.80 -+AC_ARG_ENABLE([old-ssp-compat],
   52.81 -+	      AC_HELP_STRING([--enable-old-ssp-compat],
   52.82 -+	                     [enable support for older ssp symbols @<:@default=no@:>@]),
   52.83 -+	      [enable_old_ssp_compat=$enableval],
   52.84 -+	      [enable_old_ssp_compat=no])
   52.85 -+if test "x$enable_old_ssp_compat" = "xyes"; then
   52.86 -+  AC_DEFINE(ENABLE_OLD_SSP_COMPAT)
   52.87 -+fi
   52.88 -+
   52.89 - AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
   52.90 - cat > conftest.c <<EOF
   52.91 - int foo;
   52.92 -diff -durN glibc-2_9.orig/csu/Versions glibc-2_9/csu/Versions
   52.93 ---- glibc-2_9.orig/csu/Versions	2006-10-28 01:11:41.000000000 +0200
   52.94 -+++ glibc-2_9/csu/Versions	2009-02-02 22:00:32.000000000 +0100
   52.95 -@@ -17,6 +17,12 @@
   52.96 -     # New special glibc functions.
   52.97 -     gnu_get_libc_release; gnu_get_libc_version;
   52.98 -   }
   52.99 -+  GLIBC_2.3.2 {
  52.100 -+%ifdef ENABLE_OLD_SSP_COMPAT
  52.101 -+    # global objects and functions for the old propolice patch in gcc
  52.102 -+    __guard;
  52.103 -+%endif
  52.104 -+  }
  52.105 -   GLIBC_PRIVATE {
  52.106 - %if HAVE___THREAD
  52.107 -     # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
  52.108 -diff -durN glibc-2_9.orig/csu/libc-start.c glibc-2_9/csu/libc-start.c
  52.109 ---- glibc-2_9.orig/csu/libc-start.c	2007-08-21 00:27:50.000000000 +0200
  52.110 -+++ glibc-2_9/csu/libc-start.c	2009-02-02 22:00:32.000000000 +0100
  52.111 -@@ -37,6 +37,9 @@
  52.112 - uintptr_t __stack_chk_guard attribute_relro;
  52.113 - # endif
  52.114 - #endif
  52.115 -+#ifdef ENABLE_OLD_SSP_COMPAT
  52.116 -+uintptr_t __guard attribute_relro;
  52.117 -+#endif
  52.118 - 
  52.119 - #ifdef HAVE_PTR_NTHREADS
  52.120 - /* We need atomic operations.  */
  52.121 -@@ -141,6 +144,9 @@
  52.122 - 
  52.123 -   /* Set up the stack checker's canary.  */
  52.124 -   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
  52.125 -+#ifdef ENABLE_OLD_SSP_COMPAT
  52.126 -+  __guard = stack_chk_guard;
  52.127 -+#endif
  52.128 - # ifdef THREAD_SET_STACK_GUARD
  52.129 -   THREAD_SET_STACK_GUARD (stack_chk_guard);
  52.130 - # else
  52.131 -diff -durN glibc-2_9.orig/debug/Versions glibc-2_9/debug/Versions
  52.132 ---- glibc-2_9.orig/debug/Versions	2008-03-05 07:53:41.000000000 +0100
  52.133 -+++ glibc-2_9/debug/Versions	2009-02-02 22:00:32.000000000 +0100
  52.134 -@@ -10,6 +10,12 @@
  52.135 -     # These are to support some gcc features.
  52.136 -     __cyg_profile_func_enter; __cyg_profile_func_exit;
  52.137 -   }
  52.138 -+%ifdef ENABLE_OLD_SSP_COMPAT
  52.139 -+  GLIBC_2.3.2 {
  52.140 -+    # backwards ssp compat support; alias to __stack_chk_fail
  52.141 -+    __stack_smash_handler;
  52.142 -+  }
  52.143 -+%endif
  52.144 -   GLIBC_2.3.4 {
  52.145 -     __chk_fail;
  52.146 -     __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk; __stpcpy_chk;
  52.147 -diff -durN glibc-2_9.orig/debug/stack_chk_fail.c glibc-2_9/debug/stack_chk_fail.c
  52.148 ---- glibc-2_9.orig/debug/stack_chk_fail.c	2007-05-25 01:47:08.000000000 +0200
  52.149 -+++ glibc-2_9/debug/stack_chk_fail.c	2009-02-02 22:00:32.000000000 +0100
  52.150 -@@ -28,3 +28,7 @@
  52.151 - {
  52.152 -   __fortify_fail ("stack smashing detected");
  52.153 - }
  52.154 -+
  52.155 -+#ifdef ENABLE_OLD_SSP_COMPAT
  52.156 -+strong_alias (__stack_chk_fail, __stack_smash_handler)
  52.157 -+#endif
  52.158 -diff -durN glibc-2_9.orig/elf/Versions glibc-2_9/elf/Versions
  52.159 ---- glibc-2_9.orig/elf/Versions	2008-03-08 06:42:26.000000000 +0100
  52.160 -+++ glibc-2_9/elf/Versions	2009-02-02 22:00:33.000000000 +0100
  52.161 -@@ -43,6 +43,12 @@
  52.162 -     # runtime interface to TLS
  52.163 -     __tls_get_addr;
  52.164 -   }
  52.165 -+%ifdef ENABLE_OLD_SSP_COMPAT
  52.166 -+  GLIBC_2.3.2 {
  52.167 -+    # backwards ssp compat support
  52.168 -+    __guard;
  52.169 -+  }
  52.170 -+%endif
  52.171 -   GLIBC_2.4 {
  52.172 -     # stack canary
  52.173 -     __stack_chk_guard;
  52.174 -diff -durN glibc-2_9.orig/elf/rtld.c glibc-2_9/elf/rtld.c
  52.175 ---- glibc-2_9.orig/elf/rtld.c	2008-08-14 19:01:56.000000000 +0200
  52.176 -+++ glibc-2_9/elf/rtld.c	2009-02-02 22:00:32.000000000 +0100
  52.177 -@@ -89,6 +89,9 @@
  52.178 -    in thread local area.  */
  52.179 - uintptr_t __stack_chk_guard attribute_relro;
  52.180 - #endif
  52.181 -+#ifdef ENABLE_OLD_SSP_COMPAT
  52.182 -+uintptr_t __guard attribute_relro;
  52.183 -+#endif
  52.184 - 
  52.185 - /* Only exported for architectures that don't store the pointer guard
  52.186 -    value in thread local area.  */
  52.187 -@@ -842,6 +845,9 @@
  52.188 - {
  52.189 -   /* Set up the stack checker's canary.  */
  52.190 -   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
  52.191 -+#ifdef ENABLE_OLD_SSP_COMPAT
  52.192 -+  __guard = stack_chk_guard;
  52.193 -+#endif
  52.194 - #ifdef THREAD_SET_STACK_GUARD
  52.195 -   THREAD_SET_STACK_GUARD (stack_chk_guard);
  52.196 - #else
    53.1 --- a/patches/glibc/2_9/110-respect-env-CPPFLAGS.patch	Sat Apr 11 19:03:02 2009 +0000
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,30 +0,0 @@
    53.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0030_all_glibc-respect-env-CPPFLAGS.patch
    53.5 -
    53.6 --= BEGIN original header =-
    53.7 -Respect environment CPPFLAGS when we run ./configure so we can inject
    53.8 -random -D things without having to set CFLAGS/ASFLAGS
    53.9 -
   53.10 --= END original header =-
   53.11 -
   53.12 -diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
   53.13 ---- glibc-2_9.orig/Makeconfig	2008-08-18 11:42:17.000000000 +0200
   53.14 -+++ glibc-2_9/Makeconfig	2009-02-02 22:00:35.000000000 +0100
   53.15 -@@ -673,6 +673,7 @@
   53.16 - 	   $(foreach lib,$(libof-$(basename $(@F))) \
   53.17 - 		         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
   53.18 - 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
   53.19 -+CPPFLAGS += $(CPPFLAGS-config)
   53.20 - override CFLAGS	= -std=gnu99 $(gnu89-inline-CFLAGS) \
   53.21 - 		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
   53.22 - 		  $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
   53.23 -diff -durN glibc-2_9.orig/config.make.in glibc-2_9/config.make.in
   53.24 ---- glibc-2_9.orig/config.make.in	2008-08-18 11:42:17.000000000 +0200
   53.25 -+++ glibc-2_9/config.make.in	2009-02-02 22:00:35.000000000 +0100
   53.26 -@@ -97,6 +97,7 @@
   53.27 - CXX = @CXX@
   53.28 - BUILD_CC = @BUILD_CC@
   53.29 - CFLAGS = @CFLAGS@
   53.30 -+CPPFLAGS-config = @CPPFLAGS@
   53.31 - ASFLAGS-config = @ASFLAGS_config@
   53.32 - AR = @AR@
   53.33 - RANLIB = @RANLIB@
    54.1 --- a/patches/glibc/2_9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch	Sat Apr 11 19:03:02 2009 +0000
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,35 +0,0 @@
    54.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
    54.5 -
    54.6 --= BEGIN original header =-
    54.7 -http://sourceware.org/ml/libc-alpha/2009-01/msg00000.html
    54.8 -
    54.9 -From 8ad7030880eaa18dcabf8e284e79026301fd3fa4 Mon Sep 17 00:00:00 2001
   54.10 -From: Ulrich Drepper <drepper@redhat.com>
   54.11 -Date: Thu, 8 Jan 2009 00:02:38 +0000
   54.12 -Subject: [PATCH] (_nss_dns_gethostbyaddr2_r): Check and adjust the buffer alignment.
   54.13 -
   54.14 --= END original header =-
   54.15 -
   54.16 -diff -durN glibc-2_9.orig/resolv/nss_dns/dns-host.c glibc-2_9/resolv/nss_dns/dns-host.c
   54.17 ---- glibc-2_9.orig/resolv/nss_dns/dns-host.c	2008-11-12 08:52:20.000000000 +0100
   54.18 -+++ glibc-2_9/resolv/nss_dns/dns-host.c	2009-02-02 22:00:36.000000000 +0100
   54.19 -@@ -364,6 +364,19 @@
   54.20 -   int n, status;
   54.21 -   int olderr = errno;
   54.22 - 
   54.23 -+ uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
   54.24 -+ buffer += pad;
   54.25 -+ buflen = buflen > pad ? buflen - pad : 0;
   54.26 -+
   54.27 -+ if (__builtin_expect (buflen < sizeof (struct host_data), 0))
   54.28 -+   {
   54.29 -+     *errnop = ERANGE;
   54.30 -+     *h_errnop = NETDB_INTERNAL;
   54.31 -+     return NSS_STATUS_TRYAGAIN;
   54.32 -+   }
   54.33 -+
   54.34 -+ host_data = (struct host_data *) buffer;
   54.35 -+
   54.36 -   if (__res_maybe_init (&_res, 0) == -1)
   54.37 -     return NSS_STATUS_UNAVAIL;
   54.38 - 
    55.1 --- a/patches/glibc/2_9/130-add_prio-macros.patch	Sat Apr 11 19:03:02 2009 +0000
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,26 +0,0 @@
    55.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0051_all_glibc-2.9-add_prio-macros.patch
    55.5 -
    55.6 --= BEGIN original header =-
    55.7 -http://sourceware.org/ml/libc-alpha/2009-01/msg00003.html
    55.8 -
    55.9 -From a1737958e074e8f990760acc8abeb0c23715a859 Mon Sep 17 00:00:00 2001
   55.10 -From: Roland McGrath <roland@gnu.org>
   55.11 -Date: Sat, 3 Jan 2009 21:04:01 +0000
   55.12 -Subject: [PATCH] 2009-01-03  Samuel Thibault  <samuel.thibault@ens-lyon.org>
   55.13 -
   55.14 -	* bits/resource.h (PRIO_PROCESS, PRIO_PGRP, PRIO_USER): Add macros.
   55.15 --= END original header =-
   55.16 -
   55.17 -diff -durN glibc-2_9.orig/bits/resource.h glibc-2_9/bits/resource.h
   55.18 ---- glibc-2_9.orig/bits/resource.h	2006-03-05 23:48:10.000000000 +0100
   55.19 -+++ glibc-2_9/bits/resource.h	2009-02-02 22:00:38.000000000 +0100
   55.20 -@@ -185,6 +185,9 @@
   55.21 - enum __priority_which
   55.22 -   {
   55.23 -     PRIO_PROCESS = 0,           /* WHO is a process ID.  */
   55.24 -+#define PRIO_PROCESS PRIO_PROCESS
   55.25 -     PRIO_PGRP = 1,              /* WHO is a process group ID.  */
   55.26 -+#define PRIO_PGRP PRIO_PGRP
   55.27 -     PRIO_USER = 2               /* WHO is a user ID.  */
   55.28 -+#define PRIO_USER PRIO_USER
   55.29 -   };
    56.1 --- a/patches/glibc/2_9/140-regex-BZ9697.patch	Sat Apr 11 19:03:02 2009 +0000
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,111 +0,0 @@
    56.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0052_all_glibc-2.9-regex-BZ9697.patch
    56.5 -
    56.6 --= BEGIN original header =-
    56.7 -http://sourceware.org/ml/libc-alpha/2009-01/msg00005.html
    56.8 -
    56.9 -From ea8ca0dfcbf2721bcf2c08ce3c01d5764b827572 Mon Sep 17 00:00:00 2001
   56.10 -From: Ulrich Drepper <drepper@redhat.com>
   56.11 -Date: Thu, 8 Jan 2009 00:42:28 +0000
   56.12 -Subject: [PATCH] (re_compile_fastmap_iter): Rewrite COMPLEX_BRACKET handling.
   56.13 -
   56.14 --= END original header =-
   56.15 -
   56.16 -diff -durN glibc-2_9.orig/posix/regcomp.c glibc-2_9/posix/regcomp.c
   56.17 ---- glibc-2_9.orig/posix/regcomp.c	2008-05-15 05:07:21.000000000 +0200
   56.18 -+++ glibc-2_9/posix/regcomp.c	2009-02-02 22:00:41.000000000 +0100
   56.19 -@@ -350,47 +350,67 @@
   56.20 - #ifdef RE_ENABLE_I18N
   56.21 -       else if (type == COMPLEX_BRACKET)
   56.22 - 	{
   56.23 --	  int i;
   56.24 - 	  re_charset_t *cset = dfa->nodes[node].opr.mbcset;
   56.25 --	  if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes
   56.26 --	      || cset->nranges || cset->nchar_classes)
   56.27 --	    {
   56.28 -+	  int i;
   56.29 -+
   56.30 - # ifdef _LIBC
   56.31 --	      if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0)
   56.32 -+	  /* See if we have to try all bytes which start multiple collation
   56.33 -+	     elements.
   56.34 -+	     e.g. In da_DK, we want to catch 'a' since "aa" is a valid
   56.35 -+		  collation element, and don't catch 'b' since 'b' is
   56.36 -+		  the only collation element which starts from 'b' (and
   56.37 -+		  it is caught by SIMPLE_BRACKET).  */
   56.38 -+	      if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
   56.39 -+		  && (cset->ncoll_syms || cset->nranges))
   56.40 - 		{
   56.41 --		  /* In this case we want to catch the bytes which are
   56.42 --		     the first byte of any collation elements.
   56.43 --		     e.g. In da_DK, we want to catch 'a' since "aa"
   56.44 --			  is a valid collation element, and don't catch
   56.45 --			  'b' since 'b' is the only collation element
   56.46 --			  which starts from 'b'.  */
   56.47 - 		  const int32_t *table = (const int32_t *)
   56.48 - 		    _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
   56.49 - 		  for (i = 0; i < SBC_MAX; ++i)
   56.50 - 		    if (table[i] < 0)
   56.51 - 		      re_set_fastmap (fastmap, icase, i);
   56.52 - 		}
   56.53 --# else
   56.54 --	      if (dfa->mb_cur_max > 1)
   56.55 --		for (i = 0; i < SBC_MAX; ++i)
   56.56 --		  if (__btowc (i) == WEOF)
   56.57 --		    re_set_fastmap (fastmap, icase, i);
   56.58 --# endif /* not _LIBC */
   56.59 --	    }
   56.60 --	  for (i = 0; i < cset->nmbchars; ++i)
   56.61 -+# endif /* _LIBC */
   56.62 -+
   56.63 -+	  /* See if we have to start the match at all multibyte characters,
   56.64 -+	     i.e. where we would not find an invalid sequence.  This only
   56.65 -+	     applies to multibyte character sets; for single byte character
   56.66 -+	     sets, the SIMPLE_BRACKET again suffices.  */
   56.67 -+	  if (dfa->mb_cur_max > 1
   56.68 -+	      && (cset->nchar_classes || cset->non_match
   56.69 -+# ifdef _LIBC
   56.70 -+		  || cset->nequiv_classes
   56.71 -+# endif /* _LIBC */
   56.72 -+		 ))
   56.73 - 	    {
   56.74 --	      char buf[256];
   56.75 --	      mbstate_t state;
   56.76 --	      memset (&state, '\0', sizeof (state));
   56.77 --	      if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
   56.78 --		re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
   56.79 --	      if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
   56.80 -+	      unsigned char c = 0;
   56.81 -+	      do
   56.82 - 		{
   56.83 --		  if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
   56.84 --		      != (size_t) -1)
   56.85 --		    re_set_fastmap (fastmap, 0, *(unsigned char *) buf);
   56.86 -+		  mbstate_t mbs;
   56.87 -+		  memset (&mbs, 0, sizeof (mbs));
   56.88 -+		  if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2)
   56.89 -+		    re_set_fastmap (fastmap, false, (int) c);
   56.90 - 		}
   56.91 -+	      while (++c != 0);
   56.92 - 	    }
   56.93 -+
   56.94 -+	  else
   56.95 -+	    {
   56.96 -+	      /* ... Else catch all bytes which can start the mbchars.  */
   56.97 -+	      for (i = 0; i < cset->nmbchars; ++i)
   56.98 -+		{
   56.99 -+		  char buf[256];
  56.100 -+		  mbstate_t state;
  56.101 -+		  memset (&state, '\0', sizeof (state));
  56.102 -+		  if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
  56.103 -+		    re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
  56.104 -+		  if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
  56.105 -+		    {
  56.106 -+		      if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
  56.107 -+			  != (size_t) -1)
  56.108 -+			re_set_fastmap (fastmap, false, *(unsigned char *) buf);
  56.109 -+		    }
  56.110 -+ 		}
  56.111 -+ 	    }
  56.112 - 	}
  56.113 - #endif /* RE_ENABLE_I18N */
  56.114 -       else if (type == OP_PERIOD
    57.1 --- a/patches/glibc/2_9/150-regex-BZ697.patch	Sat Apr 11 19:03:02 2009 +0000
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,28 +0,0 @@
    57.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0053_all_glibc-2.9-regex-BZ697.patch
    57.5 -
    57.6 --= BEGIN original header =-
    57.7 -http://sourceware.org/ml/libc-alpha/2009-01/msg00006.html
    57.8 -
    57.9 -From 37bdc055ceeb6b1144c07448a7210d9ab3fbb2f5 Mon Sep 17 00:00:00 2001
   57.10 -From: Ulrich Drepper <drepper@redhat.com>
   57.11 -Date: Thu, 8 Jan 2009 00:47:05 +0000
   57.12 -Subject: [PATCH] (prune_impossible_nodes): Handle sifted_states[0] being NULL also if
   57.13 - there are no backreferences.
   57.14 -
   57.15 --= END original header =-
   57.16 -
   57.17 -diff -durN glibc-2_9.orig/posix/regexec.c glibc-2_9/posix/regexec.c
   57.18 ---- glibc-2_9.orig/posix/regexec.c	2007-10-12 19:47:13.000000000 +0200
   57.19 -+++ glibc-2_9/posix/regexec.c	2009-02-02 22:00:43.000000000 +0100
   57.20 -@@ -1004,6 +1004,11 @@
   57.21 -       re_node_set_free (&sctx.limits);
   57.22 -       if (BE (ret != REG_NOERROR, 0))
   57.23 - 	goto free_return;
   57.24 -+      if (sifted_states[0] == NULL)
   57.25 -+	{
   57.26 -+	  ret = REG_NOMATCH;
   57.27 -+	  goto free_return;
   57.28 -+	}
   57.29 -     }
   57.30 -   re_free (mctx->state_log);
   57.31 -   mctx->state_log = sifted_states;
    58.1 --- a/patches/glibc/2_9/160-i386-x86_64-revert-clone-cfi.patch	Sat Apr 11 19:03:02 2009 +0000
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,53 +0,0 @@
    58.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0070_all_glibc-i386-x86_64-revert-clone-cfi.patch
    58.5 -
    58.6 --= BEGIN original header =-
    58.7 -revert cfi additions to clone on i386/x86_64 to workaround problems in
    58.8 -gcc's unwinder code.  this is not a bug in glibc, it triggers problems
    58.9 -elsewhere.  this cfi code does not gain us a whole lot anyways.
   58.10 -
   58.11 -http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
   58.12 -
   58.13 --= END original header =-
   58.14 -
   58.15 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2_9/sysdeps/unix/sysv/linux/i386/clone.S
   58.16 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/i386/clone.S	2006-12-04 00:12:36.000000000 +0100
   58.17 -+++ glibc-2_9/sysdeps/unix/sysv/linux/i386/clone.S	2009-02-02 22:00:45.000000000 +0100
   58.18 -@@ -120,9 +120,6 @@
   58.19 - 	ret
   58.20 - 
   58.21 - L(thread_start):
   58.22 --	cfi_startproc;
   58.23 --	/* Clearing frame pointer is insufficient, use CFI.  */
   58.24 --	cfi_undefined (eip);
   58.25 - 	/* Note: %esi is zero.  */
   58.26 - 	movl	%esi,%ebp	/* terminate the stack frame */
   58.27 - #ifdef RESET_PID
   58.28 -@@ -155,7 +152,6 @@
   58.29 - 	jmp	L(haspid)
   58.30 - 	.previous
   58.31 - #endif
   58.32 --	cfi_endproc;
   58.33 - 
   58.34 - 	cfi_startproc
   58.35 - PSEUDO_END (BP_SYM (__clone))
   58.36 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/x86_64/clone.S glibc-2_9/sysdeps/unix/sysv/linux/x86_64/clone.S
   58.37 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/x86_64/clone.S	2006-12-04 00:12:36.000000000 +0100
   58.38 -+++ glibc-2_9/sysdeps/unix/sysv/linux/x86_64/clone.S	2009-02-02 22:00:45.000000000 +0100
   58.39 -@@ -89,9 +89,6 @@
   58.40 - 	ret
   58.41 - 
   58.42 - L(thread_start):
   58.43 --	cfi_startproc;
   58.44 --	/* Clearing frame pointer is insufficient, use CFI.  */
   58.45 --	cfi_undefined (rip);
   58.46 - 	/* Clear the frame pointer.  The ABI suggests this be done, to mark
   58.47 - 	   the outermost frame obviously.  */
   58.48 - 	xorl	%ebp, %ebp
   58.49 -@@ -116,7 +113,6 @@
   58.50 - 	/* Call exit with return value from function call. */
   58.51 - 	movq	%rax, %rdi
   58.52 - 	call	HIDDEN_JUMPTARGET (_exit)
   58.53 --	cfi_endproc;
   58.54 - 
   58.55 - 	cfi_startproc;
   58.56 - PSEUDO_END (BP_SYM (__clone))
    59.1 --- a/patches/glibc/2_9/170-2.10-dns-no-gethostbyname4.patch	Sat Apr 11 19:03:02 2009 +0000
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,35 +0,0 @@
    59.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0080_all_glibc-2.10-dns-no-gethostbyname4.patch
    59.5 -
    59.6 --= BEGIN original header =-
    59.7 -http://sourceware.org/bugzilla/show_bug.cgi?id=7060
    59.8 -http://bugs.gentoo.org/250468
    59.9 -
   59.10 -The gethostbyname4() lookup method is problematic since it fires out both
   59.11 -the A and AAAA DNS queries in parallel and over the same socket. This
   59.12 -should work in theory, but it turns out that many cheap DSL modems and
   59.13 -similar devices have buggy DNS servers - if the AAAA query arrives too
   59.14 -quickly after the A query, the server will generate only a single reply
   59.15 -with the A query id but returning an error for the AAAA query; we get
   59.16 -stuck waiting for the second reply.
   59.17 -
   59.18 -For gethostbyname4() users affected, disabling IPv6 in the system might
   59.19 -work around the issue, unfortunately it only helps with applications
   59.20 -using AI_ADDRCONFIG (e.g. Firefox); some (notably e.g. Pidgin) neglect
   59.21 -to do that.
   59.22 -
   59.23 -Real fix should be using separate ports for the A and AAAA queries.
   59.24 -
   59.25 --= END original header =-
   59.26 -
   59.27 -diff -durN glibc-2_9.orig/resolv/Versions glibc-2_9/resolv/Versions
   59.28 ---- glibc-2_9.orig/resolv/Versions	2008-08-01 19:15:34.000000000 +0200
   59.29 -+++ glibc-2_9/resolv/Versions	2009-02-02 22:00:46.000000000 +0100
   59.30 -@@ -102,7 +102,7 @@
   59.31 -     _nss_dns_gethostbyname_r; _nss_dns_getnetbyaddr_r;
   59.32 -     _nss_dns_getnetbyname_r; _nss_dns_getcanonname_r;
   59.33 -     _nss_dns_gethostbyaddr2_r;
   59.34 --    _nss_dns_gethostbyname4_r;
   59.35 -+#    _nss_dns_gethostbyname4_r;
   59.36 -   }
   59.37 - }
   59.38 - 
    60.1 --- a/patches/glibc/2_9/180-math-tests.patch	Sat Apr 11 19:03:02 2009 +0000
    60.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.3 @@ -1,72 +0,0 @@
    60.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/0090_all_glibc-math-tests.patch
    60.5 -
    60.6 --= BEGIN original header =-
    60.7 -From: "Joseph S. Myers" <joseph at codesourcery dot com>
    60.8 -To: libc-alpha at sourceware dot org
    60.9 -Date: Tue, 15 Jul 2008 14:43:04 +0000 (UTC)
   60.10 -Subject: expm1 ulps
   60.11 -
   60.12 -If you test glibc on i686 with GCC 4.3, you get a test-ildoubl failure:
   60.13 -
   60.14 -Failure: Test: expm1 (1) == M_El - 1.0
   60.15 -Result:
   60.16 - is:          1.71828182845904523532e+00   0xd.bf0a8b14576953500000p-3
   60.17 - should be:   1.71828182845904523543e+00   0xd.bf0a8b14576953600000p-3
   60.18 - difference:  1.08420217248550443401e-19   0x8.00000000000000000000p-66
   60.19 - ulp       :  1.0000
   60.20 - max.ulp   :  0.0000
   60.21 -Maximal error of `expm1'
   60.22 - is      : 1 ulp
   60.23 - accepted: 0 ulp
   60.24 -
   60.25 -What happens is that the inline expansion of expm1l uses __builtin_expm1l,
   60.26 -and GCC 4.3 optimizes calls to __builtin_expm1l with constant argument to
   60.27 -a correctly rounded result using MPFR.  The result returned is thus the
   60.28 -value of e-1 rounded once to long double precision.  However, the test
   60.29 -expects M_El - 1.0, and the result of rounding e to long double precision,
   60.30 -then subtracting 1, differs in the last place from the result of rounding
   60.31 -e-1 to long double precision (the latter has smaller exponent, and the
   60.32 -last bit is 1).
   60.33 -
   60.34 -There are two obvious approaches possible to fixing this.  The first patch
   60.35 -below changes the expectation to a decimal expansion for e-1 (taken from
   60.36 -that of M_El) rather than doing arithmetic in the expected value.  This in
   60.37 -turn requires ulps to be set for the out-of-line version of expm1.  It
   60.38 -might also need ulps to be set for the inline version for older compilers
   60.39 -if they should continue to pass the test, and possibly for other targets.
   60.40 -The second patch below takes the alternative approach of keeping the
   60.41 -existing expectation (which has the wrong bit in the last place) and
   60.42 -setting ulps for the inline expansion of expm1, which avoids the risk of
   60.43 -breaking the test for other targets.
   60.44 -
   60.45 -2008-07-15  Joseph Myers  <joseph@codesourcery.com>
   60.46 -
   60.47 -        * sysdeps/i386/fpu/libm-test-ulps: Add inline long double ulps for
   60.48 -        expm1.
   60.49 -
   60.50 --= END original header =-
   60.51 -
   60.52 -diff -durN glibc-2_9.orig/sysdeps/i386/fpu/libm-test-ulps glibc-2_9/sysdeps/i386/fpu/libm-test-ulps
   60.53 ---- glibc-2_9.orig/sysdeps/i386/fpu/libm-test-ulps	2006-01-15 18:59:37.000000000 +0100
   60.54 -+++ glibc-2_9/sysdeps/i386/fpu/libm-test-ulps	2009-02-02 22:00:47.000000000 +0100
   60.55 -@@ -453,6 +453,10 @@
   60.56 - ildouble: 8
   60.57 - ldouble: 8
   60.58 - 
   60.59 -+# expm1
   60.60 -+Test "expm1 (1) == M_El - 1.0":
   60.61 -+ildouble: 1
   60.62 -+
   60.63 - # gamma
   60.64 - Test "gamma (-0.5) == log(2*sqrt(pi))":
   60.65 - double: 1
   60.66 -@@ -1134,6 +1138,9 @@
   60.67 - ildouble: 8
   60.68 - ldouble: 8
   60.69 - 
   60.70 -+Function: "expm1":
   60.71 -+ildouble: 1
   60.72 -+
   60.73 - Function: "gamma":
   60.74 - double: 1
   60.75 - idouble: 1
    61.1 --- a/patches/glibc/2_9/190-queue-header-updates.patch	Sat Apr 11 19:03:02 2009 +0000
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,89 +0,0 @@
    61.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1010_all_glibc-queue-header-updates.patch
    61.5 -
    61.6 --= BEGIN original header =-
    61.7 -grab some updates from FreeBSD
    61.8 -
    61.9 -http://bugs.gentoo.org/201979
   61.10 -
   61.11 --= END original header =-
   61.12 -
   61.13 -diff -durN glibc-2_9.orig/misc/sys/queue.h glibc-2_9/misc/sys/queue.h
   61.14 ---- glibc-2_9.orig/misc/sys/queue.h	2008-03-05 06:50:30.000000000 +0100
   61.15 -+++ glibc-2_9/misc/sys/queue.h	2009-02-02 22:00:48.000000000 +0100
   61.16 -@@ -136,6 +136,11 @@
   61.17 - 		(var);							\
   61.18 - 		(var) = ((var)->field.le_next))
   61.19 - 
   61.20 -+#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
   61.21 -+	for ((var) = LIST_FIRST((head));				\
   61.22 -+	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
   61.23 -+	    (var) = (tvar))
   61.24 -+
   61.25 - /*
   61.26 -  * List access methods.
   61.27 -  */
   61.28 -@@ -197,6 +202,16 @@
   61.29 - #define	SLIST_FOREACH(var, head, field)					\
   61.30 - 	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
   61.31 - 
   61.32 -+#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
   61.33 -+	for ((var) = SLIST_FIRST((head));				\
   61.34 -+	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
   61.35 -+	    (var) = (tvar))
   61.36 -+
   61.37 -+#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
   61.38 -+	for ((varp) = &SLIST_FIRST((head));				\
   61.39 -+	    ((var) = *(varp)) != NULL;					\
   61.40 -+	    (varp) = &SLIST_NEXT((var), field))
   61.41 -+
   61.42 - /*
   61.43 -  * Singly-linked List access methods.
   61.44 -  */
   61.45 -@@ -242,6 +257,12 @@
   61.46 - 	(head)->stqh_last = &(elm)->field.stqe_next;			\
   61.47 - } while (/*CONSTCOND*/0)
   61.48 - 
   61.49 -+#define	STAILQ_LAST(head, type, field)					\
   61.50 -+	(STAILQ_EMPTY((head)) ?						\
   61.51 -+		NULL :							\
   61.52 -+	        ((struct type *)(void *)				\
   61.53 -+		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
   61.54 -+
   61.55 - #define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
   61.56 - 	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
   61.57 - 		(head)->stqh_last = &(elm)->field.stqe_next;		\
   61.58 -@@ -286,6 +307,11 @@
   61.59 - #define	STAILQ_FIRST(head)	((head)->stqh_first)
   61.60 - #define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
   61.61 - 
   61.62 -+#define	STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
   61.63 -+	for ((var) = STAILQ_FIRST((head));				\
   61.64 -+	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
   61.65 -+	    (var) = (tvar))
   61.66 -+
   61.67 - 
   61.68 - /*
   61.69 -  * Simple queue definitions.
   61.70 -@@ -437,11 +463,22 @@
   61.71 - 		(var);							\
   61.72 - 		(var) = ((var)->field.tqe_next))
   61.73 - 
   61.74 -+#define	TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
   61.75 -+	for ((var) = TAILQ_FIRST((head));				\
   61.76 -+	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
   61.77 -+	    (var) = (tvar))
   61.78 -+
   61.79 - #define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
   61.80 - 	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
   61.81 - 		(var);							\
   61.82 - 		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
   61.83 - 
   61.84 -+#define	TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	\
   61.85 -+	for ((var) = TAILQ_LAST((head), headname);			\
   61.86 -+	    (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
   61.87 -+	    (var) = (tvar))
   61.88 -+
   61.89 -+
   61.90 - #define	TAILQ_CONCAT(head1, head2, field) do {				\
   61.91 - 	if (!TAILQ_EMPTY(head2)) {					\
   61.92 - 		*(head1)->tqh_last = (head2)->tqh_first;		\
    62.1 --- a/patches/glibc/2_9/200-awk-in-C-locale.patch	Sat Apr 11 19:03:02 2009 +0000
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,23 +0,0 @@
    62.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1018_all_glibc-awk-in-C-locale.patch
    62.5 -
    62.6 --= BEGIN original header =-
    62.7 -http://bugs.gentoo.org/252802
    62.8 -
    62.9 -2008-12-29  Mike Frysinger  <vapier@gentoo.org>
   62.10 -
   62.11 -	* iconvdata/Makefile (iconv-rules): Use LC_ALL=C when running awk script.
   62.12 -
   62.13 --= END original header =-
   62.14 -
   62.15 -diff -durN glibc-2_9.orig/iconvdata/Makefile glibc-2_9/iconvdata/Makefile
   62.16 ---- glibc-2_9.orig/iconvdata/Makefile	2008-05-15 03:54:31.000000000 +0200
   62.17 -+++ glibc-2_9/iconvdata/Makefile	2009-02-02 22:00:50.000000000 +0100
   62.18 -@@ -286,7 +286,7 @@
   62.19 - 	{ echo $(filter-out lib%, $(modules)); \
   62.20 - 	  echo 8bit $(gen-8bit-modules); \
   62.21 - 	  echo 8bit-gap $(gen-8bit-gap-modules); } | \
   62.22 --	$(AWK) 'NR == 1 { \
   62.23 -+	LC_ALL=C $(AWK) 'NR == 1 { \
   62.24 - 		  for (i = 1; i <= NF; i++) { \
   62.25 - 		    printf "%s-routines := %s\n", $$i, tolower($$i); \
   62.26 - 		    printf "%s-map := gconv.map\n", $$i; \
    63.1 --- a/patches/glibc/2_9/210-2.9-strlen-hack.patch	Sat Apr 11 19:03:02 2009 +0000
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,109 +0,0 @@
    63.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1020_all_glibc-2.9-strlen-hack.patch
    63.5 -
    63.6 --= BEGIN original header =-
    63.7 -http://sourceware.org/bugzilla/show_bug.cgi?id=5807
    63.8 -http://www.cl.cam.ac.uk/~am21/progtricks.html
    63.9 -
   63.10 --= END original header =-
   63.11 -
   63.12 -diff -durN glibc-2_9.orig/string/strlen.c glibc-2_9/string/strlen.c
   63.13 ---- glibc-2_9.orig/string/strlen.c	2005-12-14 12:09:07.000000000 +0100
   63.14 -+++ glibc-2_9/string/strlen.c	2009-02-02 22:00:51.000000000 +0100
   63.15 -@@ -32,7 +32,7 @@
   63.16 - {
   63.17 -   const char *char_ptr;
   63.18 -   const unsigned long int *longword_ptr;
   63.19 --  unsigned long int longword, magic_bits, himagic, lomagic;
   63.20 -+  unsigned long int longword, himagic, lomagic;
   63.21 - 
   63.22 -   /* Handle the first few characters by reading one character at a time.
   63.23 -      Do this until CHAR_PTR is aligned on a longword boundary.  */
   63.24 -@@ -42,28 +42,14 @@
   63.25 -     if (*char_ptr == '\0')
   63.26 -       return char_ptr - str;
   63.27 - 
   63.28 --  /* All these elucidatory comments refer to 4-byte longwords,
   63.29 --     but the theory applies equally well to 8-byte longwords.  */
   63.30 --
   63.31 -   longword_ptr = (unsigned long int *) char_ptr;
   63.32 - 
   63.33 --  /* Bits 31, 24, 16, and 8 of this number are zero.  Call these bits
   63.34 --     the "holes."  Note that there is a hole just to the left of
   63.35 --     each byte, with an extra at the end:
   63.36 --
   63.37 --     bits:  01111110 11111110 11111110 11111111
   63.38 --     bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
   63.39 --
   63.40 --     The 1-bits make sure that carries propagate to the next 0-bit.
   63.41 --     The 0-bits provide holes for carries to fall into.  */
   63.42 --  magic_bits = 0x7efefeffL;
   63.43 -   himagic = 0x80808080L;
   63.44 -   lomagic = 0x01010101L;
   63.45 -   if (sizeof (longword) > 4)
   63.46 -     {
   63.47 -       /* 64-bit version of the magic.  */
   63.48 -       /* Do the shift in two steps to avoid a warning if long has 32 bits.  */
   63.49 --      magic_bits = ((0x7efefefeL << 16) << 16) | 0xfefefeffL;
   63.50 -       himagic = ((himagic << 16) << 16) | himagic;
   63.51 -       lomagic = ((lomagic << 16) << 16) | lomagic;
   63.52 -     }
   63.53 -@@ -75,56 +61,12 @@
   63.54 -      if *any of the four* bytes in the longword in question are zero.  */
   63.55 -   for (;;)
   63.56 -     {
   63.57 --      /* We tentatively exit the loop if adding MAGIC_BITS to
   63.58 --	 LONGWORD fails to change any of the hole bits of LONGWORD.
   63.59 --
   63.60 --	 1) Is this safe?  Will it catch all the zero bytes?
   63.61 --	 Suppose there is a byte with all zeros.  Any carry bits
   63.62 --	 propagating from its left will fall into the hole at its
   63.63 --	 least significant bit and stop.  Since there will be no
   63.64 --	 carry from its most significant bit, the LSB of the
   63.65 --	 byte to the left will be unchanged, and the zero will be
   63.66 --	 detected.
   63.67 --
   63.68 --	 2) Is this worthwhile?  Will it ignore everything except
   63.69 --	 zero bytes?  Suppose every byte of LONGWORD has a bit set
   63.70 --	 somewhere.  There will be a carry into bit 8.  If bit 8
   63.71 --	 is set, this will carry into bit 16.  If bit 8 is clear,
   63.72 --	 one of bits 9-15 must be set, so there will be a carry
   63.73 --	 into bit 16.  Similarly, there will be a carry into bit
   63.74 --	 24.  If one of bits 24-30 is set, there will be a carry
   63.75 --	 into bit 31, so all of the hole bits will be changed.
   63.76 --
   63.77 --	 The one misfire occurs when bits 24-30 are clear and bit
   63.78 --	 31 is set; in this case, the hole at bit 31 is not
   63.79 --	 changed.  If we had access to the processor carry flag,
   63.80 --	 we could close this loophole by putting the fourth hole
   63.81 --	 at bit 32!
   63.82 --
   63.83 --	 So it ignores everything except 128's, when they're aligned
   63.84 --	 properly.  */
   63.85 --
   63.86 -       longword = *longword_ptr++;
   63.87 - 
   63.88 --      if (
   63.89 --#if 0
   63.90 --	  /* Add MAGIC_BITS to LONGWORD.  */
   63.91 --	  (((longword + magic_bits)
   63.92 --
   63.93 --	    /* Set those bits that were unchanged by the addition.  */
   63.94 --	    ^ ~longword)
   63.95 --
   63.96 --	   /* Look at only the hole bits.  If any of the hole bits
   63.97 --	      are unchanged, most likely one of the bytes was a
   63.98 --	      zero.  */
   63.99 --	   & ~magic_bits)
  63.100 --#else
  63.101 --	  ((longword - lomagic) & himagic)
  63.102 --#endif
  63.103 --	  != 0)
  63.104 -+      /* This hack taken from Alan Mycroft's HAKMEMC postings.
  63.105 -+         See: http://www.cl.cam.ac.uk/~am21/progtricks.html */
  63.106 -+      if (((longword - lomagic) & ~longword & himagic) != 0)
  63.107 - 	{
  63.108 --	  /* Which of the bytes was the zero?  If none of them were, it was
  63.109 --	     a misfire; continue the search.  */
  63.110 - 
  63.111 - 	  const char *cp = (const char *) (longword_ptr - 1);
  63.112 - 
    64.1 --- a/patches/glibc/2_9/220-manual-no-perl.patch	Sat Apr 11 19:03:02 2009 +0000
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,29 +0,0 @@
    64.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1030_all_glibc-manual-no-perl.patch
    64.5 -
    64.6 --= BEGIN original header =-
    64.7 -If we're using a cvs snapshot which updates the source files, and
    64.8 -perl isn't installed yet, then we can't regen the docs.  Not a big
    64.9 -deal, so just whine a little and continue on our merry way.
   64.10 -
   64.11 -http://bugs.gentoo.org/60132
   64.12 -
   64.13 --= END original header =-
   64.14 -
   64.15 -diff -durN glibc-2_9.orig/manual/Makefile glibc-2_9/manual/Makefile
   64.16 ---- glibc-2_9.orig/manual/Makefile	2006-01-08 07:43:47.000000000 +0100
   64.17 -+++ glibc-2_9/manual/Makefile	2009-02-02 22:00:53.000000000 +0100
   64.18 -@@ -104,9 +104,14 @@
   64.19 - libm-err.texi: stamp-libm-err
   64.20 - stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
   64.21 - 						     $(dir)/libm-test-ulps))
   64.22 -+ifneq ($(PERL),no)
   64.23 - 	pwd=`pwd`; \
   64.24 - 	$(PERL) $< $$pwd/.. > libm-err-tmp
   64.25 - 	$(move-if-change) libm-err-tmp libm-err.texi
   64.26 -+else
   64.27 -+	echo "Unable to rebuild math docs, no perl installed"
   64.28 -+	touch libm-err.texi
   64.29 -+endif
   64.30 - 	touch $@
   64.31 - 
   64.32 - # Generate Texinfo files from the C source for the example programs.
    65.1 --- a/patches/glibc/2_9/230-2.3.3-localedef-fix-trampoline.patch	Sat Apr 11 19:03:02 2009 +0000
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,74 +0,0 @@
    65.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1040_all_2.3.3-localedef-fix-trampoline.patch
    65.5 -
    65.6 --= BEGIN original header =-
    65.7 -#! /bin/sh -e
    65.8 -
    65.9 -# DP: Description: Fix localedef segfault when run under exec-shield,
   65.10 -#        PaX or similar. (#231438, #198099)
   65.11 -# DP: Dpatch Author: James Troup <james@nocrew.org>
   65.12 -# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
   65.13 -# DP: Upstream status: Unknown
   65.14 -# DP: Status Details: Unknown
   65.15 -# DP: Date: 2004-03-16
   65.16 -
   65.17 -if [ $# -ne 2 ]; then
   65.18 -    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
   65.19 -    exit 1
   65.20 -fi
   65.21 -case "$1" in
   65.22 -    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
   65.23 -    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
   65.24 -    *)
   65.25 -	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
   65.26 -	exit 1
   65.27 -esac
   65.28 -exit 0
   65.29 -
   65.30 --= END original header =-
   65.31 -
   65.32 -diff -durN glibc-2_9.orig/locale/programs/3level.h glibc-2_9/locale/programs/3level.h
   65.33 ---- glibc-2_9.orig/locale/programs/3level.h	2007-07-16 02:54:59.000000000 +0200
   65.34 -+++ glibc-2_9/locale/programs/3level.h	2009-02-02 22:00:54.000000000 +0100
   65.35 -@@ -203,6 +203,42 @@
   65.36 - 	}
   65.37 -     }
   65.38 - }
   65.39 -+
   65.40 -+/* GCC ATM seems to do a poor job with pointers to nested functions passed
   65.41 -+   to inlined functions.  Help it a little bit with this hack.  */
   65.42 -+#define wchead_table_iterate(tp, fn) \
   65.43 -+do									      \
   65.44 -+  {									      \
   65.45 -+    struct wchead_table *t = (tp);					      \
   65.46 -+    uint32_t index1;							      \
   65.47 -+    for (index1 = 0; index1 < t->level1_size; index1++)			      \
   65.48 -+      {									      \
   65.49 -+	uint32_t lookup1 = t->level1[index1];				      \
   65.50 -+	if (lookup1 != ((uint32_t) ~0))					      \
   65.51 -+	  {								      \
   65.52 -+	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
   65.53 -+	    uint32_t index2;						      \
   65.54 -+	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
   65.55 -+	      {								      \
   65.56 -+		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
   65.57 -+		if (lookup2 != ((uint32_t) ~0))				      \
   65.58 -+		  {							      \
   65.59 -+		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
   65.60 -+		    uint32_t index3;					      \
   65.61 -+		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
   65.62 -+		      {							      \
   65.63 -+			struct element_t *lookup3			      \
   65.64 -+			  = t->level3[index3 + lookup2_shifted];	      \
   65.65 -+			if (lookup3 != NULL)				      \
   65.66 -+			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
   65.67 -+			      lookup3);					      \
   65.68 -+		      }							      \
   65.69 -+		  }							      \
   65.70 -+	      }								      \
   65.71 -+	  }								      \
   65.72 -+      }									      \
   65.73 -+  } while (0)
   65.74 -+
   65.75 - #endif
   65.76 - 
   65.77 - #ifndef NO_FINALIZE
    66.1 --- a/patches/glibc/2_9/240-i386-LOAD_PIC_REG.patch	Sat Apr 11 19:03:02 2009 +0000
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,23 +0,0 @@
    66.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1050_all_glibc-i386-LOAD_PIC_REG.patch
    66.5 -
    66.6 --= BEGIN original header =-
    66.7 -From e41177ea18a77a7f62328293b4fd49ae17482e77 Mon Sep 17 00:00:00 2001
    66.8 -From: Ulrich Drepper <drepper@redhat.com>
    66.9 -Date: Sat, 6 Dec 2008 00:15:17 +0000
   66.10 -Subject: [PATCH] (_dl_tlsdesc_dynamic): Use LOAD_PIC_REG instead of doing things manually.
   66.11 -
   66.12 --= END original header =-
   66.13 -
   66.14 -diff -durN glibc-2_9.orig/sysdeps/i386/dl-tlsdesc.S glibc-2_9/sysdeps/i386/dl-tlsdesc.S
   66.15 ---- glibc-2_9.orig/sysdeps/i386/dl-tlsdesc.S	2008-05-13 07:33:06.000000000 +0200
   66.16 -+++ glibc-2_9/sysdeps/i386/dl-tlsdesc.S	2009-02-02 22:00:56.000000000 +0100
   66.17 -@@ -128,8 +128,7 @@
   66.18 - .Lslow:
   66.19 - 	cfi_adjust_cfa_offset (28)
   66.20 - 	movl	%ebx, 16(%esp)
   66.21 --	call	__i686.get_pc_thunk.bx
   66.22 --	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
   66.23 -+	LOAD_PIC_REG (bx)
   66.24 - 	call	___tls_get_addr@PLT
   66.25 - 	movl	16(%esp), %ebx
   66.26 - 	jmp	.Lret
    67.1 --- a/patches/glibc/2_9/250-resolv-dynamic.patch	Sat Apr 11 19:03:02 2009 +0000
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,44 +0,0 @@
    67.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1055_all_glibc-resolv-dynamic.patch
    67.5 -
    67.6 --= BEGIN original header =-
    67.7 -ripped from SuSE
    67.8 -
    67.9 -if /etc/resolv.conf is updated, then make sure applications
   67.10 -already running get the updated information.
   67.11 -
   67.12 -http://bugs.gentoo.org/177416
   67.13 -
   67.14 --= END original header =-
   67.15 -
   67.16 -diff -durN glibc-2_9.orig/resolv/res_libc.c glibc-2_9/resolv/res_libc.c
   67.17 ---- glibc-2_9.orig/resolv/res_libc.c	2006-10-11 10:59:28.000000000 +0200
   67.18 -+++ glibc-2_9/resolv/res_libc.c	2009-02-02 22:00:57.000000000 +0100
   67.19 -@@ -22,6 +22,7 @@
   67.20 - #include <arpa/nameser.h>
   67.21 - #include <resolv.h>
   67.22 - #include <bits/libc-lock.h>
   67.23 -+#include <sys/stat.h>
   67.24 - 
   67.25 - 
   67.26 - /* The following bit is copied from res_data.c (where it is #ifdef'ed
   67.27 -@@ -95,6 +96,20 @@
   67.28 - __res_maybe_init (res_state resp, int preinit)
   67.29 - {
   67.30 - 	if (resp->options & RES_INIT) {
   67.31 -+		static time_t last_mtime, last_check;
   67.32 -+		time_t now;
   67.33 -+		struct stat statbuf;
   67.34 -+		
   67.35 -+		time (&now);
   67.36 -+		if (now != last_check) {
   67.37 -+			last_check = now;
   67.38 -+			if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
   67.39 -+				last_mtime = statbuf.st_mtime;
   67.40 -+				atomicinclock (lock);
   67.41 -+				atomicinc (__res_initstamp);
   67.42 -+				atomicincunlock (lock);
   67.43 -+			}
   67.44 -+		}
   67.45 - 		if (__res_initstamp != resp->_u._ext.initstamp) {
   67.46 - 			if (resp->nscount > 0) {
   67.47 - 				__res_iclose (resp, true);
    68.1 --- a/patches/glibc/2_9/260-fadvise64_64.patch	Sat Apr 11 19:03:02 2009 +0000
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,30 +0,0 @@
    68.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1070_all_glibc-fadvise64_64.patch
    68.5 -
    68.6 --= BEGIN original header =-
    68.7 -ripped from Debian
    68.8 -
    68.9 --= END original header =-
   68.10 -
   68.11 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c
   68.12 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c	2003-08-17 02:36:22.000000000 +0200
   68.13 -+++ glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c	2009-02-02 22:00:58.000000000 +0100
   68.14 -@@ -35,6 +35,19 @@
   68.15 -     return INTERNAL_SYSCALL_ERRNO (ret, err);
   68.16 -   return 0;
   68.17 - #else
   68.18 -+# ifdef __NR_fadvise64_64
   68.19 -+  INTERNAL_SYSCALL_DECL (err);  
   68.20 -+  int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
   68.21 -+			      __LONG_LONG_PAIR ((long) (offset >> 31),
   68.22 -+						(long) offset),
   68.23 -+			      __LONG_LONG_PAIR ((long) (len >> 31),
   68.24 -+						(long) len),
   68.25 -+			      advise);
   68.26 -+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
   68.27 -+    return INTERNAL_SYSCALL_ERRNO (ret, err);
   68.28 -+  return 0;
   68.29 -+# else
   68.30 -   return ENOSYS;
   68.31 -+# endif
   68.32 - #endif
   68.33 - }
    69.1 --- a/patches/glibc/2_9/270-ldbl-nexttowardf.patch	Sat Apr 11 19:03:02 2009 +0000
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,68 +0,0 @@
    69.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1073_all_glibc-ldbl-nexttowardf.patch
    69.5 -
    69.6 --= BEGIN original header =-
    69.7 -ripped from Debian
    69.8 -
    69.9 -this change was made to generic __nexttowardf, but not the long double version
   69.10 -
   69.11 -2008-05-05  Aurelien Jarno  <aurelien@aurel32.net>
   69.12 -
   69.13 -	* sysdeps/ieee754/ldbl-128/s_nexttowardf.c: Include float.h.
   69.14 -	(__nexttowardf): Use math_opt_barrier and
   69.15 -	math_force_eval macros.  If FLT_EVAL_METHOD is not 0, force
   69.16 -	x to float using asm.
   69.17 -
   69.18 --= END original header =-
   69.19 -
   69.20 -diff -durN glibc-2_9.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c glibc-2_9/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
   69.21 ---- glibc-2_9.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c	1999-07-14 02:09:42.000000000 +0200
   69.22 -+++ glibc-2_9/sysdeps/ieee754/ldbl-128/s_nexttowardf.c	2009-02-02 22:00:59.000000000 +0100
   69.23 -@@ -19,7 +19,8 @@
   69.24 - #endif
   69.25 - 
   69.26 - #include "math.h"
   69.27 --#include "math_private.h"
   69.28 -+#include <math_private.h>
   69.29 -+#include <float.h>
   69.30 - 
   69.31 - #ifdef __STDC__
   69.32 - 	float __nexttowardf(float x, long double y)
   69.33 -@@ -44,10 +45,12 @@
   69.34 - 	   return x+y;
   69.35 - 	if((long double) x==y) return y;	/* x=y, return y */
   69.36 - 	if(ix==0) {				/* x == 0 */
   69.37 --	    float x2;
   69.38 -+	    float u;
   69.39 - 	    SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
   69.40 --	    x2 = x*x;
   69.41 --	    if(x2==x) return x2; else return x;	/* raise underflow flag */
   69.42 -+	    u = math_opt_barrier (x);
   69.43 -+	    u = u * u;
   69.44 -+	    math_force_eval (u);		/* raise underflow flag */
   69.45 -+	    return x;
   69.46 - 	}
   69.47 - 	if(hx>=0) {				/* x > 0 */
   69.48 - 	    if(hy<0||(ix>>23)>(iy>>48)-0x3f80
   69.49 -@@ -67,13 +70,16 @@
   69.50 - 	    }
   69.51 - 	}
   69.52 - 	hy = hx&0x7f800000;
   69.53 --	if(hy>=0x7f800000) return x+x;	/* overflow  */
   69.54 -+	if(hy>=0x7f800000) {
   69.55 -+	  x = x+x;	/* overflow  */
   69.56 -+	  if (FLT_EVAL_METHOD != 0)
   69.57 -+	    /* Force conversion to float.  */
   69.58 -+	    asm ("" : "+m"(x));
   69.59 -+	  return x;
   69.60 -+	}
   69.61 - 	if(hy<0x00800000) {		/* underflow */
   69.62 --	    float x2 = x*x;
   69.63 --	    if(x2!=x) {		/* raise underflow flag */
   69.64 --	        SET_FLOAT_WORD(x2,hx);
   69.65 --		return x2;
   69.66 --	    }
   69.67 -+	    float u = x*x;
   69.68 -+	    math_force_eval (u);	/* raise underflow flag */
   69.69 - 	}
   69.70 - 	SET_FLOAT_WORD(x,hx);
   69.71 - 	return x;
    70.1 --- a/patches/glibc/2_9/280-section-comments.patch	Sat Apr 11 19:03:02 2009 +0000
    70.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.3 @@ -1,29 +0,0 @@
    70.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1075_all_glibc-section-comments.patch
    70.5 -
    70.6 --= BEGIN original header =-
    70.7 -http://sources.redhat.com/ml/binutils/2004-04/msg00665.html
    70.8 -
    70.9 -fixes building on some architectures (like m68k/arm/cris/etc...) because
   70.10 -it does the right thing
   70.11 -
   70.12 --= END original header =-
   70.13 -
   70.14 -diff -durN glibc-2_9.orig/include/libc-symbols.h glibc-2_9/include/libc-symbols.h
   70.15 ---- glibc-2_9.orig/include/libc-symbols.h	2006-11-09 16:57:12.000000000 +0100
   70.16 -+++ glibc-2_9/include/libc-symbols.h	2009-02-02 22:01:00.000000000 +0100
   70.17 -@@ -240,12 +240,12 @@
   70.18 - #  define __make_section_unallocated(section_string)
   70.19 - # endif
   70.20 - 
   70.21 --/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
   70.22 -+/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
   70.23 -    section attributes on what looks like a comment to the assembler.  */
   70.24 - # ifdef HAVE_SECTION_QUOTES
   70.25 --#  define __sec_comment "\"\n\t#\""
   70.26 -+#  define __sec_comment "\"\n#APP\n\t#\""
   70.27 - # else
   70.28 --#  define __sec_comment "\n\t#"
   70.29 -+#  define __sec_comment "\n#APP\n\t#"
   70.30 - # endif
   70.31 - # define link_warning(symbol, msg) \
   70.32 -   __make_section_unallocated (".gnu.warning." #symbol) \
    71.1 --- a/patches/glibc/2_9/290-no-inline-gmon.patch	Sat Apr 11 19:03:02 2009 +0000
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,38 +0,0 @@
    71.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1080_all_glibc-no-inline-gmon.patch
    71.5 -
    71.6 --= BEGIN original header =-
    71.7 -http://bugs.gentoo.org/196245
    71.8 -http://sourceware.org/ml/libc-alpha/2006-05/msg00017.html
    71.9 -
   71.10 -Attached is a patch to add __attribute__ ((noinline)) to
   71.11 -call_gmon_start.
   71.12 -
   71.13 -Without this patch, the sec script that processed initfini.s removes a
   71.14 -part of inlined call_gmon_start, causing undefined label errors.
   71.15 -
   71.16 -This patch solves the problem by forcing gcc not to inline
   71.17 -call_gmon_start with __attribute__ ((noinline)).
   71.18 -
   71.19 -Tested by building for arm-none-lixux-gnueabi.  OK to apply?
   71.20 -
   71.21 -Kazu Hirata
   71.22 -
   71.23 -2006-05-07  Kazu Hirata  &lt;kazu@codesourcery.com&gt;
   71.24 -
   71.25 -	* sysdeps/generic/initfini.c (call_gmon_start): Add
   71.26 -	__attribute__ ((noinline)).
   71.27 -
   71.28 --= END original header =-
   71.29 -
   71.30 -diff -durN glibc-2_9.orig/sysdeps/generic/initfini.c glibc-2_9/sysdeps/generic/initfini.c
   71.31 ---- glibc-2_9.orig/sysdeps/generic/initfini.c	2007-06-17 20:02:40.000000000 +0200
   71.32 -+++ glibc-2_9/sysdeps/generic/initfini.c	2009-02-02 22:01:01.000000000 +0100
   71.33 -@@ -70,7 +70,7 @@
   71.34 - /* The beginning of _init:  */
   71.35 - asm ("\n/*@_init_PROLOG_BEGINS*/");
   71.36 - 
   71.37 --static void
   71.38 -+static void __attribute__ ((noinline))
   71.39 - call_gmon_start(void)
   71.40 - {
   71.41 -   extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
    72.1 --- a/patches/glibc/2_9/300-2.9-check_native-headers.patch	Sat Apr 11 19:03:02 2009 +0000
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,22 +0,0 @@
    72.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1085_all_glibc-2.9-check_native-headers.patch
    72.5 -
    72.6 --= BEGIN original header =-
    72.7 -many ports hit this warning:
    72.8 -../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
    72.9 -../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
   72.10 -
   72.11 -snipped from suse
   72.12 -
   72.13 --= END original header =-
   72.14 -
   72.15 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/check_native.c glibc-2_9/sysdeps/unix/sysv/linux/check_native.c
   72.16 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/check_native.c	2007-11-24 04:12:17.000000000 +0100
   72.17 -+++ glibc-2_9/sysdeps/unix/sysv/linux/check_native.c	2009-02-02 22:01:03.000000000 +0100
   72.18 -@@ -23,6 +23,7 @@
   72.19 - #include <stddef.h>
   72.20 - #include <stdint.h>
   72.21 - #include <stdlib.h>
   72.22 -+#include <string.h>
   72.23 - #include <time.h>
   72.24 - #include <unistd.h>
   72.25 - #include <net/if.h>
    73.1 --- a/patches/glibc/2_9/310-2.3.6-fix-pr631.patch	Sat Apr 11 19:03:02 2009 +0000
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,50 +0,0 @@
    73.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1090_all_glibc-2.3.6-fix-pr631.patch
    73.5 -
    73.6 --= BEGIN original header =-
    73.7 -From dank@kegel.com
    73.8 -Wed Jun 15 09:12:43 PDT 2005
    73.9 -
   73.10 -Fixes
   73.11 -
   73.12 -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
   73.13 -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
   73.14 -... 53 lines deleted ...
   73.15 -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
   73.16 -collect2: ld returned 1 exit status
   73.17 -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
   73.18 -
   73.19 -when building glibc with --enable-static-nss.
   73.20 -
   73.21 -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
   73.22 -
   73.23 --= END original header =-
   73.24 -
   73.25 -diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
   73.26 ---- glibc-2_9.orig/Makeconfig	2009-02-02 22:00:36.000000000 +0100
   73.27 -+++ glibc-2_9/Makeconfig	2009-02-02 22:01:04.000000000 +0100
   73.28 -@@ -509,7 +509,7 @@
   73.29 - 
   73.30 - # The static libraries.
   73.31 - ifeq (yes,$(build-static))
   73.32 --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
   73.33 -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
   73.34 - else
   73.35 - ifeq (yes,$(build-shared))
   73.36 - # We can try to link the programs with lib*_pic.a...
   73.37 -diff -durN glibc-2_9.orig/elf/Makefile glibc-2_9/elf/Makefile
   73.38 ---- glibc-2_9.orig/elf/Makefile	2008-10-31 21:35:11.000000000 +0100
   73.39 -+++ glibc-2_9/elf/Makefile	2009-02-02 22:01:04.000000000 +0100
   73.40 -@@ -121,6 +121,13 @@
   73.41 - install-bin-script = ldd
   73.42 - endif
   73.43 - 
   73.44 -+ifeq (yes,$(build-static-nss))
   73.45 -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
   73.46 -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
   73.47 -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
   73.48 -+	     $(resolvobjdir)/libresolv.a
   73.49 -+endif
   73.50 -+
   73.51 - others		= sprof sln
   73.52 - install-bin	= sprof
   73.53 - others-static   = sln
    74.1 --- a/patches/glibc/2_9/320-2.9-assume-pipe2.patch	Sat Apr 11 19:03:02 2009 +0000
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,59 +0,0 @@
    74.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1095_all_glibc-2.9-assume-pipe2.patch
    74.5 -
    74.6 --= BEGIN original header =-
    74.7 -http://bugs.gentoo.org/250342
    74.8 -http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
    74.9 -
   74.10 -we cant assume sock_cloexec and pipe2 are bound together as the former defines
   74.11 -are found in glibc only while the latter are a combo of kernel headers and
   74.12 -glibc.  so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
   74.13 -inside of glibc, we hit a problem.  for example:
   74.14 -
   74.15 -#include <grp.h>
   74.16 -#include <stdio.h>
   74.17 -main()
   74.18 -{
   74.19 -	getgrnam("portage");
   74.20 -	if (!popen("ls", "r"))
   74.21 -		perror("popen()");
   74.22 -}
   74.23 -
   74.24 -getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
   74.25 -__have_sock_cloexec and __have_pipe2 to true.  but if glibc was built against
   74.26 -older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
   74.27 -stub for it.  so popen() will always fail as glibc assumes pipe2() works.
   74.28 -
   74.29 --= END original header =-
   74.30 -
   74.31 -diff -durN glibc-2_9.orig/include/unistd.h glibc-2_9/include/unistd.h
   74.32 ---- glibc-2_9.orig/include/unistd.h	2008-07-27 20:23:17.000000000 +0200
   74.33 -+++ glibc-2_9/include/unistd.h	2009-02-02 22:01:05.000000000 +0100
   74.34 -@@ -167,9 +167,6 @@
   74.35 - extern int __pause_nocancel (void) attribute_hidden;
   74.36 - 
   74.37 - extern int __have_sock_cloexec;
   74.38 --/* At lot of other functionality became available at the same time as
   74.39 --   SOCK_CLOEXEC.  Avoid defining separate variables for all of them
   74.40 --   unless it is really necessary.  */
   74.41 --#define __have_pipe2 __have_sock_cloexec
   74.42 -+extern int __have_pipe2;
   74.43 - 
   74.44 - #endif
   74.45 -diff -durN glibc-2_9.orig/socket/have_sock_cloexec.c glibc-2_9/socket/have_sock_cloexec.c
   74.46 ---- glibc-2_9.orig/socket/have_sock_cloexec.c	2008-07-25 18:46:23.000000000 +0200
   74.47 -+++ glibc-2_9/socket/have_sock_cloexec.c	2009-02-02 22:01:05.000000000 +0100
   74.48 -@@ -16,9 +16,14 @@
   74.49 -    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   74.50 -    02111-1307 USA.  */
   74.51 - 
   74.52 -+#include <fcntl.h>
   74.53 - #include <sys/socket.h>
   74.54 - #include <kernel-features.h>
   74.55 - 
   74.56 - #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
   74.57 - int __have_sock_cloexec;
   74.58 - #endif
   74.59 -+
   74.60 -+#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
   74.61 -+int __have_pipe2;
   74.62 -+#endif
    75.1 --- a/patches/glibc/2_9/330-2.3.3-china.patch	Sat Apr 11 19:03:02 2009 +0000
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,35 +0,0 @@
    75.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1100_all_glibc-2.3.3-china.patch
    75.5 -
    75.6 --= BEGIN original header =-
    75.7 --= END original header =-
    75.8 -
    75.9 -diff -durN glibc-2_9.orig/localedata/locales/zh_TW glibc-2_9/localedata/locales/zh_TW
   75.10 ---- glibc-2_9.orig/localedata/locales/zh_TW	2004-11-01 00:42:28.000000000 +0100
   75.11 -+++ glibc-2_9/localedata/locales/zh_TW	2009-02-02 22:01:06.000000000 +0100
   75.12 -@@ -1,7 +1,7 @@
   75.13 - comment_char %
   75.14 - escape_char /
   75.15 - %
   75.16 --% Chinese language locale for Taiwan R.O.C.
   75.17 -+% Chinese language locale for Taiwan
   75.18 - % charmap: BIG5-CP950
   75.19 - %
   75.20 - % Original Author:
   75.21 -@@ -17,7 +17,7 @@
   75.22 - % Reference:	http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
   75.23 - 
   75.24 - LC_IDENTIFICATION
   75.25 --title      "Chinese locale for Taiwan R.O.C."
   75.26 -+title      "Chinese locale for Taiwan"
   75.27 - source     ""
   75.28 - address    ""
   75.29 - contact    ""
   75.30 -@@ -25,7 +25,7 @@
   75.31 - tel        ""
   75.32 - fax        ""
   75.33 - language   "Chinese"
   75.34 --territory  "Taiwan R.O.C."
   75.35 -+territory  "Taiwan"
   75.36 - revision   "0.2"
   75.37 - date       "2000-08-02"
   75.38 - %
    76.1 --- a/patches/glibc/2_9/340-new-valencian-locale.patch	Sat Apr 11 19:03:02 2009 +0000
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,120 +0,0 @@
    76.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1103_all_glibc-new-valencian-locale.patch
    76.5 -
    76.6 --= BEGIN original header =-
    76.7 -http://bugs.gentoo.org/show_bug.cgi?id=131815
    76.8 -http://sourceware.org/bugzilla/show_bug.cgi?id=2522
    76.9 -
   76.10 --= END original header =-
   76.11 -
   76.12 -diff -durN glibc-2_9.orig/localedata/SUPPORTED glibc-2_9/localedata/SUPPORTED
   76.13 ---- glibc-2_9.orig/localedata/SUPPORTED	2008-09-16 23:24:57.000000000 +0200
   76.14 -+++ glibc-2_9/localedata/SUPPORTED	2009-02-02 22:01:08.000000000 +0100
   76.15 -@@ -72,6 +72,8 @@
   76.16 - ca_ES.UTF-8/UTF-8 \
   76.17 - ca_ES/ISO-8859-1 \
   76.18 - ca_ES@euro/ISO-8859-15 \
   76.19 -+ca_ES.UTF-8@valencia/UTF-8 \
   76.20 -+ca_ES@valencia/ISO-8859-15 \
   76.21 - ca_FR.UTF-8/UTF-8 \
   76.22 - ca_FR/ISO-8859-15 \
   76.23 - ca_IT.UTF-8/UTF-8 \
   76.24 -diff -durN glibc-2_9.orig/localedata/locales/ca_ES@valencia glibc-2_9/localedata/locales/ca_ES@valencia
   76.25 ---- glibc-2_9.orig/localedata/locales/ca_ES@valencia	1970-01-01 01:00:00.000000000 +0100
   76.26 -+++ glibc-2_9/localedata/locales/ca_ES@valencia	2009-02-02 22:01:08.000000000 +0100
   76.27 -@@ -0,0 +1,96 @@
   76.28 -+comment_char %
   76.29 -+escape_char  /
   76.30 -+%
   76.31 -+% Valencian (southern Catalan) locale for Spain with Euro
   76.32 -+%
   76.33 -+% Note that this locale is almost the same as ca_ES@euro.  The point of having
   76.34 -+% a separate locale is only for PO translations, which have a lot of social
   76.35 -+% support and are very appreciated by the Valencian-speaking community.
   76.36 -+%
   76.37 -+% Contact: Jordi Mallach
   76.38 -+% Email: jordi@gnu.org
   76.39 -+% Tel:
   76.40 -+% Fax:
   76.41 -+% Language: ca
   76.42 -+% Territory: ES
   76.43 -+% Option: euro
   76.44 -+% Revision: 1.0
   76.45 -+% Date: 2006-04-06
   76.46 -+% Application: general
   76.47 -+% Users: general
   76.48 -+% Repertoiremap: mnemonic,ds
   76.49 -+% Charset: ISO-8859-15
   76.50 -+% Distribution and use is free, also
   76.51 -+% for commercial purposes.
   76.52 -+
   76.53 -+LC_IDENTIFICATION
   76.54 -+title      "Valencian (southern Catalan) locale for Spain with Euro"
   76.55 -+source     ""
   76.56 -+address    ""
   76.57 -+contact    "Jordi Mallach"
   76.58 -+email      "jordi@gnu.org"
   76.59 -+tel        ""
   76.60 -+fax        ""
   76.61 -+language   "Catalan"
   76.62 -+territory  "Spain"
   76.63 -+revision   "1.0"
   76.64 -+date       "2006-04-06"
   76.65 -+%
   76.66 -+category  "ca_ES@valencia:2006";LC_IDENTIFICATION
   76.67 -+category  "ca_ES@valencia:2006";LC_CTYPE
   76.68 -+category  "ca_ES@valencia:2006";LC_COLLATE
   76.69 -+category  "ca_ES@valencia:2006";LC_MONETARY
   76.70 -+category  "ca_ES@valencia:2006";LC_NUMERIC
   76.71 -+category  "ca_ES@valencia:2006";LC_TIME
   76.72 -+category  "ca_ES@valencia:2006";LC_MESSAGES
   76.73 -+category  "ca_ES@valencia:2006";LC_PAPER
   76.74 -+category  "ca_ES@valencia:2006";LC_NAME
   76.75 -+category  "ca_ES@valencia:2006";LC_ADDRESS
   76.76 -+category  "ca_ES@valencia:2006";LC_TELEPHONE
   76.77 -+category  "ca_ES@valencia:2006";LC_MEASUREMENT
   76.78 -+
   76.79 -+END LC_IDENTIFICATION
   76.80 -+
   76.81 -+LC_CTYPE
   76.82 -+copy "i18n"
   76.83 -+END LC_CTYPE
   76.84 -+
   76.85 -+LC_COLLATE
   76.86 -+copy "ca_ES"
   76.87 -+END LC_COLLATE
   76.88 -+
   76.89 -+LC_MONETARY
   76.90 -+copy "ca_ES"
   76.91 -+END LC_MONETARY
   76.92 -+
   76.93 -+LC_NUMERIC
   76.94 -+copy "ca_ES"
   76.95 -+END LC_NUMERIC
   76.96 -+
   76.97 -+LC_TIME
   76.98 -+copy "ca_ES"
   76.99 -+END LC_TIME
  76.100 -+
  76.101 -+LC_MESSAGES
  76.102 -+copy "ca_ES"
  76.103 -+END LC_MESSAGES
  76.104 -+
  76.105 -+LC_PAPER
  76.106 -+copy "ca_ES"
  76.107 -+END LC_PAPER
  76.108 -+
  76.109 -+LC_NAME
  76.110 -+copy "ca_ES"
  76.111 -+END LC_NAME
  76.112 -+
  76.113 -+LC_ADDRESS
  76.114 -+copy "ca_ES"
  76.115 -+END LC_ADDRESS
  76.116 -+
  76.117 -+LC_TELEPHONE
  76.118 -+copy "ca_ES"
  76.119 -+END LC_TELEPHONE
  76.120 -+
  76.121 -+LC_MEASUREMENT
  76.122 -+copy "ca_ES"
  76.123 -+END LC_MEASUREMENT
    77.1 --- a/patches/glibc/2_9/350-2.4-undefine-__i686.patch	Sat Apr 11 19:03:02 2009 +0000
    77.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.3 @@ -1,47 +0,0 @@
    77.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1130_all_glibc-2.4-undefine-__i686.patch
    77.5 -
    77.6 --= BEGIN original header =-
    77.7 -If gcc is configured to generate i686 code or better by default (like 
    77.8 -when using the --with-arch=pentium3 configure option), then the __i686
    77.9 -macro will always be defined automatically and thus screw up the
   77.10 -compilation of some .S files.
   77.11 -http://bugs.gentoo.org/131108
   77.12 -http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
   77.13 -
   77.14 -2006-04-25  Mike Frysinger  <vapier@gentoo.org>
   77.15 -
   77.16 -	* sysdeps/i386/sysdep.h (__i686): Undefine.
   77.17 -
   77.18 --= END original header =-
   77.19 -
   77.20 -diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2_9/nptl/sysdeps/pthread/pt-initfini.c
   77.21 ---- glibc-2_9.orig/nptl/sysdeps/pthread/pt-initfini.c	2007-06-17 20:02:01.000000000 +0200
   77.22 -+++ glibc-2_9/nptl/sysdeps/pthread/pt-initfini.c	2009-02-02 22:01:09.000000000 +0100
   77.23 -@@ -45,6 +45,9 @@
   77.24 - /* Embed an #include to pull in the alignment and .end directives. */
   77.25 - asm ("\n#include \"defs.h\"");
   77.26 - 
   77.27 -+/* Embed an #include to pull in asm settings. */
   77.28 -+asm ("\n#ifdef __i686__\n#include <sysdep.h>\n#endif");
   77.29 -+
   77.30 - /* The initial common code ends here. */
   77.31 - asm ("\n/*@HEADER_ENDS*/");
   77.32 - 
   77.33 -diff -durN glibc-2_9.orig/sysdeps/i386/sysdep.h glibc-2_9/sysdeps/i386/sysdep.h
   77.34 ---- glibc-2_9.orig/sysdeps/i386/sysdep.h	2006-10-28 08:44:03.000000000 +0200
   77.35 -+++ glibc-2_9/sysdeps/i386/sysdep.h	2009-02-02 22:01:09.000000000 +0100
   77.36 -@@ -18,6 +18,14 @@
   77.37 -    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   77.38 -    02111-1307 USA.  */
   77.39 - 
   77.40 -+/*
   77.41 -+ * When building for i686 targets or better, gcc automatically defines
   77.42 -+ * '__i686' to '1' for us which causes trouble when using section names
   77.43 -+ * like '__i686.get_pc_thunk.reg'.  Since we check for __i686__ in the
   77.44 -+ * code, killing '__i686' shouldn't be a problem.
   77.45 -+ */
   77.46 -+#undef __i686
   77.47 -+
   77.48 - #include <sysdeps/generic/sysdep.h>
   77.49 - 
   77.50 - #ifdef	__ASSEMBLER__
    78.1 --- a/patches/glibc/2_9/360-2.8-nscd-one-fork.patch	Sat Apr 11 19:03:02 2009 +0000
    78.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.3 @@ -1,45 +0,0 @@
    78.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1160_all_glibc-2.8-nscd-one-fork.patch
    78.5 -
    78.6 --= BEGIN original header =-
    78.7 -only fork one to assist in stop-start-daemon assumptions about daemon behavior
    78.8 -
    78.9 -http://bugs.gentoo.org/190785
   78.10 -
   78.11 --= END original header =-
   78.12 -
   78.13 -diff -durN glibc-2_9.orig/nscd/nscd.c glibc-2_9/nscd/nscd.c
   78.14 ---- glibc-2_9.orig/nscd/nscd.c	2008-03-29 19:08:12.000000000 +0100
   78.15 -+++ glibc-2_9/nscd/nscd.c	2009-02-02 22:01:10.000000000 +0100
   78.16 -@@ -179,6 +179,9 @@
   78.17 -       if (pid != 0)
   78.18 - 	exit (0);
   78.19 - 
   78.20 -+       if (write_pid (_PATH_NSCDPID) < 0)
   78.21 -+	dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
   78.22 -+
   78.23 -       int nullfd = open (_PATH_DEVNULL, O_RDWR);
   78.24 -       if (nullfd != -1)
   78.25 - 	{
   78.26 -@@ -228,12 +231,6 @@
   78.27 - 	for (i = min_close_fd; i < getdtablesize (); i++)
   78.28 - 	  close (i);
   78.29 - 
   78.30 --      pid = fork ();
   78.31 --      if (pid == -1)
   78.32 --	error (EXIT_FAILURE, errno, _("cannot fork"));
   78.33 --      if (pid != 0)
   78.34 --	exit (0);
   78.35 --
   78.36 -       setsid ();
   78.37 - 
   78.38 -       if (chdir ("/") != 0)
   78.39 -@@ -242,9 +239,6 @@
   78.40 - 
   78.41 -       openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
   78.42 - 
   78.43 --      if (write_pid (_PATH_NSCDPID) < 0)
   78.44 --        dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
   78.45 --
   78.46 -       if (!init_logfile ())
   78.47 - 	dbg_log (_("Could not create log file"));
   78.48 - 
    79.1 --- a/patches/glibc/2_9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch	Sat Apr 11 19:03:02 2009 +0000
    79.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.3 @@ -1,249 +0,0 @@
    79.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/1503_hppa_glibc-2.7-hppa-nptl-carlos.patch
    79.5 -
    79.6 --= BEGIN original header =-
    79.7 --= END original header =-
    79.8 -
    79.9 -diff -durN glibc-2_9.orig/elf/rtld.c glibc-2_9/elf/rtld.c
   79.10 ---- glibc-2_9.orig/elf/rtld.c	2009-02-02 22:00:34.000000000 +0100
   79.11 -+++ glibc-2_9/elf/rtld.c	2009-02-02 22:01:12.000000000 +0100
   79.12 -@@ -386,14 +386,14 @@
   79.13 -      know it is available.  We do not have to clear the memory if we
   79.14 -      do not have to use the temporary bootstrap_map.  Global variables
   79.15 -      are initialized to zero by default.  */
   79.16 --#ifndef DONT_USE_BOOTSTRAP_MAP
   79.17 -+#if !defined DONT_USE_BOOTSTRAP_MAP
   79.18 - # ifdef HAVE_BUILTIN_MEMSET
   79.19 -   __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
   79.20 - # else
   79.21 --  for (size_t cnt = 0;
   79.22 --       cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
   79.23 --       ++cnt)
   79.24 --    bootstrap_map.l_info[cnt] = 0;
   79.25 -+  /* Clear the whole bootstrap_map structure */
   79.26 -+  for (char *cnt = (char *)&(bootstrap_map);
   79.27 -+       cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
   79.28 -+       *cnt++ = '\0');
   79.29 - # endif
   79.30 - # if USE___THREAD
   79.31 -   bootstrap_map.l_tls_modid = 0;
   79.32 -diff -durN glibc-2_9.orig/include/atomic.h glibc-2_9/include/atomic.h
   79.33 ---- glibc-2_9.orig/include/atomic.h	2006-12-21 22:44:00.000000000 +0100
   79.34 -+++ glibc-2_9/include/atomic.h	2009-02-02 22:01:12.000000000 +0100
   79.35 -@@ -174,7 +174,7 @@
   79.36 -      __typeof (*(mem)) __atg5_value = (newvalue);			      \
   79.37 - 									      \
   79.38 -      do									      \
   79.39 --       __atg5_oldval = *__atg5_memp;					      \
   79.40 -+       __atg5_oldval = *(volatile __typeof (mem))__atg5_memp;		      \
   79.41 -      while (__builtin_expect						      \
   79.42 - 	    (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
   79.43 - 						   __atg5_oldval), 0));	      \
   79.44 -@@ -195,7 +195,7 @@
   79.45 -      __typeof (*(mem)) __atg6_value = (value);				      \
   79.46 - 									      \
   79.47 -      do									      \
   79.48 --       __atg6_oldval = *__atg6_memp;					      \
   79.49 -+       __atg6_oldval = *(volatile __typeof (mem))__atg6_memp;		      \
   79.50 -      while (__builtin_expect						      \
   79.51 - 	    (atomic_compare_and_exchange_bool_acq (__atg6_memp,		      \
   79.52 - 						   __atg6_oldval	      \
   79.53 -@@ -213,7 +213,7 @@
   79.54 -      __typeof (*(mem)) __atg7_value = (value);				      \
   79.55 - 									      \
   79.56 -      do									      \
   79.57 --       __atg7_oldv = *__atg7_memp;					      \
   79.58 -+       __atg7_oldv = *(volatile __typeof (mem))__atg7_memp;		      \
   79.59 -      while (__builtin_expect						      \
   79.60 - 	    (catomic_compare_and_exchange_bool_acq (__atg7_memp,	      \
   79.61 - 						    __atg7_oldv		      \
   79.62 -@@ -231,7 +231,7 @@
   79.63 -     __typeof (mem) __atg8_memp = (mem);					      \
   79.64 -     __typeof (*(mem)) __atg8_value = (value);				      \
   79.65 -     do {								      \
   79.66 --      __atg8_oldval = *__atg8_memp;					      \
   79.67 -+      __atg8_oldval = *(volatile __typeof (mem))__atg8_memp;		      \
   79.68 -       if (__atg8_oldval >= __atg8_value)				      \
   79.69 - 	break;								      \
   79.70 -     } while (__builtin_expect						      \
   79.71 -@@ -248,7 +248,7 @@
   79.72 -     __typeof (mem) __atg9_memp = (mem);					      \
   79.73 -     __typeof (*(mem)) __atg9_value = (value);				      \
   79.74 -     do {								      \
   79.75 --      __atg9_oldv = *__atg9_memp;					      \
   79.76 -+      __atg9_oldv = *(volatile __typeof (mem))__atg9_memp;		      \
   79.77 -       if (__atg9_oldv >= __atg9_value)					      \
   79.78 - 	break;								      \
   79.79 -     } while (__builtin_expect						      \
   79.80 -@@ -266,7 +266,7 @@
   79.81 -     __typeof (mem) __atg10_memp = (mem);				      \
   79.82 -     __typeof (*(mem)) __atg10_value = (value);				      \
   79.83 -     do {								      \
   79.84 --      __atg10_oldval = *__atg10_memp;					      \
   79.85 -+      __atg10_oldval = *(volatile __typeof (mem))__atg10_memp;		      \
   79.86 -       if (__atg10_oldval <= __atg10_value)				      \
   79.87 - 	break;								      \
   79.88 -     } while (__builtin_expect						      \
   79.89 -@@ -350,7 +350,7 @@
   79.90 - 									      \
   79.91 -      do									      \
   79.92 -        {								      \
   79.93 --	 __atg11_oldval = *__atg11_memp;				      \
   79.94 -+	 __atg11_oldval = *(volatile __typeof (mem))__atg11_memp;	      \
   79.95 - 	 if (__builtin_expect (__atg11_oldval <= 0, 0))			      \
   79.96 - 	   break;							      \
   79.97 -        }								      \
   79.98 -@@ -389,7 +389,7 @@
   79.99 -      __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit));	      \
  79.100 - 									      \
  79.101 -      do									      \
  79.102 --       __atg14_old = (*__atg14_memp);					      \
  79.103 -+       __atg14_old = (*(volatile __typeof (mem))__atg14_memp);		      \
  79.104 -      while (__builtin_expect						      \
  79.105 - 	    (atomic_compare_and_exchange_bool_acq (__atg14_memp,	      \
  79.106 - 						   __atg14_old | __atg14_mask,\
  79.107 -@@ -407,7 +407,7 @@
  79.108 -     __typeof (*(mem)) __atg15_mask = (mask);				      \
  79.109 - 									      \
  79.110 -     do									      \
  79.111 --      __atg15_old = (*__atg15_memp);					      \
  79.112 -+      __atg15_old = (*(volatile __typeof (mem))__atg15_memp);		      \
  79.113 -     while (__builtin_expect						      \
  79.114 - 	   (atomic_compare_and_exchange_bool_acq (__atg15_memp,		      \
  79.115 - 						  __atg15_old & __atg15_mask, \
  79.116 -@@ -423,7 +423,7 @@
  79.117 -      __typeof (*(mem)) __atg16_mask = (mask);				      \
  79.118 - 									      \
  79.119 -      do									      \
  79.120 --       __atg16_old = (*__atg16_memp);					      \
  79.121 -+       __atg16_old = (*(volatile __typeof (mem))__atg16_memp);		      \
  79.122 -      while (__builtin_expect						      \
  79.123 - 	    (atomic_compare_and_exchange_bool_acq (__atg16_memp,	      \
  79.124 - 						   __atg16_old & __atg16_mask,\
  79.125 -@@ -441,7 +441,7 @@
  79.126 -     __typeof (*(mem)) __atg17_mask = (mask);				      \
  79.127 - 									      \
  79.128 -     do									      \
  79.129 --      __atg17_old = (*__atg17_memp);					      \
  79.130 -+      __atg17_old = (*(volatile __typeof (mem))__atg17_memp);		      \
  79.131 -     while (__builtin_expect						      \
  79.132 - 	   (atomic_compare_and_exchange_bool_acq (__atg17_memp,		      \
  79.133 - 						  __atg17_old | __atg17_mask, \
  79.134 -@@ -457,7 +457,7 @@
  79.135 -     __typeof (*(mem)) __atg18_mask = (mask);				      \
  79.136 - 									      \
  79.137 -     do									      \
  79.138 --      __atg18_old = (*__atg18_memp);					      \
  79.139 -+      __atg18_old = (*(volatile __typeof (mem))__atg18_memp);		      \
  79.140 -     while (__builtin_expect						      \
  79.141 - 	   (catomic_compare_and_exchange_bool_acq (__atg18_memp,	      \
  79.142 - 						   __atg18_old | __atg18_mask,\
  79.143 -@@ -473,7 +473,7 @@
  79.144 -      __typeof (*(mem)) __atg19_mask = (mask);				      \
  79.145 - 									      \
  79.146 -      do									      \
  79.147 --       __atg19_old = (*__atg19_memp);					      \
  79.148 -+       __atg19_old = (*(volatile __typeof (mem))__atg19_memp);		      \
  79.149 -      while (__builtin_expect						      \
  79.150 - 	    (atomic_compare_and_exchange_bool_acq (__atg19_memp,	      \
  79.151 - 						   __atg19_old | __atg19_mask,\
  79.152 -diff -durN glibc-2_9.orig/nptl/Makefile glibc-2_9/nptl/Makefile
  79.153 ---- glibc-2_9.orig/nptl/Makefile	2008-11-12 14:38:23.000000000 +0100
  79.154 -+++ glibc-2_9/nptl/Makefile	2009-02-02 22:01:12.000000000 +0100
  79.155 -@@ -262,9 +262,9 @@
  79.156 - # Files which must not be linked with libpthread.
  79.157 - tests-nolibpthread = tst-unload
  79.158 - 
  79.159 --# This sets the stack resource limit to 1023kb, which is not a multiple
  79.160 --# of the page size since every architecture's page size is > 1k.
  79.161 --tst-oddstacklimit-ENV = ; ulimit -s 1023;
  79.162 -+# This sets the stack resource limit to 8193kb, which is not a multiple
  79.163 -+# of the page size since every architecture's page size is 4096 bytes.
  79.164 -+tst-oddstacklimit-ENV = ; ulimit -s 8193;
  79.165 - 
  79.166 - distribute = eintr.c tst-cleanup4aux.c
  79.167 - 
  79.168 -@@ -423,6 +423,35 @@
  79.169 - CFLAGS-tst-cleanupx4.c += -fexceptions
  79.170 - CFLAGS-tst-oncex3.c += -fexceptions
  79.171 - CFLAGS-tst-oncex4.c += -fexceptions
  79.172 -+
  79.173 -+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
  79.174 -+LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
  79.175 -+LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
  79.176 -+LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
  79.177 -+LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
  79.178 -+LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
  79.179 -+LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
  79.180 -+LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
  79.181 -+LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
  79.182 -+LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
  79.183 -+LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
  79.184 -+LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
  79.185 -+LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
  79.186 -+LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
  79.187 -+LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
  79.188 -+LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
  79.189 -+LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
  79.190 -+LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
  79.191 -+LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
  79.192 -+LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
  79.193 -+LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
  79.194 -+LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
  79.195 -+LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
  79.196 -+LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
  79.197 -+LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
  79.198 -+LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
  79.199 -+LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
  79.200 -+
  79.201 - CFLAGS-tst-align.c += $(stack-align-test-flags)
  79.202 - CFLAGS-tst-align3.c += $(stack-align-test-flags)
  79.203 - CFLAGS-tst-initializers1.c = -W -Wall -Werror
  79.204 -diff -durN glibc-2_9.orig/nptl/pthread_barrier_wait.c glibc-2_9/nptl/pthread_barrier_wait.c
  79.205 ---- glibc-2_9.orig/nptl/pthread_barrier_wait.c	2007-08-01 06:18:50.000000000 +0200
  79.206 -+++ glibc-2_9/nptl/pthread_barrier_wait.c	2009-02-02 22:01:12.000000000 +0100
  79.207 -@@ -64,7 +64,7 @@
  79.208 -       do
  79.209 - 	lll_futex_wait (&ibarrier->curr_event, event,
  79.210 - 			ibarrier->private ^ FUTEX_PRIVATE_FLAG);
  79.211 --      while (event == ibarrier->curr_event);
  79.212 -+      while (event == *(volatile unsigned int *)&ibarrier->curr_event);
  79.213 -     }
  79.214 - 
  79.215 -   /* Make sure the init_count is stored locally or in a register.  */
  79.216 -diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/Makefile glibc-2_9/nptl/sysdeps/pthread/Makefile
  79.217 ---- glibc-2_9.orig/nptl/sysdeps/pthread/Makefile	2006-02-28 08:09:41.000000000 +0100
  79.218 -+++ glibc-2_9/nptl/sysdeps/pthread/Makefile	2009-02-02 22:01:12.000000000 +0100
  79.219 -@@ -41,7 +41,9 @@
  79.220 - 
  79.221 - ifeq ($(have-forced-unwind),yes)
  79.222 - tests += tst-mqueue8x
  79.223 -+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
  79.224 - CFLAGS-tst-mqueue8x.c += -fexceptions
  79.225 -+LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s) 
  79.226 - endif
  79.227 - endif
  79.228 - 
  79.229 -diff -durN glibc-2_9.orig/stdio-common/Makefile glibc-2_9/stdio-common/Makefile
  79.230 ---- glibc-2_9.orig/stdio-common/Makefile	2008-07-08 18:32:28.000000000 +0200
  79.231 -+++ glibc-2_9/stdio-common/Makefile	2009-02-02 22:01:12.000000000 +0100
  79.232 -@@ -80,7 +80,7 @@
  79.233 - 	$(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
  79.234 - endif
  79.235 - 
  79.236 --CFLAGS-vfprintf.c = -Wno-uninitialized
  79.237 -+CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
  79.238 - CFLAGS-vfwprintf.c = -Wno-uninitialized
  79.239 - CFLAGS-tst-printf.c = -Wno-format
  79.240 - CFLAGS-tstdiomisc.c = -Wno-format
  79.241 -diff -durN glibc-2_9.orig/sunrpc/clnt_udp.c glibc-2_9/sunrpc/clnt_udp.c
  79.242 ---- glibc-2_9.orig/sunrpc/clnt_udp.c	2008-07-26 10:42:44.000000000 +0200
  79.243 -+++ glibc-2_9/sunrpc/clnt_udp.c	2009-02-02 22:01:12.000000000 +0100
  79.244 -@@ -462,7 +462,7 @@
  79.245 -       while (inlen < 0 && errno == EINTR);
  79.246 -       if (inlen < 0)
  79.247 - 	{
  79.248 --	  if (errno == EWOULDBLOCK)
  79.249 -+	  if (errno == EWOULDBLOCK || errno == EAGAIN)
  79.250 - 	    continue;
  79.251 - 	  cu->cu_error.re_errno = errno;
  79.252 - 	  return (cu->cu_error.re_status = RPC_CANTRECV);
    80.1 --- a/patches/glibc/2_9/380-2.3.6-dl_execstack-PaX-support.patch	Sat Apr 11 19:03:02 2009 +0000
    80.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.3 @@ -1,71 +0,0 @@
    80.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/3000_all_2.3.6-dl_execstack-PaX-support.patch
    80.5 -
    80.6 --= BEGIN original header =-
    80.7 -	With latest versions of glibc, a lot of apps failed on a PaX enabled
    80.8 -	system with:
    80.9 -		 cannot enable executable stack as shared object requires: Permission denied
   80.10 -	
   80.11 -	This is due to PaX 'exec-protecting' the stack, and ld.so then trying
   80.12 -	to make the stack executable due to some libraries not containing the
   80.13 -	PT_GNU_STACK section.  Bug #32960.  <azarah@gentoo.org> (12 Nov 2003).
   80.14 -
   80.15 -	Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
   80.16 -
   80.17 --= END original header =-
   80.18 -
   80.19 -diff -durN glibc-2_9.orig/nptl/allocatestack.c glibc-2_9/nptl/allocatestack.c
   80.20 ---- glibc-2_9.orig/nptl/allocatestack.c	2008-08-16 00:35:27.000000000 +0200
   80.21 -+++ glibc-2_9/nptl/allocatestack.c	2009-02-02 22:01:20.000000000 +0100
   80.22 -@@ -299,7 +299,8 @@
   80.23 - # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
   80.24 - #endif
   80.25 -   if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
   80.26 --    return errno;
   80.27 -+    if (errno != EACCES) /* PAX is enabled */
   80.28 -+    	return errno;
   80.29 - 
   80.30 -   return 0;
   80.31 - }
   80.32 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c
   80.33 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c	2006-01-08 09:21:15.000000000 +0100
   80.34 -+++ glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c	2009-02-02 22:01:20.000000000 +0100
   80.35 -@@ -63,7 +63,10 @@
   80.36 -       else
   80.37 - # endif
   80.38 - 	{
   80.39 --	  result = errno;
   80.40 -+	  if (errno == EACCES)  /* PAX is enabled */
   80.41 -+	    result = 0;
   80.42 -+	  else
   80.43 -+	    result = errno;
   80.44 - 	  goto out;
   80.45 - 	}
   80.46 -     }
   80.47 -@@ -89,7 +92,12 @@
   80.48 - 	page -= size;
   80.49 -       else
   80.50 - 	{
   80.51 --	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
   80.52 -+	  if (errno == EACCES)		/* PAX is enabled */
   80.53 -+	    {
   80.54 -+	      result = 0;
   80.55 -+	      goto out;
   80.56 -+	    }
   80.57 -+	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
   80.58 - 	    {
   80.59 - 	      result = errno;
   80.60 - 	      goto out;
   80.61 -@@ -115,7 +123,12 @@
   80.62 - 	page += size;
   80.63 -       else
   80.64 - 	{
   80.65 --	  if (errno != ENOMEM)	/* Unexpected failure mode.  */
   80.66 -+	  if (errno == EACCES)		/* PAX is enabled */
   80.67 -+	    {
   80.68 -+	      result = 0;
   80.69 -+	      goto out;
   80.70 -+	    }
   80.71 -+	  else if (errno != ENOMEM)	/* Unexpected failure mode.  */
   80.72 - 	    {
   80.73 - 	      result = errno;
   80.74 - 	      goto out;
    81.1 --- a/patches/glibc/2_9/390-2.3.3_pre20040117-pt_pax.patch	Sat Apr 11 19:03:02 2009 +0000
    81.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.3 @@ -1,35 +0,0 @@
    81.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/3010_all_2.3.3_pre20040117-pt_pax.patch
    81.5 -
    81.6 --= BEGIN original header =-
    81.7 --= END original header =-
    81.8 -
    81.9 -diff -durN glibc-2_9.orig/elf/elf.h glibc-2_9/elf/elf.h
   81.10 ---- glibc-2_9.orig/elf/elf.h	2008-10-01 21:41:34.000000000 +0200
   81.11 -+++ glibc-2_9/elf/elf.h	2009-02-02 22:01:21.000000000 +0100
   81.12 -@@ -571,6 +571,7 @@
   81.13 - #define PT_GNU_EH_FRAME	0x6474e550	/* GCC .eh_frame_hdr segment */
   81.14 - #define PT_GNU_STACK	0x6474e551	/* Indicates stack executability */
   81.15 - #define PT_GNU_RELRO	0x6474e552	/* Read-only after relocation */
   81.16 -+#define PT_PAX_FLAGS	0x65041580	/* Indicates PaX flag markings */
   81.17 - #define PT_LOSUNW	0x6ffffffa
   81.18 - #define PT_SUNWBSS	0x6ffffffa	/* Sun Specific segment */
   81.19 - #define PT_SUNWSTACK	0x6ffffffb	/* Stack segment */
   81.20 -@@ -584,6 +585,18 @@
   81.21 - #define PF_X		(1 << 0)	/* Segment is executable */
   81.22 - #define PF_W		(1 << 1)	/* Segment is writable */
   81.23 - #define PF_R		(1 << 2)	/* Segment is readable */
   81.24 -+#define PF_PAGEEXEC	(1 << 4)	/* Enable  PAGEEXEC */
   81.25 -+#define PF_NOPAGEEXEC	(1 << 5)	/* Disable PAGEEXEC */
   81.26 -+#define PF_SEGMEXEC	(1 << 6)	/* Enable  SEGMEXEC */
   81.27 -+#define PF_NOSEGMEXEC	(1 << 7)	/* Disable SEGMEXEC */
   81.28 -+#define PF_MPROTECT	(1 << 8)	/* Enable  MPROTECT */
   81.29 -+#define PF_NOMPROTECT	(1 << 9)	/* Disable MPROTECT */
   81.30 -+#define PF_RANDEXEC	(1 << 10)	/* Enable  RANDEXEC */
   81.31 -+#define PF_NORANDEXEC	(1 << 11)	/* Disable RANDEXEC */
   81.32 -+#define PF_EMUTRAMP	(1 << 12)	/* Enable  EMUTRAMP */
   81.33 -+#define PF_NOEMUTRAMP	(1 << 13)	/* Disable EMUTRAMP */
   81.34 -+#define PF_RANDMMAP	(1 << 14)	/* Enable  RANDMMAP */
   81.35 -+#define PF_NORANDMMAP	(1 << 15)	/* Disable RANDMMAP */
   81.36 - #define PF_MASKOS	0x0ff00000	/* OS-specific */
   81.37 - #define PF_MASKPROC	0xf0000000	/* Processor-specific */
   81.38 - 
    82.1 --- a/patches/glibc/2_9/400-tests-sandbox-libdl-paths.patch	Sat Apr 11 19:03:02 2009 +0000
    82.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.3 @@ -1,198 +0,0 @@
    82.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/3020_all_glibc-tests-sandbox-libdl-paths.patch
    82.5 -
    82.6 --= BEGIN original header =-
    82.7 -when glibc runs its tests, it does so by invoking the local library loader.
    82.8 -in Gentoo, we build/run inside of our "sandbox" which itself is linked against
    82.9 -libdl (so that it can load libraries and pull out symbols).  the trouble
   82.10 -is that when you upgrade from an older glibc to the new one, often times
   82.11 -internal symbols change name or abi.  this is normally OK as you cannot use
   82.12 -libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
   82.13 -we always say "keep all of the glibc libraries from the same build".  but
   82.14 -when glibc runs its tests, it uses dynamic paths to point to its new local
   82.15 -copies of libraries.  if the test doesnt use libdl, then glibc doesnt add
   82.16 -its path, and when sandbox triggers the loading of libdl, glibc does so
   82.17 -from the host system system.  this gets us into the case of all libraries
   82.18 -are from the locally compiled version of glibc except for libdl.so.
   82.19 -
   82.20 -Fix by Wormo
   82.21 -
   82.22 -http://bugs.gentoo.org/56898
   82.23 -
   82.24 --= END original header =-
   82.25 -
   82.26 -diff -durN glibc-2_9.orig/grp/tst_fgetgrent.sh glibc-2_9/grp/tst_fgetgrent.sh
   82.27 ---- glibc-2_9.orig/grp/tst_fgetgrent.sh	2001-07-06 06:54:46.000000000 +0200
   82.28 -+++ glibc-2_9/grp/tst_fgetgrent.sh	2009-02-02 22:01:23.000000000 +0100
   82.29 -@@ -24,7 +24,8 @@
   82.30 - rtld_installed_name=$1; shift
   82.31 - 
   82.32 - testout=${common_objpfx}/grp/tst_fgetgrent.out
   82.33 --library_path=${common_objpfx}
   82.34 -+# make sure libdl is also in path in case sandbox is in use
   82.35 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
   82.36 - 
   82.37 - result=0
   82.38 - 
   82.39 -diff -durN glibc-2_9.orig/iconvdata/run-iconv-test.sh glibc-2_9/iconvdata/run-iconv-test.sh
   82.40 ---- glibc-2_9.orig/iconvdata/run-iconv-test.sh	2008-05-15 03:59:44.000000000 +0200
   82.41 -+++ glibc-2_9/iconvdata/run-iconv-test.sh	2009-02-02 22:01:23.000000000 +0100
   82.42 -@@ -34,7 +34,7 @@
   82.43 - export GCONV_PATH
   82.44 - 
   82.45 - # We have to have some directories in the library path.
   82.46 --LIBPATH=$codir:$codir/iconvdata
   82.47 -+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
   82.48 - 
   82.49 - # How the start the iconv(1) program.
   82.50 - ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
   82.51 -diff -durN glibc-2_9.orig/iconvdata/tst-table.sh glibc-2_9/iconvdata/tst-table.sh
   82.52 ---- glibc-2_9.orig/iconvdata/tst-table.sh	2002-04-24 23:39:35.000000000 +0200
   82.53 -+++ glibc-2_9/iconvdata/tst-table.sh	2009-02-02 22:01:23.000000000 +0100
   82.54 -@@ -59,8 +59,11 @@
   82.55 -   irreversible=${charset}.irreversible
   82.56 - fi
   82.57 - 
   82.58 -+# make sure libdl is also in path in case sandbox is in use
   82.59 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
   82.60 -+
   82.61 - # iconv in one direction.
   82.62 --${common_objpfx}elf/ld.so --library-path $common_objpfx \
   82.63 -+${common_objpfx}elf/ld.so --library-path $library_path \
   82.64 - ${objpfx}tst-table-from ${charset} \
   82.65 -   > ${objpfx}tst-${charset}.table
   82.66 - 
   82.67 -diff -durN glibc-2_9.orig/intl/tst-codeset.sh glibc-2_9/intl/tst-codeset.sh
   82.68 ---- glibc-2_9.orig/intl/tst-codeset.sh	2005-04-06 04:18:35.000000000 +0200
   82.69 -+++ glibc-2_9/intl/tst-codeset.sh	2009-02-02 22:01:23.000000000 +0100
   82.70 -@@ -37,6 +37,9 @@
   82.71 - LOCPATH=${common_objpfx}localedata
   82.72 - export LOCPATH
   82.73 - 
   82.74 -+# make sure libdl is also in path in case sandbox is in use
   82.75 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
   82.76 -+
   82.77 - ${common_objpfx}elf/ld.so --library-path $common_objpfx \
   82.78 - ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
   82.79 - 
   82.80 -diff -durN glibc-2_9.orig/intl/tst-gettext.sh glibc-2_9/intl/tst-gettext.sh
   82.81 ---- glibc-2_9.orig/intl/tst-gettext.sh	2004-08-15 21:28:18.000000000 +0200
   82.82 -+++ glibc-2_9/intl/tst-gettext.sh	2009-02-02 22:01:23.000000000 +0100
   82.83 -@@ -51,9 +51,12 @@
   82.84 - LOCPATH=${common_objpfx}localedata
   82.85 - export LOCPATH
   82.86 - 
   82.87 -+# make sure libdl is also in path in case sandbox is in use
   82.88 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
   82.89 -+
   82.90 - # Now run the test.
   82.91 - MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
   82.92 --${common_objpfx}elf/ld.so --library-path $common_objpfx \
   82.93 -+${common_objpfx}elf/ld.so --library-path $library_path \
   82.94 - ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
   82.95 - 
   82.96 - exit $?
   82.97 -diff -durN glibc-2_9.orig/intl/tst-gettext2.sh glibc-2_9/intl/tst-gettext2.sh
   82.98 ---- glibc-2_9.orig/intl/tst-gettext2.sh	2005-05-04 19:54:48.000000000 +0200
   82.99 -+++ glibc-2_9/intl/tst-gettext2.sh	2009-02-02 22:01:23.000000000 +0100
  82.100 -@@ -65,8 +65,11 @@
  82.101 - LOCPATH=${objpfx}domaindir
  82.102 - export LOCPATH
  82.103 - 
  82.104 -+# make sure libdl is also in path in case sandbox is in use
  82.105 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
  82.106 -+
  82.107 - # Now run the test.
  82.108 --${common_objpfx}elf/ld.so --library-path $common_objpfx \
  82.109 -+${common_objpfx}elf/ld.so --library-path $library_path \
  82.110 - ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
  82.111 - cmp ${objpfx}tst-gettext2.out - <<EOF
  82.112 - String1 - Lang1: 1st string
  82.113 -diff -durN glibc-2_9.orig/intl/tst-translit.sh glibc-2_9/intl/tst-translit.sh
  82.114 ---- glibc-2_9.orig/intl/tst-translit.sh	2005-05-04 19:56:10.000000000 +0200
  82.115 -+++ glibc-2_9/intl/tst-translit.sh	2009-02-02 22:01:23.000000000 +0100
  82.116 -@@ -36,7 +36,10 @@
  82.117 - LOCPATH=${common_objpfx}localedata
  82.118 - export LOCPATH
  82.119 - 
  82.120 --${common_objpfx}elf/ld.so --library-path $common_objpfx \
  82.121 -+# make sure libdl is also in path in case sandbox is in use
  82.122 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
  82.123 -+
  82.124 -+${common_objpfx}elf/ld.so --library-path $library_path \
  82.125 - ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
  82.126 - 
  82.127 - exit $?
  82.128 -diff -durN glibc-2_9.orig/malloc/tst-mtrace.sh glibc-2_9/malloc/tst-mtrace.sh
  82.129 ---- glibc-2_9.orig/malloc/tst-mtrace.sh	2005-10-15 01:40:35.000000000 +0200
  82.130 -+++ glibc-2_9/malloc/tst-mtrace.sh	2009-02-02 22:01:23.000000000 +0100
  82.131 -@@ -24,9 +24,12 @@
  82.132 - status=0
  82.133 - trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
  82.134 - 
  82.135 -+# make sure libdl is also in path in case sandbox is in use
  82.136 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
  82.137 -+
  82.138 - MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
  82.139 - LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
  82.140 --${common_objpfx}elf/ld.so --library-path $common_objpfx \
  82.141 -+${common_objpfx}elf/ld.so --library-path $library_path \
  82.142 -   ${common_objpfx}malloc/tst-mtrace || status=1
  82.143 - 
  82.144 - if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
  82.145 -diff -durN glibc-2_9.orig/nptl/tst-tls6.sh glibc-2_9/nptl/tst-tls6.sh
  82.146 ---- glibc-2_9.orig/nptl/tst-tls6.sh	2003-09-03 00:02:59.000000000 +0200
  82.147 -+++ glibc-2_9/nptl/tst-tls6.sh	2009-02-02 22:01:23.000000000 +0100
  82.148 -@@ -5,8 +5,8 @@
  82.149 - rtld_installed_name=$1; shift
  82.150 - logfile=$common_objpfx/nptl/tst-tls6.out
  82.151 - 
  82.152 --# We have to find libc and nptl
  82.153 --library_path=${common_objpfx}:${common_objpfx}nptl
  82.154 -+# We have to find libc and nptl (also libdl in case sandbox is in use)
  82.155 -+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
  82.156 - tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
  82.157 - 	  ${common_objpfx}/nptl/tst-tls5"
  82.158 - 
  82.159 -diff -durN glibc-2_9.orig/posix/globtest.sh glibc-2_9/posix/globtest.sh
  82.160 ---- glibc-2_9.orig/posix/globtest.sh	2007-02-14 20:52:33.000000000 +0100
  82.161 -+++ glibc-2_9/posix/globtest.sh	2009-02-02 22:01:23.000000000 +0100
  82.162 -@@ -18,7 +18,7 @@
  82.163 - esac
  82.164 - 
  82.165 - # We have to find the libc and the NSS modules.
  82.166 --library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
  82.167 -+library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
  82.168 - 
  82.169 - # Since we use `sort' we must make sure to use the same locale everywhere.
  82.170 - LC_ALL=C
  82.171 -diff -durN glibc-2_9.orig/posix/tst-getconf.sh glibc-2_9/posix/tst-getconf.sh
  82.172 ---- glibc-2_9.orig/posix/tst-getconf.sh	2002-09-01 13:11:25.000000000 +0200
  82.173 -+++ glibc-2_9/posix/tst-getconf.sh	2009-02-02 22:01:23.000000000 +0100
  82.174 -@@ -10,7 +10,10 @@
  82.175 - else
  82.176 -   rtld_installed_name=$1; shift
  82.177 -   runit() {
  82.178 --    ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
  82.179 -+    
  82.180 -+  # make sure libdl is also in path in case sandbox is in use
  82.181 -+  library_path=${common_objpfx}:${common_objpfx}/dlfcn
  82.182 -+    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
  82.183 -   }
  82.184 - fi
  82.185 - 
  82.186 -diff -durN glibc-2_9.orig/posix/wordexp-tst.sh glibc-2_9/posix/wordexp-tst.sh
  82.187 ---- glibc-2_9.orig/posix/wordexp-tst.sh	2000-10-20 18:23:30.000000000 +0200
  82.188 -+++ glibc-2_9/posix/wordexp-tst.sh	2009-02-02 22:01:23.000000000 +0100
  82.189 -@@ -19,8 +19,11 @@
  82.190 - "
  82.191 - export IFS
  82.192 - 
  82.193 -+# make sure libdl is also in path in case sandbox is in use
  82.194 -+library_path=${common_objpfx}:${common_objpfx}/dlfcn
  82.195 -+
  82.196 - failed=0
  82.197 --${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
  82.198 -+${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
  82.199 - ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
  82.200 - cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
  82.201 - wordexp returned 0
    83.1 --- a/patches/glibc/2_9/410-2.9-fnmatch.patch	Sat Apr 11 19:03:02 2009 +0000
    83.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.3 @@ -1,64 +0,0 @@
    83.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/5021_all_2.9-fnmatch.patch
    83.5 -
    83.6 --= BEGIN original header =-
    83.7 -http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
    83.8 -
    83.9 -When fnmatch detects an invalid multibyte character it should fall back to
   83.10 -single byte matching, so that "*" has a chance to match such a string.
   83.11 -
   83.12 -Andreas.
   83.13 -
   83.14 -2005-04-12  Andreas Schwab  <schwab@suse.de>
   83.15 -
   83.16 -	* posix/fnmatch.c (fnmatch): If conversion to wide character
   83.17 -	fails fall back to single byte matching.
   83.18 -
   83.19 --= END original header =-
   83.20 -
   83.21 -diff -durN glibc-2_9.orig/posix/fnmatch.c glibc-2_9/posix/fnmatch.c
   83.22 ---- glibc-2_9.orig/posix/fnmatch.c	2007-07-28 22:35:00.000000000 +0200
   83.23 -+++ glibc-2_9/posix/fnmatch.c	2009-02-02 22:01:25.000000000 +0100
   83.24 -@@ -327,6 +327,7 @@
   83.25 - # if HANDLE_MULTIBYTE
   83.26 -   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
   83.27 -     {
   83.28 -+      const char *orig_pattern = pattern;
   83.29 -       mbstate_t ps;
   83.30 -       size_t n;
   83.31 -       const char *p;
   83.32 -@@ -382,10 +383,8 @@
   83.33 - 	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
   83.34 - 	  n = mbsrtowcs (wstring, &p, n + 1, &ps);
   83.35 - 	  if (__builtin_expect (n == (size_t) -1, 0))
   83.36 --	    /* Something wrong.
   83.37 --	       XXX Do we have to set `errno' to something which mbsrtows hasn't
   83.38 --	       already done?  */
   83.39 --	    return -1;
   83.40 -+	    /* Something wrong.  Fall back to single byte matching.  */
   83.41 -+	    goto try_singlebyte;
   83.42 - 	  if (p)
   83.43 - 	    {
   83.44 - 	      memset (&ps, '\0', sizeof (ps));
   83.45 -@@ -397,10 +396,8 @@
   83.46 - 	prepare_wstring:
   83.47 - 	  n = mbsrtowcs (NULL, &string, 0, &ps);
   83.48 - 	  if (__builtin_expect (n == (size_t) -1, 0))
   83.49 --	    /* Something wrong.
   83.50 --	       XXX Do we have to set `errno' to something which mbsrtows hasn't
   83.51 --	       already done?  */
   83.52 --	    return -1;
   83.53 -+	    /* Something wrong.  Fall back to single byte matching.  */
   83.54 -+	    goto try_singlebyte;
   83.55 - 	  wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
   83.56 - 	  assert (mbsinit (&ps));
   83.57 - 	  (void) mbsrtowcs (wstring, &string, n + 1, &ps);
   83.58 -@@ -408,6 +405,9 @@
   83.59 - 
   83.60 -       return internal_fnwmatch (wpattern, wstring, wstring + n,
   83.61 - 				flags & FNM_PERIOD, flags, NULL);
   83.62 -+
   83.63 -+    try_singlebyte:
   83.64 -+      pattern = orig_pattern;
   83.65 -     }
   83.66 - # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
   83.67 - 
    84.1 --- a/patches/glibc/2_9/420-dont-build-timezone.patch	Sat Apr 11 19:03:02 2009 +0000
    84.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.3 @@ -1,19 +0,0 @@
    84.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/5063_all_glibc-dont-build-timezone.patch
    84.5 -
    84.6 --= BEGIN original header =-
    84.7 -timezone data has been split into the package sys-libs/timezone-data
    84.8 -
    84.9 --= END original header =-
   84.10 -
   84.11 -diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
   84.12 ---- glibc-2_9.orig/Makeconfig	2009-02-02 22:01:05.000000000 +0100
   84.13 -+++ glibc-2_9/Makeconfig	2009-02-02 22:01:27.000000000 +0100
   84.14 -@@ -919,7 +919,7 @@
   84.15 - 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
   84.16 - 	      grp pwd posix io termios resource misc socket sysvipc gmon    \
   84.17 - 	      gnulib iconv iconvdata wctype manual shadow po argp	    \
   84.18 --	      crypt nss localedata timezone rt conform debug		    \
   84.19 -+	      crypt nss localedata rt conform debug		    \
   84.20 - 	      $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
   84.21 - 
   84.22 - ifndef avoid-generated
    85.1 --- a/patches/glibc/2_9/430-2.7-cross-compile-nptl.patch	Sat Apr 11 19:03:02 2009 +0000
    85.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.3 @@ -1,57 +0,0 @@
    85.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/5070_all_glibc-2.7-cross-compile-nptl.patch
    85.5 -
    85.6 --= BEGIN original header =-
    85.7 -A little hack for cross-compiling NPTL
    85.8 -
    85.9 -http://sourceware.org/ml/libc-alpha/2005-02/msg00043.html
   85.10 -
   85.11 --= END original header =-
   85.12 -
   85.13 -diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/configure glibc-2_9/nptl/sysdeps/pthread/configure
   85.14 ---- glibc-2_9.orig/nptl/sysdeps/pthread/configure	2007-10-17 00:24:30.000000000 +0200
   85.15 -+++ glibc-2_9/nptl/sysdeps/pthread/configure	2009-02-02 22:01:28.000000000 +0100
   85.16 -@@ -78,6 +78,10 @@
   85.17 - fi
   85.18 - { echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
   85.19 - echo "${ECHO_T}$libc_cv_forced_unwind" >&6; }
   85.20 -+if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
   85.21 -+  echo "$as_me:$LINENO: forcing libc_cv_forced_unwind = yes for cross-compile"
   85.22 -+  libc_cv_forced_unwind=yes
   85.23 -+fi
   85.24 - if test $libc_cv_forced_unwind = yes; then
   85.25 -   cat >>confdefs.h <<\_ACEOF
   85.26 - #define HAVE_FORCED_UNWIND 1
   85.27 -@@ -141,6 +145,10 @@
   85.28 - { echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
   85.29 - echo "${ECHO_T}$libc_cv_c_cleanup" >&6; }
   85.30 -   CFLAGS="$old_CFLAGS"
   85.31 -+  if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
   85.32 -+    echo "$as_me:$LINENO: result: forcing libc_cv_c_cleanup = yes for cross-compile"
   85.33 -+    libc_cv_c_cleanup=yes
   85.34 -+  fi
   85.35 -   if test $libc_cv_c_cleanup = no; then
   85.36 -     { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5
   85.37 - echo "$as_me: error: the compiler must support C cleanup handling" >&2;}
   85.38 -diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/configure.in glibc-2_9/nptl/sysdeps/pthread/configure.in
   85.39 ---- glibc-2_9.orig/nptl/sysdeps/pthread/configure.in	2003-12-03 07:50:01.000000000 +0100
   85.40 -+++ glibc-2_9/nptl/sysdeps/pthread/configure.in	2009-02-02 22:01:28.000000000 +0100
   85.41 -@@ -28,6 +28,9 @@
   85.42 - struct _Unwind_Context *context;
   85.43 - _Unwind_GetCFA (context)],
   85.44 - libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
   85.45 -+if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
   85.46 -+  libc_cv_forced_unwind=yes
   85.47 -+fi
   85.48 - if test $libc_cv_forced_unwind = yes; then
   85.49 -   AC_DEFINE(HAVE_FORCED_UNWIND)
   85.50 - dnl Check for C cleanup handling.
   85.51 -@@ -41,6 +44,9 @@
   85.52 -   puts ("test")],
   85.53 - libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
   85.54 -   CFLAGS="$old_CFLAGS"
   85.55 -+  if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
   85.56 -+    libc_cv_c_cleanup=yes
   85.57 -+  fi
   85.58 -   if test $libc_cv_c_cleanup = no; then
   85.59 -     AC_MSG_ERROR([the compiler must support C cleanup handling])
   85.60 -   fi
    86.1 --- a/patches/glibc/2_9/440-alpha-glibc-2.4-xstat.patch	Sat Apr 11 19:03:02 2009 +0000
    86.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.3 @@ -1,249 +0,0 @@
    86.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/6001_all_alpha-glibc-2.4-xstat.patch
    86.5 -
    86.6 --= BEGIN original header =-
    86.7 -http://sources.redhat.com/bugzilla/show_bug.cgi?id=1026
    86.8 -http://sourceware.org/ml/libc-alpha/2005-02/msg00122.html
    86.9 -
   86.10 -2005-02-26  GOTO Masanori  <gotom@debian.or.jp>
   86.11 -
   86.12 -	* sysdeps/unix/sysv/linux/kernel-features.h: Define
   86.13 -	__ASSUME_STAT64_SYSCALL.
   86.14 -	* sysdeps/unix/sysv/linux/alpha/fxstat.c: Check
   86.15 -	__ASSUME_STAT64_SYSCALL.
   86.16 -	* sysdeps/unix/sysv/linux/alpha/fxstatat.c: Likewise.
   86.17 -	* sysdeps/unix/sysv/linux/alpha/lxstat.c: Likewise.
   86.18 -	* sysdeps/unix/sysv/linux/alpha/xstat.c: Likewise.
   86.19 -	* sysdeps/unix/sysv/linux/alpha/xstatconv.c: Don't define
   86.20 -	__libc_missing_axp_stat64 when it's not needed.
   86.21 -	* sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
   86.22 -
   86.23 --= END original header =-
   86.24 -
   86.25 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstat.c
   86.26 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c	2004-03-11 03:58:44.000000000 +0100
   86.27 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstat.c	2009-02-02 22:01:30.000000000 +0100
   86.28 -@@ -35,27 +35,39 @@
   86.29 - __fxstat (int vers, int fd, struct stat *buf)
   86.30 - {
   86.31 -   INTERNAL_SYSCALL_DECL (err);
   86.32 --  int result, errno_out;
   86.33 -+  int result;
   86.34 -   struct kernel_stat kbuf;
   86.35 - 
   86.36 -+#if __ASSUME_STAT64_SYSCALL > 0
   86.37 -+  if (vers == _STAT_VER_KERNEL64)
   86.38 -+    {
   86.39 -+      result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
   86.40 -+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   86.41 -+	return result;
   86.42 -+      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
   86.43 -+      return -1;
   86.44 -+    }
   86.45 -+#elif defined __NR_fstat64
   86.46 -   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
   86.47 -     {
   86.48 -+      int errno_out;
   86.49 -       result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
   86.50 -       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   86.51 - 	return result;
   86.52 -       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
   86.53 -       if (errno_out != ENOSYS)
   86.54 --	goto fail;
   86.55 -+	{
   86.56 -+	  __set_errno (errno_out);
   86.57 -+	  return -1;
   86.58 -+	}
   86.59 -       __libc_missing_axp_stat64 = 1;
   86.60 -     }
   86.61 -+#endif
   86.62 - 
   86.63 -   result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
   86.64 -   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   86.65 -     return __xstat_conv (vers, &kbuf, buf);
   86.66 --  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
   86.67 --  
   86.68 -- fail:
   86.69 --  __set_errno (errno_out);
   86.70 -+  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
   86.71 -   return -1;
   86.72 - }
   86.73 - hidden_def (__fxstat)
   86.74 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstatat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstatat.c
   86.75 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstatat.c	2006-02-20 23:51:48.000000000 +0100
   86.76 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstatat.c	2009-02-02 22:01:30.000000000 +0100
   86.77 -@@ -65,6 +65,20 @@
   86.78 -   int result, errno_out;
   86.79 -   struct kernel_stat kst;
   86.80 - 
   86.81 -+#if __ASSUME_STAT64_SYSCALL > 0
   86.82 -+  if (vers == _STAT_VER_KERNEL64)
   86.83 -+    {
   86.84 -+      if (flag & AT_SYMLINK_NOFOLLOW)
   86.85 -+	result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
   86.86 -+      else
   86.87 -+	result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
   86.88 -+
   86.89 -+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
   86.90 -+	return result;
   86.91 -+      errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
   86.92 -+      goto fail;
   86.93 -+    }
   86.94 -+#elif defined __NR_stat64
   86.95 -   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
   86.96 -     {
   86.97 -       if (flag & AT_SYMLINK_NOFOLLOW)
   86.98 -@@ -79,6 +93,7 @@
   86.99 - 	goto fail;
  86.100 -       __libc_missing_axp_stat64 = 1;
  86.101 -     }
  86.102 -+#endif
  86.103 - 
  86.104 -   if (flag & AT_SYMLINK_NOFOLLOW)
  86.105 -     result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
  86.106 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/lxstat.c
  86.107 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c	2004-03-11 03:58:44.000000000 +0100
  86.108 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/lxstat.c	2009-02-02 22:01:30.000000000 +0100
  86.109 -@@ -35,27 +35,39 @@
  86.110 - __lxstat (int vers, const char *name, struct stat *buf)
  86.111 - {
  86.112 -   INTERNAL_SYSCALL_DECL (err);
  86.113 --  int result, errno_out;
  86.114 -+  int result;
  86.115 -   struct kernel_stat kbuf;
  86.116 - 
  86.117 -+#if __ASSUME_STAT64_SYSCALL > 0
  86.118 -+  if (vers == _STAT_VER_KERNEL64)
  86.119 -+    {
  86.120 -+      result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
  86.121 -+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  86.122 -+	return result;
  86.123 -+      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  86.124 -+      return -1;
  86.125 -+    }
  86.126 -+#elif defined __NR_lstat64
  86.127 -   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
  86.128 -     {
  86.129 -+      int errno_out;
  86.130 -       result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
  86.131 -       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  86.132 - 	return result;
  86.133 -       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  86.134 -       if (errno_out != ENOSYS)
  86.135 --	goto fail;
  86.136 -+	{
  86.137 -+	  __set_errno (errno_out);
  86.138 -+	  return -1;
  86.139 -+	}
  86.140 -       __libc_missing_axp_stat64 = 1;
  86.141 -     }
  86.142 -+#endif
  86.143 - 
  86.144 -   result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
  86.145 -   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  86.146 -     return __xstat_conv (vers, &kbuf, buf);
  86.147 --  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  86.148 --  
  86.149 -- fail:
  86.150 --  __set_errno (errno_out);
  86.151 -+  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  86.152 -   return -1;
  86.153 - }
  86.154 - hidden_def (__lxstat)
  86.155 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstat.c
  86.156 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstat.c	2004-03-11 03:58:44.000000000 +0100
  86.157 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstat.c	2009-02-02 22:01:30.000000000 +0100
  86.158 -@@ -35,27 +35,39 @@
  86.159 - __xstat (int vers, const char *name, struct stat *buf)
  86.160 - {
  86.161 -   INTERNAL_SYSCALL_DECL (err);
  86.162 --  int result, errno_out;
  86.163 -+  int result;
  86.164 -   struct kernel_stat kbuf;
  86.165 - 
  86.166 -+#if __ASSUME_STAT64_SYSCALL > 0
  86.167 -+  if (vers == _STAT_VER_KERNEL64)
  86.168 -+    {
  86.169 -+      result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
  86.170 -+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  86.171 -+	return result;
  86.172 -+      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  86.173 -+      return -1;
  86.174 -+    }
  86.175 -+#elif defined __NR_stat64
  86.176 -   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
  86.177 -     {
  86.178 -+      int errno_out;
  86.179 -       result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
  86.180 -       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  86.181 - 	return result;
  86.182 -       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  86.183 -       if (errno_out != ENOSYS)
  86.184 --	goto fail;
  86.185 -+	{
  86.186 -+	  __set_errno (errno_out);
  86.187 -+	  return -1;
  86.188 -+	}
  86.189 -       __libc_missing_axp_stat64 = 1;
  86.190 -     }
  86.191 -+#endif
  86.192 - 
  86.193 -   result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
  86.194 -   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
  86.195 -     return __xstat_conv (vers, &kbuf, buf);
  86.196 --  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  86.197 --  
  86.198 -- fail:
  86.199 --  __set_errno (errno_out);
  86.200 -+  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
  86.201 -   return -1;
  86.202 - }
  86.203 - hidden_def (__xstat)
  86.204 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.c
  86.205 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.c	2004-03-11 03:58:44.000000000 +0100
  86.206 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.c	2009-02-02 22:01:30.000000000 +0100
  86.207 -@@ -22,9 +22,14 @@
  86.208 - #include <sys/stat.h>
  86.209 - #include <kernel_stat.h>
  86.210 - #include <xstatconv.h>
  86.211 -+#include <sys/syscall.h>
  86.212 - 
  86.213 - 
  86.214 -+#ifdef __NR_stat64
  86.215 -+# if __ASSUME_STAT64_SYSCALL == 0
  86.216 - int __libc_missing_axp_stat64;
  86.217 -+# endif
  86.218 -+#endif
  86.219 - 
  86.220 - int
  86.221 - __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
  86.222 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.h
  86.223 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.h	2006-01-08 09:21:16.000000000 +0100
  86.224 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.h	2009-02-02 22:01:30.000000000 +0100
  86.225 -@@ -18,7 +18,12 @@
  86.226 -    02111-1307 USA.  */
  86.227 - 
  86.228 - #include <kernel-features.h>
  86.229 -+#include <sys/syscall.h>
  86.230 - 
  86.231 -+#ifdef __NR_stat64
  86.232 -+# if __ASSUME_STAT64_SYSCALL == 0
  86.233 - extern int __libc_missing_axp_stat64 attribute_hidden;
  86.234 -+# endif
  86.235 -+#endif
  86.236 - extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
  86.237 -   attribute_hidden;
  86.238 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2_9/sysdeps/unix/sysv/linux/kernel-features.h
  86.239 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/kernel-features.h	2008-08-01 23:51:04.000000000 +0200
  86.240 -+++ glibc-2_9/sysdeps/unix/sysv/linux/kernel-features.h	2009-02-02 22:01:30.000000000 +0100
  86.241 -@@ -395,6 +395,11 @@
  86.242 - # define __ASSUME_GETDENTS32_D_TYPE	1
  86.243 - #endif
  86.244 - 
  86.245 -+/* Starting with version 2.6.4, alpha stat64 syscalls are available.  */
  86.246 -+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
  86.247 -+# define __ASSUME_STAT64_SYSCALL	1
  86.248 -+#endif
  86.249 -+
  86.250 - /* Starting with version 2.5.3, the initial location returned by `brk'
  86.251 -    after exec is always rounded up to the next page.  */
  86.252 - #if __LINUX_KERNEL_VERSION >= 132355
    87.1 --- a/patches/glibc/2_9/450-alpha-glibc-2.5-no-page-header.patch	Sat Apr 11 19:03:02 2009 +0000
    87.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.3 @@ -1,32 +0,0 @@
    87.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/6015_all_alpha-glibc-2.5-no-page-header.patch
    87.5 -
    87.6 --= BEGIN original header =-
    87.7 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    87.8 -
    87.9 -	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   87.10 -	from the kernel header to sys/user.h and remove the #include of
   87.11 -	sys/user.h.
   87.12 -
   87.13 --= END original header =-
   87.14 -
   87.15 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/user.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/user.h
   87.16 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/user.h	2001-07-06 06:56:13.000000000 +0200
   87.17 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/user.h	2009-02-02 22:01:32.000000000 +0100
   87.18 -@@ -23,7 +23,6 @@
   87.19 -    only. Don't read too much into it. Don't use it for anything other
   87.20 -    than gdb/strace unless you know what you are doing. */
   87.21 - 
   87.22 --#include <asm/page.h>
   87.23 - #include <asm/reg.h>
   87.24 - 
   87.25 - struct user
   87.26 -@@ -41,6 +40,9 @@
   87.27 -   char u_comm[32];				/* user command name */
   87.28 - };
   87.29 - 
   87.30 -+#define PAGE_SHIFT		13
   87.31 -+#define PAGE_SIZE		(1 << PAGE_SHIFT)
   87.32 -+#define PAGE_MASK		(~(PAGE_SIZE-1))
   87.33 - #define NBPG			PAGE_SIZE
   87.34 - #define UPAGES			1
   87.35 - #define HOST_TEXT_START_ADDR	(u.start_code)
    88.1 --- a/patches/glibc/2_9/460-alpha-glibc-2.5-no-asm-elf-header.patch	Sat Apr 11 19:03:02 2009 +0000
    88.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.3 @@ -1,38 +0,0 @@
    88.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/6016_all_alpha-glibc-2.5-no-asm-elf-header.patch
    88.5 -
    88.6 --= BEGIN original header =-
    88.7 -2007-03-13  Mike Frysinger  <vapier@gentoo.org>
    88.8 -
    88.9 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some defines
   88.10 -	from alpha's asm/elf.h
   88.11 -
   88.12 --= END original header =-
   88.13 -
   88.14 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/procfs.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
   88.15 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/procfs.h	2001-07-06 06:56:13.000000000 +0200
   88.16 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/procfs.h	2009-02-02 22:01:33.000000000 +0100
   88.17 -@@ -29,10 +29,23 @@
   88.18 - #include <sys/types.h>
   88.19 - #include <sys/ucontext.h>
   88.20 - #include <sys/user.h>
   88.21 --#include <asm/elf.h>
   88.22 - 
   88.23 - __BEGIN_DECLS
   88.24 - 
   88.25 -+/*
   88.26 -+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
   88.27 -+ * I have no idea why that is so.  For now, we just leave it at 33
   88.28 -+ * (32 general regs + processor status word). 
   88.29 -+ */
   88.30 -+#define ELF_NGREG	33
   88.31 -+#define ELF_NFPREG	32
   88.32 -+
   88.33 -+typedef unsigned long elf_greg_t;
   88.34 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
   88.35 -+
   88.36 -+typedef double elf_fpreg_t;
   88.37 -+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
   88.38 -+
   88.39 - struct elf_siginfo
   88.40 -   {
   88.41 -     int si_signo;			/* Signal number.  */
    89.1 --- a/patches/glibc/2_9/470-alpha-glibc-2.8-creat.patch	Sat Apr 11 19:03:02 2009 +0000
    89.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.3 @@ -1,19 +0,0 @@
    89.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/6017_all_alpha-glibc-2.8-creat.patch
    89.5 -
    89.6 --= BEGIN original header =-
    89.7 -alpha does not have a __NR_creat
    89.8 -
    89.9 -http://bugs.gentoo.org/227275
   89.10 -http://sourceware.org/bugzilla/show_bug.cgi?id=6650
   89.11 -
   89.12 --= END original header =-
   89.13 -
   89.14 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c glibc-2_9/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
   89.15 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c	2007-11-10 20:34:26.000000000 +0100
   89.16 -+++ glibc-2_9/sysdeps/unix/sysv/linux/wordsize-64/creat64.c	2009-02-02 22:01:35.000000000 +0100
   89.17 -@@ -1 +1,5 @@
   89.18 - /* Defined as alias for the syscall.  */
   89.19 -+#include <sysdep.h>
   89.20 -+#ifndef __NR_creat
   89.21 -+#include "../../../../../io/creat64.c"
   89.22 -+#endif
    90.1 --- a/patches/glibc/2_9/480-alpha-glibc-2.8-cache-shape.patch	Sat Apr 11 19:03:02 2009 +0000
    90.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.3 @@ -1,18 +0,0 @@
    90.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/6018_all_alpha-glibc-2.8-cache-shape.patch
    90.5 -
    90.6 --= BEGIN original header =-
    90.7 -older verisons of glibc would build dl-sysdep as shared-only and dl-support as
    90.8 -static-only.  alpha hooks in a cache variable via dl-auxv.h.  newer versions of
    90.9 -glibc build dl-sysdep as both shared and static which means we now have symbol
   90.10 -duplication for static builds with dl-sysdep and dl-support.  since dl-sysdep
   90.11 -is both shared/static, there is no point in hooking dl-support anymore, so we
   90.12 -can punt it.
   90.13 -
   90.14 --= END original header =-
   90.15 -
   90.16 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/dl-support.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/dl-support.c
   90.17 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/dl-support.c	2007-03-13 22:25:16.000000000 +0100
   90.18 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/dl-support.c	2009-02-02 22:01:37.000000000 +0100
   90.19 -@@ -1,2 +0,0 @@
   90.20 --#include "dl-auxv.h"
   90.21 --#include <elf/dl-support.c>
    91.1 --- a/patches/glibc/2_9/490-ptr-mangling.patch	Sat Apr 11 19:03:02 2009 +0000
    91.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.3 @@ -1,114 +0,0 @@
    91.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/6018_all_glibc-ptr-mangling.patch
    91.5 -
    91.6 --= BEGIN original header =-
    91.7 -http://bugs.gentoo.org/201910
    91.8 -
    91.9 -For every arch, PTR_MANGLE and PTR_DEMANGLE defines are in
   91.10 -sysdeps/unix/sysv/linux/<arch>/sysdep.h. But for alpha this is not true. The
   91.11 -defines are in sysdeps/unix/alpha/sysdep.h and unix/sysv/linux/alpha/sysdep.h
   91.12 -includes the first.
   91.13 -
   91.14 -This is a patch that fixes the issue and let alpha build, at the expense of
   91.15 -disabling MANGLING in the non PIC case, but googling showed that the issue is
   91.16 -known, and that nobody really cares about it. 
   91.17 -
   91.18 -Info from: http://sourceware.org/bugzilla/show_bug.cgi?id=5216
   91.19 -
   91.20 --= END original header =-
   91.21 -
   91.22 -diff -durN glibc-2_9.orig/sysdeps/unix/alpha/sysdep.h glibc-2_9/sysdeps/unix/alpha/sysdep.h
   91.23 ---- glibc-2_9.orig/sysdeps/unix/alpha/sysdep.h	2006-03-03 12:21:28.000000000 +0100
   91.24 -+++ glibc-2_9/sysdeps/unix/alpha/sysdep.h	2009-02-02 22:01:39.000000000 +0100
   91.25 -@@ -397,42 +397,4 @@
   91.26 - 	_sc_ret = _sc_0, _sc_err = _sc_19;			\
   91.27 - }
   91.28 - 
   91.29 --/* Pointer mangling support.  Note that tls access is slow enough that
   91.30 --   we don't deoptimize things by placing the pointer check value there.  */
   91.31 --
   91.32 --#include <stdint.h>
   91.33 --
   91.34 --#if defined NOT_IN_libc && defined IS_IN_rtld
   91.35 --# ifdef __ASSEMBLER__
   91.36 --#  define PTR_MANGLE(dst, src, tmp)				\
   91.37 --	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
   91.38 --	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
   91.39 --	xor	src, tmp, dst
   91.40 --#  define PTR_MANGLE2(dst, src, tmp)				\
   91.41 --	xor	src, tmp, dst
   91.42 --#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
   91.43 --#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
   91.44 --# else
   91.45 --extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
   91.46 --#  define PTR_MANGLE(var)	\
   91.47 --  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
   91.48 --#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
   91.49 --# endif
   91.50 --#elif defined PIC
   91.51 --# ifdef __ASSEMBLER__
   91.52 --#  define PTR_MANGLE(dst, src, tmp)		\
   91.53 --	ldq	tmp, __pointer_chk_guard;	\
   91.54 --	xor	src, tmp, dst
   91.55 --#  define PTR_MANGLE2(dst, src, tmp)		\
   91.56 --	xor	src, tmp, dst
   91.57 --#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
   91.58 --#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
   91.59 --# else
   91.60 --extern uintptr_t __pointer_chk_guard attribute_relro;
   91.61 --#  define PTR_MANGLE(var)	\
   91.62 --	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
   91.63 --#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
   91.64 --# endif
   91.65 --#endif
   91.66 --
   91.67 - #endif /* ASSEMBLER */
   91.68 -diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/sysdep.h
   91.69 ---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h	2007-08-21 10:07:28.000000000 +0200
   91.70 -+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sysdep.h	2009-02-02 22:01:39.000000000 +0100
   91.71 -@@ -98,4 +98,46 @@
   91.72 - 	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
   91.73 - })
   91.74 - 
   91.75 -+/* Pointer mangling support.  Note that tls access is slow enough that
   91.76 -+   we don't deoptimize things by placing the pointer check value there.  */
   91.77 -+
   91.78 -+#if defined NOT_IN_libc && defined IS_IN_rtld
   91.79 -+# ifdef __ASSEMBLER__
   91.80 -+#  define PTR_MANGLE(dst, src, tmp)                            \
   91.81 -+       ldah    tmp, __pointer_chk_guard_local($29) !gprelhigh; \
   91.82 -+       ldq     tmp, __pointer_chk_guard_local(tmp) !gprellow;  \
   91.83 -+       xor     src, tmp, dst
   91.84 -+#  define PTR_MANGLE2(dst, src, tmp)                           \
   91.85 -+       xor     src, tmp, dst
   91.86 -+#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
   91.87 -+#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
   91.88 -+# else
   91.89 -+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
   91.90 -+#  define PTR_MANGLE(var)      \
   91.91 -+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
   91.92 -+#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
   91.93 -+# endif
   91.94 -+#elif defined PIC
   91.95 -+# ifdef __ASSEMBLER__
   91.96 -+#  define PTR_MANGLE(dst, src, tmp)            \
   91.97 -+       ldq     tmp, __pointer_chk_guard;       \
   91.98 -+       xor     src, tmp, dst
   91.99 -+#  define PTR_MANGLE2(dst, src, tmp)           \
  91.100 -+       xor     src, tmp, dst
  91.101 -+#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  91.102 -+#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  91.103 -+# else
  91.104 -+extern uintptr_t __pointer_chk_guard attribute_relro;
  91.105 -+#  define PTR_MANGLE(var)      \
  91.106 -+       (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
  91.107 -+#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  91.108 -+# endif
  91.109 -+#else
  91.110 -+/* Pointer mangling is not yet supported for static libc on alpha.  */
  91.111 -+# ifndef __ASSEMBLER__
  91.112 -+#  define PTR_MANGLE(var)   (void) (var)
  91.113 -+#  define PTR_DEMANGLE(var) (void) (var)
  91.114 -+# endif
  91.115 -+#endif
  91.116 -+
  91.117 - #endif /* _LINUX_ALPHA_SYSDEP_H */
    92.1 --- a/patches/glibc/2_9/500-ppc-glibc-2.9-atomic.patch	Sat Apr 11 19:03:02 2009 +0000
    92.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.3 @@ -1,414 +0,0 @@
    92.4 -Original patch from: gentoo/src/patchsets/glibc/2.9/6120_all_ppc-glibc-2.9-atomic.patch
    92.5 -
    92.6 --= BEGIN original header =-
    92.7 -sniped from suse
    92.8 -
    92.9 --= END original header =-
   92.10 -
   92.11 -diff -durN glibc-2_9.orig/sysdeps/powerpc/bits/atomic.h glibc-2_9/sysdeps/powerpc/bits/atomic.h
   92.12 ---- glibc-2_9.orig/sysdeps/powerpc/bits/atomic.h	2007-03-26 22:15:28.000000000 +0200
   92.13 -+++ glibc-2_9/sysdeps/powerpc/bits/atomic.h	2009-02-02 22:01:40.000000000 +0100
   92.14 -@@ -85,14 +85,14 @@
   92.15 -       __typeof (*(mem)) __tmp;						      \
   92.16 -       __typeof (mem)  __memp = (mem);					      \
   92.17 -       __asm __volatile (						      \
   92.18 --		        "1:	lwarx	%0,0,%1" MUTEX_HINT_ACQ "\n"	      \
   92.19 -+		        "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
   92.20 - 		        "	cmpw	%0,%2\n"			      \
   92.21 - 		        "	bne	2f\n"				      \
   92.22 --		        "	stwcx.	%3,0,%1\n"			      \
   92.23 -+		        "	stwcx.	%3,%y1\n"			      \
   92.24 - 		        "	bne-	1b\n"				      \
   92.25 - 		        "2:	" __ARCH_ACQ_INSTR			      \
   92.26 --		        : "=&r" (__tmp)					      \
   92.27 --		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
   92.28 -+		        : "=&r" (__tmp), "+Z" (*__memp)			      \
   92.29 -+		        : "r" (oldval), "r" (newval)			      \
   92.30 - 		        : "cr0", "memory");				      \
   92.31 -       __tmp;								      \
   92.32 -   })
   92.33 -@@ -102,14 +102,14 @@
   92.34 -       __typeof (*(mem)) __tmp;						      \
   92.35 -       __typeof (mem)  __memp = (mem);					      \
   92.36 -       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
   92.37 --		        "1:	lwarx	%0,0,%1" MUTEX_HINT_REL "\n"	      \
   92.38 -+		        "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
   92.39 - 		        "	cmpw	%0,%2\n"			      \
   92.40 - 		        "	bne	2f\n"				      \
   92.41 --		        "	stwcx.	%3,0,%1\n"			      \
   92.42 -+		        "	stwcx.	%3,%y1\n"			      \
   92.43 - 		        "	bne-	1b\n"				      \
   92.44 - 		        "2:	"					      \
   92.45 --		        : "=&r" (__tmp)					      \
   92.46 --		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
   92.47 -+		        : "=&r" (__tmp), "+Z" (__memp)			      \
   92.48 -+		        : "r" (oldval), "r" (newval)			      \
   92.49 - 		        : "cr0", "memory");				      \
   92.50 -       __tmp;								      \
   92.51 -   })
   92.52 -@@ -118,12 +118,12 @@
   92.53 -   ({									      \
   92.54 -     __typeof (*mem) __val;						      \
   92.55 -     __asm __volatile (							      \
   92.56 --		      "1:	lwarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	      \
   92.57 --		      "		stwcx.	%3,0,%2\n"			      \
   92.58 -+		      "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
   92.59 -+		      "		stwcx.	%2,%y1\n"			      \
   92.60 - 		      "		bne-	1b\n"				      \
   92.61 - 		      "   " __ARCH_ACQ_INSTR				      \
   92.62 --		      : "=&r" (__val), "=m" (*mem)			      \
   92.63 --		      : "b" (mem), "r" (value), "m" (*mem)		      \
   92.64 -+		      : "=&r" (__val), "+Z" (*mem)			      \
   92.65 -+		      : "r" (value)					      \
   92.66 - 		      : "cr0", "memory");				      \
   92.67 -     __val;								      \
   92.68 -   })
   92.69 -@@ -132,11 +132,11 @@
   92.70 -   ({									      \
   92.71 -     __typeof (*mem) __val;						      \
   92.72 -     __asm __volatile (__ARCH_REL_INSTR "\n"				      \
   92.73 --		      "1:	lwarx	%0,0,%2" MUTEX_HINT_REL "\n"	      \
   92.74 --		      "		stwcx.	%3,0,%2\n"			      \
   92.75 -+		      "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
   92.76 -+		      "		stwcx.	%2,%y1\n"			      \
   92.77 - 		      "		bne-	1b"				      \
   92.78 --		      : "=&r" (__val), "=m" (*mem)			      \
   92.79 --		      : "b" (mem), "r" (value), "m" (*mem)		      \
   92.80 -+		      : "=&r" (__val), "+Z" (*mem)			      \
   92.81 -+		      : "r" (value)					      \
   92.82 - 		      : "cr0", "memory");				      \
   92.83 -     __val;								      \
   92.84 -   })
   92.85 -@@ -144,12 +144,12 @@
   92.86 - #define __arch_atomic_exchange_and_add_32(mem, value) \
   92.87 -   ({									      \
   92.88 -     __typeof (*mem) __val, __tmp;					      \
   92.89 --    __asm __volatile ("1:	lwarx	%0,0,%3\n"			      \
   92.90 --		      "		add	%1,%0,%4\n"			      \
   92.91 --		      "		stwcx.	%1,0,%3\n"			      \
   92.92 -+    __asm __volatile ("1:	lwarx	%0,%y2\n"			      \
   92.93 -+		      "		add	%1,%0,%3\n"			      \
   92.94 -+		      "		stwcx.	%1,%y2\n"			      \
   92.95 - 		      "		bne-	1b"				      \
   92.96 --		      : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
   92.97 --		      : "b" (mem), "r" (value), "m" (*mem)		      \
   92.98 -+		      : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem)	      \
   92.99 -+		      : "r" (value)					      \
  92.100 - 		      : "cr0", "memory");				      \
  92.101 -     __val;								      \
  92.102 -   })
  92.103 -@@ -157,12 +157,12 @@
  92.104 - #define __arch_atomic_increment_val_32(mem) \
  92.105 -   ({									      \
  92.106 -     __typeof (*(mem)) __val;						      \
  92.107 --    __asm __volatile ("1:	lwarx	%0,0,%2\n"			      \
  92.108 -+    __asm __volatile ("1:	lwarx	%0,%y1\n"			      \
  92.109 - 		      "		addi	%0,%0,1\n"			      \
  92.110 --		      "		stwcx.	%0,0,%2\n"			      \
  92.111 -+		      "		stwcx.	%0,%y1\n"			      \
  92.112 - 		      "		bne-	1b"				      \
  92.113 --		      : "=&b" (__val), "=m" (*mem)			      \
  92.114 --		      : "b" (mem), "m" (*mem)				      \
  92.115 -+		      : "=&b" (__val), "+Z" (*mem)			      \
  92.116 -+		      :							      \
  92.117 - 		      : "cr0", "memory");				      \
  92.118 -     __val;								      \
  92.119 -   })
  92.120 -@@ -170,27 +170,27 @@
  92.121 - #define __arch_atomic_decrement_val_32(mem) \
  92.122 -   ({									      \
  92.123 -     __typeof (*(mem)) __val;						      \
  92.124 --    __asm __volatile ("1:	lwarx	%0,0,%2\n"			      \
  92.125 -+    __asm __volatile ("1:	lwarx	%0,%y1\n"			      \
  92.126 - 		      "		subi	%0,%0,1\n"			      \
  92.127 --		      "		stwcx.	%0,0,%2\n"			      \
  92.128 -+		      "		stwcx.	%0,%y1\n"			      \
  92.129 - 		      "		bne-	1b"				      \
  92.130 --		      : "=&b" (__val), "=m" (*mem)			      \
  92.131 --		      : "b" (mem), "m" (*mem)				      \
  92.132 -+		      : "=&b" (__val), "+Z" (*mem)			      \
  92.133 -+		      :							      \
  92.134 - 		      : "cr0", "memory");				      \
  92.135 -     __val;								      \
  92.136 -   })
  92.137 - 
  92.138 - #define __arch_atomic_decrement_if_positive_32(mem) \
  92.139 -   ({ int __val, __tmp;							      \
  92.140 --     __asm __volatile ("1:	lwarx	%0,0,%3\n"			      \
  92.141 -+     __asm __volatile ("1:	lwarx	%0,%y2\n"			      \
  92.142 - 		       "	cmpwi	0,%0,0\n"			      \
  92.143 - 		       "	addi	%1,%0,-1\n"			      \
  92.144 - 		       "	ble	2f\n"				      \
  92.145 --		       "	stwcx.	%1,0,%3\n"			      \
  92.146 -+		       "	stwcx.	%1,%y2\n"			      \
  92.147 - 		       "	bne-	1b\n"				      \
  92.148 - 		       "2:	" __ARCH_ACQ_INSTR			      \
  92.149 --		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  92.150 --		       : "b" (mem), "m" (*mem)				      \
  92.151 -+		       : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem)	      \
  92.152 -+		       :						      \
  92.153 - 		       : "cr0", "memory");				      \
  92.154 -      __val;								      \
  92.155 -   })
  92.156 -diff -durN glibc-2_9.orig/sysdeps/powerpc/powerpc32/bits/atomic.h glibc-2_9/sysdeps/powerpc/powerpc32/bits/atomic.h
  92.157 ---- glibc-2_9.orig/sysdeps/powerpc/powerpc32/bits/atomic.h	2007-03-26 22:15:45.000000000 +0200
  92.158 -+++ glibc-2_9/sysdeps/powerpc/powerpc32/bits/atomic.h	2009-02-02 22:01:40.000000000 +0100
  92.159 -@@ -44,14 +44,14 @@
  92.160 - ({									      \
  92.161 -   unsigned int __tmp;							      \
  92.162 -   __asm __volatile (							      \
  92.163 --		    "1:	lwarx	%0,0,%1" MUTEX_HINT_ACQ "\n"		      \
  92.164 -+		    "1:	lwarx	%0,%y1" MUTEX_HINT_ACQ "\n"		      \
  92.165 - 		    "	subf.	%0,%2,%0\n"				      \
  92.166 - 		    "	bne	2f\n"					      \
  92.167 --		    "	stwcx.	%3,0,%1\n"				      \
  92.168 -+		    "	stwcx.	%3,%y1\n"				      \
  92.169 - 		    "	bne-	1b\n"					      \
  92.170 - 		    "2:	" __ARCH_ACQ_INSTR				      \
  92.171 --		    : "=&r" (__tmp)					      \
  92.172 --		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  92.173 -+		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  92.174 -+		    : "r" (oldval), "r" (newval)			      \
  92.175 - 		    : "cr0", "memory");					      \
  92.176 -   __tmp != 0;								      \
  92.177 - })
  92.178 -@@ -60,14 +60,14 @@
  92.179 - ({									      \
  92.180 -   unsigned int __tmp;							      \
  92.181 -   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  92.182 --		    "1:	lwarx	%0,0,%1" MUTEX_HINT_REL "\n"		      \
  92.183 -+		    "1:	lwarx	%0,%y1" MUTEX_HINT_REL "\n"		      \
  92.184 - 		    "	subf.	%0,%2,%0\n"				      \
  92.185 - 		    "	bne	2f\n"					      \
  92.186 --		    "	stwcx.	%3,0,%1\n"				      \
  92.187 -+		    "	stwcx.	%3,%y1\n"				      \
  92.188 - 		    "	bne-	1b\n"					      \
  92.189 - 		    "2:	"						      \
  92.190 --		    : "=&r" (__tmp)					      \
  92.191 --		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  92.192 -+		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  92.193 -+		    : "r" (oldval), "r" (newval)			      \
  92.194 - 		    : "cr0", "memory");					      \
  92.195 -   __tmp != 0;								      \
  92.196 - })
  92.197 -diff -durN glibc-2_9.orig/sysdeps/powerpc/powerpc64/bits/atomic.h glibc-2_9/sysdeps/powerpc/powerpc64/bits/atomic.h
  92.198 ---- glibc-2_9.orig/sysdeps/powerpc/powerpc64/bits/atomic.h	2007-03-26 22:16:03.000000000 +0200
  92.199 -+++ glibc-2_9/sysdeps/powerpc/powerpc64/bits/atomic.h	2009-02-02 22:01:40.000000000 +0100
  92.200 -@@ -44,14 +44,14 @@
  92.201 - ({									      \
  92.202 -   unsigned int __tmp, __tmp2;						      \
  92.203 -   __asm __volatile ("   clrldi  %1,%1,32\n"				      \
  92.204 --		    "1:	lwarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	 	      \
  92.205 -+		    "1:	lwarx	%0,%y2" MUTEX_HINT_ACQ "\n"	 	      \
  92.206 - 		    "	subf.	%0,%1,%0\n"				      \
  92.207 - 		    "	bne	2f\n"					      \
  92.208 --		    "	stwcx.	%4,0,%2\n"				      \
  92.209 -+		    "	stwcx.	%4,%y2\n"				      \
  92.210 - 		    "	bne-	1b\n"					      \
  92.211 - 		    "2:	" __ARCH_ACQ_INSTR				      \
  92.212 --		    : "=&r" (__tmp), "=r" (__tmp2)			      \
  92.213 --		    : "b" (mem), "1" (oldval), "r" (newval)		      \
  92.214 -+		    : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem))	      \
  92.215 -+		    : "1" (oldval), "r" (newval)			      \
  92.216 - 		    : "cr0", "memory");					      \
  92.217 -   __tmp != 0;								      \
  92.218 - })
  92.219 -@@ -61,14 +61,14 @@
  92.220 -   unsigned int __tmp, __tmp2;						      \
  92.221 -   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  92.222 - 		    "   clrldi  %1,%1,32\n"				      \
  92.223 --		    "1:	lwarx	%0,0,%2" MUTEX_HINT_REL "\n"		      \
  92.224 -+		    "1:	lwarx	%0,%y2" MUTEX_HINT_REL "\n"		      \
  92.225 - 		    "	subf.	%0,%1,%0\n"				      \
  92.226 - 		    "	bne	2f\n"					      \
  92.227 --		    "	stwcx.	%4,0,%2\n"				      \
  92.228 -+		    "	stwcx.	%4,%y2\n"				      \
  92.229 - 		    "	bne-	1b\n"					      \
  92.230 - 		    "2:	"						      \
  92.231 --		    : "=&r" (__tmp), "=r" (__tmp2)			      \
  92.232 --		    : "b" (mem), "1" (oldval), "r" (newval)		      \
  92.233 -+		    : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem))	      \
  92.234 -+		    : "1" (oldval), "r" (newval)			      \
  92.235 - 		    : "cr0", "memory");					      \
  92.236 -   __tmp != 0;								      \
  92.237 - })
  92.238 -@@ -82,14 +82,14 @@
  92.239 - ({									      \
  92.240 -   unsigned long	__tmp;							      \
  92.241 -   __asm __volatile (							      \
  92.242 --		    "1:	ldarx	%0,0,%1" MUTEX_HINT_ACQ "\n"		      \
  92.243 -+		    "1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"		      \
  92.244 - 		    "	subf.	%0,%2,%0\n"				      \
  92.245 - 		    "	bne	2f\n"					      \
  92.246 --		    "	stdcx.	%3,0,%1\n"				      \
  92.247 -+		    "	stdcx.	%3,%y1\n"				      \
  92.248 - 		    "	bne-	1b\n"					      \
  92.249 - 		    "2:	" __ARCH_ACQ_INSTR				      \
  92.250 --		    : "=&r" (__tmp)					      \
  92.251 --		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  92.252 -+		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  92.253 -+		    : "r" (oldval), "r" (newval)			      \
  92.254 - 		    : "cr0", "memory");					      \
  92.255 -   __tmp != 0;								      \
  92.256 - })
  92.257 -@@ -98,14 +98,14 @@
  92.258 - ({									      \
  92.259 -   unsigned long	__tmp;							      \
  92.260 -   __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  92.261 --		    "1:	ldarx	%0,0,%2" MUTEX_HINT_REL "\n"		      \
  92.262 -+		    "1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"		      \
  92.263 - 		    "	subf.	%0,%2,%0\n"				      \
  92.264 - 		    "	bne	2f\n"					      \
  92.265 --		    "	stdcx.	%3,0,%1\n"				      \
  92.266 -+		    "	stdcx.	%3,%y1\n"				      \
  92.267 - 		    "	bne-	1b\n"					      \
  92.268 - 		    "2:	"						      \
  92.269 --		    : "=&r" (__tmp)					      \
  92.270 --		    : "b" (mem), "r" (oldval), "r" (newval)		      \
  92.271 -+		    : "=&r" (__tmp), "+Z" (*(mem))			      \
  92.272 -+		    : "r" (oldval), "r" (newval)			      \
  92.273 - 		    : "cr0", "memory");					      \
  92.274 -   __tmp != 0;								      \
  92.275 - })
  92.276 -@@ -115,14 +115,14 @@
  92.277 -       __typeof (*(mem)) __tmp;						      \
  92.278 -       __typeof (mem)  __memp = (mem);					      \
  92.279 -       __asm __volatile (						      \
  92.280 --		        "1:	ldarx	%0,0,%1" MUTEX_HINT_ACQ "\n"	      \
  92.281 -+		        "1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
  92.282 - 		        "	cmpd	%0,%2\n"			      \
  92.283 - 		        "	bne	2f\n"				      \
  92.284 --		        "	stdcx.	%3,0,%1\n"			      \
  92.285 -+		        "	stdcx.	%3,%y1\n"			      \
  92.286 - 		        "	bne-	1b\n"				      \
  92.287 - 		        "2:	" __ARCH_ACQ_INSTR			      \
  92.288 --		        : "=&r" (__tmp)					      \
  92.289 --		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
  92.290 -+		        : "=&r" (__tmp), "+Z" (*__memp)			      \
  92.291 -+		        : "r" (oldval), "r" (newval)			      \
  92.292 - 		        : "cr0", "memory");				      \
  92.293 -       __tmp;								      \
  92.294 -   })
  92.295 -@@ -132,14 +132,14 @@
  92.296 -       __typeof (*(mem)) __tmp;						      \
  92.297 -       __typeof (mem)  __memp = (mem);					      \
  92.298 -       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  92.299 --		        "1:	ldarx	%0,0,%1" MUTEX_HINT_REL "\n"	      \
  92.300 -+		        "1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
  92.301 - 		        "	cmpd	%0,%2\n"			      \
  92.302 - 		        "	bne	2f\n"				      \
  92.303 --		        "	stdcx.	%3,0,%1\n"			      \
  92.304 -+		        "	stdcx.	%3,%y1\n"			      \
  92.305 - 		        "	bne-	1b\n"				      \
  92.306 - 		        "2:	"					      \
  92.307 --		        : "=&r" (__tmp)					      \
  92.308 --		        : "b" (__memp), "r" (oldval), "r" (newval)	      \
  92.309 -+		        : "=&r" (__tmp), "+Z" (*__memp)			      \
  92.310 -+		        : "r" (oldval), "r" (newval)			      \
  92.311 - 		        : "cr0", "memory");				      \
  92.312 -       __tmp;								      \
  92.313 -   })
  92.314 -@@ -148,12 +148,12 @@
  92.315 -     ({									      \
  92.316 -       __typeof (*mem) __val;						      \
  92.317 -       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  92.318 --			"1:	ldarx	%0,0,%2" MUTEX_HINT_ACQ "\n"	      \
  92.319 --			"	stdcx.	%3,0,%2\n"			      \
  92.320 -+			"1:	ldarx	%0,%y1" MUTEX_HINT_ACQ "\n"	      \
  92.321 -+			"	stdcx.	%2,%y1\n"			      \
  92.322 - 			"	bne-	1b\n"				      \
  92.323 - 		  " " __ARCH_ACQ_INSTR					      \
  92.324 --			: "=&r" (__val), "=m" (*mem)			      \
  92.325 --			: "b" (mem), "r" (value), "m" (*mem)		      \
  92.326 -+			: "=&r" (__val), "+Z" (*(mem))			      \
  92.327 -+			: "r" (value)					      \
  92.328 - 			: "cr0", "memory");				      \
  92.329 -       __val;								      \
  92.330 -     })
  92.331 -@@ -162,11 +162,11 @@
  92.332 -     ({									      \
  92.333 -       __typeof (*mem) __val;						      \
  92.334 -       __asm __volatile (__ARCH_REL_INSTR "\n"				      \
  92.335 --			"1:	ldarx	%0,0,%2" MUTEX_HINT_REL "\n"	      \
  92.336 --			"	stdcx.	%3,0,%2\n"			      \
  92.337 -+			"1:	ldarx	%0,%y1" MUTEX_HINT_REL "\n"	      \
  92.338 -+			"	stdcx.	%2,%y1\n"			      \
  92.339 - 			"	bne-	1b"				      \
  92.340 --			: "=&r" (__val), "=m" (*mem)			      \
  92.341 --			: "b" (mem), "r" (value), "m" (*mem)		      \
  92.342 -+			: "=&r" (__val), "+Z" (*(mem))			      \
  92.343 -+			: "r" (value)					      \
  92.344 - 			: "cr0", "memory");				      \
  92.345 -       __val;								      \
  92.346 -     })
  92.347 -@@ -174,12 +174,12 @@
  92.348 - #define __arch_atomic_exchange_and_add_64(mem, value) \
  92.349 -     ({									      \
  92.350 -       __typeof (*mem) __val, __tmp;					      \
  92.351 --      __asm __volatile ("1:	ldarx	%0,0,%3\n"			      \
  92.352 --			"	add	%1,%0,%4\n"			      \
  92.353 --			"	stdcx.	%1,0,%3\n"			      \
  92.354 -+      __asm __volatile ("1:	ldarx	%0,%y2\n"			      \
  92.355 -+			"	add	%1,%0,%3\n"			      \
  92.356 -+			"	stdcx.	%1,%y2\n"			      \
  92.357 - 			"	bne-	1b"				      \
  92.358 --			: "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  92.359 --			: "b" (mem), "r" (value), "m" (*mem)		      \
  92.360 -+			: "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem))	      \
  92.361 -+			: "r" (value)					      \
  92.362 - 			: "cr0", "memory");				      \
  92.363 -       __val;								      \
  92.364 -     })
  92.365 -@@ -187,12 +187,12 @@
  92.366 - #define __arch_atomic_increment_val_64(mem) \
  92.367 -     ({									      \
  92.368 -       __typeof (*(mem)) __val;						      \
  92.369 --      __asm __volatile ("1:	ldarx	%0,0,%2\n"			      \
  92.370 -+      __asm __volatile ("1:	ldarx	%0,%y1\n"			      \
  92.371 - 			"	addi	%0,%0,1\n"			      \
  92.372 --			"	stdcx.	%0,0,%2\n"			      \
  92.373 -+			"	stdcx.	%0,%y1\n"			      \
  92.374 - 			"	bne-	1b"				      \
  92.375 --			: "=&b" (__val), "=m" (*mem)			      \
  92.376 --			: "b" (mem), "m" (*mem)				      \
  92.377 -+			: "=&b" (__val), "+Z" (*(mem))			      \
  92.378 -+			:						      \
  92.379 - 			: "cr0", "memory");				      \
  92.380 -       __val;								      \
  92.381 -     })
  92.382 -@@ -200,27 +200,27 @@
  92.383 - #define __arch_atomic_decrement_val_64(mem) \
  92.384 -     ({									      \
  92.385 -       __typeof (*(mem)) __val;						      \
  92.386 --      __asm __volatile ("1:	ldarx	%0,0,%2\n"			      \
  92.387 -+      __asm __volatile ("1:	ldarx	%0,%y1\n"			      \
  92.388 - 			"	subi	%0,%0,1\n"			      \
  92.389 --			"	stdcx.	%0,0,%2\n"			      \
  92.390 -+			"	stdcx.	%0,%y1\n"			      \
  92.391 - 			"	bne-	1b"				      \
  92.392 --			: "=&b" (__val), "=m" (*mem)			      \
  92.393 --			: "b" (mem), "m" (*mem)				      \
  92.394 -+			: "=&b" (__val), "+Z" (*(mem))			      \
  92.395 -+			:						      \
  92.396 - 			: "cr0", "memory");				      \
  92.397 -       __val;								      \
  92.398 -     })
  92.399 - 
  92.400 - #define __arch_atomic_decrement_if_positive_64(mem) \
  92.401 -   ({ int __val, __tmp;							      \
  92.402 --     __asm __volatile ("1:	ldarx	%0,0,%3\n"			      \
  92.403 -+     __asm __volatile ("1:	ldarx	%0,%y2\n"			      \
  92.404 - 		       "	cmpdi	0,%0,0\n"			      \
  92.405 - 		       "	addi	%1,%0,-1\n"			      \
  92.406 - 		       "	ble	2f\n"				      \
  92.407 --		       "	stdcx.	%1,0,%3\n"			      \
  92.408 -+		       "	stdcx.	%1,%y2\n"			      \
  92.409 - 		       "	bne-	1b\n"				      \
  92.410 - 		       "2:	" __ARCH_ACQ_INSTR			      \
  92.411 --		       : "=&b" (__val), "=&r" (__tmp), "=m" (*mem)	      \
  92.412 --		       : "b" (mem), "m" (*mem)				      \
  92.413 -+		       : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem))	      \
  92.414 -+		       :						      \
  92.415 - 		       : "cr0", "memory");				      \
  92.416 -      __val;								      \
  92.417 -   })
    93.1 --- a/patches/glibc/2_9/510-sh-no-asm-user-header.patch	Sat Apr 11 19:03:02 2009 +0000
    93.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.3 @@ -1,70 +0,0 @@
    93.4 -2007-03-13  Mike Frysinger  <vapier@gentoo.org>
    93.5 -
    93.6 -	* sysdeps/unix/sysv/linux/sh/sys/user.h: Copy Linux's asm-sh/user.h.
    93.7 -
    93.8 ---- glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/user.h
    93.9 -+++ glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/user.h
   93.10 -@@ -19,10 +19,60 @@
   93.11 - #ifndef _SYS_USER_H
   93.12 - #define _SYS_USER_H	1
   93.13 - 
   93.14 --#include <features.h>
   93.15 -+#include <unistd.h>
   93.16 -+#include <asm/ptrace.h>
   93.17 - 
   93.18 --#include <asm/user.h>
   93.19 -+/*
   93.20 -+ * Core file format: The core file is written in such a way that gdb
   93.21 -+ * can understand it and provide useful information to the user (under
   93.22 -+ * linux we use the `trad-core' bfd).  The file contents are as follows:
   93.23 -+ *
   93.24 -+ *  upage: 1 page consisting of a user struct that tells gdb
   93.25 -+ *	what is present in the file.  Directly after this is a
   93.26 -+ *	copy of the task_struct, which is currently not used by gdb,
   93.27 -+ *	but it may come in handy at some point.  All of the registers
   93.28 -+ *	are stored as part of the upage.  The upage should always be
   93.29 -+ *	only one page long.
   93.30 -+ *  data: The data segment follows next.  We use current->end_text to
   93.31 -+ *	current->brk to pick up all of the user variables, plus any memory
   93.32 -+ *	that may have been sbrk'ed.  No attempt is made to determine if a
   93.33 -+ *	page is demand-zero or if a page is totally unused, we just cover
   93.34 -+ *	the entire range.  All of the addresses are rounded in such a way
   93.35 -+ *	that an integral number of pages is written.
   93.36 -+ *  stack: We need the stack information in order to get a meaningful
   93.37 -+ *	backtrace.  We need to write the data from usp to
   93.38 -+ *	current->start_stack, so we round each of these in order to be able
   93.39 -+ *	to write an integer number of pages.
   93.40 -+ */
   93.41 - 
   93.42 --#undef start_thread
   93.43 -+struct user_fpu_struct {
   93.44 -+	unsigned long fp_regs[16];
   93.45 -+	unsigned long xfp_regs[16];
   93.46 -+	unsigned long fpscr;
   93.47 -+	unsigned long fpul;
   93.48 -+};
   93.49 -+
   93.50 -+struct user {
   93.51 -+	struct pt_regs	regs;			/* entire machine state */
   93.52 -+	struct user_fpu_struct fpu;	/* Math Co-processor registers  */
   93.53 -+	int u_fpvalid;		/* True if math co-processor being used */
   93.54 -+	size_t		u_tsize;		/* text size (pages) */
   93.55 -+	size_t		u_dsize;		/* data size (pages) */
   93.56 -+	size_t		u_ssize;		/* stack size (pages) */
   93.57 -+	unsigned long	start_code;		/* text starting address */
   93.58 -+	unsigned long	start_data;		/* data starting address */
   93.59 -+	unsigned long	start_stack;		/* stack starting address */
   93.60 -+	long int	signal;			/* signal causing core dump */
   93.61 -+	struct regs *	u_ar0;			/* help gdb find registers */
   93.62 -+	struct user_fpu_struct* u_fpstate;	/* Math Co-processor pointer */
   93.63 -+	unsigned long	magic;			/* identifies a core file */
   93.64 -+	char		u_comm[32];		/* user command name */
   93.65 -+};
   93.66 -+
   93.67 -+#define NBPG			getpagesize()
   93.68 -+#define UPAGES			1
   93.69 -+#define HOST_TEXT_START_ADDR	(u.start_code)
   93.70 -+#define HOST_DATA_START_ADDR	(u.start_data)
   93.71 -+#define HOST_STACK_END_ADDR	(u.start_stack + u.u_ssize * NBPG)
   93.72 - 
   93.73 - #endif  /* sys/user.h */
    94.1 --- a/patches/glibc/2_9/520-sh-no-asm-elf-header.patch	Sat Apr 11 19:03:02 2009 +0000
    94.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.3 @@ -1,27 +0,0 @@
    94.4 -2007-03-13  Mike Frysinger  <vapier@gentoo.org>
    94.5 -
    94.6 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Copy Linux's asm-sh/elf.h types.
    94.7 -
    94.8 ---- glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    94.9 -+++ glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/procfs.h
   94.10 -@@ -29,10 +29,19 @@
   94.11 - #include <sys/types.h>
   94.12 - #include <sys/ucontext.h>
   94.13 - #include <sys/user.h>
   94.14 --#include <asm/elf.h>
   94.15 - 
   94.16 - __BEGIN_DECLS
   94.17 - 
   94.18 -+/*
   94.19 -+ * ELF register definitions...
   94.20 -+ */
   94.21 -+typedef unsigned long elf_greg_t;
   94.22 -+
   94.23 -+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
   94.24 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
   94.25 -+
   94.26 -+typedef struct user_fpu_struct elf_fpregset_t;
   94.27 -+
   94.28 - struct elf_siginfo
   94.29 -   {
   94.30 -     int si_signo;			/* Signal number.  */
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/patches/glibc/ports-2.9/100-arm_linux_tls.patch	Sun Apr 19 16:17:11 2009 +0000
    95.3 @@ -0,0 +1,14 @@
    95.4 +Original patch from http://www.nabble.com/arm-linux-compilation-failure-and-possible-fix-td19229074.html
    95.5 +
    95.6 +diff -durN glibc-2.9.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h glibc-2.9/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
    95.7 +--- glibc-2.9.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 25 Nov 2008 16:37:26 -0000 1.33
    95.8 ++++ glibc-2.9/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 27 Jan 2009 15:35:38 -0000
    95.9 +@@ -28,6 +28,8 @@
   95.10 + /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
   95.11 + #include <dl-sysdep.h>
   95.12 + 
   95.13 ++#include <tls.h>
   95.14 ++
   95.15 + /* For Linux we can use the system call table in the header file
   95.16 +	/usr/include/asm/unistd.h
   95.17 +    of the kernel.  But these symbols do not follow the SYS_* syntax 
    96.1 --- a/patches/glibc/ports-2_9/100-arm_linux_tls.patch	Sat Apr 11 19:03:02 2009 +0000
    96.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.3 @@ -1,14 +0,0 @@
    96.4 -Original patch from http://www.nabble.com/arm-linux-compilation-failure-and-possible-fix-td19229074.html
    96.5 -
    96.6 -diff -durN glibc-2_9.orig/glibc-ports-2_9/sysdeps/unix/sysv/linux/arm/sysdep.h glibc-2_9/glibc-ports-2_9/sysdeps/unix/sysv/linux/arm/sysdep.h
    96.7 ---- glibc-2_9.orig/glibc-ports-2_9/sysdeps/unix/sysv/linux/arm/sysdep.h 25 Nov 2008 16:37:26 -0000 1.33
    96.8 -+++ glibc-2_9/glibc-ports-2_9/sysdeps/unix/sysv/linux/arm/sysdep.h 27 Jan 2009 15:35:38 -0000
    96.9 -@@ -28,6 +28,8 @@
   96.10 - /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
   96.11 - #include <dl-sysdep.h>
   96.12 - 
   96.13 -+#include <tls.h>
   96.14 -+
   96.15 - /* For Linux we can use the system call table in the header file
   96.16 -	/usr/include/asm/unistd.h
   96.17 -    of the kernel.  But these symbols do not follow the SYS_* syntax 
    97.1 --- a/patches/uClibc/0.9.30.1/140-gnu89-inline.patch	Sat Apr 11 19:03:02 2009 +0000
    97.2 +++ b/patches/uClibc/0.9.30.1/140-gnu89-inline.patch	Sun Apr 19 16:17:11 2009 +0000
    97.3 @@ -6,7 +6,7 @@
    97.4  diff -durN uClibc-0.9.30.orig/Rules.mak uClibc-0.9.30/Rules.mak
    97.5  --- uClibc-0.9.30.orig/Rules.mak	2008-11-12 13:24:16.000000000 +0100
    97.6  +++ uClibc-0.9.30/Rules.mak	2009-02-07 09:57:59.000000000 +0100
    97.7 -@@ -502,6 +502,7 @@
    97.8 +@@ -519,6 +519,7 @@
    97.9   endif
   97.10   
   97.11   CFLAGS += $(call check_gcc,-std=gnu99,)