summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/cc/gcc.in11
-rw-r--r--config/cc/gcc.in.211
-rw-r--r--config/libc/uClibc.in20
-rw-r--r--config/libc/uClibc.in.24
-rw-r--r--patches/ELFkickers/2.0a/100-use_CC_not_gcc.patch12
-rw-r--r--patches/cygwin/1.5.15-1/100-crossbuild.patch40
-rw-r--r--patches/duma/2_5_1/100-cross-compile.patch32
-rw-r--r--patches/duma/2_5_1/110-separate_cpp.patch20
-rw-r--r--patches/duma/2_5_12/100-cross-compile.patch31
-rw-r--r--patches/duma/2_5_12/110-separate_cpp.patch19
-rw-r--r--patches/duma/2_5_14/100-cross-compile.patch32
-rw-r--r--patches/duma/2_5_14/110-separate_cpp.patch19
-rw-r--r--patches/duma/2_5_8/100-cross-compile.patch31
-rw-r--r--patches/duma/2_5_8/110-separate_cpp.patch19
-rw-r--r--patches/gcc/4.9.3/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch29
-rw-r--r--patches/gcc/6.2.0/100-uclibc-conf.patch (renamed from patches/gcc/6.1.0/100-uclibc-conf.patch)0
-rw-r--r--patches/gcc/6.2.0/301-missing-execinfo_h.patch (renamed from patches/gcc/6.1.0/301-missing-execinfo_h.patch)0
-rw-r--r--patches/gcc/6.2.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (renamed from patches/gcc/6.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch)0
-rw-r--r--patches/gcc/6.2.0/380-gcc-plugin-POSIX-include-sys-select-h.patch (renamed from patches/gcc/6.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch)0
-rw-r--r--patches/gcc/6.2.0/810-arm-softfloat-libgcc.patch (renamed from patches/gcc/6.1.0/810-arm-softfloat-libgcc.patch)0
-rw-r--r--patches/gcc/6.2.0/830-arm_unbreak_armv4t.patch (renamed from patches/gcc/6.1.0/830-arm_unbreak_armv4t.patch)0
-rw-r--r--patches/gcc/6.2.0/840-microblaze-enable-dwarf-eh-support.patch (renamed from patches/gcc/6.1.0/840-microblaze-enable-dwarf-eh-support.patch)0
-rw-r--r--patches/gcc/6.2.0/860-cilk-wchar.patch (renamed from patches/gcc/6.1.0/860-cilk-wchar.patch)0
-rw-r--r--patches/glibc/2.10.1/900-march-i686.patch34
-rw-r--r--patches/glibc/2.10.1/910-typedef-caddr.patch28
-rw-r--r--patches/glibc/2.10.1/920-make-382.patch16
-rw-r--r--patches/glibc/2.11.1/900-march-i686.patch34
-rw-r--r--patches/glibc/2.11.1/910-typedef-caddr.patch28
-rw-r--r--patches/glibc/2.11/900-march-i686.patch34
-rw-r--r--patches/glibc/2.11/910-typedef-caddr.patch28
-rw-r--r--patches/glibc/2.11/920-make-40.patch12
-rw-r--r--patches/glibc/2.12.1/900-march-i686.patch34
-rw-r--r--patches/glibc/2.12.1/910-typedef-caddr.patch28
-rw-r--r--patches/glibc/2.12.1/920-make-382.patch15
-rw-r--r--patches/glibc/2.12.2/900-march-i686.patch34
-rw-r--r--patches/glibc/2.12.2/910-typedef-caddr.patch28
-rw-r--r--patches/glibc/2.13/900-march-i686.patch34
-rw-r--r--patches/glibc/2.13/910-typedef-caddr.patch28
-rw-r--r--patches/glibc/2.13/950-initfini-ppc64.patch20
-rw-r--r--patches/glibc/2.14.1/900-cpuid-include.patch628
-rw-r--r--patches/glibc/2.14.1/910-asm-i686.patch50
-rw-r--r--patches/glibc/2.14.1/950-initfini-ppc64.patch20
-rw-r--r--patches/glibc/2.14/950-initfini-ppc64.patch20
-rw-r--r--patches/glibc/2.16.0/500-fix-parsing-of-numeric-hosts-in-gethostbyname_r.patch222
-rw-r--r--patches/glibc/2.17/100-Fix-ARM-build-with-GCC-trunk.patch54
-rw-r--r--patches/glibc/2.18/120-support-make4.patch38
-rw-r--r--patches/glibc/2.18/130-arm-unwind.patch48
-rw-r--r--patches/glibc/2.19/130-arm-unwind.patch48
-rw-r--r--patches/glibc/2.5.1/100-cygwin.patch187
-rw-r--r--patches/glibc/2.5.1/110-configure-apple-as.patch25
-rw-r--r--patches/glibc/2.5.1/120-fix-pr631.patch45
-rw-r--r--patches/glibc/2.5.1/130-i686-assembler.patch38
-rw-r--r--patches/glibc/2.5.1/140-i386-preferred-stack-boundary.patch18
-rw-r--r--patches/glibc/2.5.1/150-alpha-asm_page.patch26
-rw-r--r--patches/glibc/2.5.1/160-use_short_for_fnstsw.patch18
-rw-r--r--patches/glibc/2.5.1/170-alpha-asm_elf.patch194
-rw-r--r--patches/glibc/2.5.1/180-alpha-cfi.patch25
-rw-r--r--patches/glibc/2.5.1/190-alpha-sigsuspend.patch24
-rw-r--r--patches/glibc/2.5/100-cygwin.patch187
-rw-r--r--patches/glibc/2.5/110-configure-apple-as.patch25
-rw-r--r--patches/glibc/2.5/120-fix-pr631.patch45
-rw-r--r--patches/glibc/2.5/130-i686-assembler.patch38
-rw-r--r--patches/glibc/2.5/140-i386-preferred-stack-boundary.patch18
-rw-r--r--patches/glibc/2.5/150-alpha-asm_page.patch26
-rw-r--r--patches/glibc/2.5/160-use_short_for_fnstsw.patch18
-rw-r--r--patches/glibc/2.5/170-alpha-asm_elf.patch194
-rw-r--r--patches/glibc/2.5/180-alpha-cfi.patch25
-rw-r--r--patches/glibc/2.5/190-alpha-sigsuspend.patch24
-rw-r--r--patches/glibc/2.6.1/100-cygwin.patch187
-rw-r--r--patches/glibc/2.6.1/110-configure-apple-as.patch25
-rw-r--r--patches/glibc/2.6.1/120-fix-pr631.patch45
-rw-r--r--patches/glibc/2.6.1/130-i686-assembler.patch38
-rw-r--r--patches/glibc/2.6.1/140-i386-preferred-stack-boundary.patch18
-rw-r--r--patches/glibc/2.6.1/150-alpha-asm_page.patch26
-rw-r--r--patches/glibc/2.6.1/160-use_short_for_fnstsw.patch18
-rw-r--r--patches/glibc/2.6.1/170-alpha-asm_elf.patch194
-rw-r--r--patches/glibc/2.6.1/180-gcc-4.3-sysinclude-path.patch50
-rw-r--r--patches/glibc/2.6.1/190-alpha-atfcts.patch11
-rw-r--r--patches/glibc/2.6.1/200-alpha-ptr_mangle.patch103
-rw-r--r--patches/glibc/2.6.1/210-lll_lock_t.patch237
-rw-r--r--patches/glibc/2.6.1/220-cross-posix_makefile.patch65
-rw-r--r--patches/glibc/2.6/100-cygwin.patch187
-rw-r--r--patches/glibc/2.6/110-configure-apple-as.patch25
-rw-r--r--patches/glibc/2.6/120-fix-pr631.patch45
-rw-r--r--patches/glibc/2.6/130-i686-assembler.patch38
-rw-r--r--patches/glibc/2.6/140-i386-preferred-stack-boundary.patch18
-rw-r--r--patches/glibc/2.6/150-alpha-asm_page.patch26
-rw-r--r--patches/glibc/2.6/160-use_short_for_fnstsw.patch18
-rw-r--r--patches/glibc/2.6/170-alpha-asm_elf.patch194
-rw-r--r--patches/glibc/2.6/180-gcc-4.3-sysinclude-path.patch50
-rw-r--r--patches/glibc/2.6/190-alpha-atfcts.patch11
-rw-r--r--patches/glibc/2.6/200-alpha-ptr_mangle.patch103
-rw-r--r--patches/glibc/2.6/210-lll_lock_t.patch237
-rw-r--r--patches/glibc/2.6/220-cross-posix_makefile.patch65
-rw-r--r--patches/glibc/2.7/100-cygwin.patch185
-rw-r--r--patches/glibc/2.7/110-configure-apple-as.patch26
-rw-r--r--patches/glibc/2.7/120-fix-pr631.patch43
-rw-r--r--patches/glibc/2.7/130-i686-assembler.patch43
-rw-r--r--patches/glibc/2.7/140-i386-preferred-stack-boundary.patch18
-rw-r--r--patches/glibc/2.7/150-alpha-asm_page.patch26
-rw-r--r--patches/glibc/2.7/160-build_wcs_upper_buffer.patch22
-rw-r--r--patches/glibc/2.7/170-use_short_for_fnstsw.patch18
-rw-r--r--patches/glibc/2.7/180-gcc-4.3-sysinclude-path.patch50
-rw-r--r--patches/glibc/2.7/190-alpha-asm_elf.patch171
-rw-r--r--patches/glibc/2.7/200-alpha-atfcts.patch12
-rw-r--r--patches/glibc/2.7/210-alpha-ptr_mangle.patch94
-rw-r--r--patches/glibc/2.7/220-objdump_for_host.patch13
-rw-r--r--patches/glibc/2.7/230-powerpc-private_futex.patch15
-rw-r--r--patches/glibc/2.7/240-sh-lowlevellock-asm.patch56
-rw-r--r--patches/glibc/2.7/250-sh-chop-linux-version.patch49
-rw-r--r--patches/glibc/2.7/260-sh-syscall-error-path.patch26
-rw-r--r--patches/glibc/2.7/270-sh-fix-procfs.patch37
-rw-r--r--patches/glibc/2.7/280-sh-fix-kernel-headers-location.patch23
-rw-r--r--patches/glibc/2.7/290-powerpc-8xx-CPU15-errata.patch56
-rw-r--r--patches/glibc/2.7/300-binutils-_begin.patch190
-rw-r--r--patches/glibc/2.9/100-ssp-compat.patch193
-rw-r--r--patches/glibc/2.9/110-respect-env-CPPFLAGS.patch30
-rw-r--r--patches/glibc/2.9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch35
-rw-r--r--patches/glibc/2.9/130-add_prio-macros.patch26
-rw-r--r--patches/glibc/2.9/140-regex-BZ9697.patch111
-rw-r--r--patches/glibc/2.9/150-regex-BZ697.patch28
-rw-r--r--patches/glibc/2.9/160-i386-x86_64-revert-clone-cfi.patch53
-rw-r--r--patches/glibc/2.9/170-2.10-dns-no-gethostbyname4.patch35
-rw-r--r--patches/glibc/2.9/180-math-tests.patch72
-rw-r--r--patches/glibc/2.9/190-queue-header-updates.patch89
-rw-r--r--patches/glibc/2.9/200-awk-in-C-locale.patch23
-rw-r--r--patches/glibc/2.9/210-2.9-strlen-hack.patch109
-rw-r--r--patches/glibc/2.9/220-manual-no-perl.patch29
-rw-r--r--patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch74
-rw-r--r--patches/glibc/2.9/240-i386-LOAD_PIC_REG.patch23
-rw-r--r--patches/glibc/2.9/250-resolv-dynamic.patch44
-rw-r--r--patches/glibc/2.9/260-fadvise64_64.patch30
-rw-r--r--patches/glibc/2.9/270-ldbl-nexttowardf.patch68
-rw-r--r--patches/glibc/2.9/280-section-comments.patch29
-rw-r--r--patches/glibc/2.9/290-no-inline-gmon.patch38
-rw-r--r--patches/glibc/2.9/300-2.9-check_native-headers.patch22
-rw-r--r--patches/glibc/2.9/310-2.3.6-fix-pr631.patch50
-rw-r--r--patches/glibc/2.9/320-2.9-assume-pipe2.patch59
-rw-r--r--patches/glibc/2.9/330-2.3.3-china.patch35
-rw-r--r--patches/glibc/2.9/340-new-valencian-locale.patch120
-rw-r--r--patches/glibc/2.9/360-2.8-nscd-one-fork.patch45
-rw-r--r--patches/glibc/2.9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch249
-rw-r--r--patches/glibc/2.9/380-2.3.6-dl_execstack-PaX-support.patch71
-rw-r--r--patches/glibc/2.9/390-2.3.3_pre20040117-pt_pax.patch35
-rw-r--r--patches/glibc/2.9/400-tests-sandbox-libdl-paths.patch198
-rw-r--r--patches/glibc/2.9/410-2.9-fnmatch.patch64
-rw-r--r--patches/glibc/2.9/420-dont-build-timezone.patch19
-rw-r--r--patches/glibc/2.9/430-2.7-cross-compile-nptl.patch57
-rw-r--r--patches/glibc/2.9/440-alpha-glibc-2.4-xstat.patch249
-rw-r--r--patches/glibc/2.9/450-alpha-glibc-2.5-no-page-header.patch32
-rw-r--r--patches/glibc/2.9/460-alpha-glibc-2.5-no-asm-elf-header.patch38
-rw-r--r--patches/glibc/2.9/470-alpha-glibc-2.8-creat.patch19
-rw-r--r--patches/glibc/2.9/480-alpha-glibc-2.8-cache-shape.patch17
-rw-r--r--patches/glibc/2.9/490-ptr-mangling.patch114
-rw-r--r--patches/glibc/2.9/500-ppc-glibc-2.9-atomic.patch414
-rw-r--r--patches/glibc/2.9/510-sh-no-asm-user-header.patch70
-rw-r--r--patches/glibc/2.9/520-sh-no-asm-elf-header.patch27
-rw-r--r--patches/glibc/2.9/530-powerpc-8xx-CPU15-errata.patch56
-rw-r--r--patches/glibc/2.9/540-alpha-atfcts.patch12
-rw-r--r--patches/glibc/2.9/550-2.9-elf-begin.patch29
-rw-r--r--patches/glibc/2.9/560-syslog.patch12
-rw-r--r--patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch24
-rw-r--r--patches/glibc/2.9/600-recent-binutils.patch37
-rw-r--r--patches/glibc/2.9/610-fix-nptl-init.patch11
-rw-r--r--patches/glibc/2.9/900-march-i686.patch34
-rw-r--r--patches/glibc/2.9/910-typedef-caddr.patch28
-rw-r--r--patches/glibc/linuxthreads-2.3.6/100-cygwin.patch37
-rw-r--r--patches/glibc/linuxthreads-2.3.6/110-alpha-cfi.patch25
-rw-r--r--patches/glibc/ports-2.10.1/100-respect-env-CPPFLAGS.patch25
-rw-r--r--patches/glibc/ports-2.10.1/110-binutils-2.20-compat.patch39
-rw-r--r--patches/glibc/ports-2.10.1/120-i386-x86_64-revert-clone-cfi.patch55
-rw-r--r--patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch55
-rw-r--r--patches/glibc/ports-2.10.1/140-disable-ldconfig.patch16
-rw-r--r--patches/glibc/ports-2.10.1/150-queue-header-updates.patch85
-rw-r--r--patches/glibc/ports-2.10.1/160-manual-no-perl.patch24
-rw-r--r--patches/glibc/ports-2.10.1/170-localedef-fix-trampoline.patch69
-rw-r--r--patches/glibc/ports-2.10.1/180-resolv-dynamic.patch39
-rw-r--r--patches/glibc/ports-2.10.1/190-localedef-mmap.patch39
-rw-r--r--patches/glibc/ports-2.10.1/200-fadvise64_64.patch28
-rw-r--r--patches/glibc/ports-2.10.1/210-ldbl-nexttowardf.patch66
-rw-r--r--patches/glibc/ports-2.10.1/220-section-comments.patch24
-rw-r--r--patches/glibc/ports-2.10.1/230-no-inline-gmon.patch36
-rw-r--r--patches/glibc/ports-2.10.1/240-check_native-headers.patch17
-rw-r--r--patches/glibc/ports-2.10.1/250-fix-pr631.patch45
-rw-r--r--patches/glibc/ports-2.10.1/260-assume-pipe2.patch54
-rw-r--r--patches/glibc/ports-2.10.1/270-china.patch32
-rw-r--r--patches/glibc/ports-2.10.1/280-new-valencian-locale.patch115
-rw-r--r--patches/glibc/ports-2.10.1/300-nscd-one-fork.patch40
-rw-r--r--patches/glibc/ports-2.10.1/310-hppa-nptl-carlos.patch246
-rw-r--r--patches/glibc/ports-2.10.1/320-hppa-pie.patch29
-rw-r--r--patches/glibc/ports-2.10.1/330-m68k-sys-user.patch97
-rw-r--r--patches/glibc/ports-2.10.1/340-dl_execstack-PaX-support.patch66
-rw-r--r--patches/glibc/ports-2.10.1/350-pre20040117-pt_pax.patch32
-rw-r--r--patches/glibc/ports-2.10.1/360-tests-sandbox-libdl-paths.patch193
-rw-r--r--patches/glibc/ports-2.10.1/370-fnmatch.patch62
-rw-r--r--patches/glibc/ports-2.10.1/380-dont-build-timezone.patch14
-rw-r--r--patches/glibc/ports-2.10.1/390-cross-compile-nptl.patch52
-rw-r--r--patches/glibc/ports-2.10.1/400-alpha-xstat.patch250
-rw-r--r--patches/glibc/ports-2.10.1/410-alpha-no-page-header.patch28
-rw-r--r--patches/glibc/ports-2.10.1/420-alpha-no-asm-elf-header.patch34
-rw-r--r--patches/glibc/ports-2.10.1/430-alpha-creat.patch14
-rw-r--r--patches/glibc/ports-2.10.1/440-alpha-cache-shape.patch13
-rw-r--r--patches/glibc/ports-2.10.1/450-alpha-ptr-mangling.patch111
-rw-r--r--patches/glibc/ports-2.10.1/460-alpha-fix-gcc-4.1-warnings.patch56
-rw-r--r--patches/glibc/ports-2.10.1/470-alpha-floor_ceil_fix.patch270
-rw-r--r--patches/glibc/ports-2.10.1/480-alpha-add-dl-procinfo-support.patch170
-rw-r--r--patches/glibc/ports-2.10.1/490-alpha_alpha-add-fdatasync-support.patch126
-rw-r--r--patches/glibc/ports-2.10.1/500-alpha-add-getsystats-support.patch31
-rw-r--r--patches/glibc/ports-2.10.1/510-alpha-fix-includes.patch95
-rw-r--r--patches/glibc/ports-2.10.1/520-alpha-add-futex-defines.patch26
-rw-r--r--patches/glibc/ports-2.10.1/530-alpha-fix-rtld-fPIC.patch21
-rw-r--r--patches/glibc/ports-2.10.1/540-alpha-fix-memchr.patch121
-rw-r--r--patches/glibc/ports-2.10.1/550-alpha-fix-SOCK_NONBLOCK.patch417
-rw-r--r--patches/glibc/ports-2.10.1/560-ppc-atomic.patch415
-rw-r--r--patches/glibc/ports-2.10.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch374
-rw-r--r--patches/glibc/ports-2.10.1/580-nptl-lowlevellock.patch23
-rw-r--r--patches/glibc/ports-2.10.1/590-sh-set-fpscr-proto.patch13
-rw-r--r--patches/glibc/ports-2.10.1/600-mips_librt-mips.patch94
-rw-r--r--patches/glibc/ports-2.10.1/610-fpu-cw-mips.patch15
-rw-r--r--patches/glibc/ports-2.10.1/620-r10k-workarounds.patch67
-rw-r--r--patches/glibc/ports-2.10.1/630-mips_shn_undef-hack.patch24
-rw-r--r--patches/glibc/ports-2.10.1/640-alpha-atfcts.patch12
-rw-r--r--patches/glibc/ports-2.10.1/650-syslog.patch12
-rw-r--r--patches/glibc/ports-2.10.1/660-debug-readlink_chk-readklinkat_chk.patch24
-rw-r--r--patches/glibc/ports-2.12.1/100-respect-env-CPPFLAGS.patch25
-rw-r--r--patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch55
-rw-r--r--patches/glibc/ports-2.12.1/140-disable-ldconfig.patch16
-rw-r--r--patches/glibc/ports-2.12.1/150-queue-header-updates.patch85
-rw-r--r--patches/glibc/ports-2.12.1/160-manual-no-perl.patch24
-rw-r--r--patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch69
-rw-r--r--patches/glibc/ports-2.12.1/180-resolv-dynamic.patch39
-rw-r--r--patches/glibc/ports-2.12.1/190-localedef-mmap.patch39
-rw-r--r--patches/glibc/ports-2.12.1/200-fadvise64_64.patch28
-rw-r--r--patches/glibc/ports-2.12.1/220-section-comments.patch24
-rw-r--r--patches/glibc/ports-2.12.1/230-no-inline-gmon.patch36
-rw-r--r--patches/glibc/ports-2.12.1/240-check_native-headers.patch17
-rw-r--r--patches/glibc/ports-2.12.1/250-fix-pr631.patch45
-rw-r--r--patches/glibc/ports-2.12.1/260-assume-pipe2.patch40
-rw-r--r--patches/glibc/ports-2.12.1/270-china.patch32
-rw-r--r--patches/glibc/ports-2.12.1/280-new-valencian-locale.patch115
-rw-r--r--patches/glibc/ports-2.12.1/300-nscd-one-fork.patch40
-rw-r--r--patches/glibc/ports-2.12.1/310-hppa-nptl-carlos.patch246
-rw-r--r--patches/glibc/ports-2.12.1/330-m68k-sys-user.patch97
-rw-r--r--patches/glibc/ports-2.12.1/340-dl_execstack-PaX-support.patch66
-rw-r--r--patches/glibc/ports-2.12.1/350-pre20040117-pt_pax.patch32
-rw-r--r--patches/glibc/ports-2.12.1/360-tests-sandbox-libdl-paths.patch193
-rw-r--r--patches/glibc/ports-2.12.1/370-fnmatch.patch62
-rw-r--r--patches/glibc/ports-2.12.1/380-dont-build-timezone.patch14
-rw-r--r--patches/glibc/ports-2.12.1/400-alpha-xstat.patch15
-rw-r--r--patches/glibc/ports-2.12.1/430-alpha-creat.patch14
-rw-r--r--patches/glibc/ports-2.12.1/440-alpha-cache-shape.patch13
-rw-r--r--patches/glibc/ports-2.12.1/460-alpha-fix-gcc-4.1-warnings.patch56
-rw-r--r--patches/glibc/ports-2.12.1/490-alpha_alpha-add-fdatasync-support.patch126
-rw-r--r--patches/glibc/ports-2.12.1/530-alpha-fix-rtld-fPIC.patch21
-rw-r--r--patches/glibc/ports-2.12.1/560-ppc-atomic.patch415
-rw-r--r--patches/glibc/ports-2.12.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch374
-rw-r--r--patches/glibc/ports-2.12.1/580-nptl-lowlevellock.patch23
-rw-r--r--patches/glibc/ports-2.12.1/610-fpu-cw-mips.patch15
-rw-r--r--patches/glibc/ports-2.12.1/630-mips_shn_undef-hack.patch16
-rw-r--r--patches/glibc/ports-2.12.1/640-alpha-atfcts.patch12
-rw-r--r--patches/glibc/ports-2.12.1/650-syslog.patch12
-rw-r--r--patches/glibc/ports-2.12.1/660-debug-readlink_chk-readklinkat_chk.patch24
-rw-r--r--patches/glibc/ports-2.13/100-respect-env-CPPFLAGS.patch14
-rw-r--r--patches/glibc/ports-2.13/120-i386-x86_64-revert-clone-cfi.patch55
-rw-r--r--patches/glibc/ports-2.13/140-disable-ldconfig.patch16
-rw-r--r--patches/glibc/ports-2.13/150-queue-header-updates.patch85
-rw-r--r--patches/glibc/ports-2.13/160-manual-no-perl.patch24
-rw-r--r--patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch69
-rw-r--r--patches/glibc/ports-2.13/180-resolv-dynamic.patch39
-rw-r--r--patches/glibc/ports-2.13/190-localedef-mmap.patch39
-rw-r--r--patches/glibc/ports-2.13/200-fadvise64_64.patch28
-rw-r--r--patches/glibc/ports-2.13/220-section-comments.patch24
-rw-r--r--patches/glibc/ports-2.13/230-no-inline-gmon.patch36
-rw-r--r--patches/glibc/ports-2.13/240-check_native-headers.patch17
-rw-r--r--patches/glibc/ports-2.13/250-fix-pr631.patch45
-rw-r--r--patches/glibc/ports-2.13/260-assume-pipe2.patch40
-rw-r--r--patches/glibc/ports-2.13/270-china.patch32
-rw-r--r--patches/glibc/ports-2.13/280-new-valencian-locale.patch115
-rw-r--r--patches/glibc/ports-2.13/300-nscd-one-fork.patch40
-rw-r--r--patches/glibc/ports-2.13/310-hppa-nptl-carlos.patch246
-rw-r--r--patches/glibc/ports-2.13/330-m68k-sys-user.patch97
-rw-r--r--patches/glibc/ports-2.13/340-dl_execstack-PaX-support.patch66
-rw-r--r--patches/glibc/ports-2.13/350-pre20040117-pt_pax.patch32
-rw-r--r--patches/glibc/ports-2.13/360-tests-sandbox-libdl-paths.patch193
-rw-r--r--patches/glibc/ports-2.13/380-dont-build-timezone.patch14
-rw-r--r--patches/glibc/ports-2.13/400-alpha-xstat.patch15
-rw-r--r--patches/glibc/ports-2.13/410-alpha-SETPIPE-GETPIPE.patch19
-rw-r--r--patches/glibc/ports-2.13/420-alpha-statfs.patch29
-rw-r--r--patches/glibc/ports-2.13/430-alpha-creat.patch14
-rw-r--r--patches/glibc/ports-2.13/440-alpha-cache-shape.patch13
-rw-r--r--patches/glibc/ports-2.13/450-alpha-DEFAULT_STACK_PERMS.patch23
-rw-r--r--patches/glibc/ports-2.13/460-alpha-fix-gcc-4.1-warnings.patch56
-rw-r--r--patches/glibc/ports-2.13/470-alpha-feupdateenv.patch26
-rw-r--r--patches/glibc/ports-2.13/490-alpha_alpha-add-fdatasync-support.patch126
-rw-r--r--patches/glibc/ports-2.13/530-alpha-fix-rtld-fPIC.patch21
-rw-r--r--patches/glibc/ports-2.13/560-ppc-atomic.patch415
-rw-r--r--patches/glibc/ports-2.13/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch374
-rw-r--r--patches/glibc/ports-2.13/580-nptl-lowlevellock.patch23
-rw-r--r--patches/glibc/ports-2.13/610-fpu-cw-mips.patch15
-rw-r--r--patches/glibc/ports-2.13/630-mips_shn_undef-hack.patch16
-rw-r--r--patches/glibc/ports-2.13/640-alpha-atfcts.patch12
-rw-r--r--patches/glibc/ports-2.13/650-syslog.patch12
-rw-r--r--patches/glibc/ports-2.13/660-debug-readlink_chk-readklinkat_chk.patch24
-rw-r--r--patches/glibc/ports-2.6.1/100-ARM-NPTL.patch13
-rw-r--r--patches/glibc/ports-2.6.1/110-ARM-asm_page_h.patch11
-rw-r--r--patches/glibc/ports-2.6.1/120-lll_lock_t.patch156
-rw-r--r--patches/glibc/ports-2.6.1/130-powerpc-softfloat.patch21
-rw-r--r--patches/glibc/ports-2.7/100-ARM-asm_page_h.patch11
-rw-r--r--patches/glibc/ports-2.7/110-ARM-NPTL.patch12
-rw-r--r--patches/glibc/ports-2.9/100-arm_linux_tls.patch14
-rw-r--r--patches/glibc/ports-2.9/110-arm-fix-sjlj-for-fpu.patch30
-rw-r--r--patches/gmp/4.2.2/100-mpf_set_str.patch38
-rw-r--r--patches/gmp/4.2.4/100-mpf_eq.patch219
-rw-r--r--patches/gmp/4.2.4/110-mpf_set_str.patch32
-rw-r--r--patches/gmp/4.2.4/120-perfpow.patch149
-rw-r--r--patches/gmp/4.3.0/100-multiplicity-that-does-not-fit-an-int.patch33
-rw-r--r--patches/gmp/4.3.0/110-unbounded-alloc.patch31
-rw-r--r--patches/gmp/5.0.1/110-get-mpn_sub_1-size-argument-right.patch38
-rw-r--r--patches/gmp/5.0.1/120-fix-r0-clobbering-issue.patch77
-rw-r--r--patches/gmp/5.0.2/110-get-mpn_sub_1-size-argument-right.patch38
-rw-r--r--patches/gmp/5.0.2/120-fix-r0-clobbering-issue.patch77
-rw-r--r--patches/gmp/5.1.1/100-fix-bulldozer-piledriver.patch21
-rw-r--r--patches/gmp/5.1.1/110-mpz_powm_ui.patch39
-rw-r--r--patches/gmp/5.1.1/120-fix-mpn_sbpi1_div_qr_sec.patch164
-rw-r--r--patches/gmp/5.1.1/130-do-not-clobber-f16-f18.patch73
-rw-r--r--patches/gmp/6.1.0/100-fix-broadwell-skylake.patch59
-rw-r--r--patches/libelf/0.8.10/100-fix-64-bit-detection.patch24
-rw-r--r--patches/libelf/0.8.11/100-fix-64-bit-detection.patch24
-rw-r--r--patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch26
-rw-r--r--patches/ltrace/0.4/110-allow-cross-compile.patch89
-rw-r--r--patches/ltrace/0.4/120-alpha-support.patch11
-rw-r--r--patches/ltrace/0.5.1/100-allow-cross-compile.patch77
-rw-r--r--patches/ltrace/0.5.1/110-alpha-support.patch11
-rw-r--r--patches/ltrace/0.5/100-fix-build-with-exotic-linux-host-OS.patch26
-rw-r--r--patches/ltrace/0.5/110-allow-cross-compile.patch89
-rw-r--r--patches/ltrace/0.5/120-alpha-support.patch11
-rw-r--r--patches/ltrace/0.5/130-fixes-by-debian.patch812
-rw-r--r--patches/mpfr/2.3.1/100-thread-safe-configure.patch209
-rw-r--r--patches/mpfr/2.4.2/120-gmp5.patch75
-rw-r--r--patches/mpfr/3.0.0/110-mpfr_out_str.patch220
-rw-r--r--patches/mpfr/3.0.0/120-alloca.patch377
-rw-r--r--patches/mpfr/3.0.0/130-gamma_underflow.patch88
-rw-r--r--patches/mpfr/3.0.0/140-mpfr_cmp_set_ui_si.patch239
-rw-r--r--patches/mpfr/3.0.0/150-tcan_round.patch45
-rw-r--r--patches/mpfr/3.0.0/160-mpfr_sub1.patch628
-rw-r--r--patches/mpfr/3.0.0/170-mpfr_set_ld.patch155
-rw-r--r--patches/mpfr/3.0.0/180-macros.patch193
-rw-r--r--patches/mpfr/3.0.1/110-asin_exprange.patch137
-rw-r--r--patches/mpfr/3.0.1/120-rec_sqrt-carry.patch76
-rw-r--r--patches/mpfr/3.0.1/130-atan-expo-range.patch107
-rw-r--r--patches/mpfr/3.0.1/140-texp-zero.patch47
-rw-r--r--patches/mpfr/3.1.0/110-mpfr_unlikely.patch50
-rw-r--r--patches/mpfr/3.1.0/120-lib-search-path.patch96
-rw-r--r--patches/mpfr/3.1.0/130-vasprintf.patch247
-rw-r--r--patches/mpfr/3.1.0/140-gmp41compat.patch166
-rw-r--r--patches/mpfr/3.1.0/150-logging-freeze.patch69
-rw-r--r--patches/mpfr/3.1.0/160-logging-varfmt.patch45
-rw-r--r--patches/mpfr/3.1.0/170-large-prec.patch591
-rw-r--r--patches/mpfr/3.1.0/180-__gmp_const.patch52
-rw-r--r--patches/mpfr/3.1.0/190-gamma-underflow.patch93
-rw-r--r--patches/mpfr/3.1.0/200-gamma-overunderflow.patch487
-rw-r--r--patches/mpfr/3.1.1/110-get_decimal64.patch235
-rw-r--r--patches/mpfr/3.1.1/120-strtofr-ternary-value.patch170
-rw-r--r--patches/mpfr/3.1.1/130-gmp51-compat.patch98
-rw-r--r--patches/mpfr/3.1.2/110-exp_2.patch45
-rw-r--r--patches/mpfr/3.1.2/120-fits-smallneg.patch605
-rw-r--r--patches/mpfr/3.1.2/130-clang-divby0.patch129
-rw-r--r--patches/mpfr/3.1.2/140-printf-alt0.patch84
-rw-r--r--patches/mpfr/3.1.2/150-custom_init_set.patch42
-rw-r--r--patches/mpfr/3.1.2/160-li2-return.patch43
-rw-r--r--patches/mpfr/3.1.2/170-exp3.patch71
-rw-r--r--patches/mpfr/3.1.2/180-gmp6-compat.patch254
-rw-r--r--patches/mpfr/3.1.2/190-div-overflow.patch166
-rw-r--r--patches/mpfr/3.1.2/200-vasprintf.patch138
-rw-r--r--patches/mpfr/3.1.2/210-strtofr.patch49
-rw-r--r--patches/mpfr/3.1.3/110-lngamma-and-doc.patch1117
-rw-r--r--patches/mpfr/3.1.3/120-muldiv-2exp-overflow.patch161
-rw-r--r--patches/mpfr/3.1.3/130-muldiv-2exp-underflow.patch217
-rw-r--r--patches/mpfr/3.1.3/140-frexp.patch204
-rw-r--r--patches/mpfr/3.1.3/150-divhigh-basecase.patch131
-rw-r--r--patches/mpfr/3.1.3/160-jn.patch71
-rw-r--r--patches/mpfr/3.1.3/170-zeta.patch125
-rw-r--r--patches/mpfr/3.1.3/180-sqrt.patch97
-rw-r--r--patches/mpfr/3.1.3/190-si-ops.patch107
-rw-r--r--patches/mpfr/3.1.3/200-can_round.patch413
-rw-r--r--patches/mpfr/3.1.3/210-fits.patch584
-rw-r--r--patches/mpfr/3.1.3/220-root.patch621
-rw-r--r--patches/mpfr/3.1.3/230-gamma.patch77
-rw-r--r--patches/mpfr/3.1.3/240-rem1.patch337
-rw-r--r--patches/mpfr/3.1.3/250-agm-eq.patch105
-rw-r--r--patches/mpfr/3.1.3/260-sum.patch223
-rw-r--r--patches/mpfr/3.1.3/270-cmp_d.patch219
-rw-r--r--patches/strace/4.5.15/100-autoreconf.patch761
-rw-r--r--patches/strace/4.5.15/110-dont-use-REG_SYSCALL-for-sh.patch11
-rw-r--r--patches/strace/4.5.15/120-fix-arm-bad-syscall.patch19
-rw-r--r--patches/strace/4.5.15/130-fix-disabled-largefile-syscalls.patch22
-rw-r--r--patches/strace/4.5.15/140-mips-sprintsigmask-fix.patch12
-rw-r--r--patches/strace/4.5.15/150-statfs64-check.patch53
-rw-r--r--patches/strace/4.5.15/160-superh-update.ac.patch22
-rw-r--r--patches/strace/4.5.15/170-undef-CTL_PROC.patch13
-rw-r--r--patches/strace/4.5.15/180-undef-PACKET_MEMBERSHIP.patch16
-rw-r--r--patches/strace/4.5.15/190-undef-syscall.patch64
-rw-r--r--patches/strace/4.5.16/100-autoreconf.patch77
-rw-r--r--patches/strace/4.5.16/110-dont-use-REG_SYSCALL-for-sh.patch11
-rw-r--r--patches/strace/4.5.16/120-fix-arm-bad-syscall.patch19
-rw-r--r--patches/strace/4.5.16/130-fix-disabled-largefile-syscalls.patch22
-rw-r--r--patches/strace/4.5.16/140-statfs64-check.patch53
-rw-r--r--patches/strace/4.5.16/150-superh-update.ac.patch22
-rw-r--r--patches/strace/4.5.16/160-undef-CTL_PROC.patch13
-rw-r--r--patches/strace/4.5.16/170-undef-PACKET_MEMBERSHIP.patch16
-rw-r--r--patches/strace/4.5.16/180-undef-syscall.patch64
-rw-r--r--patches/strace/4.5.17/100-autoreconf.patch81
-rw-r--r--patches/strace/4.5.17/110-dont-use-REG_SYSCALL-for-sh.patch15
-rw-r--r--patches/strace/4.5.17/120-fix-arm-bad-syscall.patch23
-rw-r--r--patches/strace/4.5.17/130-fix-disabled-largefile-syscalls.patch26
-rw-r--r--patches/strace/4.5.17/140-statfs64-check.patch57
-rw-r--r--patches/strace/4.5.17/150-undef-CTL_PROC.patch17
-rw-r--r--patches/strace/4.5.17/160-undef-syscall.patch68
-rw-r--r--patches/strace/4.5.17/170-arm-syscalls.patch42
-rw-r--r--patches/strace/4.5.17/180-no_cachectl.patch35
-rw-r--r--patches/strace/4.5.17/190-dirent-include.patch33
-rw-r--r--patches/strace/4.5.18/120-fix-arm-bad-syscall.patch19
-rw-r--r--patches/strace/4.5.18/150-undef-CTL_PROC.patch13
-rw-r--r--patches/strace/4.5.18/160-fix-check-for-linux-netlink.patch19
-rw-r--r--patches/strace/4.5.18/900-autoreconf.patch (renamed from patches/strace/4.5.18/100-autoreconf.patch)26
-rw-r--r--patches/strace/4.5.19/100-autoreconf.patch77
-rw-r--r--patches/strace/4.5.19/110-fix-arm-bad-syscall.patch19
-rw-r--r--patches/strace/4.5.19/140-undef-CTL_PROC.patch13
-rw-r--r--patches/strace/4.5.19/170-update-configure.patch76
-rw-r--r--patches/uClibc-ng/1.0.12/100-provide-_obstack_free.patch12
-rw-r--r--samples/sparc-leon-linux-uclibc/crosstool.config2
-rw-r--r--samples/sparc-leon-linux-uclibc/uClibc.config (renamed from samples/sparc-leon-linux-uclibc/uClibc-1.0.12.config)0
-rwxr-xr-xscripts/addToolVersion.sh3
-rw-r--r--scripts/build/cc/100-gcc.sh65
-rw-r--r--scripts/build/libc/glibc.sh3
-rw-r--r--scripts/build/libc/uClibc.sh5
436 files changed, 12185 insertions, 23312 deletions
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
index 101f2b2..6f6e1a3 100644
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -71,9 +71,9 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
-config CC_GCC_V_6_1_0
+config CC_GCC_V_6_2_0
bool
- prompt "6.1.0"
+ prompt "6.2.0"
select CC_GCC_6
config CC_GCC_V_5_4_0
@@ -160,6 +160,7 @@ config CC_GCC_5
select CC_GCC_HAS_LNK_HASH_STYLE
select CC_GCC_HAS_LIBQUADMATH
select CC_GCC_HAS_LIBSANITIZER
+ select CC_GCC_HAS_LIBMPX
select CC_SUPPORT_GOLANG
config CC_GCC_5_or_later
@@ -178,6 +179,7 @@ config CC_GCC_6
select CC_GCC_HAS_LNK_HASH_STYLE
select CC_GCC_HAS_LIBQUADMATH
select CC_GCC_HAS_LIBSANITIZER
+ select CC_GCC_HAS_LIBMPX
select CC_SUPPORT_GOLANG
config CC_GCC_6_or_later
@@ -276,13 +278,16 @@ config CC_GCC_HAS_LIBQUADMATH
config CC_GCC_HAS_LIBSANITIZER
bool
+config CC_GCC_HAS_LIBMPX
+ bool
+
if ! CC_GCC_CUSTOM
config CC_GCC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
- default "6.1.0" if CC_GCC_V_6_1_0
+ default "6.2.0" if CC_GCC_V_6_2_0
default "5.4.0" if CC_GCC_V_5_4_0
default "linaro-5.2-2015.11-2" if CC_GCC_V_linaro_5_2
default "linaro-4.9-2015.06" if CC_GCC_V_linaro_4_9
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
index c200d22..2c5d45e 100644
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -182,6 +182,17 @@ config CC_GCC_LIBSANITIZER
The default is 'N'. Say 'Y' if you need it, and report success/failure.
+config CC_GCC_LIBMPX
+ bool
+ default y
+ prompt "Compile libmpx"
+ depends on CC_GCC_HAS_LIBMPX
+ depends on ARCH_x86
+ # MUSL does not define libc types that GCC requires. Mingw lacks certain headers.
+ depends on !LIBC_musl && ! LIBC_mingw
+ help
+ Enable GCC support for Intel Memory Protection Extensions (MPX).
+
#-----------------------------------------------------------------------------
comment "Misc. obscure options."
diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in
index a99ff73..da74968 100644
--- a/config/libc/uClibc.in
+++ b/config/libc/uClibc.in
@@ -60,6 +60,8 @@ config LIBC_UCLIBC_CUSTOM_VERSION
prompt "Custom uClibc Version"
help
Enter the version number for your custom uClibc.
+ Version 1.0.18 is only enabled in EXPERIMENTAL builds due to issues
+ with static libraries.
config LIBC_VERSION
string
@@ -75,10 +77,17 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
-config LIBC_UCLIBC_NG_V_1_0_12
+# List 1.0.17 first to make it default. 1.0.18 has issues with static libs.
+config LIBC_UCLIBC_NG_V_1_0_17
bool
- prompt "1.0.12"
- select LIBC_UCLIBC_NG_1_0_12_or_later
+ prompt "1.0.17"
+ select LIBC_UCLIBC_NG_1_0_15_or_later
+
+config LIBC_UCLIBC_NG_V_1_0_18
+ bool
+ prompt "1.0.18"
+ depends on EXPERIMENTAL
+ select LIBC_UCLIBC_NG_1_0_15_or_later
config LIBC_UCLIBC_V_0_9_33_2
bool
@@ -91,12 +100,13 @@ config LIBC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
- default "1.0.12" if LIBC_UCLIBC_NG_V_1_0_12
+ default "1.0.18" if LIBC_UCLIBC_NG_V_1_0_18
+ default "1.0.17" if LIBC_UCLIBC_NG_V_1_0_17
default "0.9.33.2" if LIBC_UCLIBC_V_0_9_33_2
endif # ! LIBC_UCLIBC_CUSTOM
-config LIBC_UCLIBC_NG_1_0_12_or_later
+config LIBC_UCLIBC_NG_1_0_15_or_later
bool
select LIBC_UCLIBC_NG_1_0_0_or_later
diff --git a/config/libc/uClibc.in.2 b/config/libc/uClibc.in.2
index 3a5fe34..dc02420 100644
--- a/config/libc/uClibc.in.2
+++ b/config/libc/uClibc.in.2
@@ -1,6 +1,6 @@
# uClibc second-part option
-if THREADS_LT
+if THREADS_LT && !LIBC_UCLIBC_NG_1_0_15_or_later
choice
bool
@@ -30,10 +30,12 @@ endchoice
endif # THREADS_LT
+# uClibc-ng 1.0.15 did away with 2 implementations of linuxthreads
config LIBC_UCLIBC_LNXTHRD
string
default "" if THREADS_NONE
default "" if THREADS_NATIVE
+ default "" if LIBC_UCLIBC_NG_1_0_15_or_later
default "old" if LIBC_UCLIBC_LNXTHRD_OLD
default "new" if LIBC_UCLIBC_LNXTHRD_NEW
diff --git a/patches/ELFkickers/2.0a/100-use_CC_not_gcc.patch b/patches/ELFkickers/2.0a/100-use_CC_not_gcc.patch
deleted file mode 100644
index 373136b..0000000
--- a/patches/ELFkickers/2.0a/100-use_CC_not_gcc.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -dur ELFkickers.orig/sstrip/Makefile ELFkickers/sstrip/Makefile
---- ELFkickers.orig/sstrip/Makefile 2001-03-24 12:58:27.000000000 +0100
-+++ ELFkickers/sstrip/Makefile 2007-05-31 21:17:18.000000000 +0200
-@@ -1,7 +1,7 @@
- # Makefile for sstrip
-
- sstrip: sstrip.c
-- gcc -ggdb -Wall -W -o sstrip sstrip.c
-+ $(CC) -Wall -W -o sstrip sstrip.c
-
- clean:
- rm -f sstrip
diff --git a/patches/cygwin/1.5.15-1/100-crossbuild.patch b/patches/cygwin/1.5.15-1/100-crossbuild.patch
deleted file mode 100644
index d312403..0000000
--- a/patches/cygwin/1.5.15-1/100-crossbuild.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Message-ID: <4269173F.7020705@zee2.com>
-Date: Fri, 22 Apr 2005 16:24:47 +0100
-From: Steve Papacharalambous <stevep@zee2.com>
-To: "Robert P. J. Day" <rpjday@mindspring.com>
-CC: crossgcc list <crossgcc@sources.redhat.com>
-Subject: Re: cygwin source directory has moved
-In-Reply-To: <Pine.LNX.4.61.0504181746050.11794@localhost.localdomain>
-
-Hi Robert,
-
-I've attached two patches:
-
-1/ For crosstool-0.31 which changes the CYGWIN_URL to one which has the
-cygwin source archives. The version of cygwin that is used to build the
-cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since
-most of the mirror sites don't seem to have the original archive used.
-[created gcc-3.3.2-cygwin-1.5.15-1.dat - dank]
-
-
-2/ The later cygwin source archive fails to cross build with the error:
-/opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld:
-cannot find -luser32
-
-unless the second patch is applied,
-
-
-diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in
---- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in 2005-02-28 22:51:02.000000000 +0000
-+++ cygwin-1.5.15-1/winsup/mingw/Makefile.in 2005-04-22 15:29:18.000000000 +0100
-@@ -71,7 +71,7 @@
- mkinstalldirs = $(SHELL) @MKINSTALLDIRS@
-
- CC := @CC@
--override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}}
-+override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}}
- # FIXME: Which is it, CC or CC_FOR_TARGET?
- CC_FOR_TARGET = $(CC)
- AS_FOR_TARGET = $(AS)
-
-
diff --git a/patches/duma/2_5_1/100-cross-compile.patch b/patches/duma/2_5_1/100-cross-compile.patch
deleted file mode 100644
index 77dc98c..0000000
--- a/patches/duma/2_5_1/100-cross-compile.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -dur duma_2_5_1/Makefile duma_2_5_1.orig/Makefile
---- duma_2_5_1/Makefile 2006-06-18 06:02:13.000000000 +0200
-+++ duma_2_5_1.orig/Makefile 2007-07-11 17:49:43.000000000 +0200
-@@ -98,10 +98,6 @@
- LIBS=-lpthread
- endif
-
--
--CC=gcc
--CXX=g++
--AR=ar
- INSTALL=install
-
- ############################################################
-@@ -169,7 +165,7 @@
-
- createconf: createconf.o
- - rm -f createconf
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf
-
- tstheap: libduma.a tstheap.o
- - rm -f tstheap
-@@ -211,7 +207,7 @@
- # define rules how to build objects for createconf
- #
- createconf.o:
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-
-
- #
diff --git a/patches/duma/2_5_1/110-separate_cpp.patch b/patches/duma/2_5_1/110-separate_cpp.patch
deleted file mode 100644
index d228731..0000000
--- a/patches/duma/2_5_1/110-separate_cpp.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -dur duma_2_5_1.orig/Makefile duma_2_5_1/Makefile
---- duma_2_5_1.orig/Makefile 2007-07-11 17:49:43.000000000 +0200
-+++ duma_2_5_1/Makefile 2007-07-11 17:50:46.000000000 +0200
-@@ -115,9 +115,14 @@
- dumatest.c tstheap.c dumatestpp.cpp testoperators.cpp \
- createconf.c
-
--OBJECTS = dumapp.o duma.o sem_inc.o print.o
-+OBJECTS = duma.o sem_inc.o print.o
-+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
-+
-+ifeq ($(DUMA_CPP),1)
-+OBJECTS += dumapp.o
-+SO_OBJECTS += dumapp_so.o
-+endif
-
--SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
-
- all: libduma.a $(DUMASO) tstheap dumatest dumatestpp testoperators tstheap_so dumatestpp_so
- @ echo "Testing DUMA."
diff --git a/patches/duma/2_5_12/100-cross-compile.patch b/patches/duma/2_5_12/100-cross-compile.patch
deleted file mode 100644
index 8401c0a..0000000
--- a/patches/duma/2_5_12/100-cross-compile.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff -durN duma_2_5_12.orig/Makefile duma_2_5_12/Makefile
---- duma_2_5_12.orig/Makefile 2007-08-17 09:34:25.000000000 +0200
-+++ duma_2_5_12/Makefile 2007-09-07 21:50:04.000000000 +0200
-@@ -93,9 +93,6 @@
- # also define 'WIN32'
-
- # some defaults:
--CC=gcc
--CXX=g++
--AR=ar
- INSTALL=install
- RM=rm
- RMFORCE=rm -f
-@@ -299,7 +296,7 @@
-
- createconf$(EXEPOSTFIX): createconf.o
- - $(RMFORCE) createconf$(EXEPOSTFIX)
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
-
- tstheap$(EXEPOSTFIX): libduma.a tstheap.o
- - $(RMFORCE) tstheap$(EXEPOSTFIX)
-@@ -360,7 +357,7 @@
- # define rules how to build objects for createconf
- #
- createconf.o:
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-
-
- #
diff --git a/patches/duma/2_5_12/110-separate_cpp.patch b/patches/duma/2_5_12/110-separate_cpp.patch
deleted file mode 100644
index df2d377..0000000
--- a/patches/duma/2_5_12/110-separate_cpp.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -durN duma_2_5_12.orig/Makefile duma_2_5_12/Makefile
---- duma_2_5_12.orig/Makefile 2007-09-07 21:57:45.000000000 +0200
-+++ duma_2_5_12/Makefile 2007-09-07 21:58:35.000000000 +0200
-@@ -231,9 +231,13 @@
- dumatest.c tstheap.c thread-test.c testmt.c dumatestpp.cpp testoperators.cpp \
- createconf.c
-
--OBJECTS = dumapp.o duma.o sem_inc.o print.o
-+OBJECTS = duma.o sem_inc.o print.o
-+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
-
--SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
-+ifeq ($(DUMA_CPP),1)
-+OBJECTS += dumapp.o
-+SO_OBJECTS += dumapp_so.o
-+endif
-
- all: libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
- @ $(ECHOLF)
diff --git a/patches/duma/2_5_14/100-cross-compile.patch b/patches/duma/2_5_14/100-cross-compile.patch
deleted file mode 100644
index 8bb0735..0000000
--- a/patches/duma/2_5_14/100-cross-compile.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -durN duma_2_5_14.orig/Makefile duma_2_5_14/Makefile
---- duma_2_5_14.orig/Makefile 2008-03-13 00:54:10.000000000 +0100
-+++ duma_2_5_14/Makefile 2008-06-17 10:28:45.000000000 +0200
-@@ -93,10 +93,6 @@
- # also define 'WIN32'
-
- # some defaults:
--CC=gcc
--CXX=g++
--AR=ar
--RANLIB=ranlib
- INSTALL=install
- RM=rm
- RMFORCE=rm -f
-@@ -317,7 +313,7 @@
-
- createconf$(EXEPOSTFIX): createconf.o
- - $(RMFORCE) createconf$(EXEPOSTFIX)
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
-
- tstheap$(EXEPOSTFIX): libduma.a tstheap.o
- - $(RMFORCE) tstheap$(EXEPOSTFIX)
-@@ -378,7 +374,7 @@
- # define rules how to build objects for createconf
- #
- createconf.o:
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-
-
- #
diff --git a/patches/duma/2_5_14/110-separate_cpp.patch b/patches/duma/2_5_14/110-separate_cpp.patch
deleted file mode 100644
index bc287c4..0000000
--- a/patches/duma/2_5_14/110-separate_cpp.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -durN duma_2_5_14.orig/Makefile duma_2_5_14/Makefile
---- duma_2_5_14.orig/Makefile 2008-06-17 10:30:40.000000000 +0200
-+++ duma_2_5_14/Makefile 2008-06-17 10:30:17.000000000 +0200
-@@ -228,9 +228,13 @@
- dumatest.c tstheap.c thread-test.c testmt.c dumatestpp.cpp testoperators.cpp \
- createconf.c
-
--OBJECTS = dumapp.o duma.o sem_inc.o print.o
-+OBJECTS = duma.o sem_inc.o print.o
-+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
-
--SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
-+ifeq ($(DUMA_CPP),1)
-+OBJECTS += dumapp.o
-+SO_OBJECTS += dumapp_so.o
-+endif
-
- all: libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
-
diff --git a/patches/duma/2_5_8/100-cross-compile.patch b/patches/duma/2_5_8/100-cross-compile.patch
deleted file mode 100644
index bc96c9b..0000000
--- a/patches/duma/2_5_8/100-cross-compile.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff -durN duma_2_5_8.orig/Makefile duma_2_5_8/Makefile
---- duma_2_5_8.orig/Makefile 2007-08-17 09:34:25.000000000 +0200
-+++ duma_2_5_8/Makefile 2007-09-07 21:50:04.000000000 +0200
-@@ -93,9 +93,6 @@
- # also define 'WIN32'
-
- # some defaults:
--CC=gcc
--CXX=g++
--AR=ar
- INSTALL=install
- RM=rm
- RMFORCE=rm -f
-@@ -281,7 +278,7 @@
-
- createconf$(EXEPOSTFIX): createconf.o
- - $(RMFORCE) createconf$(EXEPOSTFIX)
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX)
-
- tstheap$(EXEPOSTFIX): libduma.a tstheap.o
- - $(RMFORCE) tstheap$(EXEPOSTFIX)
-@@ -338,7 +335,7 @@
- # define rules how to build objects for createconf
- #
- createconf.o:
-- $(CC) $(CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-+ $(HOSTCC) $(HOSTCFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@
-
-
- #
diff --git a/patches/duma/2_5_8/110-separate_cpp.patch b/patches/duma/2_5_8/110-separate_cpp.patch
deleted file mode 100644
index 86aa6c0..0000000
--- a/patches/duma/2_5_8/110-separate_cpp.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -durN duma_2_5_8.orig/Makefile duma_2_5_8/Makefile
---- duma_2_5_8.orig/Makefile 2007-09-07 21:57:45.000000000 +0200
-+++ duma_2_5_8/Makefile 2007-09-07 21:58:35.000000000 +0200
-@@ -216,9 +216,13 @@
- dumatest.c tstheap.c testmt.c dumatestpp.cpp testoperators.cpp \
- createconf.c
-
--OBJECTS = dumapp.o duma.o sem_inc.o print.o
-+OBJECTS = duma.o sem_inc.o print.o
-+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
-
--SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
-+ifeq ($(DUMA_CPP),1)
-+OBJECTS += dumapp.o
-+SO_OBJECTS += dumapp_so.o
-+endif
-
- all: libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
- @ $(ECHOLF)
diff --git a/patches/gcc/4.9.3/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch b/patches/gcc/4.9.3/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
new file mode 100644
index 0000000..c11ad35
--- /dev/null
+++ b/patches/gcc/4.9.3/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
@@ -0,0 +1,29 @@
+From 9bf6066d588632dab9f78932df15b5b4140f31f3 Mon Sep 17 00:00:00 2001
+From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
+Date: Fri, 6 Nov 2015 14:27:23 +0100
+Subject: [PATCH] gcc/config.gcc: fix typo for powerpc e6500 cpu_is_64bit
+
+Otherwise it is not recognized as a 64-bit powerpc and gcc will not generate
+64-bit binaries by default.
+
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
+---
+ gcc/config.gcc | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 4a7cbd2..9cc765e 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -439,7 +439,7 @@ powerpc*-*-*)
+ cpu_type=rs6000
+ extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
+ case x$with_cpu in
+- xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500)
++ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
+ cpu_is_64bit=yes
+ ;;
+ esac
+--
+2.6.2
+
diff --git a/patches/gcc/6.1.0/100-uclibc-conf.patch b/patches/gcc/6.2.0/100-uclibc-conf.patch
index 73d1f0d..73d1f0d 100644
--- a/patches/gcc/6.1.0/100-uclibc-conf.patch
+++ b/patches/gcc/6.2.0/100-uclibc-conf.patch
diff --git a/patches/gcc/6.1.0/301-missing-execinfo_h.patch b/patches/gcc/6.2.0/301-missing-execinfo_h.patch
index 2d0e7ba..2d0e7ba 100644
--- a/patches/gcc/6.1.0/301-missing-execinfo_h.patch
+++ b/patches/gcc/6.2.0/301-missing-execinfo_h.patch
diff --git a/patches/gcc/6.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/6.2.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
index d8986d5..d8986d5 100644
--- a/patches/gcc/6.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
+++ b/patches/gcc/6.2.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
diff --git a/patches/gcc/6.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch b/patches/gcc/6.2.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
index 12ef48e..12ef48e 100644
--- a/patches/gcc/6.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
+++ b/patches/gcc/6.2.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
diff --git a/patches/gcc/6.1.0/810-arm-softfloat-libgcc.patch b/patches/gcc/6.2.0/810-arm-softfloat-libgcc.patch
index 5efa7fd..5efa7fd 100644
--- a/patches/gcc/6.1.0/810-arm-softfloat-libgcc.patch
+++ b/patches/gcc/6.2.0/810-arm-softfloat-libgcc.patch
diff --git a/patches/gcc/6.1.0/830-arm_unbreak_armv4t.patch b/patches/gcc/6.2.0/830-arm_unbreak_armv4t.patch
index b730059..b730059 100644
--- a/patches/gcc/6.1.0/830-arm_unbreak_armv4t.patch
+++ b/patches/gcc/6.2.0/830-arm_unbreak_armv4t.patch
diff --git a/patches/gcc/6.1.0/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/6.2.0/840-microblaze-enable-dwarf-eh-support.patch
index 9d29090..9d29090 100644
--- a/patches/gcc/6.1.0/840-microblaze-enable-dwarf-eh-support.patch
+++ b/patches/gcc/6.2.0/840-microblaze-enable-dwarf-eh-support.patch
diff --git a/patches/gcc/6.1.0/860-cilk-wchar.patch b/patches/gcc/6.2.0/860-cilk-wchar.patch
index 1d9916f..1d9916f 100644
--- a/patches/gcc/6.1.0/860-cilk-wchar.patch
+++ b/patches/gcc/6.2.0/860-cilk-wchar.patch
diff --git a/patches/glibc/2.10.1/900-march-i686.patch b/patches/glibc/2.10.1/900-march-i686.patch
deleted file mode 100644
index c21c62e..0000000
--- a/patches/glibc/2.10.1/900-march-i686.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-diff -urN glibc-2.10.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.10.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c 2010-12-30 11:33:31.520855595 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -urN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.10.1/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-12-30 11:33:31.520855595 +0100
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
diff --git a/patches/glibc/2.10.1/910-typedef-caddr.patch b/patches/glibc/2.10.1/910-typedef-caddr.patch
deleted file mode 100644
index 503b5d4..0000000
--- a/patches/glibc/2.10.1/910-typedef-caddr.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urN glibc-2.10.1-orig/posix/sys/types.h glibc-2.10.1/posix/sys/types.h
---- glibc-2.10.1-orig/posix/sys/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.10.1/posix/sys/types.h 2011-03-29 14:16:00.374064708 +0200
-@@ -114,7 +114,10 @@
- #ifdef __USE_BSD
- # ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- # endif
- #endif
-diff -urN glibc-2.10.1-orig/sunrpc/rpc/types.h glibc-2.10.1/sunrpc/rpc/types.h
---- glibc-2.10.1-orig/sunrpc/rpc/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.10.1/sunrpc/rpc/types.h 2011-03-29 14:16:32.988910439 +0200
-@@ -80,7 +80,10 @@
- #endif
- #ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- #endif
-
diff --git a/patches/glibc/2.10.1/920-make-382.patch b/patches/glibc/2.10.1/920-make-382.patch
deleted file mode 100644
index a7356d8..0000000
--- a/patches/glibc/2.10.1/920-make-382.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -urN glibc-2.10.1-orig/manual/Makefile glibc-2.10.1/manual/Makefile
---- glibc-2.10.1-orig/manual/Makefile 2006-01-07 22:43:47.000000000 -0800
-+++ glibc-2.10.1/manual/Makefile 2014-01-15 11:49:08.256982014 -0800
-@@ -232,7 +232,11 @@
- .PHONY: stubs
- stubs: $(objpfx)stubs
- endif
--$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
-+$(objpfx)stamp%:
-+ $(make-target-directory)
-+ touch $@
-+
-+$(objpfx)stubs ../po/manual.pot:
- $(make-target-directory)
- touch $@
-
diff --git a/patches/glibc/2.11.1/900-march-i686.patch b/patches/glibc/2.11.1/900-march-i686.patch
deleted file mode 100644
index 5eec275..0000000
--- a/patches/glibc/2.11.1/900-march-i686.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-diff -urN glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-12-30 11:33:31.520855595 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -urN glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-12-30 11:33:31.520855595 +0100
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
diff --git a/patches/glibc/2.11.1/910-typedef-caddr.patch b/patches/glibc/2.11.1/910-typedef-caddr.patch
deleted file mode 100644
index 4cddbc3..0000000
--- a/patches/glibc/2.11.1/910-typedef-caddr.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urN glibc-2.11.1-orig/posix/sys/types.h glibc-2.11.1/posix/sys/types.h
---- glibc-2.11.1-orig/posix/sys/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.11.1/posix/sys/types.h 2011-03-29 14:16:00.374064708 +0200
-@@ -114,7 +114,10 @@
- #ifdef __USE_BSD
- # ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- # endif
- #endif
-diff -urN glibc-2.11.1-orig/sunrpc/rpc/types.h glibc-2.11.1/sunrpc/rpc/types.h
---- glibc-2.11.1-orig/sunrpc/rpc/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.11.1/sunrpc/rpc/types.h 2011-03-29 14:16:32.988910439 +0200
-@@ -80,7 +80,10 @@
- #endif
- #ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- #endif
-
diff --git a/patches/glibc/2.11/900-march-i686.patch b/patches/glibc/2.11/900-march-i686.patch
deleted file mode 100644
index 38c3473..0000000
--- a/patches/glibc/2.11/900-march-i686.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-diff -urN glibc-2.11.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.11.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.11/nptl/sysdeps/pthread/pt-initfini.c 2010-12-30 11:33:31.520855595 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -urN glibc-2.11.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.11.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.11/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-12-30 11:33:31.520855595 +0100
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
diff --git a/patches/glibc/2.11/910-typedef-caddr.patch b/patches/glibc/2.11/910-typedef-caddr.patch
deleted file mode 100644
index eb6cc6e..0000000
--- a/patches/glibc/2.11/910-typedef-caddr.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urN glibc-2.11-orig/posix/sys/types.h glibc-2.11/posix/sys/types.h
---- glibc-2.11-orig/posix/sys/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.11/posix/sys/types.h 2011-03-29 14:16:00.374064708 +0200
-@@ -114,7 +114,10 @@
- #ifdef __USE_BSD
- # ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- # endif
- #endif
-diff -urN glibc-2.11-orig/sunrpc/rpc/types.h glibc-2.11/sunrpc/rpc/types.h
---- glibc-2.11-orig/sunrpc/rpc/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.11/sunrpc/rpc/types.h 2011-03-29 14:16:32.988910439 +0200
-@@ -80,7 +80,10 @@
- #endif
- #ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- #endif
-
diff --git a/patches/glibc/2.11/920-make-40.patch b/patches/glibc/2.11/920-make-40.patch
deleted file mode 100644
index afb7cc4..0000000
--- a/patches/glibc/2.11/920-make-40.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN glibc-2.11-orig/configure glibc-2.11/configure
---- glibc-2.11-orig/configure 2015-07-14 08:14:11.671891176 -0700
-+++ glibc-2.11/configure 2015-07-14 09:14:10.053054117 -0700
-@@ -5108,7 +5108,7 @@
- ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-- 3.79* | 3.[89]*)
-+ 3.79* | 3.[89]* | 4.* )
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
diff --git a/patches/glibc/2.12.1/900-march-i686.patch b/patches/glibc/2.12.1/900-march-i686.patch
deleted file mode 100644
index 7f5b1ce..0000000
--- a/patches/glibc/2.12.1/900-march-i686.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-diff -urN glibc-2.12.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.12.1/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.12.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-10-30 18:17:08.000000000 +0100
-+++ glibc-2.12.1/nptl/sysdeps/pthread/pt-initfini.c 2010-12-30 11:36:19.858708534 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -urN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.12.1/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-10-30 18:17:08.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-12-30 11:36:19.858708534 +0100
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
diff --git a/patches/glibc/2.12.1/910-typedef-caddr.patch b/patches/glibc/2.12.1/910-typedef-caddr.patch
deleted file mode 100644
index e29e810..0000000
--- a/patches/glibc/2.12.1/910-typedef-caddr.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urN glibc-2.12.1-orig/posix/sys/types.h glibc-2.12.1/posix/sys/types.h
---- glibc-2.12.1-orig/posix/sys/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.12.1/posix/sys/types.h 2011-03-29 14:16:00.374064708 +0200
-@@ -114,7 +114,10 @@
- #ifdef __USE_BSD
- # ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- # endif
- #endif
-diff -urN glibc-2.12.1-orig/sunrpc/rpc/types.h glibc-2.12.1/sunrpc/rpc/types.h
---- glibc-2.12.1-orig/sunrpc/rpc/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.12.1/sunrpc/rpc/types.h 2011-03-29 14:16:32.988910439 +0200
-@@ -80,7 +80,10 @@
- #endif
- #ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- #endif
-
diff --git a/patches/glibc/2.12.1/920-make-382.patch b/patches/glibc/2.12.1/920-make-382.patch
deleted file mode 100644
index 28be2fe..0000000
--- a/patches/glibc/2.12.1/920-make-382.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=blob_plain;f=source/base/glibc/make-3.82-fix.patch;hb=8217c32ecc2e14962847ba3d8a272eb64a3dba4f
-
---- glibc-2.10.1.OLD/manual/Makefile
-+++ glibc-2.10.1.NEW/manual/Makefile
-@@ -232,7 +232,9 @@
- .PHONY: stubs
- stubs: $(objpfx)stubs
- endif
--$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
-+$(objpfx)stubs ../po/manual.pot:
-+ touch $@
-+$(objpfx)stamp%:
- $(make-target-directory)
- touch $@
-
diff --git a/patches/glibc/2.12.2/900-march-i686.patch b/patches/glibc/2.12.2/900-march-i686.patch
deleted file mode 100644
index 6030de9..0000000
--- a/patches/glibc/2.12.2/900-march-i686.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-diff -urN glibc-2.12.2.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.12.2/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.12.2.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-10-30 18:17:08.000000000 +0100
-+++ glibc-2.12.2/nptl/sysdeps/pthread/pt-initfini.c 2010-12-30 11:36:19.858708534 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -urN glibc-2.12.2.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.12.2/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.12.2.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-10-30 18:17:08.000000000 +0100
-+++ glibc-2.12.2/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-12-30 11:36:19.858708534 +0100
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
diff --git a/patches/glibc/2.12.2/910-typedef-caddr.patch b/patches/glibc/2.12.2/910-typedef-caddr.patch
deleted file mode 100644
index 4bc75cb..0000000
--- a/patches/glibc/2.12.2/910-typedef-caddr.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urN glibc-2.12.2-orig/posix/sys/types.h glibc-2.12.2/posix/sys/types.h
---- glibc-2.12.2-orig/posix/sys/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.12.2/posix/sys/types.h 2011-03-29 14:16:00.374064708 +0200
-@@ -114,7 +114,10 @@
- #ifdef __USE_BSD
- # ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- # endif
- #endif
-diff -urN glibc-2.12.2-orig/sunrpc/rpc/types.h glibc-2.12.2/sunrpc/rpc/types.h
---- glibc-2.12.2-orig/sunrpc/rpc/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.12.2/sunrpc/rpc/types.h 2011-03-29 14:16:32.988910439 +0200
-@@ -80,7 +80,10 @@
- #endif
- #ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- #endif
-
diff --git a/patches/glibc/2.13/900-march-i686.patch b/patches/glibc/2.13/900-march-i686.patch
deleted file mode 100644
index 7f5b1ce..0000000
--- a/patches/glibc/2.13/900-march-i686.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-diff -urN glibc-2.12.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.12.1/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.12.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-10-30 18:17:08.000000000 +0100
-+++ glibc-2.12.1/nptl/sysdeps/pthread/pt-initfini.c 2010-12-30 11:36:19.858708534 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -urN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.12.1/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-10-30 18:17:08.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-12-30 11:36:19.858708534 +0100
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
diff --git a/patches/glibc/2.13/910-typedef-caddr.patch b/patches/glibc/2.13/910-typedef-caddr.patch
deleted file mode 100644
index e29e810..0000000
--- a/patches/glibc/2.13/910-typedef-caddr.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urN glibc-2.12.1-orig/posix/sys/types.h glibc-2.12.1/posix/sys/types.h
---- glibc-2.12.1-orig/posix/sys/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.12.1/posix/sys/types.h 2011-03-29 14:16:00.374064708 +0200
-@@ -114,7 +114,10 @@
- #ifdef __USE_BSD
- # ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- # endif
- #endif
-diff -urN glibc-2.12.1-orig/sunrpc/rpc/types.h glibc-2.12.1/sunrpc/rpc/types.h
---- glibc-2.12.1-orig/sunrpc/rpc/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.12.1/sunrpc/rpc/types.h 2011-03-29 14:16:32.988910439 +0200
-@@ -80,7 +80,10 @@
- #endif
- #ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- #endif
-
diff --git a/patches/glibc/2.13/950-initfini-ppc64.patch b/patches/glibc/2.13/950-initfini-ppc64.patch
deleted file mode 100644
index 87f8d23..0000000
--- a/patches/glibc/2.13/950-initfini-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Prevent erroneous inline optimization of initfini.s on PowerPC64.
-
-The problem and the fix was reported there:
-http://sourceware.org/ml/libc-alpha/2012-01/msg00195.html
-Git commit:
-commit 1fe05ea95e1460e5e1cf1568a8ce3982f0f02de6
-Author: Ryan S. Arnold <rsa@us.ibm.com>
-Date: Tue May 3 17:26:17 2011 -0500
-
---- glibc.orig/sysdeps/powerpc/powerpc64/Makefile 2012-12-22 19:10:06.713568781 -0800
-+++ glibc/sysdeps/powerpc/powerpc64/Makefile 2012-12-22 19:10:50.318605517 -0800
-@@ -31,7 +31,7 @@
- ifneq ($(elf),no)
- # The initfini generation code doesn't work in the presence of -fPIC, so
- # we use -fpic instead which is much better.
--CFLAGS-initfini.s += -fpic -O1
-+CFLAGS-initfini.s += -fpic -O1 -fno-inline
- endif
- endif
-
diff --git a/patches/glibc/2.14.1/900-cpuid-include.patch b/patches/glibc/2.14.1/900-cpuid-include.patch
deleted file mode 100644
index 0b8db71..0000000
--- a/patches/glibc/2.14.1/900-cpuid-include.patch
+++ /dev/null
@@ -1,628 +0,0 @@
-This patch fixes another configure test issue when bootstrapping.
-sysdeps/i386/configure.in uses the obsolete AC_HEADER_CHECK macro to
-test for cpuid.h, and that macro tries to include various other
-standard headers (which come from the library, unlike cpuid.h which
-comes from the compiler, so aren't available when bootstrapping) in
-the test code it compiles. This patch changes the code to use
-AC_CHECK_HEADER, with the fourth argument used to prevent any default
-includes being used in the test.
-
-Tested x86_64 (native).
-
-2012-03-07 Joseph Myers <joseph@codesourcery.com>
-
- * sysdeps/i386/configure.in (cpuid.h): Use AC_CHECK_HEADER with no
- default includes instead of AC_HEADER_CHECK.
- * sysdeps/i386/configure: Regenerated.
-
-Origin: http://sourceware.org/ml/libc-alpha/2012-03/msg00177.html
-
-diff -Nur glibc-2.14.1.orig/sysdeps/i386/configure glibc-2.14.1/sysdeps/i386/configure
---- glibc-2.14.1.orig/sysdeps/i386/configure 2011-10-07 20:48:55.000000000 +1100
-+++ glibc-2.14.1/sysdeps/i386/configure 2012-07-25 01:23:11.799118927 +1000
-@@ -16,23 +16,6 @@
- as_fn_set_status $1
- exit $1
- } # as_fn_exit
--# as_fn_arith ARG...
--# ------------------
--# Perform arithmetic evaluation on the ARGs, and store the result in the
--# global $as_val. Take advantage of shells that can avoid forks. The arguments
--# must be portable across $(()) and expr.
--if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-- eval 'as_fn_arith ()
-- {
-- as_val=$(( $* ))
-- }'
--else
-- as_fn_arith ()
-- {
-- as_val=`expr "$@" || test $? -eq 1`
-- }
--fi # as_fn_arith
--
- if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-@@ -89,6 +72,10 @@
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
-+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-+ # already done that, so ensure we don't try to do so again and fall
-+ # in an infinite loop. This has already happened in practice.
-+ _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
-@@ -97,42 +84,6 @@
- exit
- }
-
--# Factoring default headers for most tests.
--ac_includes_default="\
--#include <stdio.h>
--#ifdef HAVE_SYS_TYPES_H
--# include <sys/types.h>
--#endif
--#ifdef HAVE_SYS_STAT_H
--# include <sys/stat.h>
--#endif
--#ifdef STDC_HEADERS
--# include <stdlib.h>
--# include <stddef.h>
--#else
--# ifdef HAVE_STDLIB_H
--# include <stdlib.h>
--# endif
--#endif
--#ifdef HAVE_STRING_H
--# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
--# include <memory.h>
--# endif
--# include <string.h>
--#endif
--#ifdef HAVE_STRINGS_H
--# include <strings.h>
--#endif
--#ifdef HAVE_INTTYPES_H
--# include <inttypes.h>
--#endif
--#ifdef HAVE_STDINT_H
--# include <stdint.h>
--#endif
--#ifdef HAVE_UNISTD_H
--# include <unistd.h>
--#endif"
--
-
- # ac_fn_c_try_compile LINENO
- # --------------------------
-@@ -167,177 +118,11 @@
-
- ac_retval=1
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_compile
-
--# ac_fn_c_try_cpp LINENO
--# ----------------------
--# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
--ac_fn_c_try_cpp ()
--{
-- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-- if { { ac_try="$ac_cpp conftest.$ac_ext"
--case "(($ac_try" in
-- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-- *) ac_try_echo=$ac_try;;
--esac
--eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
--$as_echo "$ac_try_echo"; } >&5
-- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-- ac_status=$?
-- if test -s conftest.err; then
-- grep -v '^ *+' conftest.err >conftest.er1
-- cat conftest.er1 >&5
-- mv -f conftest.er1 conftest.err
-- fi
-- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-- test $ac_status = 0; } >/dev/null && {
-- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-- test ! -s conftest.err
-- }; then :
-- ac_retval=0
--else
-- $as_echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
-- ac_retval=1
--fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-- as_fn_set_status $ac_retval
--
--} # ac_fn_c_try_cpp
--
--# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
--# -------------------------------------------------------
--# Tests whether HEADER exists, giving a warning if it cannot be compiled using
--# the include files in INCLUDES and setting the cache variable VAR
--# accordingly.
--ac_fn_c_check_header_mongrel ()
--{
-- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-- if eval "test \"\${$3+set}\"" = set; then :
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
--$as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-- $as_echo_n "(cached) " >&6
--fi
--eval ac_res=\$$3
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
--$as_echo "$ac_res" >&6; }
--else
-- # Is the header compilable?
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
--$as_echo_n "checking $2 usability... " >&6; }
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--$4
--#include <$2>
--_ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
-- ac_header_compiler=yes
--else
-- ac_header_compiler=no
--fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
--$as_echo "$ac_header_compiler" >&6; }
--
--# Is the header present?
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
--$as_echo_n "checking $2 presence... " >&6; }
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <$2>
--_ACEOF
--if ac_fn_c_try_cpp "$LINENO"; then :
-- ac_header_preproc=yes
--else
-- ac_header_preproc=no
--fi
--rm -f conftest.err conftest.$ac_ext
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
--$as_echo "$ac_header_preproc" >&6; }
--
--# So? What about this header?
--case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-- yes:no: )
-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
--$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
--$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-- ;;
-- no:yes:* )
-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
--$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
--$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
--$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
--$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
-- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
--$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-- ;;
--esac
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
--$as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-- $as_echo_n "(cached) " >&6
--else
-- eval "$3=\$ac_header_compiler"
--fi
--eval ac_res=\$$3
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
--$as_echo "$ac_res" >&6; }
--fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
--
--} # ac_fn_c_check_header_mongrel
--
--# ac_fn_c_try_run LINENO
--# ----------------------
--# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
--# that executables *can* be run.
--ac_fn_c_try_run ()
--{
-- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-- if { { ac_try="$ac_link"
--case "(($ac_try" in
-- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-- *) ac_try_echo=$ac_try;;
--esac
--eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
--$as_echo "$ac_try_echo"; } >&5
-- (eval "$ac_link") 2>&5
-- ac_status=$?
-- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-- { { case "(($ac_try" in
-- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-- *) ac_try_echo=$ac_try;;
--esac
--eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
--$as_echo "$ac_try_echo"; } >&5
-- (eval "$ac_try") 2>&5
-- ac_status=$?
-- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-- test $ac_status = 0; }; }; then :
-- ac_retval=0
--else
-- $as_echo "$as_me: program exited with status $ac_status" >&5
-- $as_echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
-- ac_retval=$ac_status
--fi
-- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-- as_fn_set_status $ac_retval
--
--} # ac_fn_c_try_run
--
- # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
- # -------------------------------------------------------
- # Tests whether HEADER exists and can be compiled using the include files in
-@@ -347,7 +132,7 @@
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -365,275 +150,16 @@
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_header_compile
- # This file is generated from configure.in by Autoconf. DO NOT EDIT!
- # Local configure fragment for sysdeps/i386.
-
-
--
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
--$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
--if test "${ac_cv_path_GREP+set}" = set; then :
-- $as_echo_n "(cached) " >&6
--else
-- if test -z "$GREP"; then
-- ac_path_GREP_found=false
-- # Loop through the user's path and test for each of PROGNAME-LIST
-- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
--do
-- IFS=$as_save_IFS
-- test -z "$as_dir" && as_dir=.
-- for ac_prog in grep ggrep; do
-- for ac_exec_ext in '' $ac_executable_extensions; do
-- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
--# Check for GNU ac_path_GREP and select it if it is found.
-- # Check for GNU $ac_path_GREP
--case `"$ac_path_GREP" --version 2>&1` in
--*GNU*)
-- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
--*)
-- ac_count=0
-- $as_echo_n 0123456789 >"conftest.in"
-- while :
-- do
-- cat "conftest.in" "conftest.in" >"conftest.tmp"
-- mv "conftest.tmp" "conftest.in"
-- cp "conftest.in" "conftest.nl"
-- $as_echo 'GREP' >> "conftest.nl"
-- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-- as_fn_arith $ac_count + 1 && ac_count=$as_val
-- if test $ac_count -gt ${ac_path_GREP_max-0}; then
-- # Best one so far, save it but keep looking for a better one
-- ac_cv_path_GREP="$ac_path_GREP"
-- ac_path_GREP_max=$ac_count
-- fi
-- # 10*(2^10) chars as input seems more than enough
-- test $ac_count -gt 10 && break
-- done
-- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
--esac
--
-- $ac_path_GREP_found && break 3
-- done
-- done
-- done
--IFS=$as_save_IFS
-- if test -z "$ac_cv_path_GREP"; then
-- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-- fi
--else
-- ac_cv_path_GREP=$GREP
--fi
--
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
--$as_echo "$ac_cv_path_GREP" >&6; }
-- GREP="$ac_cv_path_GREP"
--
--
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
--$as_echo_n "checking for egrep... " >&6; }
--if test "${ac_cv_path_EGREP+set}" = set; then :
-- $as_echo_n "(cached) " >&6
--else
-- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-- then ac_cv_path_EGREP="$GREP -E"
-- else
-- if test -z "$EGREP"; then
-- ac_path_EGREP_found=false
-- # Loop through the user's path and test for each of PROGNAME-LIST
-- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
--do
-- IFS=$as_save_IFS
-- test -z "$as_dir" && as_dir=.
-- for ac_prog in egrep; do
-- for ac_exec_ext in '' $ac_executable_extensions; do
-- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
--# Check for GNU ac_path_EGREP and select it if it is found.
-- # Check for GNU $ac_path_EGREP
--case `"$ac_path_EGREP" --version 2>&1` in
--*GNU*)
-- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
--*)
-- ac_count=0
-- $as_echo_n 0123456789 >"conftest.in"
-- while :
-- do
-- cat "conftest.in" "conftest.in" >"conftest.tmp"
-- mv "conftest.tmp" "conftest.in"
-- cp "conftest.in" "conftest.nl"
-- $as_echo 'EGREP' >> "conftest.nl"
-- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-- as_fn_arith $ac_count + 1 && ac_count=$as_val
-- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-- # Best one so far, save it but keep looking for a better one
-- ac_cv_path_EGREP="$ac_path_EGREP"
-- ac_path_EGREP_max=$ac_count
-- fi
-- # 10*(2^10) chars as input seems more than enough
-- test $ac_count -gt 10 && break
-- done
-- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
--esac
--
-- $ac_path_EGREP_found && break 3
-- done
-- done
-- done
--IFS=$as_save_IFS
-- if test -z "$ac_cv_path_EGREP"; then
-- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-- fi
--else
-- ac_cv_path_EGREP=$EGREP
--fi
--
-- fi
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
--$as_echo "$ac_cv_path_EGREP" >&6; }
-- EGREP="$ac_cv_path_EGREP"
--
--
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
--$as_echo_n "checking for ANSI C header files... " >&6; }
--if test "${ac_cv_header_stdc+set}" = set; then :
-- $as_echo_n "(cached) " >&6
--else
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <stdlib.h>
--#include <stdarg.h>
--#include <string.h>
--#include <float.h>
--
--int
--main ()
--{
--
-- ;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
-- ac_cv_header_stdc=yes
--else
-- ac_cv_header_stdc=no
--fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
--
--if test $ac_cv_header_stdc = yes; then
-- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <string.h>
--
--_ACEOF
--if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-- $EGREP "memchr" >/dev/null 2>&1; then :
--
--else
-- ac_cv_header_stdc=no
--fi
--rm -f conftest*
--
--fi
--
--if test $ac_cv_header_stdc = yes; then
-- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <stdlib.h>
--
--_ACEOF
--if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-- $EGREP "free" >/dev/null 2>&1; then :
--
--else
-- ac_cv_header_stdc=no
--fi
--rm -f conftest*
--
--fi
--
--if test $ac_cv_header_stdc = yes; then
-- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-- if test "$cross_compiling" = yes; then :
-- :
--else
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <ctype.h>
--#include <stdlib.h>
--#if ((' ' & 0x0FF) == 0x020)
--# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
--# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
--#else
--# define ISLOWER(c) \
-- (('a' <= (c) && (c) <= 'i') \
-- || ('j' <= (c) && (c) <= 'r') \
-- || ('s' <= (c) && (c) <= 'z'))
--# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
--#endif
--
--#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
--int
--main ()
--{
-- int i;
-- for (i = 0; i < 256; i++)
-- if (XOR (islower (i), ISLOWER (i))
-- || toupper (i) != TOUPPER (i))
-- return 2;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_run "$LINENO"; then :
--
--else
-- ac_cv_header_stdc=no
--fi
--rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-- conftest.$ac_objext conftest.beam conftest.$ac_ext
--fi
--
--fi
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
--$as_echo "$ac_cv_header_stdc" >&6; }
--if test $ac_cv_header_stdc = yes; then
--
--$as_echo "#define STDC_HEADERS 1" >>confdefs.h
--
--fi
--
--# On IRIX 5.3, sys/types and inttypes.h are conflicting.
--for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-- inttypes.h stdint.h unistd.h
--do :
-- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
--ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-+ac_fn_c_check_header_compile "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" "/* No default includes. */
- "
--if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-- cat >>confdefs.h <<_ACEOF
--#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
--_ACEOF
--
--fi
--
--done
--
--
--ac_fn_c_check_header_mongrel "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" "$ac_includes_default"
--if test "x$ac_cv_header_cpuid_h" = x""yes; then :
-+if test "x$ac_cv_header_cpuid_h" = xyes; then :
-
- else
- as_fn_error $? "gcc must provide the <cpuid.h> header" "$LINENO" 5
-@@ -643,7 +169,7 @@
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -g produces usable source locations for assembler-with-cpp" >&5
- $as_echo_n "checking if -g produces usable source locations for assembler-with-cpp... " >&6; }
--if test "${libc_cv_cpp_asm_debuginfo+set}" = set; then :
-+if ${libc_cv_cpp_asm_debuginfo+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat > conftest.S <<EOF
-@@ -693,7 +219,7 @@
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4 support" >&5
- $as_echo_n "checking for SSE4 support... " >&6; }
--if test "${libc_cv_cc_sse4+set}" = set; then :
-+if ${libc_cv_cc_sse4+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if { ac_try='${CC-cc} -msse4 -xc /dev/null -S -o /dev/null'
-@@ -716,7 +242,7 @@
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler -mtune=i686 support" >&5
- $as_echo_n "checking for assembler -mtune=i686 support... " >&6; }
--if test "${libc_cv_as_i686+set}" = set; then :
-+if ${libc_cv_as_i686+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if { ac_try='${CC-cc} -Wa,-mtune=i686 -xc /dev/null -S -o /dev/null'
-@@ -735,7 +261,7 @@
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX support" >&5
- $as_echo_n "checking for AVX support... " >&6; }
--if test "${libc_cv_cc_avx+set}" = set; then :
-+if ${libc_cv_cc_avx+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if { ac_try='${CC-cc} -mavx -xc /dev/null -S -o /dev/null'
-@@ -758,7 +284,7 @@
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mno-vzeroupper support" >&5
- $as_echo_n "checking for -mno-vzeroupper support... " >&6; }
--if test "${libc_cv_cc_novzeroupper+set}" = set; then :
-+if ${libc_cv_cc_novzeroupper+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if { ac_try='${CC-cc} -mno-vzeroupper -xc /dev/null -S -o /dev/null'
-diff -Nur glibc-2.14.1.orig/sysdeps/i386/configure.in glibc-2.14.1/sysdeps/i386/configure.in
---- glibc-2.14.1.orig/sysdeps/i386/configure.in 2011-10-07 20:48:55.000000000 +1100
-+++ glibc-2.14.1/sysdeps/i386/configure.in 2012-07-25 01:00:49.345025022 +1000
-@@ -1,8 +1,9 @@
- GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
- # Local configure fragment for sysdeps/i386.
-
--AC_HEADER_CHECK([cpuid.h], ,
-- [AC_MSG_ERROR([gcc must provide the <cpuid.h> header])])
-+AC_CHECK_HEADER([cpuid.h], ,
-+ [AC_MSG_ERROR([gcc must provide the <cpuid.h> header])],
-+ [/* No default includes. */])
-
- AC_CACHE_CHECK(if -g produces usable source locations for assembler-with-cpp,
- libc_cv_cpp_asm_debuginfo, [dnl
-
diff --git a/patches/glibc/2.14.1/910-asm-i686.patch b/patches/glibc/2.14.1/910-asm-i686.patch
deleted file mode 100644
index b049887..0000000
--- a/patches/glibc/2.14.1/910-asm-i686.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Submitted By: Matt Burgess <matthew_at_linuxfromscratch_dot_org>
-Date: 2010-04-18
-Initial Package Version: 2.11.1
-Upstream Status: Not Submitted
-Origin: http://www.eglibc.org/archives/patches/msg00073.html
-Description: Fixes the following build problem with GCC-4.5.0:
-
-/mnt/lfs/sources/libc-build/math/s_frexp.os.dt -MT /mnt/lfs/sources/libc-build/math/s_frexp.os
-./sysdeps/i386/fpu/s_frexp.S: Assembler messages:
-./sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
-./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
-./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
-./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
-./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.'
-./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
-./sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive
-./sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
-./sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression
-make[2]: *** [/mnt/lfs/sources/libc-build/math/s_frexp.os] Error 1
-
-diff -Naur glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 20:10:20.000000000 +0000
-+++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17 11:34:06.882681001 +0000
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -Naur glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 20:10:20.000000000 +0000
-+++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17 11:34:06.882681001 +0000
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
-
diff --git a/patches/glibc/2.14.1/950-initfini-ppc64.patch b/patches/glibc/2.14.1/950-initfini-ppc64.patch
deleted file mode 100644
index 87f8d23..0000000
--- a/patches/glibc/2.14.1/950-initfini-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Prevent erroneous inline optimization of initfini.s on PowerPC64.
-
-The problem and the fix was reported there:
-http://sourceware.org/ml/libc-alpha/2012-01/msg00195.html
-Git commit:
-commit 1fe05ea95e1460e5e1cf1568a8ce3982f0f02de6
-Author: Ryan S. Arnold <rsa@us.ibm.com>
-Date: Tue May 3 17:26:17 2011 -0500
-
---- glibc.orig/sysdeps/powerpc/powerpc64/Makefile 2012-12-22 19:10:06.713568781 -0800
-+++ glibc/sysdeps/powerpc/powerpc64/Makefile 2012-12-22 19:10:50.318605517 -0800
-@@ -31,7 +31,7 @@
- ifneq ($(elf),no)
- # The initfini generation code doesn't work in the presence of -fPIC, so
- # we use -fpic instead which is much better.
--CFLAGS-initfini.s += -fpic -O1
-+CFLAGS-initfini.s += -fpic -O1 -fno-inline
- endif
- endif
-
diff --git a/patches/glibc/2.14/950-initfini-ppc64.patch b/patches/glibc/2.14/950-initfini-ppc64.patch
deleted file mode 100644
index 87f8d23..0000000
--- a/patches/glibc/2.14/950-initfini-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Prevent erroneous inline optimization of initfini.s on PowerPC64.
-
-The problem and the fix was reported there:
-http://sourceware.org/ml/libc-alpha/2012-01/msg00195.html
-Git commit:
-commit 1fe05ea95e1460e5e1cf1568a8ce3982f0f02de6
-Author: Ryan S. Arnold <rsa@us.ibm.com>
-Date: Tue May 3 17:26:17 2011 -0500
-
---- glibc.orig/sysdeps/powerpc/powerpc64/Makefile 2012-12-22 19:10:06.713568781 -0800
-+++ glibc/sysdeps/powerpc/powerpc64/Makefile 2012-12-22 19:10:50.318605517 -0800
-@@ -31,7 +31,7 @@
- ifneq ($(elf),no)
- # The initfini generation code doesn't work in the presence of -fPIC, so
- # we use -fpic instead which is much better.
--CFLAGS-initfini.s += -fpic -O1
-+CFLAGS-initfini.s += -fpic -O1 -fno-inline
- endif
- endif
-
diff --git a/patches/glibc/2.16.0/500-fix-parsing-of-numeric-hosts-in-gethostbyname_r.patch b/patches/glibc/2.16.0/500-fix-parsing-of-numeric-hosts-in-gethostbyname_r.patch
deleted file mode 100644
index 803ac6f..0000000
--- a/patches/glibc/2.16.0/500-fix-parsing-of-numeric-hosts-in-gethostbyname_r.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-From 536ae0651b015b1f6140ec01775d4deaacf12c0c Mon Sep 17 00:00:00 2001
-From: Andreas Schwab <schwab@suse.de>
-Date: Mon, 21 Jan 2013 17:41:28 +0100
-Subject: [PATCH] Fix parsing of numeric hosts in gethostbyname_r
-
-Ported from master, fixes CVE-2015-0235.
----
- nss/Makefile | 2 -
- nss/digits_dots.c | 73 +++++++++++++------------------------------------
- nss/getXXbyYY_r.c | 3 ++
- nss/test-digits-dots.c | 38 +++++++++++++++++++++++++
- 4 files changed, 62 insertions(+), 54 deletions(-)
- create mode 100644 nss/test-digits-dots.c
-
---- a/nss/Makefile
-+++ b/nss/Makefile
-@@ -38,7 +38,7 @@ install-bin := getent makedb
- makedb-modules = xmalloc hash-string
- extra-objs += $(makedb-modules:=.o)
-
--tests = test-netdb tst-nss-test1
-+tests = test-netdb tst-nss-test1 test-digits-dots
- xtests = bug-erange
-
- include ../Makeconfig
---- a/nss/digits_dots.c
-+++ b/nss/digits_dots.c
-@@ -46,7 +46,10 @@ __nss_hostname_digits_dots (const char *
- {
- if (h_errnop)
- *h_errnop = NETDB_INTERNAL;
-- *result = NULL;
-+ if (buffer_size == NULL)
-+ *status = NSS_STATUS_TRYAGAIN;
-+ else
-+ *result = NULL;
- return -1;
- }
-
-@@ -83,14 +86,16 @@ __nss_hostname_digits_dots (const char *
- }
-
- size_needed = (sizeof (*host_addr)
-- + sizeof (*h_addr_ptrs) + strlen (name) + 1);
-+ + sizeof (*h_addr_ptrs)
-+ + sizeof (*h_alias_ptr) + strlen (name) + 1);
-
- if (buffer_size == NULL)
- {
- if (buflen < size_needed)
- {
-+ *status = NSS_STATUS_TRYAGAIN;
- if (h_errnop != NULL)
-- *h_errnop = TRY_AGAIN;
-+ *h_errnop = NETDB_INTERNAL;
- __set_errno (ERANGE);
- goto done;
- }
-@@ -109,7 +114,7 @@ __nss_hostname_digits_dots (const char *
- *buffer_size = 0;
- __set_errno (save);
- if (h_errnop != NULL)
-- *h_errnop = TRY_AGAIN;
-+ *h_errnop = NETDB_INTERNAL;
- *result = NULL;
- goto done;
- }
-@@ -149,7 +154,9 @@ __nss_hostname_digits_dots (const char *
- if (! ok)
- {
- *h_errnop = HOST_NOT_FOUND;
-- if (buffer_size)
-+ if (buffer_size == NULL)
-+ *status = NSS_STATUS_NOTFOUND;
-+ else
- *result = NULL;
- goto done;
- }
-@@ -190,7 +197,7 @@ __nss_hostname_digits_dots (const char *
- if (buffer_size == NULL)
- *status = NSS_STATUS_SUCCESS;
- else
-- *result = resbuf;
-+ *result = resbuf;
- goto done;
- }
-
-@@ -201,15 +208,6 @@ __nss_hostname_digits_dots (const char *
-
- if ((isxdigit (name[0]) && strchr (name, ':') != NULL) || name[0] == ':')
- {
-- const char *cp;
-- char *hostname;
-- typedef unsigned char host_addr_t[16];
-- host_addr_t *host_addr;
-- typedef char *host_addr_list_t[2];
-- host_addr_list_t *h_addr_ptrs;
-- size_t size_needed;
-- int addr_size;
--
- switch (af)
- {
- default:
-@@ -225,7 +223,10 @@ __nss_hostname_digits_dots (const char *
- /* This is not possible. We cannot represent an IPv6 address
- in an `struct in_addr' variable. */
- *h_errnop = HOST_NOT_FOUND;
-- *result = NULL;
-+ if (buffer_size == NULL)
-+ *status = NSS_STATUS_NOTFOUND;
-+ else
-+ *result = NULL;
- goto done;
-
- case AF_INET6:
-@@ -233,42 +234,6 @@ __nss_hostname_digits_dots (const char *
- break;
- }
-
-- size_needed = (sizeof (*host_addr)
-- + sizeof (*h_addr_ptrs) + strlen (name) + 1);
--
-- if (buffer_size == NULL && buflen < size_needed)
-- {
-- if (h_errnop != NULL)
-- *h_errnop = TRY_AGAIN;
-- __set_errno (ERANGE);
-- goto done;
-- }
-- else if (buffer_size != NULL && *buffer_size < size_needed)
-- {
-- char *new_buf;
-- *buffer_size = size_needed;
-- new_buf = realloc (*buffer, *buffer_size);
--
-- if (new_buf == NULL)
-- {
-- save = errno;
-- free (*buffer);
-- __set_errno (save);
-- *buffer = NULL;
-- *buffer_size = 0;
-- *result = NULL;
-- goto done;
-- }
-- *buffer = new_buf;
-- }
--
-- memset (*buffer, '\0', size_needed);
--
-- host_addr = (host_addr_t *) *buffer;
-- h_addr_ptrs = (host_addr_list_t *)
-- ((char *) host_addr + sizeof (*host_addr));
-- hostname = (char *) h_addr_ptrs + sizeof (*h_addr_ptrs);
--
- for (cp = name;; ++cp)
- {
- if (!*cp)
-@@ -281,7 +246,9 @@ __nss_hostname_digits_dots (const char *
- if (inet_pton (AF_INET6, name, host_addr) <= 0)
- {
- *h_errnop = HOST_NOT_FOUND;
-- if (buffer_size)
-+ if (buffer_size == NULL)
-+ *status = NSS_STATUS_NOTFOUND;
-+ else
- *result = NULL;
- goto done;
- }
---- /dev/null
-+++ b/nss/test-digits-dots.c
-@@ -0,0 +1,38 @@
-+/* Copyright (C) 2013 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, see
-+ <http://www.gnu.org/licenses/>. */
-+
-+/* Testcase for BZ #15014 */
-+
-+#include <stdlib.h>
-+#include <netdb.h>
-+#include <errno.h>
-+
-+static int
-+do_test (void)
-+{
-+ char buf[32];
-+ struct hostent *result = NULL;
-+ struct hostent ret;
-+ int h_err = 0;
-+ int err;
-+
-+ err = gethostbyname_r ("1.2.3.4", &ret, buf, sizeof (buf), &result, &h_err);
-+ return err == ERANGE && h_err == NETDB_INTERNAL ? EXIT_SUCCESS : EXIT_FAILURE;
-+}
-+
-+#define TEST_FUNCTION do_test ()
-+#include "../test-skeleton.c"
---- a/nss/getXXbyYY_r.c
-+++ b/nss/getXXbyYY_r.c
-@@ -179,6 +179,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
- case -1:
- return errno;
- case 1:
-+#ifdef NEED_H_ERRNO
-+ any_service = true;
-+#endif
- goto done;
- }
- #endif
diff --git a/patches/glibc/2.17/100-Fix-ARM-build-with-GCC-trunk.patch b/patches/glibc/2.17/100-Fix-ARM-build-with-GCC-trunk.patch
deleted file mode 100644
index 59f95aa..0000000
--- a/patches/glibc/2.17/100-Fix-ARM-build-with-GCC-trunk.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 175cef4163dd60f95106cfd5f593b8a4e09d02c9 Mon Sep 17 00:00:00 2001
-From: Joseph Myers <joseph@codesourcery.com>
-Date: Tue, 20 May 2014 21:27:13 +0000
-Subject: [PATCH] Fix ARM build with GCC trunk.
-
-sysdeps/unix/sysv/linux/arm/unwind-resume.c and
-sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
-variables that are written in C code but only read from toplevel asms.
-Current GCC trunk now optimizes away such apparently write-only static
-variables, so causing a build failure. This patch marks those
-variables with __attribute_used__ to avoid that optimization.
-
-Tested that this fixes the build for ARM.
-
- * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
- (libgcc_s_resume): Use __attribute_used__.
- * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
- Likewise.
----
- sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c | 3 ++-
- sysdeps/unix/sysv/linux/arm/unwind-resume.c | 3 ++-
- 3 files changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
-index 6ccd9b4..660d148 100644
---- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
-+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
-@@ -22,7 +22,8 @@
- #include <pthreadP.h>
-
- static void *libgcc_s_handle;
--static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
-+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
-+ __attribute_used__;
- static _Unwind_Reason_Code (*libgcc_s_personality)
- (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
- static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
-diff --git a/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/unwind-resume.c
-index bff3e2b..1f1eb71 100644
---- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
-+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
-@@ -20,7 +20,8 @@
- #include <stdio.h>
- #include <unwind.h>
-
--static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
-+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
-+ __attribute_used__;
- static _Unwind_Reason_Code (*libgcc_s_personality)
- (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
-
---
-1.9.4
-
diff --git a/patches/glibc/2.18/120-support-make4.patch b/patches/glibc/2.18/120-support-make4.patch
new file mode 100644
index 0000000..ca2bae0
--- /dev/null
+++ b/patches/glibc/2.18/120-support-make4.patch
@@ -0,0 +1,38 @@
+Original patch modified: Removed ChangeLog and NEWS sections, ajdust for configure.in
+KS
+
+From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
+Date: Thu, 31 Oct 2013 02:37:50 +0000 (+1000)
+Subject: Accept make versions 4.0 and greater
+X-Git-Tag: glibc-2.19~556
+X-Git-Url: https://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=28d708c44bc47b56f6551ff285f78edcf61c208a;hp=a56ee40b176d0a3f47f2a7eb75208f2e3763c9fd
+
+Accept make versions 4.0 and greater
+---
+
+diff --git a/configure b/configure
+index f382138..5e61abd 100755
+--- a/configure
++++ b/configure
+@@ -4761,7 +4761,7 @@ $as_echo_n "checking version of $MAKE... " >&6; }
+ ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 3.79* | 3.[89]*)
++ 3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+diff --git a/configure.in b/configure.in
+index 49b70fd..6da8efd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -984,7 +984,7 @@ AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
+ critic_missing="$critic_missing gcc")
+ AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
+ [GNU Make[^0-9]*\([0-9][0-9.]*\)],
+- [3.79* | 3.[89]*], critic_missing="$critic_missing make")
++ [3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make")
+
+ AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
+ [GNU gettext.* \([0-9]*\.[0-9.]*\)],
diff --git a/patches/glibc/2.18/130-arm-unwind.patch b/patches/glibc/2.18/130-arm-unwind.patch
new file mode 100644
index 0000000..69cc07a
--- /dev/null
+++ b/patches/glibc/2.18/130-arm-unwind.patch
@@ -0,0 +1,48 @@
+diff -urN glibc-2.18.orig/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc-2.18/nptl/sysdeps/pthread/unwind-forcedunwind.c
+--- glibc-2.18.orig/nptl/sysdeps/pthread/unwind-forcedunwind.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/nptl/sysdeps/pthread/unwind-forcedunwind.c 2016-09-15 02:30:09.199939478 +0300
+@@ -24,7 +24,7 @@
+ #include <gnu/lib-names.h>
+
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
+ struct _Unwind_Context *);
+diff -urN glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+--- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c 2016-09-15 02:29:07.096945862 +0300
+@@ -22,7 +22,7 @@
+ #include <pthreadP.h>
+
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff -urN glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+--- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c 2016-09-15 02:29:37.352917115 +0300
+@@ -20,7 +20,7 @@
+ #include <stdio.h>
+ #include <unwind.h>
+
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+
+diff -urN glibc-2.18.orig/sysdeps/gnu/unwind-resume.c glibc-2.18/sysdeps/gnu/unwind-resume.c
+--- glibc-2.18.orig/sysdeps/gnu/unwind-resume.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/sysdeps/gnu/unwind-resume.c 2016-09-15 02:29:53.376431503 +0300
+@@ -21,7 +21,7 @@
+ #include <unwind.h>
+ #include <gnu/lib-names.h>
+
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
+ struct _Unwind_Context *);
diff --git a/patches/glibc/2.19/130-arm-unwind.patch b/patches/glibc/2.19/130-arm-unwind.patch
new file mode 100644
index 0000000..69cc07a
--- /dev/null
+++ b/patches/glibc/2.19/130-arm-unwind.patch
@@ -0,0 +1,48 @@
+diff -urN glibc-2.18.orig/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc-2.18/nptl/sysdeps/pthread/unwind-forcedunwind.c
+--- glibc-2.18.orig/nptl/sysdeps/pthread/unwind-forcedunwind.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/nptl/sysdeps/pthread/unwind-forcedunwind.c 2016-09-15 02:30:09.199939478 +0300
+@@ -24,7 +24,7 @@
+ #include <gnu/lib-names.h>
+
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
+ struct _Unwind_Context *);
+diff -urN glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+--- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c 2016-09-15 02:29:07.096945862 +0300
+@@ -22,7 +22,7 @@
+ #include <pthreadP.h>
+
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff -urN glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+--- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c 2016-09-15 02:29:37.352917115 +0300
+@@ -20,7 +20,7 @@
+ #include <stdio.h>
+ #include <unwind.h>
+
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+
+diff -urN glibc-2.18.orig/sysdeps/gnu/unwind-resume.c glibc-2.18/sysdeps/gnu/unwind-resume.c
+--- glibc-2.18.orig/sysdeps/gnu/unwind-resume.c 2013-08-11 02:52:55.000000000 +0400
++++ glibc-2.18/sysdeps/gnu/unwind-resume.c 2016-09-15 02:29:53.376431503 +0300
+@@ -21,7 +21,7 @@
+ #include <unwind.h>
+ #include <gnu/lib-names.h>
+
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
+ struct _Unwind_Context *);
diff --git a/patches/glibc/2.5.1/100-cygwin.patch b/patches/glibc/2.5.1/100-cygwin.patch
deleted file mode 100644
index 3c0cd7d..0000000
--- a/patches/glibc/2.5.1/100-cygwin.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-Fixes
-elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
-...
-when building glibc-2.3.x on cygwin
-
-Idea from
-http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
-Basically, make glibc use .oST as suffix for 'object static'
-instead of .oS, since cygwin has trouble distinguishing .os from .oS
-(Original patch had .on, but .oST is more mnemonic for 'object static')
-
-glibc-linuxthreads-2.3.5 also requires a patch, see
-../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
-
-[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
-
-Message-ID: <4282FCBA.3040000@unicontrols.cz>
-Date: Thu, 12 May 2005 08:50:34 +0200
-From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
-To: Dan Kegel <dank@kegel.com>
-CC: crossgcc@sources.redhat.com
-Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
-
-Hi Dan,
-following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
-on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
-
---
- Petr Cvachoucek
- Unicontrols a.s.
- http://www.unicontrols.cz
-]
-
-diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200
-@@ -472,7 +472,7 @@
- # run the linked programs.
- link-libc = -Wl,-rpath-link=$(rpath-link) \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
-+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
- # This is how to find at build-time things that will be installed there.
- rpath-dirs = math elf dlfcn nss nis rt resolv crypt
- endif
-@@ -693,7 +693,7 @@
- # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
- # to pass different flags for each flavor.
- libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
--all-object-suffixes := .o .os .op .og .ob .oS
-+all-object-suffixes := .o .os .op .og .ob .oST
- object-suffixes :=
- CPPFLAGS-.o = $(pic-default)
- CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
-@@ -749,14 +749,14 @@
-
- ifeq (yes,$(build-shared))
- # Build special library that contains the static-only routines for libc.
--object-suffixes-for-libc += .oS
-+object-suffixes-for-libc += .oST
-
- # Must build the routines as PIC, though, because they can end up in (users')
- # shared objects. We don't want to use CFLAGS-os because users may, for
- # example, make that processor-specific.
--CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
--CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
--libtype.oS = lib%_nonshared.a
-+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
-+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
-+libtype.oST = lib%_nonshared.a
- endif
-
- # The assembler can generate debug information too.
-diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200
-@@ -417,7 +417,7 @@
- # Bounded pointer thunks are only built for *.ob
- elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
-
--elide-routines.oS += $(filter-out $(static-only-routines),\
-+elide-routines.oST += $(filter-out $(static-only-routines),\
- $(routines) $(aux) $(sysdep_routines)) \
- $(elide-bp-thunks)
- elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
-@@ -981,7 +981,7 @@
- install: $(inst_libdir)/libc.so
- $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)$(libc-name)) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -989,7 +989,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
- ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100
-+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200
-@@ -13,7 +13,7 @@
-
- ifneq (,$($(lib)-static-only-routines))
- ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
--object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
-+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
- endif
- endif
-
-@@ -29,7 +29,7 @@
-
- # Add each flavor of library to the lists of things to build and install.
- install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
--extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
-+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
- $(patsubst %,%$o,$(filter-out \
- $($(lib)-shared-only-routines),\
- $(all-$(lib)-routines))))
-@@ -57,7 +57,7 @@
-
-
- # Use o-iterator.mk to generate a rule for each flavor of library.
--ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
-+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
- define o-iterator-doit
- $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
- $(patsubst %,$(objpfx)%$o,\
-@@ -65,7 +65,7 @@
- $(all-$(lib)-routines))); \
- $$(build-extra-lib)
- endef
--object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
-+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
- include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
- endif
-
-@@ -77,9 +77,9 @@
- $(build-extra-lib)
- endif
-
--ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
--$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
-- $(patsubst %,$(objpfx)%.oS,\
-+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
-+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
-+ $(patsubst %,$(objpfx)%.oST,\
- $(filter $($(lib)-static-only-routines),\
- $(all-$(lib)-routines)))
- $(build-extra-lib)
-diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100
-+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200
-@@ -375,7 +375,7 @@
-
- $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
- $(objpfx)libpthread.so$(libpthread.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)pthread) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -383,7 +383,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
- ')' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200
-+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200
-@@ -10,4 +10,4 @@
- ASFLAGS-.op += -Wa,-Av9a
- ASFLAGS-.og += -Wa,-Av9a
- ASFLAGS-.ob += -Wa,-Av9a
--ASFLAGS-.oS += -Wa,-Av9a
-+ASFLAGS-.oST += -Wa,-Av9a
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.5.1/110-configure-apple-as.patch b/patches/glibc/2.5.1/110-configure-apple-as.patch
deleted file mode 100644
index 78a1324..0000000
--- a/patches/glibc/2.5.1/110-configure-apple-as.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
-http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
-
-The following makes it possible to configure glibc-2.3.2 on Mac OS X,
-where the assembler but doesn't understand the --version flag.
-
-Fixes the symptom
-checking whether ld is GNU ld... no
-checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
-checking version of /usr/libexec/gcc/darwin/ppc/as...
-<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
-
---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003
-+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004
-@@ -4039,7 +4039,7 @@
- # Found it, now check the version.
- echo "$as_me:$LINENO: checking version of $AS" >&5
- echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
-- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-+ ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.1[3-9]*)
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.5.1/120-fix-pr631.patch b/patches/glibc/2.5.1/120-fix-pr631.patch
deleted file mode 100644
index 13688df..0000000
--- a/patches/glibc/2.5.1/120-fix-pr631.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005
-+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005
-@@ -510,7 +510,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005
-+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005
-@@ -120,6 +120,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.5.1/130-i686-assembler.patch b/patches/glibc/2.5.1/130-i686-assembler.patch
deleted file mode 100644
index 9904efb..0000000
--- a/patches/glibc/2.5.1/130-i686-assembler.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-
-
-Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
-===================================================================
---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
-+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
-Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
-===================================================================
---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
-+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy)
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
diff --git a/patches/glibc/2.5.1/140-i386-preferred-stack-boundary.patch b/patches/glibc/2.5.1/140-i386-preferred-stack-boundary.patch
deleted file mode 100644
index 449821d..0000000
--- a/patches/glibc/2.5.1/140-i386-preferred-stack-boundary.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
-License: LGPL v2.1
-
-Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
-and 2 is not.
-
-diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100
-+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200
-@@ -36,7 +36,7 @@
- ifeq ($(subdir),csu)
- sysdep-CFLAGS += -mpreferred-stack-boundary=4
- else
--sysdep-CFLAGS += -mpreferred-stack-boundary=2
-+sysdep-CFLAGS += -mpreferred-stack-boundary=4
- # Likewise, any function which calls user callbacks
- uses-callbacks += -mpreferred-stack-boundary=4
- # Likewise, any stack alignment tests
diff --git a/patches/glibc/2.5.1/150-alpha-asm_page.patch b/patches/glibc/2.5.1/150-alpha-asm_page.patch
deleted file mode 100644
index b198b36..0000000
--- a/patches/glibc/2.5.1/150-alpha-asm_page.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
- from the kernel header to sys/user.h and remove the #include of
- sys/user.h.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
-@@ -23,7 +23,6 @@
- only. Don't read too much into it. Don't use it for anything other
- than gdb/strace unless you know what you are doing. */
-
--#include <asm/page.h>
- #include <asm/reg.h>
-
- struct user
-@@ -41,6 +40,9 @@ struct user
- char u_comm[32]; /* user command name */
- };
-
-+#define PAGE_SHIFT 13
-+#define PAGE_SIZE (1 << PAGE_SHIFT)
-+#define PAGE_MASK (~(PAGE_SIZE-1))
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
diff --git a/patches/glibc/2.5.1/160-use_short_for_fnstsw.patch b/patches/glibc/2.5.1/160-use_short_for_fnstsw.patch
deleted file mode 100644
index 0e849fa..0000000
--- a/patches/glibc/2.5.1/160-use_short_for_fnstsw.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Original patch from H.J. Lu, as reported there:
-http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
-
-fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
-The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
-
-diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
-+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c 2008-06-24 10:56:14.000000000 +0200
-@@ -26,7 +26,7 @@
- int
- fetestexcept (int excepts)
- {
-- int temp;
-+ short temp;
- int xtemp = 0;
-
- /* Get current exceptions. */
diff --git a/patches/glibc/2.5.1/170-alpha-asm_elf.patch b/patches/glibc/2.5.1/170-alpha-asm_elf.patch
deleted file mode 100644
index 3da5c8e..0000000
--- a/patches/glibc/2.5.1/170-alpha-asm_elf.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-since the kernel no longer provides asm/elf.h, the sys/procfs.h from the
-common code, alpha, and sh fail when used. this should things up.
--mike
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
-*Attachment: signature.asc <msg00012/signature.asc>*
-/Description:/ This is a digitally signed message part.
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-@@ -29,10 +29,23 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
-+ * I have no idea why that is so. For now, we just leave it at 33
-+ * (32 general regs + processor status word).
-+ */
-+#define ELF_NGREG 33
-+#define ELF_NFPREG 32
-+
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-@@ -29,10 +29,19 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * ELF register definitions...
-+ */
-+typedef unsigned long elf_greg_t;
-+
-+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef struct user_fpu_struct elf_fpregset_t;
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
-@@ -1,115 +1,2 @@
--/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
--
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, write to the Free
-- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-- 02111-1307 USA. */
--
--#ifndef _SYS_PROCFS_H
--#define _SYS_PROCFS_H 1
--
--/* This is somehow modelled after the file of the same name on SysVr4
-- systems. It provides a definition of the core file format for ELF
-- used on Linux. */
--
--#include <features.h>
--#include <signal.h>
--#include <sys/time.h>
--#include <sys/types.h>
--#include <sys/ucontext.h>
--#include <sys/user.h>
--#include <asm/elf.h>
--
--__BEGIN_DECLS
--
--struct elf_siginfo
-- {
-- int si_signo; /* Signal number. */
-- int si_code; /* Extra code. */
-- int si_errno; /* Errno. */
-- };
--
--/* Definitions to generate Intel SVR4-like core files. These mostly
-- have the same names as the SVR4 types with "elf_" tacked on the
-- front to prevent clashes with linux definitions, and the typedef
-- forms have been avoided. This is mostly like the SVR4 structure,
-- but more Linuxy, with things that Linux does not support and which
-- gdb doesn't really use excluded. Fields present but not used are
-- marked with "XXX". */
--struct elf_prstatus
-- {
--#if 0
-- long int pr_flags; /* XXX Process flags. */
-- short int pr_why; /* XXX Reason for process halt. */
-- short int pr_what; /* XXX More detailed reason. */
--#endif
-- struct elf_siginfo pr_info; /* Info associated with signal. */
-- short int pr_cursig; /* Current signal. */
-- unsigned long int pr_sigpend; /* Set of pending signals. */
-- unsigned long int pr_sighold; /* Set of held signals. */
--#if 0
-- struct sigaltstack pr_altstack; /* Alternate stack info. */
-- struct sigaction pr_action; /* Signal action for current sig. */
--#endif
-- __pid_t pr_pid;
-- __pid_t pr_ppid;
-- __pid_t pr_pgrp;
-- __pid_t pr_sid;
-- struct timeval pr_utime; /* User time. */
-- struct timeval pr_stime; /* System time. */
-- struct timeval pr_cutime; /* Cumulative user time. */
-- struct timeval pr_cstime; /* Cumulative system time. */
--#if 0
-- long int pr_instr; /* Current instruction. */
--#endif
-- elf_gregset_t pr_reg; /* GP registers. */
-- int pr_fpvalid; /* True if math copro being used. */
-- };
--
--
--#define ELF_PRARGSZ (80) /* Number of chars for args */
--
--struct elf_prpsinfo
-- {
-- char pr_state; /* Numeric process state. */
-- char pr_sname; /* Char for pr_state. */
-- char pr_zomb; /* Zombie. */
-- char pr_nice; /* Nice val. */
-- unsigned long int pr_flag; /* Flags. */
-- unsigned short int pr_uid;
-- unsigned short int pr_gid;
-- int pr_pid, pr_ppid, pr_pgrp, pr_sid;
-- /* Lots missing */
-- char pr_fname[16]; /* Filename of executable. */
-- char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
-- };
--
--/* Addresses. */
--typedef void *psaddr_t;
--
--/* Register sets. Linux has different names. */
--typedef gregset_t prgregset_t;
--typedef fpregset_t prfpregset_t;
--
--/* We don't have any differences between processes and threads,
-- therefore habe only ine PID type. */
--typedef __pid_t lwpid_t;
--
--
--typedef struct elf_prstatus prstatus_t;
--typedef struct elf_prpsinfo prpsinfo_t;
--
--__END_DECLS
--
--#endif /* sys/procfs.h */
-+/* sys/procfs.h is architecture specific. */
-+#error "This file must be supplied by every Linux architecture."
-
diff --git a/patches/glibc/2.5.1/180-alpha-cfi.patch b/patches/glibc/2.5.1/180-alpha-cfi.patch
deleted file mode 100644
index c1efd77..0000000
--- a/patches/glibc/2.5.1/180-alpha-cfi.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h 2006/10/29 21:48:06 1.6
-+++ libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h 2007/03/13 21:28:03 1.7
-@@ -55,6 +55,7 @@
- bne a3, SYSCALL_ERROR_LABEL; \
- __LABEL($pseudo_ret) \
- .subsection 2; \
-+ cfi_startproc; \
- __LABEL($pseudo_cancel) \
- subq sp, 64, sp; \
- cfi_def_cfa_offset(64); \
-@@ -90,12 +91,13 @@
- cfi_def_cfa_offset(0); \
- __LABEL($syscall_error) \
- SYSCALL_ERROR_HANDLER; \
-+ cfi_endproc; \
- .previous
-
- # undef PSEUDO_END
- # define PSEUDO_END(sym) \
-- .subsection 2; \
- cfi_endproc; \
-+ .subsection 2; \
- .size sym, .-sym
-
- # define SAVE_ARGS_0 /* Nothing. */
diff --git a/patches/glibc/2.5.1/190-alpha-sigsuspend.patch b/patches/glibc/2.5.1/190-alpha-sigsuspend.patch
deleted file mode 100644
index daf1a5d..0000000
--- a/patches/glibc/2.5.1/190-alpha-sigsuspend.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S.orig 2006-10-22 22:17:01.000000000 +0200
-+++ glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S 2006-10-22 22:18:05.000000000 +0200
-@@ -31,3 +31,21 @@
- libc_hidden_def (__sigsuspend)
- weak_alias (__sigsuspend, sigsuspend)
- strong_alias (__sigsuspend, __libc_sigsuspend)
-+
-+#ifndef NO_CANCELLATION
-+ .globl __sigsuspend_nocancel;
-+ .align 4;
-+ .type __sigsuspend_nocancel, @function;
-+ .usepv __sigsuspend_nocancel, std;
-+ cfi_startproc;
-+__LABEL(__sigsuspend_nocancel)
-+ ldgp gp, 0(pv);
-+ PSEUDO_PROF;
-+ PSEUDO_PREPARE_ARGS
-+ lda v0, SYS_ify(sigsuspend);
-+ call_pal PAL_callsys;
-+ bne a3, SYSCALL_ERROR_LABEL;
-+ ret;
-+ cfi_endproc;
-+ .size __sigsuspend_nocancel, .-__sigsuspend_nocancel
-+#endif
diff --git a/patches/glibc/2.5/100-cygwin.patch b/patches/glibc/2.5/100-cygwin.patch
deleted file mode 100644
index 3c0cd7d..0000000
--- a/patches/glibc/2.5/100-cygwin.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-Fixes
-elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
-...
-when building glibc-2.3.x on cygwin
-
-Idea from
-http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
-Basically, make glibc use .oST as suffix for 'object static'
-instead of .oS, since cygwin has trouble distinguishing .os from .oS
-(Original patch had .on, but .oST is more mnemonic for 'object static')
-
-glibc-linuxthreads-2.3.5 also requires a patch, see
-../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
-
-[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
-
-Message-ID: <4282FCBA.3040000@unicontrols.cz>
-Date: Thu, 12 May 2005 08:50:34 +0200
-From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
-To: Dan Kegel <dank@kegel.com>
-CC: crossgcc@sources.redhat.com
-Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
-
-Hi Dan,
-following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
-on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
-
---
- Petr Cvachoucek
- Unicontrols a.s.
- http://www.unicontrols.cz
-]
-
-diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200
-@@ -472,7 +472,7 @@
- # run the linked programs.
- link-libc = -Wl,-rpath-link=$(rpath-link) \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
-+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
- # This is how to find at build-time things that will be installed there.
- rpath-dirs = math elf dlfcn nss nis rt resolv crypt
- endif
-@@ -693,7 +693,7 @@
- # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
- # to pass different flags for each flavor.
- libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
--all-object-suffixes := .o .os .op .og .ob .oS
-+all-object-suffixes := .o .os .op .og .ob .oST
- object-suffixes :=
- CPPFLAGS-.o = $(pic-default)
- CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
-@@ -749,14 +749,14 @@
-
- ifeq (yes,$(build-shared))
- # Build special library that contains the static-only routines for libc.
--object-suffixes-for-libc += .oS
-+object-suffixes-for-libc += .oST
-
- # Must build the routines as PIC, though, because they can end up in (users')
- # shared objects. We don't want to use CFLAGS-os because users may, for
- # example, make that processor-specific.
--CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
--CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
--libtype.oS = lib%_nonshared.a
-+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
-+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
-+libtype.oST = lib%_nonshared.a
- endif
-
- # The assembler can generate debug information too.
-diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200
-@@ -417,7 +417,7 @@
- # Bounded pointer thunks are only built for *.ob
- elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
-
--elide-routines.oS += $(filter-out $(static-only-routines),\
-+elide-routines.oST += $(filter-out $(static-only-routines),\
- $(routines) $(aux) $(sysdep_routines)) \
- $(elide-bp-thunks)
- elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
-@@ -981,7 +981,7 @@
- install: $(inst_libdir)/libc.so
- $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)$(libc-name)) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -989,7 +989,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
- ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100
-+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200
-@@ -13,7 +13,7 @@
-
- ifneq (,$($(lib)-static-only-routines))
- ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
--object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
-+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
- endif
- endif
-
-@@ -29,7 +29,7 @@
-
- # Add each flavor of library to the lists of things to build and install.
- install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
--extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
-+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
- $(patsubst %,%$o,$(filter-out \
- $($(lib)-shared-only-routines),\
- $(all-$(lib)-routines))))
-@@ -57,7 +57,7 @@
-
-
- # Use o-iterator.mk to generate a rule for each flavor of library.
--ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
-+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
- define o-iterator-doit
- $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
- $(patsubst %,$(objpfx)%$o,\
-@@ -65,7 +65,7 @@
- $(all-$(lib)-routines))); \
- $$(build-extra-lib)
- endef
--object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
-+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
- include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
- endif
-
-@@ -77,9 +77,9 @@
- $(build-extra-lib)
- endif
-
--ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
--$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
-- $(patsubst %,$(objpfx)%.oS,\
-+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
-+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
-+ $(patsubst %,$(objpfx)%.oST,\
- $(filter $($(lib)-static-only-routines),\
- $(all-$(lib)-routines)))
- $(build-extra-lib)
-diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100
-+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200
-@@ -375,7 +375,7 @@
-
- $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
- $(objpfx)libpthread.so$(libpthread.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)pthread) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -383,7 +383,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
- ')' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200
-+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200
-@@ -10,4 +10,4 @@
- ASFLAGS-.op += -Wa,-Av9a
- ASFLAGS-.og += -Wa,-Av9a
- ASFLAGS-.ob += -Wa,-Av9a
--ASFLAGS-.oS += -Wa,-Av9a
-+ASFLAGS-.oST += -Wa,-Av9a
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.5/110-configure-apple-as.patch b/patches/glibc/2.5/110-configure-apple-as.patch
deleted file mode 100644
index 78a1324..0000000
--- a/patches/glibc/2.5/110-configure-apple-as.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
-http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
-
-The following makes it possible to configure glibc-2.3.2 on Mac OS X,
-where the assembler but doesn't understand the --version flag.
-
-Fixes the symptom
-checking whether ld is GNU ld... no
-checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
-checking version of /usr/libexec/gcc/darwin/ppc/as...
-<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
-
---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003
-+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004
-@@ -4039,7 +4039,7 @@
- # Found it, now check the version.
- echo "$as_me:$LINENO: checking version of $AS" >&5
- echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
-- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-+ ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.1[3-9]*)
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.5/120-fix-pr631.patch b/patches/glibc/2.5/120-fix-pr631.patch
deleted file mode 100644
index 13688df..0000000
--- a/patches/glibc/2.5/120-fix-pr631.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005
-+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005
-@@ -510,7 +510,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005
-+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005
-@@ -120,6 +120,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.5/130-i686-assembler.patch b/patches/glibc/2.5/130-i686-assembler.patch
deleted file mode 100644
index 9904efb..0000000
--- a/patches/glibc/2.5/130-i686-assembler.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-
-
-Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
-===================================================================
---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
-+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
-Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
-===================================================================
---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
-+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy)
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
diff --git a/patches/glibc/2.5/140-i386-preferred-stack-boundary.patch b/patches/glibc/2.5/140-i386-preferred-stack-boundary.patch
deleted file mode 100644
index 449821d..0000000
--- a/patches/glibc/2.5/140-i386-preferred-stack-boundary.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
-License: LGPL v2.1
-
-Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
-and 2 is not.
-
-diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100
-+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200
-@@ -36,7 +36,7 @@
- ifeq ($(subdir),csu)
- sysdep-CFLAGS += -mpreferred-stack-boundary=4
- else
--sysdep-CFLAGS += -mpreferred-stack-boundary=2
-+sysdep-CFLAGS += -mpreferred-stack-boundary=4
- # Likewise, any function which calls user callbacks
- uses-callbacks += -mpreferred-stack-boundary=4
- # Likewise, any stack alignment tests
diff --git a/patches/glibc/2.5/150-alpha-asm_page.patch b/patches/glibc/2.5/150-alpha-asm_page.patch
deleted file mode 100644
index b198b36..0000000
--- a/patches/glibc/2.5/150-alpha-asm_page.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
- from the kernel header to sys/user.h and remove the #include of
- sys/user.h.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
-@@ -23,7 +23,6 @@
- only. Don't read too much into it. Don't use it for anything other
- than gdb/strace unless you know what you are doing. */
-
--#include <asm/page.h>
- #include <asm/reg.h>
-
- struct user
-@@ -41,6 +40,9 @@ struct user
- char u_comm[32]; /* user command name */
- };
-
-+#define PAGE_SHIFT 13
-+#define PAGE_SIZE (1 << PAGE_SHIFT)
-+#define PAGE_MASK (~(PAGE_SIZE-1))
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
diff --git a/patches/glibc/2.5/160-use_short_for_fnstsw.patch b/patches/glibc/2.5/160-use_short_for_fnstsw.patch
deleted file mode 100644
index 0e849fa..0000000
--- a/patches/glibc/2.5/160-use_short_for_fnstsw.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Original patch from H.J. Lu, as reported there:
-http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
-
-fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
-The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
-
-diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
-+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c 2008-06-24 10:56:14.000000000 +0200
-@@ -26,7 +26,7 @@
- int
- fetestexcept (int excepts)
- {
-- int temp;
-+ short temp;
- int xtemp = 0;
-
- /* Get current exceptions. */
diff --git a/patches/glibc/2.5/170-alpha-asm_elf.patch b/patches/glibc/2.5/170-alpha-asm_elf.patch
deleted file mode 100644
index 3da5c8e..0000000
--- a/patches/glibc/2.5/170-alpha-asm_elf.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-since the kernel no longer provides asm/elf.h, the sys/procfs.h from the
-common code, alpha, and sh fail when used. this should things up.
--mike
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
-*Attachment: signature.asc <msg00012/signature.asc>*
-/Description:/ This is a digitally signed message part.
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-@@ -29,10 +29,23 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
-+ * I have no idea why that is so. For now, we just leave it at 33
-+ * (32 general regs + processor status word).
-+ */
-+#define ELF_NGREG 33
-+#define ELF_NFPREG 32
-+
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-@@ -29,10 +29,19 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * ELF register definitions...
-+ */
-+typedef unsigned long elf_greg_t;
-+
-+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef struct user_fpu_struct elf_fpregset_t;
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
-@@ -1,115 +1,2 @@
--/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
--
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, write to the Free
-- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-- 02111-1307 USA. */
--
--#ifndef _SYS_PROCFS_H
--#define _SYS_PROCFS_H 1
--
--/* This is somehow modelled after the file of the same name on SysVr4
-- systems. It provides a definition of the core file format for ELF
-- used on Linux. */
--
--#include <features.h>
--#include <signal.h>
--#include <sys/time.h>
--#include <sys/types.h>
--#include <sys/ucontext.h>
--#include <sys/user.h>
--#include <asm/elf.h>
--
--__BEGIN_DECLS
--
--struct elf_siginfo
-- {
-- int si_signo; /* Signal number. */
-- int si_code; /* Extra code. */
-- int si_errno; /* Errno. */
-- };
--
--/* Definitions to generate Intel SVR4-like core files. These mostly
-- have the same names as the SVR4 types with "elf_" tacked on the
-- front to prevent clashes with linux definitions, and the typedef
-- forms have been avoided. This is mostly like the SVR4 structure,
-- but more Linuxy, with things that Linux does not support and which
-- gdb doesn't really use excluded. Fields present but not used are
-- marked with "XXX". */
--struct elf_prstatus
-- {
--#if 0
-- long int pr_flags; /* XXX Process flags. */
-- short int pr_why; /* XXX Reason for process halt. */
-- short int pr_what; /* XXX More detailed reason. */
--#endif
-- struct elf_siginfo pr_info; /* Info associated with signal. */
-- short int pr_cursig; /* Current signal. */
-- unsigned long int pr_sigpend; /* Set of pending signals. */
-- unsigned long int pr_sighold; /* Set of held signals. */
--#if 0
-- struct sigaltstack pr_altstack; /* Alternate stack info. */
-- struct sigaction pr_action; /* Signal action for current sig. */
--#endif
-- __pid_t pr_pid;
-- __pid_t pr_ppid;
-- __pid_t pr_pgrp;
-- __pid_t pr_sid;
-- struct timeval pr_utime; /* User time. */
-- struct timeval pr_stime; /* System time. */
-- struct timeval pr_cutime; /* Cumulative user time. */
-- struct timeval pr_cstime; /* Cumulative system time. */
--#if 0
-- long int pr_instr; /* Current instruction. */
--#endif
-- elf_gregset_t pr_reg; /* GP registers. */
-- int pr_fpvalid; /* True if math copro being used. */
-- };
--
--
--#define ELF_PRARGSZ (80) /* Number of chars for args */
--
--struct elf_prpsinfo
-- {
-- char pr_state; /* Numeric process state. */
-- char pr_sname; /* Char for pr_state. */
-- char pr_zomb; /* Zombie. */
-- char pr_nice; /* Nice val. */
-- unsigned long int pr_flag; /* Flags. */
-- unsigned short int pr_uid;
-- unsigned short int pr_gid;
-- int pr_pid, pr_ppid, pr_pgrp, pr_sid;
-- /* Lots missing */
-- char pr_fname[16]; /* Filename of executable. */
-- char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
-- };
--
--/* Addresses. */
--typedef void *psaddr_t;
--
--/* Register sets. Linux has different names. */
--typedef gregset_t prgregset_t;
--typedef fpregset_t prfpregset_t;
--
--/* We don't have any differences between processes and threads,
-- therefore habe only ine PID type. */
--typedef __pid_t lwpid_t;
--
--
--typedef struct elf_prstatus prstatus_t;
--typedef struct elf_prpsinfo prpsinfo_t;
--
--__END_DECLS
--
--#endif /* sys/procfs.h */
-+/* sys/procfs.h is architecture specific. */
-+#error "This file must be supplied by every Linux architecture."
-
diff --git a/patches/glibc/2.5/180-alpha-cfi.patch b/patches/glibc/2.5/180-alpha-cfi.patch
deleted file mode 100644
index c1efd77..0000000
--- a/patches/glibc/2.5/180-alpha-cfi.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h 2006/10/29 21:48:06 1.6
-+++ libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h 2007/03/13 21:28:03 1.7
-@@ -55,6 +55,7 @@
- bne a3, SYSCALL_ERROR_LABEL; \
- __LABEL($pseudo_ret) \
- .subsection 2; \
-+ cfi_startproc; \
- __LABEL($pseudo_cancel) \
- subq sp, 64, sp; \
- cfi_def_cfa_offset(64); \
-@@ -90,12 +91,13 @@
- cfi_def_cfa_offset(0); \
- __LABEL($syscall_error) \
- SYSCALL_ERROR_HANDLER; \
-+ cfi_endproc; \
- .previous
-
- # undef PSEUDO_END
- # define PSEUDO_END(sym) \
-- .subsection 2; \
- cfi_endproc; \
-+ .subsection 2; \
- .size sym, .-sym
-
- # define SAVE_ARGS_0 /* Nothing. */
diff --git a/patches/glibc/2.5/190-alpha-sigsuspend.patch b/patches/glibc/2.5/190-alpha-sigsuspend.patch
deleted file mode 100644
index daf1a5d..0000000
--- a/patches/glibc/2.5/190-alpha-sigsuspend.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S.orig 2006-10-22 22:17:01.000000000 +0200
-+++ glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S 2006-10-22 22:18:05.000000000 +0200
-@@ -31,3 +31,21 @@
- libc_hidden_def (__sigsuspend)
- weak_alias (__sigsuspend, sigsuspend)
- strong_alias (__sigsuspend, __libc_sigsuspend)
-+
-+#ifndef NO_CANCELLATION
-+ .globl __sigsuspend_nocancel;
-+ .align 4;
-+ .type __sigsuspend_nocancel, @function;
-+ .usepv __sigsuspend_nocancel, std;
-+ cfi_startproc;
-+__LABEL(__sigsuspend_nocancel)
-+ ldgp gp, 0(pv);
-+ PSEUDO_PROF;
-+ PSEUDO_PREPARE_ARGS
-+ lda v0, SYS_ify(sigsuspend);
-+ call_pal PAL_callsys;
-+ bne a3, SYSCALL_ERROR_LABEL;
-+ ret;
-+ cfi_endproc;
-+ .size __sigsuspend_nocancel, .-__sigsuspend_nocancel
-+#endif
diff --git a/patches/glibc/2.6.1/100-cygwin.patch b/patches/glibc/2.6.1/100-cygwin.patch
deleted file mode 100644
index 3c0cd7d..0000000
--- a/patches/glibc/2.6.1/100-cygwin.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-Fixes
-elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
-...
-when building glibc-2.3.x on cygwin
-
-Idea from
-http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
-Basically, make glibc use .oST as suffix for 'object static'
-instead of .oS, since cygwin has trouble distinguishing .os from .oS
-(Original patch had .on, but .oST is more mnemonic for 'object static')
-
-glibc-linuxthreads-2.3.5 also requires a patch, see
-../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
-
-[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
-
-Message-ID: <4282FCBA.3040000@unicontrols.cz>
-Date: Thu, 12 May 2005 08:50:34 +0200
-From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
-To: Dan Kegel <dank@kegel.com>
-CC: crossgcc@sources.redhat.com
-Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
-
-Hi Dan,
-following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
-on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
-
---
- Petr Cvachoucek
- Unicontrols a.s.
- http://www.unicontrols.cz
-]
-
-diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200
-@@ -472,7 +472,7 @@
- # run the linked programs.
- link-libc = -Wl,-rpath-link=$(rpath-link) \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
-+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
- # This is how to find at build-time things that will be installed there.
- rpath-dirs = math elf dlfcn nss nis rt resolv crypt
- endif
-@@ -693,7 +693,7 @@
- # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
- # to pass different flags for each flavor.
- libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
--all-object-suffixes := .o .os .op .og .ob .oS
-+all-object-suffixes := .o .os .op .og .ob .oST
- object-suffixes :=
- CPPFLAGS-.o = $(pic-default)
- CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
-@@ -749,14 +749,14 @@
-
- ifeq (yes,$(build-shared))
- # Build special library that contains the static-only routines for libc.
--object-suffixes-for-libc += .oS
-+object-suffixes-for-libc += .oST
-
- # Must build the routines as PIC, though, because they can end up in (users')
- # shared objects. We don't want to use CFLAGS-os because users may, for
- # example, make that processor-specific.
--CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
--CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
--libtype.oS = lib%_nonshared.a
-+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
-+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
-+libtype.oST = lib%_nonshared.a
- endif
-
- # The assembler can generate debug information too.
-diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200
-@@ -417,7 +417,7 @@
- # Bounded pointer thunks are only built for *.ob
- elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
-
--elide-routines.oS += $(filter-out $(static-only-routines),\
-+elide-routines.oST += $(filter-out $(static-only-routines),\
- $(routines) $(aux) $(sysdep_routines)) \
- $(elide-bp-thunks)
- elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
-@@ -981,7 +981,7 @@
- install: $(inst_libdir)/libc.so
- $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)$(libc-name)) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -989,7 +989,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
- ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100
-+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200
-@@ -13,7 +13,7 @@
-
- ifneq (,$($(lib)-static-only-routines))
- ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
--object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
-+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
- endif
- endif
-
-@@ -29,7 +29,7 @@
-
- # Add each flavor of library to the lists of things to build and install.
- install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
--extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
-+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
- $(patsubst %,%$o,$(filter-out \
- $($(lib)-shared-only-routines),\
- $(all-$(lib)-routines))))
-@@ -57,7 +57,7 @@
-
-
- # Use o-iterator.mk to generate a rule for each flavor of library.
--ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
-+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
- define o-iterator-doit
- $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
- $(patsubst %,$(objpfx)%$o,\
-@@ -65,7 +65,7 @@
- $(all-$(lib)-routines))); \
- $$(build-extra-lib)
- endef
--object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
-+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
- include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
- endif
-
-@@ -77,9 +77,9 @@
- $(build-extra-lib)
- endif
-
--ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
--$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
-- $(patsubst %,$(objpfx)%.oS,\
-+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
-+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
-+ $(patsubst %,$(objpfx)%.oST,\
- $(filter $($(lib)-static-only-routines),\
- $(all-$(lib)-routines)))
- $(build-extra-lib)
-diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100
-+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200
-@@ -375,7 +375,7 @@
-
- $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
- $(objpfx)libpthread.so$(libpthread.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)pthread) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -383,7 +383,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
- ')' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200
-+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200
-@@ -10,4 +10,4 @@
- ASFLAGS-.op += -Wa,-Av9a
- ASFLAGS-.og += -Wa,-Av9a
- ASFLAGS-.ob += -Wa,-Av9a
--ASFLAGS-.oS += -Wa,-Av9a
-+ASFLAGS-.oST += -Wa,-Av9a
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.6.1/110-configure-apple-as.patch b/patches/glibc/2.6.1/110-configure-apple-as.patch
deleted file mode 100644
index 78a1324..0000000
--- a/patches/glibc/2.6.1/110-configure-apple-as.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
-http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
-
-The following makes it possible to configure glibc-2.3.2 on Mac OS X,
-where the assembler but doesn't understand the --version flag.
-
-Fixes the symptom
-checking whether ld is GNU ld... no
-checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
-checking version of /usr/libexec/gcc/darwin/ppc/as...
-<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
-
---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003
-+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004
-@@ -4039,7 +4039,7 @@
- # Found it, now check the version.
- echo "$as_me:$LINENO: checking version of $AS" >&5
- echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
-- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-+ ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.1[3-9]*)
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.6.1/120-fix-pr631.patch b/patches/glibc/2.6.1/120-fix-pr631.patch
deleted file mode 100644
index 13688df..0000000
--- a/patches/glibc/2.6.1/120-fix-pr631.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005
-+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005
-@@ -510,7 +510,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005
-+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005
-@@ -120,6 +120,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.6.1/130-i686-assembler.patch b/patches/glibc/2.6.1/130-i686-assembler.patch
deleted file mode 100644
index 9904efb..0000000
--- a/patches/glibc/2.6.1/130-i686-assembler.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-
-
-Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
-===================================================================
---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
-+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
-Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
-===================================================================
---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
-+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy)
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
diff --git a/patches/glibc/2.6.1/140-i386-preferred-stack-boundary.patch b/patches/glibc/2.6.1/140-i386-preferred-stack-boundary.patch
deleted file mode 100644
index 449821d..0000000
--- a/patches/glibc/2.6.1/140-i386-preferred-stack-boundary.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
-License: LGPL v2.1
-
-Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
-and 2 is not.
-
-diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100
-+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200
-@@ -36,7 +36,7 @@
- ifeq ($(subdir),csu)
- sysdep-CFLAGS += -mpreferred-stack-boundary=4
- else
--sysdep-CFLAGS += -mpreferred-stack-boundary=2
-+sysdep-CFLAGS += -mpreferred-stack-boundary=4
- # Likewise, any function which calls user callbacks
- uses-callbacks += -mpreferred-stack-boundary=4
- # Likewise, any stack alignment tests
diff --git a/patches/glibc/2.6.1/150-alpha-asm_page.patch b/patches/glibc/2.6.1/150-alpha-asm_page.patch
deleted file mode 100644
index b198b36..0000000
--- a/patches/glibc/2.6.1/150-alpha-asm_page.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
- from the kernel header to sys/user.h and remove the #include of
- sys/user.h.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
-@@ -23,7 +23,6 @@
- only. Don't read too much into it. Don't use it for anything other
- than gdb/strace unless you know what you are doing. */
-
--#include <asm/page.h>
- #include <asm/reg.h>
-
- struct user
-@@ -41,6 +40,9 @@ struct user
- char u_comm[32]; /* user command name */
- };
-
-+#define PAGE_SHIFT 13
-+#define PAGE_SIZE (1 << PAGE_SHIFT)
-+#define PAGE_MASK (~(PAGE_SIZE-1))
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
diff --git a/patches/glibc/2.6.1/160-use_short_for_fnstsw.patch b/patches/glibc/2.6.1/160-use_short_for_fnstsw.patch
deleted file mode 100644
index 0e849fa..0000000
--- a/patches/glibc/2.6.1/160-use_short_for_fnstsw.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Original patch from H.J. Lu, as reported there:
-http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
-
-fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
-The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
-
-diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
-+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c 2008-06-24 10:56:14.000000000 +0200
-@@ -26,7 +26,7 @@
- int
- fetestexcept (int excepts)
- {
-- int temp;
-+ short temp;
- int xtemp = 0;
-
- /* Get current exceptions. */
diff --git a/patches/glibc/2.6.1/170-alpha-asm_elf.patch b/patches/glibc/2.6.1/170-alpha-asm_elf.patch
deleted file mode 100644
index 3da5c8e..0000000
--- a/patches/glibc/2.6.1/170-alpha-asm_elf.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-since the kernel no longer provides asm/elf.h, the sys/procfs.h from the
-common code, alpha, and sh fail when used. this should things up.
--mike
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
-*Attachment: signature.asc <msg00012/signature.asc>*
-/Description:/ This is a digitally signed message part.
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-@@ -29,10 +29,23 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
-+ * I have no idea why that is so. For now, we just leave it at 33
-+ * (32 general regs + processor status word).
-+ */
-+#define ELF_NGREG 33
-+#define ELF_NFPREG 32
-+
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-@@ -29,10 +29,19 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * ELF register definitions...
-+ */
-+typedef unsigned long elf_greg_t;
-+
-+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef struct user_fpu_struct elf_fpregset_t;
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
-@@ -1,115 +1,2 @@
--/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
--
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, write to the Free
-- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-- 02111-1307 USA. */
--
--#ifndef _SYS_PROCFS_H
--#define _SYS_PROCFS_H 1
--
--/* This is somehow modelled after the file of the same name on SysVr4
-- systems. It provides a definition of the core file format for ELF
-- used on Linux. */
--
--#include <features.h>
--#include <signal.h>
--#include <sys/time.h>
--#include <sys/types.h>
--#include <sys/ucontext.h>
--#include <sys/user.h>
--#include <asm/elf.h>
--
--__BEGIN_DECLS
--
--struct elf_siginfo
-- {
-- int si_signo; /* Signal number. */
-- int si_code; /* Extra code. */
-- int si_errno; /* Errno. */
-- };
--
--/* Definitions to generate Intel SVR4-like core files. These mostly
-- have the same names as the SVR4 types with "elf_" tacked on the
-- front to prevent clashes with linux definitions, and the typedef
-- forms have been avoided. This is mostly like the SVR4 structure,
-- but more Linuxy, with things that Linux does not support and which
-- gdb doesn't really use excluded. Fields present but not used are
-- marked with "XXX". */
--struct elf_prstatus
-- {
--#if 0
-- long int pr_flags; /* XXX Process flags. */
-- short int pr_why; /* XXX Reason for process halt. */
-- short int pr_what; /* XXX More detailed reason. */
--#endif
-- struct elf_siginfo pr_info; /* Info associated with signal. */
-- short int pr_cursig; /* Current signal. */
-- unsigned long int pr_sigpend; /* Set of pending signals. */
-- unsigned long int pr_sighold; /* Set of held signals. */
--#if 0
-- struct sigaltstack pr_altstack; /* Alternate stack info. */
-- struct sigaction pr_action; /* Signal action for current sig. */
--#endif
-- __pid_t pr_pid;
-- __pid_t pr_ppid;
-- __pid_t pr_pgrp;
-- __pid_t pr_sid;
-- struct timeval pr_utime; /* User time. */
-- struct timeval pr_stime; /* System time. */
-- struct timeval pr_cutime; /* Cumulative user time. */
-- struct timeval pr_cstime; /* Cumulative system time. */
--#if 0
-- long int pr_instr; /* Current instruction. */
--#endif
-- elf_gregset_t pr_reg; /* GP registers. */
-- int pr_fpvalid; /* True if math copro being used. */
-- };
--
--
--#define ELF_PRARGSZ (80) /* Number of chars for args */
--
--struct elf_prpsinfo
-- {
-- char pr_state; /* Numeric process state. */
-- char pr_sname; /* Char for pr_state. */
-- char pr_zomb; /* Zombie. */
-- char pr_nice; /* Nice val. */
-- unsigned long int pr_flag; /* Flags. */
-- unsigned short int pr_uid;
-- unsigned short int pr_gid;
-- int pr_pid, pr_ppid, pr_pgrp, pr_sid;
-- /* Lots missing */
-- char pr_fname[16]; /* Filename of executable. */
-- char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
-- };
--
--/* Addresses. */
--typedef void *psaddr_t;
--
--/* Register sets. Linux has different names. */
--typedef gregset_t prgregset_t;
--typedef fpregset_t prfpregset_t;
--
--/* We don't have any differences between processes and threads,
-- therefore habe only ine PID type. */
--typedef __pid_t lwpid_t;
--
--
--typedef struct elf_prstatus prstatus_t;
--typedef struct elf_prpsinfo prpsinfo_t;
--
--__END_DECLS
--
--#endif /* sys/procfs.h */
-+/* sys/procfs.h is architecture specific. */
-+#error "This file must be supplied by every Linux architecture."
-
diff --git a/patches/glibc/2.6.1/180-gcc-4.3-sysinclude-path.patch b/patches/glibc/2.6.1/180-gcc-4.3-sysinclude-path.patch
deleted file mode 100644
index 66650a8..0000000
--- a/patches/glibc/2.6.1/180-gcc-4.3-sysinclude-path.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Patch pointed to by Ryan ARNOLD on the libc-help ML.
-See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
-
-Forwarded to crosstool-NG by Ioannis E. VENETIS:
-See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
-
-GCC 4.3 changed the location of some of the header files. I don't
-understand why you'd be getting these errors while building GCC since
-it provides them.
-
-With regard to GLIBC, Roland checked in some changes so that the GLIBC
-build system could find the new locations of the GCC provided header
-files.
-
-diff -durN glibc-2.6.1.orig/configure.in glibc-2.6.1/configure.in
---- glibc-2.6.1.orig/configure.in 2007-06-08 05:16:36.000000000 +0200
-+++ glibc-2.6.1/configure.in 2008-06-24 18:38:46.000000000 +0200
-@@ -911,8 +911,12 @@
- # header directory and add that to the list. NOTE: Only does the right
- # thing on a system that doesn't need fixincludes. (Not presently a problem.)
- if test -n "$sysheaders"; then
-- ccheaders=`$CC -print-file-name=include`
-- SYSINCLUDES="-nostdinc -isystem $ccheaders \
-+ SYSINCLUDES=-nostdinc
-+ for d in include include-fixed; do
-+ i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
-+ SYSINCLUDES="$SYSINCLUDES -isystem $i"
-+ done
-+ SYSINCLUDES="$SYSINCLUDES \
- -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
- if test -n "$CXX"; then
- cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
-diff -durN glibc-2.6.1.orig/configure glibc-2.6.1/configure
---- glibc-2.6.1.orig/configure 2008-06-24 18:35:34.000000000 +0200
-+++ glibc-2.6.1/configure 2008-06-24 18:38:46.000000000 +0200
-@@ -4562,8 +4562,12 @@
- # header directory and add that to the list. NOTE: Only does the right
- # thing on a system that doesn't need fixincludes. (Not presently a problem.)
- if test -n "$sysheaders"; then
-- ccheaders=`$CC -print-file-name=include`
-- SYSINCLUDES="-nostdinc -isystem $ccheaders \
-+ SYSINCLUDES=-nostdinc
-+ for d in include include-fixed; do
-+ i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
-+ SYSINCLUDES="$SYSINCLUDES -isystem $i"
-+ done
-+ SYSINCLUDES="$SYSINCLUDES \
- -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
- if test -n "$CXX"; then
- cxxversion=`$CXX -dumpversion 2>&5` &&
diff --git a/patches/glibc/2.6.1/190-alpha-atfcts.patch b/patches/glibc/2.6.1/190-alpha-atfcts.patch
deleted file mode 100644
index 73a2474..0000000
--- a/patches/glibc/2.6.1/190-alpha-atfcts.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- glibc-2.6.1/sysdeps/unix/sysv/linux/kernel-features.h 2006-07-29 07:43:27.000000000 +0300
-+++ glibc-2.6.1/sysdeps/unix/sysv/linux/kernel-features.h.new 2008-07-26 08:45:06.000000000 +0300
-@@ -445,7 +445,7 @@
- /* The *at syscalls were introduced just after 2.6.16-rc1. Due to the way the
- kernel versions are advertised we can only rely on 2.6.17 to have
- the code. */
--#if __LINUX_KERNEL_VERSION >= 0x020611
-+#if __LINUX_KERNEL_VERSION >= 0x020611 && !defined __alpha__
- # define __ASSUME_ATFCTS 1
- #endif
-
diff --git a/patches/glibc/2.6.1/200-alpha-ptr_mangle.patch b/patches/glibc/2.6.1/200-alpha-ptr_mangle.patch
deleted file mode 100644
index 1417562..0000000
--- a/patches/glibc/2.6.1/200-alpha-ptr_mangle.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- glibc-2.6.1.orig/sysdeps/unix/alpha/sysdep.h
-+++ glibc-2.6.1/sysdeps/unix/alpha/sysdep.h
-@@ -397,42 +397,4 @@
- _sc_ret = _sc_0, _sc_err = _sc_19; \
- }
-
--/* Pointer mangling support. Note that tls access is slow enough that
-- we don't deoptimize things by placing the pointer check value there. */
--
--#include <stdint.h>
--
--#if defined NOT_IN_libc && defined IS_IN_rtld
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-- ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
--# define PTR_MANGLE(var) \
-- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#elif defined PIC
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldq tmp, __pointer_chk_guard; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard attribute_relro;
--# define PTR_MANGLE(var) \
-- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#endif
--
- #endif /* ASSEMBLER */
---- glibc-2.6.1.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
-+++ glibc-2.6.1/sysdeps/unix/sysv/linux/alpha/sysdep.h
-@@ -29,6 +29,8 @@
- /* There is some commonality. */
- #include <sysdeps/unix/alpha/sysdep.h>
-
-+#include <tls.h>
-+
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
- of the kernel. But these symbols do not follow the SYS_* syntax
-@@ -96,4 +96,46 @@
- INTERNAL_SYSCALL1(name, err_out, nr, args); \
- })
-
-+/* Pointer mangling support. Note that tls access is slow enough that
-+ we don't deoptimize things by placing the pointer check value there. */
-+
-+#if defined NOT_IN_libc && defined IS_IN_rtld
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-+# define PTR_MANGLE(var) \
-+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#elif defined PIC
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldq tmp, __pointer_chk_guard; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard attribute_relro;
-+# define PTR_MANGLE(var) \
-+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#else
-+/* Pointer mangling is not yet supported for static libc on alpha. */
-+# ifndef __ASSEMBLER__
-+# define PTR_MANGLE(var) (void) (var)
-+# define PTR_DEMANGLE(var) (void) (var)
-+# endif
-+#endif
-+
- #endif /* _LINUX_ALPHA_SYSDEP_H */
diff --git a/patches/glibc/2.6.1/210-lll_lock_t.patch b/patches/glibc/2.6.1/210-lll_lock_t.patch
deleted file mode 100644
index 9459731..0000000
--- a/patches/glibc/2.6.1/210-lll_lock_t.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-Patch provided bu Ioannis E. VENETIS
-
-Using:
-
-typedef int lll_lock_t;
-
-creates problems during compilation. Since glibc 2.7 got rid of the 'typedef' and
-uses directly 'int', we do the same here.
-
-diff -Naur glibc-2.6.1/nptl/allocatestack.c glibc-2.6.1.new/nptl/allocatestack.c
---- glibc-2.6.1/nptl/allocatestack.c 2006-08-23 20:39:47.000000000 +0300
-+++ glibc-2.6.1.new/nptl/allocatestack.c 2008-07-27 20:56:19.000000000 +0300
-@@ -103,7 +103,7 @@
- static size_t stack_cache_actsize;
-
- /* Mutex protecting this variable. */
--static lll_lock_t stack_cache_lock = LLL_LOCK_INITIALIZER;
-+static int stack_cache_lock = LLL_LOCK_INITIALIZER;
-
- /* List of queued stack frames. */
- static LIST_HEAD (stack_cache);
-diff -Naur glibc-2.6.1/nptl/descr.h glibc-2.6.1.new/nptl/descr.h
---- glibc-2.6.1/nptl/descr.h 2006-09-24 20:10:55.000000000 +0300
-+++ glibc-2.6.1.new/nptl/descr.h 2008-07-27 20:54:41.000000000 +0300
-@@ -305,10 +305,10 @@
- int parent_cancelhandling;
-
- /* Lock to synchronize access to the descriptor. */
-- lll_lock_t lock;
-+ int lock;
-
- /* Lock for synchronizing setxid calls. */
-- lll_lock_t setxid_futex;
-+ int setxid_futex;
-
- #if HP_TIMING_AVAIL
- /* Offset of the CPU clock at start thread start time. */
-diff -Naur glibc-2.6.1/nptl/pthread_attr_init.c glibc-2.6.1.new/nptl/pthread_attr_init.c
---- glibc-2.6.1/nptl/pthread_attr_init.c 2004-03-19 01:56:31.000000000 +0200
-+++ glibc-2.6.1.new/nptl/pthread_attr_init.c 2008-07-27 20:55:03.000000000 +0300
-@@ -27,7 +27,7 @@
-
-
- struct pthread_attr *__attr_list;
--lll_lock_t __attr_list_lock = LLL_LOCK_INITIALIZER;
-+int __attr_list_lock = LLL_LOCK_INITIALIZER;
-
-
- int
-diff -Naur glibc-2.6.1/nptl/pthreadP.h glibc-2.6.1.new/nptl/pthreadP.h
---- glibc-2.6.1/nptl/pthreadP.h 2006-08-23 20:42:52.000000000 +0300
-+++ glibc-2.6.1.new/nptl/pthreadP.h 2008-07-27 20:56:40.000000000 +0300
-@@ -143,7 +143,7 @@
-
- /* Attribute handling. */
- extern struct pthread_attr *__attr_list attribute_hidden;
--extern lll_lock_t __attr_list_lock attribute_hidden;
-+extern int __attr_list_lock attribute_hidden;
-
- /* First available RT signal. */
- extern int __current_sigrtmin attribute_hidden;
-diff -Naur glibc-2.6.1/nptl/semaphoreP.h glibc-2.6.1.new/nptl/semaphoreP.h
---- glibc-2.6.1/nptl/semaphoreP.h 2006-05-11 20:08:37.000000000 +0300
-+++ glibc-2.6.1.new/nptl/semaphoreP.h 2008-07-27 20:55:42.000000000 +0300
-@@ -48,7 +48,7 @@
- extern void *__sem_mappings attribute_hidden;
-
- /* Lock to protect the search tree. */
--extern lll_lock_t __sem_mappings_lock attribute_hidden;
-+extern int __sem_mappings_lock attribute_hidden;
-
-
- /* Initializer for mountpoint. */
-diff -Naur glibc-2.6.1/nptl/sem_open.c glibc-2.6.1.new/nptl/sem_open.c
---- glibc-2.6.1/nptl/sem_open.c 2006-05-11 20:09:43.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sem_open.c 2008-07-27 20:55:22.000000000 +0300
-@@ -147,7 +147,7 @@
- void *__sem_mappings attribute_hidden;
-
- /* Lock to protect the search tree. */
--lll_lock_t __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER;
-+int __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER;
-
-
- /* Search for existing mapping and if possible add the one provided. */
-diff -Naur glibc-2.6.1/nptl/pthread_once.c glibc-2.6.1.new/nptl/pthread_once.c
---- glibc-2.6.1/nptl/pthread_once.c 2002-11-27 00:50:31.000000000 +0200
-+++ glibc-2.6.1.new/nptl/pthread_once.c 2008-07-27 20:57:12.000000000 +0300
-@@ -22,7 +22,7 @@
-
-
-
--static lll_lock_t once_lock = LLL_LOCK_INITIALIZER;
-+static int once_lock = LLL_LOCK_INITIALIZER;
-
-
- int
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h 2008-07-27 20:59:15.000000000 +0300
-@@ -230,9 +230,6 @@
- /* Our internal lock implementation is identical to the binary-compatible
- mutex implementation. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/fork.c glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/fork.c
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/fork.c 2003-12-21 01:37:13.000000000 +0200
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/fork.c 2008-07-27 21:00:01.000000000 +0300
-@@ -183,7 +183,7 @@
- }
-
- /* Initialize the fork lock. */
-- __fork_lock = (lll_lock_t) LLL_LOCK_INITIALIZER;
-+ __fork_lock = (int) LLL_LOCK_INITIALIZER;
- }
- else
- {
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/fork.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/fork.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/fork.h 2006-05-15 23:19:43.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/fork.h 2008-07-27 20:58:49.000000000 +0300
-@@ -26,7 +26,7 @@
- extern unsigned long int *__fork_generation_pointer attribute_hidden;
-
- /* Lock to protect allocation and deallocation of fork handlers. */
--extern lll_lock_t __fork_lock attribute_hidden;
-+extern int __fork_lock attribute_hidden;
-
- /* Elements of the fork handler lists. */
- struct fork_handler
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h 2006-09-05 17:44:25.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h 2008-07-27 21:00:19.000000000 +0300
-@@ -436,9 +436,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h 2008-07-27 20:58:16.000000000 +0300
-@@ -223,9 +223,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. We can use the lll_mutex_*. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
- /* Initializers for lock. */
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h 2008-07-27 21:00:36.000000000 +0300
-@@ -254,9 +254,6 @@
- /* Our internal lock implementation is identical to the binary-compatible
- mutex implementation. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/register-atfork.c glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/register-atfork.c
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/register-atfork.c 2005-12-22 00:17:21.000000000 +0200
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/register-atfork.c 2008-07-27 21:00:55.000000000 +0300
-@@ -24,7 +24,7 @@
-
-
- /* Lock to protect allocation and deallocation of fork handlers. */
--lll_lock_t __fork_lock = LLL_LOCK_INITIALIZER;
-+int __fork_lock = LLL_LOCK_INITIALIZER;
-
-
- /* Number of pre-allocated handler entries. */
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2008-07-27 21:01:14.000000000 +0300
-@@ -309,9 +309,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. We can use the lll_mutex_*. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h 2006-07-29 08:06:06.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h 2008-07-27 20:58:00.000000000 +0300
-@@ -278,9 +278,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h 2006-07-29 08:06:06.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h 2008-07-27 20:59:39.000000000 +0300
-@@ -237,9 +237,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. We can use the lll_mutex_*. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
- /* Initializers for lock. */
-diff -Naur glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
---- glibc-2.6.1/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h 2006-09-05 17:45:34.000000000 +0300
-+++ glibc-2.6.1.new/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h 2008-07-27 20:58:33.000000000 +0300
-@@ -446,9 +446,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
diff --git a/patches/glibc/2.6.1/220-cross-posix_makefile.patch b/patches/glibc/2.6.1/220-cross-posix_makefile.patch
deleted file mode 100644
index ae623db..0000000
--- a/patches/glibc/2.6.1/220-cross-posix_makefile.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-On 20090111.1151+0100, Thomas Jourdan <tjourdan@neuf.fr> wrote:
-
- I'm still working on the solaris port an I have the same issue here.
- While trying to build the i686-nptl-linux-gnu toolchain under
- OpenSolaris, the problems appears during the make install rule of the
- libc function.
-
- The problem is that solaris tries to execute ld-linux.so.2, which is an
- elf 32 bits dyn lib, and it fails with a memory fault, not a "cannot
- execute binary file". Hence the build stops on this error.
-
-And on 20090111.1339+0100, he replied with:
-
- After digging a little, the problem comes from the
- glibc-2.6.1/posix/Makefile. It has been solved starting from glibc 2.7
- so I extracted a patch for glibc 2.6.1.
-
---- glibc-2.6.1/posix/Makefile 2007-04-04 01:28:20.000000000 +0200
-+++ glibc-2.7/posix/Makefile 2007-09-12 01:57:22.000000000 +0200
-@@ -98,7 +98,7 @@
- endif
- others := getconf
- install-bin := getconf
--install-others := $(inst_libexecdir)/getconf
-+install-others-programs := $(inst_libexecdir)/getconf
-
- before-compile := testcases.h ptestcases.h
-
-@@ -110,7 +110,7 @@
- tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
- tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
- bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
-- tst-vfork3-mem tst-vfork3.mtrace
-+ tst-vfork3-mem tst-vfork3.mtrace getconf.speclist
-
- include ../Rules
-
-@@ -291,12 +291,20 @@
- $(objpfx)bug-glob2-mem: $(objpfx)bug-glob2.out
- $(common-objpfx)malloc/mtrace $(objpfx)bug-glob2.mtrace > $@
-
--$(inst_libexecdir)/getconf: $(objpfx)getconf FORCE
-+$(inst_libexecdir)/getconf: $(inst_bindir)/getconf \
-+ $(objpfx)getconf.speclist FORCE
- $(addprefix $(..)./scripts/mkinstalldirs ,\
- $(filter-out $(wildcard $@),$@))
-- for spec in `LC_ALL=C GETCONF_DIR=/dev/null \
-- $(run-program-prefix) $< \
-- _POSIX_V6_WIDTH_RESTRICTED_ENVS`; do \
-- $(INSTALL_PROGRAM) $< $@/$$spec.new; \
-- mv -f $@/$$spec.new $@/$$spec; \
-- done
-+ while read spec; do \
-+ ln -f $< $@/$$spec.new || $(INSTALL_PROGRAM) $< $@/$$spec.new; \
-+ mv -f $@/$$spec.new $@/$$spec; \
-+ done < $(objpfx)getconf.speclist
-+
-+$(objpfx)getconf.speclist: $(objpfx)getconf
-+ifeq (no,$(cross-compiling))
-+ LC_ALL=C GETCONF_DIR=/dev/null \
-+ $(run-program-prefix) $< _POSIX_V6_WIDTH_RESTRICTED_ENVS > $@.new
-+else
-+ > $@.new
-+endif
-+ mv -f $@.new $@
diff --git a/patches/glibc/2.6/100-cygwin.patch b/patches/glibc/2.6/100-cygwin.patch
deleted file mode 100644
index 3c0cd7d..0000000
--- a/patches/glibc/2.6/100-cygwin.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-Fixes
-elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
-...
-when building glibc-2.3.x on cygwin
-
-Idea from
-http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
-Basically, make glibc use .oST as suffix for 'object static'
-instead of .oS, since cygwin has trouble distinguishing .os from .oS
-(Original patch had .on, but .oST is more mnemonic for 'object static')
-
-glibc-linuxthreads-2.3.5 also requires a patch, see
-../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
-
-[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
-
-Message-ID: <4282FCBA.3040000@unicontrols.cz>
-Date: Thu, 12 May 2005 08:50:34 +0200
-From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
-To: Dan Kegel <dank@kegel.com>
-CC: crossgcc@sources.redhat.com
-Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
-
-Hi Dan,
-following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
-on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
-
---
- Petr Cvachoucek
- Unicontrols a.s.
- http://www.unicontrols.cz
-]
-
-diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200
-@@ -472,7 +472,7 @@
- # run the linked programs.
- link-libc = -Wl,-rpath-link=$(rpath-link) \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
-+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
- # This is how to find at build-time things that will be installed there.
- rpath-dirs = math elf dlfcn nss nis rt resolv crypt
- endif
-@@ -693,7 +693,7 @@
- # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
- # to pass different flags for each flavor.
- libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
--all-object-suffixes := .o .os .op .og .ob .oS
-+all-object-suffixes := .o .os .op .og .ob .oST
- object-suffixes :=
- CPPFLAGS-.o = $(pic-default)
- CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
-@@ -749,14 +749,14 @@
-
- ifeq (yes,$(build-shared))
- # Build special library that contains the static-only routines for libc.
--object-suffixes-for-libc += .oS
-+object-suffixes-for-libc += .oST
-
- # Must build the routines as PIC, though, because they can end up in (users')
- # shared objects. We don't want to use CFLAGS-os because users may, for
- # example, make that processor-specific.
--CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
--CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
--libtype.oS = lib%_nonshared.a
-+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
-+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
-+libtype.oST = lib%_nonshared.a
- endif
-
- # The assembler can generate debug information too.
-diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200
-@@ -417,7 +417,7 @@
- # Bounded pointer thunks are only built for *.ob
- elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
-
--elide-routines.oS += $(filter-out $(static-only-routines),\
-+elide-routines.oST += $(filter-out $(static-only-routines),\
- $(routines) $(aux) $(sysdep_routines)) \
- $(elide-bp-thunks)
- elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
-@@ -981,7 +981,7 @@
- install: $(inst_libdir)/libc.so
- $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)$(libc-name)) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -989,7 +989,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
- ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100
-+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200
-@@ -13,7 +13,7 @@
-
- ifneq (,$($(lib)-static-only-routines))
- ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
--object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
-+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
- endif
- endif
-
-@@ -29,7 +29,7 @@
-
- # Add each flavor of library to the lists of things to build and install.
- install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
--extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
-+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
- $(patsubst %,%$o,$(filter-out \
- $($(lib)-shared-only-routines),\
- $(all-$(lib)-routines))))
-@@ -57,7 +57,7 @@
-
-
- # Use o-iterator.mk to generate a rule for each flavor of library.
--ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
-+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
- define o-iterator-doit
- $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
- $(patsubst %,$(objpfx)%$o,\
-@@ -65,7 +65,7 @@
- $(all-$(lib)-routines))); \
- $$(build-extra-lib)
- endef
--object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
-+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
- include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
- endif
-
-@@ -77,9 +77,9 @@
- $(build-extra-lib)
- endif
-
--ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
--$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
-- $(patsubst %,$(objpfx)%.oS,\
-+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
-+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
-+ $(patsubst %,$(objpfx)%.oST,\
- $(filter $($(lib)-static-only-routines),\
- $(all-$(lib)-routines)))
- $(build-extra-lib)
-diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100
-+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200
-@@ -375,7 +375,7 @@
-
- $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
- $(objpfx)libpthread.so$(libpthread.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)pthread) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -383,7 +383,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
- ')' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200
-+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200
-@@ -10,4 +10,4 @@
- ASFLAGS-.op += -Wa,-Av9a
- ASFLAGS-.og += -Wa,-Av9a
- ASFLAGS-.ob += -Wa,-Av9a
--ASFLAGS-.oS += -Wa,-Av9a
-+ASFLAGS-.oST += -Wa,-Av9a
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.6/110-configure-apple-as.patch b/patches/glibc/2.6/110-configure-apple-as.patch
deleted file mode 100644
index 78a1324..0000000
--- a/patches/glibc/2.6/110-configure-apple-as.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
-http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
-
-The following makes it possible to configure glibc-2.3.2 on Mac OS X,
-where the assembler but doesn't understand the --version flag.
-
-Fixes the symptom
-checking whether ld is GNU ld... no
-checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
-checking version of /usr/libexec/gcc/darwin/ppc/as...
-<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
-
---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003
-+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004
-@@ -4039,7 +4039,7 @@
- # Found it, now check the version.
- echo "$as_me:$LINENO: checking version of $AS" >&5
- echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
-- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-+ ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.1[3-9]*)
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.6/120-fix-pr631.patch b/patches/glibc/2.6/120-fix-pr631.patch
deleted file mode 100644
index 13688df..0000000
--- a/patches/glibc/2.6/120-fix-pr631.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005
-+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005
-@@ -510,7 +510,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005
-+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005
-@@ -120,6 +120,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
-
-Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff --git a/patches/glibc/2.6/130-i686-assembler.patch b/patches/glibc/2.6/130-i686-assembler.patch
deleted file mode 100644
index 9904efb..0000000
--- a/patches/glibc/2.6/130-i686-assembler.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-
-
-Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
-===================================================================
---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
-+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
-Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
-===================================================================
---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
-+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy)
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
diff --git a/patches/glibc/2.6/140-i386-preferred-stack-boundary.patch b/patches/glibc/2.6/140-i386-preferred-stack-boundary.patch
deleted file mode 100644
index 449821d..0000000
--- a/patches/glibc/2.6/140-i386-preferred-stack-boundary.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
-License: LGPL v2.1
-
-Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
-and 2 is not.
-
-diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100
-+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200
-@@ -36,7 +36,7 @@
- ifeq ($(subdir),csu)
- sysdep-CFLAGS += -mpreferred-stack-boundary=4
- else
--sysdep-CFLAGS += -mpreferred-stack-boundary=2
-+sysdep-CFLAGS += -mpreferred-stack-boundary=4
- # Likewise, any function which calls user callbacks
- uses-callbacks += -mpreferred-stack-boundary=4
- # Likewise, any stack alignment tests
diff --git a/patches/glibc/2.6/150-alpha-asm_page.patch b/patches/glibc/2.6/150-alpha-asm_page.patch
deleted file mode 100644
index b198b36..0000000
--- a/patches/glibc/2.6/150-alpha-asm_page.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
- from the kernel header to sys/user.h and remove the #include of
- sys/user.h.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
-@@ -23,7 +23,6 @@
- only. Don't read too much into it. Don't use it for anything other
- than gdb/strace unless you know what you are doing. */
-
--#include <asm/page.h>
- #include <asm/reg.h>
-
- struct user
-@@ -41,6 +40,9 @@ struct user
- char u_comm[32]; /* user command name */
- };
-
-+#define PAGE_SHIFT 13
-+#define PAGE_SIZE (1 << PAGE_SHIFT)
-+#define PAGE_MASK (~(PAGE_SIZE-1))
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
diff --git a/patches/glibc/2.6/160-use_short_for_fnstsw.patch b/patches/glibc/2.6/160-use_short_for_fnstsw.patch
deleted file mode 100644
index 0e849fa..0000000
--- a/patches/glibc/2.6/160-use_short_for_fnstsw.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Original patch from H.J. Lu, as reported there:
-http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
-
-fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
-The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
-
-diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
-+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c 2008-06-24 10:56:14.000000000 +0200
-@@ -26,7 +26,7 @@
- int
- fetestexcept (int excepts)
- {
-- int temp;
-+ short temp;
- int xtemp = 0;
-
- /* Get current exceptions. */
diff --git a/patches/glibc/2.6/170-alpha-asm_elf.patch b/patches/glibc/2.6/170-alpha-asm_elf.patch
deleted file mode 100644
index 3da5c8e..0000000
--- a/patches/glibc/2.6/170-alpha-asm_elf.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-since the kernel no longer provides asm/elf.h, the sys/procfs.h from the
-common code, alpha, and sh fail when used. this should things up.
--mike
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
-*Attachment: signature.asc <msg00012/signature.asc>*
-/Description:/ This is a digitally signed message part.
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-@@ -29,10 +29,23 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
-+ * I have no idea why that is so. For now, we just leave it at 33
-+ * (32 general regs + processor status word).
-+ */
-+#define ELF_NGREG 33
-+#define ELF_NFPREG 32
-+
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-@@ -29,10 +29,19 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * ELF register definitions...
-+ */
-+typedef unsigned long elf_greg_t;
-+
-+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef struct user_fpu_struct elf_fpregset_t;
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
-@@ -1,115 +1,2 @@
--/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
--
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, write to the Free
-- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-- 02111-1307 USA. */
--
--#ifndef _SYS_PROCFS_H
--#define _SYS_PROCFS_H 1
--
--/* This is somehow modelled after the file of the same name on SysVr4
-- systems. It provides a definition of the core file format for ELF
-- used on Linux. */
--
--#include <features.h>
--#include <signal.h>
--#include <sys/time.h>
--#include <sys/types.h>
--#include <sys/ucontext.h>
--#include <sys/user.h>
--#include <asm/elf.h>
--
--__BEGIN_DECLS
--
--struct elf_siginfo
-- {
-- int si_signo; /* Signal number. */
-- int si_code; /* Extra code. */
-- int si_errno; /* Errno. */
-- };
--
--/* Definitions to generate Intel SVR4-like core files. These mostly
-- have the same names as the SVR4 types with "elf_" tacked on the
-- front to prevent clashes with linux definitions, and the typedef
-- forms have been avoided. This is mostly like the SVR4 structure,
-- but more Linuxy, with things that Linux does not support and which
-- gdb doesn't really use excluded. Fields present but not used are
-- marked with "XXX". */
--struct elf_prstatus
-- {
--#if 0
-- long int pr_flags; /* XXX Process flags. */
-- short int pr_why; /* XXX Reason for process halt. */
-- short int pr_what; /* XXX More detailed reason. */
--#endif
-- struct elf_siginfo pr_info; /* Info associated with signal. */
-- short int pr_cursig; /* Current signal. */
-- unsigned long int pr_sigpend; /* Set of pending signals. */
-- unsigned long int pr_sighold; /* Set of held signals. */
--#if 0
-- struct sigaltstack pr_altstack; /* Alternate stack info. */
-- struct sigaction pr_action; /* Signal action for current sig. */
--#endif
-- __pid_t pr_pid;
-- __pid_t pr_ppid;
-- __pid_t pr_pgrp;
-- __pid_t pr_sid;
-- struct timeval pr_utime; /* User time. */
-- struct timeval pr_stime; /* System time. */
-- struct timeval pr_cutime; /* Cumulative user time. */
-- struct timeval pr_cstime; /* Cumulative system time. */
--#if 0
-- long int pr_instr; /* Current instruction. */
--#endif
-- elf_gregset_t pr_reg; /* GP registers. */
-- int pr_fpvalid; /* True if math copro being used. */
-- };
--
--
--#define ELF_PRARGSZ (80) /* Number of chars for args */
--
--struct elf_prpsinfo
-- {
-- char pr_state; /* Numeric process state. */
-- char pr_sname; /* Char for pr_state. */
-- char pr_zomb; /* Zombie. */
-- char pr_nice; /* Nice val. */
-- unsigned long int pr_flag; /* Flags. */
-- unsigned short int pr_uid;
-- unsigned short int pr_gid;
-- int pr_pid, pr_ppid, pr_pgrp, pr_sid;
-- /* Lots missing */
-- char pr_fname[16]; /* Filename of executable. */
-- char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
-- };
--
--/* Addresses. */
--typedef void *psaddr_t;
--
--/* Register sets. Linux has different names. */
--typedef gregset_t prgregset_t;
--typedef fpregset_t prfpregset_t;
--
--/* We don't have any differences between processes and threads,
-- therefore habe only ine PID type. */
--typedef __pid_t lwpid_t;
--
--
--typedef struct elf_prstatus prstatus_t;
--typedef struct elf_prpsinfo prpsinfo_t;
--
--__END_DECLS
--
--#endif /* sys/procfs.h */
-+/* sys/procfs.h is architecture specific. */
-+#error "This file must be supplied by every Linux architecture."
-
diff --git a/patches/glibc/2.6/180-gcc-4.3-sysinclude-path.patch b/patches/glibc/2.6/180-gcc-4.3-sysinclude-path.patch
deleted file mode 100644
index 563cd28..0000000
--- a/patches/glibc/2.6/180-gcc-4.3-sysinclude-path.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Patch pointed to by Ryan ARNOLD on the libc-help ML.
-See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
-
-Forwarded to crosstool-NG by Ioannis E. VENETIS:
-See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
-
-GCC 4.3 changed the location of some of the header files. I don't
-understand why you'd be getting these errors while building GCC since
-it provides them.
-
-With regard to GLIBC, Roland checked in some changes so that the GLIBC
-build system could find the new locations of the GCC provided header
-files.
-
-diff -durN glibc-2.6.orig/configure.in glibc-2.6/configure.in
---- glibc-2.6.orig/configure.in 2007-06-08 05:16:36.000000000 +0200
-+++ glibc-2.6/configure.in 2008-06-24 18:38:46.000000000 +0200
-@@ -911,8 +911,12 @@
- # header directory and add that to the list. NOTE: Only does the right
- # thing on a system that doesn't need fixincludes. (Not presently a problem.)
- if test -n "$sysheaders"; then
-- ccheaders=`$CC -print-file-name=include`
-- SYSINCLUDES="-nostdinc -isystem $ccheaders \
-+ SYSINCLUDES=-nostdinc
-+ for d in include include-fixed; do
-+ i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
-+ SYSINCLUDES="$SYSINCLUDES -isystem $i"
-+ done
-+ SYSINCLUDES="$SYSINCLUDES \
- -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
- if test -n "$CXX"; then
- cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
-diff -durN glibc-2.6.orig/configure glibc-2.6/configure
---- glibc-2.6.orig/configure 2008-06-24 18:35:34.000000000 +0200
-+++ glibc-2.6/configure 2008-06-24 18:38:46.000000000 +0200
-@@ -4562,8 +4562,12 @@
- # header directory and add that to the list. NOTE: Only does the right
- # thing on a system that doesn't need fixincludes. (Not presently a problem.)
- if test -n "$sysheaders"; then
-- ccheaders=`$CC -print-file-name=include`
-- SYSINCLUDES="-nostdinc -isystem $ccheaders \
-+ SYSINCLUDES=-nostdinc
-+ for d in include include-fixed; do
-+ i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
-+ SYSINCLUDES="$SYSINCLUDES -isystem $i"
-+ done
-+ SYSINCLUDES="$SYSINCLUDES \
- -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
- if test -n "$CXX"; then
- cxxversion=`$CXX -dumpversion 2>&5` &&
diff --git a/patches/glibc/2.6/190-alpha-atfcts.patch b/patches/glibc/2.6/190-alpha-atfcts.patch
deleted file mode 100644
index c3cdae2..0000000
--- a/patches/glibc/2.6/190-alpha-atfcts.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- glibc-2.6/sysdeps/unix/sysv/linux/kernel-features.h 2006-07-29 07:43:27.000000000 +0300
-+++ glibc-2.6/sysdeps/unix/sysv/linux/kernel-features.h.new 2008-07-26 08:45:06.000000000 +0300
-@@ -445,7 +445,7 @@
- /* The *at syscalls were introduced just after 2.6.16-rc1. Due to the way the
- kernel versions are advertised we can only rely on 2.6.17 to have
- the code. */
--#if __LINUX_KERNEL_VERSION >= 0x020611
-+#if __LINUX_KERNEL_VERSION >= 0x020611 && !defined __alpha__
- # define __ASSUME_ATFCTS 1
- #endif
-
diff --git a/patches/glibc/2.6/200-alpha-ptr_mangle.patch b/patches/glibc/2.6/200-alpha-ptr_mangle.patch
deleted file mode 100644
index 7de4bac..0000000
--- a/patches/glibc/2.6/200-alpha-ptr_mangle.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- glibc-2.6.orig/sysdeps/unix/alpha/sysdep.h
-+++ glibc-2.6/sysdeps/unix/alpha/sysdep.h
-@@ -397,42 +397,4 @@
- _sc_ret = _sc_0, _sc_err = _sc_19; \
- }
-
--/* Pointer mangling support. Note that tls access is slow enough that
-- we don't deoptimize things by placing the pointer check value there. */
--
--#include <stdint.h>
--
--#if defined NOT_IN_libc && defined IS_IN_rtld
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-- ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
--# define PTR_MANGLE(var) \
-- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#elif defined PIC
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldq tmp, __pointer_chk_guard; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard attribute_relro;
--# define PTR_MANGLE(var) \
-- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#endif
--
- #endif /* ASSEMBLER */
---- glibc-2.6.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
-+++ glibc-2.6/sysdeps/unix/sysv/linux/alpha/sysdep.h
-@@ -29,6 +29,8 @@
- /* There is some commonality. */
- #include <sysdeps/unix/alpha/sysdep.h>
-
-+#include <tls.h>
-+
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
- of the kernel. But these symbols do not follow the SYS_* syntax
-@@ -96,4 +96,46 @@
- INTERNAL_SYSCALL1(name, err_out, nr, args); \
- })
-
-+/* Pointer mangling support. Note that tls access is slow enough that
-+ we don't deoptimize things by placing the pointer check value there. */
-+
-+#if defined NOT_IN_libc && defined IS_IN_rtld
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-+# define PTR_MANGLE(var) \
-+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#elif defined PIC
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldq tmp, __pointer_chk_guard; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard attribute_relro;
-+# define PTR_MANGLE(var) \
-+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#else
-+/* Pointer mangling is not yet supported for static libc on alpha. */
-+# ifndef __ASSEMBLER__
-+# define PTR_MANGLE(var) (void) (var)
-+# define PTR_DEMANGLE(var) (void) (var)
-+# endif
-+#endif
-+
- #endif /* _LINUX_ALPHA_SYSDEP_H */
diff --git a/patches/glibc/2.6/210-lll_lock_t.patch b/patches/glibc/2.6/210-lll_lock_t.patch
deleted file mode 100644
index d243d97..0000000
--- a/patches/glibc/2.6/210-lll_lock_t.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-Patch provided bu Ioannis E. VENETIS
-
-Using:
-
-typedef int lll_lock_t;
-
-creates problems during compilation. Since glibc 2.7 got rid of the 'typedef' and
-uses directly 'int', we do the same here.
-
-diff -Naur glibc-2.6/nptl/allocatestack.c glibc-2.6.new/nptl/allocatestack.c
---- glibc-2.6/nptl/allocatestack.c 2006-08-23 20:39:47.000000000 +0300
-+++ glibc-2.6.new/nptl/allocatestack.c 2008-07-27 20:56:19.000000000 +0300
-@@ -103,7 +103,7 @@
- static size_t stack_cache_actsize;
-
- /* Mutex protecting this variable. */
--static lll_lock_t stack_cache_lock = LLL_LOCK_INITIALIZER;
-+static int stack_cache_lock = LLL_LOCK_INITIALIZER;
-
- /* List of queued stack frames. */
- static LIST_HEAD (stack_cache);
-diff -Naur glibc-2.6/nptl/descr.h glibc-2.6.new/nptl/descr.h
---- glibc-2.6/nptl/descr.h 2006-09-24 20:10:55.000000000 +0300
-+++ glibc-2.6.new/nptl/descr.h 2008-07-27 20:54:41.000000000 +0300
-@@ -304,10 +304,10 @@
- int parent_cancelhandling;
-
- /* Lock to synchronize access to the descriptor. */
-- lll_lock_t lock;
-+ int lock;
-
- /* Lock for synchronizing setxid calls. */
-- lll_lock_t setxid_futex;
-+ int setxid_futex;
-
- #if HP_TIMING_AVAIL
- /* Offset of the CPU clock at start thread start time. */
-diff -Naur glibc-2.6/nptl/pthread_attr_init.c glibc-2.6.new/nptl/pthread_attr_init.c
---- glibc-2.6/nptl/pthread_attr_init.c 2004-03-19 01:56:31.000000000 +0200
-+++ glibc-2.6.new/nptl/pthread_attr_init.c 2008-07-27 20:55:03.000000000 +0300
-@@ -27,7 +27,7 @@
-
-
- struct pthread_attr *__attr_list;
--lll_lock_t __attr_list_lock = LLL_LOCK_INITIALIZER;
-+int __attr_list_lock = LLL_LOCK_INITIALIZER;
-
-
- int
-diff -Naur glibc-2.6/nptl/pthreadP.h glibc-2.6.new/nptl/pthreadP.h
---- glibc-2.6/nptl/pthreadP.h 2006-08-23 20:42:52.000000000 +0300
-+++ glibc-2.6.new/nptl/pthreadP.h 2008-07-27 20:56:40.000000000 +0300
-@@ -143,7 +143,7 @@
-
- /* Attribute handling. */
- extern struct pthread_attr *__attr_list attribute_hidden;
--extern lll_lock_t __attr_list_lock attribute_hidden;
-+extern int __attr_list_lock attribute_hidden;
-
- /* First available RT signal. */
- extern int __current_sigrtmin attribute_hidden;
-diff -Naur glibc-2.6/nptl/semaphoreP.h glibc-2.6.new/nptl/semaphoreP.h
---- glibc-2.6/nptl/semaphoreP.h 2006-05-11 20:08:37.000000000 +0300
-+++ glibc-2.6.new/nptl/semaphoreP.h 2008-07-27 20:55:42.000000000 +0300
-@@ -48,7 +48,7 @@
- extern void *__sem_mappings attribute_hidden;
-
- /* Lock to protect the search tree. */
--extern lll_lock_t __sem_mappings_lock attribute_hidden;
-+extern int __sem_mappings_lock attribute_hidden;
-
-
- /* Initializer for mountpoint. */
-diff -Naur glibc-2.6/nptl/sem_open.c glibc-2.6.new/nptl/sem_open.c
---- glibc-2.6/nptl/sem_open.c 2006-05-11 20:09:43.000000000 +0300
-+++ glibc-2.6.new/nptl/sem_open.c 2008-07-27 20:55:22.000000000 +0300
-@@ -147,7 +147,7 @@
- void *__sem_mappings attribute_hidden;
-
- /* Lock to protect the search tree. */
--lll_lock_t __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER;
-+int __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER;
-
-
- /* Search for existing mapping and if possible add the one provided. */
-diff -Naur glibc-2.6/nptl/pthread_once.c glibc-2.6.new/nptl/pthread_once.c
---- glibc-2.6/nptl/pthread_once.c 2002-11-27 00:50:31.000000000 +0200
-+++ glibc-2.6.new/nptl/pthread_once.c 2008-07-27 20:57:12.000000000 +0300
-@@ -22,7 +22,7 @@
-
-
-
--static lll_lock_t once_lock = LLL_LOCK_INITIALIZER;
-+static int once_lock = LLL_LOCK_INITIALIZER;
-
-
- int
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h 2008-07-27 20:59:15.000000000 +0300
-@@ -230,9 +230,6 @@
- /* Our internal lock implementation is identical to the binary-compatible
- mutex implementation. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.c glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.c
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.c 2003-12-21 01:37:13.000000000 +0200
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.c 2008-07-27 21:00:01.000000000 +0300
-@@ -183,7 +183,7 @@
- }
-
- /* Initialize the fork lock. */
-- __fork_lock = (lll_lock_t) LLL_LOCK_INITIALIZER;
-+ __fork_lock = (int) LLL_LOCK_INITIALIZER;
- }
- else
- {
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/fork.h 2006-05-15 23:19:43.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/fork.h 2008-07-27 20:58:49.000000000 +0300
-@@ -26,7 +26,7 @@
- extern unsigned long int *__fork_generation_pointer attribute_hidden;
-
- /* Lock to protect allocation and deallocation of fork handlers. */
--extern lll_lock_t __fork_lock attribute_hidden;
-+extern int __fork_lock attribute_hidden;
-
- /* Elements of the fork handler lists. */
- struct fork_handler
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h 2006-09-05 17:44:25.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h 2008-07-27 21:00:19.000000000 +0300
-@@ -436,9 +436,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h 2008-07-27 20:58:16.000000000 +0300
-@@ -223,9 +223,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. We can use the lll_mutex_*. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
- /* Initializers for lock. */
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h 2008-07-27 21:00:36.000000000 +0300
-@@ -254,9 +254,6 @@
- /* Our internal lock implementation is identical to the binary-compatible
- mutex implementation. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/register-atfork.c glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/register-atfork.c
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/register-atfork.c 2005-12-22 00:17:21.000000000 +0200
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/register-atfork.c 2008-07-27 21:00:55.000000000 +0300
-@@ -24,7 +24,7 @@
-
-
- /* Lock to protect allocation and deallocation of fork handlers. */
--lll_lock_t __fork_lock = LLL_LOCK_INITIALIZER;
-+int __fork_lock = LLL_LOCK_INITIALIZER;
-
-
- /* Number of pre-allocated handler entries. */
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2006-07-29 08:06:07.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2008-07-27 21:01:14.000000000 +0300
-@@ -309,9 +309,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. We can use the lll_mutex_*. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h 2006-07-29 08:06:06.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h 2008-07-27 20:58:00.000000000 +0300
-@@ -278,9 +278,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h 2006-07-29 08:06:06.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h 2008-07-27 20:59:39.000000000 +0300
-@@ -237,9 +237,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. We can use the lll_mutex_*. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
- /* Initializers for lock. */
-diff -Naur glibc-2.6/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
---- glibc-2.6/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h 2006-09-05 17:45:34.000000000 +0300
-+++ glibc-2.6.new/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h 2008-07-27 20:58:33.000000000 +0300
-@@ -446,9 +446,6 @@
- /* We have a separate internal lock implementation which is not tied
- to binary compatibility. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
diff --git a/patches/glibc/2.6/220-cross-posix_makefile.patch b/patches/glibc/2.6/220-cross-posix_makefile.patch
deleted file mode 100644
index ae623db..0000000
--- a/patches/glibc/2.6/220-cross-posix_makefile.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-On 20090111.1151+0100, Thomas Jourdan <tjourdan@neuf.fr> wrote:
-
- I'm still working on the solaris port an I have the same issue here.
- While trying to build the i686-nptl-linux-gnu toolchain under
- OpenSolaris, the problems appears during the make install rule of the
- libc function.
-
- The problem is that solaris tries to execute ld-linux.so.2, which is an
- elf 32 bits dyn lib, and it fails with a memory fault, not a "cannot
- execute binary file". Hence the build stops on this error.
-
-And on 20090111.1339+0100, he replied with:
-
- After digging a little, the problem comes from the
- glibc-2.6.1/posix/Makefile. It has been solved starting from glibc 2.7
- so I extracted a patch for glibc 2.6.1.
-
---- glibc-2.6.1/posix/Makefile 2007-04-04 01:28:20.000000000 +0200
-+++ glibc-2.7/posix/Makefile 2007-09-12 01:57:22.000000000 +0200
-@@ -98,7 +98,7 @@
- endif
- others := getconf
- install-bin := getconf
--install-others := $(inst_libexecdir)/getconf
-+install-others-programs := $(inst_libexecdir)/getconf
-
- before-compile := testcases.h ptestcases.h
-
-@@ -110,7 +110,7 @@
- tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
- tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
- bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
-- tst-vfork3-mem tst-vfork3.mtrace
-+ tst-vfork3-mem tst-vfork3.mtrace getconf.speclist
-
- include ../Rules
-
-@@ -291,12 +291,20 @@
- $(objpfx)bug-glob2-mem: $(objpfx)bug-glob2.out
- $(common-objpfx)malloc/mtrace $(objpfx)bug-glob2.mtrace > $@
-
--$(inst_libexecdir)/getconf: $(objpfx)getconf FORCE
-+$(inst_libexecdir)/getconf: $(inst_bindir)/getconf \
-+ $(objpfx)getconf.speclist FORCE
- $(addprefix $(..)./scripts/mkinstalldirs ,\
- $(filter-out $(wildcard $@),$@))
-- for spec in `LC_ALL=C GETCONF_DIR=/dev/null \
-- $(run-program-prefix) $< \
-- _POSIX_V6_WIDTH_RESTRICTED_ENVS`; do \
-- $(INSTALL_PROGRAM) $< $@/$$spec.new; \
-- mv -f $@/$$spec.new $@/$$spec; \
-- done
-+ while read spec; do \
-+ ln -f $< $@/$$spec.new || $(INSTALL_PROGRAM) $< $@/$$spec.new; \
-+ mv -f $@/$$spec.new $@/$$spec; \
-+ done < $(objpfx)getconf.speclist
-+
-+$(objpfx)getconf.speclist: $(objpfx)getconf
-+ifeq (no,$(cross-compiling))
-+ LC_ALL=C GETCONF_DIR=/dev/null \
-+ $(run-program-prefix) $< _POSIX_V6_WIDTH_RESTRICTED_ENVS > $@.new
-+else
-+ > $@.new
-+endif
-+ mv -f $@.new $@
diff --git a/patches/glibc/2.7/100-cygwin.patch b/patches/glibc/2.7/100-cygwin.patch
deleted file mode 100644
index 030361f..0000000
--- a/patches/glibc/2.7/100-cygwin.patch
+++ /dev/null
@@ -1,185 +0,0 @@
-Fixes
-elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
-...
-when building glibc-2.3.x on cygwin
-
-Idea from
-http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
-Basically, make glibc use .oST as suffix for 'object static'
-instead of .oS, since cygwin has trouble distinguishing .os from .oS
-(Original patch had .on, but .oST is more mnemonic for 'object static')
-
-glibc-linuxthreads-2.3.5 also requires a patch, see
-../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
-
-[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
-
-Message-ID: <4282FCBA.3040000@unicontrols.cz>
-Date: Thu, 12 May 2005 08:50:34 +0200
-From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
-To: Dan Kegel <dank@kegel.com>
-CC: crossgcc@sources.redhat.com
-Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
-
-Hi Dan,
-following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
-on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
-
---
- Petr Cvachoucek
- Unicontrols a.s.
- http://www.unicontrols.cz
-]
-
-diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200
-@@ -470,7 +470,7 @@
- # run the linked programs.
- link-libc = -Wl,-rpath-link=$(rpath-link) \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
-+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
- # This is how to find at build-time things that will be installed there.
- rpath-dirs = math elf dlfcn nss nis rt resolv crypt
- endif
-@@ -691,7 +691,7 @@
- # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
- # to pass different flags for each flavor.
- libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
--all-object-suffixes := .o .os .op .og .ob .oS
-+all-object-suffixes := .o .os .op .og .ob .oST
- object-suffixes :=
- CPPFLAGS-.o = $(pic-default)
- CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
-@@ -747,14 +747,14 @@
-
- ifeq (yes,$(build-shared))
- # Build special library that contains the static-only routines for libc.
--object-suffixes-for-libc += .oS
-+object-suffixes-for-libc += .oST
-
- # Must build the routines as PIC, though, because they can end up in (users')
- # shared objects. We don't want to use CFLAGS-os because users may, for
- # example, make that processor-specific.
--CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
--CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
--libtype.oS = lib%_nonshared.a
-+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
-+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
-+libtype.oST = lib%_nonshared.a
- endif
-
- # The assembler can generate debug information too.
-diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100
-+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200
-@@ -417,7 +417,7 @@
- # Bounded pointer thunks are only built for *.ob
- elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
-
--elide-routines.oS += $(filter-out $(static-only-routines),\
-+elide-routines.oST += $(filter-out $(static-only-routines),\
- $(routines) $(aux) $(sysdep_routines)) \
- $(elide-bp-thunks)
- elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
-@@ -984,7 +984,7 @@
- install: $(inst_libdir)/libc.so
- $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
- $(common-objpfx)libc.so$(libc.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)$(libc-name)) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -992,7 +992,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
- ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100
-+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200
-@@ -13,7 +13,7 @@
-
- ifneq (,$($(lib)-static-only-routines))
- ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
--object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
-+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
- endif
- endif
-
-@@ -29,7 +29,7 @@
-
- # Add each flavor of library to the lists of things to build and install.
- install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
--extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
-+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
- $(patsubst %,%$o,$(filter-out \
- $($(lib)-shared-only-routines),\
- $(all-$(lib)-routines))))
-@@ -57,7 +57,7 @@
-
-
- # Use o-iterator.mk to generate a rule for each flavor of library.
--ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
-+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
- define o-iterator-doit
- $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
- $(patsubst %,$(objpfx)%$o,\
-@@ -65,7 +65,7 @@
- $(all-$(lib)-routines))); \
- $$(build-extra-lib)
- endef
--object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
-+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
- include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
- endif
-
-@@ -77,9 +77,9 @@
- $(build-extra-lib)
- endif
-
--ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
--$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
-- $(patsubst %,$(objpfx)%.oS,\
-+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
-+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
-+ $(patsubst %,$(objpfx)%.oST,\
- $(filter $($(lib)-static-only-routines),\
- $(all-$(lib)-routines)))
- $(build-extra-lib)
-diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100
-+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200
-@@ -375,7 +375,7 @@
-
- $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
- $(objpfx)libpthread.so$(libpthread.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)pthread) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -383,7 +383,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
- ')' \
- ) > $@.new
- mv -f $@.new $@
-diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200
-+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200
-@@ -10,4 +10,4 @@
- ASFLAGS-.op += -Wa,-Av9a
- ASFLAGS-.og += -Wa,-Av9a
- ASFLAGS-.ob += -Wa,-Av9a
--ASFLAGS-.oS += -Wa,-Av9a
-+ASFLAGS-.oST += -Wa,-Av9a
diff --git a/patches/glibc/2.7/110-configure-apple-as.patch b/patches/glibc/2.7/110-configure-apple-as.patch
deleted file mode 100644
index 264a5df..0000000
--- a/patches/glibc/2.7/110-configure-apple-as.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
-http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
-
-The following makes it possible to configure glibc-2.3.2 on Mac OS X,
-where the assembler but doesn't understand the --version flag.
-
-Fixes the symptom
-checking whether ld is GNU ld... no
-checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
-checking version of /usr/libexec/gcc/darwin/ppc/as...
-<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
-
-NOTE: This patch should apparently be pushed upstream so we don't need to
-keep adding it here.
-
---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003
-+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004
-@@ -4524,7 +4524,7 @@
- # Found it, now check the version.
- { echo "$as_me:$LINENO: checking version of $AS" >&5
- echo $ECHO_N "checking version of $AS... $ECHO_C" >&6; }
-- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-+ ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.1[3-9]*)
diff --git a/patches/glibc/2.7/120-fix-pr631.patch b/patches/glibc/2.7/120-fix-pr631.patch
deleted file mode 100644
index 4e549fd..0000000
--- a/patches/glibc/2.7/120-fix-pr631.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005
-+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005
-@@ -508,7 +508,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005
-+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005
-@@ -120,6 +120,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
diff --git a/patches/glibc/2.7/130-i686-assembler.patch b/patches/glibc/2.7/130-i686-assembler.patch
deleted file mode 100644
index 09c8754..0000000
--- a/patches/glibc/2.7/130-i686-assembler.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-If gcc is configured to generate i686 code or better by default (like
-when using the --with-arch=pentium3 configure option), then the __i686
-macro will always be defined automatically and thus screw up the
-compilation of some .S files.
-
-http://bugs.gentoo.org/131108
-http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
-
-2006-04-25 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/i386/sysdep.h (__i686): Undefine.
-
-Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
-===================================================================
---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
-+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
-Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
-===================================================================
---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
-+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy)
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
diff --git a/patches/glibc/2.7/140-i386-preferred-stack-boundary.patch b/patches/glibc/2.7/140-i386-preferred-stack-boundary.patch
deleted file mode 100644
index 449821d..0000000
--- a/patches/glibc/2.7/140-i386-preferred-stack-boundary.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
-License: LGPL v2.1
-
-Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
-and 2 is not.
-
-diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100
-+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200
-@@ -36,7 +36,7 @@
- ifeq ($(subdir),csu)
- sysdep-CFLAGS += -mpreferred-stack-boundary=4
- else
--sysdep-CFLAGS += -mpreferred-stack-boundary=2
-+sysdep-CFLAGS += -mpreferred-stack-boundary=4
- # Likewise, any function which calls user callbacks
- uses-callbacks += -mpreferred-stack-boundary=4
- # Likewise, any stack alignment tests
diff --git a/patches/glibc/2.7/150-alpha-asm_page.patch b/patches/glibc/2.7/150-alpha-asm_page.patch
deleted file mode 100644
index b198b36..0000000
--- a/patches/glibc/2.7/150-alpha-asm_page.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
- from the kernel header to sys/user.h and remove the #include of
- sys/user.h.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
-@@ -23,7 +23,6 @@
- only. Don't read too much into it. Don't use it for anything other
- than gdb/strace unless you know what you are doing. */
-
--#include <asm/page.h>
- #include <asm/reg.h>
-
- struct user
-@@ -41,6 +40,9 @@ struct user
- char u_comm[32]; /* user command name */
- };
-
-+#define PAGE_SHIFT 13
-+#define PAGE_SIZE (1 << PAGE_SHIFT)
-+#define PAGE_MASK (~(PAGE_SIZE-1))
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
diff --git a/patches/glibc/2.7/160-build_wcs_upper_buffer.patch b/patches/glibc/2.7/160-build_wcs_upper_buffer.patch
deleted file mode 100644
index 72cde92..0000000
--- a/patches/glibc/2.7/160-build_wcs_upper_buffer.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Matthias Kaehlcke <matthias at kaehlcke dot net> writes:
-
-A compilation of an ARM toolchain with glibc 2.7 using crosstool-ng
-failed with a gcc error in glibc-2.7/posix/regex_internal.c, more
-concretly in the function build_wcs_upper_buffer(). The return type of
-the function prototype in regex_internal.h doesn't correspond with the
-return type of this function in regex_internal.c.
-
-The attached patch corrects the return type of the function prototype
-in regex_internal.h
-
---- glibc-2.7/posix/regex_internal.h.org 2008-05-30 11:16:01.000000000 +0200
-+++ glibc-2.7/posix/regex_internal.h 2008-05-30 11:16:35.000000000 +0200
-@@ -391,7 +391,7 @@
- internal_function;
- # ifdef RE_ENABLE_I18N
- static void build_wcs_buffer (re_string_t *pstr) internal_function;
--static int build_wcs_upper_buffer (re_string_t *pstr) internal_function;
-+static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr) internal_function;
- # endif /* RE_ENABLE_I18N */
- static void build_upper_buffer (re_string_t *pstr) internal_function;
- static void re_string_translate_buffer (re_string_t *pstr) internal_function;
diff --git a/patches/glibc/2.7/170-use_short_for_fnstsw.patch b/patches/glibc/2.7/170-use_short_for_fnstsw.patch
deleted file mode 100644
index 722f8d2..0000000
--- a/patches/glibc/2.7/170-use_short_for_fnstsw.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Original patch from H.J. Lu, as reported there:
-http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
-
-fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
-The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
-
-diff -dur glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.7/sysdeps/i386/fpu/ftestexcept.c
---- glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
-+++ glibc-2.7/sysdeps/i386/fpu/ftestexcept.c 2008-06-24 10:54:43.000000000 +0200
-@@ -26,7 +26,7 @@
- int
- fetestexcept (int excepts)
- {
-- int temp;
-+ short temp;
- int xtemp = 0;
-
- /* Get current exceptions. */
diff --git a/patches/glibc/2.7/180-gcc-4.3-sysinclude-path.patch b/patches/glibc/2.7/180-gcc-4.3-sysinclude-path.patch
deleted file mode 100644
index 7af09a4..0000000
--- a/patches/glibc/2.7/180-gcc-4.3-sysinclude-path.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Patch pointed to by Ryan ARNOLD on the libc-help ML.
-See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
-
-Forwarded to crosstool-NG by Ioannis E. VENETIS:
-See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
-
-GCC 4.3 changed the location of some of the header files. I don't
-understand why you'd be getting these errors while building GCC since
-it provides them.
-
-With regard to GLIBC, Roland checked in some changes so that the GLIBC
-build system could find the new locations of the GCC provided header
-files.
-
-diff -durN glibc-2.7.orig/configure.in glibc-2.7/configure.in
---- glibc-2.7.orig/configure.in 2007-06-08 05:16:36.000000000 +0200
-+++ glibc-2.7/configure.in 2008-06-24 18:38:46.000000000 +0200
-@@ -911,8 +911,12 @@
- # header directory and add that to the list. NOTE: Only does the right
- # thing on a system that doesn't need fixincludes. (Not presently a problem.)
- if test -n "$sysheaders"; then
-- ccheaders=`$CC -print-file-name=include`
-- SYSINCLUDES="-nostdinc -isystem $ccheaders \
-+ SYSINCLUDES=-nostdinc
-+ for d in include include-fixed; do
-+ i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
-+ SYSINCLUDES="$SYSINCLUDES -isystem $i"
-+ done
-+ SYSINCLUDES="$SYSINCLUDES \
- -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
- if test -n "$CXX"; then
- cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
-diff -durN glibc-2.7.orig/configure glibc-2.7/configure
---- glibc-2.7.orig/configure 2008-06-24 18:35:34.000000000 +0200
-+++ glibc-2.7/configure 2008-06-24 18:38:46.000000000 +0200
-@@ -5062,8 +5062,12 @@
- # header directory and add that to the list. NOTE: Only does the right
- # thing on a system that doesn't need fixincludes. (Not presently a problem.)
- if test -n "$sysheaders"; then
-- ccheaders=`$CC -print-file-name=include`
-- SYSINCLUDES="-nostdinc -isystem $ccheaders \
-+ SYSINCLUDES=-nostdinc
-+ for d in include include-fixed; do
-+ i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
-+ SYSINCLUDES="$SYSINCLUDES -isystem $i"
-+ done
-+ SYSINCLUDES="$SYSINCLUDES \
- -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
- if test -n "$CXX"; then
- cxxversion=`$CXX -dumpversion 2>&5` &&
diff --git a/patches/glibc/2.7/190-alpha-asm_elf.patch b/patches/glibc/2.7/190-alpha-asm_elf.patch
deleted file mode 100644
index b9d709e..0000000
--- a/patches/glibc/2.7/190-alpha-asm_elf.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-since the kernel no longer provides asm/elf.h, the sys/procfs.h from the
-common code, alpha, and sh fail when used. this should things up.
--mike
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
-*Attachment: signature.asc <msg00012/signature.asc>*
-/Description:/ This is a digitally signed message part.
-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
- definitions from the kernel header to sys/procfs.h and remove the
- #include of asm/elf.h.
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
-
---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
-@@ -29,10 +29,23 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
-+ * I have no idea why that is so. For now, we just leave it at 33
-+ * (32 general regs + processor status word).
-+ */
-+#define ELF_NGREG 33
-+#define ELF_NFPREG 32
-+
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
---- a/sysdeps/unix/sysv/linux/sys/procfs.h
-+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
-@@ -1,115 +1,2 @@
--/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
--
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, write to the Free
-- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-- 02111-1307 USA. */
--
--#ifndef _SYS_PROCFS_H
--#define _SYS_PROCFS_H 1
--
--/* This is somehow modelled after the file of the same name on SysVr4
-- systems. It provides a definition of the core file format for ELF
-- used on Linux. */
--
--#include <features.h>
--#include <signal.h>
--#include <sys/time.h>
--#include <sys/types.h>
--#include <sys/ucontext.h>
--#include <sys/user.h>
--#include <asm/elf.h>
--
--__BEGIN_DECLS
--
--struct elf_siginfo
-- {
-- int si_signo; /* Signal number. */
-- int si_code; /* Extra code. */
-- int si_errno; /* Errno. */
-- };
--
--/* Definitions to generate Intel SVR4-like core files. These mostly
-- have the same names as the SVR4 types with "elf_" tacked on the
-- front to prevent clashes with linux definitions, and the typedef
-- forms have been avoided. This is mostly like the SVR4 structure,
-- but more Linuxy, with things that Linux does not support and which
-- gdb doesn't really use excluded. Fields present but not used are
-- marked with "XXX". */
--struct elf_prstatus
-- {
--#if 0
-- long int pr_flags; /* XXX Process flags. */
-- short int pr_why; /* XXX Reason for process halt. */
-- short int pr_what; /* XXX More detailed reason. */
--#endif
-- struct elf_siginfo pr_info; /* Info associated with signal. */
-- short int pr_cursig; /* Current signal. */
-- unsigned long int pr_sigpend; /* Set of pending signals. */
-- unsigned long int pr_sighold; /* Set of held signals. */
--#if 0
-- struct sigaltstack pr_altstack; /* Alternate stack info. */
-- struct sigaction pr_action; /* Signal action for current sig. */
--#endif
-- __pid_t pr_pid;
-- __pid_t pr_ppid;
-- __pid_t pr_pgrp;
-- __pid_t pr_sid;
-- struct timeval pr_utime; /* User time. */
-- struct timeval pr_stime; /* System time. */
-- struct timeval pr_cutime; /* Cumulative user time. */
-- struct timeval pr_cstime; /* Cumulative system time. */
--#if 0
-- long int pr_instr; /* Current instruction. */
--#endif
-- elf_gregset_t pr_reg; /* GP registers. */
-- int pr_fpvalid; /* True if math copro being used. */
-- };
--
--
--#define ELF_PRARGSZ (80) /* Number of chars for args */
--
--struct elf_prpsinfo
-- {
-- char pr_state; /* Numeric process state. */
-- char pr_sname; /* Char for pr_state. */
-- char pr_zomb; /* Zombie. */
-- char pr_nice; /* Nice val. */
-- unsigned long int pr_flag; /* Flags. */
-- unsigned short int pr_uid;
-- unsigned short int pr_gid;
-- int pr_pid, pr_ppid, pr_pgrp, pr_sid;
-- /* Lots missing */
-- char pr_fname[16]; /* Filename of executable. */
-- char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
-- };
--
--/* Addresses. */
--typedef void *psaddr_t;
--
--/* Register sets. Linux has different names. */
--typedef gregset_t prgregset_t;
--typedef fpregset_t prfpregset_t;
--
--/* We don't have any differences between processes and threads,
-- therefore habe only ine PID type. */
--typedef __pid_t lwpid_t;
--
--
--typedef struct elf_prstatus prstatus_t;
--typedef struct elf_prpsinfo prpsinfo_t;
--
--__END_DECLS
--
--#endif /* sys/procfs.h */
-+/* sys/procfs.h is architecture specific. */
-+#error "This file must be supplied by every Linux architecture."
-
diff --git a/patches/glibc/2.7/200-alpha-atfcts.patch b/patches/glibc/2.7/200-alpha-atfcts.patch
deleted file mode 100644
index 06c7d8f..0000000
--- a/patches/glibc/2.7/200-alpha-atfcts.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h 2007-08-14 06:21:09.000000000 +0300
-+++ glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h.new 2008-07-23 07:05:20.000000000 +0300
-@@ -449,8 +449,7 @@
- and on Alpha just after 2.6.22-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020611 \
- && ((!defined __sh__ && !defined __alpha__) \
-- || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
-- || (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
-+ || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__))
- # define __ASSUME_ATFCTS 1
- #endif
-
diff --git a/patches/glibc/2.7/210-alpha-ptr_mangle.patch b/patches/glibc/2.7/210-alpha-ptr_mangle.patch
deleted file mode 100644
index 7f22833..0000000
--- a/patches/glibc/2.7/210-alpha-ptr_mangle.patch
+++ /dev/null
@@ -1,94 +0,0 @@
---- glibc-2.7.orig/sysdeps/unix/alpha/sysdep.h
-+++ glibc-2.7/sysdeps/unix/alpha/sysdep.h
-@@ -397,42 +397,4 @@
- _sc_ret = _sc_0, _sc_err = _sc_19; \
- }
-
--/* Pointer mangling support. Note that tls access is slow enough that
-- we don't deoptimize things by placing the pointer check value there. */
--
--#include <stdint.h>
--
--#if defined NOT_IN_libc && defined IS_IN_rtld
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-- ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
--# define PTR_MANGLE(var) \
-- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#elif defined PIC
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldq tmp, __pointer_chk_guard; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard attribute_relro;
--# define PTR_MANGLE(var) \
-- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#endif
--
- #endif /* ASSEMBLER */
---- glibc-2.7.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
-+++ glibc-2.7/sysdeps/unix/sysv/linux/alpha/sysdep.h
-@@ -98,4 +98,46 @@
- INTERNAL_SYSCALL1(name, err_out, nr, args); \
- })
-
-+/* Pointer mangling support. Note that tls access is slow enough that
-+ we don't deoptimize things by placing the pointer check value there. */
-+
-+#if defined NOT_IN_libc && defined IS_IN_rtld
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-+# define PTR_MANGLE(var) \
-+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#elif defined PIC
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldq tmp, __pointer_chk_guard; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard attribute_relro;
-+# define PTR_MANGLE(var) \
-+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#else
-+/* Pointer mangling is not yet supported for static libc on alpha. */
-+# ifndef __ASSEMBLER__
-+# define PTR_MANGLE(var) (void) (var)
-+# define PTR_DEMANGLE(var) (void) (var)
-+# endif
-+#endif
-+
- #endif /* _LINUX_ALPHA_SYSDEP_H */
diff --git a/patches/glibc/2.7/220-objdump_for_host.patch b/patches/glibc/2.7/220-objdump_for_host.patch
deleted file mode 100644
index 8730bc7..0000000
--- a/patches/glibc/2.7/220-objdump_for_host.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -durN glibc-2.7.orig/Makerules glibc-2.7/Makerules
---- glibc-2.7.orig/Makerules 2007-08-26 04:18:03.000000000 +0200
-+++ glibc-2.7/Makerules 2008-07-28 15:17:27.000000000 +0200
-@@ -1203,6 +1203,9 @@
- # The include magic above causes those files to use this variable for flags.
- CPPFLAGS-nonlib = -DNOT_IN_libc=1
-
-+ifneq ($(OBJDUMP_FOR_HOST),)
-+OBJDUMP = $(OBJDUMP_FOR_HOST)
-+endif
-
- ifeq ($(versioning),yes)
- # Generate normalized lists of symbols, versions, and data sizes.
diff --git a/patches/glibc/2.7/230-powerpc-private_futex.patch b/patches/glibc/2.7/230-powerpc-private_futex.patch
deleted file mode 100644
index 3016529..0000000
--- a/patches/glibc/2.7/230-powerpc-private_futex.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-2008-04-28 Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
-
- [BZ 6740]
- nptl/sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET):
- Guard sym definition with #ifndef __ASSUME_PRIVATE_FUTEX.
-
---- a/nptl/sysdeps/powerpc/tcb-offsets.sym
-+++ b/nptl/sysdeps/powerpc/tcb-offsets.sym
-@@ -15,4 +15,6 @@
- PID thread_offsetof (pid)
- TID thread_offsetof (tid)
- POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
-+#ifndef __ASSUME_PRIVATE_FUTEX
- PRIVATE_FUTEX_OFFSET thread_offsetof (header.private_futex)
-+#endif
diff --git a/patches/glibc/2.7/240-sh-lowlevellock-asm.patch b/patches/glibc/2.7/240-sh-lowlevellock-asm.patch
deleted file mode 100644
index dec0390..0000000
--- a/patches/glibc/2.7/240-sh-lowlevellock-asm.patch
+++ /dev/null
@@ -1,56 +0,0 @@
---- glibc-2.7/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S.orig 2007-08-03 16:44:15.000000000 +0100
-+++ glibc-2.7/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S 2008-08-19 21:08:19.000000000 +0100
-@@ -76,7 +76,7 @@
- add tmp2, tmp ; \
- mov.l @tmp, tmp2 ; \
- bra 98f ; \
-- mov #FUTEX_PRIVATE_FLAG, tmp
-+ mov #FUTEX_PRIVATE_FLAG, tmp ; \
- 99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
- 98: extu.b tmp, tmp ; \
- xor tmp, reg ; \
-@@ -88,7 +88,7 @@
- add tmp2, tmp ; \
- mov.l @tmp, tmp2 ; \
- bra 98f ; \
-- mov #FUTEX_PRIVATE_FLAG, tmp
-+ mov #FUTEX_PRIVATE_FLAG, tmp ; \
- 99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
- 98: extu.b tmp, tmp ; \
- xor tmp, reg ; \
-@@ -96,13 +96,13 @@
- mov #FUTEX_WAIT, tmp ; \
- or tmp, reg
- # endif
--# define LOAD_FUTEX_WAKE(reg,tmp) \
-+# define LOAD_FUTEX_WAKE(reg,tmp,tmp2) \
- stc gbr, tmp ; \
- mov.w 99f, tmp2 ; \
- add tmp2, tmp ; \
- mov.l @tmp, tmp2 ; \
- bra 98f ; \
-- mov #FUTEX_PRIVATE_FLAG, tmp
-+ mov #FUTEX_PRIVATE_FLAG, tmp ; \
- 99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
- 98: extu.b tmp, tmp ; \
- xor tmp, reg ; \
---- glibc-2.7/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S.orig 2007-08-03 16:44:57.000000000 +0100
-+++ glibc-2.7/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S 2008-08-19 21:08:22.000000000 +0100
-@@ -42,7 +42,7 @@
- add tmp2, tmp ; \
- mov.l @tmp, tmp2 ; \
- bra 98f ; \
-- mov #FUTEX_PRIVATE_FLAG, tmp
-+ mov #FUTEX_PRIVATE_FLAG, tmp ; \
- 99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
- 98: extu.b tmp, tmp ; \
- xor tmp, reg ; \
-@@ -54,7 +54,7 @@
- add tmp2, tmp ; \
- mov.l @tmp, tmp2 ; \
- bra 98f ; \
-- mov #FUTEX_PRIVATE_FLAG, tmp
-+ mov #FUTEX_PRIVATE_FLAG, tmp ; \
- 99: .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE ; \
- 98: extu.b tmp, tmp ; \
- xor tmp, reg ; \
diff --git a/patches/glibc/2.7/250-sh-chop-linux-version.patch b/patches/glibc/2.7/250-sh-chop-linux-version.patch
deleted file mode 100644
index 7d0062b..0000000
--- a/patches/glibc/2.7/250-sh-chop-linux-version.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- glibc-2.7/sysdeps/unix/sysv/linux/dl-osinfo.h.orig 2007-09-15 23:54:08.000000000 +0100
-+++ glibc-2.7/sysdeps/unix/sysv/linux/dl-osinfo.h 2008-08-20 09:26:26.000000000 +0100
-@@ -83,6 +83,10 @@
- int parts;
- char *cp;
- struct utsname uts;
-+ int dotsfound = 0;
-+ int versionindex = 0;
-+ char *choppoint;
-+
-
- /* Try the uname system call. */
- if (__uname (&uts))
-@@ -102,8 +106,34 @@
- else
- buf = uts.release;
-
-+ /* We are only interested in the first three kernel numbers, so */
-+ /* chop off anything past that: */
-+
-+ choppoint = buf;
-+ while (1)
-+ {
-+ versionindex++;
-+ if (versionindex == 63) break;
-+ if (*choppoint == '.') dotsfound++;
-+ choppoint++;
-+ if (dotsfound == 2)
-+ {
-+ if (*choppoint == '0' || *choppoint == '1'
-+ || *choppoint == '2' || *choppoint == '3'
-+ || *choppoint == '4' || *choppoint == '5'
-+ || *choppoint == '6' || *choppoint == '7'
-+ || *choppoint == '8' || *choppoint == '9')
-+ continue;
-+ else
-+ {
-+ *choppoint = 0;
-+ break;
-+ }
-+ }
-+ }
-+
- /* Now convert it into a number. The string consists of at most
-- three parts. */
-+ three parts. Now it does, anyway. ;-) */
- version = 0;
- parts = 0;
- cp = buf;
diff --git a/patches/glibc/2.7/260-sh-syscall-error-path.patch b/patches/glibc/2.7/260-sh-syscall-error-path.patch
deleted file mode 100644
index e293bbf..0000000
--- a/patches/glibc/2.7/260-sh-syscall-error-path.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- glibc-2.7/sysdeps/unix/sysv/linux/sh/sysdep.S.orig 2005-12-30 22:16:43.000000000 +0000
-+++ glibc-2.7/sysdeps/unix/sysv/linux/sh/sysdep.S 2008-08-19 22:33:14.000000000 +0100
-@@ -32,3 +32,13 @@
-
- #define __syscall_error __syscall_error_1
- #include <sysdeps/unix/sh/sysdep.S>
-+
-+ .data
-+ .align 3
-+ .globl ___fpscr_values
-+ .type ___fpscr_values, @object
-+ .size ___fpscr_values, 8
-+___fpscr_values:
-+ .long 0
-+ .long 0x80000
-+weak_alias (___fpscr_values, __fpscr_values)
---- glibc-2.7/sysdeps/unix/sysv/linux/sh/Versions.orig 2003-09-01 05:05:09.000000000 +0100
-+++ glibc-2.7/sysdeps/unix/sysv/linux/sh/Versions 2008-08-19 22:33:14.000000000 +0100
-@@ -2,6 +2,7 @@
- GLIBC_2.2 {
- # functions used in other libraries
- __xstat64; __fxstat64; __lxstat64;
-+ __fpscr_values;
-
- # a*
- alphasort64;
diff --git a/patches/glibc/2.7/270-sh-fix-procfs.patch b/patches/glibc/2.7/270-sh-fix-procfs.patch
deleted file mode 100644
index f5f8bb1..0000000
--- a/patches/glibc/2.7/270-sh-fix-procfs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -durN glibc-2.7.orig/sysdeps/unix/sysv/linux/sh/sys/procfs.h glibc-2.7/sysdeps/unix/sysv/linux/sh/sys/procfs.h
---- glibc-2.7.orig/sysdeps/unix/sysv/linux/sh/sys/procfs.h 2004-11-20 18:56:16.000000000 +0100
-+++ glibc-2.7/sysdeps/unix/sysv/linux/sh/sys/procfs.h 2008-10-24 11:21:15.000000000 +0200
-@@ -29,10 +29,32 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/* BEGIN - UGLY HACK - YEM
-+ * These definitions are copied from the Alpha file,
-+ * and the register numbers are set accordingly to
-+ * what I could find in the Linux kernel sources
-+ * Highly dubious !!!!
-+ * BIG FAT WARNING !!!
-+ */
-+
-+/* Linux kernel says 16 (standards?) registers */
-+#define ELF_NGREG 16
-+/* Linux kernel says 16 floating point registers */
-+#define ELF_NFPREG 16
-+
-+/* Copied from Alpha as is */
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+/* Ditto */
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
-+/* END - UGLY HACK - YEM */
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
diff --git a/patches/glibc/2.7/280-sh-fix-kernel-headers-location.patch b/patches/glibc/2.7/280-sh-fix-kernel-headers-location.patch
deleted file mode 100644
index 0c5caa5..0000000
--- a/patches/glibc/2.7/280-sh-fix-kernel-headers-location.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -durN glibc-2.7.orig/sysdeps/unix/sysv/linux/sh/sys/procfs.h glibc-2.7/sysdeps/unix/sysv/linux/sh/sys/procfs.h
---- glibc-2.7.orig/sysdeps/unix/sysv/linux/sh/sys/procfs.h 2008-10-22 21:23:32.000000000 +0200
-+++ glibc-2.7/sysdeps/unix/sysv/linux/sh/sys/procfs.h 2008-10-22 21:41:54.000000000 +0200
-@@ -29,6 +29,7 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
-+#include <asm/ptrace.h>
-
- __BEGIN_DECLS
-
-diff -durN glibc-2.7.orig/sysdeps/unix/sysv/linux/sh/sys/user.h glibc-2.7/sysdeps/unix/sysv/linux/sh/sys/user.h
---- glibc-2.7.orig/sysdeps/unix/sysv/linux/sh/sys/user.h 2008-10-22 21:23:32.000000000 +0200
-+++ glibc-2.7/sysdeps/unix/sysv/linux/sh/sys/user.h 2008-10-22 21:33:34.000000000 +0200
-@@ -21,8 +21,6 @@
-
- #include <features.h>
-
--#include <asm/user.h>
--
- #undef start_thread
-
- #endif /* sys/user.h */
diff --git a/patches/glibc/2.7/290-powerpc-8xx-CPU15-errata.patch b/patches/glibc/2.7/290-powerpc-8xx-CPU15-errata.patch
deleted file mode 100644
index 1d0643b..0000000
--- a/patches/glibc/2.7/290-powerpc-8xx-CPU15-errata.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Fix memset on PowerPC 8xx, by Nye Liu:
-http://sourceware.org/ml/crossgcc/2008-10/msg00067.html
-
-Quote:
- I am working on a powerpc 860 toolchain, but I am having problems
- convincing glibc to not emit code that uses the dcbz instruction (CPU15
- dcbX bug). The source of the problem is sysdeps/powerpc/power3/memset.S
-
---- glibc-2.7/sysdeps/powerpc/powerpc32/memset.S 2007-03-26 13:09:07.000000000 -0700
-+++ glibc-2.7/sysdeps/powerpc/powerpc32/memset.S.new 2008-10-23 20:28:52.000000000 -0700
-@@ -112,11 +112,13 @@
- clrrwi. rALIGN, rLEN, 5
- mtcrf 0x01, rLEN /* 40th instruction from .align */
-
-+#ifndef BROKEN_PPC_8xx_CPU15
- /* Check if we can use the special case for clearing memory using dcbz.
- This requires that we know the correct cache line size for this
- processor. Getting the __cache_line_size may require establishing GOT
- addressability, so branch out of line to set this up. */
- beq cr1, L(checklinesize)
-+#endif
-
- /* Store blocks of 32-bytes (256-bits) starting on a 32-byte boundary.
- Can't assume that rCHR is zero or that the cache line size is either
-@@ -158,6 +160,7 @@
- add rMEMP, rMEMP, rALIGN
- b L(medium_tail2) /* 72nd instruction from .align */
-
-+#ifndef BROKEN_PPC_8xx_CPU15
- .align 5
- nop
- /* Clear cache lines of memory in 128-byte chunks.
-@@ -191,6 +194,7 @@
- bdnz L(zloop)
- beqlr cr5
- b L(medium_tail2)
-+#endif /* ! BROKEN_PPC_8xx_CPU15 */
-
- .align 5
- L(small):
-@@ -248,6 +252,7 @@
- stw rCHR, -8(rMEMP)
- blr
-
-+#ifndef BROKEN_PPC_8xx_CPU15
- L(checklinesize):
- #ifdef SHARED
- mflr rTMP
-@@ -329,6 +334,7 @@
- L(handletail32):
- clrrwi. rALIGN, rLEN, 5
- b L(nondcbz)
-+#endif /* ! BROKEN_PPC_8xx_CPU15 */
-
- END (BP_SYM (memset))
- libc_hidden_builtin_def (memset)
diff --git a/patches/glibc/2.7/300-binutils-_begin.patch b/patches/glibc/2.7/300-binutils-_begin.patch
deleted file mode 100644
index f670d29..0000000
--- a/patches/glibc/2.7/300-binutils-_begin.patch
+++ /dev/null
@@ -1,190 +0,0 @@
---- glibc-2.7.OLD/elf/Makefile 2009-04-22 17:08:55.000000000 +0300
-+++ glibc-2.7/elf/Makefile 2009-04-22 18:09:18.000000000 +0300
-@@ -1,4 +1,4 @@
--# Copyright (C) 1995-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
-+# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
- # This file is part of the GNU C Library.
-
- # The GNU C Library is free software; you can redistribute it and/or
-@@ -23,7 +23,7 @@
- headers = elf.h bits/elfclass.h link.h bits/link.h
- routines = $(dl-routines) dl-support dl-iteratephdr \
- dl-addr enbl-secure dl-profstub \
-- dl-origin dl-libc dl-sym dl-tsd
-+ dl-origin dl-libc dl-sym dl-tsd dl-sysdep
-
- # The core dynamic linking functions are in libc for the static and
- # profiled libraries.
-@@ -33,7 +33,8 @@
- execstack caller open close trampoline)
- all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
- # But they are absent from the shared libc, because that code is in ld.so.
--elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin
-+elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
-+ dl-sysdep
- shared-only-routines += dl-caller
-
- # ld.so uses those routines, plus some special stuff for being the program
-@@ -120,13 +121,6 @@
- install-bin-script = ldd
- endif
-
--ifeq (yes,$(build-static-nss))
--nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
--resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
--otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-- $(resolvobjdir)/libresolv.a
--endif
--
- others = sprof sln
- install-bin = sprof
- others-static = sln
-@@ -165,14 +159,14 @@
- endif
- ifeq (yes,$(build-shared))
- tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
-- constload1 order $(tests-vis-$(have-protected)) noload filter unload \
-+ constload1 order vismain noload filter unload \
- reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
- nodlopen nodlopen2 neededtest neededtest2 \
- neededtest3 neededtest4 unload2 lateglobal initfirst global \
- restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
- circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
- tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
-- tst-tls-dlinfo \
-+ tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \
- tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
- tst-dlmodcount tst-dlopenrpath tst-deep1 \
- tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
-@@ -181,16 +175,17 @@
- tst-stackguard1 tst-addr1 tst-thrlock
- # reldep9
- test-srcs = tst-pathopt
--tests-vis-yes = vismain
- tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
- endif
- ifeq (yesyes,$(have-fpie)$(build-shared))
- tests: $(objpfx)tst-pie1.out
- endif
- tests: $(objpfx)tst-leaks1-mem
-+tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
-+tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
- modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
- testobj1_1 failobj constload2 constload3 unloadmod \
-- dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
-+ dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
- nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
- nodel2mod1 nodel2mod2 nodel2mod3 \
- nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
-@@ -206,7 +201,10 @@
- tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
- tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
- tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
-- tst-tlsmod15a tst-tlsmod15b \
-+ tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
-+ $(patsubst %,tst-tlsmod17a%,$(tlsmod17a-suffixes)) \
-+ tst-tlsmod17b \
-+ $(patsubst %,tst-tlsmod18a%,$(tlsmod18a-suffixes)) \
- circlemod1 circlemod1a circlemod2 circlemod2a \
- circlemod3 circlemod3a \
- reldep8mod1 reldep8mod2 reldep8mod3 \
-@@ -226,7 +224,6 @@
- ifeq (yesyes,$(have-fpie)$(build-shared))
- modules-names += tst-piemod1
- endif
--modules-vis-yes = vismod1 vismod2 vismod3
- modules-execstack-yes = tst-execstack-mod
- extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
- # We need this variable to be sure the test modules get the right CPPFLAGS.
-@@ -307,7 +304,7 @@
- $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
- LC_ALL=C \
- sed -e '/^=========/,/^=========/!d;/^=========/d' \
-- -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
-+ -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- > $@.lds
- $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
- $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
-@@ -315,7 +312,7 @@
- -Wl,-soname=$(rtld-installed-name) -T $@.lds
- rm -f $@.lds
- readelf -s $@ \
-- | awk '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
-+ | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
-
- # interp.c exists just to get this string into the libraries.
- CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
-@@ -499,6 +496,7 @@
- tst-tlsmod14a.so-no-z-defs = yes
- tst-tlsmod14b.so-no-z-defs = yes
- tst-tlsmod15a.so-no-z-defs = yes
-+tst-tlsmod16b.so-no-z-defs = yes
- circlemod2.so-no-z-defs = yes
- circlemod3.so-no-z-defs = yes
- circlemod3a.so-no-z-defs = yes
-@@ -718,6 +716,22 @@
-
-
-
-+$(objpfx)tst-tls16: $(libdl)
-+$(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so
-+
-+$(objpfx)tst-tls17: $(libdl)
-+$(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so
-+$(patsubst %,$(objpfx)tst-tlsmod17a%.os,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.os : tst-tlsmod17a.c
-+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
-+$(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so
-+$(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes))
-+
-+$(objpfx)tst-tls18: $(libdl)
-+$(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes))
-+$(patsubst %,$(objpfx)tst-tlsmod18a%.os,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c
-+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
-+$(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
-+
- CFLAGS-tst-align.c = $(stack-align-test-flags)
- CFLAGS-tst-align2.c = $(stack-align-test-flags)
- CFLAGS-tst-alignmod.c = $(stack-align-test-flags)
-@@ -804,7 +818,7 @@
- cmp $@ tst-array5-static.exp > /dev/null
-
- ifeq (yesyes,$(have-fpie)$(build-shared))
--CFLAGS-tst-pie1.c += -fpie
-+CFLAGS-tst-pie1.c += $(pie-ccflag)
-
- $(objpfx)tst-pie1.out: $(objpfx)tst-pie1
- $(elf-objpfx)$(rtld-installed-name) \
-@@ -845,10 +859,14 @@
- $(objpfx)tst-dlmodcount.out: $(test-modules)
-
- check-data := $(firstword $(wildcard \
-- $(patsubst %,../scripts/data/localplt-%.data,\
-- $(addsuffix -$(config-os),\
-- $(config-machine) $(base-machine))\
-- generic)))
-+ $(foreach D,$(add-ons) scripts,\
-+ $(patsubst %,$(..)$D/data/localplt-%.data,\
-+ $(abi-name) \
-+ $(addsuffix -$(config-os),\
-+ $(config-machine) \
-+ $(base-machine)) \
-+ generic))))
-+
- tests: $(objpfx)check-localplt.out
-
- ifeq ($(have-thread-library),yes)
-@@ -857,9 +875,11 @@
-
- $(objpfx)check-localplt.out: $(objpfx)check-localplt \
- $(common-objpfx)libc.so \
-- $(common-objpfx)math/libm.so $(thread-dso) \
-- $(common-objpfx)rt/librt.so \
-- $(common-objpfx)dlfcn/libdl.so \
-+ $(common-objpfx)math/libm.so $(thread-dso) \
-+ $(common-objpfx)rt/librt.so \
-+ $(common-objpfx)dlfcn/libdl.so \
-+ $(common-objpfx)resolv/libresolv.so \
-+ $(common-objpfx)crypt/libcrypt.so \
- $(check-data)
- $(dir $<)$(notdir $<) $(filter-out $< $(check-data),$^) | \
- LC_ALL=C sort | \
diff --git a/patches/glibc/2.9/100-ssp-compat.patch b/patches/glibc/2.9/100-ssp-compat.patch
deleted file mode 100644
index b51bc33..0000000
--- a/patches/glibc/2.9/100-ssp-compat.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0010_all_glibc-2.7-ssp-compat.patch
-
--= BEGIN original header =-
-Add backwards compat support for gcc-3.x ssp ... older ssp versions
-used __guard and __stack_smash_handler symbols while gcc-4.1 and newer
-uses __stack_chk_guard and __stack_chk_fail.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/Versions.def glibc-2_9/Versions.def
---- glibc-2_9.orig/Versions.def 2008-08-01 19:13:40.000000000 +0200
-+++ glibc-2_9/Versions.def 2009-02-02 22:00:33.000000000 +0100
-@@ -113,6 +113,9 @@
- GLIBC_2.0
- GLIBC_2.1
- GLIBC_2.3
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ GLIBC_2.3.2
-+%endif
- GLIBC_2.4
- GLIBC_PRIVATE
- }
-diff -durN glibc-2_9.orig/config.h.in glibc-2_9/config.h.in
---- glibc-2_9.orig/config.h.in 2007-03-26 22:40:08.000000000 +0200
-+++ glibc-2_9/config.h.in 2009-02-02 22:00:32.000000000 +0100
-@@ -42,6 +42,9 @@
- assembler instructions per line. Default is `;' */
- #undef ASM_LINE_SEP
-
-+/* Define if we want to enable support for old ssp symbols */
-+#undef ENABLE_OLD_SSP_COMPAT
-+
- /* Define if not using ELF, but `.init' and `.fini' sections are available. */
- #undef HAVE_INITFINI
-
-diff -durN glibc-2_9.orig/configure glibc-2_9/configure
---- glibc-2_9.orig/configure 2008-11-11 10:50:11.000000000 +0100
-+++ glibc-2_9/configure 2009-02-02 22:00:32.000000000 +0100
-@@ -1380,6 +1380,9 @@
- --enable-kernel=VERSION compile for compatibility with kernel not older than
- VERSION
- --enable-all-warnings enable all useful warnings gcc can issue
-+ --disable-old-ssp-compat
-+ enable support for older ssp symbols
-+ [default=no]
-
- Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
-@@ -6470,6 +6473,20 @@
- echo "${ECHO_T}$libc_cv_ssp" >&6; }
-
-
-+# Check whether --enable-old-ssp-compat or --disable-old-ssp-compat was given.
-+if test "${enable_old_ssp_compat+set}" = set; then
-+ enableval="$enable_old_ssp_compat"
-+ enable_old_ssp_compat=$enableval
-+else
-+ enable_old_ssp_compat=no
-+fi;
-+if test "x$enable_old_ssp_compat" = "xyes"; then
-+ cat >>confdefs.h <<\_ACEOF
-+#define ENABLE_OLD_SSP_COMPAT 1
-+_ACEOF
-+
-+fi
-+
- { echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5
- echo $ECHO_N "checking for -fgnu89-inline... $ECHO_C" >&6; }
- if test "${libc_cv_gnu89_inline+set}" = set; then
-diff -durN glibc-2_9.orig/configure.in glibc-2_9/configure.in
---- glibc-2_9.orig/configure.in 2008-11-11 10:50:11.000000000 +0100
-+++ glibc-2_9/configure.in 2009-02-02 22:00:32.000000000 +0100
-@@ -1647,6 +1647,15 @@
- rm -f conftest*])
- AC_SUBST(libc_cv_ssp)
-
-+AC_ARG_ENABLE([old-ssp-compat],
-+ AC_HELP_STRING([--enable-old-ssp-compat],
-+ [enable support for older ssp symbols @<:@default=no@:>@]),
-+ [enable_old_ssp_compat=$enableval],
-+ [enable_old_ssp_compat=no])
-+if test "x$enable_old_ssp_compat" = "xyes"; then
-+ AC_DEFINE(ENABLE_OLD_SSP_COMPAT)
-+fi
-+
- AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
- cat > conftest.c <<EOF
- int foo;
-diff -durN glibc-2_9.orig/csu/Versions glibc-2_9/csu/Versions
---- glibc-2_9.orig/csu/Versions 2006-10-28 01:11:41.000000000 +0200
-+++ glibc-2_9/csu/Versions 2009-02-02 22:00:32.000000000 +0100
-@@ -17,6 +17,12 @@
- # New special glibc functions.
- gnu_get_libc_release; gnu_get_libc_version;
- }
-+ GLIBC_2.3.2 {
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ # global objects and functions for the old propolice patch in gcc
-+ __guard;
-+%endif
-+ }
- GLIBC_PRIVATE {
- %if HAVE___THREAD
- # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
-diff -durN glibc-2_9.orig/csu/libc-start.c glibc-2_9/csu/libc-start.c
---- glibc-2_9.orig/csu/libc-start.c 2007-08-21 00:27:50.000000000 +0200
-+++ glibc-2_9/csu/libc-start.c 2009-02-02 22:00:32.000000000 +0100
-@@ -37,6 +37,9 @@
- uintptr_t __stack_chk_guard attribute_relro;
- # endif
- #endif
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+uintptr_t __guard attribute_relro;
-+#endif
-
- #ifdef HAVE_PTR_NTHREADS
- /* We need atomic operations. */
-@@ -141,6 +144,9 @@
-
- /* Set up the stack checker's canary. */
- uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+ __guard = stack_chk_guard;
-+#endif
- # ifdef THREAD_SET_STACK_GUARD
- THREAD_SET_STACK_GUARD (stack_chk_guard);
- # else
-diff -durN glibc-2_9.orig/debug/Versions glibc-2_9/debug/Versions
---- glibc-2_9.orig/debug/Versions 2008-03-05 07:53:41.000000000 +0100
-+++ glibc-2_9/debug/Versions 2009-02-02 22:00:32.000000000 +0100
-@@ -10,6 +10,12 @@
- # These are to support some gcc features.
- __cyg_profile_func_enter; __cyg_profile_func_exit;
- }
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ GLIBC_2.3.2 {
-+ # backwards ssp compat support; alias to __stack_chk_fail
-+ __stack_smash_handler;
-+ }
-+%endif
- GLIBC_2.3.4 {
- __chk_fail;
- __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk; __stpcpy_chk;
-diff -durN glibc-2_9.orig/debug/stack_chk_fail.c glibc-2_9/debug/stack_chk_fail.c
---- glibc-2_9.orig/debug/stack_chk_fail.c 2007-05-25 01:47:08.000000000 +0200
-+++ glibc-2_9/debug/stack_chk_fail.c 2009-02-02 22:00:32.000000000 +0100
-@@ -28,3 +28,7 @@
- {
- __fortify_fail ("stack smashing detected");
- }
-+
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+strong_alias (__stack_chk_fail, __stack_smash_handler)
-+#endif
-diff -durN glibc-2_9.orig/elf/Versions glibc-2_9/elf/Versions
---- glibc-2_9.orig/elf/Versions 2008-03-08 06:42:26.000000000 +0100
-+++ glibc-2_9/elf/Versions 2009-02-02 22:00:33.000000000 +0100
-@@ -43,6 +43,12 @@
- # runtime interface to TLS
- __tls_get_addr;
- }
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ GLIBC_2.3.2 {
-+ # backwards ssp compat support
-+ __guard;
-+ }
-+%endif
- GLIBC_2.4 {
- # stack canary
- __stack_chk_guard;
-diff -durN glibc-2_9.orig/elf/rtld.c glibc-2_9/elf/rtld.c
---- glibc-2_9.orig/elf/rtld.c 2008-08-14 19:01:56.000000000 +0200
-+++ glibc-2_9/elf/rtld.c 2009-02-02 22:00:32.000000000 +0100
-@@ -89,6 +89,9 @@
- in thread local area. */
- uintptr_t __stack_chk_guard attribute_relro;
- #endif
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+uintptr_t __guard attribute_relro;
-+#endif
-
- /* Only exported for architectures that don't store the pointer guard
- value in thread local area. */
-@@ -842,6 +845,9 @@
- {
- /* Set up the stack checker's canary. */
- uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+ __guard = stack_chk_guard;
-+#endif
- #ifdef THREAD_SET_STACK_GUARD
- THREAD_SET_STACK_GUARD (stack_chk_guard);
- #else
diff --git a/patches/glibc/2.9/110-respect-env-CPPFLAGS.patch b/patches/glibc/2.9/110-respect-env-CPPFLAGS.patch
deleted file mode 100644
index 68033b2..0000000
--- a/patches/glibc/2.9/110-respect-env-CPPFLAGS.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0030_all_glibc-respect-env-CPPFLAGS.patch
-
--= BEGIN original header =-
-Respect environment CPPFLAGS when we run ./configure so we can inject
-random -D things without having to set CFLAGS/ASFLAGS
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
---- glibc-2_9.orig/Makeconfig 2008-08-18 11:42:17.000000000 +0200
-+++ glibc-2_9/Makeconfig 2009-02-02 22:00:35.000000000 +0100
-@@ -673,6 +673,7 @@
- $(foreach lib,$(libof-$(basename $(@F))) \
- $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
- $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-+CPPFLAGS += $(CPPFLAGS-config)
- override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
- $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
- $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
-diff -durN glibc-2_9.orig/config.make.in glibc-2_9/config.make.in
---- glibc-2_9.orig/config.make.in 2008-08-18 11:42:17.000000000 +0200
-+++ glibc-2_9/config.make.in 2009-02-02 22:00:35.000000000 +0100
-@@ -97,6 +97,7 @@
- CXX = @CXX@
- BUILD_CC = @BUILD_CC@
- CFLAGS = @CFLAGS@
-+CPPFLAGS-config = @CPPFLAGS@
- ASFLAGS-config = @ASFLAGS_config@
- AR = @AR@
- RANLIB = @RANLIB@
diff --git a/patches/glibc/2.9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch b/patches/glibc/2.9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
deleted file mode 100644
index dedb03f..0000000
--- a/patches/glibc/2.9/120-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
-
--= BEGIN original header =-
-http://sourceware.org/ml/libc-alpha/2009-01/msg00000.html
-
-From 8ad7030880eaa18dcabf8e284e79026301fd3fa4 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Thu, 8 Jan 2009 00:02:38 +0000
-Subject: [PATCH] (_nss_dns_gethostbyaddr2_r): Check and adjust the buffer alignment.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/resolv/nss_dns/dns-host.c glibc-2_9/resolv/nss_dns/dns-host.c
---- glibc-2_9.orig/resolv/nss_dns/dns-host.c 2008-11-12 08:52:20.000000000 +0100
-+++ glibc-2_9/resolv/nss_dns/dns-host.c 2009-02-02 22:00:36.000000000 +0100
-@@ -364,6 +364,19 @@
- int n, status;
- int olderr = errno;
-
-+ uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
-+ buffer += pad;
-+ buflen = buflen > pad ? buflen - pad : 0;
-+
-+ if (__builtin_expect (buflen < sizeof (struct host_data), 0))
-+ {
-+ *errnop = ERANGE;
-+ *h_errnop = NETDB_INTERNAL;
-+ return NSS_STATUS_TRYAGAIN;
-+ }
-+
-+ host_data = (struct host_data *) buffer;
-+
- if (__res_maybe_init (&_res, 0) == -1)
- return NSS_STATUS_UNAVAIL;
-
diff --git a/patches/glibc/2.9/130-add_prio-macros.patch b/patches/glibc/2.9/130-add_prio-macros.patch
deleted file mode 100644
index ff5bf5b..0000000
--- a/patches/glibc/2.9/130-add_prio-macros.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0051_all_glibc-2.9-add_prio-macros.patch
-
--= BEGIN original header =-
-http://sourceware.org/ml/libc-alpha/2009-01/msg00003.html
-
-From a1737958e074e8f990760acc8abeb0c23715a859 Mon Sep 17 00:00:00 2001
-From: Roland McGrath <roland@gnu.org>
-Date: Sat, 3 Jan 2009 21:04:01 +0000
-Subject: [PATCH] 2009-01-03 Samuel Thibault <samuel.thibault@ens-lyon.org>
-
- * bits/resource.h (PRIO_PROCESS, PRIO_PGRP, PRIO_USER): Add macros.
--= END original header =-
-
-diff -durN glibc-2_9.orig/bits/resource.h glibc-2_9/bits/resource.h
---- glibc-2_9.orig/bits/resource.h 2006-03-05 23:48:10.000000000 +0100
-+++ glibc-2_9/bits/resource.h 2009-02-02 22:00:38.000000000 +0100
-@@ -185,6 +185,9 @@
- enum __priority_which
- {
- PRIO_PROCESS = 0, /* WHO is a process ID. */
-+#define PRIO_PROCESS PRIO_PROCESS
- PRIO_PGRP = 1, /* WHO is a process group ID. */
-+#define PRIO_PGRP PRIO_PGRP
- PRIO_USER = 2 /* WHO is a user ID. */
-+#define PRIO_USER PRIO_USER
- };
diff --git a/patches/glibc/2.9/140-regex-BZ9697.patch b/patches/glibc/2.9/140-regex-BZ9697.patch
deleted file mode 100644
index 73b0c23..0000000
--- a/patches/glibc/2.9/140-regex-BZ9697.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0052_all_glibc-2.9-regex-BZ9697.patch
-
--= BEGIN original header =-
-http://sourceware.org/ml/libc-alpha/2009-01/msg00005.html
-
-From ea8ca0dfcbf2721bcf2c08ce3c01d5764b827572 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Thu, 8 Jan 2009 00:42:28 +0000
-Subject: [PATCH] (re_compile_fastmap_iter): Rewrite COMPLEX_BRACKET handling.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/posix/regcomp.c glibc-2_9/posix/regcomp.c
---- glibc-2_9.orig/posix/regcomp.c 2008-05-15 05:07:21.000000000 +0200
-+++ glibc-2_9/posix/regcomp.c 2009-02-02 22:00:41.000000000 +0100
-@@ -350,47 +350,67 @@
- #ifdef RE_ENABLE_I18N
- else if (type == COMPLEX_BRACKET)
- {
-- int i;
- re_charset_t *cset = dfa->nodes[node].opr.mbcset;
-- if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes
-- || cset->nranges || cset->nchar_classes)
-- {
-+ int i;
-+
- # ifdef _LIBC
-- if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0)
-+ /* See if we have to try all bytes which start multiple collation
-+ elements.
-+ e.g. In da_DK, we want to catch 'a' since "aa" is a valid
-+ collation element, and don't catch 'b' since 'b' is
-+ the only collation element which starts from 'b' (and
-+ it is caught by SIMPLE_BRACKET). */
-+ if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
-+ && (cset->ncoll_syms || cset->nranges))
- {
-- /* In this case we want to catch the bytes which are
-- the first byte of any collation elements.
-- e.g. In da_DK, we want to catch 'a' since "aa"
-- is a valid collation element, and don't catch
-- 'b' since 'b' is the only collation element
-- which starts from 'b'. */
- const int32_t *table = (const int32_t *)
- _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
- for (i = 0; i < SBC_MAX; ++i)
- if (table[i] < 0)
- re_set_fastmap (fastmap, icase, i);
- }
--# else
-- if (dfa->mb_cur_max > 1)
-- for (i = 0; i < SBC_MAX; ++i)
-- if (__btowc (i) == WEOF)
-- re_set_fastmap (fastmap, icase, i);
--# endif /* not _LIBC */
-- }
-- for (i = 0; i < cset->nmbchars; ++i)
-+# endif /* _LIBC */
-+
-+ /* See if we have to start the match at all multibyte characters,
-+ i.e. where we would not find an invalid sequence. This only
-+ applies to multibyte character sets; for single byte character
-+ sets, the SIMPLE_BRACKET again suffices. */
-+ if (dfa->mb_cur_max > 1
-+ && (cset->nchar_classes || cset->non_match
-+# ifdef _LIBC
-+ || cset->nequiv_classes
-+# endif /* _LIBC */
-+ ))
- {
-- char buf[256];
-- mbstate_t state;
-- memset (&state, '\0', sizeof (state));
-- if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
-- re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
-- if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
-+ unsigned char c = 0;
-+ do
- {
-- if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
-- != (size_t) -1)
-- re_set_fastmap (fastmap, 0, *(unsigned char *) buf);
-+ mbstate_t mbs;
-+ memset (&mbs, 0, sizeof (mbs));
-+ if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2)
-+ re_set_fastmap (fastmap, false, (int) c);
- }
-+ while (++c != 0);
- }
-+
-+ else
-+ {
-+ /* ... Else catch all bytes which can start the mbchars. */
-+ for (i = 0; i < cset->nmbchars; ++i)
-+ {
-+ char buf[256];
-+ mbstate_t state;
-+ memset (&state, '\0', sizeof (state));
-+ if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
-+ re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
-+ if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
-+ {
-+ if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
-+ != (size_t) -1)
-+ re_set_fastmap (fastmap, false, *(unsigned char *) buf);
-+ }
-+ }
-+ }
- }
- #endif /* RE_ENABLE_I18N */
- else if (type == OP_PERIOD
diff --git a/patches/glibc/2.9/150-regex-BZ697.patch b/patches/glibc/2.9/150-regex-BZ697.patch
deleted file mode 100644
index 5b70629..0000000
--- a/patches/glibc/2.9/150-regex-BZ697.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0053_all_glibc-2.9-regex-BZ697.patch
-
--= BEGIN original header =-
-http://sourceware.org/ml/libc-alpha/2009-01/msg00006.html
-
-From 37bdc055ceeb6b1144c07448a7210d9ab3fbb2f5 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Thu, 8 Jan 2009 00:47:05 +0000
-Subject: [PATCH] (prune_impossible_nodes): Handle sifted_states[0] being NULL also if
- there are no backreferences.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/posix/regexec.c glibc-2_9/posix/regexec.c
---- glibc-2_9.orig/posix/regexec.c 2007-10-12 19:47:13.000000000 +0200
-+++ glibc-2_9/posix/regexec.c 2009-02-02 22:00:43.000000000 +0100
-@@ -1004,6 +1004,11 @@
- re_node_set_free (&sctx.limits);
- if (BE (ret != REG_NOERROR, 0))
- goto free_return;
-+ if (sifted_states[0] == NULL)
-+ {
-+ ret = REG_NOMATCH;
-+ goto free_return;
-+ }
- }
- re_free (mctx->state_log);
- mctx->state_log = sifted_states;
diff --git a/patches/glibc/2.9/160-i386-x86_64-revert-clone-cfi.patch b/patches/glibc/2.9/160-i386-x86_64-revert-clone-cfi.patch
deleted file mode 100644
index 9ae9a58..0000000
--- a/patches/glibc/2.9/160-i386-x86_64-revert-clone-cfi.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0070_all_glibc-i386-x86_64-revert-clone-cfi.patch
-
--= BEGIN original header =-
-revert cfi additions to clone on i386/x86_64 to workaround problems in
-gcc's unwinder code. this is not a bug in glibc, it triggers problems
-elsewhere. this cfi code does not gain us a whole lot anyways.
-
-http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2_9/sysdeps/unix/sysv/linux/i386/clone.S
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/i386/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/i386/clone.S 2009-02-02 22:00:45.000000000 +0100
-@@ -120,9 +120,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (eip);
- /* Note: %esi is zero. */
- movl %esi,%ebp /* terminate the stack frame */
- #ifdef RESET_PID
-@@ -155,7 +152,6 @@
- jmp L(haspid)
- .previous
- #endif
-- cfi_endproc;
-
- cfi_startproc
- PSEUDO_END (BP_SYM (__clone))
-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
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/x86_64/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/x86_64/clone.S 2009-02-02 22:00:45.000000000 +0100
-@@ -89,9 +89,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (rip);
- /* Clear the frame pointer. The ABI suggests this be done, to mark
- the outermost frame obviously. */
- xorl %ebp, %ebp
-@@ -116,7 +113,6 @@
- /* Call exit with return value from function call. */
- movq %rax, %rdi
- call HIDDEN_JUMPTARGET (_exit)
-- cfi_endproc;
-
- cfi_startproc;
- PSEUDO_END (BP_SYM (__clone))
diff --git a/patches/glibc/2.9/170-2.10-dns-no-gethostbyname4.patch b/patches/glibc/2.9/170-2.10-dns-no-gethostbyname4.patch
deleted file mode 100644
index 7a4f923..0000000
--- a/patches/glibc/2.9/170-2.10-dns-no-gethostbyname4.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0080_all_glibc-2.10-dns-no-gethostbyname4.patch
-
--= BEGIN original header =-
-http://sourceware.org/bugzilla/show_bug.cgi?id=7060
-http://bugs.gentoo.org/250468
-
-The gethostbyname4() lookup method is problematic since it fires out both
-the A and AAAA DNS queries in parallel and over the same socket. This
-should work in theory, but it turns out that many cheap DSL modems and
-similar devices have buggy DNS servers - if the AAAA query arrives too
-quickly after the A query, the server will generate only a single reply
-with the A query id but returning an error for the AAAA query; we get
-stuck waiting for the second reply.
-
-For gethostbyname4() users affected, disabling IPv6 in the system might
-work around the issue, unfortunately it only helps with applications
-using AI_ADDRCONFIG (e.g. Firefox); some (notably e.g. Pidgin) neglect
-to do that.
-
-Real fix should be using separate ports for the A and AAAA queries.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/resolv/Versions glibc-2_9/resolv/Versions
---- glibc-2_9.orig/resolv/Versions 2008-08-01 19:15:34.000000000 +0200
-+++ glibc-2_9/resolv/Versions 2009-02-02 22:00:46.000000000 +0100
-@@ -102,7 +102,7 @@
- _nss_dns_gethostbyname_r; _nss_dns_getnetbyaddr_r;
- _nss_dns_getnetbyname_r; _nss_dns_getcanonname_r;
- _nss_dns_gethostbyaddr2_r;
-- _nss_dns_gethostbyname4_r;
-+# _nss_dns_gethostbyname4_r;
- }
- }
-
diff --git a/patches/glibc/2.9/180-math-tests.patch b/patches/glibc/2.9/180-math-tests.patch
deleted file mode 100644
index 750ed1a..0000000
--- a/patches/glibc/2.9/180-math-tests.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/0090_all_glibc-math-tests.patch
-
--= BEGIN original header =-
-From: "Joseph S. Myers" <joseph at codesourcery dot com>
-To: libc-alpha at sourceware dot org
-Date: Tue, 15 Jul 2008 14:43:04 +0000 (UTC)
-Subject: expm1 ulps
-
-If you test glibc on i686 with GCC 4.3, you get a test-ildoubl failure:
-
-Failure: Test: expm1 (1) == M_El - 1.0
-Result:
- is: 1.71828182845904523532e+00 0xd.bf0a8b14576953500000p-3
- should be: 1.71828182845904523543e+00 0xd.bf0a8b14576953600000p-3
- difference: 1.08420217248550443401e-19 0x8.00000000000000000000p-66
- ulp : 1.0000
- max.ulp : 0.0000
-Maximal error of `expm1'
- is : 1 ulp
- accepted: 0 ulp
-
-What happens is that the inline expansion of expm1l uses __builtin_expm1l,
-and GCC 4.3 optimizes calls to __builtin_expm1l with constant argument to
-a correctly rounded result using MPFR. The result returned is thus the
-value of e-1 rounded once to long double precision. However, the test
-expects M_El - 1.0, and the result of rounding e to long double precision,
-then subtracting 1, differs in the last place from the result of rounding
-e-1 to long double precision (the latter has smaller exponent, and the
-last bit is 1).
-
-There are two obvious approaches possible to fixing this. The first patch
-below changes the expectation to a decimal expansion for e-1 (taken from
-that of M_El) rather than doing arithmetic in the expected value. This in
-turn requires ulps to be set for the out-of-line version of expm1. It
-might also need ulps to be set for the inline version for older compilers
-if they should continue to pass the test, and possibly for other targets.
-The second patch below takes the alternative approach of keeping the
-existing expectation (which has the wrong bit in the last place) and
-setting ulps for the inline expansion of expm1, which avoids the risk of
-breaking the test for other targets.
-
-2008-07-15 Joseph Myers <joseph@codesourcery.com>
-
- * sysdeps/i386/fpu/libm-test-ulps: Add inline long double ulps for
- expm1.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/i386/fpu/libm-test-ulps glibc-2_9/sysdeps/i386/fpu/libm-test-ulps
---- glibc-2_9.orig/sysdeps/i386/fpu/libm-test-ulps 2006-01-15 18:59:37.000000000 +0100
-+++ glibc-2_9/sysdeps/i386/fpu/libm-test-ulps 2009-02-02 22:00:47.000000000 +0100
-@@ -453,6 +453,10 @@
- ildouble: 8
- ldouble: 8
-
-+# expm1
-+Test "expm1 (1) == M_El - 1.0":
-+ildouble: 1
-+
- # gamma
- Test "gamma (-0.5) == log(2*sqrt(pi))":
- double: 1
-@@ -1134,6 +1138,9 @@
- ildouble: 8
- ldouble: 8
-
-+Function: "expm1":
-+ildouble: 1
-+
- Function: "gamma":
- double: 1
- idouble: 1
diff --git a/patches/glibc/2.9/190-queue-header-updates.patch b/patches/glibc/2.9/190-queue-header-updates.patch
deleted file mode 100644
index 446261d..0000000
--- a/patches/glibc/2.9/190-queue-header-updates.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1010_all_glibc-queue-header-updates.patch
-
--= BEGIN original header =-
-grab some updates from FreeBSD
-
-http://bugs.gentoo.org/201979
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/misc/sys/queue.h glibc-2_9/misc/sys/queue.h
---- glibc-2_9.orig/misc/sys/queue.h 2008-03-05 06:50:30.000000000 +0100
-+++ glibc-2_9/misc/sys/queue.h 2009-02-02 22:00:48.000000000 +0100
-@@ -136,6 +136,11 @@
- (var); \
- (var) = ((var)->field.le_next))
-
-+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = LIST_FIRST((head)); \
-+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- /*
- * List access methods.
- */
-@@ -197,6 +202,16 @@
- #define SLIST_FOREACH(var, head, field) \
- for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
-
-+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = SLIST_FIRST((head)); \
-+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
-+#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
-+ for ((varp) = &SLIST_FIRST((head)); \
-+ ((var) = *(varp)) != NULL; \
-+ (varp) = &SLIST_NEXT((var), field))
-+
- /*
- * Singly-linked List access methods.
- */
-@@ -242,6 +257,12 @@
- (head)->stqh_last = &(elm)->field.stqe_next; \
- } while (/*CONSTCOND*/0)
-
-+#define STAILQ_LAST(head, type, field) \
-+ (STAILQ_EMPTY((head)) ? \
-+ NULL : \
-+ ((struct type *)(void *) \
-+ ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-+
- #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
- if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
-@@ -286,6 +307,11 @@
- #define STAILQ_FIRST(head) ((head)->stqh_first)
- #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
-
-+#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = STAILQ_FIRST((head)); \
-+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
-
- /*
- * Simple queue definitions.
-@@ -437,11 +463,22 @@
- (var); \
- (var) = ((var)->field.tqe_next))
-
-+#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = TAILQ_FIRST((head)); \
-+ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
- for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
- (var); \
- (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
-
-+#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
-+ for ((var) = TAILQ_LAST((head), headname); \
-+ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
-+ (var) = (tvar))
-+
-+
- #define TAILQ_CONCAT(head1, head2, field) do { \
- if (!TAILQ_EMPTY(head2)) { \
- *(head1)->tqh_last = (head2)->tqh_first; \
diff --git a/patches/glibc/2.9/200-awk-in-C-locale.patch b/patches/glibc/2.9/200-awk-in-C-locale.patch
deleted file mode 100644
index 9dcb9ae..0000000
--- a/patches/glibc/2.9/200-awk-in-C-locale.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1018_all_glibc-awk-in-C-locale.patch
-
--= BEGIN original header =-
-http://bugs.gentoo.org/252802
-
-2008-12-29 Mike Frysinger <vapier@gentoo.org>
-
- * iconvdata/Makefile (iconv-rules): Use LC_ALL=C when running awk script.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/iconvdata/Makefile glibc-2_9/iconvdata/Makefile
---- glibc-2_9.orig/iconvdata/Makefile 2008-05-15 03:54:31.000000000 +0200
-+++ glibc-2_9/iconvdata/Makefile 2009-02-02 22:00:50.000000000 +0100
-@@ -286,7 +286,7 @@
- { echo $(filter-out lib%, $(modules)); \
- echo 8bit $(gen-8bit-modules); \
- echo 8bit-gap $(gen-8bit-gap-modules); } | \
-- $(AWK) 'NR == 1 { \
-+ LC_ALL=C $(AWK) 'NR == 1 { \
- for (i = 1; i <= NF; i++) { \
- printf "%s-routines := %s\n", $$i, tolower($$i); \
- printf "%s-map := gconv.map\n", $$i; \
diff --git a/patches/glibc/2.9/210-2.9-strlen-hack.patch b/patches/glibc/2.9/210-2.9-strlen-hack.patch
deleted file mode 100644
index 6071724..0000000
--- a/patches/glibc/2.9/210-2.9-strlen-hack.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1020_all_glibc-2.9-strlen-hack.patch
-
--= BEGIN original header =-
-http://sourceware.org/bugzilla/show_bug.cgi?id=5807
-http://www.cl.cam.ac.uk/~am21/progtricks.html
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/string/strlen.c glibc-2_9/string/strlen.c
---- glibc-2_9.orig/string/strlen.c 2005-12-14 12:09:07.000000000 +0100
-+++ glibc-2_9/string/strlen.c 2009-02-02 22:00:51.000000000 +0100
-@@ -32,7 +32,7 @@
- {
- const char *char_ptr;
- const unsigned long int *longword_ptr;
-- unsigned long int longword, magic_bits, himagic, lomagic;
-+ unsigned long int longword, himagic, lomagic;
-
- /* Handle the first few characters by reading one character at a time.
- Do this until CHAR_PTR is aligned on a longword boundary. */
-@@ -42,28 +42,14 @@
- if (*char_ptr == '\0')
- return char_ptr - str;
-
-- /* All these elucidatory comments refer to 4-byte longwords,
-- but the theory applies equally well to 8-byte longwords. */
--
- longword_ptr = (unsigned long int *) char_ptr;
-
-- /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits
-- the "holes." Note that there is a hole just to the left of
-- each byte, with an extra at the end:
--
-- bits: 01111110 11111110 11111110 11111111
-- bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
--
-- The 1-bits make sure that carries propagate to the next 0-bit.
-- The 0-bits provide holes for carries to fall into. */
-- magic_bits = 0x7efefeffL;
- himagic = 0x80808080L;
- lomagic = 0x01010101L;
- if (sizeof (longword) > 4)
- {
- /* 64-bit version of the magic. */
- /* Do the shift in two steps to avoid a warning if long has 32 bits. */
-- magic_bits = ((0x7efefefeL << 16) << 16) | 0xfefefeffL;
- himagic = ((himagic << 16) << 16) | himagic;
- lomagic = ((lomagic << 16) << 16) | lomagic;
- }
-@@ -75,56 +61,12 @@
- if *any of the four* bytes in the longword in question are zero. */
- for (;;)
- {
-- /* We tentatively exit the loop if adding MAGIC_BITS to
-- LONGWORD fails to change any of the hole bits of LONGWORD.
--
-- 1) Is this safe? Will it catch all the zero bytes?
-- Suppose there is a byte with all zeros. Any carry bits
-- propagating from its left will fall into the hole at its
-- least significant bit and stop. Since there will be no
-- carry from its most significant bit, the LSB of the
-- byte to the left will be unchanged, and the zero will be
-- detected.
--
-- 2) Is this worthwhile? Will it ignore everything except
-- zero bytes? Suppose every byte of LONGWORD has a bit set
-- somewhere. There will be a carry into bit 8. If bit 8
-- is set, this will carry into bit 16. If bit 8 is clear,
-- one of bits 9-15 must be set, so there will be a carry
-- into bit 16. Similarly, there will be a carry into bit
-- 24. If one of bits 24-30 is set, there will be a carry
-- into bit 31, so all of the hole bits will be changed.
--
-- The one misfire occurs when bits 24-30 are clear and bit
-- 31 is set; in this case, the hole at bit 31 is not
-- changed. If we had access to the processor carry flag,
-- we could close this loophole by putting the fourth hole
-- at bit 32!
--
-- So it ignores everything except 128's, when they're aligned
-- properly. */
--
- longword = *longword_ptr++;
-
-- if (
--#if 0
-- /* Add MAGIC_BITS to LONGWORD. */
-- (((longword + magic_bits)
--
-- /* Set those bits that were unchanged by the addition. */
-- ^ ~longword)
--
-- /* Look at only the hole bits. If any of the hole bits
-- are unchanged, most likely one of the bytes was a
-- zero. */
-- & ~magic_bits)
--#else
-- ((longword - lomagic) & himagic)
--#endif
-- != 0)
-+ /* This hack taken from Alan Mycroft's HAKMEMC postings.
-+ See: http://www.cl.cam.ac.uk/~am21/progtricks.html */
-+ if (((longword - lomagic) & ~longword & himagic) != 0)
- {
-- /* Which of the bytes was the zero? If none of them were, it was
-- a misfire; continue the search. */
-
- const char *cp = (const char *) (longword_ptr - 1);
-
diff --git a/patches/glibc/2.9/220-manual-no-perl.patch b/patches/glibc/2.9/220-manual-no-perl.patch
deleted file mode 100644
index ec13ca9..0000000
--- a/patches/glibc/2.9/220-manual-no-perl.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1030_all_glibc-manual-no-perl.patch
-
--= BEGIN original header =-
-If we're using a cvs snapshot which updates the source files, and
-perl isn't installed yet, then we can't regen the docs. Not a big
-deal, so just whine a little and continue on our merry way.
-
-http://bugs.gentoo.org/60132
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/manual/Makefile glibc-2_9/manual/Makefile
---- glibc-2_9.orig/manual/Makefile 2006-01-08 07:43:47.000000000 +0100
-+++ glibc-2_9/manual/Makefile 2009-02-02 22:00:53.000000000 +0100
-@@ -104,9 +104,14 @@
- libm-err.texi: stamp-libm-err
- stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
- $(dir)/libm-test-ulps))
-+ifneq ($(PERL),no)
- pwd=`pwd`; \
- $(PERL) $< $$pwd/.. > libm-err-tmp
- $(move-if-change) libm-err-tmp libm-err.texi
-+else
-+ echo "Unable to rebuild math docs, no perl installed"
-+ touch libm-err.texi
-+endif
- touch $@
-
- # Generate Texinfo files from the C source for the example programs.
diff --git a/patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch b/patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch
deleted file mode 100644
index 3ae9545..0000000
--- a/patches/glibc/2.9/230-2.3.3-localedef-fix-trampoline.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1040_all_2.3.3-localedef-fix-trampoline.patch
-
--= BEGIN original header =-
-#! /bin/sh -e
-
-# DP: Description: Fix localedef segfault when run under exec-shield,
-# PaX or similar. (#231438, #198099)
-# DP: Dpatch Author: James Troup <james@nocrew.org>
-# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
-# DP: Upstream status: Unknown
-# DP: Status Details: Unknown
-# DP: Date: 2004-03-16
-
-if [ $# -ne 2 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
- -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-esac
-exit 0
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/locale/programs/3level.h glibc-2_9/locale/programs/3level.h
---- glibc-2_9.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200
-+++ glibc-2_9/locale/programs/3level.h 2009-02-02 22:00:54.000000000 +0100
-@@ -203,6 +203,42 @@
- }
- }
- }
-+
-+/* GCC ATM seems to do a poor job with pointers to nested functions passed
-+ to inlined functions. Help it a little bit with this hack. */
-+#define wchead_table_iterate(tp, fn) \
-+do \
-+ { \
-+ struct wchead_table *t = (tp); \
-+ uint32_t index1; \
-+ for (index1 = 0; index1 < t->level1_size; index1++) \
-+ { \
-+ uint32_t lookup1 = t->level1[index1]; \
-+ if (lookup1 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup1_shifted = lookup1 << t->q; \
-+ uint32_t index2; \
-+ for (index2 = 0; index2 < (1 << t->q); index2++) \
-+ { \
-+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
-+ if (lookup2 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup2_shifted = lookup2 << t->p; \
-+ uint32_t index3; \
-+ for (index3 = 0; index3 < (1 << t->p); index3++) \
-+ { \
-+ struct element_t *lookup3 \
-+ = t->level3[index3 + lookup2_shifted]; \
-+ if (lookup3 != NULL) \
-+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
-+ lookup3); \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } while (0)
-+
- #endif
-
- #ifndef NO_FINALIZE
diff --git a/patches/glibc/2.9/240-i386-LOAD_PIC_REG.patch b/patches/glibc/2.9/240-i386-LOAD_PIC_REG.patch
deleted file mode 100644
index 1c69691..0000000
--- a/patches/glibc/2.9/240-i386-LOAD_PIC_REG.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1050_all_glibc-i386-LOAD_PIC_REG.patch
-
--= BEGIN original header =-
-From e41177ea18a77a7f62328293b4fd49ae17482e77 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Sat, 6 Dec 2008 00:15:17 +0000
-Subject: [PATCH] (_dl_tlsdesc_dynamic): Use LOAD_PIC_REG instead of doing things manually.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/i386/dl-tlsdesc.S glibc-2_9/sysdeps/i386/dl-tlsdesc.S
---- glibc-2_9.orig/sysdeps/i386/dl-tlsdesc.S 2008-05-13 07:33:06.000000000 +0200
-+++ glibc-2_9/sysdeps/i386/dl-tlsdesc.S 2009-02-02 22:00:56.000000000 +0100
-@@ -128,8 +128,7 @@
- .Lslow:
- cfi_adjust_cfa_offset (28)
- movl %ebx, 16(%esp)
-- call __i686.get_pc_thunk.bx
-- addl $_GLOBAL_OFFSET_TABLE_, %ebx
-+ LOAD_PIC_REG (bx)
- call ___tls_get_addr@PLT
- movl 16(%esp), %ebx
- jmp .Lret
diff --git a/patches/glibc/2.9/250-resolv-dynamic.patch b/patches/glibc/2.9/250-resolv-dynamic.patch
deleted file mode 100644
index 66c3370..0000000
--- a/patches/glibc/2.9/250-resolv-dynamic.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1055_all_glibc-resolv-dynamic.patch
-
--= BEGIN original header =-
-ripped from SuSE
-
-if /etc/resolv.conf is updated, then make sure applications
-already running get the updated information.
-
-http://bugs.gentoo.org/177416
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/resolv/res_libc.c glibc-2_9/resolv/res_libc.c
---- glibc-2_9.orig/resolv/res_libc.c 2006-10-11 10:59:28.000000000 +0200
-+++ glibc-2_9/resolv/res_libc.c 2009-02-02 22:00:57.000000000 +0100
-@@ -22,6 +22,7 @@
- #include <arpa/nameser.h>
- #include <resolv.h>
- #include <bits/libc-lock.h>
-+#include <sys/stat.h>
-
-
- /* The following bit is copied from res_data.c (where it is #ifdef'ed
-@@ -95,6 +96,20 @@
- __res_maybe_init (res_state resp, int preinit)
- {
- if (resp->options & RES_INIT) {
-+ static time_t last_mtime, last_check;
-+ time_t now;
-+ struct stat statbuf;
-+
-+ time (&now);
-+ if (now != last_check) {
-+ last_check = now;
-+ if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
-+ last_mtime = statbuf.st_mtime;
-+ atomicinclock (lock);
-+ atomicinc (__res_initstamp);
-+ atomicincunlock (lock);
-+ }
-+ }
- if (__res_initstamp != resp->_u._ext.initstamp) {
- if (resp->nscount > 0) {
- __res_iclose (resp, true);
diff --git a/patches/glibc/2.9/260-fadvise64_64.patch b/patches/glibc/2.9/260-fadvise64_64.patch
deleted file mode 100644
index 3cd0020..0000000
--- a/patches/glibc/2.9/260-fadvise64_64.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1070_all_glibc-fadvise64_64.patch
-
--= BEGIN original header =-
-ripped from Debian
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c 2003-08-17 02:36:22.000000000 +0200
-+++ glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c 2009-02-02 22:00:58.000000000 +0100
-@@ -35,6 +35,19 @@
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
- #else
-+# ifdef __NR_fadvise64_64
-+ INTERNAL_SYSCALL_DECL (err);
-+ int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
-+ __LONG_LONG_PAIR ((long) (offset >> 31),
-+ (long) offset),
-+ __LONG_LONG_PAIR ((long) (len >> 31),
-+ (long) len),
-+ advise);
-+ if (INTERNAL_SYSCALL_ERROR_P (ret, err))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+# else
- return ENOSYS;
-+# endif
- #endif
- }
diff --git a/patches/glibc/2.9/270-ldbl-nexttowardf.patch b/patches/glibc/2.9/270-ldbl-nexttowardf.patch
deleted file mode 100644
index a0ffdf9..0000000
--- a/patches/glibc/2.9/270-ldbl-nexttowardf.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1073_all_glibc-ldbl-nexttowardf.patch
-
--= BEGIN original header =-
-ripped from Debian
-
-this change was made to generic __nexttowardf, but not the long double version
-
-2008-05-05 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/ieee754/ldbl-128/s_nexttowardf.c: Include float.h.
- (__nexttowardf): Use math_opt_barrier and
- math_force_eval macros. If FLT_EVAL_METHOD is not 0, force
- x to float using asm.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c glibc-2_9/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
---- glibc-2_9.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c 1999-07-14 02:09:42.000000000 +0200
-+++ glibc-2_9/sysdeps/ieee754/ldbl-128/s_nexttowardf.c 2009-02-02 22:00:59.000000000 +0100
-@@ -19,7 +19,8 @@
- #endif
-
- #include "math.h"
--#include "math_private.h"
-+#include <math_private.h>
-+#include <float.h>
-
- #ifdef __STDC__
- float __nexttowardf(float x, long double y)
-@@ -44,10 +45,12 @@
- return x+y;
- if((long double) x==y) return y; /* x=y, return y */
- if(ix==0) { /* x == 0 */
-- float x2;
-+ float u;
- SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
-- x2 = x*x;
-- if(x2==x) return x2; else return x; /* raise underflow flag */
-+ u = math_opt_barrier (x);
-+ u = u * u;
-+ math_force_eval (u); /* raise underflow flag */
-+ return x;
- }
- if(hx>=0) { /* x > 0 */
- if(hy<0||(ix>>23)>(iy>>48)-0x3f80
-@@ -67,13 +70,16 @@
- }
- }
- hy = hx&0x7f800000;
-- if(hy>=0x7f800000) return x+x; /* overflow */
-+ if(hy>=0x7f800000) {
-+ x = x+x; /* overflow */
-+ if (FLT_EVAL_METHOD != 0)
-+ /* Force conversion to float. */
-+ asm ("" : "+m"(x));
-+ return x;
-+ }
- if(hy<0x00800000) { /* underflow */
-- float x2 = x*x;
-- if(x2!=x) { /* raise underflow flag */
-- SET_FLOAT_WORD(x2,hx);
-- return x2;
-- }
-+ float u = x*x;
-+ math_force_eval (u); /* raise underflow flag */
- }
- SET_FLOAT_WORD(x,hx);
- return x;
diff --git a/patches/glibc/2.9/280-section-comments.patch b/patches/glibc/2.9/280-section-comments.patch
deleted file mode 100644
index 13b309e..0000000
--- a/patches/glibc/2.9/280-section-comments.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1075_all_glibc-section-comments.patch
-
--= BEGIN original header =-
-http://sources.redhat.com/ml/binutils/2004-04/msg00665.html
-
-fixes building on some architectures (like m68k/arm/cris/etc...) because
-it does the right thing
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/include/libc-symbols.h glibc-2_9/include/libc-symbols.h
---- glibc-2_9.orig/include/libc-symbols.h 2006-11-09 16:57:12.000000000 +0100
-+++ glibc-2_9/include/libc-symbols.h 2009-02-02 22:01:00.000000000 +0100
-@@ -240,12 +240,12 @@
- # define __make_section_unallocated(section_string)
- # endif
-
--/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
-+/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
- section attributes on what looks like a comment to the assembler. */
- # ifdef HAVE_SECTION_QUOTES
--# define __sec_comment "\"\n\t#\""
-+# define __sec_comment "\"\n#APP\n\t#\""
- # else
--# define __sec_comment "\n\t#"
-+# define __sec_comment "\n#APP\n\t#"
- # endif
- # define link_warning(symbol, msg) \
- __make_section_unallocated (".gnu.warning." #symbol) \
diff --git a/patches/glibc/2.9/290-no-inline-gmon.patch b/patches/glibc/2.9/290-no-inline-gmon.patch
deleted file mode 100644
index e9df564..0000000
--- a/patches/glibc/2.9/290-no-inline-gmon.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1080_all_glibc-no-inline-gmon.patch
-
--= BEGIN original header =-
-http://bugs.gentoo.org/196245
-http://sourceware.org/ml/libc-alpha/2006-05/msg00017.html
-
-Attached is a patch to add __attribute__ ((noinline)) to
-call_gmon_start.
-
-Without this patch, the sec script that processed initfini.s removes a
-part of inlined call_gmon_start, causing undefined label errors.
-
-This patch solves the problem by forcing gcc not to inline
-call_gmon_start with __attribute__ ((noinline)).
-
-Tested by building for arm-none-lixux-gnueabi. OK to apply?
-
-Kazu Hirata
-
-2006-05-07 Kazu Hirata &lt;kazu@codesourcery.com&gt;
-
- * sysdeps/generic/initfini.c (call_gmon_start): Add
- __attribute__ ((noinline)).
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/generic/initfini.c glibc-2_9/sysdeps/generic/initfini.c
---- glibc-2_9.orig/sysdeps/generic/initfini.c 2007-06-17 20:02:40.000000000 +0200
-+++ glibc-2_9/sysdeps/generic/initfini.c 2009-02-02 22:01:01.000000000 +0100
-@@ -70,7 +70,7 @@
- /* The beginning of _init: */
- asm ("\n/*@_init_PROLOG_BEGINS*/");
-
--static void
-+static void __attribute__ ((noinline))
- call_gmon_start(void)
- {
- extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
diff --git a/patches/glibc/2.9/300-2.9-check_native-headers.patch b/patches/glibc/2.9/300-2.9-check_native-headers.patch
deleted file mode 100644
index c3b648b..0000000
--- a/patches/glibc/2.9/300-2.9-check_native-headers.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1085_all_glibc-2.9-check_native-headers.patch
-
--= BEGIN original header =-
-many ports hit this warning:
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-
-snipped from suse
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/check_native.c glibc-2_9/sysdeps/unix/sysv/linux/check_native.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/check_native.c 2007-11-24 04:12:17.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/check_native.c 2009-02-02 22:01:03.000000000 +0100
-@@ -23,6 +23,7 @@
- #include <stddef.h>
- #include <stdint.h>
- #include <stdlib.h>
-+#include <string.h>
- #include <time.h>
- #include <unistd.h>
- #include <net/if.h>
diff --git a/patches/glibc/2.9/310-2.3.6-fix-pr631.patch b/patches/glibc/2.9/310-2.3.6-fix-pr631.patch
deleted file mode 100644
index 4147a6d..0000000
--- a/patches/glibc/2.9/310-2.3.6-fix-pr631.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1090_all_glibc-2.3.6-fix-pr631.patch
-
--= BEGIN original header =-
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
---- glibc-2_9.orig/Makeconfig 2009-02-02 22:00:36.000000000 +0100
-+++ glibc-2_9/Makeconfig 2009-02-02 22:01:04.000000000 +0100
-@@ -509,7 +509,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
-diff -durN glibc-2_9.orig/elf/Makefile glibc-2_9/elf/Makefile
---- glibc-2_9.orig/elf/Makefile 2008-10-31 21:35:11.000000000 +0100
-+++ glibc-2_9/elf/Makefile 2009-02-02 22:01:04.000000000 +0100
-@@ -121,6 +121,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
diff --git a/patches/glibc/2.9/320-2.9-assume-pipe2.patch b/patches/glibc/2.9/320-2.9-assume-pipe2.patch
deleted file mode 100644
index e20fa94..0000000
--- a/patches/glibc/2.9/320-2.9-assume-pipe2.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1095_all_glibc-2.9-assume-pipe2.patch
-
--= BEGIN original header =-
-http://bugs.gentoo.org/250342
-http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
-
-we cant assume sock_cloexec and pipe2 are bound together as the former defines
-are found in glibc only while the latter are a combo of kernel headers and
-glibc. so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
-inside of glibc, we hit a problem. for example:
-
-#include <grp.h>
-#include <stdio.h>
-main()
-{
- getgrnam("portage");
- if (!popen("ls", "r"))
- perror("popen()");
-}
-
-getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
-__have_sock_cloexec and __have_pipe2 to true. but if glibc was built against
-older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
-stub for it. so popen() will always fail as glibc assumes pipe2() works.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/include/unistd.h glibc-2_9/include/unistd.h
---- glibc-2_9.orig/include/unistd.h 2008-07-27 20:23:17.000000000 +0200
-+++ glibc-2_9/include/unistd.h 2009-02-02 22:01:05.000000000 +0100
-@@ -167,9 +167,6 @@
- extern int __pause_nocancel (void) attribute_hidden;
-
- extern int __have_sock_cloexec;
--/* At lot of other functionality became available at the same time as
-- SOCK_CLOEXEC. Avoid defining separate variables for all of them
-- unless it is really necessary. */
--#define __have_pipe2 __have_sock_cloexec
-+extern int __have_pipe2;
-
- #endif
-diff -durN glibc-2_9.orig/socket/have_sock_cloexec.c glibc-2_9/socket/have_sock_cloexec.c
---- glibc-2_9.orig/socket/have_sock_cloexec.c 2008-07-25 18:46:23.000000000 +0200
-+++ glibc-2_9/socket/have_sock_cloexec.c 2009-02-02 22:01:05.000000000 +0100
-@@ -16,9 +16,14 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#include <fcntl.h>
- #include <sys/socket.h>
- #include <kernel-features.h>
-
- #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
- int __have_sock_cloexec;
- #endif
-+
-+#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
-+int __have_pipe2;
-+#endif
diff --git a/patches/glibc/2.9/330-2.3.3-china.patch b/patches/glibc/2.9/330-2.3.3-china.patch
deleted file mode 100644
index be0cc82..0000000
--- a/patches/glibc/2.9/330-2.3.3-china.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1100_all_glibc-2.3.3-china.patch
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN glibc-2_9.orig/localedata/locales/zh_TW glibc-2_9/localedata/locales/zh_TW
---- glibc-2_9.orig/localedata/locales/zh_TW 2004-11-01 00:42:28.000000000 +0100
-+++ glibc-2_9/localedata/locales/zh_TW 2009-02-02 22:01:06.000000000 +0100
-@@ -1,7 +1,7 @@
- comment_char %
- escape_char /
- %
--% Chinese language locale for Taiwan R.O.C.
-+% Chinese language locale for Taiwan
- % charmap: BIG5-CP950
- %
- % Original Author:
-@@ -17,7 +17,7 @@
- % Reference: http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
-
- LC_IDENTIFICATION
--title "Chinese locale for Taiwan R.O.C."
-+title "Chinese locale for Taiwan"
- source ""
- address ""
- contact ""
-@@ -25,7 +25,7 @@
- tel ""
- fax ""
- language "Chinese"
--territory "Taiwan R.O.C."
-+territory "Taiwan"
- revision "0.2"
- date "2000-08-02"
- %
diff --git a/patches/glibc/2.9/340-new-valencian-locale.patch b/patches/glibc/2.9/340-new-valencian-locale.patch
deleted file mode 100644
index 4aa6caa..0000000
--- a/patches/glibc/2.9/340-new-valencian-locale.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1103_all_glibc-new-valencian-locale.patch
-
--= BEGIN original header =-
-http://bugs.gentoo.org/show_bug.cgi?id=131815
-http://sourceware.org/bugzilla/show_bug.cgi?id=2522
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/localedata/SUPPORTED glibc-2_9/localedata/SUPPORTED
---- glibc-2_9.orig/localedata/SUPPORTED 2008-09-16 23:24:57.000000000 +0200
-+++ glibc-2_9/localedata/SUPPORTED 2009-02-02 22:01:08.000000000 +0100
-@@ -72,6 +72,8 @@
- ca_ES.UTF-8/UTF-8 \
- ca_ES/ISO-8859-1 \
- ca_ES@euro/ISO-8859-15 \
-+ca_ES.UTF-8@valencia/UTF-8 \
-+ca_ES@valencia/ISO-8859-15 \
- ca_FR.UTF-8/UTF-8 \
- ca_FR/ISO-8859-15 \
- ca_IT.UTF-8/UTF-8 \
-diff -durN glibc-2_9.orig/localedata/locales/ca_ES@valencia glibc-2_9/localedata/locales/ca_ES@valencia
---- glibc-2_9.orig/localedata/locales/ca_ES@valencia 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2_9/localedata/locales/ca_ES@valencia 2009-02-02 22:01:08.000000000 +0100
-@@ -0,0 +1,96 @@
-+comment_char %
-+escape_char /
-+%
-+% Valencian (southern Catalan) locale for Spain with Euro
-+%
-+% Note that this locale is almost the same as ca_ES@euro. The point of having
-+% a separate locale is only for PO translations, which have a lot of social
-+% support and are very appreciated by the Valencian-speaking community.
-+%
-+% Contact: Jordi Mallach
-+% Email: jordi@gnu.org
-+% Tel:
-+% Fax:
-+% Language: ca
-+% Territory: ES
-+% Option: euro
-+% Revision: 1.0
-+% Date: 2006-04-06
-+% Application: general
-+% Users: general
-+% Repertoiremap: mnemonic,ds
-+% Charset: ISO-8859-15
-+% Distribution and use is free, also
-+% for commercial purposes.
-+
-+LC_IDENTIFICATION
-+title "Valencian (southern Catalan) locale for Spain with Euro"
-+source ""
-+address ""
-+contact "Jordi Mallach"
-+email "jordi@gnu.org"
-+tel ""
-+fax ""
-+language "Catalan"
-+territory "Spain"
-+revision "1.0"
-+date "2006-04-06"
-+%
-+category "ca_ES@valencia:2006";LC_IDENTIFICATION
-+category "ca_ES@valencia:2006";LC_CTYPE
-+category "ca_ES@valencia:2006";LC_COLLATE
-+category "ca_ES@valencia:2006";LC_MONETARY
-+category "ca_ES@valencia:2006";LC_NUMERIC
-+category "ca_ES@valencia:2006";LC_TIME
-+category "ca_ES@valencia:2006";LC_MESSAGES
-+category "ca_ES@valencia:2006";LC_PAPER
-+category "ca_ES@valencia:2006";LC_NAME
-+category "ca_ES@valencia:2006";LC_ADDRESS
-+category "ca_ES@valencia:2006";LC_TELEPHONE
-+category "ca_ES@valencia:2006";LC_MEASUREMENT
-+
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+END LC_CTYPE
-+
-+LC_COLLATE
-+copy "ca_ES"
-+END LC_COLLATE
-+
-+LC_MONETARY
-+copy "ca_ES"
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+copy "ca_ES"
-+END LC_NUMERIC
-+
-+LC_TIME
-+copy "ca_ES"
-+END LC_TIME
-+
-+LC_MESSAGES
-+copy "ca_ES"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+copy "ca_ES"
-+END LC_PAPER
-+
-+LC_NAME
-+copy "ca_ES"
-+END LC_NAME
-+
-+LC_ADDRESS
-+copy "ca_ES"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+copy "ca_ES"
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+copy "ca_ES"
-+END LC_MEASUREMENT
diff --git a/patches/glibc/2.9/360-2.8-nscd-one-fork.patch b/patches/glibc/2.9/360-2.8-nscd-one-fork.patch
deleted file mode 100644
index c9bf014..0000000
--- a/patches/glibc/2.9/360-2.8-nscd-one-fork.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1160_all_glibc-2.8-nscd-one-fork.patch
-
--= BEGIN original header =-
-only fork one to assist in stop-start-daemon assumptions about daemon behavior
-
-http://bugs.gentoo.org/190785
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/nscd/nscd.c glibc-2_9/nscd/nscd.c
---- glibc-2_9.orig/nscd/nscd.c 2008-03-29 19:08:12.000000000 +0100
-+++ glibc-2_9/nscd/nscd.c 2009-02-02 22:01:10.000000000 +0100
-@@ -179,6 +179,9 @@
- if (pid != 0)
- exit (0);
-
-+ if (write_pid (_PATH_NSCDPID) < 0)
-+ dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
-+
- int nullfd = open (_PATH_DEVNULL, O_RDWR);
- if (nullfd != -1)
- {
-@@ -228,12 +231,6 @@
- for (i = min_close_fd; i < getdtablesize (); i++)
- close (i);
-
-- pid = fork ();
-- if (pid == -1)
-- error (EXIT_FAILURE, errno, _("cannot fork"));
-- if (pid != 0)
-- exit (0);
--
- setsid ();
-
- if (chdir ("/") != 0)
-@@ -242,9 +239,6 @@
-
- openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
-
-- if (write_pid (_PATH_NSCDPID) < 0)
-- dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
--
- if (!init_logfile ())
- dbg_log (_("Could not create log file"));
-
diff --git a/patches/glibc/2.9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch b/patches/glibc/2.9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch
deleted file mode 100644
index 46441d2..0000000
--- a/patches/glibc/2.9/370-hppa_glibc-2.7-hppa-nptl-carlos.patch
+++ /dev/null
@@ -1,249 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/1503_hppa_glibc-2.7-hppa-nptl-carlos.patch
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN glibc-2_9.orig/elf/rtld.c glibc-2_9/elf/rtld.c
---- glibc-2_9.orig/elf/rtld.c 2009-02-02 22:00:34.000000000 +0100
-+++ glibc-2_9/elf/rtld.c 2009-02-02 22:01:12.000000000 +0100
-@@ -386,14 +386,14 @@
- know it is available. We do not have to clear the memory if we
- do not have to use the temporary bootstrap_map. Global variables
- are initialized to zero by default. */
--#ifndef DONT_USE_BOOTSTRAP_MAP
-+#if !defined DONT_USE_BOOTSTRAP_MAP
- # ifdef HAVE_BUILTIN_MEMSET
- __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
- # else
-- for (size_t cnt = 0;
-- cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
-- ++cnt)
-- bootstrap_map.l_info[cnt] = 0;
-+ /* Clear the whole bootstrap_map structure */
-+ for (char *cnt = (char *)&(bootstrap_map);
-+ cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
-+ *cnt++ = '\0');
- # endif
- # if USE___THREAD
- bootstrap_map.l_tls_modid = 0;
-diff -durN glibc-2_9.orig/include/atomic.h glibc-2_9/include/atomic.h
---- glibc-2_9.orig/include/atomic.h 2006-12-21 22:44:00.000000000 +0100
-+++ glibc-2_9/include/atomic.h 2009-02-02 22:01:12.000000000 +0100
-@@ -174,7 +174,7 @@
- __typeof (*(mem)) __atg5_value = (newvalue); \
- \
- do \
-- __atg5_oldval = *__atg5_memp; \
-+ __atg5_oldval = *(volatile __typeof (mem))__atg5_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
- __atg5_oldval), 0)); \
-@@ -195,7 +195,7 @@
- __typeof (*(mem)) __atg6_value = (value); \
- \
- do \
-- __atg6_oldval = *__atg6_memp; \
-+ __atg6_oldval = *(volatile __typeof (mem))__atg6_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
- __atg6_oldval \
-@@ -213,7 +213,7 @@
- __typeof (*(mem)) __atg7_value = (value); \
- \
- do \
-- __atg7_oldv = *__atg7_memp; \
-+ __atg7_oldv = *(volatile __typeof (mem))__atg7_memp; \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
- __atg7_oldv \
-@@ -231,7 +231,7 @@
- __typeof (mem) __atg8_memp = (mem); \
- __typeof (*(mem)) __atg8_value = (value); \
- do { \
-- __atg8_oldval = *__atg8_memp; \
-+ __atg8_oldval = *(volatile __typeof (mem))__atg8_memp; \
- if (__atg8_oldval >= __atg8_value) \
- break; \
- } while (__builtin_expect \
-@@ -248,7 +248,7 @@
- __typeof (mem) __atg9_memp = (mem); \
- __typeof (*(mem)) __atg9_value = (value); \
- do { \
-- __atg9_oldv = *__atg9_memp; \
-+ __atg9_oldv = *(volatile __typeof (mem))__atg9_memp; \
- if (__atg9_oldv >= __atg9_value) \
- break; \
- } while (__builtin_expect \
-@@ -266,7 +266,7 @@
- __typeof (mem) __atg10_memp = (mem); \
- __typeof (*(mem)) __atg10_value = (value); \
- do { \
-- __atg10_oldval = *__atg10_memp; \
-+ __atg10_oldval = *(volatile __typeof (mem))__atg10_memp; \
- if (__atg10_oldval <= __atg10_value) \
- break; \
- } while (__builtin_expect \
-@@ -350,7 +350,7 @@
- \
- do \
- { \
-- __atg11_oldval = *__atg11_memp; \
-+ __atg11_oldval = *(volatile __typeof (mem))__atg11_memp; \
- if (__builtin_expect (__atg11_oldval <= 0, 0)) \
- break; \
- } \
-@@ -389,7 +389,7 @@
- __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
- \
- do \
-- __atg14_old = (*__atg14_memp); \
-+ __atg14_old = (*(volatile __typeof (mem))__atg14_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
- __atg14_old | __atg14_mask,\
-@@ -407,7 +407,7 @@
- __typeof (*(mem)) __atg15_mask = (mask); \
- \
- do \
-- __atg15_old = (*__atg15_memp); \
-+ __atg15_old = (*(volatile __typeof (mem))__atg15_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
- __atg15_old & __atg15_mask, \
-@@ -423,7 +423,7 @@
- __typeof (*(mem)) __atg16_mask = (mask); \
- \
- do \
-- __atg16_old = (*__atg16_memp); \
-+ __atg16_old = (*(volatile __typeof (mem))__atg16_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
- __atg16_old & __atg16_mask,\
-@@ -441,7 +441,7 @@
- __typeof (*(mem)) __atg17_mask = (mask); \
- \
- do \
-- __atg17_old = (*__atg17_memp); \
-+ __atg17_old = (*(volatile __typeof (mem))__atg17_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
- __atg17_old | __atg17_mask, \
-@@ -457,7 +457,7 @@
- __typeof (*(mem)) __atg18_mask = (mask); \
- \
- do \
-- __atg18_old = (*__atg18_memp); \
-+ __atg18_old = (*(volatile __typeof (mem))__atg18_memp); \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
- __atg18_old | __atg18_mask,\
-@@ -473,7 +473,7 @@
- __typeof (*(mem)) __atg19_mask = (mask); \
- \
- do \
-- __atg19_old = (*__atg19_memp); \
-+ __atg19_old = (*(volatile __typeof (mem))__atg19_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
- __atg19_old | __atg19_mask,\
-diff -durN glibc-2_9.orig/nptl/Makefile glibc-2_9/nptl/Makefile
---- glibc-2_9.orig/nptl/Makefile 2008-11-12 14:38:23.000000000 +0100
-+++ glibc-2_9/nptl/Makefile 2009-02-02 22:01:12.000000000 +0100
-@@ -262,9 +262,9 @@
- # Files which must not be linked with libpthread.
- tests-nolibpthread = tst-unload
-
--# This sets the stack resource limit to 1023kb, which is not a multiple
--# of the page size since every architecture's page size is > 1k.
--tst-oddstacklimit-ENV = ; ulimit -s 1023;
-+# This sets the stack resource limit to 8193kb, which is not a multiple
-+# of the page size since every architecture's page size is 4096 bytes.
-+tst-oddstacklimit-ENV = ; ulimit -s 8193;
-
- distribute = eintr.c tst-cleanup4aux.c
-
-@@ -423,6 +423,35 @@
- CFLAGS-tst-cleanupx4.c += -fexceptions
- CFLAGS-tst-oncex3.c += -fexceptions
- CFLAGS-tst-oncex4.c += -fexceptions
-+
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
-+LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
-+
- CFLAGS-tst-align.c += $(stack-align-test-flags)
- CFLAGS-tst-align3.c += $(stack-align-test-flags)
- CFLAGS-tst-initializers1.c = -W -Wall -Werror
-diff -durN glibc-2_9.orig/nptl/pthread_barrier_wait.c glibc-2_9/nptl/pthread_barrier_wait.c
---- glibc-2_9.orig/nptl/pthread_barrier_wait.c 2007-08-01 06:18:50.000000000 +0200
-+++ glibc-2_9/nptl/pthread_barrier_wait.c 2009-02-02 22:01:12.000000000 +0100
-@@ -64,7 +64,7 @@
- do
- lll_futex_wait (&ibarrier->curr_event, event,
- ibarrier->private ^ FUTEX_PRIVATE_FLAG);
-- while (event == ibarrier->curr_event);
-+ while (event == *(volatile unsigned int *)&ibarrier->curr_event);
- }
-
- /* Make sure the init_count is stored locally or in a register. */
-diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/Makefile glibc-2_9/nptl/sysdeps/pthread/Makefile
---- glibc-2_9.orig/nptl/sysdeps/pthread/Makefile 2006-02-28 08:09:41.000000000 +0100
-+++ glibc-2_9/nptl/sysdeps/pthread/Makefile 2009-02-02 22:01:12.000000000 +0100
-@@ -41,7 +41,9 @@
-
- ifeq ($(have-forced-unwind),yes)
- tests += tst-mqueue8x
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
- CFLAGS-tst-mqueue8x.c += -fexceptions
-+LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s)
- endif
- endif
-
-diff -durN glibc-2_9.orig/stdio-common/Makefile glibc-2_9/stdio-common/Makefile
---- glibc-2_9.orig/stdio-common/Makefile 2008-07-08 18:32:28.000000000 +0200
-+++ glibc-2_9/stdio-common/Makefile 2009-02-02 22:01:12.000000000 +0100
-@@ -80,7 +80,7 @@
- $(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
- endif
-
--CFLAGS-vfprintf.c = -Wno-uninitialized
-+CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
- CFLAGS-vfwprintf.c = -Wno-uninitialized
- CFLAGS-tst-printf.c = -Wno-format
- CFLAGS-tstdiomisc.c = -Wno-format
-diff -durN glibc-2_9.orig/sunrpc/clnt_udp.c glibc-2_9/sunrpc/clnt_udp.c
---- glibc-2_9.orig/sunrpc/clnt_udp.c 2008-07-26 10:42:44.000000000 +0200
-+++ glibc-2_9/sunrpc/clnt_udp.c 2009-02-02 22:01:12.000000000 +0100
-@@ -462,7 +462,7 @@
- while (inlen < 0 && errno == EINTR);
- if (inlen < 0)
- {
-- if (errno == EWOULDBLOCK)
-+ if (errno == EWOULDBLOCK || errno == EAGAIN)
- continue;
- cu->cu_error.re_errno = errno;
- return (cu->cu_error.re_status = RPC_CANTRECV);
diff --git a/patches/glibc/2.9/380-2.3.6-dl_execstack-PaX-support.patch b/patches/glibc/2.9/380-2.3.6-dl_execstack-PaX-support.patch
deleted file mode 100644
index 0529e90..0000000
--- a/patches/glibc/2.9/380-2.3.6-dl_execstack-PaX-support.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/3000_all_2.3.6-dl_execstack-PaX-support.patch
-
--= BEGIN original header =-
- With latest versions of glibc, a lot of apps failed on a PaX enabled
- system with:
- cannot enable executable stack as shared object requires: Permission denied
-
- This is due to PaX 'exec-protecting' the stack, and ld.so then trying
- to make the stack executable due to some libraries not containing the
- PT_GNU_STACK section. Bug #32960. <azarah@gentoo.org> (12 Nov 2003).
-
- Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/nptl/allocatestack.c glibc-2_9/nptl/allocatestack.c
---- glibc-2_9.orig/nptl/allocatestack.c 2008-08-16 00:35:27.000000000 +0200
-+++ glibc-2_9/nptl/allocatestack.c 2009-02-02 22:01:20.000000000 +0100
-@@ -299,7 +299,8 @@
- # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
- #endif
- if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
-- return errno;
-+ if (errno != EACCES) /* PAX is enabled */
-+ return errno;
-
- return 0;
- }
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c 2006-01-08 09:21:15.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c 2009-02-02 22:01:20.000000000 +0100
-@@ -63,7 +63,10 @@
- else
- # endif
- {
-- result = errno;
-+ if (errno == EACCES) /* PAX is enabled */
-+ result = 0;
-+ else
-+ result = errno;
- goto out;
- }
- }
-@@ -89,7 +92,12 @@
- page -= size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
-@@ -115,7 +123,12 @@
- page += size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
diff --git a/patches/glibc/2.9/390-2.3.3_pre20040117-pt_pax.patch b/patches/glibc/2.9/390-2.3.3_pre20040117-pt_pax.patch
deleted file mode 100644
index 13398b7..0000000
--- a/patches/glibc/2.9/390-2.3.3_pre20040117-pt_pax.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/3010_all_2.3.3_pre20040117-pt_pax.patch
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN glibc-2_9.orig/elf/elf.h glibc-2_9/elf/elf.h
---- glibc-2_9.orig/elf/elf.h 2008-10-01 21:41:34.000000000 +0200
-+++ glibc-2_9/elf/elf.h 2009-02-02 22:01:21.000000000 +0100
-@@ -571,6 +571,7 @@
- #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
- #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
- #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
- #define PT_LOSUNW 0x6ffffffa
- #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
- #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
-@@ -584,6 +585,18 @@
- #define PF_X (1 << 0) /* Segment is executable */
- #define PF_W (1 << 1) /* Segment is writable */
- #define PF_R (1 << 2) /* Segment is readable */
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
- #define PF_MASKOS 0x0ff00000 /* OS-specific */
- #define PF_MASKPROC 0xf0000000 /* Processor-specific */
-
diff --git a/patches/glibc/2.9/400-tests-sandbox-libdl-paths.patch b/patches/glibc/2.9/400-tests-sandbox-libdl-paths.patch
deleted file mode 100644
index 1d3dda4..0000000
--- a/patches/glibc/2.9/400-tests-sandbox-libdl-paths.patch
+++ /dev/null
@@ -1,198 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/3020_all_glibc-tests-sandbox-libdl-paths.patch
-
--= BEGIN original header =-
-when glibc runs its tests, it does so by invoking the local library loader.
-in Gentoo, we build/run inside of our "sandbox" which itself is linked against
-libdl (so that it can load libraries and pull out symbols). the trouble
-is that when you upgrade from an older glibc to the new one, often times
-internal symbols change name or abi. this is normally OK as you cannot use
-libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
-we always say "keep all of the glibc libraries from the same build". but
-when glibc runs its tests, it uses dynamic paths to point to its new local
-copies of libraries. if the test doesnt use libdl, then glibc doesnt add
-its path, and when sandbox triggers the loading of libdl, glibc does so
-from the host system system. this gets us into the case of all libraries
-are from the locally compiled version of glibc except for libdl.so.
-
-Fix by Wormo
-
-http://bugs.gentoo.org/56898
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/grp/tst_fgetgrent.sh glibc-2_9/grp/tst_fgetgrent.sh
---- glibc-2_9.orig/grp/tst_fgetgrent.sh 2001-07-06 06:54:46.000000000 +0200
-+++ glibc-2_9/grp/tst_fgetgrent.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -24,7 +24,8 @@
- rtld_installed_name=$1; shift
-
- testout=${common_objpfx}/grp/tst_fgetgrent.out
--library_path=${common_objpfx}
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-
- result=0
-
-diff -durN glibc-2_9.orig/iconvdata/run-iconv-test.sh glibc-2_9/iconvdata/run-iconv-test.sh
---- glibc-2_9.orig/iconvdata/run-iconv-test.sh 2008-05-15 03:59:44.000000000 +0200
-+++ glibc-2_9/iconvdata/run-iconv-test.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -34,7 +34,7 @@
- export GCONV_PATH
-
- # We have to have some directories in the library path.
--LIBPATH=$codir:$codir/iconvdata
-+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
-
- # How the start the iconv(1) program.
- ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
-diff -durN glibc-2_9.orig/iconvdata/tst-table.sh glibc-2_9/iconvdata/tst-table.sh
---- glibc-2_9.orig/iconvdata/tst-table.sh 2002-04-24 23:39:35.000000000 +0200
-+++ glibc-2_9/iconvdata/tst-table.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -59,8 +59,11 @@
- irreversible=${charset}.irreversible
- fi
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # iconv in one direction.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-table-from ${charset} \
- > ${objpfx}tst-${charset}.table
-
-diff -durN glibc-2_9.orig/intl/tst-codeset.sh glibc-2_9/intl/tst-codeset.sh
---- glibc-2_9.orig/intl/tst-codeset.sh 2005-04-06 04:18:35.000000000 +0200
-+++ glibc-2_9/intl/tst-codeset.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -37,6 +37,9 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- ${common_objpfx}elf/ld.so --library-path $common_objpfx \
- ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
-
-diff -durN glibc-2_9.orig/intl/tst-gettext.sh glibc-2_9/intl/tst-gettext.sh
---- glibc-2_9.orig/intl/tst-gettext.sh 2004-08-15 21:28:18.000000000 +0200
-+++ glibc-2_9/intl/tst-gettext.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -51,9 +51,12 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
- MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2_9.orig/intl/tst-gettext2.sh glibc-2_9/intl/tst-gettext2.sh
---- glibc-2_9.orig/intl/tst-gettext2.sh 2005-05-04 19:54:48.000000000 +0200
-+++ glibc-2_9/intl/tst-gettext2.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -65,8 +65,11 @@
- LOCPATH=${objpfx}domaindir
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
- cmp ${objpfx}tst-gettext2.out - <<EOF
- String1 - Lang1: 1st string
-diff -durN glibc-2_9.orig/intl/tst-translit.sh glibc-2_9/intl/tst-translit.sh
---- glibc-2_9.orig/intl/tst-translit.sh 2005-05-04 19:56:10.000000000 +0200
-+++ glibc-2_9/intl/tst-translit.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -36,7 +36,10 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2_9.orig/malloc/tst-mtrace.sh glibc-2_9/malloc/tst-mtrace.sh
---- glibc-2_9.orig/malloc/tst-mtrace.sh 2005-10-15 01:40:35.000000000 +0200
-+++ glibc-2_9/malloc/tst-mtrace.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -24,9 +24,12 @@
- status=0
- trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
- LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${common_objpfx}malloc/tst-mtrace || status=1
-
- if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
-diff -durN glibc-2_9.orig/nptl/tst-tls6.sh glibc-2_9/nptl/tst-tls6.sh
---- glibc-2_9.orig/nptl/tst-tls6.sh 2003-09-03 00:02:59.000000000 +0200
-+++ glibc-2_9/nptl/tst-tls6.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -5,8 +5,8 @@
- rtld_installed_name=$1; shift
- logfile=$common_objpfx/nptl/tst-tls6.out
-
--# We have to find libc and nptl
--library_path=${common_objpfx}:${common_objpfx}nptl
-+# We have to find libc and nptl (also libdl in case sandbox is in use)
-+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
- tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}/nptl/tst-tls5"
-
-diff -durN glibc-2_9.orig/posix/globtest.sh glibc-2_9/posix/globtest.sh
---- glibc-2_9.orig/posix/globtest.sh 2007-02-14 20:52:33.000000000 +0100
-+++ glibc-2_9/posix/globtest.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -18,7 +18,7 @@
- esac
-
- # We have to find the libc and the NSS modules.
--library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
-+library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
-
- # Since we use `sort' we must make sure to use the same locale everywhere.
- LC_ALL=C
-diff -durN glibc-2_9.orig/posix/tst-getconf.sh glibc-2_9/posix/tst-getconf.sh
---- glibc-2_9.orig/posix/tst-getconf.sh 2002-09-01 13:11:25.000000000 +0200
-+++ glibc-2_9/posix/tst-getconf.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -10,7 +10,10 @@
- else
- rtld_installed_name=$1; shift
- runit() {
-- ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
-+
-+ # make sure libdl is also in path in case sandbox is in use
-+ library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+ ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
- }
- fi
-
-diff -durN glibc-2_9.orig/posix/wordexp-tst.sh glibc-2_9/posix/wordexp-tst.sh
---- glibc-2_9.orig/posix/wordexp-tst.sh 2000-10-20 18:23:30.000000000 +0200
-+++ glibc-2_9/posix/wordexp-tst.sh 2009-02-02 22:01:23.000000000 +0100
-@@ -19,8 +19,11 @@
- "
- export IFS
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- failed=0
--${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
-+${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
- cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
- wordexp returned 0
diff --git a/patches/glibc/2.9/410-2.9-fnmatch.patch b/patches/glibc/2.9/410-2.9-fnmatch.patch
deleted file mode 100644
index 9865ed5..0000000
--- a/patches/glibc/2.9/410-2.9-fnmatch.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/5021_all_2.9-fnmatch.patch
-
--= BEGIN original header =-
-http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
-
-When fnmatch detects an invalid multibyte character it should fall back to
-single byte matching, so that "*" has a chance to match such a string.
-
-Andreas.
-
-2005-04-12 Andreas Schwab <schwab@suse.de>
-
- * posix/fnmatch.c (fnmatch): If conversion to wide character
- fails fall back to single byte matching.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/posix/fnmatch.c glibc-2_9/posix/fnmatch.c
---- glibc-2_9.orig/posix/fnmatch.c 2007-07-28 22:35:00.000000000 +0200
-+++ glibc-2_9/posix/fnmatch.c 2009-02-02 22:01:25.000000000 +0100
-@@ -327,6 +327,7 @@
- # if HANDLE_MULTIBYTE
- if (__builtin_expect (MB_CUR_MAX, 1) != 1)
- {
-+ const char *orig_pattern = pattern;
- mbstate_t ps;
- size_t n;
- const char *p;
-@@ -382,10 +383,8 @@
- wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
- n = mbsrtowcs (wstring, &p, n + 1, &ps);
- if (__builtin_expect (n == (size_t) -1, 0))
-- /* Something wrong.
-- XXX Do we have to set `errno' to something which mbsrtows hasn't
-- already done? */
-- return -1;
-+ /* Something wrong. Fall back to single byte matching. */
-+ goto try_singlebyte;
- if (p)
- {
- memset (&ps, '\0', sizeof (ps));
-@@ -397,10 +396,8 @@
- prepare_wstring:
- n = mbsrtowcs (NULL, &string, 0, &ps);
- if (__builtin_expect (n == (size_t) -1, 0))
-- /* Something wrong.
-- XXX Do we have to set `errno' to something which mbsrtows hasn't
-- already done? */
-- return -1;
-+ /* Something wrong. Fall back to single byte matching. */
-+ goto try_singlebyte;
- wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
- assert (mbsinit (&ps));
- (void) mbsrtowcs (wstring, &string, n + 1, &ps);
-@@ -408,6 +405,9 @@
-
- return internal_fnwmatch (wpattern, wstring, wstring + n,
- flags & FNM_PERIOD, flags, NULL);
-+
-+ try_singlebyte:
-+ pattern = orig_pattern;
- }
- # endif /* mbstate_t and mbsrtowcs or _LIBC. */
-
diff --git a/patches/glibc/2.9/420-dont-build-timezone.patch b/patches/glibc/2.9/420-dont-build-timezone.patch
deleted file mode 100644
index 05aeb82..0000000
--- a/patches/glibc/2.9/420-dont-build-timezone.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/5063_all_glibc-dont-build-timezone.patch
-
--= BEGIN original header =-
-timezone data has been split into the package sys-libs/timezone-data
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/Makeconfig glibc-2_9/Makeconfig
---- glibc-2_9.orig/Makeconfig 2009-02-02 22:01:05.000000000 +0100
-+++ glibc-2_9/Makeconfig 2009-02-02 22:01:27.000000000 +0100
-@@ -919,7 +919,7 @@
- stdlib stdio-common libio malloc string wcsmbs time dirent \
- grp pwd posix io termios resource misc socket sysvipc gmon \
- gnulib iconv iconvdata wctype manual shadow po argp \
-- crypt nss localedata timezone rt conform debug \
-+ crypt nss localedata rt conform debug \
- $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
-
- ifndef avoid-generated
diff --git a/patches/glibc/2.9/430-2.7-cross-compile-nptl.patch b/patches/glibc/2.9/430-2.7-cross-compile-nptl.patch
deleted file mode 100644
index 85c554d..0000000
--- a/patches/glibc/2.9/430-2.7-cross-compile-nptl.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/5070_all_glibc-2.7-cross-compile-nptl.patch
-
--= BEGIN original header =-
-A little hack for cross-compiling NPTL
-
-http://sourceware.org/ml/libc-alpha/2005-02/msg00043.html
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/configure glibc-2_9/nptl/sysdeps/pthread/configure
---- glibc-2_9.orig/nptl/sysdeps/pthread/configure 2007-10-17 00:24:30.000000000 +0200
-+++ glibc-2_9/nptl/sysdeps/pthread/configure 2009-02-02 22:01:28.000000000 +0100
-@@ -78,6 +78,10 @@
- fi
- { echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
- echo "${ECHO_T}$libc_cv_forced_unwind" >&6; }
-+if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
-+ echo "$as_me:$LINENO: forcing libc_cv_forced_unwind = yes for cross-compile"
-+ libc_cv_forced_unwind=yes
-+fi
- if test $libc_cv_forced_unwind = yes; then
- cat >>confdefs.h <<\_ACEOF
- #define HAVE_FORCED_UNWIND 1
-@@ -141,6 +145,10 @@
- { echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
- echo "${ECHO_T}$libc_cv_c_cleanup" >&6; }
- CFLAGS="$old_CFLAGS"
-+ if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
-+ echo "$as_me:$LINENO: result: forcing libc_cv_c_cleanup = yes for cross-compile"
-+ libc_cv_c_cleanup=yes
-+ fi
- if test $libc_cv_c_cleanup = no; then
- { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5
- echo "$as_me: error: the compiler must support C cleanup handling" >&2;}
-diff -durN glibc-2_9.orig/nptl/sysdeps/pthread/configure.in glibc-2_9/nptl/sysdeps/pthread/configure.in
---- glibc-2_9.orig/nptl/sysdeps/pthread/configure.in 2003-12-03 07:50:01.000000000 +0100
-+++ glibc-2_9/nptl/sysdeps/pthread/configure.in 2009-02-02 22:01:28.000000000 +0100
-@@ -28,6 +28,9 @@
- struct _Unwind_Context *context;
- _Unwind_GetCFA (context)],
- libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
-+if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
-+ libc_cv_forced_unwind=yes
-+fi
- if test $libc_cv_forced_unwind = yes; then
- AC_DEFINE(HAVE_FORCED_UNWIND)
- dnl Check for C cleanup handling.
-@@ -41,6 +44,9 @@
- puts ("test")],
- libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
- CFLAGS="$old_CFLAGS"
-+ if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
-+ libc_cv_c_cleanup=yes
-+ fi
- if test $libc_cv_c_cleanup = no; then
- AC_MSG_ERROR([the compiler must support C cleanup handling])
- fi
diff --git a/patches/glibc/2.9/440-alpha-glibc-2.4-xstat.patch b/patches/glibc/2.9/440-alpha-glibc-2.4-xstat.patch
deleted file mode 100644
index 8b5954c..0000000
--- a/patches/glibc/2.9/440-alpha-glibc-2.4-xstat.patch
+++ /dev/null
@@ -1,249 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/6001_all_alpha-glibc-2.4-xstat.patch
-
--= BEGIN original header =-
-http://sources.redhat.com/bugzilla/show_bug.cgi?id=1026
-http://sourceware.org/ml/libc-alpha/2005-02/msg00122.html
-
-2005-02-26 GOTO Masanori <gotom@debian.or.jp>
-
- * sysdeps/unix/sysv/linux/kernel-features.h: Define
- __ASSUME_STAT64_SYSCALL.
- * sysdeps/unix/sysv/linux/alpha/fxstat.c: Check
- __ASSUME_STAT64_SYSCALL.
- * sysdeps/unix/sysv/linux/alpha/fxstatat.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/lxstat.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/xstat.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/xstatconv.c: Don't define
- __libc_missing_axp_stat64 when it's not needed.
- * sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstat.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c 2004-03-11 03:58:44.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstat.c 2009-02-02 22:01:30.000000000 +0100
-@@ -35,27 +35,39 @@
- __fxstat (int vers, int fd, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_fstat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__fxstat)
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstatat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstatat.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/fxstatat.c 2006-02-20 23:51:48.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/fxstatat.c 2009-02-02 22:01:30.000000000 +0100
-@@ -65,6 +65,20 @@
- int result, errno_out;
- struct kernel_stat kst;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ if (flag & AT_SYMLINK_NOFOLLOW)
-+ result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
-+ else
-+ result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
-+
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-+ goto fail;
-+ }
-+#elif defined __NR_stat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
-@@ -79,6 +93,7 @@
- goto fail;
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/lxstat.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c 2004-03-11 03:58:44.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/lxstat.c 2009-02-02 22:01:30.000000000 +0100
-@@ -35,27 +35,39 @@
- __lxstat (int vers, const char *name, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_lstat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__lxstat)
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstat.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstat.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstat.c 2004-03-11 03:58:44.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstat.c 2009-02-02 22:01:30.000000000 +0100
-@@ -35,27 +35,39 @@
- __xstat (int vers, const char *name, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_stat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__xstat)
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.c glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.c
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.c 2004-03-11 03:58:44.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.c 2009-02-02 22:01:30.000000000 +0100
-@@ -22,9 +22,14 @@
- #include <sys/stat.h>
- #include <kernel_stat.h>
- #include <xstatconv.h>
-+#include <sys/syscall.h>
-
-
-+#ifdef __NR_stat64
-+# if __ASSUME_STAT64_SYSCALL == 0
- int __libc_missing_axp_stat64;
-+# endif
-+#endif
-
- int
- __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.h
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/xstatconv.h 2006-01-08 09:21:16.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/xstatconv.h 2009-02-02 22:01:30.000000000 +0100
-@@ -18,7 +18,12 @@
- 02111-1307 USA. */
-
- #include <kernel-features.h>
-+#include <sys/syscall.h>
-
-+#ifdef __NR_stat64
-+# if __ASSUME_STAT64_SYSCALL == 0
- extern int __libc_missing_axp_stat64 attribute_hidden;
-+# endif
-+#endif
- extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
- attribute_hidden;
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2_9/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/kernel-features.h 2008-08-01 23:51:04.000000000 +0200
-+++ glibc-2_9/sysdeps/unix/sysv/linux/kernel-features.h 2009-02-02 22:01:30.000000000 +0100
-@@ -395,6 +395,11 @@
- # define __ASSUME_GETDENTS32_D_TYPE 1
- #endif
-
-+/* Starting with version 2.6.4, alpha stat64 syscalls are available. */
-+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
-+# define __ASSUME_STAT64_SYSCALL 1
-+#endif
-+
- /* Starting with version 2.5.3, the initial location returned by `brk'
- after exec is always rounded up to the next page. */
- #if __LINUX_KERNEL_VERSION >= 132355
diff --git a/patches/glibc/2.9/450-alpha-glibc-2.5-no-page-header.patch b/patches/glibc/2.9/450-alpha-glibc-2.5-no-page-header.patch
deleted file mode 100644
index 401d5f7..0000000
--- a/patches/glibc/2.9/450-alpha-glibc-2.5-no-page-header.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/6015_all_alpha-glibc-2.5-no-page-header.patch
-
--= BEGIN original header =-
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
- from the kernel header to sys/user.h and remove the #include of
- sys/user.h.
-
--= END original header =-
-
-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
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/user.h 2001-07-06 06:56:13.000000000 +0200
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/user.h 2009-02-02 22:01:32.000000000 +0100
-@@ -23,7 +23,6 @@
- only. Don't read too much into it. Don't use it for anything other
- than gdb/strace unless you know what you are doing. */
-
--#include <asm/page.h>
- #include <asm/reg.h>
-
- struct user
-@@ -41,6 +40,9 @@
- char u_comm[32]; /* user command name */
- };
-
-+#define PAGE_SHIFT 13
-+#define PAGE_SIZE (1 << PAGE_SHIFT)
-+#define PAGE_MASK (~(PAGE_SIZE-1))
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
diff --git a/patches/glibc/2.9/460-alpha-glibc-2.5-no-asm-elf-header.patch b/patches/glibc/2.9/460-alpha-glibc-2.5-no-asm-elf-header.patch
deleted file mode 100644
index 872a0de..0000000
--- a/patches/glibc/2.9/460-alpha-glibc-2.5-no-asm-elf-header.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/6016_all_alpha-glibc-2.5-no-asm-elf-header.patch
-
--= BEGIN original header =-
-2007-03-13 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some defines
- from alpha's asm/elf.h
-
--= END original header =-
-
-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
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sys/procfs.h 2001-07-06 06:56:13.000000000 +0200
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sys/procfs.h 2009-02-02 22:01:33.000000000 +0100
-@@ -29,10 +29,23 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
-+ * I have no idea why that is so. For now, we just leave it at 33
-+ * (32 general regs + processor status word).
-+ */
-+#define ELF_NGREG 33
-+#define ELF_NFPREG 32
-+
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
diff --git a/patches/glibc/2.9/470-alpha-glibc-2.8-creat.patch b/patches/glibc/2.9/470-alpha-glibc-2.8-creat.patch
deleted file mode 100644
index 31da4d1..0000000
--- a/patches/glibc/2.9/470-alpha-glibc-2.8-creat.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/6017_all_alpha-glibc-2.8-creat.patch
-
--= BEGIN original header =-
-alpha does not have a __NR_creat
-
-http://bugs.gentoo.org/227275
-http://sourceware.org/bugzilla/show_bug.cgi?id=6650
-
--= END original header =-
-
-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
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2007-11-10 20:34:26.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2009-02-02 22:01:35.000000000 +0100
-@@ -1 +1,5 @@
- /* Defined as alias for the syscall. */
-+#include <sysdep.h>
-+#ifndef __NR_creat
-+#include "../../../../../io/creat64.c"
-+#endif
diff --git a/patches/glibc/2.9/480-alpha-glibc-2.8-cache-shape.patch b/patches/glibc/2.9/480-alpha-glibc-2.8-cache-shape.patch
deleted file mode 100644
index b9efe92..0000000
--- a/patches/glibc/2.9/480-alpha-glibc-2.8-cache-shape.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/6018_all_alpha-glibc-2.8-cache-shape.patch
-
--= BEGIN original header =-
-older verisons of glibc would build dl-sysdep as shared-only and dl-support as
-static-only. alpha hooks in a cache variable via dl-auxv.h. newer versions of
-glibc build dl-sysdep as both shared and static which means we now have symbol
-duplication for static builds with dl-sysdep and dl-support. since dl-sysdep
-is both shared/static, there is no point in hooking dl-support anymore, so we
-can punt it.
-
--= END original header =-
-
-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
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/dl-support.c 2007-03-13 22:25:16.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/dl-support.c 2009-02-02 22:01:37.000000000 +0100
-@@ -1,1 +1,0 @@
--#include "dl-auxv.h"
diff --git a/patches/glibc/2.9/490-ptr-mangling.patch b/patches/glibc/2.9/490-ptr-mangling.patch
deleted file mode 100644
index b86b5d2..0000000
--- a/patches/glibc/2.9/490-ptr-mangling.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/6018_all_glibc-ptr-mangling.patch
-
--= BEGIN original header =-
-http://bugs.gentoo.org/201910
-
-For every arch, PTR_MANGLE and PTR_DEMANGLE defines are in
-sysdeps/unix/sysv/linux/<arch>/sysdep.h. But for alpha this is not true. The
-defines are in sysdeps/unix/alpha/sysdep.h and unix/sysv/linux/alpha/sysdep.h
-includes the first.
-
-This is a patch that fixes the issue and let alpha build, at the expense of
-disabling MANGLING in the non PIC case, but googling showed that the issue is
-known, and that nobody really cares about it.
-
-Info from: http://sourceware.org/bugzilla/show_bug.cgi?id=5216
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/unix/alpha/sysdep.h glibc-2_9/sysdeps/unix/alpha/sysdep.h
---- glibc-2_9.orig/sysdeps/unix/alpha/sysdep.h 2006-03-03 12:21:28.000000000 +0100
-+++ glibc-2_9/sysdeps/unix/alpha/sysdep.h 2009-02-02 22:01:39.000000000 +0100
-@@ -397,42 +397,4 @@
- _sc_ret = _sc_0, _sc_err = _sc_19; \
- }
-
--/* Pointer mangling support. Note that tls access is slow enough that
-- we don't deoptimize things by placing the pointer check value there. */
--
--#include <stdint.h>
--
--#if defined NOT_IN_libc && defined IS_IN_rtld
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-- ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
--# define PTR_MANGLE(var) \
-- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#elif defined PIC
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldq tmp, __pointer_chk_guard; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard attribute_relro;
--# define PTR_MANGLE(var) \
-- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#endif
--
- #endif /* ASSEMBLER */
-diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h glibc-2_9/sysdeps/unix/sysv/linux/alpha/sysdep.h
---- glibc-2_9.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h 2007-08-21 10:07:28.000000000 +0200
-+++ glibc-2_9/sysdeps/unix/sysv/linux/alpha/sysdep.h 2009-02-02 22:01:39.000000000 +0100
-@@ -98,4 +98,46 @@
- INTERNAL_SYSCALL1(name, err_out, nr, args); \
- })
-
-+/* Pointer mangling support. Note that tls access is slow enough that
-+ we don't deoptimize things by placing the pointer check value there. */
-+
-+#if defined NOT_IN_libc && defined IS_IN_rtld
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-+# define PTR_MANGLE(var) \
-+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#elif defined PIC
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldq tmp, __pointer_chk_guard; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard attribute_relro;
-+# define PTR_MANGLE(var) \
-+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#else
-+/* Pointer mangling is not yet supported for static libc on alpha. */
-+# ifndef __ASSEMBLER__
-+# define PTR_MANGLE(var) (void) (var)
-+# define PTR_DEMANGLE(var) (void) (var)
-+# endif
-+#endif
-+
- #endif /* _LINUX_ALPHA_SYSDEP_H */
diff --git a/patches/glibc/2.9/500-ppc-glibc-2.9-atomic.patch b/patches/glibc/2.9/500-ppc-glibc-2.9-atomic.patch
deleted file mode 100644
index 66033aa..0000000
--- a/patches/glibc/2.9/500-ppc-glibc-2.9-atomic.patch
+++ /dev/null
@@ -1,414 +0,0 @@
-Original patch from: gentoo/src/patchsets/glibc/2.9/6120_all_ppc-glibc-2.9-atomic.patch
-
--= BEGIN original header =-
-sniped from suse
-
--= END original header =-
-
-diff -durN glibc-2_9.orig/sysdeps/powerpc/bits/atomic.h glibc-2_9/sysdeps/powerpc/bits/atomic.h
---- glibc-2_9.orig/sysdeps/powerpc/bits/atomic.h 2007-03-26 22:15:28.000000000 +0200
-+++ glibc-2_9/sysdeps/powerpc/bits/atomic.h 2009-02-02 22:01:40.000000000 +0100
-@@ -85,14 +85,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -102,14 +102,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -118,12 +118,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -132,11 +132,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -144,12 +144,12 @@
- #define __arch_atomic_exchange_and_add_32(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stwcx. %1,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -157,12 +157,12 @@
- #define __arch_atomic_increment_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -170,27 +170,27 @@
- #define __arch_atomic_decrement_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_32(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
- " cmpwi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stwcx. %1,0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-diff -durN glibc-2_9.orig/sysdeps/powerpc/powerpc32/bits/atomic.h glibc-2_9/sysdeps/powerpc/powerpc32/bits/atomic.h
---- glibc-2_9.orig/sysdeps/powerpc/powerpc32/bits/atomic.h 2007-03-26 22:15:45.000000000 +0200
-+++ glibc-2_9/sysdeps/powerpc/powerpc32/bits/atomic.h 2009-02-02 22:01:40.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -60,14 +60,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-diff -durN glibc-2_9.orig/sysdeps/powerpc/powerpc64/bits/atomic.h glibc-2_9/sysdeps/powerpc/powerpc64/bits/atomic.h
---- glibc-2_9.orig/sysdeps/powerpc/powerpc64/bits/atomic.h 2007-03-26 22:16:03.000000000 +0200
-+++ glibc-2_9/sysdeps/powerpc/powerpc64/bits/atomic.h 2009-02-02 22:01:40.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp, __tmp2; \
- __asm __volatile (" clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -61,14 +61,14 @@
- unsigned int __tmp, __tmp2; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
- " clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_REL "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -82,14 +82,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -98,14 +98,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -115,14 +115,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -132,14 +132,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -148,12 +148,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -162,11 +162,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -174,12 +174,12 @@
- #define __arch_atomic_exchange_and_add_64(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stdcx. %1,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -187,12 +187,12 @@
- #define __arch_atomic_increment_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -200,27 +200,27 @@
- #define __arch_atomic_decrement_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_64(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
- " cmpdi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stdcx. %1,0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
diff --git a/patches/glibc/2.9/510-sh-no-asm-user-header.patch b/patches/glibc/2.9/510-sh-no-asm-user-header.patch
deleted file mode 100644
index 78d5aca..0000000
--- a/patches/glibc/2.9/510-sh-no-asm-user-header.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-2007-03-13 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sh/sys/user.h: Copy Linux's asm-sh/user.h.
-
---- glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/user.h
-+++ glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/user.h
-@@ -19,10 +19,60 @@
- #ifndef _SYS_USER_H
- #define _SYS_USER_H 1
-
--#include <features.h>
-+#include <unistd.h>
-+#include <asm/ptrace.h>
-
--#include <asm/user.h>
-+/*
-+ * Core file format: The core file is written in such a way that gdb
-+ * can understand it and provide useful information to the user (under
-+ * linux we use the `trad-core' bfd). The file contents are as follows:
-+ *
-+ * upage: 1 page consisting of a user struct that tells gdb
-+ * what is present in the file. Directly after this is a
-+ * copy of the task_struct, which is currently not used by gdb,
-+ * but it may come in handy at some point. All of the registers
-+ * are stored as part of the upage. The upage should always be
-+ * only one page long.
-+ * data: The data segment follows next. We use current->end_text to
-+ * current->brk to pick up all of the user variables, plus any memory
-+ * that may have been sbrk'ed. No attempt is made to determine if a
-+ * page is demand-zero or if a page is totally unused, we just cover
-+ * the entire range. All of the addresses are rounded in such a way
-+ * that an integral number of pages is written.
-+ * stack: We need the stack information in order to get a meaningful
-+ * backtrace. We need to write the data from usp to
-+ * current->start_stack, so we round each of these in order to be able
-+ * to write an integer number of pages.
-+ */
-
--#undef start_thread
-+struct user_fpu_struct {
-+ unsigned long fp_regs[16];
-+ unsigned long xfp_regs[16];
-+ unsigned long fpscr;
-+ unsigned long fpul;
-+};
-+
-+struct user {
-+ struct pt_regs regs; /* entire machine state */
-+ struct user_fpu_struct fpu; /* Math Co-processor registers */
-+ int u_fpvalid; /* True if math co-processor being used */
-+ size_t u_tsize; /* text size (pages) */
-+ size_t u_dsize; /* data size (pages) */
-+ size_t u_ssize; /* stack size (pages) */
-+ unsigned long start_code; /* text starting address */
-+ unsigned long start_data; /* data starting address */
-+ unsigned long start_stack; /* stack starting address */
-+ long int signal; /* signal causing core dump */
-+ struct regs * u_ar0; /* help gdb find registers */
-+ struct user_fpu_struct* u_fpstate; /* Math Co-processor pointer */
-+ unsigned long magic; /* identifies a core file */
-+ char u_comm[32]; /* user command name */
-+};
-+
-+#define NBPG getpagesize()
-+#define UPAGES 1
-+#define HOST_TEXT_START_ADDR (u.start_code)
-+#define HOST_DATA_START_ADDR (u.start_data)
-+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-
- #endif /* sys/user.h */
diff --git a/patches/glibc/2.9/520-sh-no-asm-elf-header.patch b/patches/glibc/2.9/520-sh-no-asm-elf-header.patch
deleted file mode 100644
index 2fceb48..0000000
--- a/patches/glibc/2.9/520-sh-no-asm-elf-header.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-2007-03-13 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Copy Linux's asm-sh/elf.h types.
-
---- glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-+++ glibc-2_9/sysdeps/unix/sysv/linux/sh/sys/procfs.h
-@@ -29,10 +29,19 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * ELF register definitions...
-+ */
-+typedef unsigned long elf_greg_t;
-+
-+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef struct user_fpu_struct elf_fpregset_t;
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
diff --git a/patches/glibc/2.9/530-powerpc-8xx-CPU15-errata.patch b/patches/glibc/2.9/530-powerpc-8xx-CPU15-errata.patch
deleted file mode 100644
index 1d0643b..0000000
--- a/patches/glibc/2.9/530-powerpc-8xx-CPU15-errata.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Fix memset on PowerPC 8xx, by Nye Liu:
-http://sourceware.org/ml/crossgcc/2008-10/msg00067.html
-
-Quote:
- I am working on a powerpc 860 toolchain, but I am having problems
- convincing glibc to not emit code that uses the dcbz instruction (CPU15
- dcbX bug). The source of the problem is sysdeps/powerpc/power3/memset.S
-
---- glibc-2.7/sysdeps/powerpc/powerpc32/memset.S 2007-03-26 13:09:07.000000000 -0700
-+++ glibc-2.7/sysdeps/powerpc/powerpc32/memset.S.new 2008-10-23 20:28:52.000000000 -0700
-@@ -112,11 +112,13 @@
- clrrwi. rALIGN, rLEN, 5
- mtcrf 0x01, rLEN /* 40th instruction from .align */
-
-+#ifndef BROKEN_PPC_8xx_CPU15
- /* Check if we can use the special case for clearing memory using dcbz.
- This requires that we know the correct cache line size for this
- processor. Getting the __cache_line_size may require establishing GOT
- addressability, so branch out of line to set this up. */
- beq cr1, L(checklinesize)
-+#endif
-
- /* Store blocks of 32-bytes (256-bits) starting on a 32-byte boundary.
- Can't assume that rCHR is zero or that the cache line size is either
-@@ -158,6 +160,7 @@
- add rMEMP, rMEMP, rALIGN
- b L(medium_tail2) /* 72nd instruction from .align */
-
-+#ifndef BROKEN_PPC_8xx_CPU15
- .align 5
- nop
- /* Clear cache lines of memory in 128-byte chunks.
-@@ -191,6 +194,7 @@
- bdnz L(zloop)
- beqlr cr5
- b L(medium_tail2)
-+#endif /* ! BROKEN_PPC_8xx_CPU15 */
-
- .align 5
- L(small):
-@@ -248,6 +252,7 @@
- stw rCHR, -8(rMEMP)
- blr
-
-+#ifndef BROKEN_PPC_8xx_CPU15
- L(checklinesize):
- #ifdef SHARED
- mflr rTMP
-@@ -329,6 +334,7 @@
- L(handletail32):
- clrrwi. rALIGN, rLEN, 5
- b L(nondcbz)
-+#endif /* ! BROKEN_PPC_8xx_CPU15 */
-
- END (BP_SYM (memset))
- libc_hidden_builtin_def (memset)
diff --git a/patches/glibc/2.9/540-alpha-atfcts.patch b/patches/glibc/2.9/540-alpha-atfcts.patch
deleted file mode 100644
index 83adbce..0000000
--- a/patches/glibc/2.9/540-alpha-atfcts.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h 2007-08-14 06:21:09.000000000 +0300
-+++ glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h.new 2008-07-23 07:05:20.000000000 +0300
-@@ -454,8 +454,7 @@
- and on Alpha just after 2.6.22-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020611 \
- && ((!defined __sh__ && !defined __alpha__) \
-- || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
-- || (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
-+ || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__))
- # define __ASSUME_ATFCTS 1
- #endif
-
diff --git a/patches/glibc/2.9/550-2.9-elf-begin.patch b/patches/glibc/2.9/550-2.9-elf-begin.patch
deleted file mode 100644
index e4c5233..0000000
--- a/patches/glibc/2.9/550-2.9-elf-begin.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-[ALL ] powerpc-860-linux-gnu-gcc -nostdlib -nostartfiles -shared -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs -Wl,--verbose 2>&1 | LC_ALL=C sed -e '/^=========/,/^=========/!d;/^=========/d' -e 's/. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' > /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so.lds
-[ALL ] powerpc-860-linux-gnu-gcc -nostdlib -nostartfiles -shared -o /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/librtld.os -Wl,--version-script=/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/ld.map -Wl,-soname=ld.so.1 -T /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so.lds
-[ALL ] /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/librtld.os: In function `_dl_start_final':
-[ALL ] rtld.c:(.text+0x2fe): undefined reference to `_begin'
-[ALL ] /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/gcc-core-shared/lib/gcc/powerpc-860-linux-gnu/4.3.3/../../../../powerpc-860-linux-gnu/bin/ld: /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so: hidden symbol `_begin' isn't defined
-[ALL ] /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/gcc-core-shared/lib/gcc/powerpc-860-linux-gnu/4.3.3/../../../../powerpc-860-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
-[ALL ] collect2: ld returned 1 exit status
-[ERROR] make[3]: *** [/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so] Error 1
-[ALL ] make[3]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/src/glibc-2.9/elf'
-[ERROR] make[2]: *** [elf/subdir_lib] Error 2
-[ALL ] make[2]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/src/glibc-2.9'
-[ERROR] make[1]: *** [all] Error 2
-[ALL ] make[1]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc'
-[ERROR] Build failed in step 'Installing C library'
-[ERROR] Error happened in '/local/nyet-build/crosstool-ng-svn/scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
-[ERROR] called from '/local/nyet-build/crosstool-ng-svn/scripts/build/libc/glibc.sh' at line # 504 in function 'do_libc'
-[ERROR] called from '/local/nyet-build/crosstool-ng-svn/scripts/crosstool-NG.sh' at line # 478 in function 'main'
-
---- glibc-2.9_orig/elf/Makefile 2009-03-26 20:26:42.000000000 -0700
-+++ glibc-2.9/elf/Makefile 2009-03-26 20:14:11.000000000 -0700
-@@ -304,7 +304,7 @@
- $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
- LC_ALL=C \
- sed -e '/^=========/,/^=========/!d;/^=========/d' \
-- -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
-+ -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- > $@.lds
- $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
- $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
diff --git a/patches/glibc/2.9/560-syslog.patch b/patches/glibc/2.9/560-syslog.patch
deleted file mode 100644
index c20cafc..0000000
--- a/patches/glibc/2.9/560-syslog.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN glibc-cvs-2.9.orig/misc/syslog.c glibc-cvs-2.9/misc/syslog.c
---- glibc-cvs-2.9.orig/misc/syslog.c 2009-06-01 10:16:50.000000000 +0200
-+++ glibc-cvs-2.9/misc/syslog.c 2009-06-01 10:17:20.000000000 +0200
-@@ -152,7 +152,7 @@
- #define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
- /* Check for invalid bits. */
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
-- syslog(INTERNALLOG,
-+ __syslog(INTERNALLOG,
- "syslog: unknown facility/priority: %x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
diff --git a/patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch b/patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch
deleted file mode 100644
index a5a7052..0000000
--- a/patches/glibc/2.9/570-debug-readlink_chk-readklinkat_chk.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur glibc-cvs-2.9.orig/debug/readlink_chk.c glibc-cvs-2.9/debug/readlink_chk.c
---- glibc-cvs-2.9.orig/debug/readlink_chk.c 2005-03-01 01:41:15.000000000 +0100
-+++ glibc-cvs-2.9/debug/readlink_chk.c 2009-06-01 10:59:37.000000000 +0200
-@@ -25,7 +25,7 @@
-
-
- ssize_t
--__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
-+__readlink_chk (const char *path, char *buf, size_t len, size_t buflen)
- {
- if (len > buflen)
- __chk_fail ();
-diff -dur glibc-cvs-2.9.orig/debug/readlinkat_chk.c glibc-cvs-2.9/debug/readlinkat_chk.c
---- glibc-cvs-2.9.orig/debug/readlinkat_chk.c 2006-04-24 18:56:12.000000000 +0200
-+++ glibc-cvs-2.9/debug/readlinkat_chk.c 2009-06-01 11:07:26.000000000 +0200
-@@ -21,7 +21,7 @@
-
-
- ssize_t
--__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
-+__readlinkat_chk (int fd, const char *path, char *buf, size_t len,
- size_t buflen)
- {
- if (len > buflen)
diff --git a/patches/glibc/2.9/600-recent-binutils.patch b/patches/glibc/2.9/600-recent-binutils.patch
deleted file mode 100644
index f4d297e..0000000
--- a/patches/glibc/2.9/600-recent-binutils.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -durN glibc-2.9.orig/configure glibc-2.9/configure
---- glibc-2.9.orig/configure 2010-05-18 23:47:23.000000000 +0200
-+++ glibc-2.9/configure 2010-05-18 23:50:04.000000000 +0200
-@@ -4534,7 +4534,7 @@
- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-- 2.1[3-9]*)
-+ 2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*)
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
-@@ -4597,7 +4597,7 @@
- ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-- 2.1[3-9]*)
-+ 2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*)
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
-diff -durN glibc-2.9.orig/configure.in glibc-2.9/configure.in
---- glibc-2.9.orig/configure.in 2010-05-18 23:47:23.000000000 +0200
-+++ glibc-2.9/configure.in 2010-05-18 23:51:25.000000000 +0200
-@@ -844,10 +844,10 @@
- # Accept binutils 2.13 or newer.
- AC_CHECK_PROG_VER(AS, $AS, --version,
- [GNU assembler.* \([0-9]*\.[0-9.]*\)],
-- [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
-+ [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as")
- AC_CHECK_PROG_VER(LD, $LD, --version,
- [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
-- [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
-+ [2.1[3-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
-
- # We need the physical current working directory. We cannot use the
- # "pwd -P" shell builtin since that's not portable. Instead we try to
diff --git a/patches/glibc/2.9/610-fix-nptl-init.patch b/patches/glibc/2.9/610-fix-nptl-init.patch
deleted file mode 100644
index a25d6ad..0000000
--- a/patches/glibc/2.9/610-fix-nptl-init.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- glibc-2_9.orig/nptl/init.c 2007-10-15 22:25:25.000000000 +0200
-+++ glibc-2_9/nptl/init.c 2010-08-18 10:46:06.109098646 +0200
-@@ -236,7 +236,7 @@
-
-
- /* This can be set by the debugger before initialization is complete. */
--static bool __nptl_initial_report_events;
-+static bool __nptl_initial_report_events __attribute_used__;
-
- void
- __pthread_initialize_minimal_internal (void)
diff --git a/patches/glibc/2.9/900-march-i686.patch b/patches/glibc/2.9/900-march-i686.patch
deleted file mode 100644
index b34807e..0000000
--- a/patches/glibc/2.9/900-march-i686.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
-
- * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
- * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
-
-diff -urN glibc-2.9.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.9/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.9.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.9/nptl/sysdeps/pthread/pt-initfini.c 2010-12-30 11:33:31.520855595 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
-
-diff -urN glibc-2.9.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.9/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.9.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 21:10:20.000000000 +0100
-+++ glibc-2.9/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-12-30 11:33:31.520855595 +0100
-@@ -29,6 +29,10 @@
- #include <dl-sysdep.h>
- #include <tls.h>
-
-+#if defined __i686 && defined __ASSEMBLER__
-+#undef __i686
-+#define __i686 __i686
-+#endif
-
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
diff --git a/patches/glibc/2.9/910-typedef-caddr.patch b/patches/glibc/2.9/910-typedef-caddr.patch
deleted file mode 100644
index 5075c74..0000000
--- a/patches/glibc/2.9/910-typedef-caddr.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -urN glibc-2.9-orig/posix/sys/types.h glibc-2.9/posix/sys/types.h
---- glibc-2.9-orig/posix/sys/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.9/posix/sys/types.h 2011-03-29 14:16:00.374064708 +0200
-@@ -114,7 +114,10 @@
- #ifdef __USE_BSD
- # ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- # endif
- #endif
-diff -urN glibc-2.9-orig/sunrpc/rpc/types.h glibc-2.9/sunrpc/rpc/types.h
---- glibc-2.9-orig/sunrpc/rpc/types.h 2010-12-13 11:47:26.000000000 +0100
-+++ glibc-2.9/sunrpc/rpc/types.h 2011-03-29 14:16:32.988910439 +0200
-@@ -80,7 +80,10 @@
- #endif
- #ifndef __daddr_t_defined
- typedef __daddr_t daddr_t;
-+# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
- typedef __caddr_t caddr_t;
-+# define __caddr_t_defined
-+# endif
- # define __daddr_t_defined
- #endif
-
diff --git a/patches/glibc/linuxthreads-2.3.6/100-cygwin.patch b/patches/glibc/linuxthreads-2.3.6/100-cygwin.patch
deleted file mode 100644
index 0c0dac0..0000000
--- a/patches/glibc/linuxthreads-2.3.6/100-cygwin.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Fixes
-elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
-...
-when building glibc-2.3.3 on cygwin
-
-Idea from
-http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
-Basically, make glibc use .oST as suffix for 'object static'
-instead of .oS, since cygwin has trouble distinguishing .os from .oS
-(Original patch had .on, but .oST is more mnemonic for 'object static')
-
-glibc-linuxthreads-2.3.3 also requires a patch, see
-../glibc-linuxthreads-2.3.3/glibc-linuxthreads-2.3.3-cygwin.patch
-
-[ rediffed against glibc-2.3.5 ]
-
-diff -aur glibc-2.3.5/linuxthreads/Makefile glibc-2.3.5-cygwin/linuxthreads/Makefile
---- glibc-2.3.5/linuxthreads/Makefile 2005-02-16 12:26:38.000000000 +0100
-+++ glibc-2.3.5-cygwin/linuxthreads/Makefile 2005-05-11 08:32:50.453125000 +0200
-@@ -159,7 +159,7 @@
- install: $(inst_libdir)/libpthread.so
- $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
- $(objpfx)libpthread.so$(libpthread.so-version) \
-- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
-+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
- $(libprefix)pthread) \
- $(+force)
- (echo '/* GNU ld script';\
-@@ -167,7 +167,7 @@
- echo ' the static library, so try that secondarily. */';\
- cat $<; \
- echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
-- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
-+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
- ')' \
- ) > $@.new
- mv -f $@.new $@
diff --git a/patches/glibc/linuxthreads-2.3.6/110-alpha-cfi.patch b/patches/glibc/linuxthreads-2.3.6/110-alpha-cfi.patch
deleted file mode 100644
index 97c152e..0000000
--- a/patches/glibc/linuxthreads-2.3.6/110-alpha-cfi.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h.orig 2008-06-19 15:31:45.000000000 +0300
-+++ glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h 2008-06-19 15:36:10.000000000 +0300
-@@ -54,6 +54,7 @@
- bne a3, SYSCALL_ERROR_LABEL; \
- __LABEL($pseudo_ret) \
- .subsection 2; \
-+ cfi_startproc; \
- __LABEL($pseudo_cancel) \
- subq sp, 64, sp; \
- cfi_def_cfa_offset(64); \
-@@ -84,12 +85,13 @@
- cfi_def_cfa_offset(0); \
- __LABEL($syscall_error) \
- SYSCALL_ERROR_HANDLER; \
-+ cfi_endproc; \
- .previous
-
- # undef PSEUDO_END
- # define PSEUDO_END(sym) \
-- .subsection 2; \
- cfi_endproc; \
-+ .subsection 2; \
- .size sym, .-sym
-
- # define SAVE_ARGS_0 /* Nothing. */
diff --git a/patches/glibc/ports-2.10.1/100-respect-env-CPPFLAGS.patch b/patches/glibc/ports-2.10.1/100-respect-env-CPPFLAGS.patch
deleted file mode 100644
index 9523ae2..0000000
--- a/patches/glibc/ports-2.10.1/100-respect-env-CPPFLAGS.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Respect environment CPPFLAGS when we run ./configure so we can inject
-random -D things without having to set CFLAGS/ASFLAGS
-
-diff -durN glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig
---- glibc-2.10.1.orig/Makeconfig 2009-05-09 23:57:56.000000000 +0200
-+++ glibc-2.10.1/Makeconfig 2009-11-13 00:49:41.000000000 +0100
-@@ -672,6 +672,7 @@
- $(foreach lib,$(libof-$(basename $(@F))) \
- $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
- $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-+CPPFLAGS += $(CPPFLAGS-config)
- override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
- $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
- $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
-diff -durN glibc-2.10.1.orig/config.make.in glibc-2.10.1/config.make.in
---- glibc-2.10.1.orig/config.make.in 2009-05-09 17:59:38.000000000 +0200
-+++ glibc-2.10.1/config.make.in 2009-11-13 00:49:41.000000000 +0100
-@@ -103,6 +103,7 @@
- CXX = @CXX@
- BUILD_CC = @BUILD_CC@
- CFLAGS = @CFLAGS@
-+CPPFLAGS-config = @CPPFLAGS@
- ASFLAGS-config = @ASFLAGS_config@
- AR = @AR@
- RANLIB = @RANLIB@
diff --git a/patches/glibc/ports-2.10.1/110-binutils-2.20-compat.patch b/patches/glibc/ports-2.10.1/110-binutils-2.20-compat.patch
deleted file mode 100644
index e281657..0000000
--- a/patches/glibc/ports-2.10.1/110-binutils-2.20-compat.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-diff -durN glibc-2.10.1.orig/configure glibc-2.10.1/configure
---- glibc-2.10.1.orig/configure 2009-05-17 14:19:31.000000000 +0200
-+++ glibc-2.10.1/configure 2009-11-13 00:49:43.000000000 +0100
-@@ -4839,7 +4839,7 @@
- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-- 2.1[3-9]*)
-+ 2.1[3-9]*|[2-9].[2-9]*)
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
-@@ -4902,7 +4902,7 @@
- ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-- 2.1[3-9]*)
-+ 2.1[3-9]*|[2-9].[2-9]*)
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
-diff -durN glibc-2.10.1.orig/configure.in glibc-2.10.1/configure.in
---- glibc-2.10.1.orig/configure.in 2009-04-04 01:51:47.000000000 +0200
-+++ glibc-2.10.1/configure.in 2009-11-13 00:49:43.000000000 +0100
-@@ -897,10 +897,10 @@
- # Accept binutils 2.13 or newer.
- AC_CHECK_PROG_VER(AS, $AS, --version,
- [GNU assembler.* \([0-9]*\.[0-9.]*\)],
-- [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
-+ [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as")
- AC_CHECK_PROG_VER(LD, $LD, --version,
- [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
-- [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
-+ [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld")
-
- # We need the physical current working directory. We cannot use the
- # "pwd -P" shell builtin since that's not portable. Instead we try to
diff --git a/patches/glibc/ports-2.10.1/120-i386-x86_64-revert-clone-cfi.patch b/patches/glibc/ports-2.10.1/120-i386-x86_64-revert-clone-cfi.patch
deleted file mode 100644
index 1351b82..0000000
--- a/patches/glibc/ports-2.10.1/120-i386-x86_64-revert-clone-cfi.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-revert cfi additions to clone on i386/x86_64 to workaround problems in
-gcc's unwinder code. this is not a bug in glibc, it triggers problems
-elsewhere. this cfi code does not gain us a whole lot anyways.
-
-http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
-
-Index: sysdeps/unix/sysv/linux/i386/clone.S
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/clone.S,v
-retrieving revision 1.27
-retrieving revision 1.26
-diff -u -p -r1.27 -r1.26
-
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2.10.1/sysdeps/unix/sysv/linux/i386/clone.S
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/clone.S 2009-11-13 00:49:45.000000000 +0100
-@@ -120,9 +120,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (eip);
- /* Note: %esi is zero. */
- movl %esi,%ebp /* terminate the stack frame */
- #ifdef RESET_PID
-@@ -155,7 +152,6 @@
- jmp L(haspid)
- .previous
- #endif
-- cfi_endproc;
-
- cfi_startproc
- PSEUDO_END (BP_SYM (__clone))
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S glibc-2.10.1/sysdeps/unix/sysv/linux/x86_64/clone.S
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/x86_64/clone.S 2009-11-13 00:49:45.000000000 +0100
-@@ -89,9 +89,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (rip);
- /* Clear the frame pointer. The ABI suggests this be done, to mark
- the outermost frame obviously. */
- xorl %ebp, %ebp
-@@ -116,7 +113,6 @@
- /* Call exit with return value from function call. */
- movq %rax, %rdi
- call HIDDEN_JUMPTARGET (_exit)
-- cfi_endproc;
-
- cfi_startproc;
- PSEUDO_END (BP_SYM (__clone))
diff --git a/patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch b/patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch
deleted file mode 100644
index a97362f..0000000
--- a/patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Fix building on x86 when older linux headers lack __NR_fallocate define.
-
-URL: http://bugs.gentoo.org/274269
-Reported-by: Mikael Magnusson <mikachu@gmail.com>
-
-2009-11-09 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h.
- (fallocate): Return ENOSYS if __NR_fallocate is not defined.
- * sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
-
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate.c glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate.c
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate.c 2009-03-02 17:11:06.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate.c 2009-11-13 00:49:47.000000000 +0100
-@@ -16,6 +16,7 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#include <errno.h>
- #include <fcntl.h>
- #include <sysdep.h>
-
-@@ -28,5 +29,10 @@
- int
- fallocate (int fd, int mode, __off_t offset, __off_t len)
- {
-+#ifdef __NR_fallocate
- return __call_fallocate (fd, mode, offset, len);
-+#else
-+ __set_errno (ENOSYS);
-+ return -1;
-+#endif
- }
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate64.c glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate64.c
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate64.c 2009-03-02 17:10:29.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate64.c 2009-11-13 00:49:47.000000000 +0100
-@@ -16,6 +16,7 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#include <errno.h>
- #include <fcntl.h>
- #include <sysdep.h>
-
-@@ -28,5 +29,10 @@
- int
- __fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
- {
-+#ifdef __NR_fallocate
- return __call_fallocate (fd, mode, offset, len);
-+#else
-+ __set_errno (ENOSYS);
-+ return -1;
-+#endif
- }
diff --git a/patches/glibc/ports-2.10.1/140-disable-ldconfig.patch b/patches/glibc/ports-2.10.1/140-disable-ldconfig.patch
deleted file mode 100644
index 602dd10..0000000
--- a/patches/glibc/ports-2.10.1/140-disable-ldconfig.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-do not bother running ldconfig on DESTDIR. it wants to write the temp cache
-file outside of the chroot. doesnt matter anyways as we wont use the cache
-results (portage will rebuild cache), so running ldconfig is simply a waste
-of time.
-
-diff -durN glibc-2.10.1.orig/Makefile glibc-2.10.1/Makefile
---- glibc-2.10.1.orig/Makefile 2009-04-23 20:23:03.000000000 +0200
-+++ glibc-2.10.1/Makefile 2009-11-13 00:49:49.000000000 +0100
-@@ -116,6 +116,7 @@
- rm -f $(symbolic-link-list)
-
- install:
-+dont-bother-with-destdir:
- -test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
- $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
- $(slibdir) $(libdir)
diff --git a/patches/glibc/ports-2.10.1/150-queue-header-updates.patch b/patches/glibc/ports-2.10.1/150-queue-header-updates.patch
deleted file mode 100644
index 640007d..0000000
--- a/patches/glibc/ports-2.10.1/150-queue-header-updates.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-grab some updates from FreeBSD
-
-http://bugs.gentoo.org/201979
-
-diff -durN glibc-2.10.1.orig/misc/sys/queue.h glibc-2.10.1/misc/sys/queue.h
-
-diff -durN glibc-2.10.1.orig/misc/sys/queue.h glibc-2.10.1/misc/sys/queue.h
---- glibc-2.10.1.orig/misc/sys/queue.h 2008-03-05 06:50:30.000000000 +0100
-+++ glibc-2.10.1/misc/sys/queue.h 2009-11-13 00:49:51.000000000 +0100
-@@ -136,6 +136,11 @@
- (var); \
- (var) = ((var)->field.le_next))
-
-+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = LIST_FIRST((head)); \
-+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- /*
- * List access methods.
- */
-@@ -197,6 +202,16 @@
- #define SLIST_FOREACH(var, head, field) \
- for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
-
-+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = SLIST_FIRST((head)); \
-+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
-+#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
-+ for ((varp) = &SLIST_FIRST((head)); \
-+ ((var) = *(varp)) != NULL; \
-+ (varp) = &SLIST_NEXT((var), field))
-+
- /*
- * Singly-linked List access methods.
- */
-@@ -242,6 +257,12 @@
- (head)->stqh_last = &(elm)->field.stqe_next; \
- } while (/*CONSTCOND*/0)
-
-+#define STAILQ_LAST(head, type, field) \
-+ (STAILQ_EMPTY((head)) ? \
-+ NULL : \
-+ ((struct type *)(void *) \
-+ ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-+
- #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
- if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
-@@ -271,6 +292,11 @@
- (var); \
- (var) = ((var)->field.stqe_next))
-
-+#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = STAILQ_FIRST((head)); \
-+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- #define STAILQ_CONCAT(head1, head2) do { \
- if (!STAILQ_EMPTY((head2))) { \
- *(head1)->stqh_last = (head2)->stqh_first; \
-@@ -437,11 +463,21 @@
- (var); \
- (var) = ((var)->field.tqe_next))
-
-+#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = TAILQ_FIRST((head)); \
-+ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
- for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
- (var); \
- (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
-
-+#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
-+ for ((var) = TAILQ_LAST((head), headname); \
-+ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
-+ (var) = (tvar))
-+
- #define TAILQ_CONCAT(head1, head2, field) do { \
- if (!TAILQ_EMPTY(head2)) { \
- *(head1)->tqh_last = (head2)->tqh_first; \
diff --git a/patches/glibc/ports-2.10.1/160-manual-no-perl.patch b/patches/glibc/ports-2.10.1/160-manual-no-perl.patch
deleted file mode 100644
index 80a1742..0000000
--- a/patches/glibc/ports-2.10.1/160-manual-no-perl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-If we're using a cvs snapshot which updates the source files, and
-perl isn't installed yet, then we can't regen the docs. Not a big
-deal, so just whine a little and continue on our merry way.
-
-http://bugs.gentoo.org/60132
-
-diff -durN glibc-2.10.1.orig/manual/Makefile glibc-2.10.1/manual/Makefile
---- glibc-2.10.1.orig/manual/Makefile 2006-01-08 07:43:47.000000000 +0100
-+++ glibc-2.10.1/manual/Makefile 2009-11-13 00:49:54.000000000 +0100
-@@ -104,9 +104,14 @@
- libm-err.texi: stamp-libm-err
- stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
- $(dir)/libm-test-ulps))
-+ifneq ($(PERL),no)
- pwd=`pwd`; \
- $(PERL) $< $$pwd/.. > libm-err-tmp
- $(move-if-change) libm-err-tmp libm-err.texi
-+else
-+ echo "Unable to rebuild math docs, no perl installed"
-+ touch libm-err.texi
-+endif
- touch $@
-
- # Generate Texinfo files from the C source for the example programs.
diff --git a/patches/glibc/ports-2.10.1/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.10.1/170-localedef-fix-trampoline.patch
deleted file mode 100644
index 6672c5c..0000000
--- a/patches/glibc/ports-2.10.1/170-localedef-fix-trampoline.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh -e
-
-# DP: Description: Fix localedef segfault when run under exec-shield,
-# PaX or similar. (#231438, #198099)
-# DP: Dpatch Author: James Troup <james@nocrew.org>
-# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
-# DP: Upstream status: Unknown
-# DP: Status Details: Unknown
-# DP: Date: 2004-03-16
-
-if [ $# -ne 2 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
- -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-esac
-exit 0
-
-diff -durN glibc-2.10.1.orig/locale/programs/3level.h glibc-2.10.1/locale/programs/3level.h
---- glibc-2.10.1.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200
-+++ glibc-2.10.1/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100
-@@ -203,6 +203,42 @@
- }
- }
- }
-+
-+/* GCC ATM seems to do a poor job with pointers to nested functions passed
-+ to inlined functions. Help it a little bit with this hack. */
-+#define wchead_table_iterate(tp, fn) \
-+do \
-+ { \
-+ struct wchead_table *t = (tp); \
-+ uint32_t index1; \
-+ for (index1 = 0; index1 < t->level1_size; index1++) \
-+ { \
-+ uint32_t lookup1 = t->level1[index1]; \
-+ if (lookup1 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup1_shifted = lookup1 << t->q; \
-+ uint32_t index2; \
-+ for (index2 = 0; index2 < (1 << t->q); index2++) \
-+ { \
-+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
-+ if (lookup2 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup2_shifted = lookup2 << t->p; \
-+ uint32_t index3; \
-+ for (index3 = 0; index3 < (1 << t->p); index3++) \
-+ { \
-+ struct element_t *lookup3 \
-+ = t->level3[index3 + lookup2_shifted]; \
-+ if (lookup3 != NULL) \
-+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
-+ lookup3); \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } while (0)
-+
- #endif
-
- #ifndef NO_FINALIZE
diff --git a/patches/glibc/ports-2.10.1/180-resolv-dynamic.patch b/patches/glibc/ports-2.10.1/180-resolv-dynamic.patch
deleted file mode 100644
index ea88fa0..0000000
--- a/patches/glibc/ports-2.10.1/180-resolv-dynamic.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-ripped from SuSE
-
-if /etc/resolv.conf is updated, then make sure applications
-already running get the updated information.
-
-http://bugs.gentoo.org/177416
-
-diff -durN glibc-2.10.1.orig/resolv/res_libc.c glibc-2.10.1/resolv/res_libc.c
---- glibc-2.10.1.orig/resolv/res_libc.c 2009-02-07 05:27:42.000000000 +0100
-+++ glibc-2.10.1/resolv/res_libc.c 2009-11-13 00:49:59.000000000 +0100
-@@ -22,6 +22,7 @@
- #include <arpa/nameser.h>
- #include <resolv.h>
- #include <bits/libc-lock.h>
-+#include <sys/stat.h>
-
-
- /* The following bit is copied from res_data.c (where it is #ifdef'ed
-@@ -95,6 +96,20 @@
- __res_maybe_init (res_state resp, int preinit)
- {
- if (resp->options & RES_INIT) {
-+ static time_t last_mtime, last_check;
-+ time_t now;
-+ struct stat statbuf;
-+
-+ time (&now);
-+ if (now != last_check) {
-+ last_check = now;
-+ if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
-+ last_mtime = statbuf.st_mtime;
-+ atomicinclock (lock);
-+ atomicinc (__res_initstamp);
-+ atomicincunlock (lock);
-+ }
-+ }
- if (__res_initstamp != resp->_u._ext.initstamp) {
- if (resp->nscount > 0)
- __res_iclose (resp, true);
diff --git a/patches/glibc/ports-2.10.1/190-localedef-mmap.patch b/patches/glibc/ports-2.10.1/190-localedef-mmap.patch
deleted file mode 100644
index 470b8c2..0000000
--- a/patches/glibc/ports-2.10.1/190-localedef-mmap.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-sniped from Debian
-http://bugs.gentoo.org/289615
-
-2009-10-27 Aurelien Jarno <aurelien@aurel32.net>
-
- * locale/programs/locarchive.c: use MMAP_SHARED to reserve memory
- used later with MMAP_FIXED | MMAP_SHARED to cope with different
- alignment restrictions.
-
-diff -durN glibc-2.10.1.orig/locale/programs/locarchive.c glibc-2.10.1/locale/programs/locarchive.c
---- glibc-2.10.1.orig/locale/programs/locarchive.c 2009-04-27 16:07:47.000000000 +0200
-+++ glibc-2.10.1/locale/programs/locarchive.c 2009-11-13 00:50:01.000000000 +0100
-@@ -134,7 +134,7 @@
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
-@@ -396,7 +396,7 @@
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
-@@ -614,7 +614,7 @@
- int xflags = 0;
- void *p;
- if (st.st_size < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
diff --git a/patches/glibc/ports-2.10.1/200-fadvise64_64.patch b/patches/glibc/ports-2.10.1/200-fadvise64_64.patch
deleted file mode 100644
index ec22188..0000000
--- a/patches/glibc/ports-2.10.1/200-fadvise64_64.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-ripped from Debian
-
- sysdeps/unix/sysv/linux/posix_fadvise.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2.10.1/sysdeps/unix/sysv/linux/posix_fadvise.c
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/posix_fadvise.c 2003-08-17 02:36:22.000000000 +0200
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/posix_fadvise.c 2009-11-13 00:50:03.000000000 +0100
-@@ -35,6 +35,19 @@
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
- #else
-+# ifdef __NR_fadvise64_64
-+ INTERNAL_SYSCALL_DECL (err);
-+ int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
-+ __LONG_LONG_PAIR ((long) (offset >> 31),
-+ (long) offset),
-+ __LONG_LONG_PAIR ((long) (len >> 31),
-+ (long) len),
-+ advise);
-+ if (INTERNAL_SYSCALL_ERROR_P (ret, err))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+# else
- return ENOSYS;
-+# endif
- #endif
- }
diff --git a/patches/glibc/ports-2.10.1/210-ldbl-nexttowardf.patch b/patches/glibc/ports-2.10.1/210-ldbl-nexttowardf.patch
deleted file mode 100644
index a6f0dea..0000000
--- a/patches/glibc/ports-2.10.1/210-ldbl-nexttowardf.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-ripped from Debian
-
-this change was made to generic __nexttowardf, but not the long double version
-
-2008-05-05 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/ieee754/ldbl-128/s_nexttowardf.c: Include float.h.
- (__nexttowardf): Use math_opt_barrier and
- math_force_eval macros. If FLT_EVAL_METHOD is not 0, force
- x to float using asm.
-
- sysdeps/ieee754/ldbl-128/s_nexttowardf.c | 26 ++++++++++++++++----------
- 1 file changed, 16 insertions(+), 10 deletions(-)
-
-diff -durN glibc-2.10.1.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c glibc-2.10.1/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
---- glibc-2.10.1.orig/sysdeps/ieee754/ldbl-128/s_nexttowardf.c 1999-07-14 02:09:42.000000000 +0200
-+++ glibc-2.10.1/sysdeps/ieee754/ldbl-128/s_nexttowardf.c 2009-11-13 00:50:06.000000000 +0100
-@@ -19,7 +19,8 @@
- #endif
-
- #include "math.h"
--#include "math_private.h"
-+#include <math_private.h>
-+#include <float.h>
-
- #ifdef __STDC__
- float __nexttowardf(float x, long double y)
-@@ -44,10 +45,12 @@
- return x+y;
- if((long double) x==y) return y; /* x=y, return y */
- if(ix==0) { /* x == 0 */
-- float x2;
-+ float u;
- SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
-- x2 = x*x;
-- if(x2==x) return x2; else return x; /* raise underflow flag */
-+ u = math_opt_barrier (x);
-+ u = u * u;
-+ math_force_eval (u); /* raise underflow flag */
-+ return x;
- }
- if(hx>=0) { /* x > 0 */
- if(hy<0||(ix>>23)>(iy>>48)-0x3f80
-@@ -67,13 +70,16 @@
- }
- }
- hy = hx&0x7f800000;
-- if(hy>=0x7f800000) return x+x; /* overflow */
-+ if(hy>=0x7f800000) {
-+ x = x+x; /* overflow */
-+ if (FLT_EVAL_METHOD != 0)
-+ /* Force conversion to float. */
-+ asm ("" : "+m"(x));
-+ return x;
-+ }
- if(hy<0x00800000) { /* underflow */
-- float x2 = x*x;
-- if(x2!=x) { /* raise underflow flag */
-- SET_FLOAT_WORD(x2,hx);
-- return x2;
-- }
-+ float u = x*x;
-+ math_force_eval (u); /* raise underflow flag */
- }
- SET_FLOAT_WORD(x,hx);
- return x;
diff --git a/patches/glibc/ports-2.10.1/220-section-comments.patch b/patches/glibc/ports-2.10.1/220-section-comments.patch
deleted file mode 100644
index c4f08e4..0000000
--- a/patches/glibc/ports-2.10.1/220-section-comments.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-04/msg00665.html
-
-fixes building on some architectures (like m68k/arm/cris/etc...) because
-it does the right thing
-
-diff -durN glibc-2.10.1.orig/include/libc-symbols.h glibc-2.10.1/include/libc-symbols.h
---- glibc-2.10.1.orig/include/libc-symbols.h 2009-03-14 00:51:46.000000000 +0100
-+++ glibc-2.10.1/include/libc-symbols.h 2009-11-13 00:50:07.000000000 +0100
-@@ -239,12 +239,12 @@
- # define __make_section_unallocated(section_string)
- # endif
-
--/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
-+/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
- section attributes on what looks like a comment to the assembler. */
- # ifdef HAVE_SECTION_QUOTES
--# define __sec_comment "\"\n\t#\""
-+# define __sec_comment "\"\n#APP\n\t#\""
- # else
--# define __sec_comment "\n\t#"
-+# define __sec_comment "\n#APP\n\t#"
- # endif
- # define link_warning(symbol, msg) \
- __make_section_unallocated (".gnu.warning." #symbol) \
diff --git a/patches/glibc/ports-2.10.1/230-no-inline-gmon.patch b/patches/glibc/ports-2.10.1/230-no-inline-gmon.patch
deleted file mode 100644
index c2f58c6..0000000
--- a/patches/glibc/ports-2.10.1/230-no-inline-gmon.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-http://bugs.gentoo.org/196245
-http://sourceware.org/ml/libc-alpha/2006-05/msg00017.html
-
-Attached is a patch to add __attribute__ ((noinline)) to
-call_gmon_start.
-
-Without this patch, the sec script that processed initfini.s removes a
-part of inlined call_gmon_start, causing undefined label errors.
-
-This patch solves the problem by forcing gcc not to inline
-call_gmon_start with __attribute__ ((noinline)).
-
-Tested by building for arm-none-lixux-gnueabi. OK to apply?
-
-Kazu Hirata
-
-2006-05-07 Kazu Hirata &lt;kazu@codesourcery.com&gt;
-
- * sysdeps/generic/initfini.c (call_gmon_start): Add
- __attribute__ ((noinline)).
-
-Index: sysdeps/generic/initfini.c
-===================================================================
-
-diff -durN glibc-2.10.1.orig/sysdeps/generic/initfini.c glibc-2.10.1/sysdeps/generic/initfini.c
---- glibc-2.10.1.orig/sysdeps/generic/initfini.c 2007-06-17 20:02:40.000000000 +0200
-+++ glibc-2.10.1/sysdeps/generic/initfini.c 2009-11-13 00:50:09.000000000 +0100
-@@ -70,7 +70,7 @@
- /* The beginning of _init: */
- asm ("\n/*@_init_PROLOG_BEGINS*/");
-
--static void
-+static void __attribute__ ((noinline))
- call_gmon_start(void)
- {
- extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
diff --git a/patches/glibc/ports-2.10.1/240-check_native-headers.patch b/patches/glibc/ports-2.10.1/240-check_native-headers.patch
deleted file mode 100644
index c0fca6d..0000000
--- a/patches/glibc/ports-2.10.1/240-check_native-headers.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-many ports hit this warning:
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-
-snipped from suse
-
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/check_native.c glibc-2.10.1/sysdeps/unix/sysv/linux/check_native.c
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/check_native.c 2007-11-24 04:12:17.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/check_native.c 2009-11-13 00:50:11.000000000 +0100
-@@ -23,6 +23,7 @@
- #include <stddef.h>
- #include <stdint.h>
- #include <stdlib.h>
-+#include <string.h>
- #include <time.h>
- #include <unistd.h>
- #include <net/if.h>
diff --git a/patches/glibc/ports-2.10.1/250-fix-pr631.patch b/patches/glibc/ports-2.10.1/250-fix-pr631.patch
deleted file mode 100644
index 1db35ed..0000000
--- a/patches/glibc/ports-2.10.1/250-fix-pr631.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
-diff -durN glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig
---- glibc-2.10.1.orig/Makeconfig 2009-11-13 00:49:41.000000000 +0100
-+++ glibc-2.10.1/Makeconfig 2009-11-13 00:50:13.000000000 +0100
-@@ -509,7 +509,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
-diff -durN glibc-2.10.1.orig/elf/Makefile glibc-2.10.1/elf/Makefile
---- glibc-2.10.1.orig/elf/Makefile 2009-01-31 01:20:55.000000000 +0100
-+++ glibc-2.10.1/elf/Makefile 2009-11-13 00:50:13.000000000 +0100
-@@ -121,6 +121,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
diff --git a/patches/glibc/ports-2.10.1/260-assume-pipe2.patch b/patches/glibc/ports-2.10.1/260-assume-pipe2.patch
deleted file mode 100644
index 684b5e0..0000000
--- a/patches/glibc/ports-2.10.1/260-assume-pipe2.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-http://bugs.gentoo.org/250342
-http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
-
-we cant assume sock_cloexec and pipe2 are bound together as the former defines
-are found in glibc only while the latter are a combo of kernel headers and
-glibc. so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
-inside of glibc, we hit a problem. for example:
-
-#include <grp.h>
-#include <stdio.h>
-main()
-{
- getgrnam("portage");
- if (!popen("ls", "r"))
- perror("popen()");
-}
-
-getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
-__have_sock_cloexec and __have_pipe2 to true. but if glibc was built against
-older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
-stub for it. so popen() will always fail as glibc assumes pipe2() works.
-
-diff -durN glibc-2.10.1.orig/include/unistd.h glibc-2.10.1/include/unistd.h
---- glibc-2.10.1.orig/include/unistd.h 2008-07-27 20:23:17.000000000 +0200
-+++ glibc-2.10.1/include/unistd.h 2009-11-13 00:50:15.000000000 +0100
-@@ -167,9 +167,6 @@
- extern int __pause_nocancel (void) attribute_hidden;
-
- extern int __have_sock_cloexec;
--/* At lot of other functionality became available at the same time as
-- SOCK_CLOEXEC. Avoid defining separate variables for all of them
-- unless it is really necessary. */
--#define __have_pipe2 __have_sock_cloexec
-+extern int __have_pipe2;
-
- #endif
-diff -durN glibc-2.10.1.orig/socket/have_sock_cloexec.c glibc-2.10.1/socket/have_sock_cloexec.c
---- glibc-2.10.1.orig/socket/have_sock_cloexec.c 2008-07-25 18:46:23.000000000 +0200
-+++ glibc-2.10.1/socket/have_sock_cloexec.c 2009-11-13 00:50:15.000000000 +0100
-@@ -16,9 +16,14 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#include <fcntl.h>
- #include <sys/socket.h>
- #include <kernel-features.h>
-
- #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
- int __have_sock_cloexec;
- #endif
-+
-+#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
-+int __have_pipe2;
-+#endif
diff --git a/patches/glibc/ports-2.10.1/270-china.patch b/patches/glibc/ports-2.10.1/270-china.patch
deleted file mode 100644
index 646c2ef..0000000
--- a/patches/glibc/ports-2.10.1/270-china.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-diff -durN glibc-2.10.1.orig/localedata/locales/zh_TW glibc-2.10.1/localedata/locales/zh_TW
---- glibc-2.10.1.orig/localedata/locales/zh_TW 2004-11-01 00:42:28.000000000 +0100
-+++ glibc-2.10.1/localedata/locales/zh_TW 2009-11-13 00:50:17.000000000 +0100
-@@ -1,7 +1,7 @@
- comment_char %
- escape_char /
- %
--% Chinese language locale for Taiwan R.O.C.
-+% Chinese language locale for Taiwan
- % charmap: BIG5-CP950
- %
- % Original Author:
-@@ -17,7 +17,7 @@
- % Reference: http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
-
- LC_IDENTIFICATION
--title "Chinese locale for Taiwan R.O.C."
-+title "Chinese locale for Taiwan"
- source ""
- address ""
- contact ""
-@@ -25,7 +25,7 @@
- tel ""
- fax ""
- language "Chinese"
--territory "Taiwan R.O.C."
-+territory "Taiwan"
- revision "0.2"
- date "2000-08-02"
- %
diff --git a/patches/glibc/ports-2.10.1/280-new-valencian-locale.patch b/patches/glibc/ports-2.10.1/280-new-valencian-locale.patch
deleted file mode 100644
index 46afd68..0000000
--- a/patches/glibc/ports-2.10.1/280-new-valencian-locale.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-http://bugs.gentoo.org/show_bug.cgi?id=131815
-http://sourceware.org/bugzilla/show_bug.cgi?id=2522
-
-diff -durN glibc-2.10.1.orig/localedata/SUPPORTED glibc-2.10.1/localedata/SUPPORTED
---- glibc-2.10.1.orig/localedata/SUPPORTED 2009-04-18 10:43:52.000000000 +0200
-+++ glibc-2.10.1/localedata/SUPPORTED 2009-11-13 00:50:20.000000000 +0100
-@@ -72,6 +72,8 @@
- ca_ES.UTF-8/UTF-8 \
- ca_ES/ISO-8859-1 \
- ca_ES@euro/ISO-8859-15 \
-+ca_ES.UTF-8@valencia/UTF-8 \
-+ca_ES@valencia/ISO-8859-15 \
- ca_FR.UTF-8/UTF-8 \
- ca_FR/ISO-8859-15 \
- ca_IT.UTF-8/UTF-8 \
-diff -durN glibc-2.10.1.orig/localedata/locales/ca_ES@valencia glibc-2.10.1/localedata/locales/ca_ES@valencia
---- glibc-2.10.1.orig/localedata/locales/ca_ES@valencia 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.10.1/localedata/locales/ca_ES@valencia 2009-11-13 00:50:20.000000000 +0100
-@@ -0,0 +1,96 @@
-+comment_char %
-+escape_char /
-+%
-+% Valencian (southern Catalan) locale for Spain with Euro
-+%
-+% Note that this locale is almost the same as ca_ES@euro. The point of having
-+% a separate locale is only for PO translations, which have a lot of social
-+% support and are very appreciated by the Valencian-speaking community.
-+%
-+% Contact: Jordi Mallach
-+% Email: jordi@gnu.org
-+% Tel:
-+% Fax:
-+% Language: ca
-+% Territory: ES
-+% Option: euro
-+% Revision: 1.0
-+% Date: 2006-04-06
-+% Application: general
-+% Users: general
-+% Repertoiremap: mnemonic,ds
-+% Charset: ISO-8859-15
-+% Distribution and use is free, also
-+% for commercial purposes.
-+
-+LC_IDENTIFICATION
-+title "Valencian (southern Catalan) locale for Spain with Euro"
-+source ""
-+address ""
-+contact "Jordi Mallach"
-+email "jordi@gnu.org"
-+tel ""
-+fax ""
-+language "Catalan"
-+territory "Spain"
-+revision "1.0"
-+date "2006-04-06"
-+%
-+category "ca_ES@valencia:2006";LC_IDENTIFICATION
-+category "ca_ES@valencia:2006";LC_CTYPE
-+category "ca_ES@valencia:2006";LC_COLLATE
-+category "ca_ES@valencia:2006";LC_MONETARY
-+category "ca_ES@valencia:2006";LC_NUMERIC
-+category "ca_ES@valencia:2006";LC_TIME
-+category "ca_ES@valencia:2006";LC_MESSAGES
-+category "ca_ES@valencia:2006";LC_PAPER
-+category "ca_ES@valencia:2006";LC_NAME
-+category "ca_ES@valencia:2006";LC_ADDRESS
-+category "ca_ES@valencia:2006";LC_TELEPHONE
-+category "ca_ES@valencia:2006";LC_MEASUREMENT
-+
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+END LC_CTYPE
-+
-+LC_COLLATE
-+copy "ca_ES"
-+END LC_COLLATE
-+
-+LC_MONETARY
-+copy "ca_ES"
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+copy "ca_ES"
-+END LC_NUMERIC
-+
-+LC_TIME
-+copy "ca_ES"
-+END LC_TIME
-+
-+LC_MESSAGES
-+copy "ca_ES"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+copy "ca_ES"
-+END LC_PAPER
-+
-+LC_NAME
-+copy "ca_ES"
-+END LC_NAME
-+
-+LC_ADDRESS
-+copy "ca_ES"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+copy "ca_ES"
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+copy "ca_ES"
-+END LC_MEASUREMENT
diff --git a/patches/glibc/ports-2.10.1/300-nscd-one-fork.patch b/patches/glibc/ports-2.10.1/300-nscd-one-fork.patch
deleted file mode 100644
index 13c1542..0000000
--- a/patches/glibc/ports-2.10.1/300-nscd-one-fork.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-only fork one to assist in stop-start-daemon assumptions about daemon behavior
-
-http://bugs.gentoo.org/190785
-
-diff -durN glibc-2.10.1.orig/nscd/nscd.c glibc-2.10.1/nscd/nscd.c
---- glibc-2.10.1.orig/nscd/nscd.c 2009-02-06 21:10:27.000000000 +0100
-+++ glibc-2.10.1/nscd/nscd.c 2009-11-13 00:50:24.000000000 +0100
-@@ -182,6 +182,9 @@
- if (pid != 0)
- exit (0);
-
-+ if (write_pid (_PATH_NSCDPID) < 0)
-+ dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
-+
- int nullfd = open (_PATH_DEVNULL, O_RDWR);
- if (nullfd != -1)
- {
-@@ -231,12 +234,6 @@
- for (i = min_close_fd; i < getdtablesize (); i++)
- close (i);
-
-- pid = fork ();
-- if (pid == -1)
-- error (EXIT_FAILURE, errno, _("cannot fork"));
-- if (pid != 0)
-- exit (0);
--
- setsid ();
-
- if (chdir ("/") != 0)
-@@ -245,9 +242,6 @@
-
- openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
-
-- if (write_pid (_PATH_NSCDPID) < 0)
-- dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
--
- if (!init_logfile ())
- dbg_log (_("Could not create log file"));
-
diff --git a/patches/glibc/ports-2.10.1/310-hppa-nptl-carlos.patch b/patches/glibc/ports-2.10.1/310-hppa-nptl-carlos.patch
deleted file mode 100644
index 0fed2a0..0000000
--- a/patches/glibc/ports-2.10.1/310-hppa-nptl-carlos.patch
+++ /dev/null
@@ -1,246 +0,0 @@
-
-
-diff -durN glibc-2.10.1.orig/elf/rtld.c glibc-2.10.1/elf/rtld.c
---- glibc-2.10.1.orig/elf/rtld.c 2009-04-17 02:00:08.000000000 +0200
-+++ glibc-2.10.1/elf/rtld.c 2009-11-13 00:50:26.000000000 +0100
-@@ -384,14 +384,14 @@
- know it is available. We do not have to clear the memory if we
- do not have to use the temporary bootstrap_map. Global variables
- are initialized to zero by default. */
--#ifndef DONT_USE_BOOTSTRAP_MAP
-+#if !defined DONT_USE_BOOTSTRAP_MAP
- # ifdef HAVE_BUILTIN_MEMSET
- __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
- # else
-- for (size_t cnt = 0;
-- cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
-- ++cnt)
-- bootstrap_map.l_info[cnt] = 0;
-+ /* Clear the whole bootstrap_map structure */
-+ for (char *cnt = (char *)&(bootstrap_map);
-+ cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
-+ *cnt++ = '\0');
- # endif
- # if USE___THREAD
- bootstrap_map.l_tls_modid = 0;
-diff -durN glibc-2.10.1.orig/include/atomic.h glibc-2.10.1/include/atomic.h
---- glibc-2.10.1.orig/include/atomic.h 2009-02-09 00:49:53.000000000 +0100
-+++ glibc-2.10.1/include/atomic.h 2009-11-13 00:50:26.000000000 +0100
-@@ -174,7 +174,7 @@
- __typeof (*(mem)) __atg5_value = (newvalue); \
- \
- do \
-- __atg5_oldval = *__atg5_memp; \
-+ __atg5_oldval = *(volatile __typeof (mem))__atg5_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
- __atg5_oldval), 0)); \
-@@ -195,7 +195,7 @@
- __typeof (*(mem)) __atg6_value = (value); \
- \
- do \
-- __atg6_oldval = *__atg6_memp; \
-+ __atg6_oldval = *(volatile __typeof (mem))__atg6_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
- __atg6_oldval \
-@@ -213,7 +213,7 @@
- __typeof (*(mem)) __atg7_value = (value); \
- \
- do \
-- __atg7_oldv = *__atg7_memp; \
-+ __atg7_oldv = *(volatile __typeof (mem))__atg7_memp; \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
- __atg7_oldv \
-@@ -231,7 +231,7 @@
- __typeof (mem) __atg8_memp = (mem); \
- __typeof (*(mem)) __atg8_value = (value); \
- do { \
-- __atg8_oldval = *__atg8_memp; \
-+ __atg8_oldval = *(volatile __typeof (mem))__atg8_memp; \
- if (__atg8_oldval >= __atg8_value) \
- break; \
- } while (__builtin_expect \
-@@ -248,7 +248,7 @@
- __typeof (mem) __atg9_memp = (mem); \
- __typeof (*(mem)) __atg9_value = (value); \
- do { \
-- __atg9_oldv = *__atg9_memp; \
-+ __atg9_oldv = *(volatile __typeof (mem))__atg9_memp; \
- if (__atg9_oldv >= __atg9_value) \
- break; \
- } while (__builtin_expect \
-@@ -266,7 +266,7 @@
- __typeof (mem) __atg10_memp = (mem); \
- __typeof (*(mem)) __atg10_value = (value); \
- do { \
-- __atg10_oldval = *__atg10_memp; \
-+ __atg10_oldval = *(volatile __typeof (mem))__atg10_memp; \
- if (__atg10_oldval <= __atg10_value) \
- break; \
- } while (__builtin_expect \
-@@ -350,7 +350,7 @@
- \
- do \
- { \
-- __atg11_oldval = *__atg11_memp; \
-+ __atg11_oldval = *(volatile __typeof (mem))__atg11_memp; \
- if (__builtin_expect (__atg11_oldval <= 0, 0)) \
- break; \
- } \
-@@ -389,7 +389,7 @@
- __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
- \
- do \
-- __atg14_old = (*__atg14_memp); \
-+ __atg14_old = (*(volatile __typeof (mem))__atg14_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
- __atg14_old | __atg14_mask,\
-@@ -407,7 +407,7 @@
- __typeof (*(mem)) __atg15_mask = (mask); \
- \
- do \
-- __atg15_old = (*__atg15_memp); \
-+ __atg15_old = (*(volatile __typeof (mem))__atg15_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
- __atg15_old & __atg15_mask, \
-@@ -439,7 +439,7 @@
- __typeof (*(mem)) __atg16_mask = (mask); \
- \
- do \
-- __atg16_old = (*__atg16_memp); \
-+ __atg16_old = (*(volatile __typeof (mem))__atg16_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
- __atg16_old & __atg16_mask,\
-@@ -457,7 +457,7 @@
- __typeof (*(mem)) __atg17_mask = (mask); \
- \
- do \
-- __atg17_old = (*__atg17_memp); \
-+ __atg17_old = (*(volatile __typeof (mem))__atg17_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
- __atg17_old | __atg17_mask, \
-@@ -473,7 +473,7 @@
- __typeof (*(mem)) __atg18_mask = (mask); \
- \
- do \
-- __atg18_old = (*__atg18_memp); \
-+ __atg18_old = (*(volatile __typeof (mem))__atg18_memp); \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
- __atg18_old | __atg18_mask,\
-@@ -489,7 +489,7 @@
- __typeof (*(mem)) __atg19_mask = (mask); \
- \
- do \
-- __atg19_old = (*__atg19_memp); \
-+ __atg19_old = (*(volatile __typeof (mem))__atg19_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
- __atg19_old | __atg19_mask,\
-diff -durN glibc-2.10.1.orig/nptl/Makefile glibc-2.10.1/nptl/Makefile
---- glibc-2.10.1.orig/nptl/Makefile 2008-11-12 14:38:23.000000000 +0100
-+++ glibc-2.10.1/nptl/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -262,9 +262,9 @@
- # Files which must not be linked with libpthread.
- tests-nolibpthread = tst-unload
-
--# This sets the stack resource limit to 1023kb, which is not a multiple
--# of the page size since every architecture's page size is > 1k.
--tst-oddstacklimit-ENV = ; ulimit -s 1023;
-+# This sets the stack resource limit to 8193kb, which is not a multiple
-+# of the page size since every architecture's page size is 4096 bytes.
-+tst-oddstacklimit-ENV = ; ulimit -s 8193;
-
- distribute = eintr.c tst-cleanup4aux.c
-
-@@ -423,6 +423,35 @@
- CFLAGS-tst-cleanupx4.c += -fexceptions
- CFLAGS-tst-oncex3.c += -fexceptions
- CFLAGS-tst-oncex4.c += -fexceptions
-+
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
-+LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
-+
- CFLAGS-tst-align.c += $(stack-align-test-flags)
- CFLAGS-tst-align3.c += $(stack-align-test-flags)
- CFLAGS-tst-initializers1.c = -W -Wall -Werror
-diff -durN glibc-2.10.1.orig/nptl/pthread_barrier_wait.c glibc-2.10.1/nptl/pthread_barrier_wait.c
---- glibc-2.10.1.orig/nptl/pthread_barrier_wait.c 2007-08-01 06:18:50.000000000 +0200
-+++ glibc-2.10.1/nptl/pthread_barrier_wait.c 2009-11-13 00:50:26.000000000 +0100
-@@ -64,7 +64,7 @@
- do
- lll_futex_wait (&ibarrier->curr_event, event,
- ibarrier->private ^ FUTEX_PRIVATE_FLAG);
-- while (event == ibarrier->curr_event);
-+ while (event == *(volatile unsigned int *)&ibarrier->curr_event);
- }
-
- /* Make sure the init_count is stored locally or in a register. */
-diff -durN glibc-2.10.1.orig/nptl/sysdeps/pthread/Makefile glibc-2.10.1/nptl/sysdeps/pthread/Makefile
---- glibc-2.10.1.orig/nptl/sysdeps/pthread/Makefile 2006-02-28 08:09:41.000000000 +0100
-+++ glibc-2.10.1/nptl/sysdeps/pthread/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -41,7 +41,9 @@
-
- ifeq ($(have-forced-unwind),yes)
- tests += tst-mqueue8x
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
- CFLAGS-tst-mqueue8x.c += -fexceptions
-+LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s)
- endif
- endif
-
-diff -durN glibc-2.10.1.orig/stdio-common/Makefile glibc-2.10.1/stdio-common/Makefile
---- glibc-2.10.1.orig/stdio-common/Makefile 2009-04-11 07:29:56.000000000 +0200
-+++ glibc-2.10.1/stdio-common/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -82,7 +82,7 @@
- $(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
- endif
-
--CFLAGS-vfprintf.c = -Wno-uninitialized
-+CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
- CFLAGS-vfwprintf.c = -Wno-uninitialized
- CFLAGS-tst-printf.c = -Wno-format
- CFLAGS-tstdiomisc.c = -Wno-format
-diff -durN glibc-2.10.1.orig/sunrpc/clnt_udp.c glibc-2.10.1/sunrpc/clnt_udp.c
---- glibc-2.10.1.orig/sunrpc/clnt_udp.c 2008-07-26 10:42:44.000000000 +0200
-+++ glibc-2.10.1/sunrpc/clnt_udp.c 2009-11-13 00:50:26.000000000 +0100
-@@ -462,7 +462,7 @@
- while (inlen < 0 && errno == EINTR);
- if (inlen < 0)
- {
-- if (errno == EWOULDBLOCK)
-+ if (errno == EWOULDBLOCK || errno == EAGAIN)
- continue;
- cu->cu_error.re_errno = errno;
- return (cu->cu_error.re_status = RPC_CANTRECV);
diff --git a/patches/glibc/ports-2.10.1/320-hppa-pie.patch b/patches/glibc/ports-2.10.1/320-hppa-pie.patch
deleted file mode 100644
index f17507d..0000000
--- a/patches/glibc/ports-2.10.1/320-hppa-pie.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/hppa/elf/start.S glibc-2.10.1/glibc-ports-2.10.1/sysdeps/hppa/elf/start.S
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/hppa/elf/start.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/hppa/elf/start.S 2009-11-13 00:50:28.000000000 +0100
-@@ -96,16 +96,16 @@
-
- #if SHARED
- /* load main (1st argument) */
-- addil LR'.Lpmain, %r19
-- ldw RR'.Lpmain(%r1), %r26
-+ addil LT'.Lpmain, %r19
-+ ldw RT'.Lpmain(%r1), %r26
- ldw 0(%r26),%r26
- /* void (*init) (void) (4th argument) */
-- addil LR'.Lp__libc_csu_init, %r19
-- ldw RR'.Lp__libc_csu_init(%r1), %r23
-+ addil LT'.Lp__libc_csu_init, %r19
-+ ldw RT'.Lp__libc_csu_init(%r1), %r23
- ldw 0(%r23), %r23
- /* void (*fini) (void) (5th argument) */
-- addil LR'.Lp__libc_csu_fini, %r19
-- ldw RR'.Lp__libc_csu_fini(%r1), %r22
-+ addil LT'.Lp__libc_csu_fini, %r19
-+ ldw RT'.Lp__libc_csu_fini(%r1), %r22
- ldw 0(%r22), %r22
- #else
- /* load main (1st argument) */
-diff -durN glibc-2.10.1.orig/ports/sysdeps/hppa/elf/start.S glibc-2.10.1/ports/sysdeps/hppa/elf/start.S
diff --git a/patches/glibc/ports-2.10.1/330-m68k-sys-user.patch b/patches/glibc/ports-2.10.1/330-m68k-sys-user.patch
deleted file mode 100644
index 9e07fca..0000000
--- a/patches/glibc/ports-2.10.1/330-m68k-sys-user.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-copied from kernel as it is sanitized now
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/m68k/sys/user.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/m68k/sys/user.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/m68k/sys/user.h 2009-11-13 00:50:31.000000000 +0100
-@@ -1,3 +1,90 @@
-+#ifndef _SYS_USER_H
-+#define _SYS_USER_H
-+
-+/* Core file format: The core file is written in such a way that gdb
-+ can understand it and provide useful information to the user (under
-+ linux we use the 'trad-core' bfd). There are quite a number of
-+ obstacles to being able to view the contents of the floating point
-+ registers, and until these are solved you will not be able to view the
-+ contents of them. Actually, you can read in the core file and look at
-+ the contents of the user struct to find out what the floating point
-+ registers contain.
-+ The actual file contents are as follows:
-+ UPAGE: 1 page consisting of a user struct that tells gdb what is present
-+ in the file. Directly after this is a copy of the task_struct, which
-+ is currently not used by gdb, but it may come in useful at some point.
-+ All of the registers are stored as part of the upage. The upage should
-+ always be only one page.
-+ DATA: The data area is stored. We use current->end_text to
-+ current->brk to pick up all of the user variables, plus any memory
-+ that may have been malloced. No attempt is made to determine if a page
-+ is demand-zero or if a page is totally unused, we just cover the entire
-+ range. All of the addresses are rounded in such a way that an integral
-+ number of pages is written.
-+ STACK: We need the stack information in order to get a meaningful
-+ backtrace. We need to write the data from (esp) to
-+ current->start_stack, so we round each of these off in order to be able
-+ to write an integer number of pages.
-+ The minimum core file size is 3 pages, or 12288 bytes.
-+*/
-+
-+struct user_m68kfp_struct {
-+ unsigned long fpregs[8*3]; /* fp0-fp7 registers */
-+ unsigned long fpcntl[3]; /* fp control regs */
-+};
-+
-+/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
-+ is still the layout used by user (the new pt_regs doesn't have
-+ all registers). */
-+struct user_regs_struct {
-+ long d1,d2,d3,d4,d5,d6,d7;
-+ long a0,a1,a2,a3,a4,a5,a6;
-+ long d0;
-+ long usp;
-+ long orig_d0;
-+ short stkadj;
-+ short sr;
-+ long pc;
-+ short fmtvec;
-+ short __fill;
-+};
-+
-+
-+/* When the kernel dumps core, it starts by dumping the user struct -
-+ this will be used by gdb to figure out where the data and stack segments
-+ are within the file, and what virtual addresses to use. */
-+struct user{
-+/* We start with the registers, to mimic the way that "memory" is returned
-+ from the ptrace(3,...) function. */
-+ struct user_regs_struct regs; /* Where the registers are actually stored */
-+/* ptrace does not yet supply these. Someday.... */
-+ int u_fpvalid; /* True if math co-processor being used. */
-+ /* for this mess. Not yet used. */
-+ struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */
-+/* The rest of this junk is to help gdb figure out what goes where */
-+ unsigned long int u_tsize; /* Text segment size (pages). */
-+ unsigned long int u_dsize; /* Data segment size (pages). */
-+ unsigned long int u_ssize; /* Stack segment size (pages). */
-+ unsigned long start_code; /* Starting virtual address of text. */
-+ unsigned long start_stack; /* Starting virtual address of stack area.
-+ This is actually the bottom of the stack,
-+ the top of the stack is always found in the
-+ esp register. */
-+ long int signal; /* Signal that caused the core dump. */
-+ int reserved; /* No longer used */
-+ struct user_regs_struct *u_ar0;
-+ /* Used by gdb to help find the values for */
-+ /* the registers. */
-+ struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */
-+ unsigned long magic; /* To uniquely identify a core file */
-+ char u_comm[32]; /* User command that was responsible */
-+};
-+#define NBPG 4096
-+#define UPAGES 1
-+#define HOST_TEXT_START_ADDR (u.start_code)
-+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-+
-+#endif
- /* Copyright (C) 2008 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
diff --git a/patches/glibc/ports-2.10.1/340-dl_execstack-PaX-support.patch b/patches/glibc/ports-2.10.1/340-dl_execstack-PaX-support.patch
deleted file mode 100644
index 21a9759..0000000
--- a/patches/glibc/ports-2.10.1/340-dl_execstack-PaX-support.patch
+++ /dev/null
@@ -1,66 +0,0 @@
- With latest versions of glibc, a lot of apps failed on a PaX enabled
- system with:
- cannot enable executable stack as shared object requires: Permission denied
-
- This is due to PaX 'exec-protecting' the stack, and ld.so then trying
- to make the stack executable due to some libraries not containing the
- PT_GNU_STACK section. Bug #32960. <azarah@gentoo.org> (12 Nov 2003).
-
- Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
-
-diff -durN glibc-2.10.1.orig/nptl/allocatestack.c glibc-2.10.1/nptl/allocatestack.c
---- glibc-2.10.1.orig/nptl/allocatestack.c 2009-01-29 21:34:16.000000000 +0100
-+++ glibc-2.10.1/nptl/allocatestack.c 2009-11-13 00:50:33.000000000 +0100
-@@ -326,7 +326,8 @@
- # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
- #endif
- if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
-- return errno;
-+ if (errno != EACCES) /* PAX is enabled */
-+ return errno;
-
- return 0;
- }
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2.10.1/sysdeps/unix/sysv/linux/dl-execstack.c
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/dl-execstack.c 2006-01-08 09:21:15.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/dl-execstack.c 2009-11-13 00:50:33.000000000 +0100
-@@ -63,7 +63,10 @@
- else
- # endif
- {
-- result = errno;
-+ if (errno == EACCES) /* PAX is enabled */
-+ result = 0;
-+ else
-+ result = errno;
- goto out;
- }
- }
-@@ -89,7 +92,12 @@
- page -= size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
-@@ -115,7 +123,12 @@
- page += size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
diff --git a/patches/glibc/ports-2.10.1/350-pre20040117-pt_pax.patch b/patches/glibc/ports-2.10.1/350-pre20040117-pt_pax.patch
deleted file mode 100644
index 78ced36..0000000
--- a/patches/glibc/ports-2.10.1/350-pre20040117-pt_pax.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-diff -durN glibc-2.10.1.orig/elf/elf.h glibc-2.10.1/elf/elf.h
---- glibc-2.10.1.orig/elf/elf.h 2009-04-15 02:15:54.000000000 +0200
-+++ glibc-2.10.1/elf/elf.h 2009-11-13 00:50:35.000000000 +0100
-@@ -572,6 +572,7 @@
- #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
- #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
- #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
- #define PT_LOSUNW 0x6ffffffa
- #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
- #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
-@@ -585,6 +586,18 @@
- #define PF_X (1 << 0) /* Segment is executable */
- #define PF_W (1 << 1) /* Segment is writable */
- #define PF_R (1 << 2) /* Segment is readable */
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
- #define PF_MASKOS 0x0ff00000 /* OS-specific */
- #define PF_MASKPROC 0xf0000000 /* Processor-specific */
-
diff --git a/patches/glibc/ports-2.10.1/360-tests-sandbox-libdl-paths.patch b/patches/glibc/ports-2.10.1/360-tests-sandbox-libdl-paths.patch
deleted file mode 100644
index 0ac9dda..0000000
--- a/patches/glibc/ports-2.10.1/360-tests-sandbox-libdl-paths.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-when glibc runs its tests, it does so by invoking the local library loader.
-in Gentoo, we build/run inside of our "sandbox" which itself is linked against
-libdl (so that it can load libraries and pull out symbols). the trouble
-is that when you upgrade from an older glibc to the new one, often times
-internal symbols change name or abi. this is normally OK as you cannot use
-libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
-we always say "keep all of the glibc libraries from the same build". but
-when glibc runs its tests, it uses dynamic paths to point to its new local
-copies of libraries. if the test doesnt use libdl, then glibc doesnt add
-its path, and when sandbox triggers the loading of libdl, glibc does so
-from the host system system. this gets us into the case of all libraries
-are from the locally compiled version of glibc except for libdl.so.
-
-Fix by Wormo
-
-http://bugs.gentoo.org/56898
-
-diff -durN glibc-2.10.1.orig/grp/tst_fgetgrent.sh glibc-2.10.1/grp/tst_fgetgrent.sh
---- glibc-2.10.1.orig/grp/tst_fgetgrent.sh 2001-07-06 06:54:46.000000000 +0200
-+++ glibc-2.10.1/grp/tst_fgetgrent.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -24,7 +24,8 @@
- rtld_installed_name=$1; shift
-
- testout=${common_objpfx}/grp/tst_fgetgrent.out
--library_path=${common_objpfx}
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-
- result=0
-
-diff -durN glibc-2.10.1.orig/iconvdata/run-iconv-test.sh glibc-2.10.1/iconvdata/run-iconv-test.sh
---- glibc-2.10.1.orig/iconvdata/run-iconv-test.sh 2008-05-15 03:59:44.000000000 +0200
-+++ glibc-2.10.1/iconvdata/run-iconv-test.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -34,7 +34,7 @@
- export GCONV_PATH
-
- # We have to have some directories in the library path.
--LIBPATH=$codir:$codir/iconvdata
-+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
-
- # How the start the iconv(1) program.
- ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
-diff -durN glibc-2.10.1.orig/iconvdata/tst-table.sh glibc-2.10.1/iconvdata/tst-table.sh
---- glibc-2.10.1.orig/iconvdata/tst-table.sh 2002-04-24 23:39:35.000000000 +0200
-+++ glibc-2.10.1/iconvdata/tst-table.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -59,8 +59,11 @@
- irreversible=${charset}.irreversible
- fi
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # iconv in one direction.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-table-from ${charset} \
- > ${objpfx}tst-${charset}.table
-
-diff -durN glibc-2.10.1.orig/intl/tst-codeset.sh glibc-2.10.1/intl/tst-codeset.sh
---- glibc-2.10.1.orig/intl/tst-codeset.sh 2005-04-06 04:18:35.000000000 +0200
-+++ glibc-2.10.1/intl/tst-codeset.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -37,6 +37,9 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- ${common_objpfx}elf/ld.so --library-path $common_objpfx \
- ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
-
-diff -durN glibc-2.10.1.orig/intl/tst-gettext.sh glibc-2.10.1/intl/tst-gettext.sh
---- glibc-2.10.1.orig/intl/tst-gettext.sh 2004-08-15 21:28:18.000000000 +0200
-+++ glibc-2.10.1/intl/tst-gettext.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -51,9 +51,12 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
- MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2.10.1.orig/intl/tst-gettext2.sh glibc-2.10.1/intl/tst-gettext2.sh
---- glibc-2.10.1.orig/intl/tst-gettext2.sh 2005-05-04 19:54:48.000000000 +0200
-+++ glibc-2.10.1/intl/tst-gettext2.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -65,8 +65,11 @@
- LOCPATH=${objpfx}domaindir
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
- cmp ${objpfx}tst-gettext2.out - <<EOF
- String1 - Lang1: 1st string
-diff -durN glibc-2.10.1.orig/intl/tst-translit.sh glibc-2.10.1/intl/tst-translit.sh
---- glibc-2.10.1.orig/intl/tst-translit.sh 2005-05-04 19:56:10.000000000 +0200
-+++ glibc-2.10.1/intl/tst-translit.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -36,7 +36,10 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2.10.1.orig/malloc/tst-mtrace.sh glibc-2.10.1/malloc/tst-mtrace.sh
---- glibc-2.10.1.orig/malloc/tst-mtrace.sh 2005-10-15 01:40:35.000000000 +0200
-+++ glibc-2.10.1/malloc/tst-mtrace.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -24,9 +24,12 @@
- status=0
- trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
- LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${common_objpfx}malloc/tst-mtrace || status=1
-
- if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
-diff -durN glibc-2.10.1.orig/nptl/tst-tls6.sh glibc-2.10.1/nptl/tst-tls6.sh
---- glibc-2.10.1.orig/nptl/tst-tls6.sh 2003-09-03 00:02:59.000000000 +0200
-+++ glibc-2.10.1/nptl/tst-tls6.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -5,8 +5,8 @@
- rtld_installed_name=$1; shift
- logfile=$common_objpfx/nptl/tst-tls6.out
-
--# We have to find libc and nptl
--library_path=${common_objpfx}:${common_objpfx}nptl
-+# We have to find libc and nptl (also libdl in case sandbox is in use)
-+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
- tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}/nptl/tst-tls5"
-
-diff -durN glibc-2.10.1.orig/posix/globtest.sh glibc-2.10.1/posix/globtest.sh
---- glibc-2.10.1.orig/posix/globtest.sh 2008-12-06 07:05:39.000000000 +0100
-+++ glibc-2.10.1/posix/globtest.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -18,7 +18,7 @@
- esac
-
- # We have to find the libc and the NSS modules.
--library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
-+library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
-
- # Since we use `sort' we must make sure to use the same locale everywhere.
- LC_ALL=C
-diff -durN glibc-2.10.1.orig/posix/tst-getconf.sh glibc-2.10.1/posix/tst-getconf.sh
---- glibc-2.10.1.orig/posix/tst-getconf.sh 2002-09-01 13:11:25.000000000 +0200
-+++ glibc-2.10.1/posix/tst-getconf.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -10,7 +10,10 @@
- else
- rtld_installed_name=$1; shift
- runit() {
-- ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
-+
-+ # make sure libdl is also in path in case sandbox is in use
-+ library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+ ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
- }
- fi
-
-diff -durN glibc-2.10.1.orig/posix/wordexp-tst.sh glibc-2.10.1/posix/wordexp-tst.sh
---- glibc-2.10.1.orig/posix/wordexp-tst.sh 2000-10-20 18:23:30.000000000 +0200
-+++ glibc-2.10.1/posix/wordexp-tst.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -19,8 +19,11 @@
- "
- export IFS
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- failed=0
--${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
-+${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
- cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
- wordexp returned 0
diff --git a/patches/glibc/ports-2.10.1/370-fnmatch.patch b/patches/glibc/ports-2.10.1/370-fnmatch.patch
deleted file mode 100644
index 6c1f1dc..0000000
--- a/patches/glibc/ports-2.10.1/370-fnmatch.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
-
-When fnmatch detects an invalid multibyte character it should fall back to
-single byte matching, so that "*" has a chance to match such a string.
-
-Andreas.
-
-2005-04-12 Andreas Schwab <schwab@suse.de>
-
- * posix/fnmatch.c (fnmatch): If conversion to wide character
- fails fall back to single byte matching.
-
-Index: posix/fnmatch.c
-===================================================================
-
-diff -durN glibc-2.10.1.orig/posix/fnmatch.c glibc-2.10.1/posix/fnmatch.c
---- glibc-2.10.1.orig/posix/fnmatch.c 2007-07-28 22:35:00.000000000 +0200
-+++ glibc-2.10.1/posix/fnmatch.c 2009-11-13 00:50:39.000000000 +0100
-@@ -327,6 +327,7 @@
- # if HANDLE_MULTIBYTE
- if (__builtin_expect (MB_CUR_MAX, 1) != 1)
- {
-+ const char *orig_pattern = pattern;
- mbstate_t ps;
- size_t n;
- const char *p;
-@@ -382,10 +383,8 @@
- wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
- n = mbsrtowcs (wstring, &p, n + 1, &ps);
- if (__builtin_expect (n == (size_t) -1, 0))
-- /* Something wrong.
-- XXX Do we have to set `errno' to something which mbsrtows hasn't
-- already done? */
-- return -1;
-+ /* Something wrong. Fall back to single byte matching. */
-+ goto try_singlebyte;
- if (p)
- {
- memset (&ps, '\0', sizeof (ps));
-@@ -397,10 +396,8 @@
- prepare_wstring:
- n = mbsrtowcs (NULL, &string, 0, &ps);
- if (__builtin_expect (n == (size_t) -1, 0))
-- /* Something wrong.
-- XXX Do we have to set `errno' to something which mbsrtows hasn't
-- already done? */
-- return -1;
-+ /* Something wrong. Fall back to single byte matching. */
-+ goto try_singlebyte;
- wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
- assert (mbsinit (&ps));
- (void) mbsrtowcs (wstring, &string, n + 1, &ps);
-@@ -408,6 +405,9 @@
-
- return internal_fnwmatch (wpattern, wstring, wstring + n,
- flags & FNM_PERIOD, flags, NULL);
-+
-+ try_singlebyte:
-+ pattern = orig_pattern;
- }
- # endif /* mbstate_t and mbsrtowcs or _LIBC. */
-
diff --git a/patches/glibc/ports-2.10.1/380-dont-build-timezone.patch b/patches/glibc/ports-2.10.1/380-dont-build-timezone.patch
deleted file mode 100644
index c897c61..0000000
--- a/patches/glibc/ports-2.10.1/380-dont-build-timezone.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-timezone data has been split into the package sys-libs/timezone-data
-
-diff -durN glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig
---- glibc-2.10.1.orig/Makeconfig 2009-11-13 00:50:13.000000000 +0100
-+++ glibc-2.10.1/Makeconfig 2009-11-13 00:50:41.000000000 +0100
-@@ -919,7 +919,7 @@
- stdlib stdio-common libio malloc string wcsmbs time dirent \
- grp pwd posix io termios resource misc socket sysvipc gmon \
- gnulib iconv iconvdata wctype manual shadow gshadow po argp \
-- crypt nss localedata timezone rt conform debug \
-+ crypt nss localedata rt conform debug \
- $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
-
- ifndef avoid-generated
diff --git a/patches/glibc/ports-2.10.1/390-cross-compile-nptl.patch b/patches/glibc/ports-2.10.1/390-cross-compile-nptl.patch
deleted file mode 100644
index f4d96f5..0000000
--- a/patches/glibc/ports-2.10.1/390-cross-compile-nptl.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-A little hack for cross-compiling NPTL
-
-http://sourceware.org/ml/libc-alpha/2005-02/msg00043.html
-
-diff -durN glibc-2.10.1.orig/nptl/sysdeps/pthread/configure glibc-2.10.1/nptl/sysdeps/pthread/configure
---- glibc-2.10.1.orig/nptl/sysdeps/pthread/configure 2009-05-17 14:19:31.000000000 +0200
-+++ glibc-2.10.1/nptl/sysdeps/pthread/configure 2009-11-13 00:50:43.000000000 +0100
-@@ -78,6 +78,10 @@
- fi
- { echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
- echo "${ECHO_T}$libc_cv_forced_unwind" >&6; }
-+if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
-+ echo "$as_me:$LINENO: forcing libc_cv_forced_unwind = yes for cross-compile"
-+ libc_cv_forced_unwind=yes
-+fi
- if test $libc_cv_forced_unwind = yes; then
- cat >>confdefs.h <<\_ACEOF
- #define HAVE_FORCED_UNWIND 1
-@@ -141,6 +145,10 @@
- { echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
- echo "${ECHO_T}$libc_cv_c_cleanup" >&6; }
- CFLAGS="$old_CFLAGS"
-+ if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
-+ echo "$as_me:$LINENO: result: forcing libc_cv_c_cleanup = yes for cross-compile"
-+ libc_cv_c_cleanup=yes
-+ fi
- if test $libc_cv_c_cleanup = no; then
- { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5
- echo "$as_me: error: the compiler must support C cleanup handling" >&2;}
-diff -durN glibc-2.10.1.orig/nptl/sysdeps/pthread/configure.in glibc-2.10.1/nptl/sysdeps/pthread/configure.in
---- glibc-2.10.1.orig/nptl/sysdeps/pthread/configure.in 2003-12-03 07:50:01.000000000 +0100
-+++ glibc-2.10.1/nptl/sysdeps/pthread/configure.in 2009-11-13 00:50:43.000000000 +0100
-@@ -28,6 +28,9 @@
- struct _Unwind_Context *context;
- _Unwind_GetCFA (context)],
- libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
-+if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
-+ libc_cv_forced_unwind=yes
-+fi
- if test $libc_cv_forced_unwind = yes; then
- AC_DEFINE(HAVE_FORCED_UNWIND)
- dnl Check for C cleanup handling.
-@@ -41,6 +44,9 @@
- puts ("test")],
- libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
- CFLAGS="$old_CFLAGS"
-+ if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
-+ libc_cv_c_cleanup=yes
-+ fi
- if test $libc_cv_c_cleanup = no; then
- AC_MSG_ERROR([the compiler must support C cleanup handling])
- fi
diff --git a/patches/glibc/ports-2.10.1/400-alpha-xstat.patch b/patches/glibc/ports-2.10.1/400-alpha-xstat.patch
deleted file mode 100644
index d442b63..0000000
--- a/patches/glibc/ports-2.10.1/400-alpha-xstat.patch
+++ /dev/null
@@ -1,250 +0,0 @@
-http://sources.redhat.com/bugzilla/show_bug.cgi?id=1026
-http://sourceware.org/ml/libc-alpha/2005-02/msg00122.html
-
-2005-02-26 GOTO Masanori <gotom@debian.or.jp>
-
- * sysdeps/unix/sysv/linux/kernel-features.h: Define
- __ASSUME_STAT64_SYSCALL.
- * sysdeps/unix/sysv/linux/alpha/fxstat.c: Check
- __ASSUME_STAT64_SYSCALL.
- * sysdeps/unix/sysv/linux/alpha/fxstatat.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/lxstat.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/xstat.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/xstatconv.c: Don't define
- __libc_missing_axp_stat64 when it's not needed.
- * sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstat.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstat.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstat.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstat.c 2009-11-13 00:50:45.000000000 +0100
-@@ -35,27 +35,39 @@
- __fxstat (int vers, int fd, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_fstat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__fxstat)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstatat.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstatat.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstatat.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/fxstatat.c 2009-11-13 00:50:45.000000000 +0100
-@@ -65,6 +65,20 @@
- int result, errno_out;
- struct kernel_stat kst;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ if (flag & AT_SYMLINK_NOFOLLOW)
-+ result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
-+ else
-+ result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
-+
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-+ goto fail;
-+ }
-+#elif defined __NR_stat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
-@@ -79,6 +93,7 @@
- goto fail;
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/lxstat.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/lxstat.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/lxstat.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/lxstat.c 2009-11-13 00:50:45.000000000 +0100
-@@ -35,27 +35,39 @@
- __lxstat (int vers, const char *name, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_lstat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__lxstat)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstat.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstat.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstat.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstat.c 2009-11-13 00:50:45.000000000 +0100
-@@ -35,27 +35,39 @@
- __xstat (int vers, const char *name, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_stat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__xstat)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.c 2009-11-13 00:50:45.000000000 +0100
-@@ -22,9 +22,14 @@
- #include <sys/stat.h>
- #include <kernel_stat.h>
- #include <xstatconv.h>
-+#include <sys/syscall.h>
-
-
-+#ifdef __NR_stat64
-+# if __ASSUME_STAT64_SYSCALL == 0
- int __libc_missing_axp_stat64;
-+# endif
-+#endif
-
- int
- __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/xstatconv.h 2009-11-13 00:50:45.000000000 +0100
-@@ -18,7 +18,12 @@
- 02111-1307 USA. */
-
- #include <kernel-features.h>
-+#include <sys/syscall.h>
-
-+#ifdef __NR_stat64
-+# if __ASSUME_STAT64_SYSCALL == 0
- extern int __libc_missing_axp_stat64 attribute_hidden;
-+# endif
-+#endif
- extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
- attribute_hidden;
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/xstat.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/xstat.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.10.1/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/kernel-features.h 2009-05-09 08:54:20.000000000 +0200
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:50:45.000000000 +0100
-@@ -395,6 +395,11 @@
- # define __ASSUME_GETDENTS32_D_TYPE 1
- #endif
-
-+/* Starting with version 2.6.4, alpha stat64 syscalls are available. */
-+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
-+# define __ASSUME_STAT64_SYSCALL 1
-+#endif
-+
- /* Starting with version 2.5.3, the initial location returned by `brk'
- after exec is always rounded up to the next page. */
- #if __LINUX_KERNEL_VERSION >= 132355
diff --git a/patches/glibc/ports-2.10.1/410-alpha-no-page-header.patch b/patches/glibc/ports-2.10.1/410-alpha-no-page-header.patch
deleted file mode 100644
index f2397e2..0000000
--- a/patches/glibc/ports-2.10.1/410-alpha-no-page-header.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-2008-06-07 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
- from the kernel header to sys/user.h and remove the #include of
- sys/user.h.
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/user.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/user.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/user.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/user.h 2009-11-13 00:50:47.000000000 +0100
-@@ -23,7 +23,6 @@
- only. Don't read too much into it. Don't use it for anything other
- than gdb/strace unless you know what you are doing. */
-
--#include <asm/page.h>
- #include <asm/reg.h>
-
- struct user
-@@ -41,6 +40,9 @@
- char u_comm[32]; /* user command name */
- };
-
-+#define PAGE_SHIFT 13
-+#define PAGE_SIZE (1 << PAGE_SHIFT)
-+#define PAGE_MASK (~(PAGE_SIZE-1))
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/sys/user.h
diff --git a/patches/glibc/ports-2.10.1/420-alpha-no-asm-elf-header.patch b/patches/glibc/ports-2.10.1/420-alpha-no-asm-elf-header.patch
deleted file mode 100644
index bde28ad..0000000
--- a/patches/glibc/ports-2.10.1/420-alpha-no-asm-elf-header.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-03-13 Mike Frysinger <vapier@gentoo.org>
-
- * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some defines
- from alpha's asm/elf.h
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/procfs.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/procfs.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sys/procfs.h 2009-11-13 00:50:49.000000000 +0100
-@@ -29,10 +29,23 @@
- #include <sys/types.h>
- #include <sys/ucontext.h>
- #include <sys/user.h>
--#include <asm/elf.h>
-
- __BEGIN_DECLS
-
-+/*
-+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
-+ * I have no idea why that is so. For now, we just leave it at 33
-+ * (32 general regs + processor status word).
-+ */
-+#define ELF_NGREG 33
-+#define ELF_NFPREG 32
-+
-+typedef unsigned long elf_greg_t;
-+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-+
-+typedef double elf_fpreg_t;
-+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-+
- struct elf_siginfo
- {
- int si_signo; /* Signal number. */
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/sys/procfs.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
diff --git a/patches/glibc/ports-2.10.1/430-alpha-creat.patch b/patches/glibc/ports-2.10.1/430-alpha-creat.patch
deleted file mode 100644
index e80294f..0000000
--- a/patches/glibc/ports-2.10.1/430-alpha-creat.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-alpha does not have a __NR_creat
-
-http://bugs.gentoo.org/227275
-http://sourceware.org/bugzilla/show_bug.cgi?id=6650
-
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c glibc-2.10.1/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2007-11-10 20:34:26.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2009-11-13 00:50:51.000000000 +0100
-@@ -1 +1,5 @@
- /* Defined as alias for the syscall. */
-+#include <sysdep.h>
-+#ifndef __NR_creat
-+#include "../../../../../io/creat64.c"
-+#endif
diff --git a/patches/glibc/ports-2.10.1/440-alpha-cache-shape.patch b/patches/glibc/ports-2.10.1/440-alpha-cache-shape.patch
deleted file mode 100644
index 77d0753..0000000
--- a/patches/glibc/ports-2.10.1/440-alpha-cache-shape.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-older verisons of glibc would build dl-sysdep as shared-only and dl-support as
-static-only. alpha hooks in a cache variable via dl-auxv.h. newer versions of
-glibc build dl-sysdep as both shared and static which means we now have symbol
-duplication for static builds with dl-sysdep and dl-support. since dl-sysdep
-is both shared/static, there is no point in hooking dl-support anymore, so we
-can punt it.
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/dl-support.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/dl-support.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/dl-support.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/dl-support.c 2009-11-13 00:50:53.000000000 +0100
-@@ -1,2 +1,1 @@
--#include "dl-auxv.h"
- #include <elf/dl-support.c>
diff --git a/patches/glibc/ports-2.10.1/450-alpha-ptr-mangling.patch b/patches/glibc/ports-2.10.1/450-alpha-ptr-mangling.patch
deleted file mode 100644
index 5483659..0000000
--- a/patches/glibc/ports-2.10.1/450-alpha-ptr-mangling.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-http://bugs.gentoo.org/201910
-
-For every arch, PTR_MANGLE and PTR_DEMANGLE defines are in
-sysdeps/unix/sysv/linux/<arch>/sysdep.h. But for alpha this is not true. The
-defines are in sysdeps/unix/alpha/sysdep.h and unix/sysv/linux/alpha/sysdep.h
-includes the first.
-
-This is a patch that fixes the issue and let alpha build, at the expense of
-disabling MANGLING in the non PIC case, but googling showed that the issue is
-known, and that nobody really cares about it.
-
-Info from: http://sourceware.org/bugzilla/show_bug.cgi?id=5216
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h 2009-11-13 00:50:55.000000000 +0100
-@@ -397,42 +397,4 @@
- _sc_ret = _sc_0, _sc_err = _sc_19; \
- }
-
--/* Pointer mangling support. Note that tls access is slow enough that
-- we don't deoptimize things by placing the pointer check value there. */
--
--#include <stdint.h>
--
--#if defined NOT_IN_libc && defined IS_IN_rtld
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-- ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
--# define PTR_MANGLE(var) \
-- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#elif defined PIC
--# ifdef __ASSEMBLER__
--# define PTR_MANGLE(dst, src, tmp) \
-- ldq tmp, __pointer_chk_guard; \
-- xor src, tmp, dst
--# define PTR_MANGLE2(dst, src, tmp) \
-- xor src, tmp, dst
--# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
--# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
--# else
--extern uintptr_t __pointer_chk_guard attribute_relro;
--# define PTR_MANGLE(var) \
-- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
--# define PTR_DEMANGLE(var) PTR_MANGLE(var)
--# endif
--#endif
--
- #endif /* ASSEMBLER */
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h 2009-11-13 00:50:55.000000000 +0100
-@@ -98,4 +98,46 @@
- INTERNAL_SYSCALL1(name, err_out, nr, args); \
- })
-
-+/* Pointer mangling support. Note that tls access is slow enough that
-+ we don't deoptimize things by placing the pointer check value there. */
-+
-+#if defined NOT_IN_libc && defined IS_IN_rtld
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
-+ ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-+# define PTR_MANGLE(var) \
-+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#elif defined PIC
-+# ifdef __ASSEMBLER__
-+# define PTR_MANGLE(dst, src, tmp) \
-+ ldq tmp, __pointer_chk_guard; \
-+ xor src, tmp, dst
-+# define PTR_MANGLE2(dst, src, tmp) \
-+ xor src, tmp, dst
-+# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
-+# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
-+# else
-+extern uintptr_t __pointer_chk_guard attribute_relro;
-+# define PTR_MANGLE(var) \
-+ (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
-+# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-+# endif
-+#else
-+/* Pointer mangling is not yet supported for static libc on alpha. */
-+# ifndef __ASSEMBLER__
-+# define PTR_MANGLE(var) (void) (var)
-+# define PTR_DEMANGLE(var) (void) (var)
-+# endif
-+#endif
-+
- #endif /* _LINUX_ALPHA_SYSDEP_H */
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/alpha/sysdep.h glibc-2.10.1/ports/sysdeps/unix/alpha/sysdep.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/sysdep.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/sysdep.h
diff --git a/patches/glibc/ports-2.10.1/460-alpha-fix-gcc-4.1-warnings.patch b/patches/glibc/ports-2.10.1/460-alpha-fix-gcc-4.1-warnings.patch
deleted file mode 100644
index a657231..0000000
--- a/patches/glibc/ports-2.10.1/460-alpha-fix-gcc-4.1-warnings.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-2006-05-30 Falk Hueffner <falk@debian.org>
-
- * sysdeps/unix/sysv/linux/alpha/ioperm.c: force the architecture
- to ev6 in assembly code.
-
-{standard input}: Assembler messages:
-{standard input}:341: Error: macro requires $at register while noat in effect
-{standard input}:374: Error: macro requires $at register while noat in effect
-{standard input}:438: Error: macro requires $at register while noat in effect
-{standard input}:471: Error: macro requires $at register while noat in effect
-make[3]: *** [/tmp/buildd/glibc-2.3.6/build-tree/alpha-libc/misc/ioperm.o] Error 1
-
-Hrm. gcc puts .arch ev4 into the .s, and this overrides -mev6 for as.
-I cannot really think of anything better than
-
- ports/sysdeps/unix/sysv/linux/alpha/ioperm.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/ioperm.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/ioperm.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/ioperm.c 2009-11-13 00:50:57.000000000 +0100
-@@ -178,13 +178,13 @@
- static inline void
- stb_mb(unsigned char val, unsigned long addr)
- {
-- __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
-+ __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
- }
-
- static inline void
- stw_mb(unsigned short val, unsigned long addr)
- {
-- __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
-+ __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
- }
-
- static inline void
-@@ -356,7 +356,7 @@
- unsigned long int addr = dense_port_to_cpu_addr (port);
- unsigned char r;
-
-- __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
-+ __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
- return r;
- }
-
-@@ -366,7 +366,7 @@
- unsigned long int addr = dense_port_to_cpu_addr (port);
- unsigned short r;
-
-- __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
-+ __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
- return r;
- }
-
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c
diff --git a/patches/glibc/ports-2.10.1/470-alpha-floor_ceil_fix.patch b/patches/glibc/ports-2.10.1/470-alpha-floor_ceil_fix.patch
deleted file mode 100644
index 571e1fb..0000000
--- a/patches/glibc/ports-2.10.1/470-alpha-floor_ceil_fix.patch
+++ /dev/null
@@ -1,270 +0,0 @@
-http://sources.redhat.com/bugzilla/show_bug.cgi?id=5350
-https://bugs.gentoo.org/264335
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceil.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceil.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceil.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceil.c 2009-11-13 00:50:59.000000000 +0100
-@@ -27,20 +27,25 @@
- double
- __ceil (double x)
- {
-- double two52 = copysign (0x1.0p52, x);
-- double r, tmp;
--
-- __asm (
-+ if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
-+ {
-+ double tmp1, new_x;
-+
-+ new_x = -x;
-+ __asm (
- #ifdef _IEEE_FP_INEXACT
-- "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
-+ "cvttq/svim %2,%1\n\t"
- #else
-- "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
-+ "cvttq/svm %2,%1\n\t"
- #endif
-- : "=&f"(r), "=&f"(tmp)
-- : "f"(-x), "f"(-two52));
-+ "cvtqt/m %1,%0\n\t"
-+ : "=f"(new_x), "=&f"(tmp1)
-+ : "f"(new_x));
-
-- /* Fix up the negation we did above, as well as handling -0 properly. */
-- return copysign (r, x);
-+ /* Fix up the negation we did above, as well as handling -0 properly. */
-+ x = copysign(new_x, x);
-+ }
-+ return x;
- }
-
- weak_alias (__ceil, ceil)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceilf.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceilf.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceilf.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_ceilf.c 2009-11-13 00:50:59.000000000 +0100
-@@ -26,20 +26,30 @@
- float
- __ceilf (float x)
- {
-- float two23 = copysignf (0x1.0p23, x);
-- float r, tmp;
--
-- __asm (
-+ if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
-+ {
-+ /* Note that Alpha S_Floating is stored in registers in a
-+ restricted T_Floating format, so we don't even need to
-+ convert back to S_Floating in the end. The initial
-+ conversion to T_Floating is needed to handle denormals. */
-+
-+ float tmp1, tmp2, new_x;
-+
-+ new_x = -x;
-+ __asm ("cvtst/s %3,%2\n\t"
- #ifdef _IEEE_FP_INEXACT
-- "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
-+ "cvttq/svim %2,%1\n\t"
- #else
-- "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
-+ "cvttq/svm %2,%1\n\t"
- #endif
-- : "=&f"(r), "=&f"(tmp)
-- : "f"(-x), "f"(-two23));
-+ "cvtqt/m %1,%0\n\t"
-+ : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
-+ : "f"(new_x));
-
-- /* Fix up the negation we did above, as well as handling -0 properly. */
-- return copysignf (r, x);
-+ /* Fix up the negation we did above, as well as handling -0 properly. */
-+ x = copysignf(new_x, x);
-+ }
-+ return x;
- }
-
- weak_alias (__ceilf, ceilf)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floor.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floor.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floor.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floor.c 2009-11-13 00:50:59.000000000 +0100
-@@ -21,26 +21,32 @@
- #include <math_ldbl_opt.h>
-
-
--/* Use the -inf rounding mode conversion instructions to implement floor. */
-+/* Use the -inf rounding mode conversion instructions to implement
-+ floor. We note when the exponent is large enough that the value
-+ must be integral, as this avoids unpleasant integer overflows. */
-
- double
- __floor (double x)
- {
-- double two52 = copysign (0x1.0p52, x);
-- double r, tmp;
--
-- __asm (
-+ if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
-+ {
-+ double tmp1, new_x;
-+
-+ __asm (
- #ifdef _IEEE_FP_INEXACT
-- "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
-+ "cvttq/svim %2,%1\n\t"
- #else
-- "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
-+ "cvttq/svm %2,%1\n\t"
- #endif
-- : "=&f"(r), "=&f"(tmp)
-- : "f"(x), "f"(two52));
-+ "cvtqt/m %1,%0\n\t"
-+ : "=f"(new_x), "=&f"(tmp1)
-+ : "f"(x));
-
-- /* floor(-0) == -0, and in general we'll always have the same
-- sign as our input. */
-- return copysign (r, x);
-+ /* floor(-0) == -0, and in general we'll always have the same
-+ sign as our input. */
-+ x = copysign(new_x, x);
-+ }
-+ return x;
- }
-
- weak_alias (__floor, floor)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floorf.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floorf.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floorf.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_floorf.c 2009-11-13 00:50:59.000000000 +0100
-@@ -20,26 +20,37 @@
- #include <math.h>
-
-
--/* Use the -inf rounding mode conversion instructions to implement floor. */
-+/* Use the -inf rounding mode conversion instructions to implement
-+ floor. We note when the exponent is large enough that the value
-+ must be integral, as this avoids unpleasant integer overflows. */
-
- float
- __floorf (float x)
- {
-- float two23 = copysignf (0x1.0p23, x);
-- float r, tmp;
--
-- __asm (
-+ if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
-+ {
-+ /* Note that Alpha S_Floating is stored in registers in a
-+ restricted T_Floating format, so we don't even need to
-+ convert back to S_Floating in the end. The initial
-+ conversion to T_Floating is needed to handle denormals. */
-+
-+ float tmp1, tmp2, new_x;
-+
-+ __asm ("cvtst/s %3,%2\n\t"
- #ifdef _IEEE_FP_INEXACT
-- "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
-+ "cvttq/svim %2,%1\n\t"
- #else
-- "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
-+ "cvttq/svm %2,%1\n\t"
- #endif
-- : "=&f"(r), "=&f"(tmp)
-- : "f"(x), "f"(two23));
-+ "cvtqt/m %1,%0\n\t"
-+ : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
-+ : "f"(x));
-
-- /* floor(-0) == -0, and in general we'll always have the same
-- sign as our input. */
-- return copysignf (r, x);
-+ /* floor(-0) == -0, and in general we'll always have the same
-+ sign as our input. */
-+ x = copysignf(new_x, x);
-+ }
-+ return x;
- }
-
- weak_alias (__floorf, floorf)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rint.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rint.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rint.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rint.c 2009-11-13 00:50:59.000000000 +0100
-@@ -24,15 +24,24 @@
- double
- __rint (double x)
- {
-- double two52 = copysign (0x1.0p52, x);
-- double r;
--
-- r = x + two52;
-- r = r - two52;
-+ if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
-+ {
-+ double tmp1, new_x;
-+ __asm (
-+#ifdef _IEEE_FP_INEXACT
-+ "cvttq/svid %2,%1\n\t"
-+#else
-+ "cvttq/svd %2,%1\n\t"
-+#endif
-+ "cvtqt/d %1,%0\n\t"
-+ : "=f"(new_x), "=&f"(tmp1)
-+ : "f"(x));
-
-- /* rint(-0.1) == -0, and in general we'll always have the same sign
-- as our input. */
-- return copysign (r, x);
-+ /* rint(-0.1) == -0, and in general we'll always have the same
-+ sign as our input. */
-+ x = copysign(new_x, x);
-+ }
-+ return x;
- }
-
- weak_alias (__rint, rint)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rintf.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rintf.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rintf.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/fpu/s_rintf.c 2009-11-13 00:50:59.000000000 +0100
-@@ -23,15 +23,30 @@
- float
- __rintf (float x)
- {
-- float two23 = copysignf (0x1.0p23, x);
-- float r;
-+ if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
-+ {
-+ /* Note that Alpha S_Floating is stored in registers in a
-+ restricted T_Floating format, so we don't even need to
-+ convert back to S_Floating in the end. The initial
-+ conversion to T_Floating is needed to handle denormals. */
-
-- r = x + two23;
-- r = r - two23;
-+ float tmp1, tmp2, new_x;
-
-- /* rint(-0.1) == -0, and in general we'll always have the same sign
-- as our input. */
-- return copysign (r, x);
-+ __asm ("cvtst/s %3,%2\n\t"
-+#ifdef _IEEE_FP_INEXACT
-+ "cvttq/svid %2,%1\n\t"
-+#else
-+ "cvttq/svd %2,%1\n\t"
-+#endif
-+ "cvtqt/d %1,%0\n\t"
-+ : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
-+ : "f"(x));
-+
-+ /* rint(-0.1) == -0, and in general we'll always have the same
-+ sign as our input. */
-+ x = copysignf(new_x, x);
-+ }
-+ return x;
- }
-
- weak_alias (__rintf, rintf)
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/fpu/s_ceil.c glibc-2.10.1/ports/sysdeps/alpha/fpu/s_ceil.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/fpu/s_ceilf.c glibc-2.10.1/ports/sysdeps/alpha/fpu/s_ceilf.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/fpu/s_floor.c glibc-2.10.1/ports/sysdeps/alpha/fpu/s_floor.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/fpu/s_floorf.c glibc-2.10.1/ports/sysdeps/alpha/fpu/s_floorf.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/fpu/s_rint.c glibc-2.10.1/ports/sysdeps/alpha/fpu/s_rint.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/fpu/s_rintf.c glibc-2.10.1/ports/sysdeps/alpha/fpu/s_rintf.c
diff --git a/patches/glibc/ports-2.10.1/480-alpha-add-dl-procinfo-support.patch b/patches/glibc/ports-2.10.1/480-alpha-add-dl-procinfo-support.patch
deleted file mode 100644
index ccce756..0000000
--- a/patches/glibc/ports-2.10.1/480-alpha-add-dl-procinfo-support.patch
+++ /dev/null
@@ -1,170 +0,0 @@
- ports/sysdeps/alpha/dl-machine.h | 12 ++++++
- ports/sysdeps/alpha/dl-procinfo.c | 64 +++++++++++++++++++++++++++++++++++
- ports/sysdeps/alpha/dl-procinfo.h | 68 ++++++++++++++++++++++++++++++++++++++
- 3 files changed, 144 insertions(+)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h 2009-11-13 00:51:02.000000000 +0100
-@@ -249,6 +249,18 @@
- /* The alpha never uses Elf64_Rel relocations. */
- #define ELF_MACHINE_NO_REL 1
-
-+/* We define an initialization functions. This is called very early in
-+ * _dl_sysdep_start. */
-+#define DL_PLATFORM_INIT dl_platform_init ()
-+
-+static inline void __attribute__ ((unused))
-+dl_platform_init (void)
-+{
-+ if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
-+ /* Avoid an empty string which would disturb us. */
-+ GLRO(dl_platform) = NULL;
-+}
-+
- /* Fix up the instructions of a PLT entry to invoke the function
- rather than the dynamic linker. */
- static inline Elf64_Addr
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c 2009-11-13 00:51:02.000000000 +0100
-@@ -0,0 +1,64 @@
-+/* Data for Alpha version of processor capability information.
-+ Copyright (C) 2007 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2007.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* This information must be kept in sync with the _DL_PLATFORM_COUNT
-+ definitions in procinfo.h.
-+
-+ If anything should be added here check whether the size of each string
-+ is still ok with the given array size.
-+
-+ All the #ifdefs in the definitions are quite irritating but
-+ necessary if we want to avoid duplicating the information. There
-+ are three different modes:
-+
-+ - PROCINFO_DECL is defined. This means we are only interested in
-+ declarations.
-+
-+ - PROCINFO_DECL is not defined:
-+
-+ + if SHARED is defined the file is included in an array
-+ initializer. The .element = { ... } syntax is needed.
-+
-+ + if SHARED is not defined a normal array initialization is
-+ needed.
-+ */
-+
-+#ifndef PROCINFO_CLASS
-+#define PROCINFO_CLASS
-+#endif
-+
-+#if !defined PROCINFO_DECL && defined SHARED
-+ ._dl_alpha_platforms
-+#else
-+PROCINFO_CLASS const char _dl_alpha_platforms[5][5]
-+#endif
-+#ifndef PROCINFO_DECL
-+= {
-+ "ev4", "ev5", "ev56", "ev6", "ev67"
-+ }
-+#endif
-+#if !defined SHARED || defined PROCINFO_DECL
-+;
-+#else
-+,
-+#endif
-+
-+#undef PROCINFO_DECL
-+#undef PROCINFO_CLASS
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h 2009-11-13 00:51:02.000000000 +0100
-@@ -0,0 +1,68 @@
-+/* Alpha version of processor capability information handling macros.
-+ Copyright (C) 2007 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2007.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifndef _DL_PROCINFO_H
-+#define _DL_PROCINFO_H 1
-+
-+#include <ldsodefs.h>
-+
-+
-+/* Mask to filter out platforms. */
-+#define _DL_HWCAP_PLATFORM (-1ULL)
-+
-+#define _DL_PLATFORMS_COUNT 5
-+
-+static inline const char *
-+__attribute__ ((unused))
-+_dl_platform_string (int idx)
-+{
-+ return GLRO(dl_alpha_platforms)[idx];
-+};
-+
-+static inline int
-+__attribute__ ((unused, always_inline))
-+_dl_string_platform (const char *str)
-+{
-+ int i;
-+
-+ if (str != NULL)
-+ for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
-+ {
-+ if (strcmp (str, _dl_platform_string (i)) == 0)
-+ return i;
-+ }
-+ return -1;
-+};
-+
-+/* We cannot provide a general printing function. */
-+#define _dl_procinfo(word) -1
-+
-+/* There are no hardware capabilities defined. */
-+#define _dl_hwcap_string(idx) ""
-+
-+/* By default there is no important hardware capability. */
-+#define HWCAP_IMPORTANT (0)
-+
-+/* We don't have any hardware capabilities. */
-+#define _DL_HWCAP_COUNT 0
-+
-+#define _dl_string_hwcap(str) (-1)
-+
-+#endif /* dl-procinfo.h */
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-machine.h glibc-2.10.1/ports/sysdeps/alpha/dl-machine.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-procinfo.c glibc-2.10.1/ports/sysdeps/alpha/dl-procinfo.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-procinfo.h glibc-2.10.1/ports/sysdeps/alpha/dl-procinfo.h
diff --git a/patches/glibc/ports-2.10.1/490-alpha_alpha-add-fdatasync-support.patch b/patches/glibc/ports-2.10.1/490-alpha_alpha-add-fdatasync-support.patch
deleted file mode 100644
index ec8d57b..0000000
--- a/patches/glibc/ports-2.10.1/490-alpha_alpha-add-fdatasync-support.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-2009-07-25 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/kernel-features.h: define
- __ASSUME_FDATASYNC.
- * sysdeps/unix/sysv/linux/fdatasync.c: New file.
- * sysdeps/unix/sysv/linux/Makefile: compile fdatasync.c with
- -fexceptions.
- * sysdeps/unix/sysv/linux/syscalls.list: Remove fdatasync.
-
- sysdeps/unix/sysv/linux/Makefile | 1
- sysdeps/unix/sysv/linux/fdatasync.c | 69 ++++++++++++++++++++++++++++++
- sysdeps/unix/sysv/linux/kernel-features.h | 6 ++
- sysdeps/unix/sysv/linux/syscalls.list | 1
- 4 files changed, 76 insertions(+), 1 deletion(-)
-
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/Makefile glibc-2.10.1/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/Makefile 2009-03-02 17:15:13.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/Makefile 2009-11-13 00:51:04.000000000 +0100
-@@ -16,6 +16,7 @@
- setfsuid setfsgid makedev epoll_pwait signalfd \
- eventfd eventfd_read eventfd_write
-
-+CFLAGS-fdatasync.c = -fexceptions
- CFLAGS-gethostid.c = -fexceptions
-
- sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/fdatasync.c glibc-2.10.1/sysdeps/unix/sysv/linux/fdatasync.c
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/fdatasync.c 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/fdatasync.c 2009-11-13 00:51:04.000000000 +0100
-@@ -0,0 +1,69 @@
-+/* fdatasync -- synchronize at least the data part of a file with
-+ the underlying media. Linux version.
-+
-+ Copyright (C) 2007 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <errno.h>
-+#include <unistd.h>
-+
-+#include <sysdep-cancel.h>
-+#include <sys/syscall.h>
-+#include <bp-checks.h>
-+
-+#include <kernel-features.h>
-+
-+#if defined __NR_fdatasync && !defined __ASSUME_FDATASYNC
-+static int __have_no_fdatasync;
-+#endif
-+
-+static int
-+do_fdatasync (int fd)
-+{
-+#ifdef __ASSUME_FDATASYNC
-+ return INLINE_SYSCALL (fdatasync, 1, fd);
-+#elif defined __NR_fdatasync
-+ if (!__builtin_expect (__have_no_fdatasync, 0))
-+ {
-+ int result = INLINE_SYSCALL (fdatasync, 1, fd);
-+ if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
-+ return result;
-+
-+ __have_no_fdatasync = 1;
-+ }
-+#endif
-+ return INLINE_SYSCALL (fsync, 1, fd);
-+}
-+
-+int
-+__fdatasync (int fd)
-+{
-+ if (SINGLE_THREAD_P)
-+ return do_fdatasync (fd);
-+
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+
-+ int result = do_fdatasync (fd);
-+
-+ LIBC_CANCEL_RESET (oldtype);
-+
-+ return result;
-+}
-+
-+weak_alias (__fdatasync, fdatasync)
-+
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.10.1/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:50:45.000000000 +0100
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:51:04.000000000 +0100
-@@ -479,6 +479,12 @@
- # define __ASSUME_FUTEX_LOCK_PI 1
- #endif
-
-+/* Support for fsyncdata syscall was added in 2.6.22 on alpha, but it
-+ was already present in 2.0 kernels on other architectures. */
-+#if (!defined __alpha || __LINUX_KERNEL_VERSION >= 0x020616)
-+# define __ASSUME_FDATASYNC 1
-+#endif
-+
- /* Support for utimensat syscall was added in 2.6.22, on alpha and s390
- only after 2.6.22-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020616 \
-diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/syscalls.list glibc-2.10.1/sysdeps/unix/sysv/linux/syscalls.list
---- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/syscalls.list 2008-08-02 01:29:08.000000000 +0200
-+++ glibc-2.10.1/sysdeps/unix/sysv/linux/syscalls.list 2009-11-13 00:51:04.000000000 +0100
-@@ -11,7 +11,6 @@
- epoll_create1 EXTRA epoll_create1 i:i epoll_create1
- epoll_ctl EXTRA epoll_ctl i:iiip epoll_ctl
- epoll_wait EXTRA epoll_wait Ci:ipii epoll_wait
--fdatasync - fdatasync Ci:i fdatasync
- flock - flock i:ii __flock flock
- fork - fork i: __libc_fork __fork fork
- get_kernel_syms EXTRA get_kernel_syms i:p get_kernel_syms
diff --git a/patches/glibc/ports-2.10.1/500-alpha-add-getsystats-support.patch b/patches/glibc/ports-2.10.1/500-alpha-add-getsystats-support.patch
deleted file mode 100644
index a669c6d..0000000
--- a/patches/glibc/ports-2.10.1/500-alpha-add-getsystats-support.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-2009-05-16 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER):
- Change parameters and use next_line.
-
- ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c 2009-11-13 00:51:07.000000000 +0100
-@@ -20,15 +20,16 @@
-
-
- /* We need to define a special parser for /proc/cpuinfo. */
--#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \
-+#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \
- do \
- { \
- /* Find the line that contains the information about the number of \
- active cpus. We don't have to fear extremely long lines since \
- the kernel will not generate them. 8192 bytes are really enough. \
- If there is no "CPUs ..." line then we are on a UP system. */ \
-+ char *l; \
- (RESULT) = 1; \
-- while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \
-+ while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \
- if ((sscanf (BUFFER, "cpus active : %d", &(RESULT)) == 1) \
- || (sscanf (BUFFER, "CPUs probed %*d active %d", \
- &(RESULT)) == 1)) \
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c
diff --git a/patches/glibc/ports-2.10.1/510-alpha-fix-includes.patch b/patches/glibc/ports-2.10.1/510-alpha-fix-includes.patch
deleted file mode 100644
index 0004d51..0000000
--- a/patches/glibc/ports-2.10.1/510-alpha-fix-includes.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-2009-05-15 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/alpha/getdents64.c: Adjust include path.
- * sysdeps/unix/sysv/linux/alpha/nptl/fork.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c: Likewise.
- * sysdeps/unix/sysv/linux/alpha/sysconf.c: Likewise.
-
- ports/sysdeps/unix/sysv/linux/alpha/getdents64.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c | 2 +-
- ports/sysdeps/unix/sysv/linux/alpha/sysconf.c | 2 +-
- 9 files changed, 9 insertions(+), 9 deletions(-)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getdents64.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getdents64.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getdents64.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getdents64.c 2009-11-13 00:51:08.000000000 +0100
-@@ -1 +1 @@
--#include "../getdents64.c"
-+#include <sysdeps/unix/sysv/linux/getdents64.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/fork.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/fork.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/fork.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/fork.c 2009-11-13 00:51:08.000000000 +0100
-@@ -27,4 +27,4 @@
- CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
- NULL, NULL, &THREAD_SELF->tid, NULL)
-
--#include "../fork.c"
-+#include <sysdeps/unix/sysv/linux/fork.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c 2009-11-13 00:51:08.000000000 +0100
-@@ -2,4 +2,4 @@
- the acquire/release semantics of atomic_exchange_and_add. And even if
- we don't do this, we should be using atomic_full_barrier or otherwise. */
- #define __lll_rel_instr "mb"
--#include "../sem_post.c"
-+#include <nptl/sysdeps/unix/sysv/linux/sem_post.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c 2009-11-13 00:51:08.000000000 +0100
-@@ -1 +1 @@
--#include "../x86_64/timer_create.c"
-+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c 2009-11-13 00:51:08.000000000 +0100
-@@ -1 +1 @@
--#include "../x86_64/timer_delete.c"
-+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c 2009-11-13 00:51:08.000000000 +0100
-@@ -1 +1 @@
--#include "../x86_64/timer_getoverr.c"
-+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c 2009-11-13 00:51:08.000000000 +0100
-@@ -1 +1 @@
--#include "../x86_64/timer_gettime.c"
-+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c 2009-11-13 00:51:08.000000000 +0100
-@@ -1 +1 @@
--#include "../x86_64/timer_settime.c"
-+#include <nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysconf.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysconf.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysconf.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysconf.c 2009-11-13 00:51:08.000000000 +0100
-@@ -149,4 +149,4 @@
- /* Now the generic Linux version. */
- #undef __sysconf
- #define __sysconf static linux_sysconf
--#include "../sysconf.c"
-+#include <sysdeps/unix/sysv/linux/sysconf.c>
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/getdents64.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/getdents64.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/fork.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/sem_post.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_create.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_delete.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_getoverr.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_gettime.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/timer_settime.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/sysconf.c
diff --git a/patches/glibc/ports-2.10.1/520-alpha-add-futex-defines.patch b/patches/glibc/ports-2.10.1/520-alpha-add-futex-defines.patch
deleted file mode 100644
index 42e1499..0000000
--- a/patches/glibc/ports-2.10.1/520-alpha-add-futex-defines.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-2009-05-19 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h: Define
- FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
- FUTEX_BITSET_MATCH_ANY.
-
- ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h 2009-11-13 00:51:11.000000000 +0100
-@@ -37,7 +37,12 @@
- #define FUTEX_LOCK_PI 6
- #define FUTEX_UNLOCK_PI 7
- #define FUTEX_TRYLOCK_PI 8
-+#define FUTEX_WAIT_BITSET 9
-+#define FUTEX_WAKE_BITSET 10
- #define FUTEX_PRIVATE_FLAG 128
-+#define FUTEX_CLOCK_REALTIME 256
-+
-+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
-
- /* Values for 'private' parameter of locking macros. Yes, the
- definition seems to be backwards. But it is not. The bit will be
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h
diff --git a/patches/glibc/ports-2.10.1/530-alpha-fix-rtld-fPIC.patch b/patches/glibc/ports-2.10.1/530-alpha-fix-rtld-fPIC.patch
deleted file mode 100644
index 0dec6ba..0000000
--- a/patches/glibc/ports-2.10.1/530-alpha-fix-rtld-fPIC.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-2009-05-26 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/alpha/Makefile (CFLAGS-rtld.c): add $(PIC-ccflag).
-
- ports/sysdeps/alpha/Makefile | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/Makefile glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/Makefile
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/Makefile 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/Makefile 2009-11-13 00:51:13.000000000 +0100
-@@ -35,7 +35,8 @@
-
- ifeq ($(subdir),elf)
- # The ld.so startup code cannot use literals until it self-relocates.
--CFLAGS-rtld.c = -mbuild-constants
-+# It uses more than 64k for the small data area.
-+CFLAGS-rtld.c = -mbuild-constants $(PIC-ccflag)
- endif
-
- # Build everything with full IEEE math support, and with dynamic rounding;
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/Makefile glibc-2.10.1/ports/sysdeps/alpha/Makefile
diff --git a/patches/glibc/ports-2.10.1/540-alpha-fix-memchr.patch b/patches/glibc/ports-2.10.1/540-alpha-fix-memchr.patch
deleted file mode 100644
index 84999d6..0000000
--- a/patches/glibc/ports-2.10.1/540-alpha-fix-memchr.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-2009-07-27 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/alpha/memchr.S: Use prefetch load.
- * sysdeps/alpha/alphaev6/memchr.S: Likewise.
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/alphaev6/memchr.S glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/alphaev6/memchr.S
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/alphaev6/memchr.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/alphaev6/memchr.S 2009-11-13 00:51:15.000000000 +0100
-@@ -127,7 +127,7 @@
- cmpbge $31, $1, $2 # E :
- bne $2, $found_it # U :
- # At least one byte left to process.
-- ldq $1, 8($0) # L :
-+ ldq $31, 8($0) # L :
- subq $5, 1, $18 # E : U L U L
-
- addq $0, 8, $0 # E :
-@@ -143,38 +143,38 @@
- and $4, 8, $4 # E : odd number of quads?
- bne $4, $odd_quad_count # U :
- # At least three quads remain to be accessed
-- mov $1, $4 # E : L U L U : move prefetched value to correct reg
-+ nop # E : L U L U : move prefetched value to correct reg
-
- .align 4
- $unrolled_loop:
-- ldq $1, 8($0) # L : prefetch $1
-- xor $17, $4, $2 # E :
-- cmpbge $31, $2, $2 # E :
-- bne $2, $found_it # U : U L U L
-+ ldq $1, 0($0) # L : load quad
-+ xor $17, $1, $2 # E :
-+ ldq $31, 8($0) # L : prefetch next quad
-+ cmpbge $31, $2, $2 # E : U L U L
-
-+ bne $2, $found_it # U :
- addq $0, 8, $0 # E :
- nop # E :
- nop # E :
-- nop # E :
-
- $odd_quad_count:
-+ ldq $1, 0($0) # L : load quad
- xor $17, $1, $2 # E :
-- ldq $4, 8($0) # L : prefetch $4
-+ ldq $31, 8($0) # L : prefetch $4
- cmpbge $31, $2, $2 # E :
-- addq $0, 8, $6 # E :
-
-+ addq $0, 8, $6 # E :
- bne $2, $found_it # U :
- cmpult $6, $18, $6 # E :
- addq $0, 8, $0 # E :
-- nop # E :
-
- bne $6, $unrolled_loop # U :
-- mov $4, $1 # E : move prefetched value into $1
- nop # E :
- nop # E :
--
--$final: subq $5, $0, $18 # E : $18 <- number of bytes left to do
- nop # E :
-+
-+$final: ldq $1, 0($0) # L : load last quad
-+ subq $5, $0, $18 # E : $18 <- number of bytes left to do
- nop # E :
- bne $18, $last_quad # U :
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/memchr.S glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/memchr.S
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/memchr.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/memchr.S 2009-11-13 00:51:15.000000000 +0100
-@@ -119,7 +119,7 @@
-
- # At least one byte left to process.
-
-- ldq t0, 8(v0) # e0 :
-+ ldq zero, 8(v0) # e0 : prefetch next quad
- subq t4, 1, a2 # .. e1 :
- addq v0, 8, v0 #-e0 :
-
-@@ -138,19 +138,19 @@
-
- # At least three quads remain to be accessed
-
-- mov t0, t3 # e0 : move prefetched value to correct reg
--
- .align 4
- $unrolled_loop:
-- ldq t0, 8(v0) #-e0 : prefetch t0
-- xor a1, t3, t1 # .. e1 :
-- cmpbge zero, t1, t1 # e0 :
-- bne t1, $found_it # .. e1 :
-+ ldq t0, 0(v0) # e0 : load quad
-+ xor a1, t0, t1 # .. e1 :
-+ ldq zero, 8(v0) # e0 : prefetch next quad
-+ cmpbge zero, t1, t1 # .. e1:
-+ bne t1, $found_it # e0 :
-
-- addq v0, 8, v0 #-e0 :
-+ addq v0, 8, v0 # e1 :
- $odd_quad_count:
-+ ldq t0, 0(v0) # e0 : load quad
- xor a1, t0, t1 # .. e1 :
-- ldq t3, 8(v0) # e0 : prefetch t3
-+ ldq zero, 8(v0) # e0 : prefetch next quad
- cmpbge zero, t1, t1 # .. e1 :
- addq v0, 8, t5 #-e0 :
- bne t1, $found_it # .. e1 :
-@@ -159,8 +159,8 @@
- addq v0, 8, v0 # .. e1 :
- bne t5, $unrolled_loop #-e1 :
-
-- mov t3, t0 # e0 : move prefetched value into t0
--$final: subq t4, v0, a2 # .. e1 : a2 <- number of bytes left to do
-+$final: ldq t0, 0(v0) # e0 : load last quad
-+ subq t4, v0, a2 # .. e1 : a2 <- number of bytes left to do
- bne a2, $last_quad # e1 :
-
- $not_found:
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/alphaev6/memchr.S glibc-2.10.1/ports/sysdeps/alpha/alphaev6/memchr.S
-diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/memchr.S glibc-2.10.1/ports/sysdeps/alpha/memchr.S
diff --git a/patches/glibc/ports-2.10.1/550-alpha-fix-SOCK_NONBLOCK.patch b/patches/glibc/ports-2.10.1/550-alpha-fix-SOCK_NONBLOCK.patch
deleted file mode 100644
index 9a3e733..0000000
--- a/patches/glibc/ports-2.10.1/550-alpha-fix-SOCK_NONBLOCK.patch
+++ /dev/null
@@ -1,417 +0,0 @@
-2009-08-16 Aurelien Jarno <aurelien@aurel32.net>
-
- * ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h: New file based on
- the generic version, with SOCK_NONBLOCK matching the kernel value.
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h 2009-11-13 00:51:17.000000000 +0100
-@@ -0,0 +1,407 @@
-+/* System-specific socket constants and types. Linux version.
-+ Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
-+ Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifndef __BITS_SOCKET_H
-+#define __BITS_SOCKET_H
-+
-+#ifndef _SYS_SOCKET_H
-+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
-+#endif
-+
-+#define __need_size_t
-+#include <stddef.h>
-+
-+#include <sys/types.h>
-+
-+/* Type for length arguments in socket calls. */
-+#ifndef __socklen_t_defined
-+typedef __socklen_t socklen_t;
-+# define __socklen_t_defined
-+#endif
-+
-+/* Types of sockets. */
-+enum __socket_type
-+{
-+ SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
-+ byte streams. */
-+#define SOCK_STREAM SOCK_STREAM
-+ SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
-+ of fixed maximum length. */
-+#define SOCK_DGRAM SOCK_DGRAM
-+ SOCK_RAW = 3, /* Raw protocol interface. */
-+#define SOCK_RAW SOCK_RAW
-+ SOCK_RDM = 4, /* Reliably-delivered messages. */
-+#define SOCK_RDM SOCK_RDM
-+ SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
-+ datagrams of fixed maximum length. */
-+#define SOCK_SEQPACKET SOCK_SEQPACKET
-+ SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
-+#define SOCK_DCCP SOCK_DCCP
-+ SOCK_PACKET = 10, /* Linux specific way of getting packets
-+ at the dev level. For writing rarp and
-+ other similar things on the user level. */
-+#define SOCK_PACKET SOCK_PACKET
-+
-+ /* Flags to be ORed into the type parameter of socket and socketpair and
-+ used for the flags parameter of paccept. */
-+
-+ SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
-+ new descriptor(s). */
-+#define SOCK_CLOEXEC SOCK_CLOEXEC
-+#undef SOCK_NONBLOCK
-+ SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as
-+ non-blocking. */
-+#define SOCK_NONBLOCK SOCK_NONBLOCK
-+};
-+
-+/* Protocol families. */
-+#define PF_UNSPEC 0 /* Unspecified. */
-+#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
-+#define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */
-+#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
-+#define PF_INET 2 /* IP protocol family. */
-+#define PF_AX25 3 /* Amateur Radio AX.25. */
-+#define PF_IPX 4 /* Novell Internet Protocol. */
-+#define PF_APPLETALK 5 /* Appletalk DDP. */
-+#define PF_NETROM 6 /* Amateur radio NetROM. */
-+#define PF_BRIDGE 7 /* Multiprotocol bridge. */
-+#define PF_ATMPVC 8 /* ATM PVCs. */
-+#define PF_X25 9 /* Reserved for X.25 project. */
-+#define PF_INET6 10 /* IP version 6. */
-+#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
-+#define PF_DECnet 12 /* Reserved for DECnet project. */
-+#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
-+#define PF_SECURITY 14 /* Security callback pseudo AF. */
-+#define PF_KEY 15 /* PF_KEY key management API. */
-+#define PF_NETLINK 16
-+#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
-+#define PF_PACKET 17 /* Packet family. */
-+#define PF_ASH 18 /* Ash. */
-+#define PF_ECONET 19 /* Acorn Econet. */
-+#define PF_ATMSVC 20 /* ATM SVCs. */
-+#define PF_RDS 21 /* RDS sockets. */
-+#define PF_SNA 22 /* Linux SNA Project */
-+#define PF_IRDA 23 /* IRDA sockets. */
-+#define PF_PPPOX 24 /* PPPoX sockets. */
-+#define PF_WANPIPE 25 /* Wanpipe API sockets. */
-+#define PF_LLC 26 /* Linux LLC. */
-+#define PF_CAN 29 /* Controller Area Network. */
-+#define PF_TIPC 30 /* TIPC sockets. */
-+#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
-+#define PF_IUCV 32 /* IUCV sockets. */
-+#define PF_RXRPC 33 /* RxRPC sockets. */
-+#define PF_ISDN 34 /* mISDN sockets. */
-+#define PF_PHONET 35 /* Phonet sockets. */
-+#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
-+#define PF_MAX 37 /* For now.. */
-+
-+/* Address families. */
-+#define AF_UNSPEC PF_UNSPEC
-+#define AF_LOCAL PF_LOCAL
-+#define AF_UNIX PF_UNIX
-+#define AF_FILE PF_FILE
-+#define AF_INET PF_INET
-+#define AF_AX25 PF_AX25
-+#define AF_IPX PF_IPX
-+#define AF_APPLETALK PF_APPLETALK
-+#define AF_NETROM PF_NETROM
-+#define AF_BRIDGE PF_BRIDGE
-+#define AF_ATMPVC PF_ATMPVC
-+#define AF_X25 PF_X25
-+#define AF_INET6 PF_INET6
-+#define AF_ROSE PF_ROSE
-+#define AF_DECnet PF_DECnet
-+#define AF_NETBEUI PF_NETBEUI
-+#define AF_SECURITY PF_SECURITY
-+#define AF_KEY PF_KEY
-+#define AF_NETLINK PF_NETLINK
-+#define AF_ROUTE PF_ROUTE
-+#define AF_PACKET PF_PACKET
-+#define AF_ASH PF_ASH
-+#define AF_ECONET PF_ECONET
-+#define AF_ATMSVC PF_ATMSVC
-+#define AF_RDS PF_RDS
-+#define AF_SNA PF_SNA
-+#define AF_IRDA PF_IRDA
-+#define AF_PPPOX PF_PPPOX
-+#define AF_WANPIPE PF_WANPIPE
-+#define AF_LLC PF_LLC
-+#define AF_CAN PF_CAN
-+#define AF_TIPC PF_TIPC
-+#define AF_BLUETOOTH PF_BLUETOOTH
-+#define AF_IUCV PF_IUCV
-+#define AF_RXRPC PF_RXRPC
-+#define AF_ISDN PF_ISDN
-+#define AF_PHONET PF_PHONET
-+#define AF_IEEE802154 PF_IEEE802154
-+#define AF_MAX PF_MAX
-+
-+/* Socket level values. Others are defined in the appropriate headers.
-+
-+ XXX These definitions also should go into the appropriate headers as
-+ far as they are available. */
-+#define SOL_RAW 255
-+#define SOL_DECNET 261
-+#define SOL_X25 262
-+#define SOL_PACKET 263
-+#define SOL_ATM 264 /* ATM layer (cell level). */
-+#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
-+#define SOL_IRDA 266
-+
-+/* Maximum queue length specifiable by listen. */
-+#define SOMAXCONN 128
-+
-+/* Get the definition of the macro to define the common sockaddr members. */
-+#include <bits/sockaddr.h>
-+
-+/* Structure describing a generic socket address. */
-+struct sockaddr
-+ {
-+ __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
-+ char sa_data[14]; /* Address data. */
-+ };
-+
-+
-+/* Structure large enough to hold any socket address (with the historical
-+ exception of AF_UNIX). We reserve 128 bytes. */
-+#define __ss_aligntype unsigned long int
-+#define _SS_SIZE 128
-+#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
-+
-+struct sockaddr_storage
-+ {
-+ __SOCKADDR_COMMON (ss_); /* Address family, etc. */
-+ __ss_aligntype __ss_align; /* Force desired alignment. */
-+ char __ss_padding[_SS_PADSIZE];
-+ };
-+
-+
-+/* Bits in the FLAGS argument to `send', `recv', et al. */
-+enum
-+ {
-+ MSG_OOB = 0x01, /* Process out-of-band data. */
-+#define MSG_OOB MSG_OOB
-+ MSG_PEEK = 0x02, /* Peek at incoming messages. */
-+#define MSG_PEEK MSG_PEEK
-+ MSG_DONTROUTE = 0x04, /* Don't use local routing. */
-+#define MSG_DONTROUTE MSG_DONTROUTE
-+#ifdef __USE_GNU
-+ /* DECnet uses a different name. */
-+ MSG_TRYHARD = MSG_DONTROUTE,
-+# define MSG_TRYHARD MSG_DONTROUTE
-+#endif
-+ MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
-+#define MSG_CTRUNC MSG_CTRUNC
-+ MSG_PROXY = 0x10, /* Supply or ask second address. */
-+#define MSG_PROXY MSG_PROXY
-+ MSG_TRUNC = 0x20,
-+#define MSG_TRUNC MSG_TRUNC
-+ MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
-+#define MSG_DONTWAIT MSG_DONTWAIT
-+ MSG_EOR = 0x80, /* End of record. */
-+#define MSG_EOR MSG_EOR
-+ MSG_WAITALL = 0x100, /* Wait for a full request. */
-+#define MSG_WAITALL MSG_WAITALL
-+ MSG_FIN = 0x200,
-+#define MSG_FIN MSG_FIN
-+ MSG_SYN = 0x400,
-+#define MSG_SYN MSG_SYN
-+ MSG_CONFIRM = 0x800, /* Confirm path validity. */
-+#define MSG_CONFIRM MSG_CONFIRM
-+ MSG_RST = 0x1000,
-+#define MSG_RST MSG_RST
-+ MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
-+#define MSG_ERRQUEUE MSG_ERRQUEUE
-+ MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
-+#define MSG_NOSIGNAL MSG_NOSIGNAL
-+ MSG_MORE = 0x8000, /* Sender will send more. */
-+#define MSG_MORE MSG_MORE
-+
-+ MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
-+ descriptor received through
-+ SCM_RIGHTS. */
-+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
-+ };
-+
-+
-+/* Structure describing messages sent by
-+ `sendmsg' and received by `recvmsg'. */
-+struct msghdr
-+ {
-+ void *msg_name; /* Address to send to/receive from. */
-+ socklen_t msg_namelen; /* Length of address data. */
-+
-+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
-+ size_t msg_iovlen; /* Number of elements in the vector. */
-+
-+ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
-+ size_t msg_controllen; /* Ancillary data buffer length.
-+ !! The type should be socklen_t but the
-+ definition of the kernel is incompatible
-+ with this. */
-+
-+ int msg_flags; /* Flags on received message. */
-+ };
-+
-+/* Structure used for storage of ancillary data object information. */
-+struct cmsghdr
-+ {
-+ size_t cmsg_len; /* Length of data in cmsg_data plus length
-+ of cmsghdr structure.
-+ !! The type should be socklen_t but the
-+ definition of the kernel is incompatible
-+ with this. */
-+ int cmsg_level; /* Originating protocol. */
-+ int cmsg_type; /* Protocol specific type. */
-+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
-+ __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
-+#endif
-+ };
-+
-+/* Ancillary data object manipulation macros. */
-+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
-+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
-+#else
-+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
-+#endif
-+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
-+#define CMSG_FIRSTHDR(mhdr) \
-+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
-+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
-+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
-+ & (size_t) ~(sizeof (size_t) - 1))
-+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
-+ + CMSG_ALIGN (sizeof (struct cmsghdr)))
-+#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
-+
-+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
-+ struct cmsghdr *__cmsg) __THROW;
-+#ifdef __USE_EXTERN_INLINES
-+# ifndef _EXTERN_INLINE
-+# define _EXTERN_INLINE __extern_inline
-+# endif
-+_EXTERN_INLINE struct cmsghdr *
-+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
-+{
-+ if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
-+ /* The kernel header does this so there may be a reason. */
-+ return 0;
-+
-+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
-+ + CMSG_ALIGN (__cmsg->cmsg_len));
-+ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
-+ + __mhdr->msg_controllen)
-+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
-+ > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
-+ /* No more entries. */
-+ return 0;
-+ return __cmsg;
-+}
-+#endif /* Use `extern inline'. */
-+
-+/* Socket level message types. This must match the definitions in
-+ <linux/socket.h>. */
-+enum
-+ {
-+ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
-+#define SCM_RIGHTS SCM_RIGHTS
-+#ifdef __USE_GNU
-+ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
-+# define SCM_CREDENTIALS SCM_CREDENTIALS
-+#endif
-+ };
-+
-+#ifdef __USE_GNU
-+/* User visible structure for SCM_CREDENTIALS message */
-+struct ucred
-+{
-+ pid_t pid; /* PID of sending process. */
-+ uid_t uid; /* UID of sending process. */
-+ gid_t gid; /* GID of sending process. */
-+};
-+#endif
-+
-+/* Ugly workaround for unclean kernel headers. */
-+#if !defined __USE_MISC && !defined __USE_GNU
-+# ifndef FIOGETOWN
-+# define __SYS_SOCKET_H_undef_FIOGETOWN
-+# endif
-+# ifndef FIOSETOWN
-+# define __SYS_SOCKET_H_undef_FIOSETOWN
-+# endif
-+# ifndef SIOCATMARK
-+# define __SYS_SOCKET_H_undef_SIOCATMARK
-+# endif
-+# ifndef SIOCGPGRP
-+# define __SYS_SOCKET_H_undef_SIOCGPGRP
-+# endif
-+# ifndef SIOCGSTAMP
-+# define __SYS_SOCKET_H_undef_SIOCGSTAMP
-+# endif
-+# ifndef SIOCGSTAMPNS
-+# define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
-+# endif
-+# ifndef SIOCSPGRP
-+# define __SYS_SOCKET_H_undef_SIOCSPGRP
-+# endif
-+#endif
-+
-+/* Get socket manipulation related informations from kernel headers. */
-+#include <asm/socket.h>
-+
-+#if !defined __USE_MISC && !defined __USE_GNU
-+# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
-+# undef __SYS_SOCKET_H_undef_FIOGETOWN
-+# undef FIOGETOWN
-+# endif
-+# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
-+# undef __SYS_SOCKET_H_undef_FIOSETOWN
-+# undef FIOSETOWN
-+# endif
-+# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
-+# undef __SYS_SOCKET_H_undef_SIOCATMARK
-+# undef SIOCATMARK
-+# endif
-+# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
-+# undef __SYS_SOCKET_H_undef_SIOCGPGRP
-+# undef SIOCGPGRP
-+# endif
-+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
-+# undef __SYS_SOCKET_H_undef_SIOCGSTAMP
-+# undef SIOCGSTAMP
-+# endif
-+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
-+# undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
-+# undef SIOCGSTAMPNS
-+# endif
-+# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
-+# undef __SYS_SOCKET_H_undef_SIOCSPGRP
-+# undef SIOCSPGRP
-+# endif
-+#endif
-+
-+/* Structure used to manipulate the SO_LINGER option. */
-+struct linger
-+ {
-+ int l_onoff; /* Nonzero to linger on close. */
-+ int l_linger; /* Time to linger. */
-+ };
-+
-+#endif /* bits/socket.h */
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h
diff --git a/patches/glibc/ports-2.10.1/560-ppc-atomic.patch b/patches/glibc/ports-2.10.1/560-ppc-atomic.patch
deleted file mode 100644
index c44350c..0000000
--- a/patches/glibc/ports-2.10.1/560-ppc-atomic.patch
+++ /dev/null
@@ -1,415 +0,0 @@
-sniped from suse
-
-Index: sysdeps/powerpc/bits/atomic.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/powerpc/bits/atomic.h,v
-retrieving revision 1.17
-diff -u -a -p -r1.17 atomic.h
-
-diff -durN glibc-2.10.1.orig/sysdeps/powerpc/bits/atomic.h glibc-2.10.1/sysdeps/powerpc/bits/atomic.h
---- glibc-2.10.1.orig/sysdeps/powerpc/bits/atomic.h 2007-03-26 22:15:28.000000000 +0200
-+++ glibc-2.10.1/sysdeps/powerpc/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -85,14 +85,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -102,14 +102,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -118,12 +118,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -132,11 +132,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -144,12 +144,12 @@
- #define __arch_atomic_exchange_and_add_32(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stwcx. %1,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -157,12 +157,12 @@
- #define __arch_atomic_increment_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -170,27 +170,27 @@
- #define __arch_atomic_decrement_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_32(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
- " cmpwi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stwcx. %1,0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-diff -durN glibc-2.10.1.orig/sysdeps/powerpc/powerpc32/bits/atomic.h glibc-2.10.1/sysdeps/powerpc/powerpc32/bits/atomic.h
---- glibc-2.10.1.orig/sysdeps/powerpc/powerpc32/bits/atomic.h 2007-03-26 22:15:45.000000000 +0200
-+++ glibc-2.10.1/sysdeps/powerpc/powerpc32/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -60,14 +60,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-diff -durN glibc-2.10.1.orig/sysdeps/powerpc/powerpc64/bits/atomic.h glibc-2.10.1/sysdeps/powerpc/powerpc64/bits/atomic.h
---- glibc-2.10.1.orig/sysdeps/powerpc/powerpc64/bits/atomic.h 2007-03-26 22:16:03.000000000 +0200
-+++ glibc-2.10.1/sysdeps/powerpc/powerpc64/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp, __tmp2; \
- __asm __volatile (" clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -61,14 +61,14 @@
- unsigned int __tmp, __tmp2; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
- " clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_REL "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -82,14 +82,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -98,14 +98,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -115,14 +115,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -132,14 +132,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -148,12 +148,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -162,11 +162,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -174,12 +174,12 @@
- #define __arch_atomic_exchange_and_add_64(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stdcx. %1,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -187,12 +187,12 @@
- #define __arch_atomic_increment_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -200,27 +200,27 @@
- #define __arch_atomic_decrement_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_64(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
- " cmpdi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stdcx. %1,0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
diff --git a/patches/glibc/ports-2.10.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch b/patches/glibc/ports-2.10.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch
deleted file mode 100644
index f77cb8c..0000000
--- a/patches/glibc/ports-2.10.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch
+++ /dev/null
@@ -1,374 +0,0 @@
-http://yann.poupet.free.fr/ep93xx/
-Add support for the Maverick Crunch FPU on Cirrus EP93XX processor series
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/bits/endian.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/bits/endian.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/bits/endian.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/bits/endian.h 2009-11-13 00:51:22.000000000 +0100
-@@ -12,7 +12,7 @@
- /* FPA floating point units are always big-endian, irrespective of the
- CPU endianness. VFP floating point units use the same endianness
- as the rest of the system. */
--#ifdef __VFP_FP__
-+#if defined __VFP_FP__ || defined __MAVERICK__
- #define __FLOAT_WORD_ORDER __BYTE_ORDER
- #else
- #define __FLOAT_WORD_ORDER __BIG_ENDIAN
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/__longjmp.S glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/__longjmp.S
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/__longjmp.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/__longjmp.S 2009-11-13 00:51:22.000000000 +0100
-@@ -30,7 +30,33 @@
- movs r0, r1 /* get the return value in place */
- moveq r0, #1 /* can't let setjmp() return zero! */
-
-+#ifdef __MAVERICK__
-+ cfldrd mvd4, [ip], #8
-+ nop
-+ cfldrd mvd5, [ip], #8
-+ nop
-+ cfldrd mvd6, [ip], #8
-+ nop
-+ cfldrd mvd7, [ip], #8
-+ nop
-+ cfldrd mvd8, [ip], #8
-+ nop
-+ cfldrd mvd9, [ip], #8
-+ nop
-+ cfldrd mvd10, [ip], #8
-+ nop
-+ cfldrd mvd11, [ip], #8
-+ nop
-+ cfldrd mvd12, [ip], #8
-+ nop
-+ cfldrd mvd13, [ip], #8
-+ nop
-+ cfldrd mvd14, [ip], #8
-+ nop
-+ cfldrd mvd15, [ip], #8
-+#else
- lfmfd f4, 4, [ip] ! /* load the floating point regs */
-+#endif
-
- LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
- END (__longjmp)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/fenv.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/fenv.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/fenv.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/fenv.h 2009-11-13 00:51:22.000000000 +0100
-@@ -20,6 +20,45 @@
- # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
- #endif
-
-+#if defined(__MAVERICK__)
-+
-+/* Define bits representing exceptions in the FPU status word. */
-+enum
-+ {
-+ FE_INVALID = 1,
-+#define FE_INVALID FE_INVALID
-+ FE_OVERFLOW = 4,
-+#define FE_OVERFLOW FE_OVERFLOW
-+ FE_UNDERFLOW = 8,
-+#define FE_UNDERFLOW FE_UNDERFLOW
-+ FE_INEXACT = 16,
-+#define FE_INEXACT FE_INEXACT
-+ };
-+
-+/* Amount to shift by to convert an exception to a mask bit. */
-+#define FE_EXCEPT_SHIFT 5
-+
-+/* All supported exceptions. */
-+#define FE_ALL_EXCEPT \
-+ (FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
-+
-+/* IEEE rounding modes. */
-+enum
-+ {
-+ FE_TONEAREST = 0,
-+#define FE_TONEAREST FE_TONEAREST
-+ FE_TOWARDZERO = 0x400,
-+#define FE_TOWARDZERO FE_TOWARDZERO
-+ FE_DOWNWARD = 0x800,
-+#define FE_DOWNWARD FE_DOWNWARD
-+ FE_UPWARD = 0xc00,
-+#define FE_UPWARD FE_UPWARD
-+ };
-+
-+#define FE_ROUND_MASK (FE_UPWARD)
-+
-+#else /* FPA */
-+
- /* Define bits representing exceptions in the FPU status word. */
- enum
- {
-@@ -44,6 +83,8 @@
- modes exist, but you have to encode them in the actual instruction. */
- #define FE_TONEAREST 0
-
-+#endif
-+
- /* Type representing exception flags. */
- typedef unsigned long int fexcept_t;
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/setjmp.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/setjmp.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/setjmp.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/bits/setjmp.h 2009-11-13 00:51:22.000000000 +0100
-@@ -28,7 +28,11 @@
- #ifndef _ASM
- /* Jump buffer contains v1-v6, sl, fp, sp and pc. Other registers are not
- saved. */
-+#ifdef __MAVERICK__
-+typedef int __jmp_buf[34];
-+#else
- typedef int __jmp_buf[22];
- #endif
-+#endif
-
- #endif
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/fegetround.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/fegetround.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/fegetround.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/fegetround.c 2009-11-13 00:51:22.000000000 +0100
-@@ -18,9 +18,21 @@
- 02111-1307 USA. */
-
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fegetround (void)
- {
-+#if defined(__MAVERICK__)
-+
-+ unsigned long temp;
-+
-+ _FPU_GETCW (temp);
-+ return temp & FE_ROUND_MASK;
-+
-+#else /* FPA */
-+
- return FE_TONEAREST; /* Easy. :-) */
-+
-+#endif
- }
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/fesetround.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/fesetround.c
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/fesetround.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/fesetround.c 2009-11-13 00:51:22.000000000 +0100
-@@ -18,12 +18,28 @@
- 02111-1307 USA. */
-
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fesetround (int round)
- {
-+#if defined(__MAVERICK__)
-+ unsigned long temp;
-+
-+ if (round & ~FE_ROUND_MASK)
-+ return 1;
-+
-+ _FPU_GETCW (temp);
-+ temp = (temp & ~FE_ROUND_MASK) | round;
-+ _FPU_SETCW (temp);
-+ return 0;
-+
-+#else /* FPA */
-+
- /* We only support FE_TONEAREST, so there is no need for any work. */
- return (round == FE_TONEAREST)?0:1;
-+
-+#endif
- }
-
- libm_hidden_def (fesetround)
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/fpu_control.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/fpu_control.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/fpu_control.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/fpu_control.h 2009-11-13 00:51:22.000000000 +0100
-@@ -1,5 +1,6 @@
- /* FPU control word definitions. ARM version.
-- Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
-+ Copyright (C) 1996, 1997, 1998, 2000, 2005
-+ Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
-@@ -20,6 +21,79 @@
- #ifndef _FPU_CONTROL_H
- #define _FPU_CONTROL_H
-
-+#if defined(__MAVERICK__)
-+
-+/* DSPSC register: (from EP9312 User's Guide)
-+ *
-+ * bits 31..29 - DAID
-+ * bits 28..26 - HVID
-+ * bits 25..24 - RSVD
-+ * bit 23 - ISAT
-+ * bit 22 - UI
-+ * bit 21 - INT
-+ * bit 20 - AEXC
-+ * bits 19..18 - SAT
-+ * bits 17..16 - FCC
-+ * bit 15 - V
-+ * bit 14 - FWDEN
-+ * bit 13 - Invalid
-+ * bit 12 - Denorm
-+ * bits 11..10 - RM
-+ * bits 9..5 - IXE, UFE, OFE, RSVD, IOE
-+ * bits 4..0 - IX, UF, OF, RSVD, IO
-+ */
-+
-+/* masking of interrupts */
-+#define _FPU_MASK_IM (1 << 5) /* invalid operation */
-+#define _FPU_MASK_ZM 0 /* divide by zero */
-+#define _FPU_MASK_OM (1 << 7) /* overflow */
-+#define _FPU_MASK_UM (1 << 8) /* underflow */
-+#define _FPU_MASK_PM (1 << 9) /* inexact */
-+#define _FPU_MASK_DM 0 /* denormalized operation */
-+
-+#define _FPU_RESERVED 0xfffff000 /* These bits are reserved. */
-+
-+#define _FPU_DEFAULT 0x00b00000 /* Default value. */
-+#define _FPU_IEEE 0x00b003a0 /* Default + exceptions enabled. */
-+
-+/* Type of the control word. */
-+typedef unsigned int fpu_control_t;
-+
-+/* Macros for accessing the hardware control word. */
-+#define _FPU_GETCW(cw) ({ \
-+ register int __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv32sc mvdx0, dspsc\n\t" \
-+ "cfmvr64l %0, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (cw), "=r" (__t1), "=r" (__t2) \
-+ ); \
-+})
-+
-+#define _FPU_SETCW(cw) ({ \
-+ register int __t0, __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %0\n\t" \
-+ "cfmvsc32 dspsc, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (__t0), "=r" (__t1), "=r" (__t2) \
-+ : "0" (cw) \
-+ ); \
-+})
-+
-+/* Default control word set at startup. */
-+extern fpu_control_t __fpu_control;
-+
-+#else /* FPA */
-+
- /* We have a slight terminology confusion here. On the ARM, the register
- * we're interested in is actually the FPU status word - the FPU control
- * word is something different (which is implementation-defined and only
-@@ -99,4 +173,6 @@
- /* Default control word set at startup. */
- extern fpu_control_t __fpu_control;
-
-+#endif
-+
- #endif /* _FPU_CONTROL_H */
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/jmpbuf-offsets.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/jmpbuf-offsets.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/jmpbuf-offsets.h 2009-11-13 00:51:22.000000000 +0100
-@@ -17,4 +17,8 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#ifdef __MAVERICK__
-+#define __JMP_BUF_SP 32
-+#else
- #define __JMP_BUF_SP 20
-+#endif
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/setjmp.S glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/setjmp.S
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/fpu/setjmp.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/fpu/setjmp.S 2009-11-13 00:51:22.000000000 +0100
-@@ -24,11 +24,41 @@
-
- ENTRY (__sigsetjmp)
- /* Save registers */
-+#ifdef __MAVERICK__
-+ cfstrd mvd4, [r0], #8
-+ nop
-+ cfstrd mvd5, [r0], #8
-+ nop
-+ cfstrd mvd6, [r0], #8
-+ nop
-+ cfstrd mvd7, [r0], #8
-+ nop
-+ cfstrd mvd8, [r0], #8
-+ nop
-+ cfstrd mvd9, [r0], #8
-+ nop
-+ cfstrd mvd10, [r0], #8
-+ nop
-+ cfstrd mvd11, [r0], #8
-+ nop
-+ cfstrd mvd12, [r0], #8
-+ nop
-+ cfstrd mvd13, [r0], #8
-+ nop
-+ cfstrd mvd14, [r0], #8
-+ nop
-+ cfstrd mvd15, [r0], #8
-+#else
- sfmea f4, 4, [r0]!
-+#endif
- stmia r0, {v1-v6, sl, fp, sp, lr}
-
- /* Restore pointer to jmp_buf */
-+#ifdef __MAVERICK__
-+ sub r0, r0, #96
-+#else
- sub r0, r0, #48
-+#endif
-
- /* Make a tail call to __sigjmp_save; it takes the same args. */
- B PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/gccframe.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/gccframe.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/gccframe.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/gccframe.h 2009-11-13 00:51:22.000000000 +0100
-@@ -17,6 +17,10 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#ifdef __MAVERICK__
-+#define FIRST_PSEUDO_REGISTER 43
-+#else
- #define FIRST_PSEUDO_REGISTER 27
-+#endif
-
- #include <sysdeps/generic/gccframe.h>
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/gmp-mparam.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/gmp-mparam.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/arm/gmp-mparam.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/arm/gmp-mparam.h 2009-11-13 00:51:22.000000000 +0100
-@@ -29,7 +29,7 @@
- #if defined(__ARMEB__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 1
--#elif defined(__VFP_FP__)
-+#elif defined(__VFP_FP__) || defined(__MAVERICK__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 0
- #else
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/bits/endian.h glibc-2.10.1/ports/sysdeps/arm/bits/endian.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/__longjmp.S glibc-2.10.1/ports/sysdeps/arm/fpu/__longjmp.S
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/bits/fenv.h glibc-2.10.1/ports/sysdeps/arm/fpu/bits/fenv.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/bits/setjmp.h glibc-2.10.1/ports/sysdeps/arm/fpu/bits/setjmp.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/fegetround.c glibc-2.10.1/ports/sysdeps/arm/fpu/fegetround.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/fesetround.c glibc-2.10.1/ports/sysdeps/arm/fpu/fesetround.c
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/fpu_control.h glibc-2.10.1/ports/sysdeps/arm/fpu/fpu_control.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.10.1/ports/sysdeps/arm/fpu/jmpbuf-offsets.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/fpu/setjmp.S glibc-2.10.1/ports/sysdeps/arm/fpu/setjmp.S
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/gccframe.h glibc-2.10.1/ports/sysdeps/arm/gccframe.h
-diff -durN glibc-2.10.1.orig/ports/sysdeps/arm/gmp-mparam.h glibc-2.10.1/ports/sysdeps/arm/gmp-mparam.h
diff --git a/patches/glibc/ports-2.10.1/580-nptl-lowlevellock.patch b/patches/glibc/ports-2.10.1/580-nptl-lowlevellock.patch
deleted file mode 100644
index 9ab6cda..0000000
--- a/patches/glibc/ports-2.10.1/580-nptl-lowlevellock.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-fix build error on arm like on hppa:
-
-arm-unknown-linux-gnu-gcc ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -g -pipe -Wstrict-prototypes -fPIC -I../include -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/fpu -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include-fixed -isystem /usr/arm-unknown-linux-gnu/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -o /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -MD -MP -MF /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os.dt -MT /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -DNOT_IN_libc=1 -DIS_IN_rtld=1
-In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21:
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private':
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: warning: implicit declaration of function 'THREAD_GETMEM'
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'THREAD_SELF' undeclared (first use in this function)
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: (Each undeclared identifier is reported only once
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: for each function it appears in.)
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'header' undeclared (first use in this function)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-11-13 00:51:23.000000000 +0100
-@@ -25,6 +25,7 @@
- #include <atomic.h>
- #include <sysdep.h>
- #include <kernel-features.h>
-+#include <tls.h> /* Need THREAD_*, and header.*. */
-
- #define FUTEX_WAIT 0
- #define FUTEX_WAKE 1
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
diff --git a/patches/glibc/ports-2.10.1/590-sh-set-fpscr-proto.patch b/patches/glibc/ports-2.10.1/590-sh-set-fpscr-proto.patch
deleted file mode 100644
index ef8f7aa..0000000
--- a/patches/glibc/ports-2.10.1/590-sh-set-fpscr-proto.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-diff -durN glibc-2.10.1.orig/sysdeps/sh/sh4/fpu/fpu_control.h glibc-2.10.1/sysdeps/sh/sh4/fpu/fpu_control.h
---- glibc-2.10.1.orig/sysdeps/sh/sh4/fpu/fpu_control.h 2001-07-06 06:56:04.000000000 +0200
-+++ glibc-2.10.1/sysdeps/sh/sh4/fpu/fpu_control.h 2009-11-13 00:51:26.000000000 +0100
-@@ -45,6 +45,7 @@
- #define _FPU_GETCW(cw) __asm__ ("sts fpscr,%0" : "=r" (cw))
-
- #if defined __GNUC__
-+extern void __set_fpscr(unsigned long);
- #define _FPU_SETCW(cw) __set_fpscr ((cw))
- #else
- #define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw))
diff --git a/patches/glibc/ports-2.10.1/600-mips_librt-mips.patch b/patches/glibc/ports-2.10.1/600-mips_librt-mips.patch
deleted file mode 100644
index de8c858..0000000
--- a/patches/glibc/ports-2.10.1/600-mips_librt-mips.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-we kind of screwed ourselves into a corner by having the clock symbols
-exported only with the glibc-2.0 version ... this patch fixes the
-export so all new binaries built against librt will use the correct
-glibc-2.2 symbol version
-
-one day, we'll just drop this on the floor (maybe after 2006.1)
-
-diff -durN glibc-2.10.1.orig/Versions.def glibc-2.10.1/Versions.def
---- glibc-2.10.1.orig/Versions.def 2008-12-03 05:19:06.000000000 +0100
-+++ glibc-2.10.1/Versions.def 2009-11-13 00:51:27.000000000 +0100
-@@ -98,6 +98,7 @@
- GLIBC_PRIVATE
- }
- librt {
-+ GLIBC_2.0
- GLIBC_2.1
- GLIBC_2.2
- GLIBC_2.3
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/mips/Versions 2009-11-13 00:51:27.000000000 +0100
-@@ -35,3 +35,9 @@
- _test_and_set;
- }
- }
-+librt {
-+ GLIBC_2.0 {
-+ # c*
-+ clock_gettime; clock_settime;
-+ }
-+}
-diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/mips/Versions glibc-2.10.1/ports/sysdeps/unix/sysv/linux/mips/Versions
-diff -durN glibc-2.10.1.orig/sysdeps/unix/clock_gettime.c glibc-2.10.1/sysdeps/unix/clock_gettime.c
---- glibc-2.10.1.orig/sysdeps/unix/clock_gettime.c 2007-07-28 22:36:04.000000000 +0200
-+++ glibc-2.10.1/sysdeps/unix/clock_gettime.c 2009-11-13 00:51:27.000000000 +0100
-@@ -23,6 +23,7 @@
- #include <sys/time.h>
- #include <libc-internal.h>
- #include <ldsodefs.h>
-+#include <shlib-compat.h>
-
-
- #if HP_TIMING_AVAIL
-@@ -90,7 +91,7 @@
-
- /* Get current value of CLOCK and store it in TP. */
- int
--clock_gettime (clockid_t clock_id, struct timespec *tp)
-+__clock_gettime (clockid_t clock_id, struct timespec *tp)
- {
- int retval = -1;
-
-@@ -133,4 +134,10 @@
-
- return retval;
- }
--librt_hidden_def (clock_gettime)
-+versioned_symbol (librt, __clock_gettime, clock_gettime, GLIBC_2_2);
-+librt_hidden_ver (__clock_gettime, clock_gettime)
-+
-+#if defined __mips__ && defined SHARED
-+strong_alias (__clock_gettime, __mips_clock_gettime)
-+compat_symbol (librt, __mips_clock_gettime, clock_gettime, GLIBC_2_0);
-+#endif
-diff -durN glibc-2.10.1.orig/sysdeps/unix/clock_settime.c glibc-2.10.1/sysdeps/unix/clock_settime.c
---- glibc-2.10.1.orig/sysdeps/unix/clock_settime.c 2007-08-14 05:19:33.000000000 +0200
-+++ glibc-2.10.1/sysdeps/unix/clock_settime.c 2009-11-13 00:51:27.000000000 +0100
-@@ -21,6 +21,7 @@
- #include <sys/time.h>
- #include <libc-internal.h>
- #include <ldsodefs.h>
-+#include <shlib-compat.h>
-
-
- #if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME
-@@ -73,7 +74,7 @@
-
- /* Set CLOCK to value TP. */
- int
--clock_settime (clockid_t clock_id, const struct timespec *tp)
-+__clock_settime (clockid_t clock_id, const struct timespec *tp)
- {
- int retval;
-
-@@ -125,3 +126,9 @@
-
- return retval;
- }
-+versioned_symbol (librt, __clock_settime, clock_settime, GLIBC_2_2);
-+
-+#if defined __mips__ && defined SHARED
-+strong_alias (__clock_settime, __mips_clock_settime)
-+compat_symbol (librt, __mips_clock_settime, clock_settime, GLIBC_2_0);
-+#endif
diff --git a/patches/glibc/ports-2.10.1/610-fpu-cw-mips.patch b/patches/glibc/ports-2.10.1/610-fpu-cw-mips.patch
deleted file mode 100644
index 664e199..0000000
--- a/patches/glibc/ports-2.10.1/610-fpu-cw-mips.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-http://sourceware.org/ml/libc-alpha/2002-10/msg00392.html
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/mips/fpu_control.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/mips/fpu_control.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/mips/fpu_control.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/mips/fpu_control.h 2009-11-13 00:51:31.000000000 +0100
-@@ -86,7 +86,7 @@
- #define _FPU_RC_UP 0x2
- #define _FPU_RC_DOWN 0x3
-
--#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */
-+#define _FPU_RESERVED 0xfebc0000 /* Reserved bits in cw */
-
-
- /* The fdlibm code requires strict IEEE double precision arithmetic,
-diff -durN glibc-2.10.1.orig/ports/sysdeps/mips/fpu_control.h glibc-2.10.1/ports/sysdeps/mips/fpu_control.h
diff --git a/patches/glibc/ports-2.10.1/620-r10k-workarounds.patch b/patches/glibc/ports-2.10.1/620-r10k-workarounds.patch
deleted file mode 100644
index 42a431f..0000000
--- a/patches/glibc/ports-2.10.1/620-r10k-workarounds.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-ripped from Debian
-
-the R10000 needs an LL/SC Workaround. If not applied all R10k before
-rev 3.0 misbehave on atomic ops and rev 2.6 and lower (e.g. SGI IP28)
-die after very few seconds with a deadlock due to even more erratas.
-
- ports/sysdeps/mips/bits/atomic.h | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/mips/bits/atomic.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/mips/bits/atomic.h
---- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/mips/bits/atomic.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/mips/bits/atomic.h 2009-11-13 00:51:34.000000000 +0100
-@@ -74,7 +74,7 @@
- "bne %0,%2,2f\n\t" \
- "move %1,%3\n\t" \
- "sc %1,%4\n\t" \
-- "beqz %1,1b\n" \
-+ "beqzl %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
-@@ -98,7 +98,7 @@
- "bne %0,%2,2f\n\t" \
- "move %1,%3\n\t" \
- "scd %1,%4\n\t" \
-- "beqz %1,1b\n" \
-+ "beqzl %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
-@@ -192,7 +192,7 @@
- "ll %0,%3\n\t" \
- "move %1,%2\n\t" \
- "sc %1,%3\n\t" \
-- "beqz %1,1b\n" \
-+ "beqzl %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
-@@ -216,7 +216,7 @@
- "lld %0,%3\n\t" \
- "move %1,%2\n\t" \
- "scd %1,%3\n\t" \
-- "beqz %1,1b\n" \
-+ "beqzl %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
-@@ -251,7 +251,7 @@
- "ll %0,%3\n\t" \
- "addu %1,%0,%2\n\t" \
- "sc %1,%3\n\t" \
-- "beqz %1,1b\n" \
-+ "beqzl %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
-@@ -275,7 +275,7 @@
- "lld %0,%3\n\t" \
- "daddu %1,%0,%2\n\t" \
- "scd %1,%3\n\t" \
-- "beqz %1,1b\n" \
-+ "beqzl %1,1b\n" \
- acq "\n\t" \
- ".set pop\n" \
- "2:\n\t" \
-diff -durN glibc-2.10.1.orig/ports/sysdeps/mips/bits/atomic.h glibc-2.10.1/ports/sysdeps/mips/bits/atomic.h
diff --git a/patches/glibc/ports-2.10.1/630-mips_shn_undef-hack.patch b/patches/glibc/ports-2.10.1/630-mips_shn_undef-hack.patch
deleted file mode 100644
index 13f0ee8..0000000
--- a/patches/glibc/ports-2.10.1/630-mips_shn_undef-hack.patch
+++ /dev/null
@@ -1,24 +0,0 @@
- Hack from Debian to hopefully get sandbox working on mips
-
-<`Kumba> ths: given the SHN_UNDEF thing is a hack, what's the preferred solution?
-<ths> For fakeroot the simplest trigger is "fakeroot file /bin/ls".
-<ths> `Kumba: I haven't found a better one yet.
-<ths> Probably marker symbols around the stub section, and then exclude it from the link map.
-<ths> This needs a ld change.
-
-diff -durN glibc-2.10.1.orig/elf/do-lookup.h glibc-2.10.1/elf/do-lookup.h
---- glibc-2.10.1.orig/elf/do-lookup.h 2009-03-30 23:14:32.000000000 +0200
-+++ glibc-2.10.1/elf/do-lookup.h 2009-11-13 00:51:36.000000000 +0100
-@@ -248,6 +248,12 @@
- }
- /* FALLTHROUGH */
- case STB_GLOBAL:
-+#ifdef __mips__
-+ /* HACK: MIPS marks its lazy evaluation stubs with SHN_UNDEF
-+ symbols, we skip them. */
-+ if (sym->st_shndx == SHN_UNDEF)
-+ break;
-+#endif
- /* Global definition. Just what we need. */
- result->s = sym;
- result->m = (struct link_map *) map;
diff --git a/patches/glibc/ports-2.10.1/640-alpha-atfcts.patch b/patches/glibc/ports-2.10.1/640-alpha-atfcts.patch
deleted file mode 100644
index 83adbce..0000000
--- a/patches/glibc/ports-2.10.1/640-alpha-atfcts.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h 2007-08-14 06:21:09.000000000 +0300
-+++ glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h.new 2008-07-23 07:05:20.000000000 +0300
-@@ -454,8 +454,7 @@
- and on Alpha just after 2.6.22-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020611 \
- && ((!defined __sh__ && !defined __alpha__) \
-- || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
-- || (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
-+ || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__))
- # define __ASSUME_ATFCTS 1
- #endif
-
diff --git a/patches/glibc/ports-2.10.1/650-syslog.patch b/patches/glibc/ports-2.10.1/650-syslog.patch
deleted file mode 100644
index c20cafc..0000000
--- a/patches/glibc/ports-2.10.1/650-syslog.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN glibc-cvs-2.9.orig/misc/syslog.c glibc-cvs-2.9/misc/syslog.c
---- glibc-cvs-2.9.orig/misc/syslog.c 2009-06-01 10:16:50.000000000 +0200
-+++ glibc-cvs-2.9/misc/syslog.c 2009-06-01 10:17:20.000000000 +0200
-@@ -152,7 +152,7 @@
- #define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
- /* Check for invalid bits. */
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
-- syslog(INTERNALLOG,
-+ __syslog(INTERNALLOG,
- "syslog: unknown facility/priority: %x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
diff --git a/patches/glibc/ports-2.10.1/660-debug-readlink_chk-readklinkat_chk.patch b/patches/glibc/ports-2.10.1/660-debug-readlink_chk-readklinkat_chk.patch
deleted file mode 100644
index a5a7052..0000000
--- a/patches/glibc/ports-2.10.1/660-debug-readlink_chk-readklinkat_chk.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur glibc-cvs-2.9.orig/debug/readlink_chk.c glibc-cvs-2.9/debug/readlink_chk.c
---- glibc-cvs-2.9.orig/debug/readlink_chk.c 2005-03-01 01:41:15.000000000 +0100
-+++ glibc-cvs-2.9/debug/readlink_chk.c 2009-06-01 10:59:37.000000000 +0200
-@@ -25,7 +25,7 @@
-
-
- ssize_t
--__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
-+__readlink_chk (const char *path, char *buf, size_t len, size_t buflen)
- {
- if (len > buflen)
- __chk_fail ();
-diff -dur glibc-cvs-2.9.orig/debug/readlinkat_chk.c glibc-cvs-2.9/debug/readlinkat_chk.c
---- glibc-cvs-2.9.orig/debug/readlinkat_chk.c 2006-04-24 18:56:12.000000000 +0200
-+++ glibc-cvs-2.9/debug/readlinkat_chk.c 2009-06-01 11:07:26.000000000 +0200
-@@ -21,7 +21,7 @@
-
-
- ssize_t
--__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
-+__readlinkat_chk (int fd, const char *path, char *buf, size_t len,
- size_t buflen)
- {
- if (len > buflen)
diff --git a/patches/glibc/ports-2.12.1/100-respect-env-CPPFLAGS.patch b/patches/glibc/ports-2.12.1/100-respect-env-CPPFLAGS.patch
deleted file mode 100644
index ed022be..0000000
--- a/patches/glibc/ports-2.12.1/100-respect-env-CPPFLAGS.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Respect environment CPPFLAGS when we run ./configure so we can inject
-random -D things without having to set CFLAGS/ASFLAGS
-
-diff -durN glibc-2.12.1.orig/Makeconfig glibc-2.12.1/Makeconfig
---- glibc-2.12.1.orig/Makeconfig 2009-05-09 23:57:56.000000000 +0200
-+++ glibc-2.12.1/Makeconfig 2009-11-13 00:49:41.000000000 +0100
-@@ -697,6 +697,7 @@
- $(foreach lib,$(libof-$(basename $(@F))) \
- $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
- $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-+CPPFLAGS += $(CPPFLAGS-config)
- override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
- $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
- $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
-diff -durN glibc-2.12.1.orig/config.make.in glibc-2.12.1/config.make.in
---- glibc-2.12.1.orig/config.make.in 2009-05-09 17:59:38.000000000 +0200
-+++ glibc-2.12.1/config.make.in 2009-11-13 00:49:41.000000000 +0100
-@@ -107,6 +107,7 @@
- CXX = @CXX@
- BUILD_CC = @BUILD_CC@
- CFLAGS = @CFLAGS@
-+CPPFLAGS-config = @CPPFLAGS@
- ASFLAGS-config = @ASFLAGS_config@
- AR = @AR@
- RANLIB = @RANLIB@
diff --git a/patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch b/patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch
deleted file mode 100644
index 95f5ace..0000000
--- a/patches/glibc/ports-2.12.1/120-i386-x86_64-revert-clone-cfi.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-revert cfi additions to clone on i386/x86_64 to workaround problems in
-gcc's unwinder code. this is not a bug in glibc, it triggers problems
-elsewhere. this cfi code does not gain us a whole lot anyways.
-
-http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
-
-Index: sysdeps/unix/sysv/linux/i386/clone.S
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/clone.S,v
-retrieving revision 1.27
-retrieving revision 1.26
-diff -u -p -r1.27 -r1.26
-
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2.12.1/sysdeps/unix/sysv/linux/i386/clone.S
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/i386/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/i386/clone.S 2009-11-13 00:49:45.000000000 +0100
-@@ -120,9 +120,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (eip);
- /* Note: %esi is zero. */
- movl %esi,%ebp /* terminate the stack frame */
- #ifdef RESET_PID
-@@ -155,7 +152,6 @@
- jmp L(haspid)
- .previous
- #endif
-- cfi_endproc;
-
- cfi_startproc
- PSEUDO_END (BP_SYM (__clone))
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S glibc-2.12.1/sysdeps/unix/sysv/linux/x86_64/clone.S
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/x86_64/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/x86_64/clone.S 2009-11-13 00:49:45.000000000 +0100
-@@ -89,9 +89,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (rip);
- /* Clear the frame pointer. The ABI suggests this be done, to mark
- the outermost frame obviously. */
- xorl %ebp, %ebp
-@@ -116,7 +113,6 @@
- /* Call exit with return value from function call. */
- movq %rax, %rdi
- call HIDDEN_JUMPTARGET (_exit)
-- cfi_endproc;
-
- cfi_startproc;
- PSEUDO_END (BP_SYM (__clone))
diff --git a/patches/glibc/ports-2.12.1/140-disable-ldconfig.patch b/patches/glibc/ports-2.12.1/140-disable-ldconfig.patch
deleted file mode 100644
index 43330b8..0000000
--- a/patches/glibc/ports-2.12.1/140-disable-ldconfig.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-do not bother running ldconfig on DESTDIR. it wants to write the temp cache
-file outside of the chroot. doesnt matter anyways as we wont use the cache
-results (portage will rebuild cache), so running ldconfig is simply a waste
-of time.
-
-diff -durN glibc-2.12.1.orig/Makefile glibc-2.12.1/Makefile
---- glibc-2.12.1.orig/Makefile 2009-04-23 20:23:03.000000000 +0200
-+++ glibc-2.12.1/Makefile 2009-11-13 00:49:49.000000000 +0100
-@@ -116,6 +116,7 @@
- rm -f $(symbolic-link-list)
-
- install:
-+dont-bother-with-destdir:
- -test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
- $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
- $(slibdir) $(libdir)
diff --git a/patches/glibc/ports-2.12.1/150-queue-header-updates.patch b/patches/glibc/ports-2.12.1/150-queue-header-updates.patch
deleted file mode 100644
index fe625e1..0000000
--- a/patches/glibc/ports-2.12.1/150-queue-header-updates.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-grab some updates from FreeBSD
-
-http://bugs.gentoo.org/201979
-
-diff -durN glibc-2.12.1.orig/misc/sys/queue.h glibc-2.12.1/misc/sys/queue.h
-
-diff -durN glibc-2.12.1.orig/misc/sys/queue.h glibc-2.12.1/misc/sys/queue.h
---- glibc-2.12.1.orig/misc/sys/queue.h 2008-03-05 06:50:30.000000000 +0100
-+++ glibc-2.12.1/misc/sys/queue.h 2009-11-13 00:49:51.000000000 +0100
-@@ -136,6 +136,11 @@
- (var); \
- (var) = ((var)->field.le_next))
-
-+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = LIST_FIRST((head)); \
-+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- /*
- * List access methods.
- */
-@@ -197,6 +202,16 @@
- #define SLIST_FOREACH(var, head, field) \
- for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
-
-+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = SLIST_FIRST((head)); \
-+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
-+#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
-+ for ((varp) = &SLIST_FIRST((head)); \
-+ ((var) = *(varp)) != NULL; \
-+ (varp) = &SLIST_NEXT((var), field))
-+
- /*
- * Singly-linked List access methods.
- */
-@@ -242,6 +257,12 @@
- (head)->stqh_last = &(elm)->field.stqe_next; \
- } while (/*CONSTCOND*/0)
-
-+#define STAILQ_LAST(head, type, field) \
-+ (STAILQ_EMPTY((head)) ? \
-+ NULL : \
-+ ((struct type *)(void *) \
-+ ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-+
- #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
- if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
-@@ -271,6 +292,11 @@
- (var); \
- (var) = ((var)->field.stqe_next))
-
-+#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = STAILQ_FIRST((head)); \
-+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- #define STAILQ_CONCAT(head1, head2) do { \
- if (!STAILQ_EMPTY((head2))) { \
- *(head1)->stqh_last = (head2)->stqh_first; \
-@@ -437,11 +463,21 @@
- (var); \
- (var) = ((var)->field.tqe_next))
-
-+#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = TAILQ_FIRST((head)); \
-+ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
- for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
- (var); \
- (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
-
-+#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
-+ for ((var) = TAILQ_LAST((head), headname); \
-+ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
-+ (var) = (tvar))
-+
- #define TAILQ_CONCAT(head1, head2, field) do { \
- if (!TAILQ_EMPTY(head2)) { \
- *(head1)->tqh_last = (head2)->tqh_first; \
diff --git a/patches/glibc/ports-2.12.1/160-manual-no-perl.patch b/patches/glibc/ports-2.12.1/160-manual-no-perl.patch
deleted file mode 100644
index 2eb5414..0000000
--- a/patches/glibc/ports-2.12.1/160-manual-no-perl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-If we're using a cvs snapshot which updates the source files, and
-perl isn't installed yet, then we can't regen the docs. Not a big
-deal, so just whine a little and continue on our merry way.
-
-http://bugs.gentoo.org/60132
-
-diff -durN glibc-2.12.1.orig/manual/Makefile glibc-2.12.1/manual/Makefile
---- glibc-2.12.1.orig/manual/Makefile 2006-01-08 07:43:47.000000000 +0100
-+++ glibc-2.12.1/manual/Makefile 2009-11-13 00:49:54.000000000 +0100
-@@ -104,9 +104,14 @@
- libm-err.texi: stamp-libm-err
- stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
- $(dir)/libm-test-ulps))
-+ifneq ($(PERL),no)
- pwd=`pwd`; \
- $(PERL) $< $$pwd/.. > libm-err-tmp
- $(move-if-change) libm-err-tmp libm-err.texi
-+else
-+ echo "Unable to rebuild math docs, no perl installed"
-+ touch libm-err.texi
-+endif
- touch $@
-
- # Generate Texinfo files from the C source for the example programs.
diff --git a/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch
deleted file mode 100644
index 0e05844..0000000
--- a/patches/glibc/ports-2.12.1/170-localedef-fix-trampoline.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh -e
-
-# DP: Description: Fix localedef segfault when run under exec-shield,
-# PaX or similar. (#231438, #198099)
-# DP: Dpatch Author: James Troup <james@nocrew.org>
-# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
-# DP: Upstream status: Unknown
-# DP: Status Details: Unknown
-# DP: Date: 2004-03-16
-
-if [ $# -ne 2 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
- -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-esac
-exit 0
-
-diff -durN glibc-2.12.1.orig/locale/programs/3level.h glibc-2.12.1/locale/programs/3level.h
---- glibc-2.12.1.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200
-+++ glibc-2.12.1/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100
-@@ -203,6 +203,42 @@
- }
- }
- }
-+
-+/* GCC ATM seems to do a poor job with pointers to nested functions passed
-+ to inlined functions. Help it a little bit with this hack. */
-+#define wchead_table_iterate(tp, fn) \
-+do \
-+ { \
-+ struct wchead_table *t = (tp); \
-+ uint32_t index1; \
-+ for (index1 = 0; index1 < t->level1_size; index1++) \
-+ { \
-+ uint32_t lookup1 = t->level1[index1]; \
-+ if (lookup1 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup1_shifted = lookup1 << t->q; \
-+ uint32_t index2; \
-+ for (index2 = 0; index2 < (1 << t->q); index2++) \
-+ { \
-+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
-+ if (lookup2 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup2_shifted = lookup2 << t->p; \
-+ uint32_t index3; \
-+ for (index3 = 0; index3 < (1 << t->p); index3++) \
-+ { \
-+ struct element_t *lookup3 \
-+ = t->level3[index3 + lookup2_shifted]; \
-+ if (lookup3 != NULL) \
-+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
-+ lookup3); \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } while (0)
-+
- #endif
-
- #ifndef NO_FINALIZE
diff --git a/patches/glibc/ports-2.12.1/180-resolv-dynamic.patch b/patches/glibc/ports-2.12.1/180-resolv-dynamic.patch
deleted file mode 100644
index 8f74a53..0000000
--- a/patches/glibc/ports-2.12.1/180-resolv-dynamic.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-ripped from SuSE
-
-if /etc/resolv.conf is updated, then make sure applications
-already running get the updated information.
-
-http://bugs.gentoo.org/177416
-
-diff -durN glibc-2.12.1.orig/resolv/res_libc.c glibc-2.12.1/resolv/res_libc.c
---- glibc-2.12.1.orig/resolv/res_libc.c 2009-02-07 05:27:42.000000000 +0100
-+++ glibc-2.12.1/resolv/res_libc.c 2009-11-13 00:49:59.000000000 +0100
-@@ -22,6 +22,7 @@
- #include <arpa/nameser.h>
- #include <resolv.h>
- #include <bits/libc-lock.h>
-+#include <sys/stat.h>
-
-
- /* The following bit is copied from res_data.c (where it is #ifdef'ed
-@@ -95,6 +96,20 @@
- __res_maybe_init (res_state resp, int preinit)
- {
- if (resp->options & RES_INIT) {
-+ static time_t last_mtime, last_check;
-+ time_t now;
-+ struct stat statbuf;
-+
-+ time (&now);
-+ if (now != last_check) {
-+ last_check = now;
-+ if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
-+ last_mtime = statbuf.st_mtime;
-+ atomicinclock (lock);
-+ atomicinc (__res_initstamp);
-+ atomicincunlock (lock);
-+ }
-+ }
- if (__res_initstamp != resp->_u._ext.initstamp) {
- if (resp->nscount > 0)
- __res_iclose (resp, true);
diff --git a/patches/glibc/ports-2.12.1/190-localedef-mmap.patch b/patches/glibc/ports-2.12.1/190-localedef-mmap.patch
deleted file mode 100644
index b24ed80..0000000
--- a/patches/glibc/ports-2.12.1/190-localedef-mmap.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-sniped from Debian
-http://bugs.gentoo.org/289615
-
-2009-10-27 Aurelien Jarno <aurelien@aurel32.net>
-
- * locale/programs/locarchive.c: use MMAP_SHARED to reserve memory
- used later with MMAP_FIXED | MMAP_SHARED to cope with different
- alignment restrictions.
-
-diff -durN glibc-2.12.1.orig/locale/programs/locarchive.c glibc-2.12.1/locale/programs/locarchive.c
---- glibc-2.12.1.orig/locale/programs/locarchive.c 2009-04-27 16:07:47.000000000 +0200
-+++ glibc-2.12.1/locale/programs/locarchive.c 2009-11-13 00:50:01.000000000 +0100
-@@ -134,7 +134,7 @@
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
-@@ -396,7 +396,7 @@
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
-@@ -614,7 +614,7 @@
- int xflags = 0;
- void *p;
- if (st.st_size < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
diff --git a/patches/glibc/ports-2.12.1/200-fadvise64_64.patch b/patches/glibc/ports-2.12.1/200-fadvise64_64.patch
deleted file mode 100644
index a9f10cd..0000000
--- a/patches/glibc/ports-2.12.1/200-fadvise64_64.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-ripped from Debian
-
- sysdeps/unix/sysv/linux/posix_fadvise.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2.12.1/sysdeps/unix/sysv/linux/posix_fadvise.c
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/posix_fadvise.c 2003-08-17 02:36:22.000000000 +0200
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/posix_fadvise.c 2009-11-13 00:50:03.000000000 +0100
-@@ -35,6 +35,19 @@
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
- #else
-+# ifdef __NR_fadvise64_64
-+ INTERNAL_SYSCALL_DECL (err);
-+ int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
-+ __LONG_LONG_PAIR ((long) (offset >> 31),
-+ (long) offset),
-+ __LONG_LONG_PAIR ((long) (len >> 31),
-+ (long) len),
-+ advise);
-+ if (INTERNAL_SYSCALL_ERROR_P (ret, err))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+# else
- return ENOSYS;
-+# endif
- #endif
- }
diff --git a/patches/glibc/ports-2.12.1/220-section-comments.patch b/patches/glibc/ports-2.12.1/220-section-comments.patch
deleted file mode 100644
index 4d35535..0000000
--- a/patches/glibc/ports-2.12.1/220-section-comments.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-04/msg00665.html
-
-fixes building on some architectures (like m68k/arm/cris/etc...) because
-it does the right thing
-
-diff -durN glibc-2.12.1.orig/include/libc-symbols.h glibc-2.12.1/include/libc-symbols.h
---- glibc-2.12.1.orig/include/libc-symbols.h 2009-03-14 00:51:46.000000000 +0100
-+++ glibc-2.12.1/include/libc-symbols.h 2009-11-13 00:50:07.000000000 +0100
-@@ -239,12 +239,12 @@
- # define __make_section_unallocated(section_string)
- # endif
-
--/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
-+/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
- section attributes on what looks like a comment to the assembler. */
- # ifdef HAVE_SECTION_QUOTES
--# define __sec_comment "\"\n\t#\""
-+# define __sec_comment "\"\n#APP\n\t#\""
- # else
--# define __sec_comment "\n\t#"
-+# define __sec_comment "\n#APP\n\t#"
- # endif
- # define link_warning(symbol, msg) \
- __make_section_unallocated (".gnu.warning." #symbol) \
diff --git a/patches/glibc/ports-2.12.1/230-no-inline-gmon.patch b/patches/glibc/ports-2.12.1/230-no-inline-gmon.patch
deleted file mode 100644
index 594fb79..0000000
--- a/patches/glibc/ports-2.12.1/230-no-inline-gmon.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-http://bugs.gentoo.org/196245
-http://sourceware.org/ml/libc-alpha/2006-05/msg00017.html
-
-Attached is a patch to add __attribute__ ((noinline)) to
-call_gmon_start.
-
-Without this patch, the sec script that processed initfini.s removes a
-part of inlined call_gmon_start, causing undefined label errors.
-
-This patch solves the problem by forcing gcc not to inline
-call_gmon_start with __attribute__ ((noinline)).
-
-Tested by building for arm-none-lixux-gnueabi. OK to apply?
-
-Kazu Hirata
-
-2006-05-07 Kazu Hirata &lt;kazu@codesourcery.com&gt;
-
- * sysdeps/generic/initfini.c (call_gmon_start): Add
- __attribute__ ((noinline)).
-
-Index: sysdeps/generic/initfini.c
-===================================================================
-
-diff -durN glibc-2.12.1.orig/sysdeps/generic/initfini.c glibc-2.12.1/sysdeps/generic/initfini.c
---- glibc-2.12.1.orig/sysdeps/generic/initfini.c 2007-06-17 20:02:40.000000000 +0200
-+++ glibc-2.12.1/sysdeps/generic/initfini.c 2009-11-13 00:50:09.000000000 +0100
-@@ -70,7 +70,7 @@
- /* The beginning of _init: */
- asm ("\n/*@_init_PROLOG_BEGINS*/");
-
--static void
-+static void __attribute__ ((noinline))
- call_gmon_start(void)
- {
- extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
diff --git a/patches/glibc/ports-2.12.1/240-check_native-headers.patch b/patches/glibc/ports-2.12.1/240-check_native-headers.patch
deleted file mode 100644
index de0cb5b..0000000
--- a/patches/glibc/ports-2.12.1/240-check_native-headers.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-many ports hit this warning:
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-
-snipped from suse
-
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/check_native.c glibc-2.12.1/sysdeps/unix/sysv/linux/check_native.c
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/check_native.c 2007-11-24 04:12:17.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/check_native.c 2009-11-13 00:50:11.000000000 +0100
-@@ -23,6 +23,7 @@
- #include <stddef.h>
- #include <stdint.h>
- #include <stdlib.h>
-+#include <string.h>
- #include <time.h>
- #include <unistd.h>
- #include <net/if.h>
diff --git a/patches/glibc/ports-2.12.1/250-fix-pr631.patch b/patches/glibc/ports-2.12.1/250-fix-pr631.patch
deleted file mode 100644
index af5b347..0000000
--- a/patches/glibc/ports-2.12.1/250-fix-pr631.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
-diff -durN glibc-2.12.1.orig/Makeconfig glibc-2.12.1/Makeconfig
---- glibc-2.12.1.orig/Makeconfig 2009-11-13 00:49:41.000000000 +0100
-+++ glibc-2.12.1/Makeconfig 2009-11-13 00:50:13.000000000 +0100
-@@ -531,7 +531,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
-diff -durN glibc-2.12.1.orig/elf/Makefile glibc-2.12.1/elf/Makefile
---- glibc-2.12.1.orig/elf/Makefile 2009-01-31 01:20:55.000000000 +0100
-+++ glibc-2.12.1/elf/Makefile 2009-11-13 00:50:13.000000000 +0100
-@@ -146,6 +146,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
diff --git a/patches/glibc/ports-2.12.1/260-assume-pipe2.patch b/patches/glibc/ports-2.12.1/260-assume-pipe2.patch
deleted file mode 100644
index b84f882..0000000
--- a/patches/glibc/ports-2.12.1/260-assume-pipe2.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-http://bugs.gentoo.org/250342
-http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
-
-we cant assume sock_cloexec and pipe2 are bound together as the former defines
-are found in glibc only while the latter are a combo of kernel headers and
-glibc. so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
-inside of glibc, we hit a problem. for example:
-
-#include <grp.h>
-#include <stdio.h>
-main()
-{
- getgrnam("portage");
- if (!popen("ls", "r"))
- perror("popen()");
-}
-
-getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
-__have_sock_cloexec and __have_pipe2 to true. but if glibc was built against
-older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
-stub for it. so popen() will always fail as glibc assumes pipe2() works.
-
-diff -durN glibc-2.12.1.orig/socket/have_sock_cloexec.c glibc-2.12.1/socket/have_sock_cloexec.c
---- glibc-2.12.1.orig/socket/have_sock_cloexec.c 2008-07-25 18:46:23.000000000 +0200
-+++ glibc-2.12.1/socket/have_sock_cloexec.c 2009-11-13 00:50:15.000000000 +0100
-@@ -16,9 +16,14 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#include <fcntl.h>
- #include <sys/socket.h>
- #include <kernel-features.h>
-
- #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
- int __have_sock_cloexec;
- #endif
-+
-+#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
-+int __have_pipe2;
-+#endif
diff --git a/patches/glibc/ports-2.12.1/270-china.patch b/patches/glibc/ports-2.12.1/270-china.patch
deleted file mode 100644
index 4cde1cf..0000000
--- a/patches/glibc/ports-2.12.1/270-china.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-diff -durN glibc-2.12.1.orig/localedata/locales/zh_TW glibc-2.12.1/localedata/locales/zh_TW
---- glibc-2.12.1.orig/localedata/locales/zh_TW 2004-11-01 00:42:28.000000000 +0100
-+++ glibc-2.12.1/localedata/locales/zh_TW 2009-11-13 00:50:17.000000000 +0100
-@@ -1,7 +1,7 @@
- comment_char %
- escape_char /
- %
--% Chinese language locale for Taiwan R.O.C.
-+% Chinese language locale for Taiwan
- % charmap: BIG5-CP950
- %
- % Original Author:
-@@ -17,7 +17,7 @@
- % Reference: http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
-
- LC_IDENTIFICATION
--title "Chinese locale for Taiwan R.O.C."
-+title "Chinese locale for Taiwan"
- source ""
- address ""
- contact ""
-@@ -25,7 +25,7 @@
- tel ""
- fax ""
- language "Chinese"
--territory "Taiwan R.O.C."
-+territory "Taiwan"
- revision "0.2"
- date "2000-08-02"
- %
diff --git a/patches/glibc/ports-2.12.1/280-new-valencian-locale.patch b/patches/glibc/ports-2.12.1/280-new-valencian-locale.patch
deleted file mode 100644
index 6b46b44..0000000
--- a/patches/glibc/ports-2.12.1/280-new-valencian-locale.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-http://bugs.gentoo.org/show_bug.cgi?id=131815
-http://sourceware.org/bugzilla/show_bug.cgi?id=2522
-
-diff -durN glibc-2.12.1.orig/localedata/SUPPORTED glibc-2.12.1/localedata/SUPPORTED
---- glibc-2.12.1.orig/localedata/SUPPORTED 2009-04-18 10:43:52.000000000 +0200
-+++ glibc-2.12.1/localedata/SUPPORTED 2009-11-13 00:50:20.000000000 +0100
-@@ -72,6 +72,8 @@
- ca_ES.UTF-8/UTF-8 \
- ca_ES/ISO-8859-1 \
- ca_ES@euro/ISO-8859-15 \
-+ca_ES.UTF-8@valencia/UTF-8 \
-+ca_ES@valencia/ISO-8859-15 \
- ca_FR.UTF-8/UTF-8 \
- ca_FR/ISO-8859-15 \
- ca_IT.UTF-8/UTF-8 \
-diff -durN glibc-2.12.1.orig/localedata/locales/ca_ES@valencia glibc-2.12.1/localedata/locales/ca_ES@valencia
---- glibc-2.12.1.orig/localedata/locales/ca_ES@valencia 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.12.1/localedata/locales/ca_ES@valencia 2009-11-13 00:50:20.000000000 +0100
-@@ -0,0 +1,96 @@
-+comment_char %
-+escape_char /
-+%
-+% Valencian (southern Catalan) locale for Spain with Euro
-+%
-+% Note that this locale is almost the same as ca_ES@euro. The point of having
-+% a separate locale is only for PO translations, which have a lot of social
-+% support and are very appreciated by the Valencian-speaking community.
-+%
-+% Contact: Jordi Mallach
-+% Email: jordi@gnu.org
-+% Tel:
-+% Fax:
-+% Language: ca
-+% Territory: ES
-+% Option: euro
-+% Revision: 1.0
-+% Date: 2006-04-06
-+% Application: general
-+% Users: general
-+% Repertoiremap: mnemonic,ds
-+% Charset: ISO-8859-15
-+% Distribution and use is free, also
-+% for commercial purposes.
-+
-+LC_IDENTIFICATION
-+title "Valencian (southern Catalan) locale for Spain with Euro"
-+source ""
-+address ""
-+contact "Jordi Mallach"
-+email "jordi@gnu.org"
-+tel ""
-+fax ""
-+language "Catalan"
-+territory "Spain"
-+revision "1.0"
-+date "2006-04-06"
-+%
-+category "ca_ES@valencia:2006";LC_IDENTIFICATION
-+category "ca_ES@valencia:2006";LC_CTYPE
-+category "ca_ES@valencia:2006";LC_COLLATE
-+category "ca_ES@valencia:2006";LC_MONETARY
-+category "ca_ES@valencia:2006";LC_NUMERIC
-+category "ca_ES@valencia:2006";LC_TIME
-+category "ca_ES@valencia:2006";LC_MESSAGES
-+category "ca_ES@valencia:2006";LC_PAPER
-+category "ca_ES@valencia:2006";LC_NAME
-+category "ca_ES@valencia:2006";LC_ADDRESS
-+category "ca_ES@valencia:2006";LC_TELEPHONE
-+category "ca_ES@valencia:2006";LC_MEASUREMENT
-+
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+END LC_CTYPE
-+
-+LC_COLLATE
-+copy "ca_ES"
-+END LC_COLLATE
-+
-+LC_MONETARY
-+copy "ca_ES"
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+copy "ca_ES"
-+END LC_NUMERIC
-+
-+LC_TIME
-+copy "ca_ES"
-+END LC_TIME
-+
-+LC_MESSAGES
-+copy "ca_ES"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+copy "ca_ES"
-+END LC_PAPER
-+
-+LC_NAME
-+copy "ca_ES"
-+END LC_NAME
-+
-+LC_ADDRESS
-+copy "ca_ES"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+copy "ca_ES"
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+copy "ca_ES"
-+END LC_MEASUREMENT
diff --git a/patches/glibc/ports-2.12.1/300-nscd-one-fork.patch b/patches/glibc/ports-2.12.1/300-nscd-one-fork.patch
deleted file mode 100644
index 27eae51..0000000
--- a/patches/glibc/ports-2.12.1/300-nscd-one-fork.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-only fork one to assist in stop-start-daemon assumptions about daemon behavior
-
-http://bugs.gentoo.org/190785
-
-diff -durN glibc-2.12.1.orig/nscd/nscd.c glibc-2.12.1/nscd/nscd.c
---- glibc-2.12.1.orig/nscd/nscd.c 2009-02-06 21:10:27.000000000 +0100
-+++ glibc-2.12.1/nscd/nscd.c 2009-11-13 00:50:24.000000000 +0100
-@@ -182,6 +182,9 @@
- if (pid != 0)
- exit (0);
-
-+ if (write_pid (_PATH_NSCDPID) < 0)
-+ dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
-+
- int nullfd = open (_PATH_DEVNULL, O_RDWR);
- if (nullfd != -1)
- {
-@@ -231,12 +234,6 @@
- for (i = min_close_fd; i < getdtablesize (); i++)
- close (i);
-
-- pid = fork ();
-- if (pid == -1)
-- error (EXIT_FAILURE, errno, _("cannot fork"));
-- if (pid != 0)
-- exit (0);
--
- setsid ();
-
- if (chdir ("/") != 0)
-@@ -245,9 +242,6 @@
-
- openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
-
-- if (write_pid (_PATH_NSCDPID) < 0)
-- dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
--
- if (!init_logfile ())
- dbg_log (_("Could not create log file"));
-
diff --git a/patches/glibc/ports-2.12.1/310-hppa-nptl-carlos.patch b/patches/glibc/ports-2.12.1/310-hppa-nptl-carlos.patch
deleted file mode 100644
index 947bb58..0000000
--- a/patches/glibc/ports-2.12.1/310-hppa-nptl-carlos.patch
+++ /dev/null
@@ -1,246 +0,0 @@
-
-
-diff -durN glibc-2.12.1.orig/elf/rtld.c glibc-2.12.1/elf/rtld.c
---- glibc-2.12.1.orig/elf/rtld.c 2009-04-17 02:00:08.000000000 +0200
-+++ glibc-2.12.1/elf/rtld.c 2009-11-13 00:50:26.000000000 +0100
-@@ -390,14 +390,14 @@
- know it is available. We do not have to clear the memory if we
- do not have to use the temporary bootstrap_map. Global variables
- are initialized to zero by default. */
--#ifndef DONT_USE_BOOTSTRAP_MAP
-+#if !defined DONT_USE_BOOTSTRAP_MAP
- # ifdef HAVE_BUILTIN_MEMSET
- __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
- # else
-- for (size_t cnt = 0;
-- cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
-- ++cnt)
-- bootstrap_map.l_info[cnt] = 0;
-+ /* Clear the whole bootstrap_map structure */
-+ for (char *cnt = (char *)&(bootstrap_map);
-+ cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
-+ *cnt++ = '\0');
- # endif
- # if USE___THREAD
- bootstrap_map.l_tls_modid = 0;
-diff -durN glibc-2.12.1.orig/include/atomic.h glibc-2.12.1/include/atomic.h
---- glibc-2.12.1.orig/include/atomic.h 2009-02-09 00:49:53.000000000 +0100
-+++ glibc-2.12.1/include/atomic.h 2009-11-13 00:50:26.000000000 +0100
-@@ -185,7 +185,7 @@
- __typeof (*(mem)) __atg5_value = (newvalue); \
- \
- do \
-- __atg5_oldval = *__atg5_memp; \
-+ __atg5_oldval = *(volatile __typeof (mem))__atg5_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
- __atg5_oldval), 0)); \
-@@ -206,7 +206,7 @@
- __typeof (*(mem)) __atg6_value = (value); \
- \
- do \
-- __atg6_oldval = *__atg6_memp; \
-+ __atg6_oldval = *(volatile __typeof (mem))__atg6_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
- __atg6_oldval \
-@@ -224,7 +224,7 @@
- __typeof (*(mem)) __atg7_value = (value); \
- \
- do \
-- __atg7_oldv = *__atg7_memp; \
-+ __atg7_oldv = *(volatile __typeof (mem))__atg7_memp; \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
- __atg7_oldv \
-@@ -242,7 +242,7 @@
- __typeof (mem) __atg8_memp = (mem); \
- __typeof (*(mem)) __atg8_value = (value); \
- do { \
-- __atg8_oldval = *__atg8_memp; \
-+ __atg8_oldval = *(volatile __typeof (mem))__atg8_memp; \
- if (__atg8_oldval >= __atg8_value) \
- break; \
- } while (__builtin_expect \
-@@ -259,7 +259,7 @@
- __typeof (mem) __atg9_memp = (mem); \
- __typeof (*(mem)) __atg9_value = (value); \
- do { \
-- __atg9_oldv = *__atg9_memp; \
-+ __atg9_oldv = *(volatile __typeof (mem))__atg9_memp; \
- if (__atg9_oldv >= __atg9_value) \
- break; \
- } while (__builtin_expect \
-@@ -277,7 +277,7 @@
- __typeof (mem) __atg10_memp = (mem); \
- __typeof (*(mem)) __atg10_value = (value); \
- do { \
-- __atg10_oldval = *__atg10_memp; \
-+ __atg10_oldval = *(volatile __typeof (mem))__atg10_memp; \
- if (__atg10_oldval <= __atg10_value) \
- break; \
- } while (__builtin_expect \
-@@ -361,7 +361,7 @@
- \
- do \
- { \
-- __atg11_oldval = *__atg11_memp; \
-+ __atg11_oldval = *(volatile __typeof (mem))__atg11_memp; \
- if (__builtin_expect (__atg11_oldval <= 0, 0)) \
- break; \
- } \
-@@ -400,7 +400,7 @@
- __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
- \
- do \
-- __atg14_old = (*__atg14_memp); \
-+ __atg14_old = (*(volatile __typeof (mem))__atg14_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
- __atg14_old | __atg14_mask,\
-@@ -418,7 +418,7 @@
- __typeof (*(mem)) __atg15_mask = (mask); \
- \
- do \
-- __atg15_old = (*__atg15_memp); \
-+ __atg15_old = (*(volatile __typeof (mem))__atg15_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
- __atg15_old & __atg15_mask, \
-@@ -450,7 +450,7 @@
- __typeof (*(mem)) __atg16_mask = (mask); \
- \
- do \
-- __atg16_old = (*__atg16_memp); \
-+ __atg16_old = (*(volatile __typeof (mem))__atg16_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
- __atg16_old & __atg16_mask,\
-@@ -468,7 +468,7 @@
- __typeof (*(mem)) __atg17_mask = (mask); \
- \
- do \
-- __atg17_old = (*__atg17_memp); \
-+ __atg17_old = (*(volatile __typeof (mem))__atg17_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
- __atg17_old | __atg17_mask, \
-@@ -484,7 +484,7 @@
- __typeof (*(mem)) __atg18_mask = (mask); \
- \
- do \
-- __atg18_old = (*__atg18_memp); \
-+ __atg18_old = (*(volatile __typeof (mem))__atg18_memp); \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
- __atg18_old | __atg18_mask,\
-@@ -500,7 +500,7 @@
- __typeof (*(mem)) __atg19_mask = (mask); \
- \
- do \
-- __atg19_old = (*__atg19_memp); \
-+ __atg19_old = (*(volatile __typeof (mem))__atg19_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
- __atg19_old | __atg19_mask,\
-diff -durN glibc-2.12.1.orig/nptl/Makefile glibc-2.12.1/nptl/Makefile
---- glibc-2.12.1.orig/nptl/Makefile 2008-11-12 14:38:23.000000000 +0100
-+++ glibc-2.12.1/nptl/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -264,9 +264,9 @@
- # Files which must not be linked with libpthread.
- tests-nolibpthread = tst-unload
-
--# This sets the stack resource limit to 1023kb, which is not a multiple
--# of the page size since every architecture's page size is > 1k.
--tst-oddstacklimit-ENV = ; ulimit -s 1023;
-+# This sets the stack resource limit to 8193kb, which is not a multiple
-+# of the page size since every architecture's page size is 4096 bytes.
-+tst-oddstacklimit-ENV = ; ulimit -s 8193;
-
- distribute = eintr.c tst-cleanup4aux.c
-
-@@ -425,6 +425,35 @@
- CFLAGS-tst-cleanupx4.c += -fexceptions
- CFLAGS-tst-oncex3.c += -fexceptions
- CFLAGS-tst-oncex4.c += -fexceptions
-+
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
-+LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
-+
- CFLAGS-tst-align.c += $(stack-align-test-flags)
- CFLAGS-tst-align3.c += $(stack-align-test-flags)
- CFLAGS-tst-initializers1.c = -W -Wall -Werror
-diff -durN glibc-2.12.1.orig/nptl/pthread_barrier_wait.c glibc-2.12.1/nptl/pthread_barrier_wait.c
---- glibc-2.12.1.orig/nptl/pthread_barrier_wait.c 2007-08-01 06:18:50.000000000 +0200
-+++ glibc-2.12.1/nptl/pthread_barrier_wait.c 2009-11-13 00:50:26.000000000 +0100
-@@ -64,7 +64,7 @@
- do
- lll_futex_wait (&ibarrier->curr_event, event,
- ibarrier->private ^ FUTEX_PRIVATE_FLAG);
-- while (event == ibarrier->curr_event);
-+ while (event == *(volatile unsigned int *)&ibarrier->curr_event);
- }
-
- /* Make sure the init_count is stored locally or in a register. */
-diff -durN glibc-2.12.1.orig/nptl/sysdeps/pthread/Makefile glibc-2.12.1/nptl/sysdeps/pthread/Makefile
---- glibc-2.12.1.orig/nptl/sysdeps/pthread/Makefile 2006-02-28 08:09:41.000000000 +0100
-+++ glibc-2.12.1/nptl/sysdeps/pthread/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -33,7 +33,9 @@
-
- ifeq ($(have-forced-unwind),yes)
- tests += tst-mqueue8x
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
- CFLAGS-tst-mqueue8x.c += -fexceptions
-+LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s)
- endif
- endif
-
-diff -durN glibc-2.12.1.orig/stdio-common/Makefile glibc-2.12.1/stdio-common/Makefile
---- glibc-2.12.1.orig/stdio-common/Makefile 2009-04-11 07:29:56.000000000 +0200
-+++ glibc-2.12.1/stdio-common/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -82,7 +82,7 @@
- $(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
- endif
-
--CFLAGS-vfprintf.c = -Wno-uninitialized
-+CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
- CFLAGS-vfwprintf.c = -Wno-uninitialized
- CFLAGS-tst-printf.c = -Wno-format
- CFLAGS-tstdiomisc.c = -Wno-format
-diff -durN glibc-2.12.1.orig/sunrpc/clnt_udp.c glibc-2.12.1/sunrpc/clnt_udp.c
---- glibc-2.12.1.orig/sunrpc/clnt_udp.c 2008-07-26 10:42:44.000000000 +0200
-+++ glibc-2.12.1/sunrpc/clnt_udp.c 2009-11-13 00:50:26.000000000 +0100
-@@ -456,7 +456,7 @@
- while (inlen < 0 && errno == EINTR);
- if (inlen < 0)
- {
-- if (errno == EWOULDBLOCK)
-+ if (errno == EWOULDBLOCK || errno == EAGAIN)
- continue;
- cu->cu_error.re_errno = errno;
- return (cu->cu_error.re_status = RPC_CANTRECV);
diff --git a/patches/glibc/ports-2.12.1/330-m68k-sys-user.patch b/patches/glibc/ports-2.12.1/330-m68k-sys-user.patch
deleted file mode 100644
index b441691..0000000
--- a/patches/glibc/ports-2.12.1/330-m68k-sys-user.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-copied from kernel as it is sanitized now
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/m68k/sys/user.h 2009-11-13 00:50:31.000000000 +0100
-@@ -1,3 +1,90 @@
-+#ifndef _SYS_USER_H
-+#define _SYS_USER_H
-+
-+/* Core file format: The core file is written in such a way that gdb
-+ can understand it and provide useful information to the user (under
-+ linux we use the 'trad-core' bfd). There are quite a number of
-+ obstacles to being able to view the contents of the floating point
-+ registers, and until these are solved you will not be able to view the
-+ contents of them. Actually, you can read in the core file and look at
-+ the contents of the user struct to find out what the floating point
-+ registers contain.
-+ The actual file contents are as follows:
-+ UPAGE: 1 page consisting of a user struct that tells gdb what is present
-+ in the file. Directly after this is a copy of the task_struct, which
-+ is currently not used by gdb, but it may come in useful at some point.
-+ All of the registers are stored as part of the upage. The upage should
-+ always be only one page.
-+ DATA: The data area is stored. We use current->end_text to
-+ current->brk to pick up all of the user variables, plus any memory
-+ that may have been malloced. No attempt is made to determine if a page
-+ is demand-zero or if a page is totally unused, we just cover the entire
-+ range. All of the addresses are rounded in such a way that an integral
-+ number of pages is written.
-+ STACK: We need the stack information in order to get a meaningful
-+ backtrace. We need to write the data from (esp) to
-+ current->start_stack, so we round each of these off in order to be able
-+ to write an integer number of pages.
-+ The minimum core file size is 3 pages, or 12288 bytes.
-+*/
-+
-+struct user_m68kfp_struct {
-+ unsigned long fpregs[8*3]; /* fp0-fp7 registers */
-+ unsigned long fpcntl[3]; /* fp control regs */
-+};
-+
-+/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
-+ is still the layout used by user (the new pt_regs doesn't have
-+ all registers). */
-+struct user_regs_struct {
-+ long d1,d2,d3,d4,d5,d6,d7;
-+ long a0,a1,a2,a3,a4,a5,a6;
-+ long d0;
-+ long usp;
-+ long orig_d0;
-+ short stkadj;
-+ short sr;
-+ long pc;
-+ short fmtvec;
-+ short __fill;
-+};
-+
-+
-+/* When the kernel dumps core, it starts by dumping the user struct -
-+ this will be used by gdb to figure out where the data and stack segments
-+ are within the file, and what virtual addresses to use. */
-+struct user{
-+/* We start with the registers, to mimic the way that "memory" is returned
-+ from the ptrace(3,...) function. */
-+ struct user_regs_struct regs; /* Where the registers are actually stored */
-+/* ptrace does not yet supply these. Someday.... */
-+ int u_fpvalid; /* True if math co-processor being used. */
-+ /* for this mess. Not yet used. */
-+ struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */
-+/* The rest of this junk is to help gdb figure out what goes where */
-+ unsigned long int u_tsize; /* Text segment size (pages). */
-+ unsigned long int u_dsize; /* Data segment size (pages). */
-+ unsigned long int u_ssize; /* Stack segment size (pages). */
-+ unsigned long start_code; /* Starting virtual address of text. */
-+ unsigned long start_stack; /* Starting virtual address of stack area.
-+ This is actually the bottom of the stack,
-+ the top of the stack is always found in the
-+ esp register. */
-+ long int signal; /* Signal that caused the core dump. */
-+ int reserved; /* No longer used */
-+ struct user_regs_struct *u_ar0;
-+ /* Used by gdb to help find the values for */
-+ /* the registers. */
-+ struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */
-+ unsigned long magic; /* To uniquely identify a core file */
-+ char u_comm[32]; /* User command that was responsible */
-+};
-+#define NBPG 4096
-+#define UPAGES 1
-+#define HOST_TEXT_START_ADDR (u.start_code)
-+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-+
-+#endif
- /* Copyright (C) 2008 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
-diff -durN glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.12.1/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
diff --git a/patches/glibc/ports-2.12.1/340-dl_execstack-PaX-support.patch b/patches/glibc/ports-2.12.1/340-dl_execstack-PaX-support.patch
deleted file mode 100644
index afdb39c..0000000
--- a/patches/glibc/ports-2.12.1/340-dl_execstack-PaX-support.patch
+++ /dev/null
@@ -1,66 +0,0 @@
- With latest versions of glibc, a lot of apps failed on a PaX enabled
- system with:
- cannot enable executable stack as shared object requires: Permission denied
-
- This is due to PaX 'exec-protecting' the stack, and ld.so then trying
- to make the stack executable due to some libraries not containing the
- PT_GNU_STACK section. Bug #32960. <azarah@gentoo.org> (12 Nov 2003).
-
- Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
-
-diff -durN glibc-2.12.1.orig/nptl/allocatestack.c glibc-2.12.1/nptl/allocatestack.c
---- glibc-2.12.1.orig/nptl/allocatestack.c 2009-01-29 21:34:16.000000000 +0100
-+++ glibc-2.12.1/nptl/allocatestack.c 2009-11-13 00:50:33.000000000 +0100
-@@ -329,7 +329,8 @@
- # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
- #endif
- if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
-- return errno;
-+ if (errno != EACCES) /* PAX is enabled */
-+ return errno;
-
- return 0;
- }
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2.12.1/sysdeps/unix/sysv/linux/dl-execstack.c
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/dl-execstack.c 2006-01-08 09:21:15.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/dl-execstack.c 2009-11-13 00:50:33.000000000 +0100
-@@ -63,7 +63,10 @@
- else
- # endif
- {
-- result = errno;
-+ if (errno == EACCES) /* PAX is enabled */
-+ result = 0;
-+ else
-+ result = errno;
- goto out;
- }
- }
-@@ -89,7 +92,12 @@
- page -= size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
-@@ -115,7 +123,12 @@
- page += size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
diff --git a/patches/glibc/ports-2.12.1/350-pre20040117-pt_pax.patch b/patches/glibc/ports-2.12.1/350-pre20040117-pt_pax.patch
deleted file mode 100644
index 3f03169..0000000
--- a/patches/glibc/ports-2.12.1/350-pre20040117-pt_pax.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-diff -durN glibc-2.12.1.orig/elf/elf.h glibc-2.12.1/elf/elf.h
---- glibc-2.12.1.orig/elf/elf.h 2009-04-15 02:15:54.000000000 +0200
-+++ glibc-2.12.1/elf/elf.h 2009-11-13 00:50:35.000000000 +0100
-@@ -580,6 +580,7 @@
- #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
- #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
- #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
- #define PT_LOSUNW 0x6ffffffa
- #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
- #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
-@@ -593,6 +594,18 @@
- #define PF_X (1 << 0) /* Segment is executable */
- #define PF_W (1 << 1) /* Segment is writable */
- #define PF_R (1 << 2) /* Segment is readable */
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
- #define PF_MASKOS 0x0ff00000 /* OS-specific */
- #define PF_MASKPROC 0xf0000000 /* Processor-specific */
-
diff --git a/patches/glibc/ports-2.12.1/360-tests-sandbox-libdl-paths.patch b/patches/glibc/ports-2.12.1/360-tests-sandbox-libdl-paths.patch
deleted file mode 100644
index a847cdb..0000000
--- a/patches/glibc/ports-2.12.1/360-tests-sandbox-libdl-paths.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-when glibc runs its tests, it does so by invoking the local library loader.
-in Gentoo, we build/run inside of our "sandbox" which itself is linked against
-libdl (so that it can load libraries and pull out symbols). the trouble
-is that when you upgrade from an older glibc to the new one, often times
-internal symbols change name or abi. this is normally OK as you cannot use
-libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
-we always say "keep all of the glibc libraries from the same build". but
-when glibc runs its tests, it uses dynamic paths to point to its new local
-copies of libraries. if the test doesnt use libdl, then glibc doesnt add
-its path, and when sandbox triggers the loading of libdl, glibc does so
-from the host system system. this gets us into the case of all libraries
-are from the locally compiled version of glibc except for libdl.so.
-
-Fix by Wormo
-
-http://bugs.gentoo.org/56898
-
-diff -durN glibc-2.12.1.orig/grp/tst_fgetgrent.sh glibc-2.12.1/grp/tst_fgetgrent.sh
---- glibc-2.12.1.orig/grp/tst_fgetgrent.sh 2001-07-06 06:54:46.000000000 +0200
-+++ glibc-2.12.1/grp/tst_fgetgrent.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -24,7 +24,8 @@
- rtld_installed_name=$1; shift
-
- testout=${common_objpfx}/grp/tst_fgetgrent.out
--library_path=${common_objpfx}
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-
- result=0
-
-diff -durN glibc-2.12.1.orig/iconvdata/run-iconv-test.sh glibc-2.12.1/iconvdata/run-iconv-test.sh
---- glibc-2.12.1.orig/iconvdata/run-iconv-test.sh 2008-05-15 03:59:44.000000000 +0200
-+++ glibc-2.12.1/iconvdata/run-iconv-test.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -34,7 +34,7 @@
- export GCONV_PATH
-
- # We have to have some directories in the library path.
--LIBPATH=$codir:$codir/iconvdata
-+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
-
- # How the start the iconv(1) program.
- ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
-diff -durN glibc-2.12.1.orig/iconvdata/tst-table.sh glibc-2.12.1/iconvdata/tst-table.sh
---- glibc-2.12.1.orig/iconvdata/tst-table.sh 2002-04-24 23:39:35.000000000 +0200
-+++ glibc-2.12.1/iconvdata/tst-table.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -59,8 +59,11 @@
- irreversible=${charset}.irreversible
- fi
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # iconv in one direction.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-table-from ${charset} \
- > ${objpfx}tst-${charset}.table
-
-diff -durN glibc-2.12.1.orig/intl/tst-codeset.sh glibc-2.12.1/intl/tst-codeset.sh
---- glibc-2.12.1.orig/intl/tst-codeset.sh 2005-04-06 04:18:35.000000000 +0200
-+++ glibc-2.12.1/intl/tst-codeset.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -37,6 +37,9 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- ${common_objpfx}elf/ld.so --library-path $common_objpfx \
- ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
-
-diff -durN glibc-2.12.1.orig/intl/tst-gettext.sh glibc-2.12.1/intl/tst-gettext.sh
---- glibc-2.12.1.orig/intl/tst-gettext.sh 2004-08-15 21:28:18.000000000 +0200
-+++ glibc-2.12.1/intl/tst-gettext.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -51,9 +51,12 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
- MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2.12.1.orig/intl/tst-gettext2.sh glibc-2.12.1/intl/tst-gettext2.sh
---- glibc-2.12.1.orig/intl/tst-gettext2.sh 2005-05-04 19:54:48.000000000 +0200
-+++ glibc-2.12.1/intl/tst-gettext2.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -65,8 +65,11 @@
- LOCPATH=${objpfx}domaindir
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
- cmp ${objpfx}tst-gettext2.out - <<EOF
- String1 - Lang1: 1st string
-diff -durN glibc-2.12.1.orig/intl/tst-translit.sh glibc-2.12.1/intl/tst-translit.sh
---- glibc-2.12.1.orig/intl/tst-translit.sh 2005-05-04 19:56:10.000000000 +0200
-+++ glibc-2.12.1/intl/tst-translit.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -36,7 +36,10 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2.12.1.orig/malloc/tst-mtrace.sh glibc-2.12.1/malloc/tst-mtrace.sh
---- glibc-2.12.1.orig/malloc/tst-mtrace.sh 2005-10-15 01:40:35.000000000 +0200
-+++ glibc-2.12.1/malloc/tst-mtrace.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -24,9 +24,12 @@
- status=0
- trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
- LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${common_objpfx}malloc/tst-mtrace || status=1
-
- if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
-diff -durN glibc-2.12.1.orig/nptl/tst-tls6.sh glibc-2.12.1/nptl/tst-tls6.sh
---- glibc-2.12.1.orig/nptl/tst-tls6.sh 2003-09-03 00:02:59.000000000 +0200
-+++ glibc-2.12.1/nptl/tst-tls6.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -5,8 +5,8 @@
- rtld_installed_name=$1; shift
- logfile=$common_objpfx/nptl/tst-tls6.out
-
--# We have to find libc and nptl
--library_path=${common_objpfx}:${common_objpfx}nptl
-+# We have to find libc and nptl (also libdl in case sandbox is in use)
-+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
- tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}/nptl/tst-tls5"
-
-diff -durN glibc-2.12.1.orig/posix/globtest.sh glibc-2.12.1/posix/globtest.sh
---- glibc-2.12.1.orig/posix/globtest.sh 2008-12-06 07:05:39.000000000 +0100
-+++ glibc-2.12.1/posix/globtest.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -18,7 +18,7 @@
- esac
-
- # We have to find the libc and the NSS modules.
--library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
-+library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
-
- # Since we use `sort' we must make sure to use the same locale everywhere.
- LC_ALL=C
-diff -durN glibc-2.12.1.orig/posix/tst-getconf.sh glibc-2.12.1/posix/tst-getconf.sh
---- glibc-2.12.1.orig/posix/tst-getconf.sh 2002-09-01 13:11:25.000000000 +0200
-+++ glibc-2.12.1/posix/tst-getconf.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -10,7 +10,10 @@
- else
- rtld_installed_name=$1; shift
- runit() {
-- ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
-+
-+ # make sure libdl is also in path in case sandbox is in use
-+ library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+ ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
- }
- fi
-
-diff -durN glibc-2.12.1.orig/posix/wordexp-tst.sh glibc-2.12.1/posix/wordexp-tst.sh
---- glibc-2.12.1.orig/posix/wordexp-tst.sh 2000-10-20 18:23:30.000000000 +0200
-+++ glibc-2.12.1/posix/wordexp-tst.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -19,8 +19,11 @@
- "
- export IFS
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- failed=0
--${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
-+${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
- cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
- wordexp returned 0
diff --git a/patches/glibc/ports-2.12.1/370-fnmatch.patch b/patches/glibc/ports-2.12.1/370-fnmatch.patch
deleted file mode 100644
index f345b35..0000000
--- a/patches/glibc/ports-2.12.1/370-fnmatch.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
-
-When fnmatch detects an invalid multibyte character it should fall back to
-single byte matching, so that "*" has a chance to match such a string.
-
-Andreas.
-
-2005-04-12 Andreas Schwab <schwab@suse.de>
-
- * posix/fnmatch.c (fnmatch): If conversion to wide character
- fails fall back to single byte matching.
-
-Index: posix/fnmatch.c
-===================================================================
-
-diff -durN glibc-2.12.1.orig/posix/fnmatch.c glibc-2.12.1/posix/fnmatch.c
---- glibc-2.12.1.orig/posix/fnmatch.c 2007-07-28 22:35:00.000000000 +0200
-+++ glibc-2.12.1/posix/fnmatch.c 2009-11-13 00:50:39.000000000 +0100
-@@ -327,6 +327,7 @@
- # if HANDLE_MULTIBYTE
- if (__builtin_expect (MB_CUR_MAX, 1) != 1)
- {
-+ const char *orig_pattern = pattern;
- mbstate_t ps;
- size_t n;
- const char *p;
-@@ -382,10 +383,8 @@
- wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
- n = mbsrtowcs (wstring, &p, n + 1, &ps);
- if (__builtin_expect (n == (size_t) -1, 0))
-- /* Something wrong.
-- XXX Do we have to set `errno' to something which mbsrtows hasn't
-- already done? */
-- return -1;
-+ /* Something wrong. Fall back to single byte matching. */
-+ goto try_singlebyte;
- if (p)
- {
- memset (&ps, '\0', sizeof (ps));
-@@ -397,10 +396,8 @@
- prepare_wstring:
- n = mbsrtowcs (NULL, &string, 0, &ps);
- if (__builtin_expect (n == (size_t) -1, 0))
-- /* Something wrong.
-- XXX Do we have to set `errno' to something which mbsrtows hasn't
-- already done? */
-- return -1;
-+ /* Something wrong. Fall back to single byte matching. */
-+ goto try_singlebyte;
- wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
- assert (mbsinit (&ps));
- (void) mbsrtowcs (wstring, &string, n + 1, &ps);
-@@ -408,6 +405,9 @@
-
- return internal_fnwmatch (wpattern, wstring, wstring + n,
- flags & FNM_PERIOD, flags, NULL);
-+
-+ try_singlebyte:
-+ pattern = orig_pattern;
- }
- # endif /* mbstate_t and mbsrtowcs or _LIBC. */
-
diff --git a/patches/glibc/ports-2.12.1/380-dont-build-timezone.patch b/patches/glibc/ports-2.12.1/380-dont-build-timezone.patch
deleted file mode 100644
index 0a30436..0000000
--- a/patches/glibc/ports-2.12.1/380-dont-build-timezone.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-timezone data has been split into the package sys-libs/timezone-data
-
-diff -durN glibc-2.12.1.orig/Makeconfig glibc-2.12.1/Makeconfig
---- glibc-2.12.1.orig/Makeconfig 2009-11-13 00:50:13.000000000 +0100
-+++ glibc-2.12.1/Makeconfig 2009-11-13 00:50:41.000000000 +0100
-@@ -944,7 +944,7 @@
- stdlib stdio-common libio malloc string wcsmbs time dirent \
- grp pwd posix io termios resource misc socket sysvipc gmon \
- gnulib iconv iconvdata wctype manual shadow gshadow po argp \
-- crypt nss localedata timezone rt conform debug \
-+ crypt nss localedata rt conform debug \
- $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
-
- ifndef avoid-generated
diff --git a/patches/glibc/ports-2.12.1/400-alpha-xstat.patch b/patches/glibc/ports-2.12.1/400-alpha-xstat.patch
deleted file mode 100644
index 97bea98..0000000
--- a/patches/glibc/ports-2.12.1/400-alpha-xstat.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h 2009-05-09 08:54:20.000000000 +0200
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:50:45.000000000 +0100
-@@ -386,6 +386,11 @@
- # define __ASSUME_GETDENTS32_D_TYPE 1
- #endif
-
-+/* Starting with version 2.6.4, alpha stat64 syscalls are available. */
-+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
-+# define __ASSUME_STAT64_SYSCALL 1
-+#endif
-+
- /* Starting with version 2.5.3, the initial location returned by `brk'
- after exec is always rounded up to the next page. */
- #if __LINUX_KERNEL_VERSION >= 132355
diff --git a/patches/glibc/ports-2.12.1/430-alpha-creat.patch b/patches/glibc/ports-2.12.1/430-alpha-creat.patch
deleted file mode 100644
index bfb72d0..0000000
--- a/patches/glibc/ports-2.12.1/430-alpha-creat.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-alpha does not have a __NR_creat
-
-http://bugs.gentoo.org/227275
-http://sourceware.org/bugzilla/show_bug.cgi?id=6650
-
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c glibc-2.12.1/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2007-11-10 20:34:26.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2009-11-13 00:50:51.000000000 +0100
-@@ -1 +1,5 @@
- /* Defined as alias for the syscall. */
-+#include <sysdep.h>
-+#ifndef __NR_creat
-+#include "../../../../../io/creat64.c"
-+#endif
diff --git a/patches/glibc/ports-2.12.1/440-alpha-cache-shape.patch b/patches/glibc/ports-2.12.1/440-alpha-cache-shape.patch
deleted file mode 100644
index ea85e99..0000000
--- a/patches/glibc/ports-2.12.1/440-alpha-cache-shape.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-older verisons of glibc would build dl-sysdep as shared-only and dl-support as
-static-only. alpha hooks in a cache variable via dl-auxv.h. newer versions of
-glibc build dl-sysdep as both shared and static which means we now have symbol
-duplication for static builds with dl-sysdep and dl-support. since dl-sysdep
-is both shared/static, there is no point in hooking dl-support anymore, so we
-can punt it.
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/dl-support.c 2009-11-13 00:50:53.000000000 +0100
-@@ -1,2 +1,1 @@
--#include "dl-auxv.h"
- #include <elf/dl-support.c>
diff --git a/patches/glibc/ports-2.12.1/460-alpha-fix-gcc-4.1-warnings.patch b/patches/glibc/ports-2.12.1/460-alpha-fix-gcc-4.1-warnings.patch
deleted file mode 100644
index 6438267..0000000
--- a/patches/glibc/ports-2.12.1/460-alpha-fix-gcc-4.1-warnings.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-2006-05-30 Falk Hueffner <falk@debian.org>
-
- * sysdeps/unix/sysv/linux/alpha/ioperm.c: force the architecture
- to ev6 in assembly code.
-
-{standard input}: Assembler messages:
-{standard input}:341: Error: macro requires $at register while noat in effect
-{standard input}:374: Error: macro requires $at register while noat in effect
-{standard input}:438: Error: macro requires $at register while noat in effect
-{standard input}:471: Error: macro requires $at register while noat in effect
-make[3]: *** [/tmp/buildd/glibc-2.3.6/build-tree/alpha-libc/misc/ioperm.o] Error 1
-
-Hrm. gcc puts .arch ev4 into the .s, and this overrides -mev6 for as.
-I cannot really think of anything better than
-
- ports/sysdeps/unix/sysv/linux/alpha/ioperm.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/alpha/ioperm.c 2009-11-13 00:50:57.000000000 +0100
-@@ -178,13 +178,13 @@
- static inline void
- stb_mb(unsigned char val, unsigned long addr)
- {
-- __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
-+ __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
- }
-
- static inline void
- stw_mb(unsigned short val, unsigned long addr)
- {
-- __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
-+ __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
- }
-
- static inline void
-@@ -356,7 +356,7 @@
- unsigned long int addr = dense_port_to_cpu_addr (port);
- unsigned char r;
-
-- __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
-+ __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
- return r;
- }
-
-@@ -366,7 +366,7 @@
- unsigned long int addr = dense_port_to_cpu_addr (port);
- unsigned short r;
-
-- __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
-+ __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
- return r;
- }
-
-diff -durN glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.12.1/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c
diff --git a/patches/glibc/ports-2.12.1/490-alpha_alpha-add-fdatasync-support.patch b/patches/glibc/ports-2.12.1/490-alpha_alpha-add-fdatasync-support.patch
deleted file mode 100644
index 9d35ebd..0000000
--- a/patches/glibc/ports-2.12.1/490-alpha_alpha-add-fdatasync-support.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-2009-07-25 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/kernel-features.h: define
- __ASSUME_FDATASYNC.
- * sysdeps/unix/sysv/linux/fdatasync.c: New file.
- * sysdeps/unix/sysv/linux/Makefile: compile fdatasync.c with
- -fexceptions.
- * sysdeps/unix/sysv/linux/syscalls.list: Remove fdatasync.
-
- sysdeps/unix/sysv/linux/Makefile | 1
- sysdeps/unix/sysv/linux/fdatasync.c | 69 ++++++++++++++++++++++++++++++
- sysdeps/unix/sysv/linux/kernel-features.h | 6 ++
- sysdeps/unix/sysv/linux/syscalls.list | 1
- 4 files changed, 76 insertions(+), 1 deletion(-)
-
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/Makefile glibc-2.12.1/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/Makefile 2009-03-02 17:15:13.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/Makefile 2009-11-13 00:51:04.000000000 +0100
-@@ -20,6 +20,7 @@
- setfsuid setfsgid makedev epoll_pwait signalfd \
- eventfd eventfd_read eventfd_write
-
-+CFLAGS-fdatasync.c = -fexceptions
- CFLAGS-gethostid.c = -fexceptions
-
- sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/fdatasync.c glibc-2.12.1/sysdeps/unix/sysv/linux/fdatasync.c
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/fdatasync.c 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/fdatasync.c 2009-11-13 00:51:04.000000000 +0100
-@@ -0,0 +1,69 @@
-+/* fdatasync -- synchronize at least the data part of a file with
-+ the underlying media. Linux version.
-+
-+ Copyright (C) 2007 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <errno.h>
-+#include <unistd.h>
-+
-+#include <sysdep-cancel.h>
-+#include <sys/syscall.h>
-+#include <bp-checks.h>
-+
-+#include <kernel-features.h>
-+
-+#if defined __NR_fdatasync && !defined __ASSUME_FDATASYNC
-+static int __have_no_fdatasync;
-+#endif
-+
-+static int
-+do_fdatasync (int fd)
-+{
-+#ifdef __ASSUME_FDATASYNC
-+ return INLINE_SYSCALL (fdatasync, 1, fd);
-+#elif defined __NR_fdatasync
-+ if (!__builtin_expect (__have_no_fdatasync, 0))
-+ {
-+ int result = INLINE_SYSCALL (fdatasync, 1, fd);
-+ if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
-+ return result;
-+
-+ __have_no_fdatasync = 1;
-+ }
-+#endif
-+ return INLINE_SYSCALL (fsync, 1, fd);
-+}
-+
-+int
-+__fdatasync (int fd)
-+{
-+ if (SINGLE_THREAD_P)
-+ return do_fdatasync (fd);
-+
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+
-+ int result = do_fdatasync (fd);
-+
-+ LIBC_CANCEL_RESET (oldtype);
-+
-+ return result;
-+}
-+
-+weak_alias (__fdatasync, fdatasync)
-+
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:50:45.000000000 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:51:04.000000000 +0100
-@@ -459,6 +459,12 @@
- # define __ASSUME_FUTEX_LOCK_PI 1
- #endif
-
-+/* Support for fsyncdata syscall was added in 2.6.22 on alpha, but it
-+ was already present in 2.0 kernels on other architectures. */
-+#if (!defined __alpha || __LINUX_KERNEL_VERSION >= 0x020616)
-+# define __ASSUME_FDATASYNC 1
-+#endif
-+
- /* Support for utimensat syscall was added in 2.6.22, on SH
- only after 2.6.22-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020616 \
-diff -durN glibc-2.12.1.orig/sysdeps/unix/sysv/linux/syscalls.list glibc-2.12.1/sysdeps/unix/sysv/linux/syscalls.list
---- glibc-2.12.1.orig/sysdeps/unix/sysv/linux/syscalls.list 2008-08-02 01:29:08.000000000 +0200
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/syscalls.list 2009-11-13 00:51:04.000000000 +0100
-@@ -11,7 +11,6 @@
- epoll_create1 EXTRA epoll_create1 i:i epoll_create1
- epoll_ctl EXTRA epoll_ctl i:iiip epoll_ctl
- epoll_wait EXTRA epoll_wait Ci:ipii epoll_wait
--fdatasync - fdatasync Ci:i fdatasync
- flock - flock i:ii __flock flock
- fork - fork i: __libc_fork __fork fork
- get_kernel_syms EXTRA get_kernel_syms i:p get_kernel_syms
diff --git a/patches/glibc/ports-2.12.1/530-alpha-fix-rtld-fPIC.patch b/patches/glibc/ports-2.12.1/530-alpha-fix-rtld-fPIC.patch
deleted file mode 100644
index 621a6f3..0000000
--- a/patches/glibc/ports-2.12.1/530-alpha-fix-rtld-fPIC.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-2009-05-26 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/alpha/Makefile (CFLAGS-rtld.c): add $(PIC-ccflag).
-
- ports/sysdeps/alpha/Makefile | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/alpha/Makefile glibc-2.12.1/glibc-ports-2.12.1/sysdeps/alpha/Makefile
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/alpha/Makefile 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/alpha/Makefile 2009-11-13 00:51:13.000000000 +0100
-@@ -35,7 +35,8 @@
-
- ifeq ($(subdir),elf)
- # The ld.so startup code cannot use literals until it self-relocates.
--CFLAGS-rtld.c = -mbuild-constants
-+# It uses more than 64k for the small data area.
-+CFLAGS-rtld.c = -mbuild-constants $(PIC-ccflag)
- endif
-
- # Build everything with full IEEE math support, and with dynamic rounding;
-diff -durN glibc-2.12.1.orig/ports/sysdeps/alpha/Makefile glibc-2.12.1/ports/sysdeps/alpha/Makefile
diff --git a/patches/glibc/ports-2.12.1/560-ppc-atomic.patch b/patches/glibc/ports-2.12.1/560-ppc-atomic.patch
deleted file mode 100644
index 679ef18..0000000
--- a/patches/glibc/ports-2.12.1/560-ppc-atomic.patch
+++ /dev/null
@@ -1,415 +0,0 @@
-sniped from suse
-
-Index: sysdeps/powerpc/bits/atomic.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/powerpc/bits/atomic.h,v
-retrieving revision 1.17
-diff -u -a -p -r1.17 atomic.h
-
-diff -durN glibc-2.12.1.orig/sysdeps/powerpc/bits/atomic.h glibc-2.12.1/sysdeps/powerpc/bits/atomic.h
---- glibc-2.12.1.orig/sysdeps/powerpc/bits/atomic.h 2007-03-26 22:15:28.000000000 +0200
-+++ glibc-2.12.1/sysdeps/powerpc/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -85,14 +85,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -102,14 +102,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -118,12 +118,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -132,11 +132,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -144,12 +144,12 @@
- #define __arch_atomic_exchange_and_add_32(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stwcx. %1,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -157,12 +157,12 @@
- #define __arch_atomic_increment_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -170,27 +170,27 @@
- #define __arch_atomic_decrement_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_32(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
- " cmpwi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stwcx. %1,0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-diff -durN glibc-2.12.1.orig/sysdeps/powerpc/powerpc32/bits/atomic.h glibc-2.12.1/sysdeps/powerpc/powerpc32/bits/atomic.h
---- glibc-2.12.1.orig/sysdeps/powerpc/powerpc32/bits/atomic.h 2007-03-26 22:15:45.000000000 +0200
-+++ glibc-2.12.1/sysdeps/powerpc/powerpc32/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -60,14 +60,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-diff -durN glibc-2.12.1.orig/sysdeps/powerpc/powerpc64/bits/atomic.h glibc-2.12.1/sysdeps/powerpc/powerpc64/bits/atomic.h
---- glibc-2.12.1.orig/sysdeps/powerpc/powerpc64/bits/atomic.h 2007-03-26 22:16:03.000000000 +0200
-+++ glibc-2.12.1/sysdeps/powerpc/powerpc64/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp, __tmp2; \
- __asm __volatile (" clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -61,14 +61,14 @@
- unsigned int __tmp, __tmp2; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
- " clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_REL "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -82,14 +82,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -98,14 +98,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -115,14 +115,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -132,14 +132,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -148,12 +148,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -162,11 +162,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -174,12 +174,12 @@
- #define __arch_atomic_exchange_and_add_64(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stdcx. %1,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -187,12 +187,12 @@
- #define __arch_atomic_increment_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -200,27 +200,27 @@
- #define __arch_atomic_decrement_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_64(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
- " cmpdi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stdcx. %1,0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
diff --git a/patches/glibc/ports-2.12.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch b/patches/glibc/ports-2.12.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch
deleted file mode 100644
index fc42a92..0000000
--- a/patches/glibc/ports-2.12.1/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch
+++ /dev/null
@@ -1,374 +0,0 @@
-http://yann.poupet.free.fr/ep93xx/
-Add support for the Maverick Crunch FPU on Cirrus EP93XX processor series
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/bits/endian.h 2009-11-13 00:51:22.000000000 +0100
-@@ -12,7 +12,7 @@
- /* FPA floating point units are always big-endian, irrespective of the
- CPU endianness. VFP floating point units use the same endianness
- as the rest of the system. */
--#ifdef __VFP_FP__
-+#if defined __VFP_FP__ || defined __MAVERICK__
- #define __FLOAT_WORD_ORDER __BYTE_ORDER
- #else
- #define __FLOAT_WORD_ORDER __BIG_ENDIAN
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/__longjmp.S 2009-11-13 00:51:22.000000000 +0100
-@@ -30,7 +30,33 @@
- movs r0, r1 /* get the return value in place */
- moveq r0, #1 /* can't let setjmp() return zero! */
-
-+#ifdef __MAVERICK__
-+ cfldrd mvd4, [ip], #8
-+ nop
-+ cfldrd mvd5, [ip], #8
-+ nop
-+ cfldrd mvd6, [ip], #8
-+ nop
-+ cfldrd mvd7, [ip], #8
-+ nop
-+ cfldrd mvd8, [ip], #8
-+ nop
-+ cfldrd mvd9, [ip], #8
-+ nop
-+ cfldrd mvd10, [ip], #8
-+ nop
-+ cfldrd mvd11, [ip], #8
-+ nop
-+ cfldrd mvd12, [ip], #8
-+ nop
-+ cfldrd mvd13, [ip], #8
-+ nop
-+ cfldrd mvd14, [ip], #8
-+ nop
-+ cfldrd mvd15, [ip], #8
-+#else
- lfmfd f4, 4, [ip] ! /* load the floating point regs */
-+#endif
-
- LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
- END (__longjmp)
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/fenv.h 2009-11-13 00:51:22.000000000 +0100
-@@ -20,6 +20,45 @@
- # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
- #endif
-
-+#if defined(__MAVERICK__)
-+
-+/* Define bits representing exceptions in the FPU status word. */
-+enum
-+ {
-+ FE_INVALID = 1,
-+#define FE_INVALID FE_INVALID
-+ FE_OVERFLOW = 4,
-+#define FE_OVERFLOW FE_OVERFLOW
-+ FE_UNDERFLOW = 8,
-+#define FE_UNDERFLOW FE_UNDERFLOW
-+ FE_INEXACT = 16,
-+#define FE_INEXACT FE_INEXACT
-+ };
-+
-+/* Amount to shift by to convert an exception to a mask bit. */
-+#define FE_EXCEPT_SHIFT 5
-+
-+/* All supported exceptions. */
-+#define FE_ALL_EXCEPT \
-+ (FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
-+
-+/* IEEE rounding modes. */
-+enum
-+ {
-+ FE_TONEAREST = 0,
-+#define FE_TONEAREST FE_TONEAREST
-+ FE_TOWARDZERO = 0x400,
-+#define FE_TOWARDZERO FE_TOWARDZERO
-+ FE_DOWNWARD = 0x800,
-+#define FE_DOWNWARD FE_DOWNWARD
-+ FE_UPWARD = 0xc00,
-+#define FE_UPWARD FE_UPWARD
-+ };
-+
-+#define FE_ROUND_MASK (FE_UPWARD)
-+
-+#else /* FPA */
-+
- /* Define bits representing exceptions in the FPU status word. */
- enum
- {
-@@ -44,6 +83,8 @@
- modes exist, but you have to encode them in the actual instruction. */
- #define FE_TONEAREST 0
-
-+#endif
-+
- /* Type representing exception flags. */
- typedef unsigned long int fexcept_t;
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/bits/setjmp.h 2009-11-13 00:51:22.000000000 +0100
-@@ -28,7 +28,11 @@
- #ifndef _ASM
- /* Jump buffer contains v1-v6, sl, fp, sp and pc. Other registers are not
- saved. */
-+#ifdef __MAVERICK__
-+typedef int __jmp_buf[34];
-+#else
- typedef int __jmp_buf[22];
- #endif
-+#endif
-
- #endif
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fegetround.c 2009-11-13 00:51:22.000000000 +0100
-@@ -18,9 +18,21 @@
- 02111-1307 USA. */
-
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fegetround (void)
- {
-+#if defined(__MAVERICK__)
-+
-+ unsigned long temp;
-+
-+ _FPU_GETCW (temp);
-+ return temp & FE_ROUND_MASK;
-+
-+#else /* FPA */
-+
- return FE_TONEAREST; /* Easy. :-) */
-+
-+#endif
- }
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fesetround.c 2009-11-13 00:51:22.000000000 +0100
-@@ -18,12 +18,28 @@
- 02111-1307 USA. */
-
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fesetround (int round)
- {
-+#if defined(__MAVERICK__)
-+ unsigned long temp;
-+
-+ if (round & ~FE_ROUND_MASK)
-+ return 1;
-+
-+ _FPU_GETCW (temp);
-+ temp = (temp & ~FE_ROUND_MASK) | round;
-+ _FPU_SETCW (temp);
-+ return 0;
-+
-+#else /* FPA */
-+
- /* We only support FE_TONEAREST, so there is no need for any work. */
- return (round == FE_TONEAREST)?0:1;
-+
-+#endif
- }
-
- libm_hidden_def (fesetround)
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/fpu_control.h 2009-11-13 00:51:22.000000000 +0100
-@@ -1,5 +1,6 @@
- /* FPU control word definitions. ARM version.
-- Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
-+ Copyright (C) 1996, 1997, 1998, 2000, 2005
-+ Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
-@@ -20,6 +21,79 @@
- #ifndef _FPU_CONTROL_H
- #define _FPU_CONTROL_H
-
-+#if defined(__MAVERICK__)
-+
-+/* DSPSC register: (from EP9312 User's Guide)
-+ *
-+ * bits 31..29 - DAID
-+ * bits 28..26 - HVID
-+ * bits 25..24 - RSVD
-+ * bit 23 - ISAT
-+ * bit 22 - UI
-+ * bit 21 - INT
-+ * bit 20 - AEXC
-+ * bits 19..18 - SAT
-+ * bits 17..16 - FCC
-+ * bit 15 - V
-+ * bit 14 - FWDEN
-+ * bit 13 - Invalid
-+ * bit 12 - Denorm
-+ * bits 11..10 - RM
-+ * bits 9..5 - IXE, UFE, OFE, RSVD, IOE
-+ * bits 4..0 - IX, UF, OF, RSVD, IO
-+ */
-+
-+/* masking of interrupts */
-+#define _FPU_MASK_IM (1 << 5) /* invalid operation */
-+#define _FPU_MASK_ZM 0 /* divide by zero */
-+#define _FPU_MASK_OM (1 << 7) /* overflow */
-+#define _FPU_MASK_UM (1 << 8) /* underflow */
-+#define _FPU_MASK_PM (1 << 9) /* inexact */
-+#define _FPU_MASK_DM 0 /* denormalized operation */
-+
-+#define _FPU_RESERVED 0xfffff000 /* These bits are reserved. */
-+
-+#define _FPU_DEFAULT 0x00b00000 /* Default value. */
-+#define _FPU_IEEE 0x00b003a0 /* Default + exceptions enabled. */
-+
-+/* Type of the control word. */
-+typedef unsigned int fpu_control_t;
-+
-+/* Macros for accessing the hardware control word. */
-+#define _FPU_GETCW(cw) ({ \
-+ register int __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv32sc mvdx0, dspsc\n\t" \
-+ "cfmvr64l %0, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (cw), "=r" (__t1), "=r" (__t2) \
-+ ); \
-+})
-+
-+#define _FPU_SETCW(cw) ({ \
-+ register int __t0, __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %0\n\t" \
-+ "cfmvsc32 dspsc, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (__t0), "=r" (__t1), "=r" (__t2) \
-+ : "0" (cw) \
-+ ); \
-+})
-+
-+/* Default control word set at startup. */
-+extern fpu_control_t __fpu_control;
-+
-+#else /* FPA */
-+
- /* We have a slight terminology confusion here. On the ARM, the register
- * we're interested in is actually the FPU status word - the FPU control
- * word is something different (which is implementation-defined and only
-@@ -99,4 +173,6 @@
- /* Default control word set at startup. */
- extern fpu_control_t __fpu_control;
-
-+#endif
-+
- #endif /* _FPU_CONTROL_H */
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/jmpbuf-offsets.h 2009-11-13 00:51:22.000000000 +0100
-@@ -17,4 +17,8 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#ifdef __MAVERICK__
-+#define __JMP_BUF_SP 32
-+#else
- #define __JMP_BUF_SP 20
-+#endif
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/fpu/setjmp.S 2009-11-13 00:51:22.000000000 +0100
-@@ -24,11 +24,41 @@
-
- ENTRY (__sigsetjmp)
- /* Save registers */
-+#ifdef __MAVERICK__
-+ cfstrd mvd4, [r0], #8
-+ nop
-+ cfstrd mvd5, [r0], #8
-+ nop
-+ cfstrd mvd6, [r0], #8
-+ nop
-+ cfstrd mvd7, [r0], #8
-+ nop
-+ cfstrd mvd8, [r0], #8
-+ nop
-+ cfstrd mvd9, [r0], #8
-+ nop
-+ cfstrd mvd10, [r0], #8
-+ nop
-+ cfstrd mvd11, [r0], #8
-+ nop
-+ cfstrd mvd12, [r0], #8
-+ nop
-+ cfstrd mvd13, [r0], #8
-+ nop
-+ cfstrd mvd14, [r0], #8
-+ nop
-+ cfstrd mvd15, [r0], #8
-+#else
- sfmea f4, 4, [r0]!
-+#endif
- stmia r0, {v1-v6, sl, fp, sp, lr}
-
- /* Restore pointer to jmp_buf */
-+#ifdef __MAVERICK__
-+ sub r0, r0, #96
-+#else
- sub r0, r0, #48
-+#endif
-
- /* Make a tail call to __sigjmp_save; it takes the same args. */
- B PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gccframe.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gccframe.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gccframe.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gccframe.h 2009-11-13 00:51:22.000000000 +0100
-@@ -17,6 +17,10 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#ifdef __MAVERICK__
-+#define FIRST_PSEUDO_REGISTER 43
-+#else
- #define FIRST_PSEUDO_REGISTER 27
-+#endif
-
- #include <sysdeps/generic/gccframe.h>
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/arm/gmp-mparam.h 2009-11-13 00:51:22.000000000 +0100
-@@ -29,7 +29,7 @@
- #if defined(__ARMEB__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 1
--#elif defined(__VFP_FP__)
-+#elif defined(__VFP_FP__) || defined(__MAVERICK__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 0
- #else
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/bits/endian.h glibc-2.12.1/ports/sysdeps/arm/bits/endian.h
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/__longjmp.S glibc-2.12.1/ports/sysdeps/arm/fpu/__longjmp.S
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/bits/fenv.h glibc-2.12.1/ports/sysdeps/arm/fpu/bits/fenv.h
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/bits/setjmp.h glibc-2.12.1/ports/sysdeps/arm/fpu/bits/setjmp.h
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/fegetround.c glibc-2.12.1/ports/sysdeps/arm/fpu/fegetround.c
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/fesetround.c glibc-2.12.1/ports/sysdeps/arm/fpu/fesetround.c
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/fpu_control.h glibc-2.12.1/ports/sysdeps/arm/fpu/fpu_control.h
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.12.1/ports/sysdeps/arm/fpu/jmpbuf-offsets.h
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/fpu/setjmp.S glibc-2.12.1/ports/sysdeps/arm/fpu/setjmp.S
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/gccframe.h glibc-2.12.1/ports/sysdeps/arm/gccframe.h
-diff -durN glibc-2.12.1.orig/ports/sysdeps/arm/gmp-mparam.h glibc-2.12.1/ports/sysdeps/arm/gmp-mparam.h
diff --git a/patches/glibc/ports-2.12.1/580-nptl-lowlevellock.patch b/patches/glibc/ports-2.12.1/580-nptl-lowlevellock.patch
deleted file mode 100644
index c243a76..0000000
--- a/patches/glibc/ports-2.12.1/580-nptl-lowlevellock.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-fix build error on arm like on hppa:
-
-arm-unknown-linux-gnu-gcc ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -g -pipe -Wstrict-prototypes -fPIC -I../include -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/fpu -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include-fixed -isystem /usr/arm-unknown-linux-gnu/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -o /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -MD -MP -MF /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os.dt -MT /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -DNOT_IN_libc=1 -DIS_IN_rtld=1
-In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21:
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private':
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: warning: implicit declaration of function 'THREAD_GETMEM'
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'THREAD_SELF' undeclared (first use in this function)
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: (Each undeclared identifier is reported only once
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: for each function it appears in.)
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'header' undeclared (first use in this function)
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-11-13 00:51:23.000000000 +0100
-@@ -25,6 +25,7 @@
- #include <atomic.h>
- #include <sysdep.h>
- #include <kernel-features.h>
-+#include <tls.h> /* Need THREAD_*, and header.*. */
-
- #define FUTEX_WAIT 0
- #define FUTEX_WAKE 1
-diff -durN glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.12.1/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
diff --git a/patches/glibc/ports-2.12.1/610-fpu-cw-mips.patch b/patches/glibc/ports-2.12.1/610-fpu-cw-mips.patch
deleted file mode 100644
index 7d990de..0000000
--- a/patches/glibc/ports-2.12.1/610-fpu-cw-mips.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-http://sourceware.org/ml/libc-alpha/2002-10/msg00392.html
-
-diff -durN glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h glibc-2.12.1/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h
---- glibc-2.12.1.orig/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.12.1/glibc-ports-2.12.1/sysdeps/mips/fpu_control.h 2009-11-13 00:51:31.000000000 +0100
-@@ -86,7 +86,7 @@
- #define _FPU_RC_UP 0x2
- #define _FPU_RC_DOWN 0x3
-
--#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */
-+#define _FPU_RESERVED 0xfebc0000 /* Reserved bits in cw */
-
-
- /* The fdlibm code requires strict IEEE double precision arithmetic,
-diff -durN glibc-2.12.1.orig/ports/sysdeps/mips/fpu_control.h glibc-2.12.1/ports/sysdeps/mips/fpu_control.h
diff --git a/patches/glibc/ports-2.12.1/630-mips_shn_undef-hack.patch b/patches/glibc/ports-2.12.1/630-mips_shn_undef-hack.patch
deleted file mode 100644
index f6a5eb6..0000000
--- a/patches/glibc/ports-2.12.1/630-mips_shn_undef-hack.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -durN glibc-2.12.1.orig/elf/dl-lookup.c glibc-2.12.1/elf/dl-lookup.c
---- glibc-2.12.1.orig/elf/dl-lookup.c 2009-03-30 23:14:32.000000000 +0200
-+++ glibc-2.12.1/elf/dl-lookup.c 2009-11-13 00:51:36.000000000 +0100
-@@ -301,6 +301,12 @@
- /* FALLTHROUGH */
- case STB_GLOBAL:
- success:
-+#ifdef __mips__
-+ /* HACK: MIPS marks its lazy evaluation stubs with SHN_UNDEF
-+ symbols, we skip them. */
-+ if (sym->st_shndx == SHN_UNDEF)
-+ break;
-+#endif
- /* Global definition. Just what we need. */
- result->s = sym;
- result->m = (struct link_map *) map;
diff --git a/patches/glibc/ports-2.12.1/640-alpha-atfcts.patch b/patches/glibc/ports-2.12.1/640-alpha-atfcts.patch
deleted file mode 100644
index 90a9d0d..0000000
--- a/patches/glibc/ports-2.12.1/640-alpha-atfcts.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h 2010-07-27 14:34:39.000000000 +0300
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/kernel-features.h.new 2011-03-10 18:54:37.686795979 +0200
-@@ -437,7 +437,8 @@
- the code. On PPC they were introduced in 2.6.17-rc1,
- on SH in 2.6.19-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020611 \
-- && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613)
-+ && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613) \
-+ && (!defined __alpha__)
- # define __ASSUME_ATFCTS 1
- #endif
-
diff --git a/patches/glibc/ports-2.12.1/650-syslog.patch b/patches/glibc/ports-2.12.1/650-syslog.patch
deleted file mode 100644
index c20cafc..0000000
--- a/patches/glibc/ports-2.12.1/650-syslog.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN glibc-cvs-2.9.orig/misc/syslog.c glibc-cvs-2.9/misc/syslog.c
---- glibc-cvs-2.9.orig/misc/syslog.c 2009-06-01 10:16:50.000000000 +0200
-+++ glibc-cvs-2.9/misc/syslog.c 2009-06-01 10:17:20.000000000 +0200
-@@ -152,7 +152,7 @@
- #define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
- /* Check for invalid bits. */
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
-- syslog(INTERNALLOG,
-+ __syslog(INTERNALLOG,
- "syslog: unknown facility/priority: %x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
diff --git a/patches/glibc/ports-2.12.1/660-debug-readlink_chk-readklinkat_chk.patch b/patches/glibc/ports-2.12.1/660-debug-readlink_chk-readklinkat_chk.patch
deleted file mode 100644
index a5a7052..0000000
--- a/patches/glibc/ports-2.12.1/660-debug-readlink_chk-readklinkat_chk.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur glibc-cvs-2.9.orig/debug/readlink_chk.c glibc-cvs-2.9/debug/readlink_chk.c
---- glibc-cvs-2.9.orig/debug/readlink_chk.c 2005-03-01 01:41:15.000000000 +0100
-+++ glibc-cvs-2.9/debug/readlink_chk.c 2009-06-01 10:59:37.000000000 +0200
-@@ -25,7 +25,7 @@
-
-
- ssize_t
--__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
-+__readlink_chk (const char *path, char *buf, size_t len, size_t buflen)
- {
- if (len > buflen)
- __chk_fail ();
-diff -dur glibc-cvs-2.9.orig/debug/readlinkat_chk.c glibc-cvs-2.9/debug/readlinkat_chk.c
---- glibc-cvs-2.9.orig/debug/readlinkat_chk.c 2006-04-24 18:56:12.000000000 +0200
-+++ glibc-cvs-2.9/debug/readlinkat_chk.c 2009-06-01 11:07:26.000000000 +0200
-@@ -21,7 +21,7 @@
-
-
- ssize_t
--__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
-+__readlinkat_chk (int fd, const char *path, char *buf, size_t len,
- size_t buflen)
- {
- if (len > buflen)
diff --git a/patches/glibc/ports-2.13/100-respect-env-CPPFLAGS.patch b/patches/glibc/ports-2.13/100-respect-env-CPPFLAGS.patch
deleted file mode 100644
index 3798cb2..0000000
--- a/patches/glibc/ports-2.13/100-respect-env-CPPFLAGS.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Respect environment CPPFLAGS when we run ./configure so we can inject
-random -D things without having to set CFLAGS/ASFLAGS
-
-diff -durN glibc-2.13.orig/Makeconfig glibc-2.13/Makeconfig
---- glibc-2.13.orig/Makeconfig 2009-05-09 23:57:56.000000000 +0200
-+++ glibc-2.13/Makeconfig 2009-11-13 00:49:41.000000000 +0100
-@@ -697,6 +697,7 @@
- $(foreach lib,$(libof-$(basename $(@F))) \
- $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
- $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-+CPPFLAGS += $(CPPFLAGS-config)
- override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
- $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
- $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
diff --git a/patches/glibc/ports-2.13/120-i386-x86_64-revert-clone-cfi.patch b/patches/glibc/ports-2.13/120-i386-x86_64-revert-clone-cfi.patch
deleted file mode 100644
index c7f6182..0000000
--- a/patches/glibc/ports-2.13/120-i386-x86_64-revert-clone-cfi.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-revert cfi additions to clone on i386/x86_64 to workaround problems in
-gcc's unwinder code. this is not a bug in glibc, it triggers problems
-elsewhere. this cfi code does not gain us a whole lot anyways.
-
-http://gcc.gnu.org/ml/gcc/2006-12/msg00293.html
-
-Index: sysdeps/unix/sysv/linux/i386/clone.S
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/clone.S,v
-retrieving revision 1.27
-retrieving revision 1.26
-diff -u -p -r1.27 -r1.26
-
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/i386/clone.S glibc-2.13/sysdeps/unix/sysv/linux/i386/clone.S
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/i386/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/i386/clone.S 2009-11-13 00:49:45.000000000 +0100
-@@ -120,9 +120,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (eip);
- /* Note: %esi is zero. */
- movl %esi,%ebp /* terminate the stack frame */
- #ifdef RESET_PID
-@@ -155,7 +152,6 @@
- jmp L(haspid)
- .previous
- #endif
-- cfi_endproc;
-
- cfi_startproc
- PSEUDO_END (BP_SYM (__clone))
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/x86_64/clone.S glibc-2.13/sysdeps/unix/sysv/linux/x86_64/clone.S
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/x86_64/clone.S 2006-12-04 00:12:36.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/x86_64/clone.S 2009-11-13 00:49:45.000000000 +0100
-@@ -89,9 +89,6 @@
- ret
-
- L(thread_start):
-- cfi_startproc;
-- /* Clearing frame pointer is insufficient, use CFI. */
-- cfi_undefined (rip);
- /* Clear the frame pointer. The ABI suggests this be done, to mark
- the outermost frame obviously. */
- xorl %ebp, %ebp
-@@ -116,7 +113,6 @@
- /* Call exit with return value from function call. */
- movq %rax, %rdi
- call HIDDEN_JUMPTARGET (_exit)
-- cfi_endproc;
-
- cfi_startproc;
- PSEUDO_END (BP_SYM (__clone))
diff --git a/patches/glibc/ports-2.13/140-disable-ldconfig.patch b/patches/glibc/ports-2.13/140-disable-ldconfig.patch
deleted file mode 100644
index 378e1df..0000000
--- a/patches/glibc/ports-2.13/140-disable-ldconfig.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-do not bother running ldconfig on DESTDIR. it wants to write the temp cache
-file outside of the chroot. doesnt matter anyways as we wont use the cache
-results (portage will rebuild cache), so running ldconfig is simply a waste
-of time.
-
-diff -durN glibc-2.13.orig/Makefile glibc-2.13/Makefile
---- glibc-2.13.orig/Makefile 2009-04-23 20:23:03.000000000 +0200
-+++ glibc-2.13/Makefile 2009-11-13 00:49:49.000000000 +0100
-@@ -116,6 +116,7 @@
- rm -f $(symbolic-link-list)
-
- install:
-+dont-bother-with-destdir:
- -test ! -x $(common-objpfx)elf/ldconfig || LC_ALL=C LANGUAGE=C \
- $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \
- $(slibdir) $(libdir)
diff --git a/patches/glibc/ports-2.13/150-queue-header-updates.patch b/patches/glibc/ports-2.13/150-queue-header-updates.patch
deleted file mode 100644
index 7cbe70e..0000000
--- a/patches/glibc/ports-2.13/150-queue-header-updates.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-grab some updates from FreeBSD
-
-http://bugs.gentoo.org/201979
-
-diff -durN glibc-2.13.orig/misc/sys/queue.h glibc-2.13/misc/sys/queue.h
-
-diff -durN glibc-2.13.orig/misc/sys/queue.h glibc-2.13/misc/sys/queue.h
---- glibc-2.13.orig/misc/sys/queue.h 2008-03-05 06:50:30.000000000 +0100
-+++ glibc-2.13/misc/sys/queue.h 2009-11-13 00:49:51.000000000 +0100
-@@ -136,6 +136,11 @@
- (var); \
- (var) = ((var)->field.le_next))
-
-+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = LIST_FIRST((head)); \
-+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- /*
- * List access methods.
- */
-@@ -197,6 +202,16 @@
- #define SLIST_FOREACH(var, head, field) \
- for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
-
-+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = SLIST_FIRST((head)); \
-+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
-+#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
-+ for ((varp) = &SLIST_FIRST((head)); \
-+ ((var) = *(varp)) != NULL; \
-+ (varp) = &SLIST_NEXT((var), field))
-+
- /*
- * Singly-linked List access methods.
- */
-@@ -242,6 +257,12 @@
- (head)->stqh_last = &(elm)->field.stqe_next; \
- } while (/*CONSTCOND*/0)
-
-+#define STAILQ_LAST(head, type, field) \
-+ (STAILQ_EMPTY((head)) ? \
-+ NULL : \
-+ ((struct type *)(void *) \
-+ ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-+
- #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
- if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
-@@ -271,6 +292,11 @@
- (var); \
- (var) = ((var)->field.stqe_next))
-
-+#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = STAILQ_FIRST((head)); \
-+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- #define STAILQ_CONCAT(head1, head2) do { \
- if (!STAILQ_EMPTY((head2))) { \
- *(head1)->stqh_last = (head2)->stqh_first; \
-@@ -437,11 +463,21 @@
- (var); \
- (var) = ((var)->field.tqe_next))
-
-+#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-+ for ((var) = TAILQ_FIRST((head)); \
-+ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
-+ (var) = (tvar))
-+
- #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
- for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
- (var); \
- (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
-
-+#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
-+ for ((var) = TAILQ_LAST((head), headname); \
-+ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
-+ (var) = (tvar))
-+
- #define TAILQ_CONCAT(head1, head2, field) do { \
- if (!TAILQ_EMPTY(head2)) { \
- *(head1)->tqh_last = (head2)->tqh_first; \
diff --git a/patches/glibc/ports-2.13/160-manual-no-perl.patch b/patches/glibc/ports-2.13/160-manual-no-perl.patch
deleted file mode 100644
index 5e2b807..0000000
--- a/patches/glibc/ports-2.13/160-manual-no-perl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-If we're using a cvs snapshot which updates the source files, and
-perl isn't installed yet, then we can't regen the docs. Not a big
-deal, so just whine a little and continue on our merry way.
-
-http://bugs.gentoo.org/60132
-
-diff -durN glibc-2.13.orig/manual/Makefile glibc-2.13/manual/Makefile
---- glibc-2.13.orig/manual/Makefile 2006-01-08 07:43:47.000000000 +0100
-+++ glibc-2.13/manual/Makefile 2009-11-13 00:49:54.000000000 +0100
-@@ -104,9 +104,14 @@
- libm-err.texi: stamp-libm-err
- stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
- $(dir)/libm-test-ulps))
-+ifneq ($(PERL),no)
- pwd=`pwd`; \
- $(PERL) $< $$pwd/.. > libm-err-tmp
- $(move-if-change) libm-err-tmp libm-err.texi
-+else
-+ echo "Unable to rebuild math docs, no perl installed"
-+ touch libm-err.texi
-+endif
- touch $@
-
- # Generate Texinfo files from the C source for the example programs.
diff --git a/patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch b/patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch
deleted file mode 100644
index 4784a07..0000000
--- a/patches/glibc/ports-2.13/170-localedef-fix-trampoline.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh -e
-
-# DP: Description: Fix localedef segfault when run under exec-shield,
-# PaX or similar. (#231438, #198099)
-# DP: Dpatch Author: James Troup <james@nocrew.org>
-# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
-# DP: Upstream status: Unknown
-# DP: Status Details: Unknown
-# DP: Date: 2004-03-16
-
-if [ $# -ne 2 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
- -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-esac
-exit 0
-
-diff -durN glibc-2.13.orig/locale/programs/3level.h glibc-2.13/locale/programs/3level.h
---- glibc-2.13.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200
-+++ glibc-2.13/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100
-@@ -203,6 +203,42 @@
- }
- }
- }
-+
-+/* GCC ATM seems to do a poor job with pointers to nested functions passed
-+ to inlined functions. Help it a little bit with this hack. */
-+#define wchead_table_iterate(tp, fn) \
-+do \
-+ { \
-+ struct wchead_table *t = (tp); \
-+ uint32_t index1; \
-+ for (index1 = 0; index1 < t->level1_size; index1++) \
-+ { \
-+ uint32_t lookup1 = t->level1[index1]; \
-+ if (lookup1 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup1_shifted = lookup1 << t->q; \
-+ uint32_t index2; \
-+ for (index2 = 0; index2 < (1 << t->q); index2++) \
-+ { \
-+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
-+ if (lookup2 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup2_shifted = lookup2 << t->p; \
-+ uint32_t index3; \
-+ for (index3 = 0; index3 < (1 << t->p); index3++) \
-+ { \
-+ struct element_t *lookup3 \
-+ = t->level3[index3 + lookup2_shifted]; \
-+ if (lookup3 != NULL) \
-+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
-+ lookup3); \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } while (0)
-+
- #endif
-
- #ifndef NO_FINALIZE
diff --git a/patches/glibc/ports-2.13/180-resolv-dynamic.patch b/patches/glibc/ports-2.13/180-resolv-dynamic.patch
deleted file mode 100644
index e916bce..0000000
--- a/patches/glibc/ports-2.13/180-resolv-dynamic.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-ripped from SuSE
-
-if /etc/resolv.conf is updated, then make sure applications
-already running get the updated information.
-
-http://bugs.gentoo.org/177416
-
-diff -durN glibc-2.13.orig/resolv/res_libc.c glibc-2.13/resolv/res_libc.c
---- glibc-2.13.orig/resolv/res_libc.c 2009-02-07 05:27:42.000000000 +0100
-+++ glibc-2.13/resolv/res_libc.c 2009-11-13 00:49:59.000000000 +0100
-@@ -22,6 +22,7 @@
- #include <arpa/nameser.h>
- #include <resolv.h>
- #include <bits/libc-lock.h>
-+#include <sys/stat.h>
-
-
- /* The following bit is copied from res_data.c (where it is #ifdef'ed
-@@ -95,6 +96,20 @@
- __res_maybe_init (res_state resp, int preinit)
- {
- if (resp->options & RES_INIT) {
-+ static time_t last_mtime, last_check;
-+ time_t now;
-+ struct stat statbuf;
-+
-+ time (&now);
-+ if (now != last_check) {
-+ last_check = now;
-+ if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
-+ last_mtime = statbuf.st_mtime;
-+ atomicinclock (lock);
-+ atomicinc (__res_initstamp);
-+ atomicincunlock (lock);
-+ }
-+ }
- if (__res_initstamp != resp->_u._ext.initstamp) {
- if (resp->nscount > 0)
- __res_iclose (resp, true);
diff --git a/patches/glibc/ports-2.13/190-localedef-mmap.patch b/patches/glibc/ports-2.13/190-localedef-mmap.patch
deleted file mode 100644
index f3914cd..0000000
--- a/patches/glibc/ports-2.13/190-localedef-mmap.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-sniped from Debian
-http://bugs.gentoo.org/289615
-
-2009-10-27 Aurelien Jarno <aurelien@aurel32.net>
-
- * locale/programs/locarchive.c: use MMAP_SHARED to reserve memory
- used later with MMAP_FIXED | MMAP_SHARED to cope with different
- alignment restrictions.
-
-diff -durN glibc-2.13.orig/locale/programs/locarchive.c glibc-2.13/locale/programs/locarchive.c
---- glibc-2.13.orig/locale/programs/locarchive.c 2009-04-27 16:07:47.000000000 +0200
-+++ glibc-2.13/locale/programs/locarchive.c 2009-11-13 00:50:01.000000000 +0100
-@@ -134,7 +134,7 @@
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
-@@ -396,7 +396,7 @@
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
-@@ -614,7 +614,7 @@
- int xflags = 0;
- void *p;
- if (st.st_size < reserved
-- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
-+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
diff --git a/patches/glibc/ports-2.13/200-fadvise64_64.patch b/patches/glibc/ports-2.13/200-fadvise64_64.patch
deleted file mode 100644
index 71bca38..0000000
--- a/patches/glibc/ports-2.13/200-fadvise64_64.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-ripped from Debian
-
- sysdeps/unix/sysv/linux/posix_fadvise.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2.13/sysdeps/unix/sysv/linux/posix_fadvise.c
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/posix_fadvise.c 2003-08-17 02:36:22.000000000 +0200
-+++ glibc-2.13/sysdeps/unix/sysv/linux/posix_fadvise.c 2009-11-13 00:50:03.000000000 +0100
-@@ -35,6 +35,19 @@
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
- #else
-+# ifdef __NR_fadvise64_64
-+ INTERNAL_SYSCALL_DECL (err);
-+ int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
-+ __LONG_LONG_PAIR ((long) (offset >> 31),
-+ (long) offset),
-+ __LONG_LONG_PAIR ((long) (len >> 31),
-+ (long) len),
-+ advise);
-+ if (INTERNAL_SYSCALL_ERROR_P (ret, err))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+# else
- return ENOSYS;
-+# endif
- #endif
- }
diff --git a/patches/glibc/ports-2.13/220-section-comments.patch b/patches/glibc/ports-2.13/220-section-comments.patch
deleted file mode 100644
index d717829..0000000
--- a/patches/glibc/ports-2.13/220-section-comments.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-04/msg00665.html
-
-fixes building on some architectures (like m68k/arm/cris/etc...) because
-it does the right thing
-
-diff -durN glibc-2.13.orig/include/libc-symbols.h glibc-2.13/include/libc-symbols.h
---- glibc-2.13.orig/include/libc-symbols.h 2009-03-14 00:51:46.000000000 +0100
-+++ glibc-2.13/include/libc-symbols.h 2009-11-13 00:50:07.000000000 +0100
-@@ -239,12 +239,12 @@
- # define __make_section_unallocated(section_string)
- # endif
-
--/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
-+/* Tacking on "\n#APP\n\t#" to the section name makes gcc put it's bogus
- section attributes on what looks like a comment to the assembler. */
- # ifdef HAVE_SECTION_QUOTES
--# define __sec_comment "\"\n\t#\""
-+# define __sec_comment "\"\n#APP\n\t#\""
- # else
--# define __sec_comment "\n\t#"
-+# define __sec_comment "\n#APP\n\t#"
- # endif
- # define link_warning(symbol, msg) \
- __make_section_unallocated (".gnu.warning." #symbol) \
diff --git a/patches/glibc/ports-2.13/230-no-inline-gmon.patch b/patches/glibc/ports-2.13/230-no-inline-gmon.patch
deleted file mode 100644
index fa33c2b..0000000
--- a/patches/glibc/ports-2.13/230-no-inline-gmon.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-http://bugs.gentoo.org/196245
-http://sourceware.org/ml/libc-alpha/2006-05/msg00017.html
-
-Attached is a patch to add __attribute__ ((noinline)) to
-call_gmon_start.
-
-Without this patch, the sec script that processed initfini.s removes a
-part of inlined call_gmon_start, causing undefined label errors.
-
-This patch solves the problem by forcing gcc not to inline
-call_gmon_start with __attribute__ ((noinline)).
-
-Tested by building for arm-none-lixux-gnueabi. OK to apply?
-
-Kazu Hirata
-
-2006-05-07 Kazu Hirata &lt;kazu@codesourcery.com&gt;
-
- * sysdeps/generic/initfini.c (call_gmon_start): Add
- __attribute__ ((noinline)).
-
-Index: sysdeps/generic/initfini.c
-===================================================================
-
-diff -durN glibc-2.13.orig/sysdeps/generic/initfini.c glibc-2.13/sysdeps/generic/initfini.c
---- glibc-2.13.orig/sysdeps/generic/initfini.c 2007-06-17 20:02:40.000000000 +0200
-+++ glibc-2.13/sysdeps/generic/initfini.c 2009-11-13 00:50:09.000000000 +0100
-@@ -70,7 +70,7 @@
- /* The beginning of _init: */
- asm ("\n/*@_init_PROLOG_BEGINS*/");
-
--static void
-+static void __attribute__ ((noinline))
- call_gmon_start(void)
- {
- extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
diff --git a/patches/glibc/ports-2.13/240-check_native-headers.patch b/patches/glibc/ports-2.13/240-check_native-headers.patch
deleted file mode 100644
index c936f71..0000000
--- a/patches/glibc/ports-2.13/240-check_native-headers.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-many ports hit this warning:
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-../sysdeps/unix/sysv/linux/check_native.c:46: warning: implicit declaration of function 'memset'
-
-snipped from suse
-
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/check_native.c glibc-2.13/sysdeps/unix/sysv/linux/check_native.c
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/check_native.c 2007-11-24 04:12:17.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/check_native.c 2009-11-13 00:50:11.000000000 +0100
-@@ -23,6 +23,7 @@
- #include <stddef.h>
- #include <stdint.h>
- #include <stdlib.h>
-+#include <string.h>
- #include <time.h>
- #include <unistd.h>
- #include <net/if.h>
diff --git a/patches/glibc/ports-2.13/250-fix-pr631.patch b/patches/glibc/ports-2.13/250-fix-pr631.patch
deleted file mode 100644
index a48912e..0000000
--- a/patches/glibc/ports-2.13/250-fix-pr631.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From dank@kegel.com
-Wed Jun 15 09:12:43 PDT 2005
-
-Fixes
-
-build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
-build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
-... 53 lines deleted ...
-build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
-collect2: ld returned 1 exit status
-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
-
-when building glibc with --enable-static-nss.
-
-See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
-
-diff -durN glibc-2.13.orig/Makeconfig glibc-2.13/Makeconfig
---- glibc-2.13.orig/Makeconfig 2009-11-13 00:49:41.000000000 +0100
-+++ glibc-2.13/Makeconfig 2009-11-13 00:50:13.000000000 +0100
-@@ -531,7 +531,7 @@
-
- # The static libraries.
- ifeq (yes,$(build-static))
--link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
-+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
- else
- ifeq (yes,$(build-shared))
- # We can try to link the programs with lib*_pic.a...
-diff -durN glibc-2.13.orig/elf/Makefile glibc-2.13/elf/Makefile
---- glibc-2.13.orig/elf/Makefile 2009-01-31 01:20:55.000000000 +0100
-+++ glibc-2.13/elf/Makefile 2009-11-13 00:50:13.000000000 +0100
-@@ -146,6 +146,13 @@
- install-bin-script = ldd
- endif
-
-+ifeq (yes,$(build-static-nss))
-+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
-+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
-+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
-+ $(resolvobjdir)/libresolv.a
-+endif
-+
- others = sprof sln
- install-bin = sprof
- others-static = sln
diff --git a/patches/glibc/ports-2.13/260-assume-pipe2.patch b/patches/glibc/ports-2.13/260-assume-pipe2.patch
deleted file mode 100644
index 42e8f4e..0000000
--- a/patches/glibc/ports-2.13/260-assume-pipe2.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-http://bugs.gentoo.org/250342
-http://sources.redhat.com/bugzilla/show_bug.cgi?id=9685
-
-we cant assume sock_cloexec and pipe2 are bound together as the former defines
-are found in glibc only while the latter are a combo of kernel headers and
-glibc. so if we do a runtime detection of SOCK_CLOEXEC, but pipe2() is a stub
-inside of glibc, we hit a problem. for example:
-
-#include <grp.h>
-#include <stdio.h>
-main()
-{
- getgrnam("portage");
- if (!popen("ls", "r"))
- perror("popen()");
-}
-
-getgrnam() will detect that the kernel supports SOCK_CLOEXEC and then set both
-__have_sock_cloexec and __have_pipe2 to true. but if glibc was built against
-older kernel headers where __NR_pipe2 does not exist, glibc will have a ENOSYS
-stub for it. so popen() will always fail as glibc assumes pipe2() works.
-
-diff -durN glibc-2.13.orig/socket/have_sock_cloexec.c glibc-2.13/socket/have_sock_cloexec.c
---- glibc-2.13.orig/socket/have_sock_cloexec.c 2008-07-25 18:46:23.000000000 +0200
-+++ glibc-2.13/socket/have_sock_cloexec.c 2009-11-13 00:50:15.000000000 +0100
-@@ -16,9 +16,14 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#include <fcntl.h>
- #include <sys/socket.h>
- #include <kernel-features.h>
-
- #if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC
- int __have_sock_cloexec;
- #endif
-+
-+#if defined O_CLOEXEC && !defined __ASSUME_PIPE2
-+int __have_pipe2;
-+#endif
diff --git a/patches/glibc/ports-2.13/270-china.patch b/patches/glibc/ports-2.13/270-china.patch
deleted file mode 100644
index 41d7759..0000000
--- a/patches/glibc/ports-2.13/270-china.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-diff -durN glibc-2.13.orig/localedata/locales/zh_TW glibc-2.13/localedata/locales/zh_TW
---- glibc-2.13.orig/localedata/locales/zh_TW 2004-11-01 00:42:28.000000000 +0100
-+++ glibc-2.13/localedata/locales/zh_TW 2009-11-13 00:50:17.000000000 +0100
-@@ -1,7 +1,7 @@
- comment_char %
- escape_char /
- %
--% Chinese language locale for Taiwan R.O.C.
-+% Chinese language locale for Taiwan
- % charmap: BIG5-CP950
- %
- % Original Author:
-@@ -17,7 +17,7 @@
- % Reference: http://wwwold.dkuug.dk/JTC1/SC22/WG20/docs/n690.pdf
-
- LC_IDENTIFICATION
--title "Chinese locale for Taiwan R.O.C."
-+title "Chinese locale for Taiwan"
- source ""
- address ""
- contact ""
-@@ -25,7 +25,7 @@
- tel ""
- fax ""
- language "Chinese"
--territory "Taiwan R.O.C."
-+territory "Taiwan"
- revision "0.2"
- date "2000-08-02"
- %
diff --git a/patches/glibc/ports-2.13/280-new-valencian-locale.patch b/patches/glibc/ports-2.13/280-new-valencian-locale.patch
deleted file mode 100644
index 4cdd108..0000000
--- a/patches/glibc/ports-2.13/280-new-valencian-locale.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-http://bugs.gentoo.org/show_bug.cgi?id=131815
-http://sourceware.org/bugzilla/show_bug.cgi?id=2522
-
-diff -durN glibc-2.13.orig/localedata/SUPPORTED glibc-2.13/localedata/SUPPORTED
---- glibc-2.13.orig/localedata/SUPPORTED 2009-04-18 10:43:52.000000000 +0200
-+++ glibc-2.13/localedata/SUPPORTED 2009-11-13 00:50:20.000000000 +0100
-@@ -72,6 +72,8 @@
- ca_ES.UTF-8/UTF-8 \
- ca_ES/ISO-8859-1 \
- ca_ES@euro/ISO-8859-15 \
-+ca_ES.UTF-8@valencia/UTF-8 \
-+ca_ES@valencia/ISO-8859-15 \
- ca_FR.UTF-8/UTF-8 \
- ca_FR/ISO-8859-15 \
- ca_IT.UTF-8/UTF-8 \
-diff -durN glibc-2.13.orig/localedata/locales/ca_ES@valencia glibc-2.13/localedata/locales/ca_ES@valencia
---- glibc-2.13.orig/localedata/locales/ca_ES@valencia 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.13/localedata/locales/ca_ES@valencia 2009-11-13 00:50:20.000000000 +0100
-@@ -0,0 +1,96 @@
-+comment_char %
-+escape_char /
-+%
-+% Valencian (southern Catalan) locale for Spain with Euro
-+%
-+% Note that this locale is almost the same as ca_ES@euro. The point of having
-+% a separate locale is only for PO translations, which have a lot of social
-+% support and are very appreciated by the Valencian-speaking community.
-+%
-+% Contact: Jordi Mallach
-+% Email: jordi@gnu.org
-+% Tel:
-+% Fax:
-+% Language: ca
-+% Territory: ES
-+% Option: euro
-+% Revision: 1.0
-+% Date: 2006-04-06
-+% Application: general
-+% Users: general
-+% Repertoiremap: mnemonic,ds
-+% Charset: ISO-8859-15
-+% Distribution and use is free, also
-+% for commercial purposes.
-+
-+LC_IDENTIFICATION
-+title "Valencian (southern Catalan) locale for Spain with Euro"
-+source ""
-+address ""
-+contact "Jordi Mallach"
-+email "jordi@gnu.org"
-+tel ""
-+fax ""
-+language "Catalan"
-+territory "Spain"
-+revision "1.0"
-+date "2006-04-06"
-+%
-+category "ca_ES@valencia:2006";LC_IDENTIFICATION
-+category "ca_ES@valencia:2006";LC_CTYPE
-+category "ca_ES@valencia:2006";LC_COLLATE
-+category "ca_ES@valencia:2006";LC_MONETARY
-+category "ca_ES@valencia:2006";LC_NUMERIC
-+category "ca_ES@valencia:2006";LC_TIME
-+category "ca_ES@valencia:2006";LC_MESSAGES
-+category "ca_ES@valencia:2006";LC_PAPER
-+category "ca_ES@valencia:2006";LC_NAME
-+category "ca_ES@valencia:2006";LC_ADDRESS
-+category "ca_ES@valencia:2006";LC_TELEPHONE
-+category "ca_ES@valencia:2006";LC_MEASUREMENT
-+
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+END LC_CTYPE
-+
-+LC_COLLATE
-+copy "ca_ES"
-+END LC_COLLATE
-+
-+LC_MONETARY
-+copy "ca_ES"
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+copy "ca_ES"
-+END LC_NUMERIC
-+
-+LC_TIME
-+copy "ca_ES"
-+END LC_TIME
-+
-+LC_MESSAGES
-+copy "ca_ES"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+copy "ca_ES"
-+END LC_PAPER
-+
-+LC_NAME
-+copy "ca_ES"
-+END LC_NAME
-+
-+LC_ADDRESS
-+copy "ca_ES"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+copy "ca_ES"
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+copy "ca_ES"
-+END LC_MEASUREMENT
diff --git a/patches/glibc/ports-2.13/300-nscd-one-fork.patch b/patches/glibc/ports-2.13/300-nscd-one-fork.patch
deleted file mode 100644
index adc9b3f..0000000
--- a/patches/glibc/ports-2.13/300-nscd-one-fork.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-only fork one to assist in stop-start-daemon assumptions about daemon behavior
-
-http://bugs.gentoo.org/190785
-
-diff -durN glibc-2.13.orig/nscd/nscd.c glibc-2.13/nscd/nscd.c
---- glibc-2.13.orig/nscd/nscd.c 2009-02-06 21:10:27.000000000 +0100
-+++ glibc-2.13/nscd/nscd.c 2009-11-13 00:50:24.000000000 +0100
-@@ -182,6 +182,9 @@
- if (pid != 0)
- exit (0);
-
-+ if (write_pid (_PATH_NSCDPID) < 0)
-+ dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
-+
- int nullfd = open (_PATH_DEVNULL, O_RDWR);
- if (nullfd != -1)
- {
-@@ -231,12 +234,6 @@
- for (i = min_close_fd; i < getdtablesize (); i++)
- close (i);
-
-- pid = fork ();
-- if (pid == -1)
-- error (EXIT_FAILURE, errno, _("cannot fork"));
-- if (pid != 0)
-- exit (0);
--
- setsid ();
-
- if (chdir ("/") != 0)
-@@ -245,9 +242,6 @@
-
- openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON);
-
-- if (write_pid (_PATH_NSCDPID) < 0)
-- dbg_log ("%s: %s", _PATH_NSCDPID, strerror (errno));
--
- if (!init_logfile ())
- dbg_log (_("Could not create log file"));
-
diff --git a/patches/glibc/ports-2.13/310-hppa-nptl-carlos.patch b/patches/glibc/ports-2.13/310-hppa-nptl-carlos.patch
deleted file mode 100644
index 4c028b2..0000000
--- a/patches/glibc/ports-2.13/310-hppa-nptl-carlos.patch
+++ /dev/null
@@ -1,246 +0,0 @@
-
-
-diff -durN glibc-2.13.orig/elf/rtld.c glibc-2.13/elf/rtld.c
---- glibc-2.13.orig/elf/rtld.c 2009-04-17 02:00:08.000000000 +0200
-+++ glibc-2.13/elf/rtld.c 2009-11-13 00:50:26.000000000 +0100
-@@ -392,14 +392,14 @@
- know it is available. We do not have to clear the memory if we
- do not have to use the temporary bootstrap_map. Global variables
- are initialized to zero by default. */
--#ifndef DONT_USE_BOOTSTRAP_MAP
-+#if !defined DONT_USE_BOOTSTRAP_MAP
- # ifdef HAVE_BUILTIN_MEMSET
- __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
- # else
-- for (size_t cnt = 0;
-- cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
-- ++cnt)
-- bootstrap_map.l_info[cnt] = 0;
-+ /* Clear the whole bootstrap_map structure */
-+ for (char *cnt = (char *)&(bootstrap_map);
-+ cnt < ((char *)&(bootstrap_map) + sizeof (bootstrap_map));
-+ *cnt++ = '\0');
- # endif
- # if USE___THREAD
- bootstrap_map.l_tls_modid = 0;
-diff -durN glibc-2.13.orig/include/atomic.h glibc-2.13/include/atomic.h
---- glibc-2.13.orig/include/atomic.h 2009-02-09 00:49:53.000000000 +0100
-+++ glibc-2.13/include/atomic.h 2009-11-13 00:50:26.000000000 +0100
-@@ -185,7 +185,7 @@
- __typeof (*(mem)) __atg5_value = (newvalue); \
- \
- do \
-- __atg5_oldval = *__atg5_memp; \
-+ __atg5_oldval = *(volatile __typeof (mem))__atg5_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
- __atg5_oldval), 0)); \
-@@ -206,7 +206,7 @@
- __typeof (*(mem)) __atg6_value = (value); \
- \
- do \
-- __atg6_oldval = *__atg6_memp; \
-+ __atg6_oldval = *(volatile __typeof (mem))__atg6_memp; \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
- __atg6_oldval \
-@@ -224,7 +224,7 @@
- __typeof (*(mem)) __atg7_value = (value); \
- \
- do \
-- __atg7_oldv = *__atg7_memp; \
-+ __atg7_oldv = *(volatile __typeof (mem))__atg7_memp; \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
- __atg7_oldv \
-@@ -242,7 +242,7 @@
- __typeof (mem) __atg8_memp = (mem); \
- __typeof (*(mem)) __atg8_value = (value); \
- do { \
-- __atg8_oldval = *__atg8_memp; \
-+ __atg8_oldval = *(volatile __typeof (mem))__atg8_memp; \
- if (__atg8_oldval >= __atg8_value) \
- break; \
- } while (__builtin_expect \
-@@ -259,7 +259,7 @@
- __typeof (mem) __atg9_memp = (mem); \
- __typeof (*(mem)) __atg9_value = (value); \
- do { \
-- __atg9_oldv = *__atg9_memp; \
-+ __atg9_oldv = *(volatile __typeof (mem))__atg9_memp; \
- if (__atg9_oldv >= __atg9_value) \
- break; \
- } while (__builtin_expect \
-@@ -277,7 +277,7 @@
- __typeof (mem) __atg10_memp = (mem); \
- __typeof (*(mem)) __atg10_value = (value); \
- do { \
-- __atg10_oldval = *__atg10_memp; \
-+ __atg10_oldval = *(volatile __typeof (mem))__atg10_memp; \
- if (__atg10_oldval <= __atg10_value) \
- break; \
- } while (__builtin_expect \
-@@ -361,7 +361,7 @@
- \
- do \
- { \
-- __atg11_oldval = *__atg11_memp; \
-+ __atg11_oldval = *(volatile __typeof (mem))__atg11_memp; \
- if (__builtin_expect (__atg11_oldval <= 0, 0)) \
- break; \
- } \
-@@ -400,7 +400,7 @@
- __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
- \
- do \
-- __atg14_old = (*__atg14_memp); \
-+ __atg14_old = (*(volatile __typeof (mem))__atg14_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
- __atg14_old | __atg14_mask,\
-@@ -418,7 +418,7 @@
- __typeof (*(mem)) __atg15_mask = (mask); \
- \
- do \
-- __atg15_old = (*__atg15_memp); \
-+ __atg15_old = (*(volatile __typeof (mem))__atg15_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
- __atg15_old & __atg15_mask, \
-@@ -450,7 +450,7 @@
- __typeof (*(mem)) __atg16_mask = (mask); \
- \
- do \
-- __atg16_old = (*__atg16_memp); \
-+ __atg16_old = (*(volatile __typeof (mem))__atg16_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
- __atg16_old & __atg16_mask,\
-@@ -468,7 +468,7 @@
- __typeof (*(mem)) __atg17_mask = (mask); \
- \
- do \
-- __atg17_old = (*__atg17_memp); \
-+ __atg17_old = (*(volatile __typeof (mem))__atg17_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
- __atg17_old | __atg17_mask, \
-@@ -484,7 +484,7 @@
- __typeof (*(mem)) __atg18_mask = (mask); \
- \
- do \
-- __atg18_old = (*__atg18_memp); \
-+ __atg18_old = (*(volatile __typeof (mem))__atg18_memp); \
- while (__builtin_expect \
- (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
- __atg18_old | __atg18_mask,\
-@@ -500,7 +500,7 @@
- __typeof (*(mem)) __atg19_mask = (mask); \
- \
- do \
-- __atg19_old = (*__atg19_memp); \
-+ __atg19_old = (*(volatile __typeof (mem))__atg19_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
- __atg19_old | __atg19_mask,\
-diff -durN glibc-2.13.orig/nptl/Makefile glibc-2.13/nptl/Makefile
---- glibc-2.13.orig/nptl/Makefile 2008-11-12 14:38:23.000000000 +0100
-+++ glibc-2.13/nptl/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -265,9 +265,9 @@
- # Files which must not be linked with libpthread.
- tests-nolibpthread = tst-unload
-
--# This sets the stack resource limit to 1023kb, which is not a multiple
--# of the page size since every architecture's page size is > 1k.
--tst-oddstacklimit-ENV = ; ulimit -s 1023;
-+# This sets the stack resource limit to 8193kb, which is not a multiple
-+# of the page size since every architecture's page size is 4096 bytes.
-+tst-oddstacklimit-ENV = ; ulimit -s 8193;
-
- distribute = eintr.c tst-cleanup4aux.c
-
-@@ -426,6 +426,35 @@
- CFLAGS-tst-cleanupx4.c += -fexceptions
- CFLAGS-tst-oncex3.c += -fexceptions
- CFLAGS-tst-oncex4.c += -fexceptions
-+
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
-+LDFLAGS-tst-cancelx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx5 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx6 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx7 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx8 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx9 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx10 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx11 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx12 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx13 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx14 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx15 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx16 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx17 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx18 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx20 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cancelx21 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx0 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx1 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx2 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-cleanupx4 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex3 += $(ldflags-libgcc_s)
-+LDFLAGS-tst-oncex4 += $(ldflags-libgcc_s)
-+
- CFLAGS-tst-align.c += $(stack-align-test-flags)
- CFLAGS-tst-align3.c += $(stack-align-test-flags)
- CFLAGS-tst-initializers1.c = -W -Wall -Werror
-diff -durN glibc-2.13.orig/nptl/pthread_barrier_wait.c glibc-2.13/nptl/pthread_barrier_wait.c
---- glibc-2.13.orig/nptl/pthread_barrier_wait.c 2007-08-01 06:18:50.000000000 +0200
-+++ glibc-2.13/nptl/pthread_barrier_wait.c 2009-11-13 00:50:26.000000000 +0100
-@@ -64,7 +64,7 @@
- do
- lll_futex_wait (&ibarrier->curr_event, event,
- ibarrier->private ^ FUTEX_PRIVATE_FLAG);
-- while (event == ibarrier->curr_event);
-+ while (event == *(volatile unsigned int *)&ibarrier->curr_event);
- }
-
- /* Make sure the init_count is stored locally or in a register. */
-diff -durN glibc-2.13.orig/nptl/sysdeps/pthread/Makefile glibc-2.13/nptl/sysdeps/pthread/Makefile
---- glibc-2.13.orig/nptl/sysdeps/pthread/Makefile 2006-02-28 08:09:41.000000000 +0100
-+++ glibc-2.13/nptl/sysdeps/pthread/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -33,7 +33,9 @@
-
- ifeq ($(have-forced-unwind),yes)
- tests += tst-mqueue8x
-+ldflags-libgcc_s = --as-needed -lgcc_s --no-as-needed
- CFLAGS-tst-mqueue8x.c += -fexceptions
-+LDFLAGS-tst-mqueue8x += $(ldflags-libgcc_s)
- endif
- endif
-
-diff -durN glibc-2.13.orig/stdio-common/Makefile glibc-2.13/stdio-common/Makefile
---- glibc-2.13.orig/stdio-common/Makefile 2009-04-11 07:29:56.000000000 +0200
-+++ glibc-2.13/stdio-common/Makefile 2009-11-13 00:50:26.000000000 +0100
-@@ -82,7 +82,7 @@
- $(SHELL) -e tst-printf.sh $(common-objpfx) '$(run-program-prefix)'
- endif
-
--CFLAGS-vfprintf.c = -Wno-uninitialized
-+CFLAGS-vfprintf.c = -Wno-uninitialized -fno-delayed-branch
- CFLAGS-vfwprintf.c = -Wno-uninitialized
- CFLAGS-tst-printf.c = -Wno-format
- CFLAGS-tstdiomisc.c = -Wno-format
-diff -durN glibc-2.13.orig/sunrpc/clnt_udp.c glibc-2.13/sunrpc/clnt_udp.c
---- glibc-2.13.orig/sunrpc/clnt_udp.c 2008-07-26 10:42:44.000000000 +0200
-+++ glibc-2.13/sunrpc/clnt_udp.c 2009-11-13 00:50:26.000000000 +0100
-@@ -456,7 +456,7 @@
- while (inlen < 0 && errno == EINTR);
- if (inlen < 0)
- {
-- if (errno == EWOULDBLOCK)
-+ if (errno == EWOULDBLOCK || errno == EAGAIN)
- continue;
- cu->cu_error.re_errno = errno;
- return (cu->cu_error.re_status = RPC_CANTRECV);
diff --git a/patches/glibc/ports-2.13/330-m68k-sys-user.patch b/patches/glibc/ports-2.13/330-m68k-sys-user.patch
deleted file mode 100644
index 191e0c6..0000000
--- a/patches/glibc/ports-2.13/330-m68k-sys-user.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-copied from kernel as it is sanitized now
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/m68k/sys/user.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/m68k/sys/user.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/m68k/sys/user.h 2009-11-13 00:50:31.000000000 +0100
-@@ -1,3 +1,90 @@
-+#ifndef _SYS_USER_H
-+#define _SYS_USER_H
-+
-+/* Core file format: The core file is written in such a way that gdb
-+ can understand it and provide useful information to the user (under
-+ linux we use the 'trad-core' bfd). There are quite a number of
-+ obstacles to being able to view the contents of the floating point
-+ registers, and until these are solved you will not be able to view the
-+ contents of them. Actually, you can read in the core file and look at
-+ the contents of the user struct to find out what the floating point
-+ registers contain.
-+ The actual file contents are as follows:
-+ UPAGE: 1 page consisting of a user struct that tells gdb what is present
-+ in the file. Directly after this is a copy of the task_struct, which
-+ is currently not used by gdb, but it may come in useful at some point.
-+ All of the registers are stored as part of the upage. The upage should
-+ always be only one page.
-+ DATA: The data area is stored. We use current->end_text to
-+ current->brk to pick up all of the user variables, plus any memory
-+ that may have been malloced. No attempt is made to determine if a page
-+ is demand-zero or if a page is totally unused, we just cover the entire
-+ range. All of the addresses are rounded in such a way that an integral
-+ number of pages is written.
-+ STACK: We need the stack information in order to get a meaningful
-+ backtrace. We need to write the data from (esp) to
-+ current->start_stack, so we round each of these off in order to be able
-+ to write an integer number of pages.
-+ The minimum core file size is 3 pages, or 12288 bytes.
-+*/
-+
-+struct user_m68kfp_struct {
-+ unsigned long fpregs[8*3]; /* fp0-fp7 registers */
-+ unsigned long fpcntl[3]; /* fp control regs */
-+};
-+
-+/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
-+ is still the layout used by user (the new pt_regs doesn't have
-+ all registers). */
-+struct user_regs_struct {
-+ long d1,d2,d3,d4,d5,d6,d7;
-+ long a0,a1,a2,a3,a4,a5,a6;
-+ long d0;
-+ long usp;
-+ long orig_d0;
-+ short stkadj;
-+ short sr;
-+ long pc;
-+ short fmtvec;
-+ short __fill;
-+};
-+
-+
-+/* When the kernel dumps core, it starts by dumping the user struct -
-+ this will be used by gdb to figure out where the data and stack segments
-+ are within the file, and what virtual addresses to use. */
-+struct user{
-+/* We start with the registers, to mimic the way that "memory" is returned
-+ from the ptrace(3,...) function. */
-+ struct user_regs_struct regs; /* Where the registers are actually stored */
-+/* ptrace does not yet supply these. Someday.... */
-+ int u_fpvalid; /* True if math co-processor being used. */
-+ /* for this mess. Not yet used. */
-+ struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */
-+/* The rest of this junk is to help gdb figure out what goes where */
-+ unsigned long int u_tsize; /* Text segment size (pages). */
-+ unsigned long int u_dsize; /* Data segment size (pages). */
-+ unsigned long int u_ssize; /* Stack segment size (pages). */
-+ unsigned long start_code; /* Starting virtual address of text. */
-+ unsigned long start_stack; /* Starting virtual address of stack area.
-+ This is actually the bottom of the stack,
-+ the top of the stack is always found in the
-+ esp register. */
-+ long int signal; /* Signal that caused the core dump. */
-+ int reserved; /* No longer used */
-+ struct user_regs_struct *u_ar0;
-+ /* Used by gdb to help find the values for */
-+ /* the registers. */
-+ struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */
-+ unsigned long magic; /* To uniquely identify a core file */
-+ char u_comm[32]; /* User command that was responsible */
-+};
-+#define NBPG 4096
-+#define UPAGES 1
-+#define HOST_TEXT_START_ADDR (u.start_code)
-+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-+
-+#endif
- /* Copyright (C) 2008, 2010 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
-diff -durN glibc-2.13.orig/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h glibc-2.13/ports/sysdeps/unix/sysv/linux/m68k/sys/user.h
diff --git a/patches/glibc/ports-2.13/340-dl_execstack-PaX-support.patch b/patches/glibc/ports-2.13/340-dl_execstack-PaX-support.patch
deleted file mode 100644
index 2402af0..0000000
--- a/patches/glibc/ports-2.13/340-dl_execstack-PaX-support.patch
+++ /dev/null
@@ -1,66 +0,0 @@
- With latest versions of glibc, a lot of apps failed on a PaX enabled
- system with:
- cannot enable executable stack as shared object requires: Permission denied
-
- This is due to PaX 'exec-protecting' the stack, and ld.so then trying
- to make the stack executable due to some libraries not containing the
- PT_GNU_STACK section. Bug #32960. <azarah@gentoo.org> (12 Nov 2003).
-
- Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
-
-diff -durN glibc-2.13.orig/nptl/allocatestack.c glibc-2.13/nptl/allocatestack.c
---- glibc-2.13.orig/nptl/allocatestack.c 2009-01-29 21:34:16.000000000 +0100
-+++ glibc-2.13/nptl/allocatestack.c 2009-11-13 00:50:33.000000000 +0100
-@@ -329,7 +329,8 @@
- # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
- #endif
- if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
-- return errno;
-+ if (errno != EACCES) /* PAX is enabled */
-+ return errno;
-
- return 0;
- }
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2.13/sysdeps/unix/sysv/linux/dl-execstack.c
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/dl-execstack.c 2006-01-08 09:21:15.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/dl-execstack.c 2009-11-13 00:50:33.000000000 +0100
-@@ -63,7 +63,10 @@
- else
- # endif
- {
-- result = errno;
-+ if (errno == EACCES) /* PAX is enabled */
-+ result = 0;
-+ else
-+ result = errno;
- goto out;
- }
- }
-@@ -89,7 +92,12 @@
- page -= size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
-@@ -115,7 +123,12 @@
- page += size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) /* PAX is enabled */
-+ {
-+ result = 0;
-+ goto out;
-+ }
-+ else if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
diff --git a/patches/glibc/ports-2.13/350-pre20040117-pt_pax.patch b/patches/glibc/ports-2.13/350-pre20040117-pt_pax.patch
deleted file mode 100644
index f8f6b83..0000000
--- a/patches/glibc/ports-2.13/350-pre20040117-pt_pax.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-diff -durN glibc-2.13.orig/elf/elf.h glibc-2.13/elf/elf.h
---- glibc-2.13.orig/elf/elf.h 2009-04-15 02:15:54.000000000 +0200
-+++ glibc-2.13/elf/elf.h 2009-11-13 00:50:35.000000000 +0100
-@@ -580,6 +580,7 @@
- #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
- #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
- #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
- #define PT_LOSUNW 0x6ffffffa
- #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
- #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
-@@ -593,6 +594,18 @@
- #define PF_X (1 << 0) /* Segment is executable */
- #define PF_W (1 << 1) /* Segment is writable */
- #define PF_R (1 << 2) /* Segment is readable */
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
- #define PF_MASKOS 0x0ff00000 /* OS-specific */
- #define PF_MASKPROC 0xf0000000 /* Processor-specific */
-
diff --git a/patches/glibc/ports-2.13/360-tests-sandbox-libdl-paths.patch b/patches/glibc/ports-2.13/360-tests-sandbox-libdl-paths.patch
deleted file mode 100644
index 9f78c52..0000000
--- a/patches/glibc/ports-2.13/360-tests-sandbox-libdl-paths.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-when glibc runs its tests, it does so by invoking the local library loader.
-in Gentoo, we build/run inside of our "sandbox" which itself is linked against
-libdl (so that it can load libraries and pull out symbols). the trouble
-is that when you upgrade from an older glibc to the new one, often times
-internal symbols change name or abi. this is normally OK as you cannot use
-libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
-we always say "keep all of the glibc libraries from the same build". but
-when glibc runs its tests, it uses dynamic paths to point to its new local
-copies of libraries. if the test doesnt use libdl, then glibc doesnt add
-its path, and when sandbox triggers the loading of libdl, glibc does so
-from the host system system. this gets us into the case of all libraries
-are from the locally compiled version of glibc except for libdl.so.
-
-Fix by Wormo
-
-http://bugs.gentoo.org/56898
-
-diff -durN glibc-2.13.orig/grp/tst_fgetgrent.sh glibc-2.13/grp/tst_fgetgrent.sh
---- glibc-2.13.orig/grp/tst_fgetgrent.sh 2001-07-06 06:54:46.000000000 +0200
-+++ glibc-2.13/grp/tst_fgetgrent.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -24,7 +24,8 @@
- rtld_installed_name=$1; shift
-
- testout=${common_objpfx}/grp/tst_fgetgrent.out
--library_path=${common_objpfx}
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-
- result=0
-
-diff -durN glibc-2.13.orig/iconvdata/run-iconv-test.sh glibc-2.13/iconvdata/run-iconv-test.sh
---- glibc-2.13.orig/iconvdata/run-iconv-test.sh 2008-05-15 03:59:44.000000000 +0200
-+++ glibc-2.13/iconvdata/run-iconv-test.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -34,7 +34,7 @@
- export GCONV_PATH
-
- # We have to have some directories in the library path.
--LIBPATH=$codir:$codir/iconvdata
-+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
-
- # How the start the iconv(1) program.
- ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
-diff -durN glibc-2.13.orig/iconvdata/tst-table.sh glibc-2.13/iconvdata/tst-table.sh
---- glibc-2.13.orig/iconvdata/tst-table.sh 2002-04-24 23:39:35.000000000 +0200
-+++ glibc-2.13/iconvdata/tst-table.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -59,8 +59,11 @@
- irreversible=${charset}.irreversible
- fi
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # iconv in one direction.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-table-from ${charset} \
- > ${objpfx}tst-${charset}.table
-
-diff -durN glibc-2.13.orig/intl/tst-codeset.sh glibc-2.13/intl/tst-codeset.sh
---- glibc-2.13.orig/intl/tst-codeset.sh 2005-04-06 04:18:35.000000000 +0200
-+++ glibc-2.13/intl/tst-codeset.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -37,6 +37,9 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- ${common_objpfx}elf/ld.so --library-path $common_objpfx \
- ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
-
-diff -durN glibc-2.13.orig/intl/tst-gettext.sh glibc-2.13/intl/tst-gettext.sh
---- glibc-2.13.orig/intl/tst-gettext.sh 2004-08-15 21:28:18.000000000 +0200
-+++ glibc-2.13/intl/tst-gettext.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -51,9 +51,12 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
- MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2.13.orig/intl/tst-gettext2.sh glibc-2.13/intl/tst-gettext2.sh
---- glibc-2.13.orig/intl/tst-gettext2.sh 2005-05-04 19:54:48.000000000 +0200
-+++ glibc-2.13/intl/tst-gettext2.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -65,8 +65,11 @@
- LOCPATH=${objpfx}domaindir
- export LOCPATH
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- # Now run the test.
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
- cmp ${objpfx}tst-gettext2.out - <<EOF
- String1 - Lang1: 1st string
-diff -durN glibc-2.13.orig/intl/tst-translit.sh glibc-2.13/intl/tst-translit.sh
---- glibc-2.13.orig/intl/tst-translit.sh 2005-05-04 19:56:10.000000000 +0200
-+++ glibc-2.13/intl/tst-translit.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -36,7 +36,10 @@
- LOCPATH=${common_objpfx}localedata
- export LOCPATH
-
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
-
- exit $?
-diff -durN glibc-2.13.orig/malloc/tst-mtrace.sh glibc-2.13/malloc/tst-mtrace.sh
---- glibc-2.13.orig/malloc/tst-mtrace.sh 2005-10-15 01:40:35.000000000 +0200
-+++ glibc-2.13/malloc/tst-mtrace.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -24,9 +24,12 @@
- status=0
- trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
- LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
--${common_objpfx}elf/ld.so --library-path $common_objpfx \
-+${common_objpfx}elf/ld.so --library-path $library_path \
- ${common_objpfx}malloc/tst-mtrace || status=1
-
- if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
-diff -durN glibc-2.13.orig/nptl/tst-tls6.sh glibc-2.13/nptl/tst-tls6.sh
---- glibc-2.13.orig/nptl/tst-tls6.sh 2003-09-03 00:02:59.000000000 +0200
-+++ glibc-2.13/nptl/tst-tls6.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -5,8 +5,8 @@
- rtld_installed_name=$1; shift
- logfile=$common_objpfx/nptl/tst-tls6.out
-
--# We have to find libc and nptl
--library_path=${common_objpfx}:${common_objpfx}nptl
-+# We have to find libc and nptl (also libdl in case sandbox is in use)
-+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
- tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}/nptl/tst-tls5"
-
-diff -durN glibc-2.13.orig/posix/globtest.sh glibc-2.13/posix/globtest.sh
---- glibc-2.13.orig/posix/globtest.sh 2008-12-06 07:05:39.000000000 +0100
-+++ glibc-2.13/posix/globtest.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -18,7 +18,7 @@
- esac
-
- # We have to find the libc and the NSS modules.
--library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
-+library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
-
- # Since we use `sort' we must make sure to use the same locale everywhere.
- LC_ALL=C
-diff -durN glibc-2.13.orig/posix/tst-getconf.sh glibc-2.13/posix/tst-getconf.sh
---- glibc-2.13.orig/posix/tst-getconf.sh 2002-09-01 13:11:25.000000000 +0200
-+++ glibc-2.13/posix/tst-getconf.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -10,7 +10,10 @@
- else
- rtld_installed_name=$1; shift
- runit() {
-- ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
-+
-+ # make sure libdl is also in path in case sandbox is in use
-+ library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+ ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
- }
- fi
-
-diff -durN glibc-2.13.orig/posix/wordexp-tst.sh glibc-2.13/posix/wordexp-tst.sh
---- glibc-2.13.orig/posix/wordexp-tst.sh 2000-10-20 18:23:30.000000000 +0200
-+++ glibc-2.13/posix/wordexp-tst.sh 2009-11-13 00:50:37.000000000 +0100
-@@ -19,8 +19,11 @@
- "
- export IFS
-
-+# make sure libdl is also in path in case sandbox is in use
-+library_path=${common_objpfx}:${common_objpfx}/dlfcn
-+
- failed=0
--${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
-+${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
- ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
- cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
- wordexp returned 0
diff --git a/patches/glibc/ports-2.13/380-dont-build-timezone.patch b/patches/glibc/ports-2.13/380-dont-build-timezone.patch
deleted file mode 100644
index 11c358e..0000000
--- a/patches/glibc/ports-2.13/380-dont-build-timezone.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-timezone data has been split into the package sys-libs/timezone-data
-
-diff -durN glibc-2.13.orig/Makeconfig glibc-2.13/Makeconfig
---- glibc-2.13.orig/Makeconfig 2009-11-13 00:50:13.000000000 +0100
-+++ glibc-2.13/Makeconfig 2009-11-13 00:50:41.000000000 +0100
-@@ -944,7 +944,7 @@
- stdlib stdio-common libio malloc string wcsmbs time dirent \
- grp pwd posix io termios resource misc socket sysvipc gmon \
- gnulib iconv iconvdata wctype manual shadow gshadow po argp \
-- crypt nss localedata timezone rt conform debug \
-+ crypt nss localedata rt conform debug \
- $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
-
- ifndef avoid-generated
diff --git a/patches/glibc/ports-2.13/400-alpha-xstat.patch b/patches/glibc/ports-2.13/400-alpha-xstat.patch
deleted file mode 100644
index 6e4ab8f..0000000
--- a/patches/glibc/ports-2.13/400-alpha-xstat.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.13/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/kernel-features.h 2009-05-09 08:54:20.000000000 +0200
-+++ glibc-2.13/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:50:45.000000000 +0100
-@@ -386,6 +386,11 @@
- # define __ASSUME_GETDENTS32_D_TYPE 1
- #endif
-
-+/* Starting with version 2.6.4, alpha stat64 syscalls are available. */
-+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
-+# define __ASSUME_STAT64_SYSCALL 1
-+#endif
-+
- /* Starting with version 2.5.3, the initial location returned by `brk'
- after exec is always rounded up to the next page. */
- #if __LINUX_KERNEL_VERSION >= 132355
diff --git a/patches/glibc/ports-2.13/410-alpha-SETPIPE-GETPIPE.patch b/patches/glibc/ports-2.13/410-alpha-SETPIPE-GETPIPE.patch
deleted file mode 100644
index fd55537..0000000
--- a/patches/glibc/ports-2.13/410-alpha-SETPIPE-GETPIPE.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-2011-02-28 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h (F_SETPIPE_SZ,
- F_GETPIPE_SZ): Define.
-
-diff --git glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
-index 860e9ac..e5e726b 100644
---- glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
-@@ -97,6 +97,8 @@
- # define F_SETLEASE 1024 /* Set a lease. */
- # define F_GETLEASE 1025 /* Enquire what lease is active. */
- # define F_NOTIFY 1026 /* Request notfications on a directory. */
-+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
-+# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
- #endif
- #ifdef __USE_XOPEN2K8
- # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
-
diff --git a/patches/glibc/ports-2.13/420-alpha-statfs.patch b/patches/glibc/ports-2.13/420-alpha-statfs.patch
deleted file mode 100644
index 65c925a..0000000
--- a/patches/glibc/ports-2.13/420-alpha-statfs.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-2011-02-28 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/mips/bits/statfs.h (struct statfs,
- struct statfs64): Add f_flags field.
-
-diff --git glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/statfs.h glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
-index d838e6b..157591d 100644
---- glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/bits/statfs.h
-@@ -42,7 +42,8 @@ struct statfs
- __fsid_t f_fsid;
- int f_namelen;
- int f_frsize;
-- int f_spare[5];
-+ int f_flags;
-+ int f_spare[4];
- };
-
- #ifdef __USE_LARGEFILE64
-@@ -58,7 +59,8 @@ struct statfs64
- __fsid_t f_fsid;
- int f_namelen;
- int f_frsize;
-- int f_spare[5];
-+ int f_flags;
-+ int f_spare[4];
- };
- #endif
-
diff --git a/patches/glibc/ports-2.13/430-alpha-creat.patch b/patches/glibc/ports-2.13/430-alpha-creat.patch
deleted file mode 100644
index da6ddda..0000000
--- a/patches/glibc/ports-2.13/430-alpha-creat.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-alpha does not have a __NR_creat
-
-http://bugs.gentoo.org/227275
-http://sourceware.org/bugzilla/show_bug.cgi?id=6650
-
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c glibc-2.13/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2007-11-10 20:34:26.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/wordsize-64/creat64.c 2009-11-13 00:50:51.000000000 +0100
-@@ -1 +1,5 @@
- /* Defined as alias for the syscall. */
-+#include <sysdep.h>
-+#ifndef __NR_creat
-+#include "../../../../../io/creat64.c"
-+#endif
diff --git a/patches/glibc/ports-2.13/440-alpha-cache-shape.patch b/patches/glibc/ports-2.13/440-alpha-cache-shape.patch
deleted file mode 100644
index 62ade7b..0000000
--- a/patches/glibc/ports-2.13/440-alpha-cache-shape.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-older verisons of glibc would build dl-sysdep as shared-only and dl-support as
-static-only. alpha hooks in a cache variable via dl-auxv.h. newer versions of
-glibc build dl-sysdep as both shared and static which means we now have symbol
-duplication for static builds with dl-sysdep and dl-support. since dl-sysdep
-is both shared/static, there is no point in hooking dl-support anymore, so we
-can punt it.
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/dl-support.c glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/dl-support.c
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/dl-support.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/dl-support.c 2009-11-13 00:50:53.000000000 +0100
-@@ -1,2 +1,1 @@
--#include "dl-auxv.h"
- #include <elf/dl-support.c>
diff --git a/patches/glibc/ports-2.13/450-alpha-DEFAULT_STACK_PERMS.patch b/patches/glibc/ports-2.13/450-alpha-DEFAULT_STACK_PERMS.patch
deleted file mode 100644
index ac3ea9a..0000000
--- a/patches/glibc/ports-2.13/450-alpha-DEFAULT_STACK_PERMS.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-2011-02-28 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/alpha/stackinfo.h: Define DEFAULT_STACK_PERMS with PF_X.
-
-diff --git glibc-2.13/glibc-ports-2.13/sysdeps/alpha/stackinfo.h glibc-2.13/glibc-ports-2.13/sysdeps/alpha/stackinfo.h
-index 0a281bd..d9dbc35 100644
---- glibc-2.13/glibc-ports-2.13/sysdeps/alpha/stackinfo.h
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/alpha/stackinfo.h
-@@ -22,7 +22,13 @@
- #ifndef _STACKINFO_H
- #define _STACKINFO_H 1
-
-+#include <elf.h>
-+
- /* On Alpha the stack grows down. */
- #define _STACK_GROWS_DOWN 1
-
-+/* Default to an executable stack. PF_X can be overridden if PT_GNU_STACK is
-+ * present, but it is presumed absent. */
-+#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
-+
- #endif /* stackinfo.h */
-
diff --git a/patches/glibc/ports-2.13/460-alpha-fix-gcc-4.1-warnings.patch b/patches/glibc/ports-2.13/460-alpha-fix-gcc-4.1-warnings.patch
deleted file mode 100644
index 313e0e0..0000000
--- a/patches/glibc/ports-2.13/460-alpha-fix-gcc-4.1-warnings.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-2006-05-30 Falk Hueffner <falk@debian.org>
-
- * sysdeps/unix/sysv/linux/alpha/ioperm.c: force the architecture
- to ev6 in assembly code.
-
-{standard input}: Assembler messages:
-{standard input}:341: Error: macro requires $at register while noat in effect
-{standard input}:374: Error: macro requires $at register while noat in effect
-{standard input}:438: Error: macro requires $at register while noat in effect
-{standard input}:471: Error: macro requires $at register while noat in effect
-make[3]: *** [/tmp/buildd/glibc-2.3.6/build-tree/alpha-libc/misc/ioperm.o] Error 1
-
-Hrm. gcc puts .arch ev4 into the .s, and this overrides -mev6 for as.
-I cannot really think of anything better than
-
- ports/sysdeps/unix/sysv/linux/alpha/ioperm.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/ioperm.c
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/ioperm.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/alpha/ioperm.c 2009-11-13 00:50:57.000000000 +0100
-@@ -178,13 +178,13 @@
- static inline void
- stb_mb(unsigned char val, unsigned long addr)
- {
-- __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
-+ __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
- }
-
- static inline void
- stw_mb(unsigned short val, unsigned long addr)
- {
-- __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
-+ __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
- }
-
- static inline void
-@@ -356,7 +356,7 @@
- unsigned long int addr = dense_port_to_cpu_addr (port);
- unsigned char r;
-
-- __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
-+ __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
- return r;
- }
-
-@@ -366,7 +366,7 @@
- unsigned long int addr = dense_port_to_cpu_addr (port);
- unsigned short r;
-
-- __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
-+ __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
- return r;
- }
-
-diff -durN glibc-2.13.orig/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.13/ports/sysdeps/unix/sysv/linux/alpha/ioperm.c
diff --git a/patches/glibc/ports-2.13/470-alpha-feupdateenv.patch b/patches/glibc/ports-2.13/470-alpha-feupdateenv.patch
deleted file mode 100644
index 45a7051..0000000
--- a/patches/glibc/ports-2.13/470-alpha-feupdateenv.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-2011-03-01 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/alpha/fpu/feupdateenv.c (feupdateenv): Add
- libm_hidden_def.
- * sysdeps/alpha/fpu/ftestexcept.c (fetestexcept): Likewise.
-
-diff --git glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/feupdateenv.c glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/feupdateenv.c
-index c798070..9abbf11 100644
---- glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/feupdateenv.c
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/feupdateenv.c
-@@ -46,4 +46,5 @@ strong_alias (__feupdateenv, __old_feupdateenv)
- compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
- #endif
-
-+libm_hidden_ver (__feupdateenv, feupdateenv)
- versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
-diff --git glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/ftestexcept.c glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/ftestexcept.c
-index a4b3081..34d8113 100644
---- glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/ftestexcept.c
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/alpha/fpu/ftestexcept.c
-@@ -30,3 +30,4 @@ fetestexcept (int excepts)
-
- return tmp & excepts & SWCR_STATUS_MASK;
- }
-+libm_hidden_def (fetestexcept)
-
diff --git a/patches/glibc/ports-2.13/490-alpha_alpha-add-fdatasync-support.patch b/patches/glibc/ports-2.13/490-alpha_alpha-add-fdatasync-support.patch
deleted file mode 100644
index 372f34c..0000000
--- a/patches/glibc/ports-2.13/490-alpha_alpha-add-fdatasync-support.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-2009-07-25 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/unix/sysv/linux/kernel-features.h: define
- __ASSUME_FDATASYNC.
- * sysdeps/unix/sysv/linux/fdatasync.c: New file.
- * sysdeps/unix/sysv/linux/Makefile: compile fdatasync.c with
- -fexceptions.
- * sysdeps/unix/sysv/linux/syscalls.list: Remove fdatasync.
-
- sysdeps/unix/sysv/linux/Makefile | 1
- sysdeps/unix/sysv/linux/fdatasync.c | 69 ++++++++++++++++++++++++++++++
- sysdeps/unix/sysv/linux/kernel-features.h | 6 ++
- sysdeps/unix/sysv/linux/syscalls.list | 1
- 4 files changed, 76 insertions(+), 1 deletion(-)
-
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/Makefile glibc-2.13/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/Makefile 2009-03-02 17:15:13.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/Makefile 2009-11-13 00:51:04.000000000 +0100
-@@ -20,6 +20,7 @@
- setfsuid setfsgid makedev epoll_pwait signalfd \
- eventfd eventfd_read eventfd_write prlimit
-
-+CFLAGS-fdatasync.c = -fexceptions
- CFLAGS-gethostid.c = -fexceptions
-
- sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/fdatasync.c glibc-2.13/sysdeps/unix/sysv/linux/fdatasync.c
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/fdatasync.c 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/fdatasync.c 2009-11-13 00:51:04.000000000 +0100
-@@ -0,0 +1,69 @@
-+/* fdatasync -- synchronize at least the data part of a file with
-+ the underlying media. Linux version.
-+
-+ Copyright (C) 2007 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <errno.h>
-+#include <unistd.h>
-+
-+#include <sysdep-cancel.h>
-+#include <sys/syscall.h>
-+#include <bp-checks.h>
-+
-+#include <kernel-features.h>
-+
-+#if defined __NR_fdatasync && !defined __ASSUME_FDATASYNC
-+static int __have_no_fdatasync;
-+#endif
-+
-+static int
-+do_fdatasync (int fd)
-+{
-+#ifdef __ASSUME_FDATASYNC
-+ return INLINE_SYSCALL (fdatasync, 1, fd);
-+#elif defined __NR_fdatasync
-+ if (!__builtin_expect (__have_no_fdatasync, 0))
-+ {
-+ int result = INLINE_SYSCALL (fdatasync, 1, fd);
-+ if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
-+ return result;
-+
-+ __have_no_fdatasync = 1;
-+ }
-+#endif
-+ return INLINE_SYSCALL (fsync, 1, fd);
-+}
-+
-+int
-+__fdatasync (int fd)
-+{
-+ if (SINGLE_THREAD_P)
-+ return do_fdatasync (fd);
-+
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+
-+ int result = do_fdatasync (fd);
-+
-+ LIBC_CANCEL_RESET (oldtype);
-+
-+ return result;
-+}
-+
-+weak_alias (__fdatasync, fdatasync)
-+
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.13/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:50:45.000000000 +0100
-+++ glibc-2.13/sysdeps/unix/sysv/linux/kernel-features.h 2009-11-13 00:51:04.000000000 +0100
-@@ -459,6 +459,12 @@
- # define __ASSUME_FUTEX_LOCK_PI 1
- #endif
-
-+/* Support for fsyncdata syscall was added in 2.6.22 on alpha, but it
-+ was already present in 2.0 kernels on other architectures. */
-+#if (!defined __alpha || __LINUX_KERNEL_VERSION >= 0x020616)
-+# define __ASSUME_FDATASYNC 1
-+#endif
-+
- /* Support for utimensat syscall was added in 2.6.22, on SH
- only after 2.6.22-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020616 \
-diff -durN glibc-2.13.orig/sysdeps/unix/sysv/linux/syscalls.list glibc-2.13/sysdeps/unix/sysv/linux/syscalls.list
---- glibc-2.13.orig/sysdeps/unix/sysv/linux/syscalls.list 2008-08-02 01:29:08.000000000 +0200
-+++ glibc-2.13/sysdeps/unix/sysv/linux/syscalls.list 2009-11-13 00:51:04.000000000 +0100
-@@ -11,7 +11,6 @@
- epoll_create1 EXTRA epoll_create1 i:i epoll_create1
- epoll_ctl EXTRA epoll_ctl i:iiip epoll_ctl
- epoll_wait EXTRA epoll_wait Ci:ipii epoll_wait
--fdatasync - fdatasync Ci:i fdatasync
- flock - flock i:ii __flock flock
- fork - fork i: __libc_fork __fork fork
- get_kernel_syms EXTRA get_kernel_syms i:p get_kernel_syms
diff --git a/patches/glibc/ports-2.13/530-alpha-fix-rtld-fPIC.patch b/patches/glibc/ports-2.13/530-alpha-fix-rtld-fPIC.patch
deleted file mode 100644
index b2ae9b5..0000000
--- a/patches/glibc/ports-2.13/530-alpha-fix-rtld-fPIC.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-2009-05-26 Aurelien Jarno <aurelien@aurel32.net>
-
- * sysdeps/alpha/Makefile (CFLAGS-rtld.c): add $(PIC-ccflag).
-
- ports/sysdeps/alpha/Makefile | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/alpha/Makefile glibc-2.13/glibc-ports-2.13/sysdeps/alpha/Makefile
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/alpha/Makefile 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/alpha/Makefile 2009-11-13 00:51:13.000000000 +0100
-@@ -35,7 +35,8 @@
-
- ifeq ($(subdir),elf)
- # The ld.so startup code cannot use literals until it self-relocates.
--CFLAGS-rtld.c = -mbuild-constants
-+# It uses more than 64k for the small data area.
-+CFLAGS-rtld.c = -mbuild-constants $(PIC-ccflag)
- endif
-
- # Build everything with full IEEE math support, and with dynamic rounding;
-diff -durN glibc-2.13.orig/ports/sysdeps/alpha/Makefile glibc-2.13/ports/sysdeps/alpha/Makefile
diff --git a/patches/glibc/ports-2.13/560-ppc-atomic.patch b/patches/glibc/ports-2.13/560-ppc-atomic.patch
deleted file mode 100644
index ee1cb90..0000000
--- a/patches/glibc/ports-2.13/560-ppc-atomic.patch
+++ /dev/null
@@ -1,415 +0,0 @@
-sniped from suse
-
-Index: sysdeps/powerpc/bits/atomic.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/powerpc/bits/atomic.h,v
-retrieving revision 1.17
-diff -u -a -p -r1.17 atomic.h
-
-diff -durN glibc-2.13.orig/sysdeps/powerpc/bits/atomic.h glibc-2.13/sysdeps/powerpc/bits/atomic.h
---- glibc-2.13.orig/sysdeps/powerpc/bits/atomic.h 2007-03-26 22:15:28.000000000 +0200
-+++ glibc-2.13/sysdeps/powerpc/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -85,14 +85,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -102,14 +102,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpw %0,%2\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -118,12 +118,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -132,11 +132,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stwcx. %3,0,%2\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stwcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -144,12 +144,12 @@
- #define __arch_atomic_exchange_and_add_32(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stwcx. %1,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -157,12 +157,12 @@
- #define __arch_atomic_increment_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -170,27 +170,27 @@
- #define __arch_atomic_decrement_val_32(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: lwarx %0,0,%2\n" \
-+ __asm __volatile ("1: lwarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stwcx. %0,0,%2\n" \
-+ " stwcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_32(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: lwarx %0,0,%3\n" \
-+ __asm __volatile ("1: lwarx %0,%y2\n" \
- " cmpwi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stwcx. %1,0,%3\n" \
-+ " stwcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*mem) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-diff -durN glibc-2.13.orig/sysdeps/powerpc/powerpc32/bits/atomic.h glibc-2.13/sysdeps/powerpc/powerpc32/bits/atomic.h
---- glibc-2.13.orig/sysdeps/powerpc/powerpc32/bits/atomic.h 2007-03-26 22:15:45.000000000 +0200
-+++ glibc-2.13/sysdeps/powerpc/powerpc32/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile ( \
-- "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -60,14 +60,14 @@
- ({ \
- unsigned int __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stwcx. %3,0,%1\n" \
-+ " stwcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-diff -durN glibc-2.13.orig/sysdeps/powerpc/powerpc64/bits/atomic.h glibc-2.13/sysdeps/powerpc/powerpc64/bits/atomic.h
---- glibc-2.13.orig/sysdeps/powerpc/powerpc64/bits/atomic.h 2007-03-26 22:16:03.000000000 +0200
-+++ glibc-2.13/sysdeps/powerpc/powerpc64/bits/atomic.h 2009-11-13 00:51:19.000000000 +0100
-@@ -44,14 +44,14 @@
- ({ \
- unsigned int __tmp, __tmp2; \
- __asm __volatile (" clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -61,14 +61,14 @@
- unsigned int __tmp, __tmp2; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
- " clrldi %1,%1,32\n" \
-- "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: lwarx %0,%y2" MUTEX_HINT_REL "\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
-- " stwcx. %4,0,%2\n" \
-+ " stwcx. %4,%y2\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp), "=r" (__tmp2) \
-- : "b" (mem), "1" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "=r" (__tmp2), "+Z" (*(mem)) \
-+ : "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -82,14 +82,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -98,14 +98,14 @@
- ({ \
- unsigned long __tmp; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (mem), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
- })
-@@ -115,14 +115,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile ( \
-- "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -132,14 +132,14 @@
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%1" MUTEX_HINT_REL "\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
-- " stdcx. %3,0,%1\n" \
-+ " stdcx. %3,%y1\n" \
- " bne- 1b\n" \
- "2: " \
-- : "=&r" (__tmp) \
-- : "b" (__memp), "r" (oldval), "r" (newval) \
-+ : "=&r" (__tmp), "+Z" (*__memp) \
-+ : "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-@@ -148,12 +148,12 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_ACQ "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -162,11 +162,11 @@
- ({ \
- __typeof (*mem) __val; \
- __asm __volatile (__ARCH_REL_INSTR "\n" \
-- "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
-- " stdcx. %3,0,%2\n" \
-+ "1: ldarx %0,%y1" MUTEX_HINT_REL "\n" \
-+ " stdcx. %2,%y1\n" \
- " bne- 1b" \
-- : "=&r" (__val), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&r" (__val), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -174,12 +174,12 @@
- #define __arch_atomic_exchange_and_add_64(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-- " add %1,%0,%4\n" \
-- " stdcx. %1,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
-+ " add %1,%0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "r" (value), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : "r" (value) \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -187,12 +187,12 @@
- #define __arch_atomic_increment_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " addi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-@@ -200,27 +200,27 @@
- #define __arch_atomic_decrement_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
-- __asm __volatile ("1: ldarx %0,0,%2\n" \
-+ __asm __volatile ("1: ldarx %0,%y1\n" \
- " subi %0,%0,1\n" \
-- " stdcx. %0,0,%2\n" \
-+ " stdcx. %0,%y1\n" \
- " bne- 1b" \
-- : "=&b" (__val), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
-
- #define __arch_atomic_decrement_if_positive_64(mem) \
- ({ int __val, __tmp; \
-- __asm __volatile ("1: ldarx %0,0,%3\n" \
-+ __asm __volatile ("1: ldarx %0,%y2\n" \
- " cmpdi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
-- " stdcx. %1,0,%3\n" \
-+ " stdcx. %1,%y2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
-- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
-- : "b" (mem), "m" (*mem) \
-+ : "=&b" (__val), "=&r" (__tmp), "+Z" (*(mem)) \
-+ : \
- : "cr0", "memory"); \
- __val; \
- })
diff --git a/patches/glibc/ports-2.13/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch b/patches/glibc/ports-2.13/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch
deleted file mode 100644
index 4f4dbec..0000000
--- a/patches/glibc/ports-2.13/570-arm-cirrus-ep93xx-maverick-crunch-fpu.patch
+++ /dev/null
@@ -1,374 +0,0 @@
-http://yann.poupet.free.fr/ep93xx/
-Add support for the Maverick Crunch FPU on Cirrus EP93XX processor series
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/bits/endian.h glibc-2.13/glibc-ports-2.13/sysdeps/arm/bits/endian.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/bits/endian.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/bits/endian.h 2009-11-13 00:51:22.000000000 +0100
-@@ -12,7 +12,7 @@
- /* FPA floating point units are always big-endian, irrespective of the
- CPU endianness. VFP floating point units use the same endianness
- as the rest of the system. */
--#ifdef __VFP_FP__
-+#if defined __VFP_FP__ || defined __MAVERICK__
- #define __FLOAT_WORD_ORDER __BYTE_ORDER
- #else
- #define __FLOAT_WORD_ORDER __BIG_ENDIAN
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/__longjmp.S glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/__longjmp.S
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/__longjmp.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/__longjmp.S 2009-11-13 00:51:22.000000000 +0100
-@@ -30,7 +30,33 @@
- movs r0, r1 /* get the return value in place */
- moveq r0, #1 /* can't let setjmp() return zero! */
-
-+#ifdef __MAVERICK__
-+ cfldrd mvd4, [ip], #8
-+ nop
-+ cfldrd mvd5, [ip], #8
-+ nop
-+ cfldrd mvd6, [ip], #8
-+ nop
-+ cfldrd mvd7, [ip], #8
-+ nop
-+ cfldrd mvd8, [ip], #8
-+ nop
-+ cfldrd mvd9, [ip], #8
-+ nop
-+ cfldrd mvd10, [ip], #8
-+ nop
-+ cfldrd mvd11, [ip], #8
-+ nop
-+ cfldrd mvd12, [ip], #8
-+ nop
-+ cfldrd mvd13, [ip], #8
-+ nop
-+ cfldrd mvd14, [ip], #8
-+ nop
-+ cfldrd mvd15, [ip], #8
-+#else
- lfmfd f4, 4, [ip] ! /* load the floating point regs */
-+#endif
-
- LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
- END (__longjmp)
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/bits/fenv.h glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/bits/fenv.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/bits/fenv.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/bits/fenv.h 2009-11-13 00:51:22.000000000 +0100
-@@ -20,6 +20,45 @@
- # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
- #endif
-
-+#if defined(__MAVERICK__)
-+
-+/* Define bits representing exceptions in the FPU status word. */
-+enum
-+ {
-+ FE_INVALID = 1,
-+#define FE_INVALID FE_INVALID
-+ FE_OVERFLOW = 4,
-+#define FE_OVERFLOW FE_OVERFLOW
-+ FE_UNDERFLOW = 8,
-+#define FE_UNDERFLOW FE_UNDERFLOW
-+ FE_INEXACT = 16,
-+#define FE_INEXACT FE_INEXACT
-+ };
-+
-+/* Amount to shift by to convert an exception to a mask bit. */
-+#define FE_EXCEPT_SHIFT 5
-+
-+/* All supported exceptions. */
-+#define FE_ALL_EXCEPT \
-+ (FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
-+
-+/* IEEE rounding modes. */
-+enum
-+ {
-+ FE_TONEAREST = 0,
-+#define FE_TONEAREST FE_TONEAREST
-+ FE_TOWARDZERO = 0x400,
-+#define FE_TOWARDZERO FE_TOWARDZERO
-+ FE_DOWNWARD = 0x800,
-+#define FE_DOWNWARD FE_DOWNWARD
-+ FE_UPWARD = 0xc00,
-+#define FE_UPWARD FE_UPWARD
-+ };
-+
-+#define FE_ROUND_MASK (FE_UPWARD)
-+
-+#else /* FPA */
-+
- /* Define bits representing exceptions in the FPU status word. */
- enum
- {
-@@ -44,6 +83,8 @@
- modes exist, but you have to encode them in the actual instruction. */
- #define FE_TONEAREST 0
-
-+#endif
-+
- /* Type representing exception flags. */
- typedef unsigned long int fexcept_t;
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/bits/setjmp.h glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/bits/setjmp.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/bits/setjmp.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/bits/setjmp.h 2009-11-13 00:51:22.000000000 +0100
-@@ -28,7 +28,11 @@
- #ifndef _ASM
- /* Jump buffer contains v1-v6, sl, fp, sp and pc. Other registers are not
- saved. */
-+#ifdef __MAVERICK__
-+typedef int __jmp_buf[34];
-+#else
- typedef int __jmp_buf[22];
- #endif
-+#endif
-
- #endif
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/fegetround.c glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/fegetround.c
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/fegetround.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/fegetround.c 2009-11-13 00:51:22.000000000 +0100
-@@ -18,9 +18,21 @@
- 02111-1307 USA. */
-
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fegetround (void)
- {
-+#if defined(__MAVERICK__)
-+
-+ unsigned long temp;
-+
-+ _FPU_GETCW (temp);
-+ return temp & FE_ROUND_MASK;
-+
-+#else /* FPA */
-+
- return FE_TONEAREST; /* Easy. :-) */
-+
-+#endif
- }
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/fesetround.c glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/fesetround.c
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/fesetround.c 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/fesetround.c 2009-11-13 00:51:22.000000000 +0100
-@@ -18,12 +18,28 @@
- 02111-1307 USA. */
-
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fesetround (int round)
- {
-+#if defined(__MAVERICK__)
-+ unsigned long temp;
-+
-+ if (round & ~FE_ROUND_MASK)
-+ return 1;
-+
-+ _FPU_GETCW (temp);
-+ temp = (temp & ~FE_ROUND_MASK) | round;
-+ _FPU_SETCW (temp);
-+ return 0;
-+
-+#else /* FPA */
-+
- /* We only support FE_TONEAREST, so there is no need for any work. */
- return (round == FE_TONEAREST)?0:1;
-+
-+#endif
- }
-
- libm_hidden_def (fesetround)
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/fpu_control.h glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/fpu_control.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/fpu_control.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/fpu_control.h 2009-11-13 00:51:22.000000000 +0100
-@@ -1,5 +1,6 @@
- /* FPU control word definitions. ARM version.
-- Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
-+ Copyright (C) 1996, 1997, 1998, 2000, 2005
-+ Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
-@@ -20,6 +21,79 @@
- #ifndef _FPU_CONTROL_H
- #define _FPU_CONTROL_H
-
-+#if defined(__MAVERICK__)
-+
-+/* DSPSC register: (from EP9312 User's Guide)
-+ *
-+ * bits 31..29 - DAID
-+ * bits 28..26 - HVID
-+ * bits 25..24 - RSVD
-+ * bit 23 - ISAT
-+ * bit 22 - UI
-+ * bit 21 - INT
-+ * bit 20 - AEXC
-+ * bits 19..18 - SAT
-+ * bits 17..16 - FCC
-+ * bit 15 - V
-+ * bit 14 - FWDEN
-+ * bit 13 - Invalid
-+ * bit 12 - Denorm
-+ * bits 11..10 - RM
-+ * bits 9..5 - IXE, UFE, OFE, RSVD, IOE
-+ * bits 4..0 - IX, UF, OF, RSVD, IO
-+ */
-+
-+/* masking of interrupts */
-+#define _FPU_MASK_IM (1 << 5) /* invalid operation */
-+#define _FPU_MASK_ZM 0 /* divide by zero */
-+#define _FPU_MASK_OM (1 << 7) /* overflow */
-+#define _FPU_MASK_UM (1 << 8) /* underflow */
-+#define _FPU_MASK_PM (1 << 9) /* inexact */
-+#define _FPU_MASK_DM 0 /* denormalized operation */
-+
-+#define _FPU_RESERVED 0xfffff000 /* These bits are reserved. */
-+
-+#define _FPU_DEFAULT 0x00b00000 /* Default value. */
-+#define _FPU_IEEE 0x00b003a0 /* Default + exceptions enabled. */
-+
-+/* Type of the control word. */
-+typedef unsigned int fpu_control_t;
-+
-+/* Macros for accessing the hardware control word. */
-+#define _FPU_GETCW(cw) ({ \
-+ register int __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv32sc mvdx0, dspsc\n\t" \
-+ "cfmvr64l %0, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (cw), "=r" (__t1), "=r" (__t2) \
-+ ); \
-+})
-+
-+#define _FPU_SETCW(cw) ({ \
-+ register int __t0, __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %0\n\t" \
-+ "cfmvsc32 dspsc, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (__t0), "=r" (__t1), "=r" (__t2) \
-+ : "0" (cw) \
-+ ); \
-+})
-+
-+/* Default control word set at startup. */
-+extern fpu_control_t __fpu_control;
-+
-+#else /* FPA */
-+
- /* We have a slight terminology confusion here. On the ARM, the register
- * we're interested in is actually the FPU status word - the FPU control
- * word is something different (which is implementation-defined and only
-@@ -99,4 +173,6 @@
- /* Default control word set at startup. */
- extern fpu_control_t __fpu_control;
-
-+#endif
-+
- #endif /* _FPU_CONTROL_H */
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/jmpbuf-offsets.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/jmpbuf-offsets.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/jmpbuf-offsets.h 2009-11-13 00:51:22.000000000 +0100
-@@ -17,4 +17,8 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#ifdef __MAVERICK__
-+#define __JMP_BUF_SP 32
-+#else
- #define __JMP_BUF_SP 20
-+#endif
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/setjmp.S glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/setjmp.S
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/fpu/setjmp.S 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/fpu/setjmp.S 2009-11-13 00:51:22.000000000 +0100
-@@ -24,11 +24,41 @@
-
- ENTRY (__sigsetjmp)
- /* Save registers */
-+#ifdef __MAVERICK__
-+ cfstrd mvd4, [r0], #8
-+ nop
-+ cfstrd mvd5, [r0], #8
-+ nop
-+ cfstrd mvd6, [r0], #8
-+ nop
-+ cfstrd mvd7, [r0], #8
-+ nop
-+ cfstrd mvd8, [r0], #8
-+ nop
-+ cfstrd mvd9, [r0], #8
-+ nop
-+ cfstrd mvd10, [r0], #8
-+ nop
-+ cfstrd mvd11, [r0], #8
-+ nop
-+ cfstrd mvd12, [r0], #8
-+ nop
-+ cfstrd mvd13, [r0], #8
-+ nop
-+ cfstrd mvd14, [r0], #8
-+ nop
-+ cfstrd mvd15, [r0], #8
-+#else
- sfmea f4, 4, [r0]!
-+#endif
- stmia r0, {v1-v6, sl, fp, sp, lr}
-
- /* Restore pointer to jmp_buf */
-+#ifdef __MAVERICK__
-+ sub r0, r0, #96
-+#else
- sub r0, r0, #48
-+#endif
-
- /* Make a tail call to __sigjmp_save; it takes the same args. */
- B PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/gccframe.h glibc-2.13/glibc-ports-2.13/sysdeps/arm/gccframe.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/gccframe.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/gccframe.h 2009-11-13 00:51:22.000000000 +0100
-@@ -17,6 +17,10 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#ifdef __MAVERICK__
-+#define FIRST_PSEUDO_REGISTER 43
-+#else
- #define FIRST_PSEUDO_REGISTER 27
-+#endif
-
- #include <sysdeps/generic/gccframe.h>
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/gmp-mparam.h glibc-2.13/glibc-ports-2.13/sysdeps/arm/gmp-mparam.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/arm/gmp-mparam.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/arm/gmp-mparam.h 2009-11-13 00:51:22.000000000 +0100
-@@ -29,7 +29,7 @@
- #if defined(__ARMEB__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 1
--#elif defined(__VFP_FP__)
-+#elif defined(__VFP_FP__) || defined(__MAVERICK__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 0
- #else
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/bits/endian.h glibc-2.13/ports/sysdeps/arm/bits/endian.h
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/__longjmp.S glibc-2.13/ports/sysdeps/arm/fpu/__longjmp.S
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/bits/fenv.h glibc-2.13/ports/sysdeps/arm/fpu/bits/fenv.h
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/bits/setjmp.h glibc-2.13/ports/sysdeps/arm/fpu/bits/setjmp.h
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/fegetround.c glibc-2.13/ports/sysdeps/arm/fpu/fegetround.c
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/fesetround.c glibc-2.13/ports/sysdeps/arm/fpu/fesetround.c
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/fpu_control.h glibc-2.13/ports/sysdeps/arm/fpu/fpu_control.h
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/jmpbuf-offsets.h glibc-2.13/ports/sysdeps/arm/fpu/jmpbuf-offsets.h
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/fpu/setjmp.S glibc-2.13/ports/sysdeps/arm/fpu/setjmp.S
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/gccframe.h glibc-2.13/ports/sysdeps/arm/gccframe.h
-diff -durN glibc-2.13.orig/ports/sysdeps/arm/gmp-mparam.h glibc-2.13/ports/sysdeps/arm/gmp-mparam.h
diff --git a/patches/glibc/ports-2.13/580-nptl-lowlevellock.patch b/patches/glibc/ports-2.13/580-nptl-lowlevellock.patch
deleted file mode 100644
index 08518e9..0000000
--- a/patches/glibc/ports-2.13/580-nptl-lowlevellock.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-fix build error on arm like on hppa:
-
-arm-unknown-linux-gnu-gcc ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -g -pipe -Wstrict-prototypes -fPIC -I../include -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl -I/var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/fpu -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include -isystem /usr/lib/gcc/arm-unknown-linux-gnu/4.3.2/include-fixed -isystem /usr/arm-unknown-linux-gnu/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -o /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -MD -MP -MF /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os.dt -MT /var/tmp/portage/cross-arm-unknown-linux-gnu/glibc-2.8_p20080602/work/build-default-arm-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os -DNOT_IN_libc=1 -DIS_IN_rtld=1
-In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21:
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private':
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: warning: implicit declaration of function 'THREAD_GETMEM'
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'THREAD_SELF' undeclared (first use in this function)
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: (Each undeclared identifier is reported only once
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: for each function it appears in.)
-../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:31: error: 'header' undeclared (first use in this function)
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-11-13 00:51:23.000000000 +0100
-@@ -25,6 +25,7 @@
- #include <atomic.h>
- #include <sysdep.h>
- #include <kernel-features.h>
-+#include <tls.h> /* Need THREAD_*, and header.*. */
-
- #define FUTEX_WAIT 0
- #define FUTEX_WAKE 1
-diff -durN glibc-2.13.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.13/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
diff --git a/patches/glibc/ports-2.13/610-fpu-cw-mips.patch b/patches/glibc/ports-2.13/610-fpu-cw-mips.patch
deleted file mode 100644
index cd2b4d9..0000000
--- a/patches/glibc/ports-2.13/610-fpu-cw-mips.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-http://sourceware.org/ml/libc-alpha/2002-10/msg00392.html
-
-diff -durN glibc-2.13.orig/glibc-ports-2.13/sysdeps/mips/fpu_control.h glibc-2.13/glibc-ports-2.13/sysdeps/mips/fpu_control.h
---- glibc-2.13.orig/glibc-ports-2.13/sysdeps/mips/fpu_control.h 2009-05-16 10:36:20.000000000 +0200
-+++ glibc-2.13/glibc-ports-2.13/sysdeps/mips/fpu_control.h 2009-11-13 00:51:31.000000000 +0100
-@@ -86,7 +86,7 @@
- #define _FPU_RC_UP 0x2
- #define _FPU_RC_DOWN 0x3
-
--#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */
-+#define _FPU_RESERVED 0xfebc0000 /* Reserved bits in cw */
-
-
- /* The fdlibm code requires strict IEEE double precision arithmetic,
-diff -durN glibc-2.13.orig/ports/sysdeps/mips/fpu_control.h glibc-2.13/ports/sysdeps/mips/fpu_control.h
diff --git a/patches/glibc/ports-2.13/630-mips_shn_undef-hack.patch b/patches/glibc/ports-2.13/630-mips_shn_undef-hack.patch
deleted file mode 100644
index 791d76c..0000000
--- a/patches/glibc/ports-2.13/630-mips_shn_undef-hack.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -durN glibc-2.13.orig/elf/dl-lookup.c glibc-2.13/elf/dl-lookup.c
---- glibc-2.13.orig/elf/dl-lookup.c 2009-03-30 23:14:32.000000000 +0200
-+++ glibc-2.13/elf/dl-lookup.c 2009-11-13 00:51:36.000000000 +0100
-@@ -301,6 +301,12 @@
- /* FALLTHROUGH */
- case STB_GLOBAL:
- success:
-+#ifdef __mips__
-+ /* HACK: MIPS marks its lazy evaluation stubs with SHN_UNDEF
-+ symbols, we skip them. */
-+ if (sym->st_shndx == SHN_UNDEF)
-+ break;
-+#endif
- /* Global definition. Just what we need. */
- result->s = sym;
- result->m = (struct link_map *) map;
diff --git a/patches/glibc/ports-2.13/640-alpha-atfcts.patch b/patches/glibc/ports-2.13/640-alpha-atfcts.patch
deleted file mode 100644
index 7a8a94a..0000000
--- a/patches/glibc/ports-2.13/640-alpha-atfcts.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- glibc-2.13/sysdeps/unix/sysv/linux/kernel-features.h 2010-07-27 14:34:39.000000000 +0300
-+++ glibc-2.13/sysdeps/unix/sysv/linux/kernel-features.h.new 2011-03-10 18:54:37.686795979 +0200
-@@ -437,7 +437,8 @@
- the code. On PPC they were introduced in 2.6.17-rc1,
- on SH in 2.6.19-rc1. */
- #if __LINUX_KERNEL_VERSION >= 0x020611 \
-- && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613)
-+ && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613) \
-+ && (!defined __alpha__)
- # define __ASSUME_ATFCTS 1
- #endif
-
diff --git a/patches/glibc/ports-2.13/650-syslog.patch b/patches/glibc/ports-2.13/650-syslog.patch
deleted file mode 100644
index c20cafc..0000000
--- a/patches/glibc/ports-2.13/650-syslog.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN glibc-cvs-2.9.orig/misc/syslog.c glibc-cvs-2.9/misc/syslog.c
---- glibc-cvs-2.9.orig/misc/syslog.c 2009-06-01 10:16:50.000000000 +0200
-+++ glibc-cvs-2.9/misc/syslog.c 2009-06-01 10:17:20.000000000 +0200
-@@ -152,7 +152,7 @@
- #define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
- /* Check for invalid bits. */
- if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
-- syslog(INTERNALLOG,
-+ __syslog(INTERNALLOG,
- "syslog: unknown facility/priority: %x", pri);
- pri &= LOG_PRIMASK|LOG_FACMASK;
- }
diff --git a/patches/glibc/ports-2.13/660-debug-readlink_chk-readklinkat_chk.patch b/patches/glibc/ports-2.13/660-debug-readlink_chk-readklinkat_chk.patch
deleted file mode 100644
index a5a7052..0000000
--- a/patches/glibc/ports-2.13/660-debug-readlink_chk-readklinkat_chk.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur glibc-cvs-2.9.orig/debug/readlink_chk.c glibc-cvs-2.9/debug/readlink_chk.c
---- glibc-cvs-2.9.orig/debug/readlink_chk.c 2005-03-01 01:41:15.000000000 +0100
-+++ glibc-cvs-2.9/debug/readlink_chk.c 2009-06-01 10:59:37.000000000 +0200
-@@ -25,7 +25,7 @@
-
-
- ssize_t
--__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
-+__readlink_chk (const char *path, char *buf, size_t len, size_t buflen)
- {
- if (len > buflen)
- __chk_fail ();
-diff -dur glibc-cvs-2.9.orig/debug/readlinkat_chk.c glibc-cvs-2.9/debug/readlinkat_chk.c
---- glibc-cvs-2.9.orig/debug/readlinkat_chk.c 2006-04-24 18:56:12.000000000 +0200
-+++ glibc-cvs-2.9/debug/readlinkat_chk.c 2009-06-01 11:07:26.000000000 +0200
-@@ -21,7 +21,7 @@
-
-
- ssize_t
--__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
-+__readlinkat_chk (int fd, const char *path, char *buf, size_t len,
- size_t buflen)
- {
- if (len > buflen)
diff --git a/patches/glibc/ports-2.6.1/100-ARM-NPTL.patch b/patches/glibc/ports-2.6.1/100-ARM-NPTL.patch
deleted file mode 100644
index 15de823..0000000
--- a/patches/glibc/ports-2.6.1/100-ARM-NPTL.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
---- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2005-11-16 20:22:59.000000000 +0100
-+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2007-09-06 13:53:16.000000000 +0200
-@@ -126,3 +126,9 @@
- # define NO_CANCELLATION 1
-
- #endif
-+
-+#ifndef __ASSEMBLER__
-+# define RTLD_SINGLE_THREAD_P \
-+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
-+ header.multiple_threads) == 0, 1)
-+#endif
diff --git a/patches/glibc/ports-2.6.1/110-ARM-asm_page_h.patch b/patches/glibc/ports-2.6.1/110-ARM-asm_page_h.patch
deleted file mode 100644
index 4e882af..0000000
--- a/patches/glibc/ports-2.6.1/110-ARM-asm_page_h.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -durN glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/ioperm.c
---- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c 2005-06-10 13:12:09.000000000 +0200
-+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-05-18 16:19:45.000000000 +0200
-@@ -45,7 +45,6 @@
- #include <sys/mman.h>
-
- #include <linux/version.h>
--#include <asm/page.h>
- #include <sys/sysctl.h>
-
- #define PATH_ARM_SYSTYPE "/etc/arm_systype"
diff --git a/patches/glibc/ports-2.6.1/120-lll_lock_t.patch b/patches/glibc/ports-2.6.1/120-lll_lock_t.patch
deleted file mode 100644
index b674337..0000000
--- a/patches/glibc/ports-2.6.1/120-lll_lock_t.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Propagate the patch from base glibc that changes lll_lock_t into a plain int,
-without using a typedef, as glibc-2.7 now does.
-
-diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
---- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2006-08-04 20:56:15.000000000 +0200
-+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2008-07-28 23:49:29.000000000 +0200
-@@ -260,9 +260,6 @@
- /* Our internal lock implementation is identical to the binary-compatible
- mutex implementation. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
-diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
---- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2006-07-14 15:51:24.000000000 +0200
-+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2008-07-28 23:49:56.000000000 +0200
-@@ -25,7 +25,7 @@
-
-
- void
--__lll_lock_wait (lll_lock_t *futex)
-+__lll_lock_wait (int *futex)
- {
- do
- {
-@@ -38,7 +38,7 @@
-
-
- int
--__lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime)
-+__lll_timedlock_wait (int *futex, const struct timespec *abstime)
- {
- /* Reject invalid timeouts. */
- if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
-@@ -78,7 +78,7 @@
- /* These don't get included in libc.so */
- #ifdef IS_IN_libpthread
- int
--lll_unlock_wake_cb (lll_lock_t *futex)
-+lll_unlock_wake_cb (int *futex)
- {
- int val = atomic_exchange_rel (futex, 0);
-
-diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
---- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2006-09-07 18:34:43.000000000 +0200
-+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2008-07-28 23:50:54.000000000 +0200
-@@ -43,11 +43,6 @@
- /* Initialize locks to zero. */
- #define LLL_MUTEX_LOCK_INITIALIZER (0)
-
--
--/* Type for lock object. */
--typedef int lll_lock_t;
--
--
- #define lll_futex_wait(futexp, val) \
- ({ \
- INTERNAL_SYSCALL_DECL (__err); \
-@@ -108,7 +103,7 @@
- })
-
- static inline int __attribute__((always_inline))
--__lll_mutex_trylock(lll_lock_t *futex)
-+__lll_mutex_trylock(int *futex)
- {
- return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
- }
-@@ -124,17 +119,17 @@
-
-
- static inline int __attribute__((always_inline))
--__lll_mutex_cond_trylock(lll_lock_t *futex)
-+__lll_mutex_cond_trylock(int *futex)
- {
- return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
- }
- #define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock))
-
-
--extern void __lll_lock_wait (lll_lock_t *futex) attribute_hidden;
-+extern void __lll_lock_wait (int *futex) attribute_hidden;
-
- static inline void __attribute__((always_inline))
--__lll_mutex_lock(lll_lock_t *futex)
-+__lll_mutex_lock(int *futex)
- {
- if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
- __lll_lock_wait (futex);
-@@ -155,7 +150,7 @@
- __lll_robust_mutex_lock (&(futex), id)
-
- static inline void __attribute__ ((always_inline))
--__lll_mutex_cond_lock (lll_lock_t *futex)
-+__lll_mutex_cond_lock (int *futex)
- {
- if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
- __lll_lock_wait (futex);
-@@ -167,13 +162,13 @@
- __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
-
-
--extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *)
-+extern int __lll_timedlock_wait (int *futex, const struct timespec *)
- attribute_hidden;
- extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
- attribute_hidden;
-
- static inline int __attribute__ ((always_inline))
--__lll_mutex_timedlock (lll_lock_t *futex, const struct timespec *abstime)
-+__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
- {
- int result = 0;
- if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
-@@ -197,7 +192,7 @@
-
-
- static inline void __attribute__ ((always_inline))
--__lll_mutex_unlock (lll_lock_t *futex)
-+__lll_mutex_unlock (int *futex)
- {
- int val = atomic_exchange_rel (futex, 0);
- if (__builtin_expect (val > 1, 0))
-@@ -218,7 +213,7 @@
-
-
- static inline void __attribute__ ((always_inline))
--__lll_mutex_unlock_force (lll_lock_t *futex)
-+__lll_mutex_unlock_force (int *futex)
- {
- (void) atomic_exchange_rel (futex, 0);
- lll_futex_wake (futex, 1);
-@@ -239,7 +234,7 @@
- #define THREAD_INIT_LOCK(PD, LOCK) \
- (PD)->LOCK = LLL_LOCK_INITIALIZER
-
--extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
-+extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
- /* The states of a lock are:
- 0 - untaken
-diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
---- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2006-08-04 20:54:56.000000000 +0200
-+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2008-07-28 23:51:14.000000000 +0200
-@@ -227,9 +227,6 @@
- /* Our internal lock implementation is identical to the binary-compatible
- mutex implementation. */
-
--/* Type for lock object. */
--typedef int lll_lock_t;
--
- /* Initializers for lock. */
- #define LLL_LOCK_INITIALIZER (0)
- #define LLL_LOCK_INITIALIZER_LOCKED (1)
diff --git a/patches/glibc/ports-2.6.1/130-powerpc-softfloat.patch b/patches/glibc/ports-2.6.1/130-powerpc-softfloat.patch
deleted file mode 100644
index 18aedd9..0000000
--- a/patches/glibc/ports-2.6.1/130-powerpc-softfloat.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: http://sourceware.org/ml/crossgcc/2008-10/msg00044.html
-From: http://sources.redhat.com/ml/libc-ports/2007-06/msg00005.html
-
-2007-06-07 Steven Munroe <sjmunroe@us.ibm.com>
-
- * sysdeps/powerpc/nofpu/Makefile: Remove fe_nomask from libm-support.
-
-diff -urN glibc-2.6.orig/glibc-ports-2.6.1/sysdeps/powerpc/nofpu/Makefile glibc-2.6/glibc-ports-2.6.1/sysdeps/powerpc/nofpu/Makefile
---- glibc-2.6.orig/glibc-ports-2.6.1/sysdeps/powerpc/nofpu/Makefile 2006-11-22 09:13:11.000000000 -0600
-+++ glibc-2.6/glibc-ports-2.6.1/sysdeps/powerpc/nofpu/Makefile 2007-06-07 09:53:05.708240976 -0500
-@@ -6,7 +6,7 @@
- endif
-
- ifeq ($(subdir),math)
--libm-support += fenv_const fe_nomask
-+libm-support += fenv_const
- CPPFLAGS += -I../soft-fp/
- # The follow CFLAGS are a work around for GCC Bugzilla Bug 29253
- # "expand_abs wrong default code for floating point"
-
-
diff --git a/patches/glibc/ports-2.7/100-ARM-asm_page_h.patch b/patches/glibc/ports-2.7/100-ARM-asm_page_h.patch
deleted file mode 100644
index 60079d3..0000000
--- a/patches/glibc/ports-2.7/100-ARM-asm_page_h.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -durN glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/ioperm.c
---- glibc-2.7.orig/glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/ioperm.c 2005-06-10 13:12:09.000000000 +0200
-+++ glibc-2.7/glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-05-18 16:19:45.000000000 +0200
-@@ -45,7 +45,6 @@
- #include <sys/mman.h>
-
- #include <linux/version.h>
--#include <asm/page.h>
- #include <sys/sysctl.h>
-
- #define PATH_ARM_SYSTYPE "/etc/arm_systype"
diff --git a/patches/glibc/ports-2.7/110-ARM-NPTL.patch b/patches/glibc/ports-2.7/110-ARM-NPTL.patch
deleted file mode 100644
index fb801b6..0000000
--- a/patches/glibc/ports-2.7/110-ARM-NPTL.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- glibc-2.7/glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2007-06-06 19:27:04.000000000 +0200
-+++ glibc-2.7/glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h 2008-05-18 16:57:21.000000000 +0200
-@@ -73,6 +73,9 @@
- # define DOCARGS_5 DOCARGS_4
- # define UNDOCARGS_5 UNDOCARGS_4
-
-+# define DOCARGS_6 DOCARGS_5
-+# define UNDOCARGS_6 UNDOCARGS_5
-+
- # ifdef IS_IN_libpthread
- # define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
- # define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)
diff --git a/patches/glibc/ports-2.9/100-arm_linux_tls.patch b/patches/glibc/ports-2.9/100-arm_linux_tls.patch
deleted file mode 100644
index 7b9d4ac..0000000
--- a/patches/glibc/ports-2.9/100-arm_linux_tls.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Original patch from http://www.nabble.com/arm-linux-compilation-failure-and-possible-fix-td19229074.html
-
-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
---- glibc-2.9.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 25 Nov 2008 16:37:26 -0000 1.33
-+++ glibc-2.9/ports/sysdeps/unix/sysv/linux/arm/sysdep.h 27 Jan 2009 15:35:38 -0000
-@@ -28,6 +28,8 @@
- /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
- #include <dl-sysdep.h>
-
-+#include <tls.h>
-+
- /* For Linux we can use the system call table in the header file
- /usr/include/asm/unistd.h
- of the kernel. But these symbols do not follow the SYS_* syntax
diff --git a/patches/glibc/ports-2.9/110-arm-fix-sjlj-for-fpu.patch b/patches/glibc/ports-2.9/110-arm-fix-sjlj-for-fpu.patch
deleted file mode 100644
index 0f7c1f6..0000000
--- a/patches/glibc/ports-2.9/110-arm-fix-sjlj-for-fpu.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Mike Frysinger <vapier at gentoo dot org>
-To: libc-ports at sourceware dot org
-Subject: [PATCH] arm/fpu/setjmp.S: add missing hidden def
-Date: Thu, 25 Dec 2008 23:08:56 -0500
-
-All the other arm setjmp.S files provide a hidden alias for __sigsetjmp.
-Without this, we get a nice build failure like so:
-
-/var/tmp/cross/armv4l-unknown-linux-gnu/portage/cross-armv4l-unknown-linux-gnu/glibc-2.9_p20081201/work/build-default-armv4l-unknown-linux-gnu-nptl/libc_pic.os: In function `setjmp':
-unwind-pe.c:(.text+0x15a54): undefined reference to `__GI___sigsetjmp'
-/var/tmp/cross/armv4l-unknown-linux-gnu/portage/cross-armv4l-unknown-linux-gnu/glibc-2.9_p20081201/work/build-default-armv4l-unknown-linux-gnu-nptl/libc_pic.os: In function `__GI__setjmp':
-unwind-pe.c:(.text+0x15a64): undefined reference to `__GI___sigsetjmp'
-collect2: ld returned 1 exit status
-make[1]: *** [/var/tmp/cross/armv4l-unknown-linux-gnu/portage/cross-armv4l-unknown-linux-gnu/glibc-2.9_p20081201/work/build-default-armv4l-unknown-linux-gnu-nptl/libc.so] Error 1
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- sysdeps/arm/fpu/setjmp.S | 2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/sysdeps/arm/fpu/setjmp.S b/sysdeps/arm/fpu/setjmp.S
-index 8432836..82a7e19 100644
---- a/ports/sysdeps/arm/fpu/setjmp.S
-+++ b/ports/sysdeps/arm/fpu/setjmp.S
-@@ -33,3 +33,5 @@ ENTRY (__sigsetjmp)
- /* Make a tail call to __sigjmp_save; it takes the same args. */
- B PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
- END (__sigsetjmp)
-+
-+hidden_def (__sigsetjmp)
diff --git a/patches/gmp/4.2.2/100-mpf_set_str.patch b/patches/gmp/4.2.2/100-mpf_set_str.patch
deleted file mode 100644
index 6d9ac04..0000000
--- a/patches/gmp/4.2.2/100-mpf_set_str.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Original patch from http://gmplib.org/patches/mpf_set_str.c.diff
-Re-diffed to match crosstool-NG conventions.
-
-diff -dur gmp-4.2.2.orig/mpf/set_str.c gmp-4.2.2/mpf/set_str.c
---- gmp-4.2.2.orig/mpf/set_str.c 2007-08-30 20:31:40.000000000 +0200
-+++ gmp-4.2.2/mpf/set_str.c 2008-01-28 23:05:29.000000000 +0100
-@@ -271,8 +271,29 @@
- }
-
- if (expptr != 0)
-- /* FIXME: Should do some error checking here. */
-- exp_in_base = strtol (expptr, (char **) 0, exp_base);
-+ {
-+ /* Scan and convert the exponent, in base exp_base. */
-+ long dig, neg = -(long) ('-' == expptr[0]);
-+ expptr -= neg; /* conditional increment */
-+ c = (unsigned char) *expptr++;
-+ dig = digit_value[c];
-+ if (dig >= exp_base)
-+ {
-+ TMP_FREE;
-+ return -1;
-+ }
-+ exp_in_base = dig;
-+ c = (unsigned char) *expptr++;
-+ dig = digit_value[c];
-+ while (dig < exp_base)
-+ {
-+ exp_in_base = exp_in_base * exp_base;
-+ exp_in_base += dig;
-+ c = (unsigned char) *expptr++;
-+ dig = digit_value[c];
-+ }
-+ exp_in_base = (exp_in_base ^ neg) - neg; /* conditional negation */
-+ }
- else
- exp_in_base = 0;
- if (dotpos != 0)
diff --git a/patches/gmp/4.2.4/100-mpf_eq.patch b/patches/gmp/4.2.4/100-mpf_eq.patch
deleted file mode 100644
index 942f7de..0000000
--- a/patches/gmp/4.2.4/100-mpf_eq.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-Original patch from: mpf_eq.diff
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN gmp-4.2.4.orig/doc/gmp.texi gmp-4.2.4/doc/gmp.texi
---- gmp-4.2.4.orig/doc/gmp.texi 2008-09-18 17:36:14.000000000 +0200
-+++ gmp-4.2.4/doc/gmp.texi 2009-03-08 18:36:16.000000000 +0100
-@@ -4849,9 +4849,12 @@
- equal, zero otherwise. I.e., test if @var{op1} and @var{op2} are approximately
- equal.
-
--Caution: Currently only whole limbs are compared, and only in an exact
--fashion. In the future values like 1000 and 0111 may be considered the same
--to 3 bits (on the basis that their difference is that small).
-+Caution 1: All version of GMP up to version 4.2.4 compared just whole limbs,
-+meaning sometimes more than @var{op3} bits, sometimes fewer.
-+
-+Caution 2: This function will consider XXX11...111 and XX100...000 different,
-+even if ... is replaced by a semi-infinite number of bits. Such numbers are
-+really just one ulp off, and should be considered equal.
- @end deftypefun
-
- @deftypefun void mpf_reldiff (mpf_t @var{rop}, mpf_t @var{op1}, mpf_t @var{op2})
-diff -durN gmp-4.2.4.orig/mpf/eq.c gmp-4.2.4/mpf/eq.c
---- gmp-4.2.4.orig/mpf/eq.c 2007-08-30 20:31:40.000000000 +0200
-+++ gmp-4.2.4/mpf/eq.c 2009-03-08 18:36:16.000000000 +0100
-@@ -1,6 +1,6 @@
- /* mpf_eq -- Compare two floats up to a specified bit #.
-
--Copyright 1993, 1995, 1996, 2001, 2002 Free Software Foundation, Inc.
-+Copyright 1993, 1995, 1996, 2001, 2002, 2008 Free Software Foundation, Inc.
-
- This file is part of the GNU MP Library.
-
-@@ -19,6 +19,7 @@
-
- #include "gmp.h"
- #include "gmp-impl.h"
-+#include "longlong.h"
-
- int
- mpf_eq (mpf_srcptr u, mpf_srcptr v, unsigned long int n_bits)
-@@ -26,6 +27,8 @@
- mp_srcptr up, vp;
- mp_size_t usize, vsize, size, i;
- mp_exp_t uexp, vexp;
-+ mp_limb_t diff;
-+ int cnt;
-
- uexp = u->_mp_exp;
- vexp = v->_mp_exp;
-@@ -53,10 +56,8 @@
- /* U and V have the same sign and are both non-zero. */
-
- /* 2. Are the exponents different? */
-- if (uexp > vexp)
-- return 0; /* ??? handle (uexp = vexp + 1) */
-- if (vexp > uexp)
-- return 0; /* ??? handle (vexp = uexp + 1) */
-+ if (uexp != vexp)
-+ return 0;
-
- usize = ABS (usize);
- vsize = ABS (vsize);
-@@ -93,17 +94,26 @@
- size = usize;
- }
-
-- if (size > (n_bits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS)
-- size = (n_bits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
-+ up += usize; /* point just above most significant limb */
-+ vp += vsize; /* point just above most significant limb */
-
-- up += usize - size;
-- vp += vsize - size;
-+ count_leading_zeros (cnt, up[-1]);
-+ if ((vp[-1] >> (GMP_LIMB_BITS - 1 - cnt)) != 1)
-+ return 0; /* msb positions different */
-
-- for (i = size - 1; i >= 0; i--)
-+ n_bits += cnt - GMP_NAIL_BITS;
-+
-+ size = MIN (size, (n_bits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS);
-+
-+ up -= size; /* point at least significant relevant limb */
-+ vp -= size; /* point at least significant relevant limb */
-+
-+ for (i = size - 1; i > 0; i--)
- {
- if (up[i] != vp[i])
- return 0;
- }
-
-- return 1;
-+ diff = (up[0] ^ vp[0]) >> GMP_NUMB_BITS - 1 - (n_bits - 1) % GMP_NUMB_BITS;
-+ return diff == 0;
- }
-diff -durN gmp-4.2.4.orig/tests/cxx/t-prec.cc gmp-4.2.4/tests/cxx/t-prec.cc
---- gmp-4.2.4.orig/tests/cxx/t-prec.cc 2007-09-01 12:09:03.000000000 +0200
-+++ gmp-4.2.4/tests/cxx/t-prec.cc 2009-03-08 18:36:16.000000000 +0100
-@@ -1,6 +1,6 @@
- /* Test precision of mpf_class expressions.
-
--Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
-+Copyright 2001, 2002, 2003, 2008 Free Software Foundation, Inc.
-
- This file is part of the GNU MP Library.
-
-@@ -61,7 +61,7 @@
- g = 1 / f;
- ASSERT_ALWAYS_PREC
- (g, "0.11111 11111 11111 11111 11111 11111 11111 11111 11111 11111"
-- " 11111 11111 11111 11111 11111 11", very_large_prec);
-+ " 11111 11111 11111 11111 11111 111", very_large_prec);
- }
- {
- mpf_class f(15.0, large_prec);
-@@ -69,7 +69,7 @@
- g = 1 / f;
- ASSERT_ALWAYS_PREC
- (g, "0.06666 66666 66666 66666 66666 66666 66666 66666 66666 66666"
-- " 66666 66666 66666 66666 66666 67", very_large_prec);
-+ " 66666 66666 66666 66666 66666 667", very_large_prec);
- }
-
- // compound expressions
-@@ -94,14 +94,14 @@
- i = f / g + h;
- ASSERT_ALWAYS_PREC
- (i, "15.33333 33333 33333 33333 33333 33333 33333 33333 33333 33333"
-- " 33333 33333 33333 333", very_large_prec);
-+ " 33333 33333 33333 33333 33333 3", very_large_prec);
- }
- {
- mpf_class f(3.0, small_prec);
- mpf_class g(-(1 + f) / 3, very_large_prec);
- ASSERT_ALWAYS_PREC
- (g, "-1.33333 33333 33333 33333 33333 33333 33333 33333 33333 33333"
-- " 33333 33333 33333 333", very_large_prec);
-+ " 33333 33333 33333 33333 33333 33", very_large_prec);
- }
- {
- mpf_class f(9.0, medium_prec);
-@@ -117,7 +117,7 @@
- g = hypot(1 + 5 / f, 1.0);
- ASSERT_ALWAYS_PREC
- (g, "1.66666 66666 66666 66666 66666 66666 66666 66666 66666 66666"
-- " 66666 66666 66666 667", very_large_prec);
-+ " 66666 66666 66666 66666 66666 67", very_large_prec);
- }
-
- // compound assignments
-@@ -142,7 +142,7 @@
- mpf_class g(0.0, very_large_prec);
- g = mpf_class(1 / f);
- ASSERT_ALWAYS_PREC
-- (g, "0.11111 11111 11111 11111 11111 11111 11111 111", medium_prec);
-+ (g, "0.11111 11111 11111 11111 11111 11111 11111 1111", medium_prec);
- }
- {
- mpf_class f(15.0, large_prec);
-@@ -150,7 +150,7 @@
- g = mpf_class(1 / f);
- ASSERT_ALWAYS_PREC
- (g, "0.06666 66666 66666 66666 66666 66666 66666 66666 66666 66666"
-- " 66666 667", large_prec);
-+ " 66666 6667", large_prec);
- }
-
- {
-@@ -158,7 +158,8 @@
- mpf_class h(0.0, very_large_prec);
- h = mpf_class(f / g + 1, large_prec);
- ASSERT_ALWAYS_PREC
-- (h, "1.33333 33333 33333 33333 33333 33333 33333 33333 33333 3333",
-+ (h, "1.33333 33333 33333 33333 33333 33333 33333 33333 33333 33333"
-+ " 33333 333",
- large_prec);
- }
-
-@@ -170,7 +171,7 @@
- g = f - q;
- ASSERT_ALWAYS_PREC
- (g, "2.66666 66666 66666 66666 66666 66666 66666 66666 66666 66666"
-- " 66666 66666 66666 667", very_large_prec);
-+ " 66666 66666 66666 66666 66666 67", very_large_prec);
- }
-
- {
-@@ -179,7 +180,8 @@
- mpf_class g(0.0, very_large_prec);
- g = mpf_class(f - q, large_prec);
- ASSERT_ALWAYS_PREC
-- (g, "2.66666 66666 66666 66666 66666 66666 66666 66666 66666 6667",
-+ (g, "2.66666 66666 66666 66666 66666 66666 66666 66666 66666 66666"
-+ " 66666 667",
- large_prec);
- }
- {
-@@ -188,7 +190,7 @@
- mpf_class g(0.0, very_large_prec);
- g = mpf_class(f - q);
- ASSERT_ALWAYS_PREC
-- (g, "2.66666 66666 66666 66666 66666 6667", medium_prec);
-+ (g, "2.66666 66666 66666 66666 66666 66666 66666 667", medium_prec);
- }
- {
- mpf_class f(15.0, large_prec);
-@@ -196,7 +198,8 @@
- mpf_class g(0.0, very_large_prec);
- g = mpf_class(f + q);
- ASSERT_ALWAYS_PREC
-- (g, "15.33333 33333 33333 33333 33333 33333 33333 33333 33333 3333",
-+ (g, "15.33333 33333 33333 33333 33333 33333 33333 33333 33333 33333"
-+ " 33333 33",
- large_prec);
- }
- }
diff --git a/patches/gmp/4.2.4/110-mpf_set_str.patch b/patches/gmp/4.2.4/110-mpf_set_str.patch
deleted file mode 100644
index 9cb600b..0000000
--- a/patches/gmp/4.2.4/110-mpf_set_str.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Original patch from: mpf_set_str.c.4.diff
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN gmp-4.2.4.orig/mpf/set_str.c gmp-4.2.4/mpf/set_str.c
---- gmp-4.2.4.orig/mpf/set_str.c 2008-08-25 16:11:37.000000000 +0200
-+++ gmp-4.2.4/mpf/set_str.c 2009-03-08 18:36:16.000000000 +0100
-@@ -137,7 +137,12 @@
- c = (unsigned char) *++str;
- }
-
-+ /* Default base to decimal. */
-+ if (base == 0)
-+ base = 10;
-+
- exp_base = base;
-+
- if (base < 0)
- {
- exp_base = 10;
-@@ -165,10 +170,6 @@
- return -1;
- }
-
-- /* Default base to decimal. */
-- if (base == 0)
-- base = 10;
--
- /* Locate exponent part of the input. Look from the right of the string,
- since the exponent is usually a lot shorter than the mantissa. */
- expptr = NULL;
diff --git a/patches/gmp/4.2.4/120-perfpow.patch b/patches/gmp/4.2.4/120-perfpow.patch
deleted file mode 100644
index f062b22..0000000
--- a/patches/gmp/4.2.4/120-perfpow.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-Original patch from: perfpow.c.diff
-
--= BEGIN original header =-
-Copyright 1998, 1999, 2000, 2001, 2005, 2008 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MP Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
-
--= END original header =-
-
-diff -durN gmp-4.2.4.orig/mpz/perfpow.c gmp-4.2.4/mpz/perfpow.c
---- gmp-4.2.4.orig/mpz/perfpow.c 2007-08-30 20:31:41.000000000 +0200
-+++ gmp-4.2.4/mpz/perfpow.c 2009-03-08 18:36:16.000000000 +0100
-@@ -1,7 +1,7 @@
- /* mpz_perfect_power_p(arg) -- Return non-zero if ARG is a perfect power,
- zero otherwise.
-
--Copyright 1998, 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
-+Copyright 1998, 1999, 2000, 2001, 2005, 2008 Free Software Foundation, Inc.
-
- This file is part of the GNU MP Library.
-
-@@ -59,6 +59,8 @@
- #define SMALLEST_OMITTED_PRIME 1009
-
-
-+#define POW2P(a) (((a) & ((a) - 1)) == 0)
-+
- int
- mpz_perfect_power_p (mpz_srcptr u)
- {
-@@ -72,16 +74,13 @@
- mp_size_t usize = SIZ (u);
- TMP_DECL;
-
-- if (usize == 0)
-- return 1; /* consider 0 a perfect power */
-+ if (mpz_cmpabs_ui (u, 1) <= 0)
-+ return 1; /* -1, 0, and +1 are perfect powers */
-
- n2 = mpz_scan1 (u, 0);
- if (n2 == 1)
- return 0; /* 2 divides exactly once. */
-
-- if (n2 != 0 && (n2 & 1) == 0 && usize < 0)
-- return 0; /* 2 has even multiplicity with negative U */
--
- TMP_MARK;
-
- uns = ABS (usize) - n2 / BITS_PER_MP_LIMB;
-@@ -89,6 +88,14 @@
- MPZ_TMP_INIT (u2, uns);
-
- mpz_tdiv_q_2exp (u2, u, n2);
-+ mpz_abs (u2, u2);
-+
-+ if (mpz_cmp_ui (u2, 1) == 0)
-+ {
-+ TMP_FREE;
-+ /* factoring completed; consistent power */
-+ return ! (usize < 0 && POW2P(n2));
-+ }
-
- if (isprime (n2))
- goto n2prime;
-@@ -97,6 +104,9 @@
- {
- prime = primes[i];
-
-+ if (mpz_cmp_ui (u2, prime) < 0)
-+ break;
-+
- if (mpz_divisible_ui_p (u2, prime)) /* divisible by this prime? */
- {
- rem = mpz_tdiv_q_ui (q, u2, prime * prime);
-@@ -115,12 +125,6 @@
- n++;
- }
-
-- if ((n & 1) == 0 && usize < 0)
-- {
-- TMP_FREE;
-- return 0; /* even multiplicity with negative U, reject */
-- }
--
- n2 = gcd (n2, n);
- if (n2 == 1)
- {
-@@ -128,10 +132,11 @@
- return 0; /* we have multiplicity 1 of some factor */
- }
-
-- if (mpz_cmpabs_ui (u2, 1) == 0)
-+ if (mpz_cmp_ui (u2, 1) == 0)
- {
- TMP_FREE;
-- return 1; /* factoring completed; consistent power */
-+ /* factoring completed; consistent power */
-+ return ! (usize < 0 && POW2P(n2));
- }
-
- /* As soon as n2 becomes a prime number, stop factoring.
-@@ -169,6 +174,10 @@
- else
- {
- unsigned long int nth;
-+
-+ if (usize < 0 && POW2P(n2))
-+ return 0;
-+
- /* We found some factors above. We just need to consider values of n
- that divides n2. */
- for (nth = 2; nth <= n2; nth++)
-@@ -184,8 +193,11 @@
- exact = mpz_root (q, u2, nth);
- if (exact)
- {
-- TMP_FREE;
-- return 1;
-+ if (! (usize < 0 && POW2P(nth)))
-+ {
-+ TMP_FREE;
-+ return 1;
-+ }
- }
- if (mpz_cmp_ui (q, SMALLEST_OMITTED_PRIME) < 0)
- {
-@@ -199,6 +211,9 @@
- }
-
- n2prime:
-+ if (usize < 0 && POW2P(n2))
-+ return 0;
-+
- exact = mpz_root (NULL, u2, n2);
- TMP_FREE;
- return exact;
diff --git a/patches/gmp/4.3.0/100-multiplicity-that-does-not-fit-an-int.patch b/patches/gmp/4.3.0/100-multiplicity-that-does-not-fit-an-int.patch
new file mode 100644
index 0000000..f60e88f
--- /dev/null
+++ b/patches/gmp/4.3.0/100-multiplicity-that-does-not-fit-an-int.patch
@@ -0,0 +1,33 @@
+diff --git a/mpz/remove.c b/mpz/remove.c
+--- a/mpz/remove.c
++++ b/mpz/remove.c
+@@ -23,7 +23,7 @@
+ unsigned long int
+ mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f)
+ {
+- mpz_t fpow[40]; /* inexhaustible...until year 2020 or so */
++ mpz_t fpow[GMP_LIMB_BITS]; /* Really MP_SIZE_T_BITS */
+ mpz_t x, rem;
+ unsigned long int pwr;
+ int p;
+@@ -69,7 +69,7 @@
+ mpz_set (dest, x);
+ }
+
+- pwr = (1 << p) - 1;
++ pwr = (1L << p) - 1;
+
+ mpz_clear (fpow[p]);
+
+diff --git a/mpz/remove.c b/mpz/remove.c
+--- a/mpz/remove.c
++++ b/mpz/remove.c
+@@ -80,7 +80,7 @@
+ mpz_tdiv_qr (x, rem, dest, fpow[p]);
+ if (SIZ (rem) == 0)
+ {
+- pwr += 1 << p;
++ pwr += 1L << p;
+ mpz_set (dest, x);
+ }
+ mpz_clear (fpow[p]);
diff --git a/patches/gmp/4.3.0/110-unbounded-alloc.patch b/patches/gmp/4.3.0/110-unbounded-alloc.patch
new file mode 100644
index 0000000..78e0588
--- /dev/null
+++ b/patches/gmp/4.3.0/110-unbounded-alloc.patch
@@ -0,0 +1,31 @@
+diff --git a/mpn/generic/toom44_mul.c b/mpn/generic/toom44_mul.c
+--- a/mpn/generic/toom44_mul.c
++++ b/mpn/generic/toom44_mul.c
+@@ -116,17 +116,16 @@
+
+ TMP_MARK;
+
+- as1 = TMP_SALLOC_LIMBS (n + 1);
+- asm1 = TMP_SALLOC_LIMBS (n + 1);
+- as2 = TMP_SALLOC_LIMBS (n + 1);
+- ash = TMP_SALLOC_LIMBS (n + 1);
+- asmh = TMP_SALLOC_LIMBS (n + 1);
+-
+- bs1 = TMP_SALLOC_LIMBS (n + 1);
+- bsm1 = TMP_SALLOC_LIMBS (n + 1);
+- bs2 = TMP_SALLOC_LIMBS (n + 1);
+- bsh = TMP_SALLOC_LIMBS (n + 1);
+- bsmh = TMP_SALLOC_LIMBS (n + 1);
++ as1 = TMP_ALLOC_LIMBS (10 * n + 10);
++ asm1 = as1 + n + 1;
++ as2 = asm1 + n + 1;
++ ash = as2 + n + 1;
++ asmh = ash + n + 1;
++ bs1 = asmh + n + 1;
++ bsm1 = bs1 + n + 1;
++ bs2 = bsm1 + n + 1;
++ bsh = bs2 + n + 1;
++ bsmh = bsh + n + 1;
+
+ gp = pp;
+ hp = pp + n + 1;
diff --git a/patches/gmp/5.0.1/110-get-mpn_sub_1-size-argument-right.patch b/patches/gmp/5.0.1/110-get-mpn_sub_1-size-argument-right.patch
new file mode 100644
index 0000000..2e0a1af
--- /dev/null
+++ b/patches/gmp/5.0.1/110-get-mpn_sub_1-size-argument-right.patch
@@ -0,0 +1,38 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1310730221 -7200
+# Node ID 538dfce27f410b910d5e2f011119269e224d16a3
+# Parent 03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366
+(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right.
+
+diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c
+--- a/mpn/generic/dcpi1_bdiv_q.c Thu Jun 16 12:22:24 2011 +0200
++++ b/mpn/generic/dcpi1_bdiv_q.c Fri Jul 15 13:43:41 2011 +0200
+@@ -7,7 +7,7 @@
+ SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
+ GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
+
+-Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
++Copyright 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+ This file is part of the GNU MP Library.
+
+@@ -28,7 +28,6 @@
+ #include "gmp-impl.h"
+
+
+-
+ mp_size_t
+ mpn_dcpi1_bdiv_q_n_itch (mp_size_t n)
+ {
+@@ -130,7 +129,7 @@
+ qn = nn - qn;
+ while (qn > dn)
+ {
+- mpn_sub_1 (np + dn, np + dn, qn, cy);
++ mpn_sub_1 (np + dn, np + dn, qn - dn, cy);
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
+ qp += dn;
+ np += dn;
+
diff --git a/patches/gmp/5.0.1/120-fix-r0-clobbering-issue.patch b/patches/gmp/5.0.1/120-fix-r0-clobbering-issue.patch
new file mode 100644
index 0000000..d12d6b2
--- /dev/null
+++ b/patches/gmp/5.0.1/120-fix-r0-clobbering-issue.patch
@@ -0,0 +1,77 @@
+Removed ChangeLog part
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1342891151 -7200
+# Node ID 829215e83ff1db3cd00e510a737092df691442d5
+# Parent 816c18dbd492050ef8892e91602d9e758abc2988
+Fix r0 clobbering issue with "large" code affecting elf+darwin PIC.
+
+diff -r 816c18dbd492 -r 829215e83ff1 mpn/powerpc32/vmx/mod_34lsub1.asm
+--- a/mpn/powerpc32/vmx/mod_34lsub1.asm Tue Jun 19 15:02:48 2012 +0200
++++ b/mpn/powerpc32/vmx/mod_34lsub1.asm Sat Jul 21 19:19:11 2012 +0200
+@@ -1,6 +1,7 @@
+ dnl PowerPC-32 mpn_mod_34lsub1 -- mpn remainder mod 2^24-1.
+
+-dnl Copyright 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
++dnl Copyright 2002, 2003, 2005, 2006, 2007, 2012 Free Software Foundation,
++dnl Inc.
+
+ dnl This file is part of the GNU MP Library.
+
+@@ -135,15 +136,15 @@
+
+ andi. r7, up, 15
+ vxor a0, v0, v0
+- lis r0, 0xaaaa
++ lis r9, 0xaaaa
+ vxor a1, v0, v0
+- ori r0, r0, 0xaaab
++ ori r9, r9, 0xaaab
+ vxor a2, v0, v0
+ li r5, 16
+ vxor c0, v0, v0
+ li r6, 32
+ vxor c1, v0, v0
+- LEAL( r11, cnsts)
++ LEAL( r11, cnsts) C CAUTION clobbers r0 for elf, darwin
+ vxor c2, v0, v0
+ vxor z, v0, v0
+
+@@ -158,7 +159,7 @@
+ vsldoi a2, z, a2, 12
+
+ addi n, n, 9
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+@@ -174,7 +175,7 @@
+ vsldoi a1, z, a1, 8
+
+ addi n, n, 6
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+@@ -188,7 +189,7 @@
+ vsldoi a0, z, a0, 4
+
+ addi n, n, 3
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+@@ -197,7 +198,7 @@
+ b L(0)
+
+ L(aligned16):
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+
diff --git a/patches/gmp/5.0.2/110-get-mpn_sub_1-size-argument-right.patch b/patches/gmp/5.0.2/110-get-mpn_sub_1-size-argument-right.patch
new file mode 100644
index 0000000..2e0a1af
--- /dev/null
+++ b/patches/gmp/5.0.2/110-get-mpn_sub_1-size-argument-right.patch
@@ -0,0 +1,38 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1310730221 -7200
+# Node ID 538dfce27f410b910d5e2f011119269e224d16a3
+# Parent 03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366
+(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right.
+
+diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c
+--- a/mpn/generic/dcpi1_bdiv_q.c Thu Jun 16 12:22:24 2011 +0200
++++ b/mpn/generic/dcpi1_bdiv_q.c Fri Jul 15 13:43:41 2011 +0200
+@@ -7,7 +7,7 @@
+ SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
+ GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
+
+-Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
++Copyright 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+ This file is part of the GNU MP Library.
+
+@@ -28,7 +28,6 @@
+ #include "gmp-impl.h"
+
+
+-
+ mp_size_t
+ mpn_dcpi1_bdiv_q_n_itch (mp_size_t n)
+ {
+@@ -130,7 +129,7 @@
+ qn = nn - qn;
+ while (qn > dn)
+ {
+- mpn_sub_1 (np + dn, np + dn, qn, cy);
++ mpn_sub_1 (np + dn, np + dn, qn - dn, cy);
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
+ qp += dn;
+ np += dn;
+
diff --git a/patches/gmp/5.0.2/120-fix-r0-clobbering-issue.patch b/patches/gmp/5.0.2/120-fix-r0-clobbering-issue.patch
new file mode 100644
index 0000000..d12d6b2
--- /dev/null
+++ b/patches/gmp/5.0.2/120-fix-r0-clobbering-issue.patch
@@ -0,0 +1,77 @@
+Removed ChangeLog part
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1342891151 -7200
+# Node ID 829215e83ff1db3cd00e510a737092df691442d5
+# Parent 816c18dbd492050ef8892e91602d9e758abc2988
+Fix r0 clobbering issue with "large" code affecting elf+darwin PIC.
+
+diff -r 816c18dbd492 -r 829215e83ff1 mpn/powerpc32/vmx/mod_34lsub1.asm
+--- a/mpn/powerpc32/vmx/mod_34lsub1.asm Tue Jun 19 15:02:48 2012 +0200
++++ b/mpn/powerpc32/vmx/mod_34lsub1.asm Sat Jul 21 19:19:11 2012 +0200
+@@ -1,6 +1,7 @@
+ dnl PowerPC-32 mpn_mod_34lsub1 -- mpn remainder mod 2^24-1.
+
+-dnl Copyright 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
++dnl Copyright 2002, 2003, 2005, 2006, 2007, 2012 Free Software Foundation,
++dnl Inc.
+
+ dnl This file is part of the GNU MP Library.
+
+@@ -135,15 +136,15 @@
+
+ andi. r7, up, 15
+ vxor a0, v0, v0
+- lis r0, 0xaaaa
++ lis r9, 0xaaaa
+ vxor a1, v0, v0
+- ori r0, r0, 0xaaab
++ ori r9, r9, 0xaaab
+ vxor a2, v0, v0
+ li r5, 16
+ vxor c0, v0, v0
+ li r6, 32
+ vxor c1, v0, v0
+- LEAL( r11, cnsts)
++ LEAL( r11, cnsts) C CAUTION clobbers r0 for elf, darwin
+ vxor c2, v0, v0
+ vxor z, v0, v0
+
+@@ -158,7 +159,7 @@
+ vsldoi a2, z, a2, 12
+
+ addi n, n, 9
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+@@ -174,7 +175,7 @@
+ vsldoi a1, z, a1, 8
+
+ addi n, n, 6
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+@@ -188,7 +189,7 @@
+ vsldoi a0, z, a0, 4
+
+ addi n, n, 3
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+@@ -197,7 +198,7 @@
+ b L(0)
+
+ L(aligned16):
+- mulhwu r0, n, r0
++ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+
diff --git a/patches/gmp/5.1.1/100-fix-bulldozer-piledriver.patch b/patches/gmp/5.1.1/100-fix-bulldozer-piledriver.patch
new file mode 100644
index 0000000..f6faca1
--- /dev/null
+++ b/patches/gmp/5.1.1/100-fix-bulldozer-piledriver.patch
@@ -0,0 +1,21 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1368052461 -7200
+# Node ID 11fbd825bc45385d00b69c30bd7566acee11f0d2
+# Parent bd4c950486ab4c161ea69b91c25150719c3cb700
+Fix typo.
+
+diff -r bd4c950486ab -r 11fbd825bc45 mpn/x86_64/bd1/mul_1.asm
+--- a/mpn/x86_64/bd1/mul_1.asm Thu May 02 18:20:37 2013 +0200
++++ b/mpn/x86_64/bd1/mul_1.asm Thu May 09 00:34:21 2013 +0200
+@@ -53,7 +53,7 @@
+ IFDOS(` define(`v0', ``%r9'') ') dnl
+ IFDOS(` define(`r9', ``rdi'') ') dnl
+ IFDOS(` define(`n', ``%r8'') ') dnl
+-IFDOS(` define(`r8', ``r11'') ') dnl
++IFDOS(` define(`r8', ``rbx'') ') dnl
+
+ ASM_START()
+ TEXT
+
diff --git a/patches/gmp/5.1.1/110-mpz_powm_ui.patch b/patches/gmp/5.1.1/110-mpz_powm_ui.patch
new file mode 100644
index 0000000..f0d240c
--- /dev/null
+++ b/patches/gmp/5.1.1/110-mpz_powm_ui.patch
@@ -0,0 +1,39 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1363174284 -3600
+# Node ID ec4d88674036804b26f22c6a2bfca6ae1e92d370
+# Parent e616ff715c34e112d0a5f7535d31ffe1194a5c7d
+(mod): Adhere to mpn_mu_div_qr's overlap requirements.
+
+diff -r e616ff715c34 -r ec4d88674036 mpz/powm_ui.c
+--- a/mpz/powm_ui.c Sun Feb 17 19:40:16 2013 +0100
++++ b/mpz/powm_ui.c Wed Mar 13 12:31:24 2013 +0100
+@@ -2,8 +2,8 @@
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+-Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2005, 2008,
+-2009, 2011, 2012 Free Software Foundation, Inc.
++Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2005, 2008, 2009,
++2011, 2012, 2013 Free Software Foundation, Inc.
+
+ This file is part of the GNU MP Library.
+
+@@ -70,9 +70,14 @@
+ }
+ else
+ {
++ /* We need to allocate separate remainder area, since mpn_mu_div_qr does
++ not handle overlap between the numerator and remainder areas.
++ FIXME: Make it handle such overlap. */
++ mp_ptr rp = TMP_ALLOC_LIMBS (dn);
+ mp_size_t itch = mpn_mu_div_qr_itch (nn, dn, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+- mpn_mu_div_qr (qp, np, np, nn, dp, dn, scratch);
++ mpn_mu_div_qr (qp, rp, np, nn, dp, dn, scratch);
++ MPN_COPY (np, rp, dn);
+ }
+
+ TMP_FREE;
+
diff --git a/patches/gmp/5.1.1/120-fix-mpn_sbpi1_div_qr_sec.patch b/patches/gmp/5.1.1/120-fix-mpn_sbpi1_div_qr_sec.patch
new file mode 100644
index 0000000..13a50ad
--- /dev/null
+++ b/patches/gmp/5.1.1/120-fix-mpn_sbpi1_div_qr_sec.patch
@@ -0,0 +1,164 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1373624469 -7200
+# Node ID a447c0c537891ed23edf180594a89616364ee633
+# Parent 6540e0b2925ead29f7158bb182e4fabfb9441433
+Partial rewrite.
+
+diff -r 6540e0b2925e -r a447c0c53789 mpn/generic/sbpi1_div_sec.c
+--- a/mpn/generic/sbpi1_div_sec.c Mon Jul 01 19:16:32 2013 +0200
++++ b/mpn/generic/sbpi1_div_sec.c Fri Jul 12 12:21:09 2013 +0200
+@@ -8,7 +8,7 @@
+ SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
+ GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+-Copyright 2011, 2012 Free Software Foundation, Inc.
++Copyright 2011, 2012, 2013 Free Software Foundation, Inc.
+
+ This file is part of the GNU MP Library.
+
+@@ -29,6 +29,28 @@
+ #include "gmp-impl.h"
+ #include "longlong.h"
+
++/* This side-channel silent division algorithm reduces the partial remainder by
++ GMP_NUMB_BITS/2 bits at a time, compared to GMP_NUMB_BITS for the main
++ division algorithm. We do not insists on reducing by exactly
++ GMP_NUMB_BITS/2, but may leave a partial remainder that is D*B^i to 3D*B^i
++ too large (B is the limb base, D is the divisor, and i is the induction
++ variable); the subsequent step will handle the extra partial remainder bits.
++
++ WIth that partial remainder reduction, each step generates a quotient "half
++ limb". The outer loop generates two quotient half limbs, an upper (q1h) and
++ a lower (q0h) which are stored sparsely in separate limb arrays. These
++ arrays are added at the end; using separate arrays avoids data-dependent
++ carry propagation which could else pose a side-channel leakage problem.
++
++ The quotient half limbs may be between -3 to 0 from the accurate value
++ ("accurate" being the one which corresponds to a reduction to a principal
++ partial remainder). Too small quotient half limbs correspond to too large
++ remainders, which we reduce later, as described above.
++
++ In order to keep quotients from getting too big, corresponding to a negative
++ partial remainder, we use an inverse which is sligtly smaller than usually.
++*/
++
+ #if OPERATION_sbpi1_div_qr_sec
+ /* Needs (dn + 1) + (nn - dn) + (nn - dn) = 2nn - dn + 1 limbs at tp. */
+ #define FNAME mpn_sbpi1_div_qr_sec
+@@ -49,7 +71,7 @@
+ mp_limb_t dinv,
+ mp_ptr tp)
+ {
+- mp_limb_t nh, cy, q1h, q0h, dummy, h;
++ mp_limb_t nh, cy, q1h, q0h, dummy, cnd;
+ mp_size_t i;
+ mp_ptr hp;
+ #if OPERATION_sbpi1_div_qr_sec
+@@ -72,77 +94,69 @@
+ #endif
+ }
+
++ /* Decremenet inverse to keep quotient half limbs from being too large. */
++ dinv -= dinv != 0; /* FIXME: cmp-to-int */
++
+ /* Create a divisor copy shifted half a limb. */
+ hp = tp; /* (dn + 1) limbs */
+- cy = mpn_lshift (hp, dp, dn, GMP_NUMB_BITS / 2);
+- hp[dn] = dp[dn - 1] >> GMP_NUMB_BITS / 2;
++ hp[dn] = mpn_lshift (hp, dp, dn, GMP_NUMB_BITS / 2);
+
+ #if OPERATION_sbpi1_div_qr_sec
+ qlp = tp + (dn + 1); /* (nn - dn) limbs */
+ qhp = tp + (nn + 1); /* (nn - dn) limbs */
+ #endif
+
+- np += nn;
++ np += nn - dn;
++ nh = 0;
+
+- /* Main loop. Develop one full limb per iteration, but do it in two steps in
+- order to avoid conditionals. Quotient bits will be either correct or
+- underestimates. When a quotient is underestimated, the next quotient will
+- compensate, since quotients are to be added at consecutive weight distance
+- GMP_NUMB_BITS/2. We make two quotient arrays, each with GMP_NUMB_BITS/2+2
+- bits per entry. The arrays are added late after the loop. Separate
+- arrays avoid data-dependent carry propagation. */
+- nh = 0;
+ for (i = nn - dn - 1; i >= 0; i--)
+ {
+ np--;
+
+- nh = (nh << GMP_NUMB_BITS/2) + (np[0] >> GMP_NUMB_BITS/2);
++ nh = (nh << GMP_NUMB_BITS/2) + (np[dn] >> GMP_NUMB_BITS/2);
+ umul_ppmm (q1h, dummy, nh, dinv);
+ q1h += nh;
+ #if OPERATION_sbpi1_div_qr_sec
+ qhp[i] = q1h;
+ #endif
+- cy = mpn_submul_1 (np - dn, hp, dn + 1, q1h);
++ mpn_submul_1 (np, hp, dn + 1, q1h);
+
+- nh = np[0];
++ nh = np[dn];
+ umul_ppmm (q0h, dummy, nh, dinv);
+ q0h += nh;
+ #if OPERATION_sbpi1_div_qr_sec
+ qlp[i] = q0h;
+ #endif
+- cy = mpn_submul_1 (np - dn, dp, dn, q0h);
+-
+- nh -= cy;
++ nh -= mpn_submul_1 (np, dp, dn, q0h);
+ }
+
+- np[0] = nh;
+-
+- np -= dn;
+-
+ /* 1st adjustment depends on extra high remainder limb. */
+- h = np[dn];
++ cnd = nh != 0; /* FIXME: cmp-to-int */
+ #if OPERATION_sbpi1_div_qr_sec
+- qlp[0] += h;
++ qlp[0] += cnd;
+ #endif
+- h -= mpn_subcnd_n (np, np, dp, dn, h);
++ nh -= mpn_subcnd_n (np, np, dp, dn, cnd);
+
+- /* 2nd adjustment depends on remainder/divisor comparision as well as whether
++ /* 2nd adjustment depends on remainder/divisor comparison as well as whether
+ extra remainder limb was nullified by previous subtract. */
+ cy = mpn_sub_n (np, np, dp, dn);
+- cy = cy == h; /* FIXME: might leak on some archs */
++ cy = cy - nh;
+ #if OPERATION_sbpi1_div_qr_sec
+- qlp[0] += cy;
++ qlp[0] += 1 - cy;
+ #endif
+- mpn_addcnd_n (np, np, dp, dn, 1 - cy);
++ mpn_addcnd_n (np, np, dp, dn, cy);
+
++ /* 3rd adjustment depends on remainder/divisor comparison. */
++ cy = mpn_sub_n (np, np, dp, dn);
++#if OPERATION_sbpi1_div_qr_sec
++ qlp[0] += 1 - cy;
++#endif
++ mpn_addcnd_n (np, np, dp, dn, cy);
++
++#if OPERATION_sbpi1_div_qr_sec
+ /* Combine quotient halves into final quotient. */
+-#if OPERATION_sbpi1_div_qr_sec
+- qh = 0;
+- if (nn - dn != 0)
+- {
+- qh = mpn_lshift (qhp, qhp, nn - dn, GMP_NUMB_BITS/2);
+- qh += mpn_add_n (qp, qhp, qlp, nn - dn);
+- }
++ qh = mpn_lshift (qhp, qhp, nn - dn, GMP_NUMB_BITS/2);
++ qh += mpn_add_n (qp, qhp, qlp, nn - dn);
+
+ return qh;
+ #else
+
diff --git a/patches/gmp/5.1.1/130-do-not-clobber-f16-f18.patch b/patches/gmp/5.1.1/130-do-not-clobber-f16-f18.patch
new file mode 100644
index 0000000..9f9f470
--- /dev/null
+++ b/patches/gmp/5.1.1/130-do-not-clobber-f16-f18.patch
@@ -0,0 +1,73 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1369216954 -7200
+# Node ID 394bdf8fdaee749660cc5680cc0636ea0242fae7
+# Parent 0771124b9f13b218a3f07f7dd7c127961974489d
+Don't clobber f16-f18.
+
+diff -r 0771124b9f13 -r 394bdf8fdaee mpn/ia64/divrem_2.asm
+--- a/mpn/ia64/divrem_2.asm Mon May 20 16:56:05 2013 +0200
++++ b/mpn/ia64/divrem_2.asm Wed May 22 12:02:34 2013 +0200
+@@ -1,6 +1,6 @@
+ dnl IA-64 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
+
+-dnl Copyright 2010 Free Software Foundation, Inc.
++dnl Copyright 2010, 2013 Free Software Foundation, Inc.
+
+ dnl This file is part of the GNU MP Library.
+
+@@ -98,17 +98,17 @@
+ br.call.sptk.many b0 = mpn_invert_limb
+ ;;
+ setf.sig f11 = r8 // di (non-final)
+- setf.sig f18 = r39 // d1
+- setf.sig f17 = r36 // d0
++ setf.sig f34 = r39 // d1
++ setf.sig f33 = r36 // d0
+ mov r1 = r43
+ ;;
+ mov r17 = 1
+ setf.sig f9 = r38 // n2
+- xma.l f6 = f11, f18, f0 // t0 = LO(di * d1)
++ xma.l f6 = f11, f34, f0 // t0 = LO(di * d1)
+ ;;
+ setf.sig f10 = r37 // n1
+ setf.sig f15 = r17 // 1
+- xma.hu f8 = f11, f17, f0 // s0 = HI(di * d0)
++ xma.hu f8 = f11, f33, f0 // s0 = HI(di * d0)
+ ;;
+ getf.sig r17 = f6
+ getf.sig r16 = f8
+@@ -178,7 +178,7 @@
+ (p9) br.cond.dptk .L52
+ .L46:
+ ')
+- setf.sig f16 = r8 // di
++ setf.sig f32 = r8 // di
+ shladd r32 = r35, 3, r32
+ ;;
+
+@@ -189,8 +189,8 @@
+ ;;
+ (p8) mov r37 = r0
+ (p9) ld8 r37 = [r34], -8
+- xma.hu f8 = f9, f16, f10 // 0,29
+- xma.l f12 = f9, f16, f10 // 0
++ xma.hu f8 = f9, f32, f10 // 0,29
++ xma.l f12 = f9, f32, f10 // 0
+ ;;
+ getf.sig r20 = f12 // q0 4
+ xma.l f13 = f15, f8, f9 // q += n2 4
+@@ -198,8 +198,8 @@
+ ;;
+ getf.sig r18 = f13 // 8
+ xma.l f7 = f14, f13, f10 // 8
+- xma.l f6 = f17, f13, f17 // t0 = LO(d0*q+d0) 8
+- xma.hu f9 = f17, f13, f17 // t1 = HI(d0*q+d0) 9
++ xma.l f6 = f33, f13, f33 // t0 = LO(d0*q+d0) 8
++ xma.hu f9 = f33, f13, f33 // t1 = HI(d0*q+d0) 9
+ ;;
+ getf.sig r38 = f7 // n1 12
+ getf.sig r16 = f6 // 13
+
diff --git a/patches/gmp/6.1.0/100-fix-broadwell-skylake.patch b/patches/gmp/6.1.0/100-fix-broadwell-skylake.patch
new file mode 100644
index 0000000..9afd339
--- /dev/null
+++ b/patches/gmp/6.1.0/100-fix-broadwell-skylake.patch
@@ -0,0 +1,59 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <torbjorng@google.com>
+# Date 1450109109 -3600
+# Node ID 67d4ee9dead1ed8b1c9f4eb320ac72208fe1a015
+# Parent 20bf21d5f600710d62b040ea9b20da22871db1f1
+Add FUNC_EXITs.
+
+diff -r 20bf21d5f600 -r 67d4ee9dead1 NEWS
+--- a/NEWS Mon Dec 14 08:37:18 2015 +0100
++++ b/NEWS Mon Dec 14 17:05:09 2015 +0100
+@@ -4,6 +4,11 @@
+ medium, provided this notice is preserved.
+
+
++Changes between GMP version 6.1.1 and 6.1.0
++
++ BUGS FIXED
++ * .
++
+ Changes between GMP version 6.0.* and 6.1.0
+
+ BUGS FIXED
+diff -r 20bf21d5f600 -r 67d4ee9dead1 mpn/x86_64/coreibwl/mul_basecase.asm
+--- a/mpn/x86_64/coreibwl/mul_basecase.asm Mon Dec 14 08:37:18 2015 +0100
++++ b/mpn/x86_64/coreibwl/mul_basecase.asm Mon Dec 14 17:05:09 2015 +0100
+@@ -94,6 +94,7 @@
+
+ L(s11): mov %rax, (rp)
+ mov %r9, 8(rp)
++ FUNC_EXIT()
+ ret
+
+ L(s2x): cmp $2, vn
+@@ -105,6 +106,7 @@
+ mov %rax, (rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
++ FUNC_EXIT()
+ ret
+
+ L(s22): add %r8, %r9 C 1
+@@ -121,6 +123,7 @@
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ mov %rdx, 24(rp)
++ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+@@ -294,6 +297,7 @@
+ pop %r12
+ pop %rbp
+ pop %rbx
++ FUNC_EXIT()
+ ret
+
+ L(f2):
+
diff --git a/patches/libelf/0.8.10/100-fix-64-bit-detection.patch b/patches/libelf/0.8.10/100-fix-64-bit-detection.patch
deleted file mode 100644
index 7995443..0000000
--- a/patches/libelf/0.8.10/100-fix-64-bit-detection.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur libelf-0.8.10.orig/configure libelf-0.8.10/configure
---- libelf-0.8.10.orig/configure 2007-09-07 14:08:06.000000000 +0200
-+++ libelf-0.8.10/configure 2008-10-23 22:43:19.000000000 +0200
-@@ -1595,7 +1595,7 @@
- echo $ac_n "(cached) $ac_c" 1>&6
- else
- if test "$cross_compiling" = yes; then
-- ac_cv_sizeof_long_long=0
-+ ac_cv_sizeof_long_long=8
- else
- cat > conftest.$ac_ext <<EOF
- #line 1602 "configure"
-diff -dur libelf-0.8.10.orig/configure.in libelf-0.8.10/configure.in
---- libelf-0.8.10.orig/configure.in 2007-09-07 14:07:59.000000000 +0200
-+++ libelf-0.8.10/configure.in 2008-10-23 22:43:10.000000000 +0200
-@@ -90,7 +90,7 @@
- AC_CHECK_SIZEOF(short,2)
- AC_CHECK_SIZEOF(int,4)
- AC_CHECK_SIZEOF(long,4)
--AC_CHECK_SIZEOF(long long,0)
-+AC_CHECK_SIZEOF(long long,8)
- # Windows port
- AC_CHECK_SIZEOF(__int64, 0)
-
diff --git a/patches/libelf/0.8.11/100-fix-64-bit-detection.patch b/patches/libelf/0.8.11/100-fix-64-bit-detection.patch
deleted file mode 100644
index 7995443..0000000
--- a/patches/libelf/0.8.11/100-fix-64-bit-detection.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur libelf-0.8.10.orig/configure libelf-0.8.10/configure
---- libelf-0.8.10.orig/configure 2007-09-07 14:08:06.000000000 +0200
-+++ libelf-0.8.10/configure 2008-10-23 22:43:19.000000000 +0200
-@@ -1595,7 +1595,7 @@
- echo $ac_n "(cached) $ac_c" 1>&6
- else
- if test "$cross_compiling" = yes; then
-- ac_cv_sizeof_long_long=0
-+ ac_cv_sizeof_long_long=8
- else
- cat > conftest.$ac_ext <<EOF
- #line 1602 "configure"
-diff -dur libelf-0.8.10.orig/configure.in libelf-0.8.10/configure.in
---- libelf-0.8.10.orig/configure.in 2007-09-07 14:07:59.000000000 +0200
-+++ libelf-0.8.10/configure.in 2008-10-23 22:43:10.000000000 +0200
-@@ -90,7 +90,7 @@
- AC_CHECK_SIZEOF(short,2)
- AC_CHECK_SIZEOF(int,4)
- AC_CHECK_SIZEOF(long,4)
--AC_CHECK_SIZEOF(long long,0)
-+AC_CHECK_SIZEOF(long long,8)
- # Windows port
- AC_CHECK_SIZEOF(__int64, 0)
-
diff --git a/patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch b/patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch
deleted file mode 100644
index eba117a..0000000
--- a/patches/ltrace/0.4/100-fix-build-with-exotic-linux-host-OS.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -durN ltrace-0.4.orig/configure ltrace-0.4/configure
---- ltrace-0.4.orig/configure 2008-10-23 23:19:38.000000000 +0200
-+++ ltrace-0.4/configure 2008-10-23 23:19:06.000000000 +0200
-@@ -1392,6 +1392,9 @@
-
-
- HOST_OS="$host_os"
-+case "${HOST_OS}" in
-+ linux-*) HOST_OS=linux-gnu;;
-+esac
-
-
- ac_ext=c
-diff -durN ltrace-0.4.orig/configure.ac ltrace-0.4/configure.ac
---- ltrace-0.4.orig/configure.ac 2008-10-23 23:19:43.000000000 +0200
-+++ ltrace-0.4/configure.ac 2008-10-23 23:18:44.000000000 +0200
-@@ -7,6 +7,9 @@
- dnl Check host system type
- AC_CANONICAL_HOST
- HOST_OS="$host_os"
-+case "${HOST_OS}" in
-+ linux-*) HOST_OS=linux-gnu;;
-+esac
- AC_SUBST(HOST_OS)
-
- dnl Checks for programs.
diff --git a/patches/ltrace/0.4/110-allow-cross-compile.patch b/patches/ltrace/0.4/110-allow-cross-compile.patch
deleted file mode 100644
index a83f7f3..0000000
--- a/patches/ltrace/0.4/110-allow-cross-compile.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-diff -durN ltrace-0.4.orig/Makefile.in ltrace-0.4/Makefile.in
---- ltrace-0.4.orig/Makefile.in 2006-03-05 23:21:07.000000000 +0100
-+++ ltrace-0.4/Makefile.in 2008-10-24 10:31:51.000000000 +0200
-@@ -2,8 +2,14 @@
- # ltrace's Makefile.in
- #
-
--#OS := $(shell uname -s)
- OS := @HOST_OS@
-+ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
-+ -e s/sun4u/sparc64/ \
-+ -e s/arm.*/arm/ \
-+ -e s/sa110/arm/ \
-+ -e s/ppc64/ppc/ \
-+ -e s/s390x/s390/)
-+export ARCH
-
- TOPDIR = $(shell pwd)
-
-@@ -20,10 +26,10 @@
- LIBS = @LIBS@
-
- INSTALL = @INSTALL@
--INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
--INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
--INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
--INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755
-+INSTALL_FILE = $(INSTALL) -p -m 644
-+INSTALL_PROGRAM = $(INSTALL) -p -m 755
-+INSTALL_SCRIPT = $(INSTALL) -p -m 755
-+INSTALL_DIR = $(INSTALL) -p -d -m 755
-
- OBJ = ltrace.o options.o elf.o output.o read_config_file.o \
- execute_program.o wait_for_something.o process_event.o \
-diff -durN ltrace-0.4.orig/configure ltrace-0.4/configure
---- ltrace-0.4.orig/configure 2008-10-23 23:35:39.000000000 +0200
-+++ ltrace-0.4/configure 2008-10-24 10:27:20.000000000 +0200
-@@ -311,7 +311,7 @@
- # include <unistd.h>
- #endif"
-
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_OS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP iquote iquoteend LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_ARCH HOST_OS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP iquote iquoteend LIBOBJS LTLIBOBJS'
- ac_subst_files=''
-
- # Initialize some variables set by options.
-@@ -1390,7 +1390,7 @@
- host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
- host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
--
-+HOST_ARCH="$host_cpu"
- HOST_OS="$host_os"
- case "${HOST_OS}" in
- linux-*) HOST_OS=linux-gnu;;
-@@ -4818,6 +4818,7 @@
- s,@host_cpu@,$host_cpu,;t t
- s,@host_vendor@,$host_vendor,;t t
- s,@host_os@,$host_os,;t t
-+s,@HOST_ARCH@,$HOST_ARCH,;t t
- s,@HOST_OS@,$HOST_OS,;t t
- s,@CC@,$CC,;t t
- s,@CFLAGS@,$CFLAGS,;t t
-diff -durN ltrace-0.4.orig/configure.ac ltrace-0.4/configure.ac
---- ltrace-0.4.orig/configure.ac 2008-10-23 23:35:39.000000000 +0200
-+++ ltrace-0.4/configure.ac 2008-10-24 10:19:47.000000000 +0200
-@@ -6,10 +6,12 @@
-
- dnl Check host system type
- AC_CANONICAL_HOST
-+HOST_ARCH="$host_cpu"
- HOST_OS="$host_os"
- case "${HOST_OS}" in
- linux-*) HOST_OS=linux-gnu;;
- esac
-+AC_SUBST(HOST_ARCH)
- AC_SUBST(HOST_OS)
-
- dnl Checks for programs.
-diff -durN ltrace-0.4.orig/sysdeps/linux-gnu/Makefile ltrace-0.4/sysdeps/linux-gnu/Makefile
---- ltrace-0.4.orig/sysdeps/linux-gnu/Makefile 2006-02-20 22:44:45.000000000 +0100
-+++ ltrace-0.4/sysdeps/linux-gnu/Makefile 2008-10-24 10:24:41.000000000 +0200
-@@ -1,6 +1,3 @@
--ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-- -e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/)
--
- CPPFLAGS += -I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH)
-
- OBJ = trace.o proc.o breakpoint.o
diff --git a/patches/ltrace/0.4/120-alpha-support.patch b/patches/ltrace/0.4/120-alpha-support.patch
deleted file mode 100644
index 90594d7..0000000
--- a/patches/ltrace/0.4/120-alpha-support.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -durN ltrace-0.4.orig/Makefile.in ltrace-0.4/Makefile.in
---- ltrace-0.4.orig/Makefile.in 2008-10-26 15:34:21.000000000 +0100
-+++ ltrace-0.4/Makefile.in 2008-10-26 15:37:40.000000000 +0100
-@@ -5,6 +5,7 @@
- OS := @HOST_OS@
- ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
- -e s/sun4u/sparc64/ \
-+ -e s/alpha.*/alpha/ \
- -e s/arm.*/arm/ \
- -e s/sa110/arm/ \
- -e s/ppc64/ppc/ \
diff --git a/patches/ltrace/0.5.1/100-allow-cross-compile.patch b/patches/ltrace/0.5.1/100-allow-cross-compile.patch
deleted file mode 100644
index dda4f15..0000000
--- a/patches/ltrace/0.5.1/100-allow-cross-compile.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-diff -durN ltrace-0.5.1.orig/Makefile.in ltrace-0.5.1/Makefile.in
---- ltrace-0.5.1.orig/Makefile.in 2008-12-10 18:43:41.000000000 +0100
-+++ ltrace-0.5.1/Makefile.in 2009-03-16 17:23:26.000000000 +0100
-@@ -2,8 +2,14 @@
- # ltrace's Makefile.in
- #
-
--#OS := $(shell uname -s)
- OS := @HOST_OS@
-+ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
-+ -e s/sun4u/sparc64/ \
-+ -e s/arm.*/arm/ \
-+ -e s/sa110/arm/ \
-+ -e s/ppc64/ppc/ \
-+ -e s/s390x/s390/)
-+export ARCH
-
- TOPDIR = $(shell pwd)
-
-diff -durN ltrace-0.5.1.orig/configure ltrace-0.5.1/configure
---- ltrace-0.5.1.orig/configure 2008-12-10 18:43:43.000000000 +0100
-+++ ltrace-0.5.1/configure 2009-03-16 17:20:10.000000000 +0100
-@@ -660,6 +660,7 @@
- host_cpu
- host_vendor
- host_os
-+HOST_ARCH
- HOST_OS
- CC
- CFLAGS
-@@ -1823,6 +1824,7 @@
- case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-+HOST_ARCH="$host_cpu"
- case "$host_os" in
- linux-gnu*) host_os=linux-gnu
- esac
-@@ -5406,6 +5408,7 @@
- host_cpu!$host_cpu$ac_delim
- host_vendor!$host_vendor$ac_delim
- host_os!$host_os$ac_delim
-+HOST_ARCH!$HOST_ARCH$ac_delim
- HOST_OS!$HOST_OS$ac_delim
- CC!$CC$ac_delim
- CFLAGS!$CFLAGS$ac_delim
-@@ -5426,7 +5429,7 @@
- LTLIBOBJS!$LTLIBOBJS$ac_delim
- _ACEOF
-
-- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then
-+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-diff -durN ltrace-0.5.1.orig/configure.ac ltrace-0.5.1/configure.ac
---- ltrace-0.5.1.orig/configure.ac 2008-12-10 18:43:41.000000000 +0100
-+++ ltrace-0.5.1/configure.ac 2009-03-16 17:21:26.000000000 +0100
-@@ -11,6 +11,8 @@
- esac
- HOST_OS="$host_os"
- AC_SUBST(HOST_OS)
-+HOST_ARCH="$host_cpu"
-+AC_SUBST(HOST_ARCH)
-
- dnl Checks for programs.
- AC_PROG_CC
-diff -durN ltrace-0.5.1.orig/sysdeps/linux-gnu/Makefile ltrace-0.5.1/sysdeps/linux-gnu/Makefile
---- ltrace-0.5.1.orig/sysdeps/linux-gnu/Makefile 2008-12-10 18:43:41.000000000 +0100
-+++ ltrace-0.5.1/sysdeps/linux-gnu/Makefile 2009-03-16 17:21:49.000000000 +0100
-@@ -1,6 +1,3 @@
--ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-- -e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/)
--
- CPPFLAGS += -I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH)
-
- OBJ = trace.o proc.o breakpoint.o
diff --git a/patches/ltrace/0.5.1/110-alpha-support.patch b/patches/ltrace/0.5.1/110-alpha-support.patch
deleted file mode 100644
index 4e7a5c9..0000000
--- a/patches/ltrace/0.5.1/110-alpha-support.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -durN ltrace-0.5.1.orig/Makefile.in ltrace-0.5.1/Makefile.in
---- ltrace-0.5.1.orig/Makefile.in 2009-03-16 17:24:08.000000000 +0100
-+++ ltrace-0.5.1/Makefile.in 2009-03-16 17:43:09.000000000 +0100
-@@ -5,6 +5,7 @@
- OS := @HOST_OS@
- ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
- -e s/sun4u/sparc64/ \
-+ -e s/alpha.*/alpha/ \
- -e s/arm.*/arm/ \
- -e s/sa110/arm/ \
- -e s/ppc64/ppc/ \
diff --git a/patches/ltrace/0.5/100-fix-build-with-exotic-linux-host-OS.patch b/patches/ltrace/0.5/100-fix-build-with-exotic-linux-host-OS.patch
deleted file mode 100644
index eba117a..0000000
--- a/patches/ltrace/0.5/100-fix-build-with-exotic-linux-host-OS.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -durN ltrace-0.4.orig/configure ltrace-0.4/configure
---- ltrace-0.4.orig/configure 2008-10-23 23:19:38.000000000 +0200
-+++ ltrace-0.4/configure 2008-10-23 23:19:06.000000000 +0200
-@@ -1392,6 +1392,9 @@
-
-
- HOST_OS="$host_os"
-+case "${HOST_OS}" in
-+ linux-*) HOST_OS=linux-gnu;;
-+esac
-
-
- ac_ext=c
-diff -durN ltrace-0.4.orig/configure.ac ltrace-0.4/configure.ac
---- ltrace-0.4.orig/configure.ac 2008-10-23 23:19:43.000000000 +0200
-+++ ltrace-0.4/configure.ac 2008-10-23 23:18:44.000000000 +0200
-@@ -7,6 +7,9 @@
- dnl Check host system type
- AC_CANONICAL_HOST
- HOST_OS="$host_os"
-+case "${HOST_OS}" in
-+ linux-*) HOST_OS=linux-gnu;;
-+esac
- AC_SUBST(HOST_OS)
-
- dnl Checks for programs.
diff --git a/patches/ltrace/0.5/110-allow-cross-compile.patch b/patches/ltrace/0.5/110-allow-cross-compile.patch
deleted file mode 100644
index c9273b6..0000000
--- a/patches/ltrace/0.5/110-allow-cross-compile.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-diff -durN ltrace-0.5.orig/Makefile.in ltrace-0.5/Makefile.in
---- ltrace-0.5.orig/Makefile.in 2006-03-14 00:12:01.000000000 +0100
-+++ ltrace-0.5/Makefile.in 2008-11-04 19:23:05.000000000 +0100
-@@ -2,8 +2,14 @@
- # ltrace's Makefile.in
- #
-
--#OS := $(shell uname -s)
- OS := @HOST_OS@
-+ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
-+ -e s/sun4u/sparc64/ \
-+ -e s/arm.*/arm/ \
-+ -e s/sa110/arm/ \
-+ -e s/ppc64/ppc/ \
-+ -e s/s390x/s390/)
-+export ARCH
-
- TOPDIR = $(shell pwd)
-
-@@ -20,10 +26,10 @@
- LIBS = @LIBS@
-
- INSTALL = @INSTALL@
--INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
--INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
--INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
--INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755
-+INSTALL_FILE = $(INSTALL) -p -m 644
-+INSTALL_PROGRAM = $(INSTALL) -p -m 755
-+INSTALL_SCRIPT = $(INSTALL) -p -m 755
-+INSTALL_DIR = $(INSTALL) -p -d -m 755
-
- OBJ = ltrace.o options.o elf.o output.o read_config_file.o \
- execute_program.o wait_for_something.o process_event.o \
-diff -durN ltrace-0.5.orig/configure ltrace-0.5/configure
---- ltrace-0.5.orig/configure 2008-11-04 19:23:00.000000000 +0100
-+++ ltrace-0.5/configure 2008-11-04 19:23:05.000000000 +0100
-@@ -311,7 +311,7 @@
- # include <unistd.h>
- #endif"
-
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_OS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP iquote iquoteend LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_ARCH HOST_OS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP iquote iquoteend LIBOBJS LTLIBOBJS'
- ac_subst_files=''
-
- # Initialize some variables set by options.
-@@ -1390,7 +1390,7 @@
- host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
- host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
--
-+HOST_ARCH="$host_cpu"
- HOST_OS="$host_os"
- case "${HOST_OS}" in
- linux-*) HOST_OS=linux-gnu;;
-@@ -4846,6 +4846,7 @@
- s,@host_cpu@,$host_cpu,;t t
- s,@host_vendor@,$host_vendor,;t t
- s,@host_os@,$host_os,;t t
-+s,@HOST_ARCH@,$HOST_ARCH,;t t
- s,@HOST_OS@,$HOST_OS,;t t
- s,@CC@,$CC,;t t
- s,@CFLAGS@,$CFLAGS,;t t
-diff -durN ltrace-0.5.orig/configure.ac ltrace-0.5/configure.ac
---- ltrace-0.5.orig/configure.ac 2008-11-04 19:23:00.000000000 +0100
-+++ ltrace-0.5/configure.ac 2008-11-04 19:23:05.000000000 +0100
-@@ -6,10 +6,12 @@
-
- dnl Check host system type
- AC_CANONICAL_HOST
-+HOST_ARCH="$host_cpu"
- HOST_OS="$host_os"
- case "${HOST_OS}" in
- linux-*) HOST_OS=linux-gnu;;
- esac
-+AC_SUBST(HOST_ARCH)
- AC_SUBST(HOST_OS)
-
- dnl Checks for programs.
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/Makefile ltrace-0.5/sysdeps/linux-gnu/Makefile
---- ltrace-0.5.orig/sysdeps/linux-gnu/Makefile 2006-02-20 22:44:45.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/Makefile 2008-11-04 19:23:05.000000000 +0100
-@@ -1,6 +1,3 @@
--ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-- -e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/)
--
- CPPFLAGS += -I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH)
-
- OBJ = trace.o proc.o breakpoint.o
diff --git a/patches/ltrace/0.5/120-alpha-support.patch b/patches/ltrace/0.5/120-alpha-support.patch
deleted file mode 100644
index 90594d7..0000000
--- a/patches/ltrace/0.5/120-alpha-support.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -durN ltrace-0.4.orig/Makefile.in ltrace-0.4/Makefile.in
---- ltrace-0.4.orig/Makefile.in 2008-10-26 15:34:21.000000000 +0100
-+++ ltrace-0.4/Makefile.in 2008-10-26 15:37:40.000000000 +0100
-@@ -5,6 +5,7 @@
- OS := @HOST_OS@
- ARCH := $(shell echo "@HOST_ARCH@" |sed -e s/i.86/i386/ \
- -e s/sun4u/sparc64/ \
-+ -e s/alpha.*/alpha/ \
- -e s/arm.*/arm/ \
- -e s/sa110/arm/ \
- -e s/ppc64/ppc/ \
diff --git a/patches/ltrace/0.5/130-fixes-by-debian.patch b/patches/ltrace/0.5/130-fixes-by-debian.patch
deleted file mode 100644
index 25ebdab..0000000
--- a/patches/ltrace/0.5/130-fixes-by-debian.patch
+++ /dev/null
@@ -1,812 +0,0 @@
-This patch was vampirised from the 0.5-3.1 Debian-packaged version of ltrace,
-and contains the following fixes (exerpt from the Debian changelog). Moreover,
-you will also find an exerpt of the Debian copyright file with proper
-attribution.
-
-================ Debian changelog exerpt ================
-ltrace (0.5-3.1) unstable; urgency=low
-
- * Non-maintainer upload.
- * Big thanks for Anderson Lizardo for providing patches!
- * Add generic support for arm targets, Closes: #176413
- * Save funtion arguments on arm, Closes: #462530
- * Add thumb instruction support, Closes: #462531
- * Add basic arm/eabi support, Closes: #450931
- * fix exec() testcase cleanup, Closes: #462532
- * fix memory corruption in clone() test, Closes: #462533
- * fix tracing child with "-p" option, Closes: #462535
- * Update standard, no changes
-
- -- Riku Voipio <riku.voipio@iki.fi> Tue, 29 Jan 2008 00:26:50 +0200
-
-ltrace (0.5-3) unstable; urgency=low
-
- * Really fix compilation problems in ppc (!)
-
- -- Juan Cespedes <cespedes@debian.org> Fri, 31 Aug 2007 19:04:03 +0200
-
-ltrace (0.5-2) unstable; urgency=low
-
- * Fixed compilation issue in ppc
-
- -- Juan Cespedes <cespedes@debian.org> Fri, 31 Aug 2007 13:53:27 +0200
-
-ltrace (0.5-1) unstable; urgency=low
-
- * New upstream version
- * Remove some unneeded files in /usr/share/doc (ChangeLog, COPYING...)
- * Fix several typos (closes: Bug#372928)
- * Added more system calls to ltrace.conf
-
- -- Juan Cespedes <cespedes@debian.org> Thu, 30 Aug 2007 14:54:44 +0200
-============== End Debian changelog exerpt ==============
-
-================ Debian copyright exerpt ================
-Copyrights
-----------
-Copyright (C) 1997-2007 Juan Cespedes <cespedes@debian.org>
-
-ARMLinux port: Copyright (C) 1998 Pat Beirne <pbeirne@home.com>
-m68k port: Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
-Misc fixes: Copyright (C) 1999 Morten Eriksen <mortene@sim.no>
-s390 port: Copyright (C) 2001 IBM Poughkeepsie, IBM Cororation <slate@us.ibm.com>
-ELF hacking: Copyright (C) 1999 Silvio Cesare <silvio@big.net.au>
-PowerPC port: Copyright (C) 2001-2002 Anton Blanchard <anton@samba.org>
-SPARC port: Copyright (C) 1999 Jakub Jelinek <jakub@redhat.com>
-
-Autoconf stuff: Copyright 1992-1996 Free Software Foundation, Inc.
-install-sh: Copyright 1991 by the Massachusetts Institute of Technology
-C++ demangle: Copyright 1989-1997 Free Software Foundation, Inc.
-============== End Debian copyright exerpt ==============
-
-diff -durN ltrace-0.5.orig/breakpoints.c ltrace-0.5/breakpoints.c
---- ltrace-0.5.orig/breakpoints.c 2006-06-14 06:55:21.000000000 +0200
-+++ ltrace-0.5/breakpoints.c 2008-11-04 19:25:50.000000000 +0100
-@@ -53,6 +53,10 @@
- if (libsym)
- libsym->brkpnt = sbp;
- }
-+#ifdef __arm__
-+ sbp->thumb_mode = proc->thumb_mode;
-+ proc->thumb_mode = 0;
-+#endif
- sbp->enabled++;
- if (sbp->enabled == 1 && proc->pid)
- enable_breakpoint(proc->pid, sbp);
-diff -durN ltrace-0.5.orig/elf.c ltrace-0.5/elf.c
---- ltrace-0.5.orig/elf.c 2006-06-14 06:55:21.000000000 +0200
-+++ ltrace-0.5/elf.c 2008-11-04 19:25:50.000000000 +0100
-@@ -464,8 +464,7 @@
- if (strcmp(xptr->name, PLTs_initialized_by_here) == 0) {
- if (lte->ehdr.e_entry) {
- add_library_symbol (
-- elf_plt2addr (lte, (void*)(long)
-- lte->ehdr.e_entry),
-+ opd2addr (lte, lte->ehdr.e_entry),
- PLTs_initialized_by_here,
- lib_tail, 1, 0);
- fprintf (stderr, "WARNING: Using e_ent"
-diff -durN ltrace-0.5.orig/etc/ltrace.conf ltrace-0.5/etc/ltrace.conf
---- ltrace-0.5.orig/etc/ltrace.conf 2006-02-20 22:55:47.000000000 +0100
-+++ ltrace-0.5/etc/ltrace.conf 2008-11-04 19:25:50.000000000 +0100
-@@ -444,3 +444,81 @@
- int SYS_removexattr(string,string);
- int SYS_lremovexattr(string,string);
- int SYS_fremovexattr(int,string);
-+int SYS_chdir(string);
-+int SYS_fchdir(int);
-+int SYS_chmod(string,octal);
-+int SYS_fchmod(int,octal);
-+int SYS_chown(string,int,int);
-+int SYS_fchown(int,int,int);
-+int SYS_lchown(string,int,int);
-+int SYS_chroot(string);
-+int SYS_dup(int);
-+int SYS_dup2(int,int);
-+int SYS_fdatasync(int);
-+int SYS_fsync(int);
-+int SYS_getpriority(int,int);
-+int SYS_setpriority(int,int,int);
-+int SYS_getrlimit(int,addr);
-+int SYS_setrlimit(int,addr);
-+int SYS_gettimeofday(addr,addr);
-+int SYS_settimeofday(addr,addr);
-+int SYS_setfsgid(int);
-+int SYS_setfsuid(int);
-+int SYS_getuid(void);
-+int SYS_setuid(int);
-+int SYS_getgid(void);
-+int SYS_setgid(int);
-+int SYS_getsid(int);
-+int SYS_setsid(int);
-+int SYS_setreuid(int,int);
-+int SYS_setregid(int,int);
-+int SYS_geteuid(void);
-+int SYS_getegid(void);
-+int SYS_setpgid(int,int);
-+int SYS_getresuid(addr,addr,addr);
-+int SYS_setresuid(int,int,int);
-+int SYS_getresgid(addr,addr,addr);
-+int SYS_setresgid(int,int,int);
-+int SYS_kill(int,int);
-+int SYS_link(string,string);
-+int SYS_madvise(addr,ulong,int);
-+int SYS_mkdir(string,octal);
-+int SYS_mknod(string,octal,int);
-+int SYS_msync(addr,ulong,int);
-+int SYS_nice(int);
-+int SYS_poll(addr,uint,int);
-+int SYS_readdir(uint,addr,uint);
-+int SYS_readlink(string,string,ulong);
-+int SYS_reboot(int,int,int,addr);
-+int SYS_rename(string,string);
-+int SYS_rmdir(string);
-+int SYS_sigaltstack(addr,addr);
-+int SYS_statfs(string,addr);
-+int SYS_fstatfs(int,addr);
-+int SYS_fstat(int,addr);
-+int SYS_lstat(string,addr);
-+int SYS_stime(addr);
-+int SYS_symlink(string, string);
-+int SYS_sysinfo(addr);
-+int SYS_syslog(int,string,int);
-+int SYS_truncate(string,long);
-+int SYS_ftruncate(int,long);
-+int SYS_mount(string,string,string,ulong,addr);
-+int SYS_umount(string);
-+int SYS_umount2(string,int);
-+int SYS_unlink(string);
-+int SYS_utime(string,addr);
-+long SYS_lseek(int,long,int);
-+addr SYS_signal(int,addr);
-+int SYS_sigaction(int,addr,addr);
-+int SYS_pause(void);
-+int SYS_sigpending(addr);
-+int SYS_sigprocmask(int,addr,addr);
-+int SYS_sigqueue(int,int,addr);
-+int SYS_sigsuspend(addr);
-+int SYS_wait(addr);
-+int SYS_waitpid(int,addr,int);
-+ulong SYS_readv(int,addr,int);
-+ulong SYS_writev(int,addr,int);
-+int SYS_mprotect(addr,int,int);
-+int SYS_access(string,octal);
-diff -durN ltrace-0.5.orig/ltrace.1 ltrace-0.5/ltrace.1
---- ltrace-0.5.orig/ltrace.1 2006-06-16 03:15:18.000000000 +0200
-+++ ltrace-0.5/ltrace.1 2008-11-04 19:25:50.000000000 +0100
-@@ -30,7 +30,7 @@
- .TP
- .I \-C, \-\-demangle
- Decode (demangle) low-level symbol names into user-level names.
--Besides removing any initial underscore prepended by the system,
-+Besides removing any initial underscore prefix used by the system,
- this makes C++ function names readable.
- .TP
- .I \-d, \-\-debug
-diff -durN ltrace-0.5.orig/ltrace.c ltrace-0.5/ltrace.c
---- ltrace-0.5.orig/ltrace.c 2006-02-20 22:48:07.000000000 +0100
-+++ ltrace-0.5/ltrace.c 2008-11-04 19:25:50.000000000 +0100
-@@ -54,6 +54,9 @@
- {
- exiting = 1;
- debug(1, "Received interrupt signal; exiting...");
-+ if (opt_o) {
-+ fclose(output);
-+ }
- signal(SIGINT, SIG_IGN);
- signal(SIGTERM, SIG_IGN);
- signal(SIGALRM, signal_alarm);
-@@ -74,6 +77,9 @@
- if (opt_c) {
- show_summary();
- }
-+ if (opt_o) {
-+ fclose(output);
-+ }
- }
-
- static void guess_cols(void)
-diff -durN ltrace-0.5.orig/ltrace.h ltrace-0.5/ltrace.h
---- ltrace-0.5.orig/ltrace.h 2006-06-14 06:55:21.000000000 +0200
-+++ ltrace-0.5/ltrace.h 2008-11-04 19:25:50.000000000 +0100
-@@ -26,6 +26,9 @@
- unsigned char orig_value[BREAKPOINT_LENGTH];
- int enabled;
- struct library_symbol *libsym;
-+#ifdef __arm__
-+ int thumb_mode;
-+#endif
- };
-
- enum arg_type {
-@@ -119,6 +122,9 @@
- void *arch_ptr;
- short e_machine;
- short need_to_reinitialize_breakpoints;
-+#ifdef __arm__
-+ int thumb_mode; /* ARM execution mode: 0: ARM mode, 1: Thumb mode */
-+#endif
-
- /* output: */
- enum tof type_being_displayed;
-@@ -136,12 +142,14 @@
- LT_EV_EXIT_SIGNAL,
- LT_EV_SYSCALL,
- LT_EV_SYSRET,
-+ LT_EV_ARCH_SYSCALL,
-+ LT_EV_ARCH_SYSRET,
- LT_EV_BREAKPOINT
- } thing;
- union {
- int ret_val; /* _EV_EXIT */
- int signum; /* _EV_SIGNAL, _EV_EXIT_SIGNAL */
-- int sysnum; /* _EV_SYSCALL, _EV_SYSRET */
-+ int sysnum; /* _EV_SYSCALL, _EV_SYSRET, _EV_ARCH_SYSCALL, _EV_ARCH_SYSRET */
- void *brk_addr; /* _EV_BREAKPOINT */
- } e_un;
- };
-diff -durN ltrace-0.5.orig/options.c ltrace-0.5/options.c
---- ltrace-0.5.orig/options.c 2006-04-24 22:06:23.000000000 +0200
-+++ ltrace-0.5/options.c 2008-11-04 19:25:50.000000000 +0100
-@@ -42,6 +42,7 @@
- #endif
- int opt_n = 0; /* indent trace output according to program flow */
- int opt_T = 0; /* show the time spent inside each call */
-+int opt_o = 0; /* output to a specific file */
-
- /* List of pids given to option -p: */
- struct opt_p_t *opt_p = NULL; /* attach to process with a given pid */
-@@ -274,6 +275,7 @@
- opt_n = atoi(optarg);
- break;
- case 'o':
-+ opt_o++;
- output = fopen(optarg, "w");
- if (!output) {
- fprintf(stderr,
-diff -durN ltrace-0.5.orig/options.h ltrace-0.5/options.h
---- ltrace-0.5.orig/options.h 2006-03-13 18:43:13.000000000 +0100
-+++ ltrace-0.5/options.h 2008-11-04 19:25:50.000000000 +0100
-@@ -20,6 +20,7 @@
- extern int opt_C; /* Demanglelow-level symbol names into user-level names */
- extern int opt_n; /* indent trace output according to program flow */
- extern int opt_T; /* show the time spent inside each call */
-+extern int opt_o; /* output to a specific file */
-
- struct opt_p_t {
- pid_t pid;
-diff -durN ltrace-0.5.orig/process_event.c ltrace-0.5/process_event.c
---- ltrace-0.5.orig/process_event.c 2006-06-14 06:55:21.000000000 +0200
-+++ ltrace-0.5/process_event.c 2008-11-04 19:25:50.000000000 +0100
-@@ -24,7 +24,9 @@
- static void process_exit(struct event *event);
- static void process_exit_signal(struct event *event);
- static void process_syscall(struct event *event);
-+static void process_arch_syscall(struct event *event);
- static void process_sysret(struct event *event);
-+static void process_arch_sysret(struct event *event);
- static void process_breakpoint(struct event *event);
- static void remove_proc(struct process *proc);
-
-@@ -81,6 +83,24 @@
- }
- }
-
-+static char *arch_sysname(struct process *proc, int sysnum)
-+{
-+ static char result[128];
-+ static char *arch_syscalent[] = {
-+#include "arch_syscallent.h"
-+ };
-+ int nsyscals = sizeof arch_syscalent / sizeof arch_syscalent[0];
-+
-+ if (sysnum < 0 || sysnum >= nsyscals) {
-+ sprintf(result, "ARCH_%d", sysnum);
-+ return result;
-+ } else {
-+ sprintf(result, "ARCH_%s",
-+ arch_syscalent[sysnum]);
-+ return result;
-+ }
-+}
-+
- void process_event(struct event *event)
- {
- switch (event->thing) {
-@@ -115,6 +135,18 @@
- event->e_un.sysnum);
- process_sysret(event);
- return;
-+ case LT_EV_ARCH_SYSCALL:
-+ debug(1, "event: arch_syscall (%s [%d])",
-+ arch_sysname(event->proc, event->e_un.sysnum),
-+ event->e_un.sysnum);
-+ process_arch_syscall(event);
-+ return;
-+ case LT_EV_ARCH_SYSRET:
-+ debug(1, "event: arch_sysret (%s [%d])",
-+ arch_sysname(event->proc, event->e_un.sysnum),
-+ event->e_un.sysnum);
-+ process_arch_sysret(event);
-+ return;
- case LT_EV_BREAKPOINT:
- debug(1, "event: breakpoint");
- process_breakpoint(event);
-@@ -195,6 +227,19 @@
- continue_process(event->proc->pid);
- }
-
-+static void process_arch_syscall(struct event *event)
-+{
-+ if (opt_S) {
-+ output_left(LT_TOF_SYSCALL, event->proc,
-+ arch_sysname(event->proc, event->e_un.sysnum));
-+ }
-+ if (event->proc->breakpoints_enabled == 0) {
-+ enable_all_breakpoints(event->proc);
-+ }
-+ callstack_push_syscall(event->proc, 0xf0000 + event->e_un.sysnum);
-+ continue_process(event->proc->pid);
-+}
-+
- struct timeval current_time_spent;
-
- static void calc_time_spent(struct process *proc)
-@@ -257,6 +302,19 @@
- continue_process(event->proc->pid);
- }
-
-+static void process_arch_sysret(struct event *event)
-+{
-+ if (opt_T || opt_c) {
-+ calc_time_spent(event->proc);
-+ }
-+ callstack_pop(event->proc);
-+ if (opt_S) {
-+ output_right(LT_TOF_SYSCALLR, event->proc,
-+ arch_sysname(event->proc, event->e_un.sysnum));
-+ }
-+ continue_process(event->proc->pid);
-+}
-+
- static void process_breakpoint(struct event *event)
- {
- int i, j;
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/Makefile ltrace-0.5/sysdeps/linux-gnu/Makefile
---- ltrace-0.5.orig/sysdeps/linux-gnu/Makefile 2008-11-04 19:25:11.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/Makefile 2008-11-04 19:25:50.000000000 +0100
-@@ -2,7 +2,7 @@
-
- OBJ = trace.o proc.o breakpoint.o
-
--all: sysdep.h signalent.h syscallent.h signalent1.h syscallent1.h ../sysdep.o
-+all: sysdep.h signalent.h syscallent.h arch_syscallent.h signalent1.h syscallent1.h ../sysdep.o
-
- sysdep.h: $(ARCH)/arch.h
- cat $(ARCH)/arch.h > sysdep.h
-@@ -26,6 +26,13 @@
- > syscallent1.h; \
- fi
-
-+arch_syscallent.h:
-+ if [ -f $(ARCH)/arch_syscallent.h ]; then \
-+ cp $(ARCH)/arch_syscallent.h arch_syscallent.h; \
-+ else \
-+ > arch_syscallent.h; \
-+ fi
-+
- ../sysdep.o: os.o $(ARCH)/arch.o
- $(CC) -nostdlib -r -o ../sysdep.o os.o $(ARCH)/arch.o
-
-@@ -37,7 +44,7 @@
-
- clean:
- $(MAKE) -C $(ARCH) clean
-- rm -f $(OBJ) sysdep.h signalent.h signalent1.h syscallent.h
-+ rm -f $(OBJ) sysdep.h signalent.h signalent1.h syscallent.h arch_syscallent.h
- rm -f syscallent1.h os.o sysdep.o ../sysdep.o
-
- dummy:
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arch_mksyscallent ltrace-0.5/sysdeps/linux-gnu/arch_mksyscallent
---- ltrace-0.5.orig/sysdeps/linux-gnu/arch_mksyscallent 1970-01-01 01:00:00.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/arch_mksyscallent 2008-11-04 19:25:50.000000000 +0100
-@@ -0,0 +1,43 @@
-+#!/usr/bin/awk -f
-+
-+# hack expression to generate arch_syscallent.h from <asm/unistd.h>
-+# It reads from stdin and writes to stdout
-+# Currently (linux-2.6.16), it works OK on arm
-+# It is untested in other architectures
-+
-+BEGIN {
-+ max=0;
-+ FS="[ \t\n()+]+";
-+}
-+
-+{
-+# printf("/%s/%s/%s/%s/\n", $1, $2, $3, $4);
-+ if (($1 ~ /^#define$/) && ($2 ~ /^__[A-Z]+_NR_/)) {
-+ sub(/^__[A-Z]+_NR_/,"",$2);
-+ if (($3>=0) && ($3<=1000)) {
-+ SYSCALL[$3]=$2;
-+ if ($3 > max) {
-+ max=$3;
-+ }
-+ } else if (($3 ~ /^__[A-Z]+_NR_BASE$/) && ($4>=0) && ($4<=1000)) {
-+ SYSCALL[$4]=$2;
-+ if ($4 > max) {
-+ max=$4;
-+ }
-+ }
-+ }
-+}
-+
-+END {
-+ for(i=0; i<=max; i++) {
-+ if (!SYSCALL[i]) {
-+ SYSCALL[i] = i;
-+ }
-+ pad = 32 - length(SYSCALL[i]);
-+ if (pad<1) {
-+ pad=1;
-+ }
-+ printf("\t\"%s\",%*s/* %d */\n", SYSCALL[i], pad, "", i);
-+ }
-+}
-+
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arm/Makefile ltrace-0.5/sysdeps/linux-gnu/arm/Makefile
---- ltrace-0.5.orig/sysdeps/linux-gnu/arm/Makefile 2006-02-20 22:44:45.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/arm/Makefile 2008-11-04 19:25:50.000000000 +0100
-@@ -1,4 +1,4 @@
--OBJ = trace.o regs.o plt.o
-+OBJ = trace.o regs.o plt.o breakpoint.o
-
- all: arch.o
-
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arm/arch.h ltrace-0.5/sysdeps/linux-gnu/arm/arch.h
---- ltrace-0.5.orig/sysdeps/linux-gnu/arm/arch.h 2006-04-24 22:06:23.000000000 +0200
-+++ ltrace-0.5/sysdeps/linux-gnu/arm/arch.h 2008-11-04 19:25:50.000000000 +0100
-@@ -1,5 +1,10 @@
--#define BREAKPOINT_VALUE { 0x01, 0x00, 0x9f, 0xef }
-+#define ARCH_HAVE_ENABLE_BREAKPOINT 1
-+#define ARCH_HAVE_DISABLE_BREAKPOINT 1
-+
-+#define BREAKPOINT_VALUE { 0xf0, 0x01, 0xf0, 0xe7 }
- #define BREAKPOINT_LENGTH 4
-+#define THUMB_BREAKPOINT_VALUE { 0x01, 0xde }
-+#define THUMB_BREAKPOINT_LENGTH 2
- #define DECR_PC_AFTER_BREAK 0
-
- #define LT_ELFCLASS ELFCLASS32
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arm/arch_syscallent.h ltrace-0.5/sysdeps/linux-gnu/arm/arch_syscallent.h
---- ltrace-0.5.orig/sysdeps/linux-gnu/arm/arch_syscallent.h 1970-01-01 01:00:00.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/arm/arch_syscallent.h 2008-11-04 19:25:50.000000000 +0100
-@@ -0,0 +1,6 @@
-+ "0", /* 0 */
-+ "breakpoint", /* 1 */
-+ "cacheflush", /* 2 */
-+ "usr26", /* 3 */
-+ "usr32", /* 4 */
-+ "set_tls", /* 5 */
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arm/breakpoint.c ltrace-0.5/sysdeps/linux-gnu/arm/breakpoint.c
---- ltrace-0.5.orig/sysdeps/linux-gnu/arm/breakpoint.c 1970-01-01 01:00:00.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/arm/breakpoint.c 2008-11-04 19:25:50.000000000 +0100
-@@ -0,0 +1,86 @@
-+/*
-+ * This file is part of ltrace.
-+ *
-+ * Copyright (C) 2007 by Instituto Nokia de Tecnologia (INdT)
-+ *
-+ * Author: Anderson Lizardo <anderson.lizardo@indt.org.br>
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA
-+ *
-+ * Modified from sysdeps/linux-gnu/breakpoint.c and added ARM Thumb support.
-+*/
-+
-+#include <sys/ptrace.h>
-+#include "config.h"
-+#include "arch.h"
-+#include "options.h"
-+#include "output.h"
-+#include "debug.h"
-+
-+void arch_enable_breakpoint(pid_t pid, struct breakpoint *sbp)
-+{
-+ unsigned int i, j;
-+ const unsigned char break_insn[] = BREAKPOINT_VALUE;
-+ const unsigned char thumb_break_insn[] = THUMB_BREAKPOINT_VALUE;
-+
-+ debug(1, "arch_enable_breakpoint(%d,%p)", pid, sbp->addr);
-+
-+ for (i = 0; i < 1 + ((BREAKPOINT_LENGTH - 1) / sizeof(long)); i++) {
-+ long a =
-+ ptrace(PTRACE_PEEKTEXT, pid, sbp->addr + i * sizeof(long),
-+ 0);
-+ unsigned char *bytes = (unsigned char *)&a;
-+
-+ debug(2, "current = 0x%lx, orig_value = 0x%lx, thumb_mode = %d", a, *(long *)&sbp->orig_value, sbp->thumb_mode);
-+ for (j = 0;
-+ j < sizeof(long)
-+ && i * sizeof(long) + j < BREAKPOINT_LENGTH; j++) {
-+
-+ sbp->orig_value[i * sizeof(long) + j] = bytes[j];
-+ if (!sbp->thumb_mode) {
-+ bytes[j] = break_insn[i * sizeof(long) + j];
-+ }
-+ else if (j < THUMB_BREAKPOINT_LENGTH) {
-+ bytes[j] = thumb_break_insn[i * sizeof(long) + j];
-+ }
-+ }
-+ ptrace(PTRACE_POKETEXT, pid, sbp->addr + i * sizeof(long), a);
-+ }
-+}
-+
-+void arch_disable_breakpoint(pid_t pid, const struct breakpoint *sbp)
-+{
-+ unsigned int i, j;
-+ const unsigned char break_insn[] = BREAKPOINT_VALUE;
-+ const unsigned char thumb_break_insn[] = THUMB_BREAKPOINT_VALUE;
-+
-+ debug(1, "arch_disable_breakpoint(%d,%p)", pid, sbp->addr);
-+
-+ for (i = 0; i < 1 + ((BREAKPOINT_LENGTH - 1) / sizeof(long)); i++) {
-+ long a =
-+ ptrace(PTRACE_PEEKTEXT, pid, sbp->addr + i * sizeof(long),
-+ 0);
-+ unsigned char *bytes = (unsigned char *)&a;
-+
-+ debug(2, "current = 0x%lx, orig_value = 0x%lx, thumb_mode = %d", a, *(long *)&sbp->orig_value, sbp->thumb_mode);
-+ for (j = 0;
-+ j < sizeof(long)
-+ && i * sizeof(long) + j < BREAKPOINT_LENGTH; j++) {
-+
-+ bytes[j] = sbp->orig_value[i * sizeof(long) + j];
-+ }
-+ ptrace(PTRACE_POKETEXT, pid, sbp->addr + i * sizeof(long), a);
-+ }
-+}
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arm/ptrace.h ltrace-0.5/sysdeps/linux-gnu/arm/ptrace.h
---- ltrace-0.5.orig/sysdeps/linux-gnu/arm/ptrace.h 2006-02-20 22:44:45.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/arm/ptrace.h 2008-11-04 19:25:50.000000000 +0100
-@@ -1 +1,9 @@
- #include <sys/ptrace.h>
-+#include <asm/ptrace.h>
-+
-+typedef struct {
-+ int valid;
-+ struct pt_regs regs;
-+ long func_arg[5];
-+ long sysc_arg[5];
-+} proc_archdep;
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arm/regs.c ltrace-0.5/sysdeps/linux-gnu/arm/regs.c
---- ltrace-0.5.orig/sysdeps/linux-gnu/arm/regs.c 2006-02-20 22:48:07.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/arm/regs.c 2008-11-04 19:25:50.000000000 +0100
-@@ -39,5 +39,10 @@
- * a CISC architecture; in our case, we don't need that */
- void *get_return_addr(struct process *proc, void *stack_pointer)
- {
-- return (void *)ptrace(PTRACE_PEEKUSER, proc->pid, off_lr, 0);
-+ long addr = ptrace(PTRACE_PEEKUSER, proc->pid, off_lr, 0);
-+
-+ proc->thumb_mode = addr & 1;
-+ if (proc->thumb_mode)
-+ addr &= ~1;
-+ return (void *)addr;
- }
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/arm/trace.c ltrace-0.5/sysdeps/linux-gnu/arm/trace.c
---- ltrace-0.5.orig/sysdeps/linux-gnu/arm/trace.c 2006-02-20 22:48:07.000000000 +0100
-+++ ltrace-0.5/sysdeps/linux-gnu/arm/trace.c 2008-11-04 19:25:50.000000000 +0100
-@@ -2,6 +2,7 @@
- #include "config.h"
- #endif
-
-+#include <string.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <signal.h>
-@@ -9,6 +10,8 @@
- #include <asm/ptrace.h>
-
- #include "ltrace.h"
-+#include "output.h"
-+#include "ptrace.h"
-
- #if (!defined(PTRACE_PEEKUSER) && defined(PTRACE_PEEKUSR))
- # define PTRACE_PEEKUSER PTRACE_PEEKUSR
-@@ -18,19 +21,25 @@
- # define PTRACE_POKEUSER PTRACE_POKEUSR
- #endif
-
--/* syscall tracing protocol: ArmLinux
-- on the way in, ip is 0
-- on the way out, ip is non-zero
--*/
- #define off_r0 0
-+#define off_r7 28
- #define off_ip 48
- #define off_pc 60
-
- void get_arch_dep(struct process *proc)
- {
-+ proc_archdep *a;
-+
-+ if (!proc->arch_ptr)
-+ proc->arch_ptr = (void *)malloc(sizeof(proc_archdep));
-+ a = (proc_archdep *) (proc->arch_ptr);
-+ a->valid = (ptrace(PTRACE_GETREGS, proc->pid, 0, &a->regs) >= 0);
- }
-
--/* Returns 1 if syscall, 2 if sysret, 0 otherwise.
-+/* Returns 0 if not a syscall,
-+ * 1 if syscall entry, 2 if syscall exit,
-+ * 3 if arch-specific syscall entry, 4 if arch-specific syscall exit,
-+ * -1 on error.
- */
- int syscall_p(struct process *proc, int status, int *sysnum)
- {
-@@ -40,19 +49,39 @@
- int pc = ptrace(PTRACE_PEEKUSER, proc->pid, off_pc, 0);
- /* fetch the SWI instruction */
- int insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0);
-+ int ip = ptrace(PTRACE_PEEKUSER, proc->pid, off_ip, 0);
-
-- *sysnum = insn & 0xFFFF;
-- /* if it is a syscall, return 1 or 2 */
-- if ((insn & 0xFFFF0000) == 0xef900000) {
-- return ptrace(PTRACE_PEEKUSER, proc->pid, off_ip,
-- 0) ? 2 : 1;
-+ if (insn == 0xef000000 || insn == 0x0f000000) {
-+ /* EABI syscall */
-+ *sysnum = ptrace(PTRACE_PEEKUSER, proc->pid, off_r7, 0);
-+ } else if ((insn & 0xfff00000) == 0xef900000) {
-+ /* old ABI syscall */
-+ *sysnum = insn & 0xfffff;
-+ } else {
-+ /* TODO: handle swi<cond> variations */
-+ /* one possible reason for getting in here is that we
-+ * are coming from a signal handler, so the current
-+ * PC does not point to the instruction just after the
-+ * "swi" one. */
-+ output_line(proc, "unexpected instruction 0x%x at %p", insn, pc - 4);
-+ return -1;
-+ }
-+ if ((*sysnum & 0xf0000) == 0xf0000) {
-+ /* arch-specific syscall */
-+ *sysnum &= ~0xf0000;
-+ return ip ? 4 : 3;
- }
-+ /* ARM syscall convention: on syscall entry, ip is zero;
-+ * on syscall exit, ip is non-zero */
-+ return ip ? 2 : 1;
- }
- return 0;
- }
-
- long gimme_arg(enum tof type, struct process *proc, int arg_num)
- {
-+ proc_archdep *a = (proc_archdep *) proc->arch_ptr;
-+
- if (arg_num == -1) { /* return value */
- return ptrace(PTRACE_PEEKUSER, proc->pid, off_r0, 0);
- }
-@@ -60,6 +89,10 @@
- /* deal with the ARM calling conventions */
- if (type == LT_TOF_FUNCTION || type == LT_TOF_FUNCTIONR) {
- if (arg_num < 4) {
-+ if (a->valid && type == LT_TOF_FUNCTION)
-+ return a->regs.uregs[arg_num];
-+ if (a->valid && type == LT_TOF_FUNCTIONR)
-+ return a->func_arg[arg_num];
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * arg_num,
- 0);
- } else {
-@@ -69,6 +102,10 @@
- }
- } else if (type == LT_TOF_SYSCALL || type == LT_TOF_SYSCALLR) {
- if (arg_num < 5) {
-+ if (a->valid && type == LT_TOF_SYSCALL)
-+ return a->regs.uregs[arg_num];
-+ if (a->valid && type == LT_TOF_SYSCALLR)
-+ return a->sysc_arg[arg_num];
- return ptrace(PTRACE_PEEKUSER, proc->pid, 4 * arg_num,
- 0);
- } else {
-@@ -86,4 +123,11 @@
-
- void save_register_args(enum tof type, struct process *proc)
- {
-+ proc_archdep *a = (proc_archdep *) proc->arch_ptr;
-+ if (a->valid) {
-+ if (type == LT_TOF_FUNCTION)
-+ memcpy(a->func_arg, a->regs.uregs, sizeof(a->func_arg));
-+ else
-+ memcpy(a->sysc_arg, a->regs.uregs, sizeof(a->sysc_arg));
-+ }
- }
-diff -durN ltrace-0.5.orig/sysdeps/linux-gnu/ppc/arch.h ltrace-0.5/sysdeps/linux-gnu/ppc/arch.h
---- ltrace-0.5.orig/sysdeps/linux-gnu/ppc/arch.h 2006-06-14 06:55:21.000000000 +0200
-+++ ltrace-0.5/sysdeps/linux-gnu/ppc/arch.h 2008-11-04 19:25:50.000000000 +0100
-@@ -4,9 +4,12 @@
-
- #define LT_ELFCLASS ELFCLASS32
- #define LT_ELF_MACHINE EM_PPC
-+
- #ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing about target.
- #define LT_ELFCLASS2 ELFCLASS64
- #define LT_ELF_MACHINE2 EM_PPC64
-+#define ARCH_SUPPORTS_OPD
-+#endif
-
- #define PLT_REINITALISATION_BP "_start"
-
-@@ -16,6 +19,3 @@
- #if (PPC_NOP_LENGTH != BREAKPOINT_LENGTH)
- #error "Length of the breakpoint value not equal to the length of a nop instruction"
- #endif
--
--
--#endif
-diff -durN ltrace-0.5.orig/testsuite/ltrace.minor/Makefile.in ltrace-0.5/testsuite/ltrace.minor/Makefile.in
---- ltrace-0.5.orig/testsuite/ltrace.minor/Makefile.in 2006-03-14 00:12:01.000000000 +0100
-+++ ltrace-0.5/testsuite/ltrace.minor/Makefile.in 2008-11-04 19:25:50.000000000 +0100
-@@ -19,7 +19,7 @@
-
- .SUFFIXES:
- clean:
-- -rm -f demangle trace-fork trace-clone
-+ -rm -f demangle trace-fork trace-clone trace-exec trace-exec1
- -rm -f time-record-tt time-record-ttt time-record-T
- -rm -f attach-process count-record
- -rm -f print-instruction-pointer
-diff -durN ltrace-0.5.orig/testsuite/ltrace.minor/trace-clone.c ltrace-0.5/testsuite/ltrace.minor/trace-clone.c
---- ltrace-0.5.orig/testsuite/ltrace.minor/trace-clone.c 2006-03-16 01:38:47.000000000 +0100
-+++ ltrace-0.5/testsuite/ltrace.minor/trace-clone.c 2008-11-04 19:25:50.000000000 +0100
-@@ -21,11 +21,11 @@
- int main ()
- {
- pid_t pid;
-- static char stack[STACK_SIZE];
-+ char stack[STACK_SIZE];
- #ifdef __ia64__
- pid = __clone2((myfunc)&child, stack, STACK_SIZE, CLONE_FS, NULL);
- #else
-- pid = clone((myfunc)&child, stack,CLONE_FS, NULL );
-+ pid = clone((myfunc)&child, stack + STACK_SIZE,CLONE_FS, NULL );
- #endif
- if (pid < 0)
- {
-diff -durN ltrace-0.5.orig/wait_for_something.c ltrace-0.5/wait_for_something.c
---- ltrace-0.5.orig/wait_for_something.c 2006-02-20 22:48:07.000000000 +0100
-+++ ltrace-0.5/wait_for_something.c 2008-11-04 19:25:50.000000000 +0100
-@@ -71,6 +71,18 @@
- event.thing = LT_EV_SYSRET;
- event.e_un.sysnum = tmp;
- return &event;
-+ case 3:
-+ event.thing = LT_EV_ARCH_SYSCALL;
-+ event.e_un.sysnum = tmp;
-+ return &event;
-+ case 4:
-+ event.thing = LT_EV_ARCH_SYSRET;
-+ event.e_un.sysnum = tmp;
-+ return &event;
-+ case -1:
-+ event.thing = LT_EV_NONE;
-+ continue_process(event.proc->pid);
-+ return &event;
- }
- if (WIFEXITED(status)) {
- event.thing = LT_EV_EXIT;
diff --git a/patches/mpfr/2.3.1/100-thread-safe-configure.patch b/patches/mpfr/2.3.1/100-thread-safe-configure.patch
deleted file mode 100644
index 7c16c1b..0000000
--- a/patches/mpfr/2.3.1/100-thread-safe-configure.patch
+++ /dev/null
@@ -1,209 +0,0 @@
-diff -Naurd mpfr-2.3.1-a/acinclude.m4 mpfr-2.3.1-b/acinclude.m4
---- mpfr-2.3.1-a/acinclude.m4 2008-01-23 13:36:46.000000000 +0000
-+++ mpfr-2.3.1-b/acinclude.m4 2008-01-23 13:36:46.000000000 +0000
-@@ -286,6 +286,9 @@
- dnl important to run the test below.
- if test "$enable_thread_safe" = yes; then
- AC_CACHE_CHECK([for TLS support], mpfr_cv_working_tls, [
-+saved_CPPFLAGS="$CPPFLAGS"
-+# The -I$srcdir is necessary when objdir is different from srcdir.
-+CPPFLAGS="$CPPFLAGS -I$srcdir"
- AC_RUN_IFELSE([
- #define MPFR_USE_THREAD_SAFE 1
- #include "mpfr-thread.h"
-@@ -297,6 +300,7 @@
- [AC_MSG_RESULT(no)
- AC_MSG_ERROR([please configure with --disable-thread-safe])],
- [mpfr_cv_working_tls="cannot test, assume yes"])
-+CPPFLAGS="$saved_CPPFLAGS"
- ])
- fi
- ])
-diff -Naurd mpfr-2.3.1-a/configure mpfr-2.3.1-b/configure
---- mpfr-2.3.1-a/configure 2008-01-29 08:51:07.000000000 +0000
-+++ mpfr-2.3.1-b/configure 2008-05-10 23:49:37.000000000 +0000
-@@ -7528,6 +7528,9 @@
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-
-+saved_CPPFLAGS="$CPPFLAGS"
-+# The -I$srcdir is necessary when objdir is different from srcdir.
-+CPPFLAGS="$CPPFLAGS -I$srcdir"
- if test "$cross_compiling" = yes; then
- mpfr_cv_working_tls="cannot test, assume yes"
- else
-@@ -7578,6 +7581,7 @@
- fi
-
-
-+CPPFLAGS="$saved_CPPFLAGS"
-
- fi
- { echo "$as_me:$LINENO: result: $mpfr_cv_working_tls" >&5
-@@ -9278,7 +9282,7 @@
- ;;
- *-*-irix6*)
- # Find out which ABI we are using.
-- echo '#line 9281 "configure"' > conftest.$ac_ext
-+ echo '#line 9285 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
-@@ -11103,11 +11107,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:11106: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:11110: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
-- echo "$as_me:11110: \$? = $ac_status" >&5
-+ echo "$as_me:11114: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
-@@ -11393,11 +11397,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:11396: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:11400: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
-- echo "$as_me:11400: \$? = $ac_status" >&5
-+ echo "$as_me:11404: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
-@@ -11497,11 +11501,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:11500: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:11504: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
-- echo "$as_me:11504: \$? = $ac_status" >&5
-+ echo "$as_me:11508: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
-@@ -13859,7 +13863,7 @@
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
--#line 13862 "configure"
-+#line 13866 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
-@@ -13959,7 +13963,7 @@
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
--#line 13962 "configure"
-+#line 13966 "configure"
- #include "confdefs.h"
-
- #if HAVE_DLFCN_H
-@@ -16379,11 +16383,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:16382: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:16386: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
-- echo "$as_me:16386: \$? = $ac_status" >&5
-+ echo "$as_me:16390: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
-@@ -16483,11 +16487,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:16486: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:16490: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
-- echo "$as_me:16490: \$? = $ac_status" >&5
-+ echo "$as_me:16494: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
-@@ -18060,11 +18064,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:18063: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:18067: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
-- echo "$as_me:18067: \$? = $ac_status" >&5
-+ echo "$as_me:18071: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
-@@ -18164,11 +18168,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:18167: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:18171: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
-- echo "$as_me:18171: \$? = $ac_status" >&5
-+ echo "$as_me:18175: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
-@@ -20364,11 +20368,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:20367: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:20371: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
-- echo "$as_me:20371: \$? = $ac_status" >&5
-+ echo "$as_me:20375: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
-@@ -20654,11 +20658,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:20657: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:20661: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
-- echo "$as_me:20661: \$? = $ac_status" >&5
-+ echo "$as_me:20665: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
-@@ -20758,11 +20762,11 @@
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
-- (eval echo "\"\$as_me:20761: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:20765: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
-- echo "$as_me:20765: \$? = $ac_status" >&5
-+ echo "$as_me:20769: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
diff --git a/patches/mpfr/2.4.2/120-gmp5.patch b/patches/mpfr/2.4.2/120-gmp5.patch
new file mode 100644
index 0000000..3ce4952
--- /dev/null
+++ b/patches/mpfr/2.4.2/120-gmp5.patch
@@ -0,0 +1,75 @@
+diff -Naurd mpfr-2.4.2-a/PATCHES mpfr-2.4.2-b/PATCHES
+--- mpfr-2.4.2-a/PATCHES 2010-01-11 15:27:18.000000000 +0000
++++ mpfr-2.4.2-b/PATCHES 2010-01-11 15:30:31.000000000 +0000
+@@ -0,0 +1 @@
++gmp5
+diff -Naurd mpfr-2.4.2-a/VERSION mpfr-2.4.2-b/VERSION
+--- mpfr-2.4.2-a/VERSION 2009-12-18 12:05:09.000000000 +0000
++++ mpfr-2.4.2-b/VERSION 2010-01-11 15:29:40.000000000 +0000
+@@ -1 +1 @@
+-2.4.2-p2
++2.4.2-p3
+diff -Naurd mpfr-2.4.2-a/configure mpfr-2.4.2-b/configure
+--- mpfr-2.4.2-a/configure 2009-11-30 02:44:35.000000000 +0000
++++ mpfr-2.4.2-b/configure 2010-01-11 15:28:56.000000000 +0000
+@@ -20449,6 +20449,9 @@
+ main ()
+ {
+
++#ifndef BITS_PER_MP_LIMB
++#define BITS_PER_MP_LIMB GMP_LIMB_BITS
++#endif
+ return BITS_PER_MP_LIMB == BYTES_PER_MP_LIMB * CHAR_BIT
+ && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1;
+
+diff -Naurd mpfr-2.4.2-a/configure.in mpfr-2.4.2-b/configure.in
+--- mpfr-2.4.2-a/configure.in 2009-11-30 02:43:08.000000000 +0000
++++ mpfr-2.4.2-b/configure.in 2009-11-30 02:43:08.000000000 +0000
+@@ -424,6 +424,9 @@
+ #include "gmp.h"
+ #include "gmp-impl.h"
+ ]], [[
++#ifndef BITS_PER_MP_LIMB
++#define BITS_PER_MP_LIMB GMP_LIMB_BITS
++#endif
+ return BITS_PER_MP_LIMB == BYTES_PER_MP_LIMB * CHAR_BIT
+ && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1;
+ ]])], [AC_MSG_RESULT(yes)], [
+diff -Naurd mpfr-2.4.2-a/mpfr-impl.h mpfr-2.4.2-b/mpfr-impl.h
+--- mpfr-2.4.2-a/mpfr-impl.h 2009-11-30 02:43:08.000000000 +0000
++++ mpfr-2.4.2-b/mpfr-impl.h 2010-01-11 15:28:01.000000000 +0000
+@@ -65,6 +65,12 @@
+ # ifndef __GMP_IMPL_H__
+ # include "gmp-impl.h"
+ # endif
++# ifndef BITS_PER_MP_LIMB
++# define BITS_PER_MP_LIMB GMP_LIMB_BITS
++# endif
++#ifndef mpn_sqr_n
++# define mpn_sqr_n mpn_sqr
++#endif
+ # ifdef MPFR_NEED_LONGLONG_H
+ # include "longlong.h"
+ # endif
+diff -Naurd mpfr-2.4.2-a/mpfr.h mpfr-2.4.2-b/mpfr.h
+--- mpfr-2.4.2-a/mpfr.h 2009-12-18 12:05:09.000000000 +0000
++++ mpfr-2.4.2-b/mpfr.h 2010-01-11 15:29:40.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 2
+ #define MPFR_VERSION_MINOR 4
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "2.4.2-p2"
++#define MPFR_VERSION_STRING "2.4.2-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-2.4.2-a/version.c mpfr-2.4.2-b/version.c
+--- mpfr-2.4.2-a/version.c 2009-12-18 12:05:09.000000000 +0000
++++ mpfr-2.4.2-b/version.c 2010-01-11 15:29:40.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "2.4.2-p2";
++ return "2.4.2-p3";
+ }
diff --git a/patches/mpfr/3.0.0/110-mpfr_out_str.patch b/patches/mpfr/3.0.0/110-mpfr_out_str.patch
new file mode 100644
index 0000000..da98aab
--- /dev/null
+++ b/patches/mpfr/3.0.0/110-mpfr_out_str.patch
@@ -0,0 +1,220 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-06-23 11:02:49.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-06-23 11:03:36.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_out_str
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-06-23 11:03:20.000000000 +0000
+@@ -1 +1 @@
+-3.0.0
++3.0.0-p1
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-06-23 11:03:20.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0"
++#define MPFR_VERSION_STRING "3.0.0-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/mpfr.texi mpfr-3.0.0-b/mpfr.texi
+--- mpfr-3.0.0-a/mpfr.texi 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.texi 2010-06-23 11:03:12.000000000 +0000
+@@ -2050,7 +2050,7 @@
+ are printed. If @var{base} is greater than 10, @samp{@@} will be used
+ instead of @samp{e} as exponent delimiter.
+
+-Return the number of bytes written, or if an error occurred, return 0.
++Return the number of characters written, or if an error occurred, return 0.
+ @end deftypefun
+
+ @deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mpfr_rnd_t @var{rnd})
+diff -Naurd mpfr-3.0.0-a/out_str.c mpfr-3.0.0-b/out_str.c
+--- mpfr-3.0.0-a/out_str.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/out_str.c 2010-06-23 11:03:12.000000000 +0000
+@@ -22,6 +22,16 @@
+
+ #include "mpfr-impl.h"
+
++/* Warning! S should not contain "%". */
++#define OUT_STR_RET(S) \
++ do \
++ { \
++ int r; \
++ r = fprintf (stream, (S)); \
++ return r < 0 ? 0 : r; \
++ } \
++ while (0)
++
+ size_t
+ mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
+ mpfr_rnd_t rnd_mode)
+@@ -29,6 +39,7 @@
+ char *s, *s0;
+ size_t l;
+ mpfr_exp_t e;
++ int err;
+
+ MPFR_ASSERTN (base >= 2 && base <= 62);
+
+@@ -36,37 +47,16 @@
+ if (stream == NULL)
+ stream = stdout;
+
+- if (MPFR_IS_NAN(op))
+- {
+- fprintf (stream, "@NaN@");
+- return 3;
+- }
+-
+- if (MPFR_IS_INF(op))
+- {
+- if (MPFR_SIGN(op) > 0)
+- {
+- fprintf (stream, "@Inf@");
+- return 3;
+- }
+- else
+- {
+- fprintf (stream, "-@Inf@");
+- return 4;
+- }
+- }
+-
+- if (MPFR_IS_ZERO(op))
++ if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (op)))
+ {
+- if (MPFR_SIGN(op) > 0)
+- {
+- fprintf(stream, "0");
+- return 1;
+- }
++ if (MPFR_IS_NAN (op))
++ OUT_STR_RET ("@NaN@");
++ else if (MPFR_IS_INF (op))
++ OUT_STR_RET (MPFR_IS_POS (op) ? "@Inf@" : "-@Inf@");
+ else
+ {
+- fprintf(stream, "-0");
+- return 2;
++ MPFR_ASSERTD (MPFR_IS_ZERO (op));
++ OUT_STR_RET (MPFR_IS_POS (op) ? "0" : "-0");
+ }
+ }
+
+@@ -77,21 +67,31 @@
+
+ l = strlen (s) + 1; /* size of allocated block returned by mpfr_get_str
+ - may be incorrect, as only an upper bound? */
+- if (*s == '-')
+- fputc (*s++, stream);
+
+- /* outputs mantissa */
+- fputc (*s++, stream); e--; /* leading digit */
+- fputc ((unsigned char) MPFR_DECIMAL_POINT, stream);
+- fputs (s, stream); /* rest of mantissa */
++ /* outputs possible sign and significand */
++ err = (*s == '-' && fputc (*s++, stream) == EOF)
++ || fputc (*s++, stream) == EOF /* leading digit */
++ || fputc ((unsigned char) MPFR_DECIMAL_POINT, stream) == EOF
++ || fputs (s, stream) == EOF; /* trailing significand */
+ (*__gmp_free_func) (s0, l);
++ if (MPFR_UNLIKELY (err))
++ return 0;
++
++ e--; /* due to the leading digit */
+
+ /* outputs exponent */
+ if (e)
+ {
++ int r;
++
+ MPFR_ASSERTN(e >= LONG_MIN);
+ MPFR_ASSERTN(e <= LONG_MAX);
+- l += fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
++
++ r = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
++ if (MPFR_UNLIKELY (r < 0))
++ return 0;
++
++ l += r;
+ }
+
+ return l;
+diff -Naurd mpfr-3.0.0-a/tests/tout_str.c mpfr-3.0.0-b/tests/tout_str.c
+--- mpfr-3.0.0-a/tests/tout_str.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tout_str.c 2010-06-23 11:03:12.000000000 +0000
+@@ -46,22 +46,54 @@
+ special (void)
+ {
+ mpfr_t x;
++ unsigned int n;
+
+ mpfr_init (x);
+
+ mpfr_set_nan (x);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 5)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, NaN, MPFR_RNDN) wrote %u "
++ "characters instead of 5.\n", n);
++ exit (1);
++ }
+
+ mpfr_set_inf (x, 1);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 5)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, +Inf, MPFR_RNDN) wrote %u "
++ "characters instead of 5.\n", n);
++ exit (1);
++ }
+
+ mpfr_set_inf (x, -1);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 6)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, -Inf, MPFR_RNDN) wrote %u "
++ "characters instead of 6.\n", n);
++ exit (1);
++ }
+
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 1)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, +0, MPFR_RNDN) wrote %u "
++ "characters instead of 1.\n", n);
++ exit (1);
++ }
++
+ mpfr_neg (x, x, MPFR_RNDN);
+- mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
++ if (n != 2)
++ {
++ printf ("Error: mpfr_out_str (file, 10, 0, -0, MPFR_RNDN) wrote %u "
++ "characters instead of 2.\n", n);
++ exit (1);
++ }
+
+ mpfr_clear (x);
+ }
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-06-23 11:03:20.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0";
++ return "3.0.0-p1";
+ }
diff --git a/patches/mpfr/3.0.0/120-alloca.patch b/patches/mpfr/3.0.0/120-alloca.patch
new file mode 100644
index 0000000..af6dfb2
--- /dev/null
+++ b/patches/mpfr/3.0.0/120-alloca.patch
@@ -0,0 +1,377 @@
+diff -Naurd mpfr-3.0.0-a/Makefile.in mpfr-3.0.0-b/Makefile.in
+--- mpfr-3.0.0-a/Makefile.in 2010-06-10 11:00:52.000000000 +0000
++++ mpfr-3.0.0-b/Makefile.in 2010-06-10 11:00:52.000000000 +0000
+@@ -239,6 +239,7 @@
+ distuninstallcheck_listfiles = find . -type f -print
+ distcleancheck_listfiles = find . -type f -print
+ ACLOCAL = @ACLOCAL@
++ALLOCA = @ALLOCA@
+ AMTAR = @AMTAR@
+ AR = @AR@
+ AS = @AS@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-06-23 11:03:36.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-06-25 13:23:13.000000000 +0000
+@@ -0,0 +1 @@
++alloca
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-06-23 11:03:20.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-06-25 13:23:13.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p1
++3.0.0-p2
+diff -Naurd mpfr-3.0.0-a/acinclude.m4 mpfr-3.0.0-b/acinclude.m4
+--- mpfr-3.0.0-a/acinclude.m4 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/acinclude.m4 2010-06-10 11:00:14.000000000 +0000
+@@ -59,6 +59,9 @@
+ dnl sys/fpu.h - MIPS specific
+ AC_CHECK_HEADERS([sys/time.h sys/fpu.h])
+
++dnl Check how to get `alloca'
++AC_FUNC_ALLOCA
++
+ dnl SIZE_MAX macro
+ gl_SIZE_MAX
+
+diff -Naurd mpfr-3.0.0-a/configure mpfr-3.0.0-b/configure
+--- mpfr-3.0.0-a/configure 2010-06-10 11:00:51.000000000 +0000
++++ mpfr-3.0.0-b/configure 2010-06-25 13:23:05.000000000 +0000
+@@ -783,6 +783,7 @@
+ OBJDUMP
+ DLLTOOL
+ AS
++ALLOCA
+ MPFR_LIBM
+ ANSI2KNR
+ U
+@@ -5622,6 +5623,197 @@
+ done
+
+
++# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
++# for constant arguments. Useless!
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
++$as_echo_n "checking for working alloca.h... " >&6; }
++if test "${ac_cv_working_alloca_h+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <alloca.h>
++int
++main ()
++{
++char *p = (char *) alloca (2 * sizeof (int));
++ if (p) return 0;
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_working_alloca_h=yes
++else
++ ac_cv_working_alloca_h=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
++$as_echo "$ac_cv_working_alloca_h" >&6; }
++if test $ac_cv_working_alloca_h = yes; then
++
++$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
++
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
++$as_echo_n "checking for alloca... " >&6; }
++if test "${ac_cv_func_alloca_works+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#ifdef __GNUC__
++# define alloca __builtin_alloca
++#else
++# ifdef _MSC_VER
++# include <malloc.h>
++# define alloca _alloca
++# else
++# ifdef HAVE_ALLOCA_H
++# include <alloca.h>
++# else
++# ifdef _AIX
++ #pragma alloca
++# else
++# ifndef alloca /* predefined by HP cc +Olibcalls */
++char *alloca ();
++# endif
++# endif
++# endif
++# endif
++#endif
++
++int
++main ()
++{
++char *p = (char *) alloca (1);
++ if (p) return 0;
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_func_alloca_works=yes
++else
++ ac_cv_func_alloca_works=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
++$as_echo "$ac_cv_func_alloca_works" >&6; }
++
++if test $ac_cv_func_alloca_works = yes; then
++
++$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
++
++else
++ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
++# that cause trouble. Some versions do not even contain alloca or
++# contain a buggy version. If you still want to use their alloca,
++# use ar to extract alloca.o from them instead of compiling alloca.c.
++
++ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
++
++$as_echo "#define C_ALLOCA 1" >>confdefs.h
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
++$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
++if test "${ac_cv_os_cray+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#if defined CRAY && ! defined CRAY2
++webecray
++#else
++wenotbecray
++#endif
++
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++ $EGREP "webecray" >/dev/null 2>&1; then :
++ ac_cv_os_cray=yes
++else
++ ac_cv_os_cray=no
++fi
++rm -f conftest*
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
++$as_echo "$ac_cv_os_cray" >&6; }
++if test $ac_cv_os_cray = yes; then
++ for ac_func in _getb67 GETB67 getb67; do
++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
++eval as_val=\$$as_ac_var
++ if test "x$as_val" = x""yes; then :
++
++cat >>confdefs.h <<_ACEOF
++#define CRAY_STACKSEG_END $ac_func
++_ACEOF
++
++ break
++fi
++
++ done
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
++$as_echo_n "checking stack direction for C alloca... " >&6; }
++if test "${ac_cv_c_stack_direction+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test "$cross_compiling" = yes; then :
++ ac_cv_c_stack_direction=0
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++$ac_includes_default
++int
++find_stack_direction ()
++{
++ static char *addr = 0;
++ auto char dummy;
++ if (addr == 0)
++ {
++ addr = &dummy;
++ return find_stack_direction ();
++ }
++ else
++ return (&dummy > addr) ? 1 : -1;
++}
++
++int
++main ()
++{
++ return find_stack_direction () < 0;
++}
++_ACEOF
++if ac_fn_c_try_run "$LINENO"; then :
++ ac_cv_c_stack_direction=1
++else
++ ac_cv_c_stack_direction=-1
++fi
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++ conftest.$ac_objext conftest.beam conftest.$ac_ext
++fi
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
++$as_echo "$ac_cv_c_stack_direction" >&6; }
++cat >>confdefs.h <<_ACEOF
++#define STACK_DIRECTION $ac_cv_c_stack_direction
++_ACEOF
++
++
++fi
++
++
+
+ for ac_header in stdint.h
+ do :
+@@ -7564,13 +7756,13 @@
+ else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+- (eval echo "\"\$as_me:7567: $ac_compile\"" >&5)
++ (eval echo "\"\$as_me:7759: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+- (eval echo "\"\$as_me:7570: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
++ (eval echo "\"\$as_me:7762: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+- (eval echo "\"\$as_me:7573: output\"" >&5)
++ (eval echo "\"\$as_me:7765: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+@@ -8772,7 +8964,7 @@
+ ;;
+ *-*-irix6*)
+ # Find out which ABI we are using.
+- echo '#line 8775 "configure"' > conftest.$ac_ext
++ echo '#line 8967 "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+@@ -10032,11 +10224,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10035: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10227: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:10039: \$? = $ac_status" >&5
++ echo "$as_me:10231: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -10371,11 +10563,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10374: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10566: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:10378: \$? = $ac_status" >&5
++ echo "$as_me:10570: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -10476,11 +10668,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10479: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10671: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:10483: \$? = $ac_status" >&5
++ echo "$as_me:10675: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -10531,11 +10723,11 @@
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:10534: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:10726: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:10538: \$? = $ac_status" >&5
++ echo "$as_me:10730: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -12915,7 +13107,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12918 "configure"
++#line 13110 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -13011,7 +13203,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 13014 "configure"
++#line 13206 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-06-23 11:03:20.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-06-25 13:23:13.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p1"
++#define MPFR_VERSION_STRING "3.0.0-p2"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/tests/Makefile.in mpfr-3.0.0-b/tests/Makefile.in
+--- mpfr-3.0.0-a/tests/Makefile.in 2010-06-10 11:00:52.000000000 +0000
++++ mpfr-3.0.0-b/tests/Makefile.in 2010-06-10 11:00:52.000000000 +0000
+@@ -960,6 +960,7 @@
+ red=; grn=; lgn=; blu=; std=
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ ACLOCAL = @ACLOCAL@
++ALLOCA = @ALLOCA@
+ AMTAR = @AMTAR@
+ AR = @AR@
+ AS = @AS@
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-06-23 11:03:20.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-06-25 13:23:13.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p1";
++ return "3.0.0-p2";
+ }
diff --git a/patches/mpfr/3.0.0/130-gamma_underflow.patch b/patches/mpfr/3.0.0/130-gamma_underflow.patch
new file mode 100644
index 0000000..cf8a936
--- /dev/null
+++ b/patches/mpfr/3.0.0/130-gamma_underflow.patch
@@ -0,0 +1,88 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-07-10 00:11:19.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-07-10 00:12:50.000000000 +0000
+@@ -0,0 +1 @@
++gamma_underflow
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-06-25 13:23:13.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-07-10 00:11:53.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p2
++3.0.0-p3
+diff -Naurd mpfr-3.0.0-a/gamma.c mpfr-3.0.0-b/gamma.c
+--- mpfr-3.0.0-a/gamma.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/gamma.c 2010-07-10 00:11:46.000000000 +0000
+@@ -274,7 +274,7 @@
+ /* we want an upper bound for x * [log(2-x)-1].
+ since x < 0, we need a lower bound on log(2-x) */
+ mpfr_ui_sub (xp, 2, x, MPFR_RNDD);
+- mpfr_log (xp, xp, MPFR_RNDD);
++ mpfr_log2 (xp, xp, MPFR_RNDD);
+ mpfr_sub_ui (xp, xp, 1, MPFR_RNDD);
+ mpfr_mul (xp, xp, x, MPFR_RNDU);
+
+@@ -303,8 +303,8 @@
+ {
+ mpfr_sub (tmp, tmp, tmp2, MPFR_RNDZ); /* low bnd on |sin(Pi*(2-x))| */
+ mpfr_ui_div (tmp, 12, tmp, MPFR_RNDU); /* upper bound */
+- mpfr_log (tmp, tmp, MPFR_RNDU);
+- mpfr_add (tmp, tmp, xp, MPFR_RNDU);
++ mpfr_log2 (tmp, tmp, MPFR_RNDU);
++ mpfr_add (xp, tmp, xp, MPFR_RNDU);
+ underflow = mpfr_cmp_si (xp, expo.saved_emin - 2) <= 0;
+ }
+
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-06-25 13:23:13.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-07-10 00:11:53.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p2"
++#define MPFR_VERSION_STRING "3.0.0-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/tests/tgamma.c mpfr-3.0.0-b/tests/tgamma.c
+--- mpfr-3.0.0-a/tests/tgamma.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tgamma.c 2010-07-10 00:11:46.000000000 +0000
+@@ -461,6 +461,20 @@
+ mpfr_clear (x);
+ }
+
++/* bug found by Stathis, only occurs on 32-bit machines */
++static void
++test20100709 (void)
++{
++ mpfr_t x;
++ int inex;
++
++ mpfr_init2 (x, 100);
++ mpfr_set_str (x, "-4.6308260837372266e+07", 10, MPFR_RNDN);
++ inex = mpfr_gamma (x, x, MPFR_RNDN);
++ MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
++ mpfr_clear (x);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -471,6 +485,7 @@
+ test_generic (2, 100, 2);
+ gamma_integer ();
+ test20071231 ();
++ test20100709 ();
+
+ data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
+
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-06-25 13:23:13.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-07-10 00:11:53.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p2";
++ return "3.0.0-p3";
+ }
diff --git a/patches/mpfr/3.0.0/140-mpfr_cmp_set_ui_si.patch b/patches/mpfr/3.0.0/140-mpfr_cmp_set_ui_si.patch
new file mode 100644
index 0000000..67d6a6a
--- /dev/null
+++ b/patches/mpfr/3.0.0/140-mpfr_cmp_set_ui_si.patch
@@ -0,0 +1,239 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-09-07 08:44:01.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-09-07 08:48:46.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_cmp/set_ui/si
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-07-10 00:11:53.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-09-07 08:46:06.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p3
++3.0.0-p4
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-07-10 00:11:53.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-09-07 08:46:06.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p3"
++#define MPFR_VERSION_STRING "3.0.0-p4"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+@@ -798,35 +798,45 @@
+ anyway. Checking with other ICC versions is needed. Possibly detect
+ whether warnings are produced or not with a configure test.
+ + Remove C++ too, since it complains too much. */
++/* Added casts to improve robustness in case of undefined behavior and
++ compiler extensions based on UB (in particular -fwrapv). MPFR doesn't
++ use such extensions, but these macros will be used by 3rd-party code,
++ where such extensions may be required.
++ Moreover casts to unsigned long have been added to avoid warnings in
++ programs that use MPFR and are compiled with -Wconversion; such casts
++ are OK since if X is a constant expression, then (unsigned long) X is
++ also a constant expression, so that the optimizations still work. */
+ #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
+ #if (__GNUC__ >= 2)
+ #undef mpfr_cmp_ui
+-/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
+-#define mpfr_cmp_ui(_f,_u) \
+- (__builtin_constant_p (_u) && (_u) == 0 ? \
+- mpfr_sgn (_f) : \
+- mpfr_cmp_ui_2exp ((_f),(_u),0))
++/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0.
++ But warning! mpfr_sgn is specified as a macro in the API, thus the macro
++ mustn't be used if side effects are possible, like here. */
++#define mpfr_cmp_ui(_f,_u) \
++ (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ (mpfr_sgn) (_f) : \
++ mpfr_cmp_ui_2exp ((_f), (unsigned long) (_u), 0))
+ #undef mpfr_cmp_si
+-#define mpfr_cmp_si(_f,_s) \
+- (__builtin_constant_p (_s) && (_s) >= 0 ? \
+- mpfr_cmp_ui ((_f), (_s)) : \
+- mpfr_cmp_si_2exp ((_f), (_s), 0))
++#define mpfr_cmp_si(_f,_s) \
++ (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
++ mpfr_cmp_ui ((_f), (unsigned long) (long) (_s)) : \
++ mpfr_cmp_si_2exp ((_f), (long) (_s), 0))
+ #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
+ #undef mpfr_set_ui
+-#define mpfr_set_ui(_f,_u,_r) \
+- (__builtin_constant_p (_u) && (_u) == 0 ? \
+- __extension__ ({ \
+- mpfr_ptr _p = (_f); \
+- _p->_mpfr_sign = 1; \
+- _p->_mpfr_exp = __MPFR_EXP_ZERO; \
+- (void) (_r); 0; }) : \
+- mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
++#define mpfr_set_ui(_f,_u,_r) \
++ (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ __extension__ ({ \
++ mpfr_ptr _p = (_f); \
++ _p->_mpfr_sign = 1; \
++ _p->_mpfr_exp = __MPFR_EXP_ZERO; \
++ (void) (_r); 0; }) : \
++ mpfr_set_ui_2exp ((_f), (unsigned long) (_u), 0, (_r)))
+ #endif
+ #undef mpfr_set_si
+-#define mpfr_set_si(_f,_s,_r) \
+- (__builtin_constant_p (_s) && (_s) >= 0 ? \
+- mpfr_set_ui ((_f), (_s), (_r)) : \
+- mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
++#define mpfr_set_si(_f,_s,_r) \
++ (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
++ mpfr_set_ui ((_f), (unsigned long) (long) (_s), (_r)) : \
++ mpfr_set_si_2exp ((_f), (long) (_s), 0, (_r)))
+ #endif
+ #endif
+
+diff -Naurd mpfr-3.0.0-a/tests/tcmp_ui.c mpfr-3.0.0-b/tests/tcmp_ui.c
+--- mpfr-3.0.0-a/tests/tcmp_ui.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tcmp_ui.c 2010-09-07 08:45:12.000000000 +0000
+@@ -88,6 +88,126 @@
+ mpfr_clear (x);
+ }
+
++/* Since mpfr_cmp_ui and mpfr_cmp_si are also implemented by a macro
++ with __builtin_constant_p for GCC, check that side effects are
++ handled correctly. */
++static void
++check_macros (void)
++{
++ mpfr_t x;
++ int c;
++
++ mpfr_init2 (x, 32);
++
++ c = 0;
++ mpfr_set_ui (x, 17, MPFR_RNDN);
++ if (mpfr_cmp_ui (x, 17) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_ui(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_ui (x, (c++, 17)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_ui(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (c != 1)
++ {
++ printf ("Error 3 on mpfr_cmp_ui(x,17) in check_macros\n"
++ "(c = %d instead of 1)\n", c);
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, 17) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_si(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, (c++, 17)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_si(x,17) in check_macros\n");
++ exit (1);
++ }
++ if (c != 2)
++ {
++ printf ("Error 3 on mpfr_cmp_si(x,17) in check_macros\n"
++ "(c = %d instead of 2)\n", c);
++ exit (1);
++ }
++
++ c = 0;
++ mpfr_set_ui (x, 0, MPFR_RNDN);
++ if (mpfr_cmp_ui (x, 0) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_ui(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_ui (x, (c++, 0)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_ui(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (c != 1)
++ {
++ printf ("Error 3 on mpfr_cmp_ui(x,0) in check_macros\n"
++ "(c = %d instead of 1)\n", c);
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, 0) != 0)
++ {
++ printf ("Error 1 on mpfr_cmp_si(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (mpfr_cmp_si (x, (c++, 0)) != 0)
++ {
++ printf ("Error 2 on mpfr_cmp_si(x,0) in check_macros\n");
++ exit (1);
++ }
++ if (c != 2)
++ {
++ printf ("Error 3 on mpfr_cmp_si(x,0) in check_macros\n"
++ "(c = %d instead of 2)\n", c);
++ exit (1);
++ }
++
++ mpfr_clear (x);
++}
++
++/* Bug in r7114 */
++static void
++test_macros (void)
++{
++ mpfr_t x[3];
++ mpfr_ptr p;
++
++ mpfr_inits (x[0], x[1], x[2], (mpfr_ptr) 0);
++ mpfr_set_ui (x[0], 0, MPFR_RNDN);
++ p = x[0];
++ if (mpfr_cmp_ui (p++, 0) != 0)
++ {
++ printf ("Error in mpfr_cmp_ui macro: result should be 0.\n");
++ exit (1);
++ }
++ if (p != x[1])
++ {
++ printf ("Error in mpfr_cmp_ui macro: p - x[0] = %d (expecting 1)\n",
++ (int) (p - x[0]));
++ exit (1);
++ }
++ p = x[0];
++ if (mpfr_cmp_si (p++, 0) != 0)
++ {
++ printf ("Error in mpfr_cmp_si macro: result should be 0.\n");
++ exit (1);
++ }
++ if (p != x[1])
++ {
++ printf ("Error in mpfr_cmp_si macro: p - x[0] = %d (expecting 1)\n",
++ (int) (p - x[0]));
++ exit (1);
++ }
++ mpfr_clears (x[0], x[1], x[2], (mpfr_ptr) 0);
++}
++
+ int
+ main (void)
+ {
+@@ -216,6 +336,8 @@
+ mpfr_clear (x);
+
+ check_nan ();
++ check_macros ();
++ test_macros ();
+
+ tests_end_mpfr ();
+ return 0;
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-07-10 00:11:53.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-09-07 08:46:06.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p3";
++ return "3.0.0-p4";
+ }
diff --git a/patches/mpfr/3.0.0/150-tcan_round.patch b/patches/mpfr/3.0.0/150-tcan_round.patch
new file mode 100644
index 0000000..292e7a5
--- /dev/null
+++ b/patches/mpfr/3.0.0/150-tcan_round.patch
@@ -0,0 +1,45 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-10-21 20:28:38.000000000 +0000
+@@ -0,0 +1 @@
++tcan_round
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-09-07 08:46:06.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-10-21 20:28:38.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p4
++3.0.0-p5
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-09-07 08:46:06.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-10-21 20:28:38.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p4"
++#define MPFR_VERSION_STRING "3.0.0-p5"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/tests/tcan_round.c mpfr-3.0.0-b/tests/tcan_round.c
+--- mpfr-3.0.0-a/tests/tcan_round.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tcan_round.c 2010-10-21 20:28:38.000000000 +0000
+@@ -41,7 +41,7 @@
+ /* avoid mpn_random which leaks memory */
+ for (i = 0; i < n; i++)
+ buf[i] = randlimb ();
+- p = (mpfr_prec_t) randlimb() % ((n-1) * GMP_NUMB_BITS) + MPFR_PREC_MIN;
++ p = randlimb() % ((n-1) * GMP_NUMB_BITS) + MPFR_PREC_MIN;
+ err = p + randlimb () % GMP_NUMB_BITS;
+ r1 = mpfr_round_p (buf, n, err, p);
+ r2 = mpfr_can_round_raw (buf, n, MPFR_SIGN_POS, err,
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-09-07 08:46:06.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-10-21 20:28:38.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p4";
++ return "3.0.0-p5";
+ }
diff --git a/patches/mpfr/3.0.0/160-mpfr_sub1.patch b/patches/mpfr/3.0.0/160-mpfr_sub1.patch
new file mode 100644
index 0000000..2ce98e9
--- /dev/null
+++ b/patches/mpfr/3.0.0/160-mpfr_sub1.patch
@@ -0,0 +1,628 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-10-21 20:59:32.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_sub1
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-10-21 20:59:32.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p5
++3.0.0-p6
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-10-21 20:59:32.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p5"
++#define MPFR_VERSION_STRING "3.0.0-p6"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/sub1.c mpfr-3.0.0-b/sub1.c
+--- mpfr-3.0.0-a/sub1.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/sub1.c 2010-10-21 20:59:32.000000000 +0000
+@@ -37,7 +37,9 @@
+ mp_size_t cancel2, an, bn, cn, cn0;
+ mp_limb_t *ap, *bp, *cp;
+ mp_limb_t carry, bb, cc, borrow = 0;
+- int inexact, shift_b, shift_c, is_exact = 1, down = 0, add_exp = 0;
++ int inexact, shift_b, shift_c, add_exp = 0;
++ int cmp_low = 0; /* used for rounding to nearest: 0 if low(b) = low(c),
++ negative if low(b) < low(c), positive if low(b)>low(c) */
+ int sh, k;
+ MPFR_TMP_DECL(marker);
+
+@@ -196,7 +198,8 @@
+ }
+
+ #ifdef DEBUG
+- printf ("shift_b=%d shift_c=%d diffexp=%lu\n", shift_b, shift_c,
++ printf ("rnd=%s shift_b=%d shift_c=%d diffexp=%lu\n",
++ mpfr_print_rnd_mode (rnd_mode), shift_b, shift_c,
+ (unsigned long) diff_exp);
+ #endif
+
+@@ -307,17 +310,18 @@
+ {
+ if (MPFR_LIKELY(sh))
+ {
+- is_exact = (carry == 0);
+ /* can decide except when carry = 2^(sh-1) [middle]
+ or carry = 0 [truncate, but cannot decide inexact flag] */
+- down = (carry < (MPFR_LIMB_ONE << (sh - 1)));
+ if (carry > (MPFR_LIMB_ONE << (sh - 1)))
+ goto add_one_ulp;
+- else if ((0 < carry) && down)
++ else if ((0 < carry) && (carry < (MPFR_LIMB_ONE << (sh - 1))))
+ {
+ inexact = -1; /* result if smaller than exact value */
+ goto truncate;
+ }
++ /* now carry = 2^(sh-1), in which case cmp_low=2,
++ or carry = 0, in which case cmp_low=0 */
++ cmp_low = (carry == 0) ? 0 : 2;
+ }
+ }
+ else /* directed rounding: set rnd_mode to RNDZ iff toward zero */
+@@ -344,12 +348,32 @@
+ cn -= (long int) an + cancel2;
+
+ #ifdef DEBUG
+- printf ("last %d bits from a are %lu, bn=%ld, cn=%ld\n",
++ printf ("last sh=%d bits from a are %lu, bn=%ld, cn=%ld\n",
+ sh, (unsigned long) carry, (long) bn, (long) cn);
+ #endif
+
++ /* for rounding to nearest, we couldn't conclude up to here in the following
++ cases:
++ 1. sh = 0, then cmp_low=0: we can either truncate, subtract one ulp
++ or add one ulp: -1 ulp < low(b)-low(c) < 1 ulp
++ 2. sh > 0 but the low sh bits from high(b)-high(c) equal 2^(sh-1):
++ -0.5 ulp <= -1/2^sh < low(b)-low(c)-0.5 < 1/2^sh <= 0.5 ulp
++ we can't decide the rounding, in that case cmp_low=2:
++ either we truncate and flag=-1, or we add one ulp and flag=1
++ 3. the low sh>0 bits from high(b)-high(c) equal 0: we know we have to
++ truncate but we can't decide the ternary value, here cmp_low=0:
++ -0.5 ulp <= -1/2^sh < low(b)-low(c) < 1/2^sh <= 0.5 ulp
++ we always truncate and inexact can be any of -1,0,1
++ */
++
++ /* note: here cn might exceed cn0, in which case we consider a zero limb */
+ for (k = 0; (bn > 0) || (cn > 0); k = 1)
+ {
++ /* if cmp_low < 0, we know low(b) - low(c) < 0
++ if cmp_low > 0, we know low(b) - low(c) > 0
++ (more precisely if cmp_low = 2, low(b) - low(c) = 0.5 ulp so far)
++ if cmp_low = 0, so far low(b) - low(c) = 0 */
++
+ /* get next limbs */
+ bb = (bn > 0) ? bp[--bn] : 0;
+ if ((cn > 0) && (cn-- <= cn0))
+@@ -357,76 +381,115 @@
+ else
+ cc = 0;
+
+- /* down is set when low(b) < low(c) */
+- if (down == 0)
+- down = (bb < cc);
++ /* cmp_low compares low(b) and low(c) */
++ if (cmp_low == 0) /* case 1 or 3 */
++ cmp_low = (bb < cc) ? -2+k : (bb > cc) ? 1 : 0;
++
++ /* Case 1 for k=0 splits into 7 subcases:
++ 1a: bb > cc + half
++ 1b: bb = cc + half
++ 1c: 0 < bb - cc < half
++ 1d: bb = cc
++ 1e: -half < bb - cc < 0
++ 1f: bb - cc = -half
++ 1g: bb - cc < -half
++
++ Case 2 splits into 3 subcases:
++ 2a: bb > cc
++ 2b: bb = cc
++ 2c: bb < cc
++
++ Case 3 splits into 3 subcases:
++ 3a: bb > cc
++ 3b: bb = cc
++ 3c: bb < cc
++ */
+
+ /* the case rounding to nearest with sh=0 is special since one couldn't
+ subtract above 1/2 ulp in the trailing limb of the result */
+- if ((rnd_mode == MPFR_RNDN) && sh == 0 && k == 0)
++ if (rnd_mode == MPFR_RNDN && sh == 0 && k == 0) /* case 1 for k=0 */
+ {
+ mp_limb_t half = MPFR_LIMB_HIGHBIT;
+
+- is_exact = (bb == cc);
+-
+ /* add one ulp if bb > cc + half
+ truncate if cc - half < bb < cc + half
+ sub one ulp if bb < cc - half
+ */
+
+- if (down)
++ if (cmp_low < 0) /* bb < cc: -1 ulp < low(b) - low(c) < 0,
++ cases 1e, 1f and 1g */
+ {
+ if (cc >= half)
+ cc -= half;
+- else
++ else /* since bb < cc < half, bb+half < 2*half */
+ bb += half;
++ /* now we have bb < cc + half:
++ we have to subtract one ulp if bb < cc,
++ and truncate if bb > cc */
+ }
+- else /* bb >= cc */
++ else if (cmp_low >= 0) /* bb >= cc, cases 1a to 1d */
+ {
+ if (cc < half)
+ cc += half;
+- else
++ else /* since bb >= cc >= half, bb - half >= 0 */
+ bb -= half;
++ /* now we have bb > cc - half: we have to add one ulp if bb > cc,
++ and truncate if bb < cc */
++ if (cmp_low > 0)
++ cmp_low = 2;
+ }
+ }
+
+ #ifdef DEBUG
+- printf (" bb=%lu cc=%lu down=%d is_exact=%d\n",
+- (unsigned long) bb, (unsigned long) cc, down, is_exact);
++ printf ("k=%u bb=%lu cc=%lu cmp_low=%d\n", k,
++ (unsigned long) bb, (unsigned long) cc, cmp_low);
+ #endif
+- if (bb < cc)
++ if (cmp_low < 0) /* low(b) - low(c) < 0: either truncate or subtract
++ one ulp */
+ {
+ if (rnd_mode == MPFR_RNDZ)
+- goto sub_one_ulp;
++ goto sub_one_ulp; /* set inexact=-1 */
+ else if (rnd_mode != MPFR_RNDN) /* round away */
+ {
+ inexact = 1;
+ goto truncate;
+ }
+- else /* round to nearest: special case here since for sh=k=0
+- bb = bb0 - MPFR_LIMB_HIGHBIT */
++ else /* round to nearest */
+ {
+- if (is_exact && sh == 0)
+- {
+- /* For k=0 we can't decide exactness since it may depend
+- from low order bits.
+- For k=1, the first low limbs matched: low(b)-low(c)<0. */
+- if (k)
+- {
+- inexact = 1;
+- goto truncate;
+- }
+- }
+- else if (down && sh == 0)
+- goto sub_one_ulp;
+- else
+- {
+- inexact = (is_exact) ? 1 : -1;
++ /* If cmp_low < 0 and bb > cc, then -0.5 ulp < low(b)-low(c) < 0,
++ whatever the value of sh.
++ If sh>0, then cmp_low < 0 implies that the initial neglected
++ sh bits were 0 (otherwise cmp_low=2 initially), thus the
++ weight of the new bits is less than 0.5 ulp too.
++ If k > 0 (and sh=0) this means that either the first neglected
++ limbs bb and cc were equal (thus cmp_low was 0 for k=0),
++ or we had bb - cc = -0.5 ulp or 0.5 ulp.
++ The last case is not possible here since we would have
++ cmp_low > 0 which is sticky.
++ In the first case (where we have cmp_low = -1), we truncate,
++ whereas in the 2nd case we have cmp_low = -2 and we subtract
++ one ulp.
++ */
++ if (bb > cc || sh > 0 || cmp_low == -1)
++ { /* -0.5 ulp < low(b)-low(c) < 0,
++ bb > cc corresponds to cases 1e and 1f1
++ sh > 0 corresponds to cases 3c and 3b3
++ cmp_low = -1 corresponds to case 1d3 (also 3b3) */
++ inexact = 1;
+ goto truncate;
+ }
++ else if (bb < cc) /* here sh = 0 and low(b)-low(c) < -0.5 ulp,
++ this corresponds to cases 1g and 1f3 */
++ goto sub_one_ulp;
++ /* the only case where we can't conclude is sh=0 and bb=cc,
++ i.e., we have low(b) - low(c) = -0.5 ulp (up to now), thus
++ we don't know if we must truncate or subtract one ulp.
++ Note: for sh=0 we can't have low(b) - low(c) = -0.5 ulp up to
++ now, since low(b) - low(c) > 1/2^sh */
+ }
+ }
+- else if (bb > cc)
++ else if (cmp_low > 0) /* 0 < low(b) - low(c): either truncate or
++ add one ulp */
+ {
+ if (rnd_mode == MPFR_RNDZ)
+ {
+@@ -437,34 +500,70 @@
+ goto add_one_ulp;
+ else /* round to nearest */
+ {
+- if (is_exact)
++ if (bb > cc)
+ {
+- inexact = -1;
+- goto truncate;
++ /* if sh=0, then bb>cc means that low(b)-low(c) > 0.5 ulp,
++ and similarly when cmp_low=2 */
++ if (cmp_low == 2) /* cases 1a, 1b1, 2a and 2b1 */
++ goto add_one_ulp;
++ /* sh > 0 and cmp_low > 0: this implies that the sh initial
++ neglected bits were 0, and the remaining low(b)-low(c)>0,
++ but its weight is less than 0.5 ulp */
++ else /* 0 < low(b) - low(c) < 0.5 ulp, this corresponds to
++ cases 3a, 1d1 and 3b1 */
++ {
++ inexact = -1;
++ goto truncate;
++ }
+ }
+- else if (down)
++ else if (bb < cc) /* 0 < low(b) - low(c) < 0.5 ulp, cases 1c,
++ 1b3, 2b3 and 2c */
+ {
+- inexact = 1;
++ inexact = -1;
+ goto truncate;
+ }
+- else
+- goto add_one_ulp;
++ /* the only case where we can't conclude is bb=cc, i.e.,
++ low(b) - low(c) = 0.5 ulp (up to now), thus we don't know
++ if we must truncate or add one ulp. */
+ }
+ }
++ /* after k=0, we cannot conclude in the following cases, we split them
++ according to the values of bb and cc for k=1:
++ 1b. sh=0 and cmp_low = 1 and bb-cc = half [around 0.5 ulp]
++ 1b1. bb > cc: add one ulp, inex = 1
++ 1b2: bb = cc: cannot conclude
++ 1b3: bb < cc: truncate, inex = -1
++ 1d. sh=0 and cmp_low = 0 and bb-cc = 0 [around 0]
++ 1d1: bb > cc: truncate, inex = -1
++ 1d2: bb = cc: cannot conclude
++ 1d3: bb < cc: truncate, inex = +1
++ 1f. sh=0 and cmp_low = -1 and bb-cc = -half [around -0.5 ulp]
++ 1f1: bb > cc: truncate, inex = +1
++ 1f2: bb = cc: cannot conclude
++ 1f3: bb < cc: sub one ulp, inex = -1
++ 2b. sh > 0 and cmp_low = 2 and bb=cc [around 0.5 ulp]
++ 2b1. bb > cc: add one ulp, inex = 1
++ 2b2: bb = cc: cannot conclude
++ 2b3: bb < cc: truncate, inex = -1
++ 3b. sh > 0 and cmp_low = 0 [around 0]
++ 3b1. bb > cc: truncate, inex = -1
++ 3b2: bb = cc: cannot conclude
++ 3b3: bb < cc: truncate, inex = +1
++ */
+ }
+
+- if ((rnd_mode == MPFR_RNDN) && !is_exact)
++ if ((rnd_mode == MPFR_RNDN) && cmp_low != 0)
+ {
+ /* even rounding rule */
+ if ((ap[0] >> sh) & 1)
+ {
+- if (down)
++ if (cmp_low < 0)
+ goto sub_one_ulp;
+ else
+ goto add_one_ulp;
+ }
+ else
+- inexact = (down) ? 1 : -1;
++ inexact = (cmp_low > 0) ? -1 : 1;
+ }
+ else
+ inexact = 0;
+diff -Naurd mpfr-3.0.0-a/tests/tfma.c mpfr-3.0.0-b/tests/tfma.c
+--- mpfr-3.0.0-a/tests/tfma.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tfma.c 2010-10-21 20:59:32.000000000 +0000
+@@ -337,6 +337,94 @@
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
+ }
+
++static void
++bug20101018 (void)
++{
++ mpfr_t x, y, z, t, u;
++ int i;
++
++ mpfr_init2 (x, 64);
++ mpfr_init2 (y, 64);
++ mpfr_init2 (z, 64);
++ mpfr_init2 (t, 64);
++ mpfr_init2 (u, 64);
++
++ mpfr_set_str (x, "0xf.fffffffffffffffp-14766", 16, MPFR_RNDN);
++ mpfr_set_str (y, "-0xf.fffffffffffffffp+317", 16, MPFR_RNDN);
++ mpfr_set_str (z, "0x8.3ffffffffffe3ffp-14443", 16, MPFR_RNDN);
++ mpfr_set_str (t, "0x8.7ffffffffffc7ffp-14444", 16, MPFR_RNDN);
++ i = mpfr_fma (u, x, y, z, MPFR_RNDN);
++ if (mpfr_cmp (u, t) != 0)
++ {
++ printf ("Wrong result in bug20101018 (a)\n");
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, t, MPFR_RNDN);
++ printf ("\nGot ");
++ mpfr_out_str (stdout, 16, 0, u, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in bug20101018 (a)\n");
++ printf ("Expected > 0\n");
++ printf ("Got %d\n", i);
++ exit (1);
++ }
++
++ mpfr_set_str (x, "-0xf.fffffffffffffffp-11420", 16, MPFR_RNDN);
++ mpfr_set_str (y, "0xf.fffffffffffffffp+9863", 16, MPFR_RNDN);
++ mpfr_set_str (z, "0x8.fffff80ffffffffp-1551", 16, MPFR_RNDN);
++ mpfr_set_str (t, "0x9.fffff01ffffffffp-1552", 16, MPFR_RNDN);
++ i = mpfr_fma (u, x, y, z, MPFR_RNDN);
++ if (mpfr_cmp (u, t) != 0)
++ {
++ printf ("Wrong result in bug20101018 (b)\n");
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, t, MPFR_RNDN);
++ printf ("\nGot ");
++ mpfr_out_str (stdout, 16, 0, u, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in bug20101018 (b)\n");
++ printf ("Expected > 0\n");
++ printf ("Got %d\n", i);
++ exit (1);
++ }
++
++ mpfr_set_str (x, "0xf.fffffffffffffffp-2125", 16, MPFR_RNDN);
++ mpfr_set_str (y, "-0xf.fffffffffffffffp-6000", 16, MPFR_RNDN);
++ mpfr_set_str (z, "0x8p-8119", 16, MPFR_RNDN);
++ mpfr_set_str (t, "0x8.000000000000001p-8120", 16, MPFR_RNDN);
++ i = mpfr_fma (u, x, y, z, MPFR_RNDN);
++ if (mpfr_cmp (u, t) != 0)
++ {
++ printf ("Wrong result in bug20101018 (c)\n");
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, t, MPFR_RNDN);
++ printf ("\nGot ");
++ mpfr_out_str (stdout, 16, 0, u, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in bug20101018 (c)\n");
++ printf ("Expected > 0\n");
++ printf ("Got %d\n", i);
++ exit (1);
++ }
++
++ mpfr_clear (x);
++ mpfr_clear (y);
++ mpfr_clear (z);
++ mpfr_clear (t);
++ mpfr_clear (u);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -345,6 +433,8 @@
+
+ tests_start_mpfr ();
+
++ bug20101018 ();
++
+ mpfr_init (x);
+ mpfr_init (s);
+ mpfr_init (y);
+diff -Naurd mpfr-3.0.0-a/tests/tsub.c mpfr-3.0.0-b/tests/tsub.c
+--- mpfr-3.0.0-a/tests/tsub.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tsub.c 2010-10-21 20:59:32.000000000 +0000
+@@ -201,6 +201,8 @@
+ if (mpfr_cmp (z, x))
+ {
+ printf ("Error in mpfr_sub (2)\n");
++ printf ("Expected "); mpfr_print_binary (x); puts ("");
++ printf ("Got "); mpfr_print_binary (z); puts ("");
+ exit (1);
+ }
+ mpfr_set_str_binary (x, "1.1110111011110001110111011111111111101000011001011100101100101101");
+@@ -478,6 +480,156 @@
+ mpfr_clear (u);
+ }
+
++/* Bug found by Jakub Jelinek
++ * http://bugzilla.redhat.com/643657
++ * https://gforge.inria.fr/tracker/index.php?func=detail&aid=11301
++ * The consequence can be either an assertion failure (i = 2 in the
++ * testcase below, in debug mode) or an incorrectly rounded value.
++ */
++static void
++bug20101017 (void)
++{
++ mpfr_t a, b, c;
++ int inex;
++ int i;
++
++ mpfr_init2 (a, GMP_NUMB_BITS * 2);
++ mpfr_init2 (b, GMP_NUMB_BITS);
++ mpfr_init2 (c, GMP_NUMB_BITS);
++
++ /* a = 2^(2N) + k.2^(2N-1) + 2^N and b = 1
++ with N = GMP_NUMB_BITS and k = 0 or 1.
++ c = a - b should round to the same value as a. */
++
++ for (i = 2; i <= 3; i++)
++ {
++ mpfr_set_ui_2exp (a, i, GMP_NUMB_BITS - 1, MPFR_RNDN);
++ mpfr_add_ui (a, a, 1, MPFR_RNDN);
++ mpfr_mul_2ui (a, a, GMP_NUMB_BITS, MPFR_RNDN);
++ mpfr_set_ui (b, 1, MPFR_RNDN);
++ inex = mpfr_sub (c, a, b, MPFR_RNDN);
++ mpfr_set (b, a, MPFR_RNDN);
++ if (! mpfr_equal_p (c, b))
++ {
++ printf ("Error in bug20101017 for i = %d.\n", i);
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, b, MPFR_RNDN);
++ putchar ('\n');
++ printf ("Got ");
++ mpfr_out_str (stdout, 16, 0, c, MPFR_RNDN);
++ putchar ('\n');
++ exit (1);
++ }
++ if (inex >= 0)
++ {
++ printf ("Error in bug20101017 for i = %d: bad inex value.\n", i);
++ printf ("Expected negative, got %d.\n", inex);
++ exit (1);
++ }
++ }
++
++ mpfr_set_prec (a, 64);
++ mpfr_set_prec (b, 129);
++ mpfr_set_prec (c, 2);
++ mpfr_set_str_binary (b, "0.100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001E65");
++ mpfr_set_str_binary (c, "0.10E1");
++ inex = mpfr_sub (a, b, c, MPFR_RNDN);
++ if (mpfr_cmp_ui_2exp (a, 1, 64) != 0 || inex >= 0)
++ {
++ printf ("Error in mpfr_sub for b-c for b=2^64+1+2^(-64), c=1\n");
++ printf ("Expected result 2^64 with inex < 0\n");
++ printf ("Got "); mpfr_print_binary (a);
++ printf (" with inex=%d\n", inex);
++ exit (1);
++ }
++
++ mpfr_clears (a, b, c, (mpfr_ptr) 0);
++}
++
++/* hard test of rounding */
++static void
++check_rounding (void)
++{
++ mpfr_t a, b, c, res;
++ mpfr_prec_t p;
++ long k, l;
++ int i;
++
++#define MAXKL (2 * GMP_NUMB_BITS)
++ for (p = MPFR_PREC_MIN; p <= GMP_NUMB_BITS; p++)
++ {
++ mpfr_init2 (a, p);
++ mpfr_init2 (res, p);
++ mpfr_init2 (b, p + 1 + MAXKL);
++ mpfr_init2 (c, MPFR_PREC_MIN);
++
++ /* b = 2^p + 1 + 2^(-k), c = 2^(-l) */
++ for (k = 0; k <= MAXKL; k++)
++ for (l = 0; l <= MAXKL; l++)
++ {
++ mpfr_set_ui_2exp (b, 1, p, MPFR_RNDN);
++ mpfr_add_ui (b, b, 1, MPFR_RNDN);
++ mpfr_mul_2ui (b, b, k, MPFR_RNDN);
++ mpfr_add_ui (b, b, 1, MPFR_RNDN);
++ mpfr_div_2ui (b, b, k, MPFR_RNDN);
++ mpfr_set_ui_2exp (c, 1, -l, MPFR_RNDN);
++ i = mpfr_sub (a, b, c, MPFR_RNDN);
++ /* b - c = 2^p + 1 + 2^(-k) - 2^(-l), should be rounded to
++ 2^p for l <= k, and 2^p+2 for l < k */
++ if (l <= k)
++ {
++ if (mpfr_cmp_ui_2exp (a, 1, p) != 0)
++ {
++ printf ("Wrong result in check_rounding\n");
++ printf ("p=%lu k=%ld l=%ld\n", p, k, l);
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("Expected 2^%lu\n", p);
++ printf ("Got "); mpfr_print_binary (a); puts ("");
++ exit (1);
++ }
++ if (i >= 0)
++ {
++ printf ("Wrong ternary value in check_rounding\n");
++ printf ("p=%lu k=%ld l=%ld\n", p, k, l);
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("a="); mpfr_print_binary (a); puts ("");
++ printf ("Expected < 0, got %d\n", i);
++ exit (1);
++ }
++ }
++ else /* l < k */
++ {
++ mpfr_set_ui_2exp (res, 1, p, MPFR_RNDN);
++ mpfr_add_ui (res, res, 2, MPFR_RNDN);
++ if (mpfr_cmp (a, res) != 0)
++ {
++ printf ("Wrong result in check_rounding\n");
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("Expected "); mpfr_print_binary (res); puts ("");
++ printf ("Got "); mpfr_print_binary (a); puts ("");
++ exit (1);
++ }
++ if (i <= 0)
++ {
++ printf ("Wrong ternary value in check_rounding\n");
++ printf ("b="); mpfr_print_binary (b); puts ("");
++ printf ("c="); mpfr_print_binary (c); puts ("");
++ printf ("Expected > 0, got %d\n", i);
++ exit (1);
++ }
++ }
++ }
++
++ mpfr_clear (a);
++ mpfr_clear (res);
++ mpfr_clear (b);
++ mpfr_clear (c);
++ }
++}
++
+ #define TEST_FUNCTION test_sub
+ #define TWO_ARGS
+ #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100, RANDS)
+@@ -491,6 +643,8 @@
+
+ tests_start_mpfr ();
+
++ bug20101017 ();
++ check_rounding ();
+ check_diverse ();
+ check_inexact ();
+ bug_ddefour ();
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-10-21 20:28:38.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-10-21 20:59:32.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p5";
++ return "3.0.0-p6";
+ }
diff --git a/patches/mpfr/3.0.0/170-mpfr_set_ld.patch b/patches/mpfr/3.0.0/170-mpfr_set_ld.patch
new file mode 100644
index 0000000..9209afe
--- /dev/null
+++ b/patches/mpfr/3.0.0/170-mpfr_set_ld.patch
@@ -0,0 +1,155 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-10-21 21:18:26.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_set_ld
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-10-21 21:18:26.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p6
++3.0.0-p7
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-10-21 21:18:26.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p6"
++#define MPFR_VERSION_STRING "3.0.0-p7"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.0-a/set_ld.c mpfr-3.0.0-b/set_ld.c
+--- mpfr-3.0.0-a/set_ld.c 2010-06-10 11:00:14.000000000 +0000
++++ mpfr-3.0.0-b/set_ld.c 2010-10-21 21:18:26.000000000 +0000
+@@ -102,21 +102,25 @@
+ {
+ x /= div13; /* exact */
+ shift_exp += 8192;
++ mpfr_div_2si (t, t, 8192, MPFR_RNDZ);
+ }
+ if (ABS (x) >= div12)
+ {
+ x /= div12; /* exact */
+ shift_exp += 4096;
++ mpfr_div_2si (t, t, 4096, MPFR_RNDZ);
+ }
+ if (ABS (x) >= div11)
+ {
+ x /= div11; /* exact */
+ shift_exp += 2048;
++ mpfr_div_2si (t, t, 2048, MPFR_RNDZ);
+ }
+ if (ABS (x) >= div10)
+ {
+ x /= div10; /* exact */
+ shift_exp += 1024;
++ mpfr_div_2si (t, t, 1024, MPFR_RNDZ);
+ }
+ /* warning: we may have DBL_MAX=2^1024*(1-2^(-53)) < x < 2^1024,
+ therefore we have one extra exponent reduction step */
+@@ -124,9 +128,10 @@
+ {
+ x /= div9; /* exact */
+ shift_exp += 512;
++ mpfr_div_2si (t, t, 512, MPFR_RNDZ);
+ }
+ } /* Check overflow of double */
+- else
++ else /* no overflow on double */
+ {
+ long double div9, div10, div11;
+
+@@ -149,29 +154,34 @@
+ {
+ x /= div13; /* exact */
+ shift_exp -= 8192;
++ mpfr_mul_2si (t, t, 8192, MPFR_RNDZ);
+ }
+ if (ABS (x) <= div12)
+ {
+ x /= div12; /* exact */
+ shift_exp -= 4096;
++ mpfr_mul_2si (t, t, 4096, MPFR_RNDZ);
+ }
+ if (ABS (x) <= div11)
+ {
+ x /= div11; /* exact */
+ shift_exp -= 2048;
++ mpfr_mul_2si (t, t, 2048, MPFR_RNDZ);
+ }
+ if (ABS (x) <= div10)
+ {
+ x /= div10; /* exact */
+ shift_exp -= 1024;
++ mpfr_mul_2si (t, t, 1024, MPFR_RNDZ);
+ }
+ if (ABS(x) <= div9)
+ {
+ x /= div9; /* exact */
+ shift_exp -= 512;
++ mpfr_mul_2si (t, t, 512, MPFR_RNDZ);
+ }
+ }
+- else
++ else /* no underflow */
+ {
+ inexact = mpfr_set_d (u, (double) x, MPFR_RNDZ);
+ MPFR_ASSERTD (inexact == 0);
+diff -Naurd mpfr-3.0.0-a/tests/tset_ld.c mpfr-3.0.0-b/tests/tset_ld.c
+--- mpfr-3.0.0-a/tests/tset_ld.c 2010-06-10 11:00:13.000000000 +0000
++++ mpfr-3.0.0-b/tests/tset_ld.c 2010-10-21 21:18:26.000000000 +0000
+@@ -147,12 +147,39 @@
+ test_fixed_bugs (void)
+ {
+ mpfr_t x;
+- long double d;
++ long double l, m;
+
+ /* bug found by Steve Kargl (2009-03-14) */
+ mpfr_init2 (x, 64);
+ mpfr_set_ui_2exp (x, 1, -16447, MPFR_RNDN);
+- d = mpfr_get_ld (x, MPFR_RNDN); /* an assertion failed in init2.c:50 */
++ mpfr_get_ld (x, MPFR_RNDN); /* an assertion failed in init2.c:50 */
++
++ /* bug reported by Jakub Jelinek (2010-10-17)
++ https://gforge.inria.fr/tracker/?func=detail&aid=11300 */
++ mpfr_set_prec (x, MPFR_LDBL_MANT_DIG);
++ /* l = 0x1.23456789abcdef0123456789abcdp-914L; */
++ l = 8.215640181713713164092636634579e-276;
++ mpfr_set_ld (x, l, MPFR_RNDN);
++ m = mpfr_get_ld (x, MPFR_RNDN);
++ if (m != l)
++ {
++ printf ("Error in get_ld o set_ld for l=%Le\n", l);
++ printf ("Got m=%Le instead of l\n", m);
++ exit (1);
++ }
++
++ /* another similar test which failed with extended double precision and the
++ generic code for mpfr_set_ld */
++ /* l = 0x1.23456789abcdef0123456789abcdp-968L; */
++ l = 4.560596445887084662336528403703e-292;
++ mpfr_set_ld (x, l, MPFR_RNDN);
++ m = mpfr_get_ld (x, MPFR_RNDN);
++ if (m != l)
++ {
++ printf ("Error in get_ld o set_ld for l=%Le\n", l);
++ printf ("Got m=%Le instead of l\n", m);
++ exit (1);
++ }
+
+ mpfr_clear (x);
+ }
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-10-21 20:59:32.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-10-21 21:18:26.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p6";
++ return "3.0.0-p7";
+ }
diff --git a/patches/mpfr/3.0.0/180-macros.patch b/patches/mpfr/3.0.0/180-macros.patch
new file mode 100644
index 0000000..58a490f
--- /dev/null
+++ b/patches/mpfr/3.0.0/180-macros.patch
@@ -0,0 +1,193 @@
+diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
+--- mpfr-3.0.0-a/PATCHES 2010-11-09 15:15:07.000000000 +0000
++++ mpfr-3.0.0-b/PATCHES 2010-11-09 15:15:07.000000000 +0000
+@@ -0,0 +1 @@
++macros
+diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
+--- mpfr-3.0.0-a/VERSION 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/VERSION 2010-11-09 15:15:07.000000000 +0000
+@@ -1 +1 @@
+-3.0.0-p7
++3.0.0-p8
+diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
+--- mpfr-3.0.0-a/mpfr.h 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/mpfr.h 2010-11-09 15:15:07.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.0.0-p7"
++#define MPFR_VERSION_STRING "3.0.0-p8"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+@@ -67,6 +67,16 @@
+ # define _MPFR_H_HAVE_INTMAX_T 1
+ #endif
+
++/* Avoid some problems with macro expansion if the user defines macros
++ with the same name as keywords. By convention, identifiers and macro
++ names starting with mpfr_ are reserved by MPFR. */
++typedef void mpfr_void;
++typedef int mpfr_int;
++typedef unsigned int mpfr_uint;
++typedef long mpfr_long;
++typedef unsigned long mpfr_ulong;
++typedef size_t mpfr_size_t;
++
+ /* Definition of rounding modes (DON'T USE MPFR_RNDNA!).
+ Warning! Changing the contents of this enum should be seen as an
+ interface change since the old and the new types are not compatible
+@@ -136,7 +146,7 @@
+ typedef mp_exp_t mpfr_exp_t;
+
+ /* Definition of the standard exponent limits */
+-#define MPFR_EMAX_DEFAULT ((mpfr_exp_t) (((unsigned long) 1 << 30) - 1))
++#define MPFR_EMAX_DEFAULT ((mpfr_exp_t) (((mpfr_ulong) 1 << 30) - 1))
+ #define MPFR_EMIN_DEFAULT (-(MPFR_EMAX_DEFAULT))
+
+ /* Definition of the main structure */
+@@ -725,13 +735,13 @@
+ unexpected results with future compilers and aggressive optimisations.
+ Why not working only with signed types, using INT_MIN and LONG_MIN? */
+ #if __GMP_MP_SIZE_T_INT
+-#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+2))
+-#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+1))
+-#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+3))
++#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(mpfr_uint)0)>>1))+2))
++#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(mpfr_uint)0)>>1))+1))
++#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(mpfr_uint)0)>>1))+3))
+ #else
+-#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+2))
+-#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+1))
+-#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+3))
++#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(mpfr_ulong)0)>>1))+2))
++#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(mpfr_ulong)0)>>1))+1))
++#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(mpfr_ulong)0)>>1))+3))
+ #endif
+
+ /* Define MPFR_USE_EXTENSION to avoid "gcc -pedantic" warnings. */
+@@ -760,9 +770,9 @@
+ #define mpfr_inf_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_INF)
+ #define mpfr_zero_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_ZERO)
+ #define mpfr_regular_p(_x) ((_x)->_mpfr_exp > __MPFR_EXP_INF)
+-#define mpfr_sgn(_x) \
+- ((_x)->_mpfr_exp < __MPFR_EXP_INF ? \
+- (mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (void) 0), 0 : \
++#define mpfr_sgn(_x) \
++ ((_x)->_mpfr_exp < __MPFR_EXP_INF ? \
++ (mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (mpfr_void) 0), 0 : \
+ MPFR_SIGN (_x))
+
+ /* Prevent them from using as lvalues */
+@@ -805,7 +815,19 @@
+ Moreover casts to unsigned long have been added to avoid warnings in
+ programs that use MPFR and are compiled with -Wconversion; such casts
+ are OK since if X is a constant expression, then (unsigned long) X is
+- also a constant expression, so that the optimizations still work. */
++ also a constant expression, so that the optimizations still work. The
++ warnings are probably related to the following two bugs:
++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210
++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38470 (possibly a variant)
++ and the casts could be removed once these bugs are fixed.
++ Casts shouldn't be used on the generic calls (to the ..._2exp functions),
++ where implicit conversions are performed. Indeed, having at least one
++ implicit conversion in the macro allows the compiler to emit diagnostics
++ when normally expected, for instance in the following call:
++ mpfr_set_ui (x, "foo", MPFR_RNDN);
++ If this is not possible (for future macros), one of the tricks described
++ on http://groups.google.com/group/comp.std.c/msg/e92abd24bf9eaf7b could
++ be used. */
+ #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
+ #if (__GNUC__ >= 2)
+ #undef mpfr_cmp_ui
+@@ -813,45 +835,45 @@
+ But warning! mpfr_sgn is specified as a macro in the API, thus the macro
+ mustn't be used if side effects are possible, like here. */
+ #define mpfr_cmp_ui(_f,_u) \
+- (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ (__builtin_constant_p (_u) && (mpfr_ulong) (_u) == 0 ? \
+ (mpfr_sgn) (_f) : \
+- mpfr_cmp_ui_2exp ((_f), (unsigned long) (_u), 0))
++ mpfr_cmp_ui_2exp ((_f), (_u), 0))
+ #undef mpfr_cmp_si
+-#define mpfr_cmp_si(_f,_s) \
+- (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
+- mpfr_cmp_ui ((_f), (unsigned long) (long) (_s)) : \
+- mpfr_cmp_si_2exp ((_f), (long) (_s), 0))
++#define mpfr_cmp_si(_f,_s) \
++ (__builtin_constant_p (_s) && (mpfr_long) (_s) >= 0 ? \
++ mpfr_cmp_ui ((_f), (mpfr_ulong) (mpfr_long) (_s)) : \
++ mpfr_cmp_si_2exp ((_f), (_s), 0))
+ #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
+ #undef mpfr_set_ui
+ #define mpfr_set_ui(_f,_u,_r) \
+- (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
++ (__builtin_constant_p (_u) && (mpfr_ulong) (_u) == 0 ? \
+ __extension__ ({ \
+ mpfr_ptr _p = (_f); \
+ _p->_mpfr_sign = 1; \
+ _p->_mpfr_exp = __MPFR_EXP_ZERO; \
+- (void) (_r); 0; }) : \
+- mpfr_set_ui_2exp ((_f), (unsigned long) (_u), 0, (_r)))
++ (mpfr_void) (_r); 0; }) : \
++ mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
+ #endif
+ #undef mpfr_set_si
+ #define mpfr_set_si(_f,_s,_r) \
+- (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
+- mpfr_set_ui ((_f), (unsigned long) (long) (_s), (_r)) : \
+- mpfr_set_si_2exp ((_f), (long) (_s), 0, (_r)))
++ (__builtin_constant_p (_s) && (mpfr_long) (_s) >= 0 ? \
++ mpfr_set_ui ((_f), (mpfr_ulong) (mpfr_long) (_s), (_r)) : \
++ mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
+ #endif
+ #endif
+
+ /* Macro version of mpfr_stack interface for fast access */
+-#define mpfr_custom_get_size(p) ((size_t) \
++#define mpfr_custom_get_size(p) ((mpfr_size_t) \
+ (((p)+GMP_NUMB_BITS-1)/GMP_NUMB_BITS*sizeof (mp_limb_t)))
+ #define mpfr_custom_init(m,p) do {} while (0)
+-#define mpfr_custom_get_significand(x) ((void*)((x)->_mpfr_d))
++#define mpfr_custom_get_significand(x) ((mpfr_void*)((x)->_mpfr_d))
+ #define mpfr_custom_get_exp(x) ((x)->_mpfr_exp)
+ #define mpfr_custom_move(x,m) do { ((x)->_mpfr_d = (mp_limb_t*)(m)); } while (0)
+ #define mpfr_custom_init_set(x,k,e,p,m) do { \
+ mpfr_ptr _x = (x); \
+ mpfr_exp_t _e; \
+ mpfr_kind_t _t; \
+- int _s, _k; \
++ mpfr_int _s, _k; \
+ _k = (k); \
+ if (_k >= 0) { \
+ _t = (mpfr_kind_t) _k; \
+@@ -868,11 +890,13 @@
+ _x->_mpfr_exp = _e; \
+ _x->_mpfr_d = (mp_limb_t*) (m); \
+ } while (0)
+-#define mpfr_custom_get_kind(x) \
+- ( (x)->_mpfr_exp > __MPFR_EXP_INF ? (int)MPFR_REGULAR_KIND*MPFR_SIGN (x) \
+- : (x)->_mpfr_exp == __MPFR_EXP_INF ? (int)MPFR_INF_KIND*MPFR_SIGN (x) \
+- : (x)->_mpfr_exp == __MPFR_EXP_NAN ? (int)MPFR_NAN_KIND \
+- : (int) MPFR_ZERO_KIND * MPFR_SIGN (x) )
++#define mpfr_custom_get_kind(x) \
++ ( (x)->_mpfr_exp > __MPFR_EXP_INF ? \
++ (mpfr_int) MPFR_REGULAR_KIND * MPFR_SIGN (x) \
++ : (x)->_mpfr_exp == __MPFR_EXP_INF ? \
++ (mpfr_int) MPFR_INF_KIND * MPFR_SIGN (x) \
++ : (x)->_mpfr_exp == __MPFR_EXP_NAN ? (mpfr_int) MPFR_NAN_KIND \
++ : (mpfr_int) MPFR_ZERO_KIND * MPFR_SIGN (x) )
+
+
+ #endif /* MPFR_USE_NO_MACRO */
+diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
+--- mpfr-3.0.0-a/version.c 2010-10-21 21:18:26.000000000 +0000
++++ mpfr-3.0.0-b/version.c 2010-11-09 15:15:07.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.0-p7";
++ return "3.0.0-p8";
+ }
diff --git a/patches/mpfr/3.0.1/110-asin_exprange.patch b/patches/mpfr/3.0.1/110-asin_exprange.patch
new file mode 100644
index 0000000..d79a6f9
--- /dev/null
+++ b/patches/mpfr/3.0.1/110-asin_exprange.patch
@@ -0,0 +1,137 @@
+diff -Naurd mpfr-3.0.1-a/PATCHES mpfr-3.0.1-b/PATCHES
+--- mpfr-3.0.1-a/PATCHES 2011-04-12 10:50:02.000000000 +0000
++++ mpfr-3.0.1-b/PATCHES 2011-04-12 10:50:02.000000000 +0000
+@@ -0,0 +1 @@
++asin_exprange
+diff -Naurd mpfr-3.0.1-a/VERSION mpfr-3.0.1-b/VERSION
+--- mpfr-3.0.1-a/VERSION 2011-04-04 10:19:18.000000000 +0000
++++ mpfr-3.0.1-b/VERSION 2011-04-12 10:50:02.000000000 +0000
+@@ -1 +1 @@
+-3.0.1
++3.0.1-p1
+diff -Naurd mpfr-3.0.1-a/asin.c mpfr-3.0.1-b/asin.c
+--- mpfr-3.0.1-a/asin.c 2011-04-04 10:19:18.000000000 +0000
++++ mpfr-3.0.1-b/asin.c 2011-04-12 10:50:02.000000000 +0000
+@@ -63,11 +63,14 @@
+
+ compared = mpfr_cmp_ui (xp, 1);
+
++ MPFR_SAVE_EXPO_MARK (expo);
++
+ if (MPFR_UNLIKELY (compared >= 0))
+ {
+ mpfr_clear (xp);
+ if (compared > 0) /* asin(x) = NaN for |x| > 1 */
+ {
++ MPFR_SAVE_EXPO_FREE (expo);
+ MPFR_SET_NAN (asin);
+ MPFR_RET_NAN;
+ }
+@@ -80,13 +83,11 @@
+ inexact = -mpfr_const_pi (asin, MPFR_INVERT_RND(rnd_mode));
+ MPFR_CHANGE_SIGN (asin);
+ }
+- mpfr_div_2ui (asin, asin, 1, rnd_mode); /* May underflow */
+- return inexact;
++ mpfr_div_2ui (asin, asin, 1, rnd_mode);
+ }
+ }
+-
+- MPFR_SAVE_EXPO_MARK (expo);
+-
++ else
++ {
+ /* Compute exponent of 1 - ABS(x) */
+ mpfr_ui_sub (xp, 1, xp, MPFR_RNDD);
+ MPFR_ASSERTD (MPFR_GET_EXP (xp) <= 0);
+@@ -115,6 +116,7 @@
+ inexact = mpfr_set (asin, xp, rnd_mode);
+
+ mpfr_clear (xp);
++ }
+
+ MPFR_SAVE_EXPO_FREE (expo);
+ return mpfr_check_range (asin, inexact, rnd_mode);
+diff -Naurd mpfr-3.0.1-a/mpfr.h mpfr-3.0.1-b/mpfr.h
+--- mpfr-3.0.1-a/mpfr.h 2011-04-04 10:19:18.000000000 +0000
++++ mpfr-3.0.1-b/mpfr.h 2011-04-12 10:50:02.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "3.0.1"
++#define MPFR_VERSION_STRING "3.0.1-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.1-a/tests/tasin.c mpfr-3.0.1-b/tests/tasin.c
+--- mpfr-3.0.1-a/tests/tasin.c 2011-04-04 10:19:17.000000000 +0000
++++ mpfr-3.0.1-b/tests/tasin.c 2011-04-12 10:50:02.000000000 +0000
+@@ -219,6 +219,49 @@
+ mpfr_clear (y);
+ }
+
++static void
++reduced_expo_range (void)
++{
++ mpfr_exp_t emin, emax;
++ mpfr_t x, y, ex_y;
++ int inex, ex_inex;
++ unsigned int flags, ex_flags;
++
++ emin = mpfr_get_emin ();
++ emax = mpfr_get_emax ();
++
++ mpfr_inits2 (4, x, y, ex_y, (mpfr_ptr) 0);
++ mpfr_set_str (x, "-0.1e1", 2, MPFR_RNDN);
++
++ mpfr_set_emin (1);
++ mpfr_set_emax (1);
++ mpfr_clear_flags ();
++ inex = mpfr_asin (y, x, MPFR_RNDA);
++ flags = __gmpfr_flags;
++ mpfr_set_emin (emin);
++ mpfr_set_emax (emax);
++
++ mpfr_set_str (ex_y, "-0.1101e1", 2, MPFR_RNDN);
++ ex_inex = -1;
++ ex_flags = MPFR_FLAGS_INEXACT;
++
++ if (SIGN (inex) != ex_inex || flags != ex_flags ||
++ ! mpfr_equal_p (y, ex_y))
++ {
++ printf ("Error in reduced_expo_range\non x = ");
++ mpfr_dump (x);
++ printf ("Expected y = ");
++ mpfr_out_str (stdout, 2, 0, ex_y, MPFR_RNDN);
++ printf ("\n inex = %d, flags = %u\n", ex_inex, ex_flags);
++ printf ("Got y = ");
++ mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
++ printf ("\n inex = %d, flags = %u\n", SIGN (inex), flags);
++ exit (1);
++ }
++
++ mpfr_clears (x, y, ex_y, (mpfr_ptr) 0);
++}
++
+ int
+ main (void)
+ {
+@@ -226,6 +269,7 @@
+
+ special ();
+ special_overflow ();
++ reduced_expo_range ();
+
+ test_generic (2, 100, 15);
+
+diff -Naurd mpfr-3.0.1-a/version.c mpfr-3.0.1-b/version.c
+--- mpfr-3.0.1-a/version.c 2011-04-04 10:19:18.000000000 +0000
++++ mpfr-3.0.1-b/version.c 2011-04-12 10:50:02.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.1";
++ return "3.0.1-p1";
+ }
diff --git a/patches/mpfr/3.0.1/120-rec_sqrt-carry.patch b/patches/mpfr/3.0.1/120-rec_sqrt-carry.patch
new file mode 100644
index 0000000..0367d84
--- /dev/null
+++ b/patches/mpfr/3.0.1/120-rec_sqrt-carry.patch
@@ -0,0 +1,76 @@
+diff -Naurd mpfr-3.0.1-a/PATCHES mpfr-3.0.1-b/PATCHES
+--- mpfr-3.0.1-a/PATCHES 2011-05-04 11:18:33.000000000 +0000
++++ mpfr-3.0.1-b/PATCHES 2011-05-04 11:18:33.000000000 +0000
+@@ -0,0 +1 @@
++rec_sqrt-carry
+diff -Naurd mpfr-3.0.1-a/VERSION mpfr-3.0.1-b/VERSION
+--- mpfr-3.0.1-a/VERSION 2011-04-12 10:50:02.000000000 +0000
++++ mpfr-3.0.1-b/VERSION 2011-05-04 11:18:33.000000000 +0000
+@@ -1 +1 @@
+-3.0.1-p1
++3.0.1-p2
+diff -Naurd mpfr-3.0.1-a/mpfr.h mpfr-3.0.1-b/mpfr.h
+--- mpfr-3.0.1-a/mpfr.h 2011-04-12 10:50:02.000000000 +0000
++++ mpfr-3.0.1-b/mpfr.h 2011-05-04 11:18:33.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "3.0.1-p1"
++#define MPFR_VERSION_STRING "3.0.1-p2"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.1-a/rec_sqrt.c mpfr-3.0.1-b/rec_sqrt.c
+--- mpfr-3.0.1-a/rec_sqrt.c 2011-04-04 10:19:18.000000000 +0000
++++ mpfr-3.0.1-b/rec_sqrt.c 2011-05-04 11:18:33.000000000 +0000
+@@ -375,20 +375,37 @@
+ MPFR_ASSERTD(un == ln + 1 || un == ln + 2);
+ /* the high un-ln limbs of u will overlap the low part of {x+ln,xn},
+ we need to add or subtract the overlapping part {u + ln, un - ln} */
++ /* Warning! th may be 0, in which case the mpn_add_1 and mpn_sub_1
++ below (with size = th) mustn't be used. In such a case, the limb
++ (carry) will be 0, so that this is semantically a no-op, but if
++ mpn_add_1 and mpn_sub_1 are used, GMP (currently) still does a
++ non-atomic read/write in a place that is not always allocated,
++ with the possible consequences: a crash if the corresponding
++ address is not mapped, or (rather unlikely) memory corruption
++ if another process/thread writes at the same place; things may
++ be worse with future GMP versions. Hence the tests carry != 0. */
+ if (neg == 0)
+ {
+ if (ln > 0)
+ MPN_COPY (x, u, ln);
+ cy = mpn_add (x + ln, x + ln, xn, u + ln, un - ln);
+ /* add cu at x+un */
+- cy += mpn_add_1 (x + un, x + un, th, cu);
++ if (cu != 0)
++ {
++ MPFR_ASSERTD (th != 0);
++ cy += mpn_add_1 (x + un, x + un, th, cu);
++ }
+ }
+ else /* negative case */
+ {
+ /* subtract {u+ln, un-ln} from {x+ln,un} */
+ cy = mpn_sub (x + ln, x + ln, xn, u + ln, un - ln);
+ /* carry cy is at x+un, like cu */
+- cy = mpn_sub_1 (x + un, x + un, th, cy + cu); /* n - un = th */
++ if (cy + cu != 0)
++ {
++ MPFR_ASSERTD (th != 0);
++ cy = mpn_sub_1 (x + un, x + un, th, cy + cu); /* n - un = th */
++ }
+ /* cy cannot be zero, since the most significant bit of Xh is 1,
+ and the correction is bounded by 2^{-h+3} */
+ MPFR_ASSERTD(cy == 0);
+diff -Naurd mpfr-3.0.1-a/version.c mpfr-3.0.1-b/version.c
+--- mpfr-3.0.1-a/version.c 2011-04-12 10:50:02.000000000 +0000
++++ mpfr-3.0.1-b/version.c 2011-05-04 11:18:33.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.1-p1";
++ return "3.0.1-p2";
+ }
diff --git a/patches/mpfr/3.0.1/130-atan-expo-range.patch b/patches/mpfr/3.0.1/130-atan-expo-range.patch
new file mode 100644
index 0000000..251b837
--- /dev/null
+++ b/patches/mpfr/3.0.1/130-atan-expo-range.patch
@@ -0,0 +1,107 @@
+diff -Naurd mpfr-3.0.1-a/PATCHES mpfr-3.0.1-b/PATCHES
+--- mpfr-3.0.1-a/PATCHES 2011-05-05 00:00:35.000000000 +0000
++++ mpfr-3.0.1-b/PATCHES 2011-05-05 00:00:35.000000000 +0000
+@@ -0,0 +1 @@
++atan-expo-range
+diff -Naurd mpfr-3.0.1-a/VERSION mpfr-3.0.1-b/VERSION
+--- mpfr-3.0.1-a/VERSION 2011-05-04 11:18:33.000000000 +0000
++++ mpfr-3.0.1-b/VERSION 2011-05-05 00:00:35.000000000 +0000
+@@ -1 +1 @@
+-3.0.1-p2
++3.0.1-p3
+diff -Naurd mpfr-3.0.1-a/atan.c mpfr-3.0.1-b/atan.c
+--- mpfr-3.0.1-a/atan.c 2011-04-04 10:19:18.000000000 +0000
++++ mpfr-3.0.1-b/atan.c 2011-05-05 00:00:35.000000000 +0000
+@@ -431,5 +431,5 @@
+ MPFR_GROUP_CLEAR (group);
+
+ MPFR_SAVE_EXPO_FREE (expo);
+- return mpfr_check_range (arctgt, inexact, rnd_mode);
++ return mpfr_check_range (atan, inexact, rnd_mode);
+ }
+diff -Naurd mpfr-3.0.1-a/mpfr.h mpfr-3.0.1-b/mpfr.h
+--- mpfr-3.0.1-a/mpfr.h 2011-05-04 11:18:33.000000000 +0000
++++ mpfr-3.0.1-b/mpfr.h 2011-05-05 00:00:35.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "3.0.1-p2"
++#define MPFR_VERSION_STRING "3.0.1-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.1-a/tests/tatan.c mpfr-3.0.1-b/tests/tatan.c
+--- mpfr-3.0.1-a/tests/tatan.c 2011-04-04 10:19:17.000000000 +0000
++++ mpfr-3.0.1-b/tests/tatan.c 2011-05-05 00:00:35.000000000 +0000
+@@ -535,6 +535,52 @@
+ mpfr_clears (a, x, y, (mpfr_ptr) 0);
+ }
+
++/* http://websympa.loria.fr/wwsympa/arc/mpfr/2011-05/msg00008.html
++ * Incorrect flags (in debug mode on a 32-bit machine, assertion failure).
++ */
++static void
++reduced_expo_range (void)
++{
++ mpfr_exp_t emin, emax;
++ mpfr_t x, y, ex_y;
++ int inex, ex_inex;
++ unsigned int flags, ex_flags;
++
++ emin = mpfr_get_emin ();
++ emax = mpfr_get_emax ();
++
++ mpfr_inits2 (12, x, y, ex_y, (mpfr_ptr) 0);
++ mpfr_set_str (x, "0.1e-5", 2, MPFR_RNDN);
++
++ mpfr_set_emin (-5);
++ mpfr_set_emax (-5);
++ mpfr_clear_flags ();
++ inex = mpfr_atan (y, x, MPFR_RNDN);
++ flags = __gmpfr_flags;
++ mpfr_set_emin (emin);
++ mpfr_set_emax (emax);
++
++ mpfr_set_str (ex_y, "0.1e-5", 2, MPFR_RNDN);
++ ex_inex = 1;
++ ex_flags = MPFR_FLAGS_INEXACT;
++
++ if (SIGN (inex) != ex_inex || flags != ex_flags ||
++ ! mpfr_equal_p (y, ex_y))
++ {
++ printf ("Error in reduced_expo_range\non x = ");
++ mpfr_dump (x);
++ printf ("Expected y = ");
++ mpfr_out_str (stdout, 2, 0, ex_y, MPFR_RNDN);
++ printf ("\n inex = %d, flags = %u\n", ex_inex, ex_flags);
++ printf ("Got y = ");
++ mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
++ printf ("\n inex = %d, flags = %u\n", SIGN (inex), flags);
++ exit (1);
++ }
++
++ mpfr_clears (x, y, ex_y, (mpfr_ptr) 0);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -546,6 +592,7 @@
+ smallvals_atan2 ();
+ atan2_bug_20071003 ();
+ atan2_different_prec ();
++ reduced_expo_range ();
+
+ test_generic_atan (2, 200, 17);
+ test_generic_atan2 (2, 200, 17);
+diff -Naurd mpfr-3.0.1-a/version.c mpfr-3.0.1-b/version.c
+--- mpfr-3.0.1-a/version.c 2011-05-04 11:18:33.000000000 +0000
++++ mpfr-3.0.1-b/version.c 2011-05-05 00:00:35.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.1-p2";
++ return "3.0.1-p3";
+ }
diff --git a/patches/mpfr/3.0.1/140-texp-zero.patch b/patches/mpfr/3.0.1/140-texp-zero.patch
new file mode 100644
index 0000000..fd74087
--- /dev/null
+++ b/patches/mpfr/3.0.1/140-texp-zero.patch
@@ -0,0 +1,47 @@
+diff -Naurd mpfr-3.0.1-a/PATCHES mpfr-3.0.1-b/PATCHES
+--- mpfr-3.0.1-a/PATCHES 2011-05-09 14:48:24.000000000 +0000
++++ mpfr-3.0.1-b/PATCHES 2011-05-09 14:48:24.000000000 +0000
+@@ -0,0 +1 @@
++texp-zero
+diff -Naurd mpfr-3.0.1-a/VERSION mpfr-3.0.1-b/VERSION
+--- mpfr-3.0.1-a/VERSION 2011-05-05 00:00:35.000000000 +0000
++++ mpfr-3.0.1-b/VERSION 2011-05-09 14:48:24.000000000 +0000
+@@ -1 +1 @@
+-3.0.1-p3
++3.0.1-p4
+diff -Naurd mpfr-3.0.1-a/mpfr.h mpfr-3.0.1-b/mpfr.h
+--- mpfr-3.0.1-a/mpfr.h 2011-05-05 00:00:35.000000000 +0000
++++ mpfr-3.0.1-b/mpfr.h 2011-05-09 14:48:24.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 0
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "3.0.1-p3"
++#define MPFR_VERSION_STRING "3.0.1-p4"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.0.1-a/tests/texp.c mpfr-3.0.1-b/tests/texp.c
+--- mpfr-3.0.1-a/tests/texp.c 2011-04-04 10:19:17.000000000 +0000
++++ mpfr-3.0.1-b/tests/texp.c 2011-05-09 14:48:24.000000000 +0000
+@@ -170,7 +170,9 @@
+ mpfr_set_prec (x, prec);
+ mpfr_set_prec (y, prec);
+ mpfr_set_prec (z, prec);
+- mpfr_urandomb (x, RANDS);
++ do
++ mpfr_urandomb (x, RANDS);
++ while (MPFR_IS_ZERO (x)); /* 0 is handled by mpfr_exp only */
+ rnd = RND_RAND ();
+ mpfr_exp_2 (y, x, rnd);
+ mpfr_exp_3 (z, x, rnd);
+diff -Naurd mpfr-3.0.1-a/version.c mpfr-3.0.1-b/version.c
+--- mpfr-3.0.1-a/version.c 2011-05-05 00:00:35.000000000 +0000
++++ mpfr-3.0.1-b/version.c 2011-05-09 14:48:24.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.0.1-p3";
++ return "3.0.1-p4";
+ }
diff --git a/patches/mpfr/3.1.0/110-mpfr_unlikely.patch b/patches/mpfr/3.1.0/110-mpfr_unlikely.patch
new file mode 100644
index 0000000..437b1a2
--- /dev/null
+++ b/patches/mpfr/3.1.0/110-mpfr_unlikely.patch
@@ -0,0 +1,50 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2011-10-05 21:39:57.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2011-10-05 21:39:57.000000000 +0000
+@@ -0,0 +1 @@
++mpfr_unlikely
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2011-10-03 08:17:15.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2011-10-05 21:39:57.000000000 +0000
+@@ -1 +1 @@
+-3.1.0
++3.1.0-p1
+diff -Naurd mpfr-3.1.0-a/src/mpfr-impl.h mpfr-3.1.0-b/src/mpfr-impl.h
+--- mpfr-3.1.0-a/src/mpfr-impl.h 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr-impl.h 2011-10-05 21:39:57.000000000 +0000
+@@ -988,10 +988,11 @@
+ ******************************************************/
+
+ /* Theses macros help the compiler to determine if a test is
+- * likely or unlikely. */
++ likely or unlikely. The !! is necessary in case x is larger
++ than a long. */
+ #if __MPFR_GNUC(3,0) || __MPFR_ICC(8,1,0)
+ # define MPFR_LIKELY(x) (__builtin_expect(!!(x),1))
+-# define MPFR_UNLIKELY(x) (__builtin_expect((x),0))
++# define MPFR_UNLIKELY(x) (__builtin_expect(!!(x),0))
+ #else
+ # define MPFR_LIKELY(x) (x)
+ # define MPFR_UNLIKELY(x) (x)
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2011-10-05 21:39:57.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0"
++#define MPFR_VERSION_STRING "3.1.0-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2011-10-05 21:39:57.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0";
++ return "3.1.0-p1";
+ }
diff --git a/patches/mpfr/3.1.0/120-lib-search-path.patch b/patches/mpfr/3.1.0/120-lib-search-path.patch
new file mode 100644
index 0000000..4714ac9
--- /dev/null
+++ b/patches/mpfr/3.1.0/120-lib-search-path.patch
@@ -0,0 +1,96 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2011-10-14 10:43:32.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2011-10-14 10:43:32.000000000 +0000
+@@ -0,0 +1 @@
++lib-search-path
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2011-10-05 21:39:57.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2011-10-14 10:43:32.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p1
++3.1.0-p2
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2011-10-05 21:39:57.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2011-10-14 10:43:32.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p1"
++#define MPFR_VERSION_STRING "3.1.0-p2"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2011-10-05 21:39:57.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2011-10-14 10:43:32.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p1";
++ return "3.1.0-p2";
+ }
+diff -Naurd mpfr-3.1.0-a/tests/Makefile.am mpfr-3.1.0-b/tests/Makefile.am
+--- mpfr-3.1.0-a/tests/Makefile.am 2011-10-03 08:17:14.000000000 +0000
++++ mpfr-3.1.0-b/tests/Makefile.am 2011-10-03 08:17:14.000000000 +0000
+@@ -65,8 +65,24 @@
+ TESTS = $(check_PROGRAMS)
+ TESTS_ENVIRONMENT = MPFR_QUIET=1 $(VALGRIND)
+
+-# Option to prevent libtool from generating wrapper scripts for the tests.
++# The -no-install option prevents libtool from generating wrapper scripts
++# for the tests.
+ # This is useful to easily run the test scripts under valgrind or gdb.
+ # See discussion http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28033
+ # http://article.gmane.org/gmane.comp.lib.gnulib.bugs/28140 in particular.
+-AM_LDFLAGS = -no-install
++#
++# The -L$(top_builddir)/src/.libs option is necessary for some platforms,
++# such as HP-UX, when --with-gmp or --with-gmp-lib is used and an old MPFR
++# library is already installed in the corresponding lib directory: its
++# purpose is to make sure that the local .libs comes first in the library
++# search path (otherwise the tests are linked against the old MPFR library
++# by the LINK command -- see the generated Makefile). See:
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00042.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00043.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00044.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00066.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00065.html
++# and
++# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9728
++#
++AM_LDFLAGS = -no-install -L$(top_builddir)/src/.libs
+diff -Naurd mpfr-3.1.0-a/tests/Makefile.in mpfr-3.1.0-b/tests/Makefile.in
+--- mpfr-3.1.0-a/tests/Makefile.in 2011-10-03 08:17:35.000000000 +0000
++++ mpfr-3.1.0-b/tests/Makefile.in 2011-10-03 08:17:35.000000000 +0000
+@@ -1124,11 +1124,27 @@
+ TESTS = $(check_PROGRAMS)
+ TESTS_ENVIRONMENT = MPFR_QUIET=1 $(VALGRIND)
+
+-# Option to prevent libtool from generating wrapper scripts for the tests.
++# The -no-install option prevents libtool from generating wrapper scripts
++# for the tests.
+ # This is useful to easily run the test scripts under valgrind or gdb.
+ # See discussion http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28033
+ # http://article.gmane.org/gmane.comp.lib.gnulib.bugs/28140 in particular.
+-AM_LDFLAGS = -no-install
++#
++# The -L$(top_builddir)/src/.libs option is necessary for some platforms,
++# such as HP-UX, when --with-gmp or --with-gmp-lib is used and an old MPFR
++# library is already installed in the corresponding lib directory: its
++# purpose is to make sure that the local .libs comes first in the library
++# search path (otherwise the tests are linked against the old MPFR library
++# by the LINK command -- see the generated Makefile). See:
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00042.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00043.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00044.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00066.html
++# http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00065.html
++# and
++# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9728
++#
++AM_LDFLAGS = -no-install -L$(top_builddir)/src/.libs
+ all: all-am
+
+ .SUFFIXES:
diff --git a/patches/mpfr/3.1.0/130-vasprintf.patch b/patches/mpfr/3.1.0/130-vasprintf.patch
new file mode 100644
index 0000000..aa1cfbc
--- /dev/null
+++ b/patches/mpfr/3.1.0/130-vasprintf.patch
@@ -0,0 +1,247 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2011-11-03 15:15:11.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2011-11-03 15:15:11.000000000 +0000
+@@ -0,0 +1 @@
++vasprintf
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2011-10-14 10:43:32.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2011-11-03 15:15:11.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p2
++3.1.0-p3
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2011-10-14 10:43:32.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2011-11-03 15:15:11.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p2"
++#define MPFR_VERSION_STRING "3.1.0-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/vasprintf.c mpfr-3.1.0-b/src/vasprintf.c
+--- mpfr-3.1.0-a/src/vasprintf.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/vasprintf.c 2011-11-03 15:15:11.000000000 +0000
+@@ -1178,7 +1178,7 @@
+ mpfr_exp_t exp;
+ char * str;
+ const int spec_g = (spec.spec == 'g' || spec.spec == 'G');
+- const int keep_trailing_zeros = spec_g && spec.alt;
++ const int keep_trailing_zeros = !spec_g || spec.alt;
+
+ /* WARNING: an empty precision field is forbidden (it means precision = 6
+ and it should have been changed to 6 before the function call) */
+@@ -1356,7 +1356,7 @@
+ else
+ /* 1 <= |p| */
+ {
+- size_t nsd; /* Number of significant digits */
++ size_t str_len;
+
+ /* Determine the position of the most significant decimal digit. */
+ exp = floor_log10 (p);
+@@ -1365,12 +1365,10 @@
+ /* P is too large to print all its integral part digits */
+ return -1;
+
+- np->ip_size = exp + 1;
+-
+- nsd = spec.prec + np->ip_size;
+ if (dec_info == NULL)
+- {
+- str = mpfr_get_str (NULL, &exp, 10, nsd, p, spec.rnd_mode);
++ { /* this case occurs with mpfr_printf ("%.0RUf", x) with x=9.5 */
++ str =
++ mpfr_get_str (NULL, &exp, 10, spec.prec+exp+1, p, spec.rnd_mode);
+ register_string (np->sl, str);
+ }
+ else
+@@ -1379,81 +1377,60 @@
+ str = dec_info->str;
+ }
+ np->ip_ptr = MPFR_IS_NEG (p) ? ++str : str; /* skip sign */
++ str_len = strlen (str);
++
++ /* integral part */
++ if (exp > str_len)
++ /* mpfr_get_str gives no trailing zero when p is rounded up to the next
++ power of 10 (p integer, so no fractional part) */
++ {
++ np->ip_trailing_zeros = exp - str_len;
++ np->ip_size = str_len;
++ }
++ else
++ np->ip_size = exp;
+
+ if (spec.group)
+ /* thousands separator in integral part */
+ np->thousands_sep = MPFR_THOUSANDS_SEPARATOR;
+
+- if (nsd == 0 || (spec_g && !spec.alt))
+- /* compute how much non-zero digits in integral and fractional
+- parts */
++ /* fractional part */
++ str += np->ip_size;
++ str_len -= np->ip_size;
++ if (!keep_trailing_zeros)
++ /* remove trailing zeros, if any */
+ {
+- size_t str_len;
+- str_len = strlen (str); /* note: the sign has been skipped */
+-
+- if (exp > str_len)
+- /* mpfr_get_str doesn't give the trailing zeros when p is a
+- multiple of 10 (p integer, so no fractional part) */
+- {
+- np->ip_trailing_zeros = exp - str_len;
+- np->ip_size = str_len;
+- if (spec.alt)
+- np->point = MPFR_DECIMAL_POINT;
+- }
+- else
+- /* str may contain some digits which are in fractional part */
++ char *ptr = str + str_len - 1; /* pointer to the last digit of
++ str */
++ while ((*ptr == '0') && (str_len != 0))
+ {
+- char *ptr;
+-
+- ptr = str + str_len - 1; /* points to the end of str */
+- str_len -= np->ip_size; /* number of digits in fractional
+- part */
+-
+- if (!keep_trailing_zeros)
+- /* remove trailing zeros, if any */
+- {
+- while ((*ptr == '0') && (str_len != 0))
+- {
+- --ptr;
+- --str_len;
+- }
+- }
+-
+- if (str_len > INT_MAX)
+- /* too many digits in fractional part */
+- return -1;
+-
+- if (str_len != 0)
+- /* some digits in fractional part */
+- {
+- np->point = MPFR_DECIMAL_POINT;
+- np->fp_ptr = str + np->ip_size;
+- np->fp_size = str_len;
+- }
++ --ptr;
++ --str_len;
+ }
+ }
+- else
+- /* spec.prec digits in fractional part */
++
++ if (str_len > 0)
++ /* some nonzero digits in fractional part */
+ {
+- if (np->ip_size == exp - 1)
+- /* the absolute value of the number has been rounded up to a power
+- of ten.
+- Insert an additional zero in integral part and put the rest of
+- them in fractional part. */
+- np->ip_trailing_zeros = 1;
++ if (str_len > INT_MAX)
++ /* too many digits in fractional part */
++ return -1;
+
+- if (spec.prec != 0)
+- {
+- MPFR_ASSERTD (np->ip_size + np->ip_trailing_zeros == exp);
+- MPFR_ASSERTD (np->ip_size + spec.prec == nsd);
++ np->point = MPFR_DECIMAL_POINT;
++ np->fp_ptr = str;
++ np->fp_size = str_len;
++ }
+
+- np->point = MPFR_DECIMAL_POINT;
+- np->fp_ptr = str + np->ip_size;
+- np->fp_size = spec.prec;
+- }
+- else if (spec.alt)
+- np->point = MPFR_DECIMAL_POINT;
++ if (keep_trailing_zeros && str_len < spec.prec)
++ /* add missing trailing zeros */
++ {
++ np->point = MPFR_DECIMAL_POINT;
++ np->fp_trailing_zeros = spec.prec - np->fp_size;
+ }
++
++ if (spec.alt)
++ /* add decimal point even if no digits follow it */
++ np->point = MPFR_DECIMAL_POINT;
+ }
+
+ return 0;
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2011-10-14 10:43:32.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2011-11-03 15:15:11.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p2";
++ return "3.1.0-p3";
+ }
+diff -Naurd mpfr-3.1.0-a/tests/tsprintf.c mpfr-3.1.0-b/tests/tsprintf.c
+--- mpfr-3.1.0-a/tests/tsprintf.c 2011-10-03 08:17:14.000000000 +0000
++++ mpfr-3.1.0-b/tests/tsprintf.c 2011-11-03 15:15:11.000000000 +0000
+@@ -475,6 +475,18 @@
+ check_sprintf ("-1.", "%- #0.1RG", x);
+
+ /* precision zero */
++ mpfr_set_d (x, 9.5, MPFR_RNDN);
++ check_sprintf ("9", "%.0RDf", x);
++ check_sprintf ("10", "%.0RUf", x);
++
++ mpfr_set_d (x, 19.5, MPFR_RNDN);
++ check_sprintf ("19", "%.0RDf", x);
++ check_sprintf ("20", "%.0RUf", x);
++
++ mpfr_set_d (x, 99.5, MPFR_RNDN);
++ check_sprintf ("99", "%.0RDf", x);
++ check_sprintf ("100", "%.0RUf", x);
++
+ mpfr_set_d (x, -9.5, MPFR_RNDN);
+ check_sprintf ("-10", "%.0RDf", x);
+ check_sprintf ("-10", "%.0RYf", x);
+@@ -1078,6 +1090,23 @@
+ mpfr_clear (x);
+ }
+
++static void
++bug20111102 (void)
++{
++ mpfr_t t;
++ char s[100];
++
++ mpfr_init2 (t, 84);
++ mpfr_set_str (t, "999.99999999999999999999", 10, MPFR_RNDN);
++ mpfr_sprintf (s, "%.20RNg", t);
++ if (strcmp (s, "1000") != 0)
++ {
++ printf ("Error in bug20111102, expected 1000, got %s\n", s);
++ exit (1);
++ }
++ mpfr_clear (t);
++}
++
+ /* In particular, the following test makes sure that the rounding
+ * for %Ra and %Rb is not done on the MPFR number itself (as it
+ * would overflow). Note: it has been reported on comp.std.c that
+@@ -1161,6 +1190,7 @@
+ locale = setlocale (LC_ALL, "C");
+ #endif
+
++ bug20111102 ();
+ native_types ();
+ hexadecimal ();
+ binary ();
diff --git a/patches/mpfr/3.1.0/140-gmp41compat.patch b/patches/mpfr/3.1.0/140-gmp41compat.patch
new file mode 100644
index 0000000..4b1ba08
--- /dev/null
+++ b/patches/mpfr/3.1.0/140-gmp41compat.patch
@@ -0,0 +1,166 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2011-11-28 12:22:52.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2011-11-28 12:22:52.000000000 +0000
+@@ -0,0 +1 @@
++gmp41compat
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2011-11-03 15:15:11.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2011-11-28 12:22:52.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p3
++3.1.0-p4
+diff -Naurd mpfr-3.1.0-a/doc/mpfr.info mpfr-3.1.0-b/doc/mpfr.info
+--- mpfr-3.1.0-a/doc/mpfr.info 2011-10-03 09:43:04.000000000 +0000
++++ mpfr-3.1.0-b/doc/mpfr.info 2011-11-28 12:22:52.000000000 +0000
+@@ -2994,11 +2994,12 @@
+
+ * `mpfr_urandom' and `mpfr_urandomb' changed in MPFR 3.1. Their
+ behavior no longer depends on the platform (assuming this is also
+- true for GMP's random generator). As a consequence, the returned
+- values can be different between MPFR 3.1 and previous MPFR
+- versions. Note: as the reproducibility of these functions was not
+- specified before MPFR 3.1, the MPFR 3.1 behavior is _not_ regarded
+- as backward incompatible with previous versions.
++ true for GMP's random generator, which is not the case between GMP
++ 4.1 and 4.2 if `gmp_randinit_default' is used). As a consequence,
++ the returned values can be different between MPFR 3.1 and previous
++ MPFR versions. Note: as the reproducibility of these functions
++ was not specified before MPFR 3.1, the MPFR 3.1 behavior is _not_
++ regarded as backward incompatible with previous versions.
+
+
+ 
+@@ -4239,13 +4240,13 @@
+ Node: Type and Macro Changes129308
+ Node: Added Functions132029
+ Node: Changed Functions134972
+-Node: Removed Functions139167
+-Node: Other Changes139579
+-Node: Contributors141108
+-Node: References143574
+-Node: GNU Free Documentation License145315
+-Node: Concept Index167758
+-Node: Function and Type Index173677
++Node: Removed Functions139253
++Node: Other Changes139665
++Node: Contributors141194
++Node: References143660
++Node: GNU Free Documentation License145401
++Node: Concept Index167844
++Node: Function and Type Index173763
+ 
+ End Tag Table
+
+diff -Naurd mpfr-3.1.0-a/doc/mpfr.texi mpfr-3.1.0-b/doc/mpfr.texi
+--- mpfr-3.1.0-a/doc/mpfr.texi 2011-10-03 08:17:14.000000000 +0000
++++ mpfr-3.1.0-b/doc/mpfr.texi 2011-11-28 12:22:52.000000000 +0000
+@@ -3466,8 +3466,9 @@
+ a lack of specification.
+
+ @item @code{mpfr_urandom} and @code{mpfr_urandomb} changed in MPFR 3.1.
+-Their behavior no longer depends on the platform (assuming this is also
+-true for GMP's random generator). As a consequence, the returned values
++Their behavior no longer depends on the platform (assuming this is also true
++for GMP's random generator, which is not the case between GMP 4.1 and 4.2 if
++@code{gmp_randinit_default} is used). As a consequence, the returned values
+ can be different between MPFR 3.1 and previous MPFR versions.
+ Note: as the reproducibility of these functions was not specified
+ before MPFR 3.1, the MPFR 3.1 behavior is @emph{not} regarded as
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2011-11-03 15:15:11.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2011-11-28 12:22:52.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p3"
++#define MPFR_VERSION_STRING "3.1.0-p4"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2011-11-03 15:15:11.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2011-11-28 12:22:52.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p3";
++ return "3.1.0-p4";
+ }
+diff -Naurd mpfr-3.1.0-a/tests/trandom.c mpfr-3.1.0-b/tests/trandom.c
+--- mpfr-3.1.0-a/tests/trandom.c 2011-10-03 08:17:14.000000000 +0000
++++ mpfr-3.1.0-b/tests/trandom.c 2011-11-28 12:22:52.000000000 +0000
+@@ -114,21 +114,29 @@
+ mpfr_t x;
+ gmp_randstate_t s;
+
++#if __MPFR_GMP(4,2,0)
++# define C1 "0.895943"
++# define C2 "0.848824"
++#else
++# define C1 "0.479652"
++# define C2 "0.648529"
++#endif
++
+ gmp_randinit_default (s);
+ gmp_randseed_ui (s, 42);
+ mpfr_init2 (x, 17);
+ mpfr_urandomb (x, s);
+- if (mpfr_cmp_str1 (x, "0.895943") != 0)
++ if (mpfr_cmp_str1 (x, C1) != 0)
+ {
+- printf ("Error in bug20100914, expected 0.895943, got ");
++ printf ("Error in bug20100914, expected " C1 ", got ");
+ mpfr_out_str (stdout, 10, 0, x, MPFR_RNDN);
+ printf ("\n");
+ exit (1);
+ }
+ mpfr_urandomb (x, s);
+- if (mpfr_cmp_str1 (x, "0.848824") != 0)
++ if (mpfr_cmp_str1 (x, C2) != 0)
+ {
+- printf ("Error in bug20100914, expected 0.848824, got ");
++ printf ("Error in bug20100914, expected " C2 ", got ");
+ mpfr_out_str (stdout, 10, 0, x, MPFR_RNDN);
+ printf ("\n");
+ exit (1);
+diff -Naurd mpfr-3.1.0-a/tests/turandom.c mpfr-3.1.0-b/tests/turandom.c
+--- mpfr-3.1.0-a/tests/turandom.c 2011-10-03 08:17:14.000000000 +0000
++++ mpfr-3.1.0-b/tests/turandom.c 2011-11-28 12:22:52.000000000 +0000
+@@ -160,23 +160,29 @@
+ mpfr_t x;
+ gmp_randstate_t s;
+
++#if __MPFR_GMP(4,2,0)
++# define C1 "0.8488312"
++# define C2 "0.8156509"
++#else
++# define C1 "0.6485367"
++# define C2 "0.9362717"
++#endif
++
+ gmp_randinit_default (s);
+ gmp_randseed_ui (s, 42);
+ mpfr_init2 (x, 17);
+ mpfr_urandom (x, s, MPFR_RNDN);
+- /* the following values are obtained on a 32-bit computer, we should get
+- the same values on a 64-bit computer */
+- if (mpfr_cmp_str1 (x, "0.8488312") != 0)
++ if (mpfr_cmp_str1 (x, C1) != 0)
+ {
+- printf ("Error in bug20100914, expected 0.8488312, got ");
++ printf ("Error in bug20100914, expected " C1 ", got ");
+ mpfr_out_str (stdout, 10, 0, x, MPFR_RNDN);
+ printf ("\n");
+ exit (1);
+ }
+ mpfr_urandom (x, s, MPFR_RNDN);
+- if (mpfr_cmp_str1 (x, "0.8156509") != 0)
++ if (mpfr_cmp_str1 (x, C2) != 0)
+ {
+- printf ("Error in bug20100914, expected 0.8156509, got ");
++ printf ("Error in bug20100914, expected " C2 ", got ");
+ mpfr_out_str (stdout, 10, 0, x, MPFR_RNDN);
+ printf ("\n");
+ exit (1);
diff --git a/patches/mpfr/3.1.0/150-logging-freeze.patch b/patches/mpfr/3.1.0/150-logging-freeze.patch
new file mode 100644
index 0000000..c664cee
--- /dev/null
+++ b/patches/mpfr/3.1.0/150-logging-freeze.patch
@@ -0,0 +1,69 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2012-02-24 12:44:49.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2012-02-24 12:44:49.000000000 +0000
+@@ -0,0 +1 @@
++logging-freeze
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2011-11-28 12:22:52.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2012-02-24 12:44:49.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p4
++3.1.0-p5
+diff -Naurd mpfr-3.1.0-a/src/add_d.c mpfr-3.1.0-b/src/add_d.c
+--- mpfr-3.1.0-a/src/add_d.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/add_d.c 2012-02-24 12:44:49.000000000 +0000
+@@ -34,7 +34,7 @@
+ (("b[%Pu]=%.*Rg c=%.20g rnd=%d",
+ mpfr_get_prec(b), mpfr_log_prec, b, c, rnd_mode),
+ ("a[%Pu]=%.*Rg inexact=%d",
+- mpfr_get_prec (a), mpfr_get_prec, a, inexact));
++ mpfr_get_prec (a), mpfr_log_prec, a, inexact));
+
+ MPFR_SAVE_EXPO_MARK (expo);
+
+diff -Naurd mpfr-3.1.0-a/src/add_ui.c mpfr-3.1.0-b/src/add_ui.c
+--- mpfr-3.1.0-a/src/add_ui.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/add_ui.c 2012-02-24 12:44:49.000000000 +0000
+@@ -29,7 +29,7 @@
+ MPFR_LOG_FUNC
+ (("x[%Pu]=%.*Rg u=%d rnd=%d",
+ mpfr_get_prec(x), mpfr_log_prec, x, u, rnd_mode),
+- ("y[%Pu]=%.*Rg", mpfr_get_prec (y), mpfr_get_prec, y));
++ ("y[%Pu]=%.*Rg", mpfr_get_prec (y), mpfr_log_prec, y));
+
+ if (MPFR_LIKELY(u != 0) ) /* if u=0, do nothing */
+ {
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2011-11-28 12:22:52.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2012-02-24 12:44:49.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p4"
++#define MPFR_VERSION_STRING "3.1.0-p5"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/mul_d.c mpfr-3.1.0-b/src/mul_d.c
+--- mpfr-3.1.0-a/src/mul_d.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/mul_d.c 2012-02-24 12:44:49.000000000 +0000
+@@ -34,7 +34,7 @@
+ (("b[%Pu]=%.*Rg c=%.20g rnd=%d",
+ mpfr_get_prec(b), mpfr_log_prec, b, c, rnd_mode),
+ ("a[%Pu]=%.*Rg inexact=%d",
+- mpfr_get_prec (a), mpfr_get_prec, a, inexact));
++ mpfr_get_prec (a), mpfr_log_prec, a, inexact));
+
+ MPFR_SAVE_EXPO_MARK (expo);
+
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2011-11-28 12:22:52.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2012-02-24 12:44:49.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p4";
++ return "3.1.0-p5";
+ }
diff --git a/patches/mpfr/3.1.0/160-logging-varfmt.patch b/patches/mpfr/3.1.0/160-logging-varfmt.patch
new file mode 100644
index 0000000..0f4bfad
--- /dev/null
+++ b/patches/mpfr/3.1.0/160-logging-varfmt.patch
@@ -0,0 +1,45 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2012-02-24 13:50:05.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2012-02-24 13:50:05.000000000 +0000
+@@ -0,0 +1 @@
++logging-varfmt
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2012-02-24 12:44:49.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2012-02-24 13:50:05.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p5
++3.1.0-p6
+diff -Naurd mpfr-3.1.0-a/src/mpfr-impl.h mpfr-3.1.0-b/src/mpfr-impl.h
+--- mpfr-3.1.0-a/src/mpfr-impl.h 2011-10-05 21:39:57.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr-impl.h 2012-02-24 13:50:05.000000000 +0000
+@@ -1592,7 +1592,7 @@
+ do \
+ if ((MPFR_LOG_INTERNAL_F & mpfr_log_type) && \
+ (mpfr_log_current <= mpfr_log_level)) \
+- LOG_PRINT ("%s.%d:%s[%#Pu]=%.*Rf\n", __func__, __LINE__, \
++ LOG_PRINT ("%s.%d:%s[%#Pu]=%.*Rg\n", __func__, __LINE__, \
+ #x, mpfr_get_prec (x), mpfr_log_prec, x); \
+ while (0)
+
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2012-02-24 12:44:49.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2012-02-24 13:50:05.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p5"
++#define MPFR_VERSION_STRING "3.1.0-p6"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2012-02-24 12:44:49.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2012-02-24 13:50:05.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p5";
++ return "3.1.0-p6";
+ }
diff --git a/patches/mpfr/3.1.0/170-large-prec.patch b/patches/mpfr/3.1.0/170-large-prec.patch
new file mode 100644
index 0000000..08e7b57
--- /dev/null
+++ b/patches/mpfr/3.1.0/170-large-prec.patch
@@ -0,0 +1,591 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2012-03-08 15:17:03.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2012-03-08 15:17:03.000000000 +0000
+@@ -0,0 +1 @@
++large-prec
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2012-02-24 13:50:05.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2012-03-08 15:17:03.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p6
++3.1.0-p7
+diff -Naurd mpfr-3.1.0-a/src/add1.c mpfr-3.1.0-b/src/add1.c
+--- mpfr-3.1.0-a/src/add1.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/add1.c 2012-03-08 15:17:03.000000000 +0000
+@@ -44,12 +44,12 @@
+ bq = MPFR_PREC(b);
+ cq = MPFR_PREC(c);
+
+- an = (aq-1)/GMP_NUMB_BITS+1; /* number of limbs of a */
++ an = MPFR_PREC2LIMBS (aq); /* number of limbs of a */
+ aq2 = (mpfr_prec_t) an * GMP_NUMB_BITS;
+ sh = aq2 - aq; /* non-significant bits in low limb */
+
+- bn = (bq-1)/GMP_NUMB_BITS+1; /* number of limbs of b */
+- cn = (cq-1)/GMP_NUMB_BITS+1; /* number of limbs of c */
++ bn = MPFR_PREC2LIMBS (bq); /* number of limbs of b */
++ cn = MPFR_PREC2LIMBS (cq); /* number of limbs of c */
+
+ ap = MPFR_MANT(a);
+ bp = MPFR_MANT(b);
+@@ -124,7 +124,7 @@
+ dif = aq2 - diff_exp;
+ /* dif is the number of bits of c which overlap with a' */
+
+- difn = (dif-1)/GMP_NUMB_BITS + 1;
++ difn = MPFR_PREC2LIMBS (dif);
+ /* only the highest difn limbs from c have to be considered */
+ if (MPFR_UNLIKELY(difn > cn))
+ {
+diff -Naurd mpfr-3.1.0-a/src/add1sp.c mpfr-3.1.0-b/src/add1sp.c
+--- mpfr-3.1.0-a/src/add1sp.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/add1sp.c 2012-03-08 15:17:03.000000000 +0000
+@@ -107,7 +107,7 @@
+
+ /* Read prec and num of limbs */
+ p = MPFR_PREC(b);
+- n = (p+GMP_NUMB_BITS-1)/GMP_NUMB_BITS;
++ n = MPFR_PREC2LIMBS (p);
+ MPFR_UNSIGNED_MINUS_MODULO(sh, p);
+ bx = MPFR_GET_EXP(b);
+ d = (mpfr_uexp_t) (bx - MPFR_GET_EXP(c));
+diff -Naurd mpfr-3.1.0-a/src/agm.c mpfr-3.1.0-b/src/agm.c
+--- mpfr-3.1.0-a/src/agm.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/agm.c 2012-03-08 15:17:03.000000000 +0000
+@@ -91,7 +91,7 @@
+ q = MPFR_PREC(r);
+ p = q + MPFR_INT_CEIL_LOG2(q) + 15;
+ MPFR_ASSERTD (p >= 7); /* see algorithms.tex */
+- s = (p - 1) / GMP_NUMB_BITS + 1;
++ s = MPFR_PREC2LIMBS (p);
+
+ /* b (op2) and a (op1) are the 2 operands but we want b >= a */
+ compare = mpfr_cmp (op1, op2);
+@@ -285,7 +285,7 @@
+
+ /* Next iteration */
+ MPFR_ZIV_NEXT (loop, p);
+- s = (p - 1) / GMP_NUMB_BITS + 1;
++ s = MPFR_PREC2LIMBS (p);
+ }
+ MPFR_ZIV_FREE (loop);
+
+diff -Naurd mpfr-3.1.0-a/src/eq.c mpfr-3.1.0-b/src/eq.c
+--- mpfr-3.1.0-a/src/eq.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/eq.c 2012-03-08 15:17:03.000000000 +0000
+@@ -56,8 +56,8 @@
+ if (uexp != vexp)
+ return 0; /* no bit agree */
+
+- usize = (MPFR_PREC(u) - 1) / GMP_NUMB_BITS + 1;
+- vsize = (MPFR_PREC(v) - 1) / GMP_NUMB_BITS + 1;
++ usize = MPFR_LIMB_SIZE (u);
++ vsize = MPFR_LIMB_SIZE (v);
+
+ if (vsize > usize) /* exchange u and v */
+ {
+diff -Naurd mpfr-3.1.0-a/src/exp.c mpfr-3.1.0-b/src/exp.c
+--- mpfr-3.1.0-a/src/exp.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/exp.c 2012-03-08 15:17:03.000000000 +0000
+@@ -133,7 +133,7 @@
+ mp_size_t yn;
+ int sh;
+
+- yn = 1 + (MPFR_PREC(y) - 1) / GMP_NUMB_BITS;
++ yn = MPFR_LIMB_SIZE (y);
+ sh = (mpfr_prec_t) yn * GMP_NUMB_BITS - MPFR_PREC(y);
+ MPFR_MANT(y)[0] += MPFR_LIMB_ONE << sh;
+ inexact = 1;
+diff -Naurd mpfr-3.1.0-a/src/get_d.c mpfr-3.1.0-b/src/get_d.c
+--- mpfr-3.1.0-a/src/get_d.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/get_d.c 2012-03-08 15:17:03.000000000 +0000
+@@ -100,7 +100,7 @@
+ nbits += (1021 + e);
+ MPFR_ASSERTD (nbits >= 1);
+ }
+- np = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
++ np = MPFR_PREC2LIMBS (nbits);
+ MPFR_ASSERTD ( np <= MPFR_LIMBS_PER_DOUBLE );
+ carry = mpfr_round_raw_4 (tp, MPFR_MANT(src), MPFR_PREC(src), negative,
+ nbits, rnd_mode);
+diff -Naurd mpfr-3.1.0-a/src/get_flt.c mpfr-3.1.0-b/src/get_flt.c
+--- mpfr-3.1.0-a/src/get_flt.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/get_flt.c 2012-03-08 15:17:03.000000000 +0000
+@@ -92,7 +92,7 @@
+ nbits += (125 + e);
+ MPFR_ASSERTD (nbits >= 1);
+ }
+- np = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
++ np = MPFR_PREC2LIMBS (nbits);
+ MPFR_ASSERTD(np <= MPFR_LIMBS_PER_FLT);
+ carry = mpfr_round_raw_4 (tp, MPFR_MANT(src), MPFR_PREC(src), negative,
+ nbits, rnd_mode);
+diff -Naurd mpfr-3.1.0-a/src/get_str.c mpfr-3.1.0-b/src/get_str.c
+--- mpfr-3.1.0-a/src/get_str.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/get_str.c 2012-03-08 15:17:03.000000000 +0000
+@@ -2351,7 +2351,7 @@
+
+ /* the first digit will contain only r bits */
+ prec = (m - 1) * pow2 + r; /* total number of bits */
+- n = (prec - 1) / GMP_NUMB_BITS + 1;
++ n = MPFR_PREC2LIMBS (prec);
+
+ MPFR_TMP_MARK (marker);
+ x1 = MPFR_TMP_LIMBS_ALLOC (n + 1);
+@@ -2417,12 +2417,12 @@
+ exact = 1;
+
+ /* number of limbs */
+- n = 1 + (prec - 1) / GMP_NUMB_BITS;
++ n = MPFR_PREC2LIMBS (prec);
+
+ /* a will contain the approximation of the mantissa */
+ a = MPFR_TMP_LIMBS_ALLOC (n);
+
+- nx = 1 + (MPFR_PREC(x) - 1) / GMP_NUMB_BITS;
++ nx = MPFR_LIMB_SIZE (x);
+
+ if ((mpfr_exp_t) m == g) /* final exponent is 0, no multiplication or
+ division to perform */
+diff -Naurd mpfr-3.1.0-a/src/init2.c mpfr-3.1.0-b/src/init2.c
+--- mpfr-3.1.0-a/src/init2.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/init2.c 2012-03-08 15:17:03.000000000 +0000
+@@ -51,7 +51,7 @@
+ which both have an odd mantissa */
+ MPFR_ASSERTN(p >= MPFR_PREC_MIN && p <= MPFR_PREC_MAX);
+
+- xsize = (mp_size_t) ((p - 1) / GMP_NUMB_BITS) + 1;
++ xsize = MPFR_PREC2LIMBS (p);
+ tmp = (mpfr_limb_ptr) (*__gmp_allocate_func)(MPFR_MALLOC_SIZE(xsize));
+
+ MPFR_PREC(x) = p; /* Set prec */
+diff -Naurd mpfr-3.1.0-a/src/lngamma.c mpfr-3.1.0-b/src/lngamma.c
+--- mpfr-3.1.0-a/src/lngamma.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/lngamma.c 2012-03-08 15:17:03.000000000 +0000
+@@ -67,7 +67,7 @@
+
+ /* Now, the unit bit is represented. */
+
+- prec = ((prec - 1) / GMP_NUMB_BITS + 1) * GMP_NUMB_BITS - expo;
++ prec = MPFR_PREC2LIMBS (prec) * GMP_NUMB_BITS - expo;
+ /* number of represented fractional bits (including the trailing 0's) */
+
+ x0 = *(MPFR_MANT (x) + prec / GMP_NUMB_BITS);
+diff -Naurd mpfr-3.1.0-a/src/mpfr-impl.h mpfr-3.1.0-b/src/mpfr-impl.h
+--- mpfr-3.1.0-a/src/mpfr-impl.h 2012-02-24 13:50:05.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr-impl.h 2012-03-09 12:06:26.000000000 +0000
+@@ -646,10 +646,24 @@
+ **************** mpfr_t properties *******************
+ ******************************************************/
+
++/* In the following macro, p is usually a mpfr_prec_t, but this macro
++ works with other integer types (without integer overflow). Checking
++ that p >= 1 in debug mode is useful here because this macro can be
++ used on a computed precision (in particular, this formula does not
++ work for a degenerate case p = 0, and could give different results
++ on different platforms). But let us not use an assertion checking
++ in the MPFR_LAST_LIMB() and MPFR_LIMB_SIZE() macros below to avoid
++ too much expansion for assertions (in practice, this should be a
++ problem just when testing MPFR with the --enable-assert configure
++ option and the -ansi -pedantic-errors gcc compiler flags). */
++#define MPFR_PREC2LIMBS(p) \
++ (MPFR_ASSERTD ((p) >= 1), ((p) - 1) / GMP_NUMB_BITS + 1)
++
+ #define MPFR_PREC(x) ((x)->_mpfr_prec)
+ #define MPFR_EXP(x) ((x)->_mpfr_exp)
+ #define MPFR_MANT(x) ((x)->_mpfr_d)
+-#define MPFR_LIMB_SIZE(x) ((MPFR_PREC((x))-1)/GMP_NUMB_BITS+1)
++#define MPFR_LAST_LIMB(x) ((MPFR_PREC (x) - 1) / GMP_NUMB_BITS)
++#define MPFR_LIMB_SIZE(x) (MPFR_LAST_LIMB (x) + 1)
+
+
+ /******************************************************
+@@ -749,7 +763,8 @@
+ #define MPFR_IS_FP(x) (!MPFR_IS_NAN(x) && !MPFR_IS_INF(x))
+ #define MPFR_IS_SINGULAR(x) (MPFR_EXP(x) <= MPFR_EXP_INF)
+ #define MPFR_IS_PURE_FP(x) (!MPFR_IS_SINGULAR(x) && \
+- (MPFR_ASSERTD (MPFR_MANT(x)[MPFR_LIMB_SIZE(x)-1] & MPFR_LIMB_HIGHBIT), 1))
++ (MPFR_ASSERTD ((MPFR_MANT(x)[MPFR_LAST_LIMB(x)] \
++ & MPFR_LIMB_HIGHBIT) != 0), 1))
+
+ #define MPFR_ARE_SINGULAR(x,y) \
+ (MPFR_UNLIKELY(MPFR_IS_SINGULAR(x)) || MPFR_UNLIKELY(MPFR_IS_SINGULAR(y)))
+@@ -1061,7 +1076,7 @@
+ /* Set a number to 1 (Fast) - It doesn't check if 1 is in the exponent range */
+ #define MPFR_SET_ONE(x) \
+ do { \
+- mp_size_t _size = MPFR_LIMB_SIZE(x) - 1; \
++ mp_size_t _size = MPFR_LAST_LIMB(x); \
+ MPFR_SET_POS(x); \
+ MPFR_EXP(x) = 1; \
+ MPN_ZERO ( MPFR_MANT(x), _size); \
+@@ -1213,8 +1228,8 @@
+ _destp = MPFR_MANT (dest); \
+ if (MPFR_UNLIKELY (_destprec >= _srcprec)) \
+ { \
+- _srcs = (_srcprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \
+- _dests = (_destprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS - _srcs; \
++ _srcs = MPFR_PREC2LIMBS (_srcprec); \
++ _dests = MPFR_PREC2LIMBS (_destprec) - _srcs; \
+ MPN_COPY (_destp + _dests, srcp, _srcs); \
+ MPN_ZERO (_destp, _dests); \
+ inexact = 0; \
+@@ -1227,8 +1242,8 @@
+ mp_limb_t _rb, _sb, _ulp; \
+ \
+ /* Compute Position and shift */ \
+- _srcs = (_srcprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \
+- _dests = (_destprec + GMP_NUMB_BITS-1)/GMP_NUMB_BITS; \
++ _srcs = MPFR_PREC2LIMBS (_srcprec); \
++ _dests = MPFR_PREC2LIMBS (_destprec); \
+ MPFR_UNSIGNED_MINUS_MODULO (_sh, _destprec); \
+ _sp = (srcp) + _srcs - _dests; \
+ \
+@@ -1372,7 +1387,7 @@
+ if (MPFR_LIKELY (MPFR_PREC (dest) == MPFR_PREC (src))) \
+ { \
+ MPN_COPY (MPFR_MANT (dest), MPFR_MANT (src), \
+- (MPFR_PREC (src) + GMP_NUMB_BITS-1)/GMP_NUMB_BITS); \
++ MPFR_LIMB_SIZE (src)); \
+ inexact = 0; \
+ } \
+ else \
+@@ -1682,7 +1697,7 @@
+ MPFR_ASSERTD (_prec >= MPFR_PREC_MIN); \
+ if (MPFR_UNLIKELY (_prec > MPFR_PREC_MAX)) \
+ mpfr_abort_prec_max (); \
+- _size = (mpfr_prec_t) (_prec + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS; \
++ _size = MPFR_PREC2LIMBS (_prec); \
+ if (MPFR_UNLIKELY (_size * (num) > MPFR_GROUP_STATIC_SIZE)) \
+ { \
+ (g).alloc = (num) * _size * sizeof (mp_limb_t); \
+@@ -1733,7 +1748,7 @@
+ MPFR_ASSERTD (_prec >= MPFR_PREC_MIN); \
+ if (MPFR_UNLIKELY (_prec > MPFR_PREC_MAX)) \
+ mpfr_abort_prec_max (); \
+- _size = (mpfr_prec_t) (_prec + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS; \
++ _size = MPFR_PREC2LIMBS (_prec); \
+ (g).alloc = (num) * _size * sizeof (mp_limb_t); \
+ if (MPFR_LIKELY (_oalloc == 0)) \
+ (g).mant = (mp_limb_t *) (*__gmp_allocate_func) ((g).alloc); \
+@@ -1886,7 +1901,7 @@
+ MPFR_NORETURN_ATTR;
+
+ __MPFR_DECLSPEC void mpfr_rand_raw _MPFR_PROTO((mpfr_limb_ptr, gmp_randstate_t,
+- unsigned long));
++ mpfr_prec_t));
+
+ __MPFR_DECLSPEC mpz_t* mpfr_bernoulli_internal _MPFR_PROTO((mpz_t*,
+ unsigned long));
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2012-02-24 13:50:05.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2012-03-08 15:17:03.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p6"
++#define MPFR_VERSION_STRING "3.1.0-p7"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/mul.c mpfr-3.1.0-b/src/mul.c
+--- mpfr-3.1.0-a/src/mul.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/mul.c 2012-03-08 15:17:03.000000000 +0000
+@@ -93,15 +93,15 @@
+
+ ax = MPFR_GET_EXP (b) + MPFR_GET_EXP (c);
+
+- bq = MPFR_PREC(b);
+- cq = MPFR_PREC(c);
++ bq = MPFR_PREC (b);
++ cq = MPFR_PREC (c);
+
+- MPFR_ASSERTD(bq+cq > bq); /* PREC_MAX is /2 so no integer overflow */
++ MPFR_ASSERTN ((mpfr_uprec_t) bq + cq <= MPFR_PREC_MAX);
+
+- bn = (bq+GMP_NUMB_BITS-1)/GMP_NUMB_BITS; /* number of limbs of b */
+- cn = (cq+GMP_NUMB_BITS-1)/GMP_NUMB_BITS; /* number of limbs of c */
++ bn = MPFR_PREC2LIMBS (bq); /* number of limbs of b */
++ cn = MPFR_PREC2LIMBS (cq); /* number of limbs of c */
+ k = bn + cn; /* effective nb of limbs used by b*c (= tn or tn+1) below */
+- tn = (bq + cq + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
++ tn = MPFR_PREC2LIMBS (bq + cq);
+ /* <= k, thus no int overflow */
+ MPFR_ASSERTD(tn <= k);
+
+@@ -292,12 +292,12 @@
+ bq = MPFR_PREC (b);
+ cq = MPFR_PREC (c);
+
+- MPFR_ASSERTD (bq+cq > bq); /* PREC_MAX is /2 so no integer overflow */
++ MPFR_ASSERTN ((mpfr_uprec_t) bq + cq <= MPFR_PREC_MAX);
+
+- bn = (bq+GMP_NUMB_BITS-1)/GMP_NUMB_BITS; /* number of limbs of b */
+- cn = (cq+GMP_NUMB_BITS-1)/GMP_NUMB_BITS; /* number of limbs of c */
++ bn = MPFR_PREC2LIMBS (bq); /* number of limbs of b */
++ cn = MPFR_PREC2LIMBS (cq); /* number of limbs of c */
+ k = bn + cn; /* effective nb of limbs used by b*c (= tn or tn+1) below */
+- tn = (bq + cq + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
++ tn = MPFR_PREC2LIMBS (bq + cq);
+ MPFR_ASSERTD (tn <= k); /* tn <= k, thus no int overflow */
+
+ /* Check for no size_t overflow*/
+diff -Naurd mpfr-3.1.0-a/src/pow.c mpfr-3.1.0-b/src/pow.c
+--- mpfr-3.1.0-a/src/pow.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/pow.c 2012-03-08 15:17:03.000000000 +0000
+@@ -136,7 +136,7 @@
+ (b) all the 'z' bits are zero
+ */
+
+- prec = ((prec - 1) / GMP_NUMB_BITS + 1) * GMP_NUMB_BITS - expo;
++ prec = MPFR_PREC2LIMBS (prec) * GMP_NUMB_BITS - expo;
+ /* number of z+0 bits */
+
+ yn = prec / GMP_NUMB_BITS;
+diff -Naurd mpfr-3.1.0-a/src/print_raw.c mpfr-3.1.0-b/src/print_raw.c
+--- mpfr-3.1.0-a/src/print_raw.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/print_raw.c 2012-03-08 15:17:03.000000000 +0000
+@@ -84,7 +84,7 @@
+ int i;
+ mpfr_prec_t count = 0;
+ char c;
+- mp_size_t n = (r - 1) / GMP_NUMB_BITS + 1;
++ mp_size_t n = MPFR_PREC2LIMBS (r);
+
+ printf("%s ", str);
+ for(n-- ; n>=0 ; n--)
+@@ -109,7 +109,7 @@
+ int i;
+ mpfr_prec_t count = 0;
+ char c;
+- mp_size_t n = (r - 1) / GMP_NUMB_BITS + 1;
++ mp_size_t n = MPFR_PREC2LIMBS (r);
+
+ for(n-- ; n>=0 ; n--)
+ {
+diff -Naurd mpfr-3.1.0-a/src/round_prec.c mpfr-3.1.0-b/src/round_prec.c
+--- mpfr-3.1.0-a/src/round_prec.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/round_prec.c 2012-03-08 15:17:03.000000000 +0000
+@@ -55,12 +55,12 @@
+
+ MPFR_ASSERTN(prec >= MPFR_PREC_MIN && prec <= MPFR_PREC_MAX);
+
+- nw = 1 + (prec - 1) / GMP_NUMB_BITS; /* needed allocated limbs */
++ nw = MPFR_PREC2LIMBS (prec); /* needed allocated limbs */
+
+ /* check if x has enough allocated space for the significand */
+ /* Get the number of limbs from the precision.
+ (Compatible with all allocation methods) */
+- ow = (MPFR_PREC (x) + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
++ ow = MPFR_LIMB_SIZE (x);
+ if (nw > ow)
+ {
+ /* FIXME: Variable can't be created using custom allocation,
+diff -Naurd mpfr-3.1.0-a/src/round_raw_generic.c mpfr-3.1.0-b/src/round_raw_generic.c
+--- mpfr-3.1.0-a/src/round_raw_generic.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/round_raw_generic.c 2012-03-08 15:17:03.000000000 +0000
+@@ -80,7 +80,7 @@
+ (xprec <= yprec || MPFR_IS_LIKE_RNDZ (rnd_mode, neg)))
+ return 0;
+
+- xsize = (xprec-1)/GMP_NUMB_BITS + 1;
++ xsize = MPFR_PREC2LIMBS (xprec);
+ nw = yprec / GMP_NUMB_BITS;
+ rw = yprec & (GMP_NUMB_BITS - 1);
+
+diff -Naurd mpfr-3.1.0-a/src/set.c mpfr-3.1.0-b/src/set.c
+--- mpfr-3.1.0-a/src/set.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/set.c 2012-03-08 15:17:03.000000000 +0000
+@@ -48,8 +48,7 @@
+ /* Same precision and b is not singular:
+ * just copy the mantissa, and set the exponent and the sign
+ * The result is exact. */
+- MPN_COPY (MPFR_MANT (a), MPFR_MANT (b),
+- (MPFR_PREC (b) + GMP_NUMB_BITS-1)/GMP_NUMB_BITS);
++ MPN_COPY (MPFR_MANT (a), MPFR_MANT (b), MPFR_LIMB_SIZE (b));
+ MPFR_RET (0);
+ }
+ else
+diff -Naurd mpfr-3.1.0-a/src/set_f.c mpfr-3.1.0-b/src/set_f.c
+--- mpfr-3.1.0-a/src/set_f.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/set_f.c 2012-03-08 15:17:03.000000000 +0000
+@@ -43,7 +43,7 @@
+ if (SIZ(x) * MPFR_FROM_SIGN_TO_INT(MPFR_SIGN(y)) < 0)
+ MPFR_CHANGE_SIGN (y);
+
+- sy = 1 + (MPFR_PREC(y) - 1) / GMP_NUMB_BITS;
++ sy = MPFR_LIMB_SIZE (y);
+ my = MPFR_MANT(y);
+ mx = PTR(x);
+
+diff -Naurd mpfr-3.1.0-a/src/set_prec.c mpfr-3.1.0-b/src/set_prec.c
+--- mpfr-3.1.0-a/src/set_prec.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/set_prec.c 2012-03-08 15:17:03.000000000 +0000
+@@ -32,7 +32,7 @@
+ MPFR_ASSERTN (p >= MPFR_PREC_MIN && p <= MPFR_PREC_MAX);
+
+ /* Calculate the new number of limbs */
+- xsize = (p - 1) / GMP_NUMB_BITS + 1;
++ xsize = MPFR_PREC2LIMBS (p);
+
+ /* Realloc only if the new size is greater than the old */
+ xoldsize = MPFR_GET_ALLOC_SIZE (x);
+diff -Naurd mpfr-3.1.0-a/src/setmax.c mpfr-3.1.0-b/src/setmax.c
+--- mpfr-3.1.0-a/src/setmax.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/setmax.c 2012-03-08 15:17:03.000000000 +0000
+@@ -32,7 +32,7 @@
+ mp_limb_t *xp;
+
+ MPFR_SET_EXP (x, e);
+- xn = 1 + (MPFR_PREC(x) - 1) / GMP_NUMB_BITS;
++ xn = MPFR_LIMB_SIZE (x);
+ sh = (mpfr_prec_t) xn * GMP_NUMB_BITS - MPFR_PREC(x);
+ xp = MPFR_MANT(x);
+ xp[0] = MP_LIMB_T_MAX << sh;
+diff -Naurd mpfr-3.1.0-a/src/sqr.c mpfr-3.1.0-b/src/sqr.c
+--- mpfr-3.1.0-a/src/sqr.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/sqr.c 2012-03-08 15:17:03.000000000 +0000
+@@ -56,11 +56,11 @@
+ ax = 2 * MPFR_GET_EXP (b);
+ bq = MPFR_PREC(b);
+
+- MPFR_ASSERTD (2 * bq > bq); /* PREC_MAX is /2 so no integer overflow */
++ MPFR_ASSERTN (2 * (mpfr_uprec_t) bq <= MPFR_PREC_MAX);
+
+- bn = MPFR_LIMB_SIZE(b); /* number of limbs of b */
+- tn = 1 + (2 * bq - 1) / GMP_NUMB_BITS; /* number of limbs of square,
+- 2*bn or 2*bn-1 */
++ bn = MPFR_LIMB_SIZE (b); /* number of limbs of b */
++ tn = MPFR_PREC2LIMBS (2 * bq); /* number of limbs of square,
++ 2*bn or 2*bn-1 */
+
+ if (MPFR_UNLIKELY(bn > MPFR_SQR_THRESHOLD))
+ return mpfr_mul (a, b, b, rnd_mode);
+diff -Naurd mpfr-3.1.0-a/src/stack_interface.c mpfr-3.1.0-b/src/stack_interface.c
+--- mpfr-3.1.0-a/src/stack_interface.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/stack_interface.c 2012-03-08 15:17:03.000000000 +0000
+@@ -26,7 +26,7 @@
+ size_t
+ mpfr_custom_get_size (mpfr_prec_t prec)
+ {
+- return (prec + GMP_NUMB_BITS -1) / GMP_NUMB_BITS * BYTES_PER_MP_LIMB;
++ return MPFR_PREC2LIMBS (prec) * BYTES_PER_MP_LIMB;
+ }
+
+ #undef mpfr_custom_init
+diff -Naurd mpfr-3.1.0-a/src/strtofr.c mpfr-3.1.0-b/src/strtofr.c
+--- mpfr-3.1.0-a/src/strtofr.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/strtofr.c 2012-03-08 15:17:03.000000000 +0000
+@@ -467,7 +467,7 @@
+ /* Set y to the value of the ~prec most significant bits of pstr->mant
+ (as long as we guarantee correct rounding, we don't need to get
+ exactly prec bits). */
+- ysize = (prec - 1) / GMP_NUMB_BITS + 1;
++ ysize = MPFR_PREC2LIMBS (prec);
+ /* prec bits corresponds to ysize limbs */
+ ysize_bits = ysize * GMP_NUMB_BITS;
+ /* and to ysize_bits >= prec > MPFR_PREC (x) bits */
+diff -Naurd mpfr-3.1.0-a/src/sub1sp.c mpfr-3.1.0-b/src/sub1sp.c
+--- mpfr-3.1.0-a/src/sub1sp.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/sub1sp.c 2012-03-08 15:17:03.000000000 +0000
+@@ -155,8 +155,8 @@
+ MPFR_ASSERTD(MPFR_IS_PURE_FP(c));
+
+ /* Read prec and num of limbs */
+- p = MPFR_PREC(b);
+- n = (p-1)/GMP_NUMB_BITS+1;
++ p = MPFR_PREC (b);
++ n = MPFR_PREC2LIMBS (p);
+
+ /* Fast cmp of |b| and |c|*/
+ bx = MPFR_GET_EXP (b);
+diff -Naurd mpfr-3.1.0-a/src/urandomb.c mpfr-3.1.0-b/src/urandomb.c
+--- mpfr-3.1.0-a/src/urandomb.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/urandomb.c 2012-03-08 15:17:03.000000000 +0000
+@@ -31,13 +31,20 @@
+ a sufficient number of limbs */
+ void
+ mpfr_rand_raw (mpfr_limb_ptr mp, gmp_randstate_t rstate,
+- unsigned long int nbits)
++ mpfr_prec_t nbits)
+ {
+ mpz_t z;
+
++ MPFR_ASSERTN (nbits >= 1);
+ /* To be sure to avoid the potential allocation of mpz_urandomb */
+- ALLOC(z) = SIZ(z) = ((nbits - 1) / GMP_NUMB_BITS) + 1;
++ ALLOC(z) = SIZ(z) = MPFR_PREC2LIMBS (nbits);
+ PTR(z) = mp;
++#if __MPFR_GMP(5,0,0)
++ /* Check for integer overflow (unless mp_bitcnt_t is signed,
++ but according to the GMP manual, this shouldn't happen).
++ Note: mp_bitcnt_t has been introduced in GMP 5.0.0. */
++ MPFR_ASSERTN ((mp_bitcnt_t) -1 < 0 || nbits <= (mp_bitcnt_t) -1);
++#endif
+ mpz_urandomb (z, rstate, nbits);
+ }
+
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2012-02-24 13:50:05.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2012-03-08 15:17:03.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p6";
++ return "3.1.0-p7";
+ }
+diff -Naurd mpfr-3.1.0-a/tests/tinits.c mpfr-3.1.0-b/tests/tinits.c
+--- mpfr-3.1.0-a/tests/tinits.c 2011-10-03 08:17:14.000000000 +0000
++++ mpfr-3.1.0-b/tests/tinits.c 2012-03-08 15:17:03.000000000 +0000
+@@ -1,4 +1,4 @@
+-/* Test file for mpfr_inits, mpfr_inits2 and mpfr_clears.
++/* Test file for mpfr_init2, mpfr_inits, mpfr_inits2 and mpfr_clears.
+
+ Copyright 2003, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Contributed by the Arenaire and Caramel projects, INRIA.
+@@ -20,18 +20,43 @@
+ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
++#include <stdlib.h>
++
+ #include "mpfr-test.h"
+
+ int
+ main (void)
+ {
+ mpfr_t a, b, c;
++ long large_prec;
+
+ tests_start_mpfr ();
++
+ mpfr_inits (a, b, c, (mpfr_ptr) 0);
+ mpfr_clears (a, b, c, (mpfr_ptr) 0);
+ mpfr_inits2 (200, a, b, c, (mpfr_ptr) 0);
+ mpfr_clears (a, b, c, (mpfr_ptr) 0);
++
++ /* test for precision 2^31-1, see
++ https://gforge.inria.fr/tracker/index.php?func=detail&aid=13918 */
++ large_prec = 2147483647;
++ if (getenv ("MPFR_CHECK_LARGEMEM") != NULL)
++ {
++ /* We assume that the precision won't be increased internally. */
++ if (large_prec > MPFR_PREC_MAX)
++ large_prec = MPFR_PREC_MAX;
++ mpfr_inits2 (large_prec, a, b, (mpfr_ptr) 0);
++ mpfr_set_ui (a, 17, MPFR_RNDN);
++ mpfr_set (b, a, MPFR_RNDN);
++ if (mpfr_get_ui (a, MPFR_RNDN) != 17)
++ {
++ printf ("Error in mpfr_init2 with precision 2^31-1\n");
++ exit (1);
++ }
++ mpfr_clears (a, b, (mpfr_ptr) 0);
++ }
++
+ tests_end_mpfr ();
++
+ return 0;
+ }
diff --git a/patches/mpfr/3.1.0/180-__gmp_const.patch b/patches/mpfr/3.1.0/180-__gmp_const.patch
new file mode 100644
index 0000000..94444b6
--- /dev/null
+++ b/patches/mpfr/3.1.0/180-__gmp_const.patch
@@ -0,0 +1,52 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2012-03-12 11:59:47.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2012-03-12 11:59:47.000000000 +0000
+@@ -0,0 +1 @@
++__gmp_const
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2012-03-08 15:17:03.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2012-03-12 11:59:47.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p7
++3.1.0-p8
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2012-03-08 15:17:03.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2012-03-12 11:59:47.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p7"
++#define MPFR_VERSION_STRING "3.1.0-p8"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+@@ -39,6 +39,18 @@
+ # include <gmp.h>
+ #endif
+
++/* GMP's internal __gmp_const macro has been removed on 2012-03-04:
++ http://gmplib.org:8000/gmp/rev/d287cfaf6732
++ const is standard and now assumed to be available. If the __gmp_const
++ definition is no longer present in GMP, this probably means that GMP
++ assumes that const is available; thus let's define it to const.
++ Note: this is a temporary fix that can be backported to previous MPFR
++ versions. In the future, __gmp_const should be replaced by const like
++ in GMP. */
++#ifndef __gmp_const
++# define __gmp_const const
++#endif
++
+ /* Avoid some problems with macro expansion if the user defines macros
+ with the same name as keywords. By convention, identifiers and macro
+ names starting with mpfr_ are reserved by MPFR. */
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2012-03-08 15:17:03.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2012-03-12 11:59:47.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p7";
++ return "3.1.0-p8";
+ }
diff --git a/patches/mpfr/3.1.0/190-gamma-underflow.patch b/patches/mpfr/3.1.0/190-gamma-underflow.patch
new file mode 100644
index 0000000..3de1d19
--- /dev/null
+++ b/patches/mpfr/3.1.0/190-gamma-underflow.patch
@@ -0,0 +1,93 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2012-04-27 01:13:15.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2012-04-27 01:13:15.000000000 +0000
+@@ -0,0 +1 @@
++gamma-underflow
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2012-03-12 11:59:47.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2012-04-27 01:13:15.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p8
++3.1.0-p9
+diff -Naurd mpfr-3.1.0-a/src/gamma.c mpfr-3.1.0-b/src/gamma.c
+--- mpfr-3.1.0-a/src/gamma.c 2011-10-03 08:17:09.000000000 +0000
++++ mpfr-3.1.0-b/src/gamma.c 2012-04-27 01:13:15.000000000 +0000
+@@ -296,7 +296,7 @@
+ /* we want an upper bound for x * [log(2-x)-1].
+ since x < 0, we need a lower bound on log(2-x) */
+ mpfr_ui_sub (xp, 2, x, MPFR_RNDD);
+- mpfr_log2 (xp, xp, MPFR_RNDD);
++ mpfr_log (xp, xp, MPFR_RNDD);
+ mpfr_sub_ui (xp, xp, 1, MPFR_RNDD);
+ mpfr_mul (xp, xp, x, MPFR_RNDU);
+
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2012-03-12 11:59:47.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2012-04-27 01:13:15.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p8"
++#define MPFR_VERSION_STRING "3.1.0-p9"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2012-03-12 11:59:47.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2012-04-27 01:13:15.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p8";
++ return "3.1.0-p9";
+ }
+diff -Naurd mpfr-3.1.0-a/tests/tgamma.c mpfr-3.1.0-b/tests/tgamma.c
+--- mpfr-3.1.0-a/tests/tgamma.c 2011-10-03 08:17:14.000000000 +0000
++++ mpfr-3.1.0-b/tests/tgamma.c 2012-04-27 01:13:15.000000000 +0000
+@@ -478,6 +478,36 @@
+ mpfr_clear (x);
+ }
+
++/* bug found by Giridhar Tammana */
++static void
++test20120426 (void)
++{
++ mpfr_t xa, xb;
++ int i;
++ mpfr_exp_t emin;
++
++ mpfr_init2 (xa, 53);
++ mpfr_init2 (xb, 53);
++ mpfr_set_d (xb, -168.5, MPFR_RNDN);
++ emin = mpfr_get_emin ();
++ mpfr_set_emin (-1073);
++ i = mpfr_gamma (xa, xb, MPFR_RNDN);
++ i = mpfr_subnormalize (xa, i, MPFR_RNDN); /* new ternary value */
++ mpfr_set_str (xb, "-9.5737343987585366746184749943e-304", 10, MPFR_RNDN);
++ if (!((i > 0) && (mpfr_cmp (xa, xb) == 0)))
++ {
++ printf ("Error in test20120426, i=%d\n", i);
++ printf ("expected ");
++ mpfr_print_binary (xb); putchar ('\n');
++ printf ("got ");
++ mpfr_print_binary (xa); putchar ('\n');
++ exit (1);
++ }
++ mpfr_set_emin (emin);
++ mpfr_clear (xa);
++ mpfr_clear (xb);
++}
++
+ static void
+ exprange (void)
+ {
+@@ -821,6 +851,7 @@
+ gamma_integer ();
+ test20071231 ();
+ test20100709 ();
++ test20120426 ();
+
+ data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
+
diff --git a/patches/mpfr/3.1.0/200-gamma-overunderflow.patch b/patches/mpfr/3.1.0/200-gamma-overunderflow.patch
new file mode 100644
index 0000000..e6d6051
--- /dev/null
+++ b/patches/mpfr/3.1.0/200-gamma-overunderflow.patch
@@ -0,0 +1,487 @@
+diff -Naurd mpfr-3.1.0-a/PATCHES mpfr-3.1.0-b/PATCHES
+--- mpfr-3.1.0-a/PATCHES 2012-05-07 18:52:45.000000000 +0000
++++ mpfr-3.1.0-b/PATCHES 2012-05-07 18:52:45.000000000 +0000
+@@ -0,0 +1 @@
++gamma-overunderflow
+diff -Naurd mpfr-3.1.0-a/VERSION mpfr-3.1.0-b/VERSION
+--- mpfr-3.1.0-a/VERSION 2012-04-27 01:13:15.000000000 +0000
++++ mpfr-3.1.0-b/VERSION 2012-05-07 18:52:45.000000000 +0000
+@@ -1 +1 @@
+-3.1.0-p9
++3.1.0-p10
+diff -Naurd mpfr-3.1.0-a/src/gamma.c mpfr-3.1.0-b/src/gamma.c
+--- mpfr-3.1.0-a/src/gamma.c 2012-04-27 01:13:15.000000000 +0000
++++ mpfr-3.1.0-b/src/gamma.c 2012-05-07 18:52:45.000000000 +0000
+@@ -100,7 +100,8 @@
+ mpfr_t xp, GammaTrial, tmp, tmp2;
+ mpz_t fact;
+ mpfr_prec_t realprec;
+- int compared, inex, is_integer;
++ int compared, is_integer;
++ int inex = 0; /* 0 means: result gamma not set yet */
+ MPFR_GROUP_DECL (group);
+ MPFR_SAVE_EXPO_DECL (expo);
+ MPFR_ZIV_DECL (loop);
+@@ -377,6 +378,15 @@
+ mpfr_mul (GammaTrial, tmp2, xp, MPFR_RNDN); /* Pi*(2-x), error (1+u)^2 */
+ err_g = MPFR_GET_EXP(GammaTrial);
+ mpfr_sin (GammaTrial, GammaTrial, MPFR_RNDN); /* sin(Pi*(2-x)) */
++ /* If tmp is +Inf, we compute exp(lngamma(x)). */
++ if (mpfr_inf_p (tmp))
++ {
++ inex = mpfr_explgamma (gamma, x, &expo, tmp, tmp2, rnd_mode);
++ if (inex)
++ goto end;
++ else
++ goto ziv_next;
++ }
+ err_g = err_g + 1 - MPFR_GET_EXP(GammaTrial);
+ /* let g0 the true value of Pi*(2-x), g the computed value.
+ We have g = g0 + h with |h| <= |(1+u^2)-1|*g.
+@@ -411,11 +421,16 @@
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (GammaTrial, realprec - err_g,
+ MPFR_PREC(gamma), rnd_mode)))
+ break;
++
++ ziv_next:
+ MPFR_ZIV_NEXT (loop, realprec);
+ }
++
++ end:
+ MPFR_ZIV_FREE (loop);
+
+- inex = mpfr_set (gamma, GammaTrial, rnd_mode);
++ if (inex == 0)
++ inex = mpfr_set (gamma, GammaTrial, rnd_mode);
+ MPFR_GROUP_CLEAR (group);
+ mpz_clear (fact);
+
+diff -Naurd mpfr-3.1.0-a/src/lngamma.c mpfr-3.1.0-b/src/lngamma.c
+--- mpfr-3.1.0-a/src/lngamma.c 2012-03-08 15:17:03.000000000 +0000
++++ mpfr-3.1.0-b/src/lngamma.c 2012-05-07 18:52:45.000000000 +0000
+@@ -49,9 +49,72 @@
+ mpfr_set_ui_2exp (s, 9, -1, MPFR_RNDN); /* 4.5 */
+ }
+
+-#ifndef IS_GAMMA
++#ifdef IS_GAMMA
++
++/* This function is called in case of intermediate overflow/underflow.
++ The s1 and s2 arguments are temporary MPFR numbers, having the
++ working precision. If the result could be determined, then the
++ flags are updated via pexpo, y is set to the result, and the
++ (non-zero) ternary value is returned. Otherwise 0 is returned
++ in order to perform the next Ziv iteration. */
+ static int
+-unit_bit (mpfr_srcptr (x))
++mpfr_explgamma (mpfr_ptr y, mpfr_srcptr x, mpfr_save_expo_t *pexpo,
++ mpfr_ptr s1, mpfr_ptr s2, mpfr_rnd_t rnd)
++{
++ mpfr_t t1, t2;
++ int inex1, inex2, sign;
++ MPFR_BLOCK_DECL (flags1);
++ MPFR_BLOCK_DECL (flags2);
++ MPFR_GROUP_DECL (group);
++
++ MPFR_BLOCK (flags1, inex1 = mpfr_lgamma (s1, &sign, x, MPFR_RNDD));
++ MPFR_ASSERTN (inex1 != 0);
++ /* s1 = RNDD(lngamma(x)), inexact */
++ if (MPFR_UNLIKELY (MPFR_OVERFLOW (flags1)))
++ {
++ if (MPFR_SIGN (s1) > 0)
++ {
++ MPFR_SAVE_EXPO_UPDATE_FLAGS (*pexpo, MPFR_FLAGS_OVERFLOW);
++ return mpfr_overflow (y, rnd, sign);
++ }
++ else
++ {
++ MPFR_SAVE_EXPO_UPDATE_FLAGS (*pexpo, MPFR_FLAGS_UNDERFLOW);
++ return mpfr_underflow (y, rnd == MPFR_RNDN ? MPFR_RNDZ : rnd, sign);
++ }
++ }
++
++ mpfr_set (s2, s1, MPFR_RNDN); /* exact */
++ mpfr_nextabove (s2); /* v = RNDU(lngamma(z0)) */
++
++ if (sign < 0)
++ rnd = MPFR_INVERT_RND (rnd); /* since the result with be negated */
++ MPFR_GROUP_INIT_2 (group, MPFR_PREC (y), t1, t2);
++ MPFR_BLOCK (flags1, inex1 = mpfr_exp (t1, s1, rnd));
++ MPFR_BLOCK (flags2, inex2 = mpfr_exp (t2, s2, rnd));
++ /* t1 is the rounding with mode 'rnd' of a lower bound on |Gamma(x)|,
++ t2 is the rounding with mode 'rnd' of an upper bound, thus if both
++ are equal, so is the wanted result. If t1 and t2 differ or the flags
++ differ, at some point of Ziv's loop they should agree. */
++ if (mpfr_equal_p (t1, t2) && flags1 == flags2)
++ {
++ MPFR_ASSERTN ((inex1 > 0 && inex2 > 0) || (inex1 < 0 && inex2 < 0));
++ mpfr_set4 (y, t1, MPFR_RNDN, sign); /* exact */
++ if (sign < 0)
++ inex1 = - inex1;
++ MPFR_SAVE_EXPO_UPDATE_FLAGS (*pexpo, flags1);
++ }
++ else
++ inex1 = 0; /* couldn't determine the result */
++ MPFR_GROUP_CLEAR (group);
++
++ return inex1;
++}
++
++#else
++
++static int
++unit_bit (mpfr_srcptr x)
+ {
+ mpfr_exp_t expo;
+ mpfr_prec_t prec;
+@@ -75,6 +138,7 @@
+
+ return (x0 >> (prec % GMP_NUMB_BITS)) & 1;
+ }
++
+ #endif
+
+ /* lngamma(x) = log(gamma(x)).
+@@ -99,12 +163,14 @@
+ mpfr_t s, t, u, v, z;
+ unsigned long m, k, maxm;
+ mpz_t *INITIALIZED(B); /* variable B declared as initialized */
+- int inexact, compared;
++ int compared;
++ int inexact = 0; /* 0 means: result y not set yet */
+ mpfr_exp_t err_s, err_t;
+ unsigned long Bm = 0; /* number of allocated B[] */
+ unsigned long oldBm;
+ double d;
+ MPFR_SAVE_EXPO_DECL (expo);
++ MPFR_ZIV_DECL (loop);
+
+ compared = mpfr_cmp_ui (z0, 1);
+
+@@ -122,7 +188,7 @@
+ if (MPFR_EXP(z0) <= - (mpfr_exp_t) MPFR_PREC(y))
+ {
+ mpfr_t l, h, g;
+- int ok, inex2;
++ int ok, inex1, inex2;
+ mpfr_prec_t prec = MPFR_PREC(y) + 14;
+ MPFR_ZIV_DECL (loop);
+
+@@ -157,14 +223,14 @@
+ mpfr_sub (h, h, g, MPFR_RNDD);
+ mpfr_mul (g, z0, z0, MPFR_RNDU);
+ mpfr_add (h, h, g, MPFR_RNDU);
+- inexact = mpfr_prec_round (l, MPFR_PREC(y), rnd);
++ inex1 = mpfr_prec_round (l, MPFR_PREC(y), rnd);
+ inex2 = mpfr_prec_round (h, MPFR_PREC(y), rnd);
+ /* Caution: we not only need l = h, but both inexact flags should
+ agree. Indeed, one of the inexact flags might be zero. In that
+ case if we assume lngamma(z0) cannot be exact, the other flag
+ should be correct. We are conservative here and request that both
+ inexact flags agree. */
+- ok = SAME_SIGN (inexact, inex2) && mpfr_cmp (l, h) == 0;
++ ok = SAME_SIGN (inex1, inex2) && mpfr_cmp (l, h) == 0;
+ if (ok)
+ mpfr_set (y, h, rnd); /* exact */
+ mpfr_clear (l);
+@@ -172,8 +238,9 @@
+ mpfr_clear (g);
+ if (ok)
+ {
++ MPFR_ZIV_FREE (loop);
+ MPFR_SAVE_EXPO_FREE (expo);
+- return mpfr_check_range (y, inexact, rnd);
++ return mpfr_check_range (y, inex1, rnd);
+ }
+ /* since we have log|gamma(x)| = - log|x| - gamma*x + O(x^2),
+ if x ~ 2^(-n), then we have a n-bit approximation, thus
+@@ -205,9 +272,10 @@
+ thus lngamma(x) = log(Pi*(x-1)/sin(Pi*(2-x))) - lngamma(2-x) */
+
+ w = precy + MPFR_INT_CEIL_LOG2 (precy);
++ w += MPFR_INT_CEIL_LOG2 (w) + 14;
++ MPFR_ZIV_INIT (loop, w);
+ while (1)
+ {
+- w += MPFR_INT_CEIL_LOG2 (w) + 14;
+ MPFR_ASSERTD(w >= 3);
+ mpfr_set_prec (s, w);
+ mpfr_set_prec (t, w);
+@@ -288,7 +356,9 @@
+ + (rnd == MPFR_RNDN)))
+ goto end;
+ }
++ MPFR_ZIV_NEXT (loop, w);
+ }
++ MPFR_ZIV_FREE (loop);
+ }
+
+ /* now z0 > 1 */
+@@ -298,10 +368,10 @@
+ /* since k is O(w), the value of log(z0*...*(z0+k-1)) is about w*log(w),
+ so there is a cancellation of ~log(w) in the argument reconstruction */
+ w = precy + MPFR_INT_CEIL_LOG2 (precy);
+-
+- do
++ w += MPFR_INT_CEIL_LOG2 (w) + 13;
++ MPFR_ZIV_INIT (loop, w);
++ while (1)
+ {
+- w += MPFR_INT_CEIL_LOG2 (w) + 13;
+ MPFR_ASSERTD (w >= 3);
+
+ /* argument reduction: we compute gamma(z0 + k), where the series
+@@ -441,6 +511,15 @@
+ #ifdef IS_GAMMA
+ err_s = MPFR_GET_EXP(s);
+ mpfr_exp (s, s, MPFR_RNDN);
++ /* If s is +Inf, we compute exp(lngamma(z0)). */
++ if (mpfr_inf_p (s))
++ {
++ inexact = mpfr_explgamma (y, z0, &expo, s, t, rnd);
++ if (inexact)
++ goto end0;
++ else
++ goto ziv_next;
++ }
+ /* before the exponential, we have s = s0 + h where
+ |h| <= (2m+48)*ulp(s), thus exp(s0) = exp(s) * exp(-h).
+ For |h| <= 1/4, we have |exp(h)-1| <= 1.2*|h| thus
+@@ -480,16 +559,26 @@
+ err_s = (err_t == err_s) ? 1 + err_s : ((err_t > err_s) ? err_t : err_s);
+ err_s += 1 - MPFR_GET_EXP(s);
+ #endif
++ if (MPFR_LIKELY (MPFR_CAN_ROUND (s, w - err_s, precy, rnd)))
++ break;
++#ifdef IS_GAMMA
++ ziv_next:
++#endif
++ MPFR_ZIV_NEXT (loop, w);
+ }
+- while (MPFR_UNLIKELY (!MPFR_CAN_ROUND (s, w - err_s, precy, rnd)));
+
++#ifdef IS_GAMMA
++ end0:
++#endif
+ oldBm = Bm;
+ while (Bm--)
+ mpz_clear (B[Bm]);
+ (*__gmp_free_func) (B, oldBm * sizeof (mpz_t));
+
+ end:
+- inexact = mpfr_set (y, s, rnd);
++ if (inexact == 0)
++ inexact = mpfr_set (y, s, rnd);
++ MPFR_ZIV_FREE (loop);
+
+ mpfr_clear (s);
+ mpfr_clear (t);
+diff -Naurd mpfr-3.1.0-a/src/mpfr.h mpfr-3.1.0-b/src/mpfr.h
+--- mpfr-3.1.0-a/src/mpfr.h 2012-04-27 01:13:15.000000000 +0000
++++ mpfr-3.1.0-b/src/mpfr.h 2012-05-07 18:52:45.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 0
+-#define MPFR_VERSION_STRING "3.1.0-p9"
++#define MPFR_VERSION_STRING "3.1.0-p10"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.0-a/src/version.c mpfr-3.1.0-b/src/version.c
+--- mpfr-3.1.0-a/src/version.c 2012-04-27 01:13:15.000000000 +0000
++++ mpfr-3.1.0-b/src/version.c 2012-05-07 18:52:45.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.0-p9";
++ return "3.1.0-p10";
+ }
+diff -Naurd mpfr-3.1.0-a/tests/tgamma.c mpfr-3.1.0-b/tests/tgamma.c
+--- mpfr-3.1.0-a/tests/tgamma.c 2012-04-27 01:13:15.000000000 +0000
++++ mpfr-3.1.0-b/tests/tgamma.c 2012-05-07 18:52:45.000000000 +0000
+@@ -838,6 +838,175 @@
+ exit (1);
+ }
+
++/* Test mpfr_gamma in precision p1 by comparing it with exp(lgamma(x))
++ computing with a working precision p2. Assume that x is not an
++ integer <= 2. */
++static void
++exp_lgamma (mpfr_t x, mpfr_prec_t p1, mpfr_prec_t p2)
++{
++ mpfr_t yd, yu, zd, zu;
++ int inexd, inexu, sign;
++ int underflow = -1, overflow = -1; /* -1: we don't know */
++ int got_underflow, got_overflow;
++
++ if (mpfr_integer_p (x) && mpfr_cmp_si (x, 2) <= 0)
++ {
++ printf ("Warning! x is an integer <= 2 in exp_lgamma: ");
++ mpfr_out_str (stdout, 10, 0, x, MPFR_RNDN); putchar ('\n');
++ return;
++ }
++ mpfr_inits2 (p2, yd, yu, (mpfr_ptr) 0);
++ inexd = mpfr_lgamma (yd, &sign, x, MPFR_RNDD);
++ mpfr_set (yu, yd, MPFR_RNDN); /* exact */
++ if (inexd)
++ mpfr_nextabove (yu);
++ mpfr_clear_flags ();
++ mpfr_exp (yd, yd, MPFR_RNDD);
++ if (! mpfr_underflow_p ())
++ underflow = 0;
++ if (mpfr_overflow_p ())
++ overflow = 1;
++ mpfr_clear_flags ();
++ mpfr_exp (yu, yu, MPFR_RNDU);
++ if (mpfr_underflow_p ())
++ underflow = 1;
++ if (! mpfr_overflow_p ())
++ overflow = 0;
++ if (sign < 0)
++ {
++ mpfr_neg (yd, yd, MPFR_RNDN); /* exact */
++ mpfr_neg (yu, yu, MPFR_RNDN); /* exact */
++ mpfr_swap (yd, yu);
++ }
++ /* yd < Gamma(x) < yu (strict inequalities since x != 1 and x != 2) */
++ mpfr_inits2 (p1, zd, zu, (mpfr_ptr) 0);
++ mpfr_clear_flags ();
++ inexd = mpfr_gamma (zd, x, MPFR_RNDD); /* zd <= Gamma(x) < yu */
++ got_underflow = underflow == -1 ? -1 : !! mpfr_underflow_p ();
++ got_overflow = overflow == -1 ? -1 : !! mpfr_overflow_p ();
++ if (! mpfr_less_p (zd, yu) || inexd > 0 ||
++ got_underflow != underflow ||
++ got_overflow != overflow)
++ {
++ printf ("Error in exp_lgamma on x = ");
++ mpfr_out_str (stdout, 16, 0, x, MPFR_RNDN); putchar ('\n');
++ printf ("yu = ");
++ mpfr_dump (yu);
++ printf ("zd = ");
++ mpfr_dump (zd);
++ printf ("got inexd = %d, expected <= 0\n", inexd);
++ printf ("got underflow = %d, expected %d\n", got_underflow, underflow);
++ printf ("got overflow = %d, expected %d\n", got_overflow, overflow);
++ exit (1);
++ }
++ mpfr_clear_flags ();
++ inexu = mpfr_gamma (zu, x, MPFR_RNDU); /* zu >= Gamma(x) > yd */
++ got_underflow = underflow == -1 ? -1 : !! mpfr_underflow_p ();
++ got_overflow = overflow == -1 ? -1 : !! mpfr_overflow_p ();
++ if (! mpfr_greater_p (zu, yd) || inexu < 0 ||
++ got_underflow != underflow ||
++ got_overflow != overflow)
++ {
++ printf ("Error in exp_lgamma on x = ");
++ mpfr_out_str (stdout, 16, 0, x, MPFR_RNDN); putchar ('\n');
++ printf ("yd = ");
++ mpfr_dump (yd);
++ printf ("zu = ");
++ mpfr_dump (zu);
++ printf ("got inexu = %d, expected >= 0\n", inexu);
++ printf ("got underflow = %d, expected %d\n", got_underflow, underflow);
++ printf ("got overflow = %d, expected %d\n", got_overflow, overflow);
++ exit (1);
++ }
++ if (mpfr_equal_p (zd, zu))
++ {
++ if (inexd != 0 || inexu != 0)
++ {
++ printf ("Error in exp_lgamma on x = ");
++ mpfr_out_str (stdout, 16, 0, x, MPFR_RNDN); putchar ('\n');
++ printf ("zd = zu, thus exact, but inexd = %d and inexu = %d\n",
++ inexd, inexu);
++ exit (1);
++ }
++ MPFR_ASSERTN (got_underflow == 0);
++ MPFR_ASSERTN (got_overflow == 0);
++ }
++ else if (inexd == 0 || inexu == 0)
++ {
++ printf ("Error in exp_lgamma on x = ");
++ mpfr_out_str (stdout, 16, 0, x, MPFR_RNDN); putchar ('\n');
++ printf ("zd != zu, thus inexact, but inexd = %d and inexu = %d\n",
++ inexd, inexu);
++ exit (1);
++ }
++ mpfr_clears (yd, yu, zd, zu, (mpfr_ptr) 0);
++}
++
++static void
++exp_lgamma_tests (void)
++{
++ mpfr_t x;
++ mpfr_exp_t emin, emax;
++ int i;
++
++ emin = mpfr_get_emin ();
++ emax = mpfr_get_emax ();
++ set_emin (MPFR_EMIN_MIN);
++ set_emax (MPFR_EMAX_MAX);
++
++ mpfr_init2 (x, 96);
++ for (i = 3; i <= 8; i++)
++ {
++ mpfr_set_ui (x, i, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ mpfr_nextbelow (x);
++ exp_lgamma (x, 53, 64);
++ mpfr_nextabove (x);
++ mpfr_nextabove (x);
++ exp_lgamma (x, 53, 64);
++ }
++ mpfr_set_str (x, "1.7", 10, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ mpfr_set_str (x, "-4.6308260837372266e+07", 10, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ mpfr_set_str (x, "-90.6308260837372266e+15", 10, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ /* The following test gives a large positive result < +Inf */
++ mpfr_set_str (x, "1.2b13fc45a92dea1@14", 16, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ /* Idem for a large negative result > -Inf */
++ mpfr_set_str (x, "-1.2b13fc45a92de81@14", 16, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ /* The following two tests trigger an endless loop in r8186
++ on 64-bit machines (64-bit exponent). The second one (due
++ to undetected overflow) is a direct consequence of the
++ first one, due to the call of Gamma(2-x) if x < 1. */
++ mpfr_set_str (x, "1.2b13fc45a92dec8@14", 16, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ mpfr_set_str (x, "-1.2b13fc45a92dea8@14", 16, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ /* Similar tests (overflow threshold) for 32-bit machines. */
++ mpfr_set_str (x, "2ab68d8.657542f855111c61", 16, MPFR_RNDN);
++ exp_lgamma (x, 12, 64);
++ mpfr_set_str (x, "-2ab68d6.657542f855111c61", 16, MPFR_RNDN);
++ exp_lgamma (x, 12, 64);
++ /* The following test is an overflow on 32-bit and 64-bit machines.
++ Revision r8189 fails on 64-bit machines as the flag is unset. */
++ mpfr_set_str (x, "1.2b13fc45a92ded8@14", 16, MPFR_RNDN);
++ exp_lgamma (x, 53, 64);
++ /* On the following tests, with r8196, one gets an underflow on
++ 32-bit machines, while a normal result is expected (see FIXME
++ in gamma.c:382). */
++ mpfr_set_str (x, "-2ab68d6.657542f855111c6104", 16, MPFR_RNDN);
++ exp_lgamma (x, 12, 64); /* failure on 32-bit machines */
++ mpfr_set_str (x, "-12b13fc45a92deb.1c6c5bc964", 16, MPFR_RNDN);
++ exp_lgamma (x, 12, 64); /* failure on 64-bit machines */
++ mpfr_clear (x);
++
++ set_emin (emin);
++ set_emax (emax);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -852,6 +1021,7 @@
+ test20071231 ();
+ test20100709 ();
+ test20120426 ();
++ exp_lgamma_tests ();
+
+ data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
+
diff --git a/patches/mpfr/3.1.1/110-get_decimal64.patch b/patches/mpfr/3.1.1/110-get_decimal64.patch
new file mode 100644
index 0000000..d73a3d7
--- /dev/null
+++ b/patches/mpfr/3.1.1/110-get_decimal64.patch
@@ -0,0 +1,235 @@
+diff -Naurd mpfr-3.1.1-a/PATCHES mpfr-3.1.1-b/PATCHES
+--- mpfr-3.1.1-a/PATCHES 2012-08-30 09:28:51.000000000 +0000
++++ mpfr-3.1.1-b/PATCHES 2012-08-30 09:28:51.000000000 +0000
+@@ -0,0 +1 @@
++get_decimal64
+diff -Naurd mpfr-3.1.1-a/VERSION mpfr-3.1.1-b/VERSION
+--- mpfr-3.1.1-a/VERSION 2012-07-03 15:01:13.000000000 +0000
++++ mpfr-3.1.1-b/VERSION 2012-08-30 09:28:51.000000000 +0000
+@@ -1 +1 @@
+-3.1.1
++3.1.1-p1
+diff -Naurd mpfr-3.1.1-a/src/get_d64.c mpfr-3.1.1-b/src/get_d64.c
+--- mpfr-3.1.1-a/src/get_d64.c 2012-07-03 15:01:18.000000000 +0000
++++ mpfr-3.1.1-b/src/get_d64.c 2012-08-30 09:28:51.000000000 +0000
+@@ -32,6 +32,10 @@
+
+ #ifdef MPFR_WANT_DECIMAL_FLOATS
+
++#ifndef DEC64_MAX
++# define DEC64_MAX 9.999999999999999E384dd
++#endif
++
+ #ifdef DPD_FORMAT
+ static int T[1000] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 32,
+@@ -142,26 +146,14 @@
+ static _Decimal64
+ get_decimal64_min (int negative)
+ {
+- union ieee_double_extract x;
+-
+- x.s.sig = (negative) ? 1 : 0;
+- x.s.exp = 0;
+- x.s.manh = 0;
+- x.s.manl = 1;
+- return x.d;
++ return negative ? - 1E-398dd : 1E-398dd;
+ }
+
+ /* construct the decimal64 largest finite number with given sign */
+ static _Decimal64
+ get_decimal64_max (int negative)
+ {
+- union ieee_double_extract x;
+-
+- x.s.sig = (negative) ? 1 : 0;
+- x.s.exp = 1919;
+- x.s.manh = 1048575; /* 2^20-1 */
+- x.s.manl = ~0;
+- return x.d;
++ return negative ? - DEC64_MAX : DEC64_MAX;
+ }
+
+ /* one-to-one conversion:
+@@ -334,7 +326,8 @@
+ /* the largest decimal64 number is just below 10^(385) < 2^1279 */
+ else if (MPFR_UNLIKELY (e > 1279)) /* then src >= 2^1279 */
+ {
+- if (MPFR_RNDZ || (rnd_mode == MPFR_RNDU && negative != 0)
++ if (rnd_mode == MPFR_RNDZ
++ || (rnd_mode == MPFR_RNDU && negative != 0)
+ || (rnd_mode == MPFR_RNDD && negative == 0))
+ return get_decimal64_max (negative);
+ else
+@@ -354,6 +347,15 @@
+ which corresponds to s=[0.]1000...000 and e=-397 */
+ if (e < -397)
+ {
++ if (rnd_mode == MPFR_RNDN && e == -398)
++ {
++ /* If 0.5E-398 < |src| < 1E-398 (smallest subnormal),
++ src should round to +/- 1E-398 in MPFR_RNDN. */
++ mpfr_get_str (s, &e, 10, 1, src, MPFR_RNDA);
++ return e == -398 && s[negative] <= '5' ?
++ get_decimal64_zero (negative) :
++ get_decimal64_min (negative);
++ }
+ if (rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDN
+ || (rnd_mode == MPFR_RNDD && negative == 0)
+ || (rnd_mode == MPFR_RNDU && negative != 0))
+@@ -379,7 +381,8 @@
+ which corresponds to s=[0.]9999...999 and e=385 */
+ else if (e > 385)
+ {
+- if (MPFR_RNDZ || (rnd_mode == MPFR_RNDU && negative != 0)
++ if (rnd_mode == MPFR_RNDZ
++ || (rnd_mode == MPFR_RNDU && negative != 0)
+ || (rnd_mode == MPFR_RNDD && negative == 0))
+ return get_decimal64_max (negative);
+ else
+diff -Naurd mpfr-3.1.1-a/src/mpfr.h mpfr-3.1.1-b/src/mpfr.h
+--- mpfr-3.1.1-a/src/mpfr.h 2012-07-03 15:01:19.000000000 +0000
++++ mpfr-3.1.1-b/src/mpfr.h 2012-08-30 09:28:51.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "3.1.1"
++#define MPFR_VERSION_STRING "3.1.1-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.1-a/src/version.c mpfr-3.1.1-b/src/version.c
+--- mpfr-3.1.1-a/src/version.c 2012-07-03 15:01:18.000000000 +0000
++++ mpfr-3.1.1-b/src/version.c 2012-08-30 09:28:51.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.1";
++ return "3.1.1-p1";
+ }
+diff -Naurd mpfr-3.1.1-a/tests/tget_set_d64.c mpfr-3.1.1-b/tests/tget_set_d64.c
+--- mpfr-3.1.1-a/tests/tget_set_d64.c 2012-07-03 15:01:24.000000000 +0000
++++ mpfr-3.1.1-b/tests/tget_set_d64.c 2012-08-30 09:28:51.000000000 +0000
+@@ -25,6 +25,10 @@
+ #include <stdlib.h> /* for exit */
+ #include "mpfr-test.h"
+
++#ifndef DEC64_MAX
++# define DEC64_MAX 9.999999999999999E384dd
++#endif
++
+ /* #define DEBUG */
+
+ static void
+@@ -149,6 +153,15 @@
+ mpfr_set_str (x, "9.999999999999999E384", 10, MPFR_RNDZ);
+ mpfr_set (y, x, MPFR_RNDZ);
+ d = mpfr_get_decimal64 (x, MPFR_RNDU);
++ ASSERT_ALWAYS (d == DEC64_MAX);
++ mpfr_set_ui (x, 0, MPFR_RNDZ);
++ mpfr_set_decimal64 (x, d, MPFR_RNDZ);
++ ASSERT_ALWAYS (mpfr_cmp (x, y) == 0);
++
++ mpfr_set_str (x, "-9.999999999999999E384", 10, MPFR_RNDZ);
++ mpfr_set (y, x, MPFR_RNDZ);
++ d = mpfr_get_decimal64 (x, MPFR_RNDA);
++ ASSERT_ALWAYS (d == -DEC64_MAX);
+ mpfr_set_ui (x, 0, MPFR_RNDZ);
+ mpfr_set_decimal64 (x, d, MPFR_RNDZ);
+ ASSERT_ALWAYS (mpfr_cmp (x, y) == 0);
+@@ -225,6 +238,83 @@
+ mpfr_clear (x);
+ }
+
++static void
++check_overflow (void)
++{
++ mpfr_t x;
++ int err = 0, neg, rnd;
++
++ mpfr_init2 (x, 96);
++ for (neg = 0; neg < 2; neg++)
++ RND_LOOP (rnd)
++ {
++ _Decimal64 d, e;
++ mpfr_rnd_t r = (mpfr_rnd_t) rnd;
++ int sign = neg ? -1 : 1;
++
++ e = sign * (MPFR_IS_LIKE_RNDZ (r, neg) ? 1 : 2) * DEC64_MAX;
++ /* This tests the binary exponent e > 1279 case of get_d64.c */
++ mpfr_set_si_2exp (x, sign, 9999, MPFR_RNDN);
++ d = mpfr_get_decimal64 (x, r);
++ if (d != e)
++ {
++ printf ("Error 1 in check_overflow for %s, %s\n",
++ neg ? "negative" : "positive",
++ mpfr_print_rnd_mode (r));
++ err = 1;
++ }
++ /* This tests the decimal exponent e > 385 case of get_d64.c */
++ mpfr_set_si_2exp (x, sign * 31, 1274, MPFR_RNDN);
++ d = mpfr_get_decimal64 (x, r);
++ if (d != e)
++ {
++ printf ("Error 2 in check_overflow for %s, %s\n",
++ neg ? "negative" : "positive",
++ mpfr_print_rnd_mode (r));
++ err = 1;
++ }
++ /* This tests the last else (-382 <= e <= 385) of get_d64.c */
++ mpfr_set_decimal64 (x, e, MPFR_RNDA);
++ d = mpfr_get_decimal64 (x, r);
++ if (d != e)
++ {
++ printf ("Error 3 in check_overflow for %s, %s\n",
++ neg ? "negative" : "positive",
++ mpfr_print_rnd_mode (r));
++ err = 1;
++ }
++ }
++ mpfr_clear (x);
++ if (err)
++ exit (1);
++}
++
++static void
++check_tiny (void)
++{
++ mpfr_t x;
++ _Decimal64 d;
++
++ /* If 0.5E-398 < |x| < 1E-398 (smallest subnormal), x should round
++ to +/- 1E-398 in MPFR_RNDN. Note: the midpoint 0.5E-398 between
++ 0 and 1E-398 is not a representable binary number, so that there
++ are no tests for it. */
++ mpfr_init2 (x, 128);
++ mpfr_set_str (x, "1E-398", 10, MPFR_RNDZ);
++ d = mpfr_get_decimal64 (x, MPFR_RNDN);
++ MPFR_ASSERTN (d == 1.0E-398dd);
++ mpfr_neg (x, x, MPFR_RNDN);
++ d = mpfr_get_decimal64 (x, MPFR_RNDN);
++ MPFR_ASSERTN (d == -1.0E-398dd);
++ mpfr_set_str (x, "0.5E-398", 10, MPFR_RNDU);
++ d = mpfr_get_decimal64 (x, MPFR_RNDN);
++ MPFR_ASSERTN (d == 1.0E-398dd);
++ mpfr_neg (x, x, MPFR_RNDN);
++ d = mpfr_get_decimal64 (x, MPFR_RNDN);
++ MPFR_ASSERTN (d == -1.0E-398dd);
++ mpfr_clear (x);
++}
++
+ int
+ main (void)
+ {
+@@ -241,6 +331,8 @@
+ check_inf_nan ();
+ check_random ();
+ check_native ();
++ check_overflow ();
++ check_tiny ();
+
+ tests_end_mpfr ();
+ return 0;
diff --git a/patches/mpfr/3.1.1/120-strtofr-ternary-value.patch b/patches/mpfr/3.1.1/120-strtofr-ternary-value.patch
new file mode 100644
index 0000000..76dbc45
--- /dev/null
+++ b/patches/mpfr/3.1.1/120-strtofr-ternary-value.patch
@@ -0,0 +1,170 @@
+diff -Naurd mpfr-3.1.1-a/PATCHES mpfr-3.1.1-b/PATCHES
+--- mpfr-3.1.1-a/PATCHES 2012-08-30 09:35:12.000000000 +0000
++++ mpfr-3.1.1-b/PATCHES 2012-08-30 09:35:12.000000000 +0000
+@@ -0,0 +1 @@
++strtofr-ternary-value
+diff -Naurd mpfr-3.1.1-a/VERSION mpfr-3.1.1-b/VERSION
+--- mpfr-3.1.1-a/VERSION 2012-08-30 09:28:51.000000000 +0000
++++ mpfr-3.1.1-b/VERSION 2012-08-30 09:35:12.000000000 +0000
+@@ -1 +1 @@
+-3.1.1-p1
++3.1.1-p2
+diff -Naurd mpfr-3.1.1-a/src/mpfr.h mpfr-3.1.1-b/src/mpfr.h
+--- mpfr-3.1.1-a/src/mpfr.h 2012-08-30 09:28:51.000000000 +0000
++++ mpfr-3.1.1-b/src/mpfr.h 2012-08-30 09:35:12.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "3.1.1-p1"
++#define MPFR_VERSION_STRING "3.1.1-p2"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.1-a/src/strtofr.c mpfr-3.1.1-b/src/strtofr.c
+--- mpfr-3.1.1-a/src/strtofr.c 2012-07-03 15:01:16.000000000 +0000
++++ mpfr-3.1.1-b/src/strtofr.c 2012-08-30 09:35:12.000000000 +0000
+@@ -667,6 +667,20 @@
+ /* (z, exp_z) = base^(exp_base-pstr_size) */
+ z = result + 2*ysize + 1;
+ err = mpfr_mpn_exp (z, &exp_z, pstr->base, exp_z, ysize);
++ /* Since we want y/z rounded toward zero, we must get an upper
++ bound of z. If err >= 0, the error on z is bounded by 2^err. */
++ if (err >= 0)
++ {
++ mp_limb_t cy;
++ unsigned long h = err / GMP_NUMB_BITS;
++ unsigned long l = err - h * GMP_NUMB_BITS;
++
++ if (h >= ysize) /* not enough precision in z */
++ goto next_loop;
++ cy = mpn_add_1 (z, z, ysize - h, MPFR_LIMB_ONE << l);
++ if (cy != 0) /* the code below requires z on ysize limbs */
++ goto next_loop;
++ }
+ exact = exact && (err == -1);
+ if (err == -2)
+ goto underflow; /* FIXME: Sure? */
+@@ -730,6 +744,7 @@
+ MPFR_RNDN, rnd, MPFR_PREC(x)))
+ break;
+
++ next_loop:
+ /* update the prec for next loop */
+ MPFR_ZIV_NEXT (loop, prec);
+ } /* loop */
+diff -Naurd mpfr-3.1.1-a/src/version.c mpfr-3.1.1-b/src/version.c
+--- mpfr-3.1.1-a/src/version.c 2012-08-30 09:28:51.000000000 +0000
++++ mpfr-3.1.1-b/src/version.c 2012-08-30 09:35:12.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.1-p1";
++ return "3.1.1-p2";
+ }
+diff -Naurd mpfr-3.1.1-a/tests/tstrtofr.c mpfr-3.1.1-b/tests/tstrtofr.c
+--- mpfr-3.1.1-a/tests/tstrtofr.c 2012-07-03 15:01:24.000000000 +0000
++++ mpfr-3.1.1-b/tests/tstrtofr.c 2012-08-30 09:35:12.000000000 +0000
+@@ -1105,6 +1105,92 @@
+ mpfr_clear (y);
+ }
+
++/* From a bug reported by Joseph S. Myers
++ https://sympa.inria.fr/sympa/arc/mpfr/2012-08/msg00005.html */
++static void
++bug20120814 (void)
++{
++ mpfr_exp_t emin = -30, e;
++ mpfr_t x, y;
++ int r;
++ char s[64], *p;
++
++ mpfr_init2 (x, 2);
++ mpfr_set_ui_2exp (x, 3, emin - 2, MPFR_RNDN);
++ mpfr_get_str (s + 1, &e, 10, 19, x, MPFR_RNDD);
++ s[0] = s[1];
++ s[1] = '.';
++ for (p = s; *p != 0; p++) ;
++ *p = 'e';
++ sprintf (p + 1, "%d", (int) e - 1);
++
++ mpfr_init2 (y, 4);
++ r = mpfr_strtofr (y, s, NULL, 0, MPFR_RNDN);
++ if (r <= 0 || ! mpfr_equal_p (x, y))
++ {
++ printf ("Error in bug20120814\n");
++ printf ("mpfr_strtofr failed on string \"%s\"\n", s);
++ printf ("Expected inex > 0 and y = 0.1100E%d\n", (int) emin);
++ printf ("Got inex = %-6d and y = ", r);
++ mpfr_dump (y);
++ exit (1);
++ }
++
++ mpfr_clear (x);
++ mpfr_clear (y);
++}
++
++static void
++bug20120829 (void)
++{
++ mpfr_t x1, x2, e;
++ int inex1, inex2, i, r;
++ char s[48] = "1e-1";
++
++ mpfr_init2 (e, 128);
++ mpfr_inits2 (4, x1, x2, (mpfr_ptr) 0);
++
++ inex1 = mpfr_set_si (e, -1, MPFR_RNDN);
++ MPFR_ASSERTN (inex1 == 0);
++
++ for (i = 1; i <= sizeof(s) - 5; i++)
++ {
++ s[3+i] = '0';
++ s[4+i] = 0;
++ inex1 = mpfr_mul_ui (e, e, 10, MPFR_RNDN);
++ MPFR_ASSERTN (inex1 == 0);
++ RND_LOOP(r)
++ {
++ mpfr_rnd_t rnd = (mpfr_rnd_t) r;
++
++ inex1 = mpfr_exp10 (x1, e, rnd);
++ inex1 = SIGN (inex1);
++ inex2 = mpfr_strtofr (x2, s, NULL, 0, rnd);
++ inex2 = SIGN (inex2);
++ /* On 32-bit machines, for i = 7, r8389, r8391 and r8394 do:
++ strtofr.c:...: MPFR assertion failed: cy == 0
++ r8396 is OK.
++ On 64-bit machines, for i = 15,
++ r8389 does: strtofr.c:678: MPFR assertion failed: err < (64 - 0)
++ r8391 does: strtofr.c:680: MPFR assertion failed: h < ysize
++ r8394 and r8396 are OK.
++ */
++ if (! mpfr_equal_p (x1, x2) || inex1 != inex2)
++ {
++ printf ("Error in bug20120829 for i = %d, rnd = %s\n",
++ i, mpfr_print_rnd_mode (rnd));
++ printf ("Expected inex = %d, x = ", inex1);
++ mpfr_dump (x1);
++ printf ("Got inex = %d, x = ", inex2);
++ mpfr_dump (x2);
++ exit (1);
++ }
++ }
++ }
++
++ mpfr_clears (e, x1, x2, (mpfr_ptr) 0);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -1117,6 +1203,8 @@
+ check_retval ();
+ bug20081028 ();
+ test20100310 ();
++ bug20120814 ();
++ bug20120829 ();
+
+ tests_end_mpfr ();
+ return 0;
diff --git a/patches/mpfr/3.1.1/130-gmp51-compat.patch b/patches/mpfr/3.1.1/130-gmp51-compat.patch
new file mode 100644
index 0000000..ecf7537
--- /dev/null
+++ b/patches/mpfr/3.1.1/130-gmp51-compat.patch
@@ -0,0 +1,98 @@
+diff -Naurd mpfr-3.1.1-a/PATCHES mpfr-3.1.1-b/PATCHES
+--- mpfr-3.1.1-a/PATCHES 2013-02-22 12:17:27.000000000 +0000
++++ mpfr-3.1.1-b/PATCHES 2013-02-22 12:18:34.000000000 +0000
+@@ -0,0 +1 @@
++gmp51-compat
+diff -Naurd mpfr-3.1.1-a/VERSION mpfr-3.1.1-b/VERSION
+--- mpfr-3.1.1-a/VERSION 2012-08-30 09:35:12.000000000 +0000
++++ mpfr-3.1.1-b/VERSION 2013-02-22 12:18:20.000000000 +0000
+@@ -1 +1 @@
+-3.1.1-p2
++3.1.1-p3
+diff -Naurd mpfr-3.1.1-a/src/get_f.c mpfr-3.1.1-b/src/get_f.c
+--- mpfr-3.1.1-a/src/get_f.c 2012-07-03 15:01:19.000000000 +0000
++++ mpfr-3.1.1-b/src/get_f.c 2013-02-22 12:18:06.000000000 +0000
+@@ -61,7 +61,7 @@
+
+ sx = PREC (x);
+ SIZ (x) = sx;
+- xp = LIMBS (x);
++ xp = PTR (x);
+ for (i = 0; i < sx; i++)
+ xp[i] = MP_LIMB_T_MAX;
+
+diff -Naurd mpfr-3.1.1-a/src/mpfr-gmp.h mpfr-3.1.1-b/src/mpfr-gmp.h
+--- mpfr-3.1.1-a/src/mpfr-gmp.h 2012-07-03 15:01:16.000000000 +0000
++++ mpfr-3.1.1-b/src/mpfr-gmp.h 2013-02-22 12:18:06.000000000 +0000
+@@ -163,7 +163,6 @@
+ #define SIZ(x) ((x)->_mp_size)
+ #define ABSIZ(x) ABS (SIZ (x))
+ #define PTR(x) ((x)->_mp_d)
+-#define LIMBS(x) ((x)->_mp_d)
+ #define EXP(x) ((x)->_mp_exp)
+ #define PREC(x) ((x)->_mp_prec)
+ #define ALLOC(x) ((x)->_mp_alloc)
+diff -Naurd mpfr-3.1.1-a/src/mpfr.h mpfr-3.1.1-b/src/mpfr.h
+--- mpfr-3.1.1-a/src/mpfr.h 2012-08-30 09:35:12.000000000 +0000
++++ mpfr-3.1.1-b/src/mpfr.h 2013-02-22 12:18:20.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "3.1.1-p2"
++#define MPFR_VERSION_STRING "3.1.1-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.1-a/src/version.c mpfr-3.1.1-b/src/version.c
+--- mpfr-3.1.1-a/src/version.c 2012-08-30 09:35:12.000000000 +0000
++++ mpfr-3.1.1-b/src/version.c 2013-02-22 12:18:20.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.1-p2";
++ return "3.1.1-p3";
+ }
+diff -Naurd mpfr-3.1.1-a/tests/tadd.c mpfr-3.1.1-b/tests/tadd.c
+--- mpfr-3.1.1-a/tests/tadd.c 2012-07-03 15:01:24.000000000 +0000
++++ mpfr-3.1.1-b/tests/tadd.c 2013-02-22 12:18:06.000000000 +0000
+@@ -20,7 +20,7 @@
+ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+-#define NUM 30000
++#define N 30000
+
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -674,7 +674,7 @@
+
+ mpfr_init2 (one, MPFR_PREC_MIN);
+ mpfr_set_ui (one, 1, MPFR_RNDN);
+- for (n = 0; n < NUM; n++)
++ for (n = 0; n < N; n++)
+ {
+ mpfr_prec_t prec_a, prec_b, prec_c;
+ mpfr_exp_t tb=0, tc, diff;
+diff -Naurd mpfr-3.1.1-a/tests/tgeneric.c mpfr-3.1.1-b/tests/tgeneric.c
+--- mpfr-3.1.1-a/tests/tgeneric.c 2012-07-03 15:01:24.000000000 +0000
++++ mpfr-3.1.1-b/tests/tgeneric.c 2013-02-22 12:18:06.000000000 +0000
+@@ -121,7 +121,7 @@
+ #endif
+
+ static void
+-test_generic (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int N)
++test_generic (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int nmax)
+ {
+ mpfr_prec_t prec, xprec, yprec;
+ mpfr_t x, y, z, t, w;
+@@ -155,7 +155,7 @@
+ mpfr_set_prec (w, yprec);
+
+ /* Note: in precision p1, we test 4 special cases. */
+- for (n = 0; n < (prec == p1 ? N + 4 : N); n++)
++ for (n = 0; n < (prec == p1 ? nmax + 4 : nmax); n++)
+ {
+ int infinite_input = 0;
+
diff --git a/patches/mpfr/3.1.2/110-exp_2.patch b/patches/mpfr/3.1.2/110-exp_2.patch
new file mode 100644
index 0000000..731ea92
--- /dev/null
+++ b/patches/mpfr/3.1.2/110-exp_2.patch
@@ -0,0 +1,45 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2013-09-26 10:52:52.000000000 +0000
++++ mpfr-3.1.2-b/PATCHES 2013-09-26 10:52:52.000000000 +0000
+@@ -0,0 +1 @@
++exp_2
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2013-03-13 15:37:28.000000000 +0000
++++ mpfr-3.1.2-b/VERSION 2013-09-26 10:52:52.000000000 +0000
+@@ -1 +1 @@
+-3.1.2
++3.1.2-p1
+diff -Naurd mpfr-3.1.2-a/src/exp_2.c mpfr-3.1.2-b/src/exp_2.c
+--- mpfr-3.1.2-a/src/exp_2.c 2013-03-13 15:37:28.000000000 +0000
++++ mpfr-3.1.2-b/src/exp_2.c 2013-09-26 10:52:52.000000000 +0000
+@@ -204,7 +204,7 @@
+ for (k = 0; k < K; k++)
+ {
+ mpz_mul (ss, ss, ss);
+- exps <<= 1;
++ exps *= 2;
+ exps += mpz_normalize (ss, ss, q);
+ }
+ mpfr_set_z (s, ss, MPFR_RNDN);
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2013-03-13 15:37:37.000000000 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2"
++#define MPFR_VERSION_STRING "3.1.2-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2013-03-13 15:37:34.000000000 +0000
++++ mpfr-3.1.2-b/src/version.c 2013-09-26 10:52:52.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2";
++ return "3.1.2-p1";
+ }
diff --git a/patches/mpfr/3.1.2/120-fits-smallneg.patch b/patches/mpfr/3.1.2/120-fits-smallneg.patch
new file mode 100644
index 0000000..b229c18
--- /dev/null
+++ b/patches/mpfr/3.1.2/120-fits-smallneg.patch
@@ -0,0 +1,605 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2013-09-26 10:56:55.000000000 +0000
++++ mpfr-3.1.2-b/PATCHES 2013-09-26 10:56:55.000000000 +0000
+@@ -0,0 +1 @@
++fits-smallneg
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2013-09-26 10:52:52.000000000 +0000
++++ mpfr-3.1.2-b/VERSION 2013-09-26 10:56:55.000000000 +0000
+@@ -1 +1 @@
+-3.1.2-p1
++3.1.2-p2
+diff -Naurd mpfr-3.1.2-a/src/fits_u.h mpfr-3.1.2-b/src/fits_u.h
+--- mpfr-3.1.2-a/src/fits_u.h 2013-03-13 15:37:35.000000000 +0000
++++ mpfr-3.1.2-b/src/fits_u.h 2013-09-26 10:56:55.000000000 +0000
+@@ -32,17 +32,20 @@
+ int res;
+
+ if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f)))
+- /* Zero always fit */
+- return MPFR_IS_ZERO (f) ? 1 : 0;
+- else if (MPFR_IS_NEG (f))
+- /* Negative numbers don't fit */
+- return 0;
+- /* now it fits if
+- (a) f <= MAXIMUM
+- (b) round(f, prec(slong), rnd) <= MAXIMUM */
++ return MPFR_IS_ZERO (f) ? 1 : 0; /* Zero always fits */
+
+ e = MPFR_GET_EXP (f);
+
++ if (MPFR_IS_NEG (f))
++ return e >= 1 ? 0 /* f <= -1 does not fit */
++ : rnd != MPFR_RNDN ? MPFR_IS_LIKE_RNDU (rnd, -1) /* directed mode */
++ : e < 0 ? 1 /* f > -1/2 fits in MPFR_RNDN */
++ : mpfr_powerof2_raw(f); /* -1/2 fits, -1 < f < -1/2 don't */
++
++ /* Now it fits if
++ (a) f <= MAXIMUM
++ (b) round(f, prec(slong), rnd) <= MAXIMUM */
++
+ /* first compute prec(MAXIMUM); fits in an int */
+ for (s = MAXIMUM, prec = 0; s != 0; s /= 2, prec ++);
+
+diff -Naurd mpfr-3.1.2-a/src/fits_uintmax.c mpfr-3.1.2-b/src/fits_uintmax.c
+--- mpfr-3.1.2-a/src/fits_uintmax.c 2013-03-13 15:37:33.000000000 +0000
++++ mpfr-3.1.2-b/src/fits_uintmax.c 2013-09-26 10:56:55.000000000 +0000
+@@ -27,51 +27,19 @@
+ #include "mpfr-intmax.h"
+ #include "mpfr-impl.h"
+
+-#ifdef _MPFR_H_HAVE_INTMAX_T
+-
+-/* We can't use fits_u.h <= mpfr_cmp_ui */
+-int
+-mpfr_fits_uintmax_p (mpfr_srcptr f, mpfr_rnd_t rnd)
+-{
+- mpfr_exp_t e;
+- int prec;
+- uintmax_t s;
+- mpfr_t x;
+- int res;
+-
+- if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f)))
+- /* Zero always fit */
+- return MPFR_IS_ZERO (f) ? 1 : 0;
+- else if (MPFR_IS_NEG (f))
+- /* Negative numbers don't fit */
+- return 0;
+- /* now it fits if
+- (a) f <= MAXIMUM
+- (b) round(f, prec(slong), rnd) <= MAXIMUM */
+-
+- e = MPFR_GET_EXP (f);
+-
+- /* first compute prec(MAXIMUM); fits in an int */
+- for (s = MPFR_UINTMAX_MAX, prec = 0; s != 0; s /= 2, prec ++);
+-
+- /* MAXIMUM needs prec bits, i.e. MAXIMUM = 2^prec - 1 */
+-
+- /* if e <= prec - 1, then f < 2^(prec-1) < MAXIMUM */
+- if (e <= prec - 1)
+- return 1;
++/* Note: though mpfr-impl.h is included in fits_u.h, we also include it
++ above so that it gets included even when _MPFR_H_HAVE_INTMAX_T is not
++ defined; this is necessary to avoid an empty translation unit, which
++ is forbidden by ISO C. Without this, a failing test can be reproduced
++ by creating an invalid stdint.h somewhere in the default include path
++ and by compiling MPFR with "gcc -ansi -pedantic-errors". */
+
+- /* if e >= prec + 1, then f >= 2^prec > MAXIMUM */
+- if (e >= prec + 1)
+- return 0;
++#ifdef _MPFR_H_HAVE_INTMAX_T
+
+- MPFR_ASSERTD (e == prec);
++#define FUNCTION mpfr_fits_uintmax_p
++#define MAXIMUM MPFR_UINTMAX_MAX
++#define TYPE uintmax_t
+
+- /* hard case: first round to prec bits, then check */
+- mpfr_init2 (x, prec);
+- mpfr_set (x, f, rnd);
+- res = MPFR_GET_EXP (x) == e;
+- mpfr_clear (x);
+- return res;
+-}
++#include "fits_u.h"
+
+ #endif
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2013-09-26 10:56:55.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p1"
++#define MPFR_VERSION_STRING "3.1.2-p2"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2013-09-26 10:52:52.000000000 +0000
++++ mpfr-3.1.2-b/src/version.c 2013-09-26 10:56:55.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p1";
++ return "3.1.2-p2";
+ }
+diff -Naurd mpfr-3.1.2-a/tests/tfits.c mpfr-3.1.2-b/tests/tfits.c
+--- mpfr-3.1.2-a/tests/tfits.c 2013-03-13 15:37:45.000000000 +0000
++++ mpfr-3.1.2-b/tests/tfits.c 2013-09-26 10:56:55.000000000 +0000
+@@ -33,155 +33,176 @@
+ #include "mpfr-intmax.h"
+ #include "mpfr-test.h"
+
+-#define ERROR1 { printf("Initial error for x="); mpfr_dump(x); exit(1); }
+-#define ERROR2 { printf("Error for x="); mpfr_dump(x); exit(1); }
++#define ERROR1(N) \
++ do \
++ { \
++ printf("Error %d for rnd = %s and x = ", N, \
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r)); \
++ mpfr_dump(x); \
++ exit(1); \
++ } \
++ while (0)
+
+ static void check_intmax (void);
+
+ int
+ main (void)
+ {
+- mpfr_t x;
++ mpfr_t x, y;
++ int i, r;
+
+ tests_start_mpfr ();
+
+ mpfr_init2 (x, 256);
++ mpfr_init2 (y, 8);
+
+- /* Check NAN */
+- mpfr_set_nan (x);
+- if (mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR1;
++ RND_LOOP (r)
++ {
+
+- /* Check INF */
+- mpfr_set_inf (x, 1);
+- if (mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR1;
++ /* Check NAN */
++ mpfr_set_nan (x);
++ if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (1);
++ if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (2);
++ if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (3);
++ if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (4);
++ if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (5);
++ if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (6);
+
+- /* Check Zero */
+- MPFR_SET_ZERO (x);
+- if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR2;
++ /* Check INF */
++ mpfr_set_inf (x, 1);
++ if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (7);
++ if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (8);
++ if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (9);
++ if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (10);
++ if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (11);
++ if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (12);
+
+- /* Check small op */
+- mpfr_set_str1 (x, "1@-1");
+- if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR2;
++ /* Check Zero */
++ MPFR_SET_ZERO (x);
++ if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (13);
++ if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (14);
++ if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (15);
++ if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (16);
++ if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (17);
++ if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (18);
+
+- /* Check 17 */
+- mpfr_set_ui (x, 17, MPFR_RNDN);
+- if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR2;
++ /* Check small positive op */
++ mpfr_set_str1 (x, "1@-1");
++ if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (19);
++ if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (20);
++ if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (21);
++ if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (22);
++ if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (23);
++ if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (24);
+
+- /* Check all other values */
+- mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
+- mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR1;
+- mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
+- if (mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR1;
++ /* Check 17 */
++ mpfr_set_ui (x, 17, MPFR_RNDN);
++ if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (25);
++ if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (26);
++ if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (27);
++ if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (28);
++ if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (29);
++ if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (30);
+
+- mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
+- if (!mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_set_ui (x, LONG_MAX, MPFR_RNDN);
+- if (!mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_set_ui (x, UINT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_set_ui (x, INT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR2;
++ /* Check all other values */
++ mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
++ mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
++ if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (31);
++ if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (32);
++ mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
++ if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (33);
++ if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (34);
++ if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (35);
++ if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (36);
++ if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (37);
+
+- mpfr_set_si (x, 1, MPFR_RNDN);
+- if (!mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR2;
++ mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
++ if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (38);
++ mpfr_set_ui (x, LONG_MAX, MPFR_RNDN);
++ if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (39);
++ mpfr_set_ui (x, UINT_MAX, MPFR_RNDN);
++ if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (40);
++ mpfr_set_ui (x, INT_MAX, MPFR_RNDN);
++ if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (41);
++ mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN);
++ if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (42);
++ mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN);
++ if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (43);
+
+- /* Check negative value */
+- mpfr_set_si (x, -1, MPFR_RNDN);
+- if (!mpfr_fits_sint_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_sshort_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_slong_p (x, MPFR_RNDN))
+- ERROR2;
+- if (mpfr_fits_uint_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_ushort_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_ulong_p (x, MPFR_RNDN))
+- ERROR1;
++ mpfr_set_si (x, 1, MPFR_RNDN);
++ if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (44);
++ if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (45);
++
++ /* Check negative op */
++ for (i = 1; i <= 4; i++)
++ {
++ int inv;
++
++ mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
++ mpfr_rint (y, x, (mpfr_rnd_t) r);
++ inv = MPFR_NOTZERO (y);
++ if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r) ^ inv)
++ ERROR1 (46);
++ if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
++ ERROR1 (47);
++ if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r) ^ inv)
++ ERROR1 (48);
++ if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
++ ERROR1 (49);
++ if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r) ^ inv)
++ ERROR1 (50);
++ if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
++ ERROR1 (51);
++ }
++ }
+
+ mpfr_clear (x);
++ mpfr_clear (y);
+
+ check_intmax ();
+
+@@ -189,85 +210,98 @@
+ return 0;
+ }
+
+-static void check_intmax (void)
++static void
++check_intmax (void)
+ {
+ #ifdef _MPFR_H_HAVE_INTMAX_T
+- mpfr_t x;
++ mpfr_t x, y;
++ int i, r;
+
+- mpfr_init2 (x, sizeof (uintmax_t)*CHAR_BIT);
++ mpfr_init2 (x, sizeof (uintmax_t) * CHAR_BIT);
++ mpfr_init2 (y, 8);
+
+- /* Check NAN */
+- mpfr_set_nan (x);
+- if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR1;
++ RND_LOOP (r)
++ {
++ /* Check NAN */
++ mpfr_set_nan (x);
++ if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (52);
++ if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (53);
+
+- /* Check INF */
+- mpfr_set_inf (x, 1);
+- if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR1;
++ /* Check INF */
++ mpfr_set_inf (x, 1);
++ if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (54);
++ if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (55);
+
+- /* Check Zero */
+- MPFR_SET_ZERO (x);
+- if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR2;
++ /* Check Zero */
++ MPFR_SET_ZERO (x);
++ if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (56);
++ if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (57);
+
+- /* Check small op */
+- mpfr_set_str1 (x, "1@-1");
+- if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR2;
++ /* Check positive small op */
++ mpfr_set_str1 (x, "1@-1");
++ if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (58);
++ if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (59);
+
+- /* Check 17 */
+- mpfr_set_ui (x, 17, MPFR_RNDN);
+- if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR2;
+- if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR2;
++ /* Check 17 */
++ mpfr_set_ui (x, 17, MPFR_RNDN);
++ if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (60);
++ if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (61);
+
+- /* Check hugest */
+- mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN);
+- if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR1;
+- if (mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR1;
++ /* Check hugest */
++ mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN);
++ if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (62);
++ if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (63);
+
+- /* Check all other values */
+- mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
+- mpfr_add_ui (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR1;
+- mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
+- if (!mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
+- mpfr_add_ui (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR1;
+- mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
+- if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN);
+- if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR2;
+- mpfr_sub_ui (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR1;
++ /* Check all other values */
++ mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
++ mpfr_add_ui (x, x, 1, MPFR_RNDN);
++ if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (64);
++ mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
++ if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (65);
++ mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
++ mpfr_add_ui (x, x, 1, MPFR_RNDN);
++ if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (66);
++ mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
++ if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (67);
++ mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN);
++ if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (68);
++ mpfr_sub_ui (x, x, 1, MPFR_RNDN);
++ if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (69);
+
+- /* Check negative value */
+- mpfr_set_si (x, -1, MPFR_RNDN);
+- if (!mpfr_fits_intmax_p (x, MPFR_RNDN))
+- ERROR2;
+- if (mpfr_fits_uintmax_p (x, MPFR_RNDN))
+- ERROR1;
++ /* Check negative op */
++ for (i = 1; i <= 4; i++)
++ {
++ int inv;
++
++ mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
++ mpfr_rint (y, x, (mpfr_rnd_t) r);
++ inv = MPFR_NOTZERO (y);
++ if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r) ^ inv)
++ ERROR1 (70);
++ if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
++ ERROR1 (71);
++ }
++ }
+
+ mpfr_clear (x);
++ mpfr_clear (y);
+ #endif
+ }
+-
diff --git a/patches/mpfr/3.1.2/130-clang-divby0.patch b/patches/mpfr/3.1.2/130-clang-divby0.patch
new file mode 100644
index 0000000..8e0cd8e
--- /dev/null
+++ b/patches/mpfr/3.1.2/130-clang-divby0.patch
@@ -0,0 +1,129 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2013-10-09 13:34:21.000000000 +0000
++++ mpfr-3.1.2-b/PATCHES 2013-10-09 13:34:21.000000000 +0000
+@@ -0,0 +1 @@
++clang-divby0
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2013-09-26 10:52:52.000000000 +0000
++++ mpfr-3.1.2-b/VERSION 2013-10-09 13:34:21.000000000 +0000
+@@ -1 +1 @@
+-3.1.2-p2
++3.1.2-p3
+diff -Naurd mpfr-3.1.2-a/src/mpfr-impl.h mpfr-3.1.2-b/src/mpfr-impl.h
+--- mpfr-3.1.2-a/src/mpfr-impl.h 2013-03-13 15:37:36.000000000 +0000
++++ mpfr-3.1.2-b/src/mpfr-impl.h 2013-10-09 13:34:21.000000000 +0000
+@@ -468,8 +468,16 @@
+ #define MPFR_LIMBS_PER_FLT ((IEEE_FLT_MANT_DIG-1)/GMP_NUMB_BITS+1)
+
+ /* Visual C++ doesn't support +1.0/0.0, -1.0/0.0 and 0.0/0.0
+- at compile time. */
+-#if defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200)
++ at compile time.
++ Clang with -fsanitize=undefined is a bit similar due to a bug:
++ http://llvm.org/bugs/show_bug.cgi?id=17381
++ but even without its sanitizer, it may be better to use the
++ double_zero version until IEEE 754 division by zero is properly
++ supported:
++ http://llvm.org/bugs/show_bug.cgi?id=17000
++*/
++#if (defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200)) || \
++ defined(__clang__)
+ static double double_zero = 0.0;
+ # define DBL_NAN (double_zero/double_zero)
+ # define DBL_POS_INF ((double) 1.0/double_zero)
+@@ -501,6 +509,8 @@
+ (with Xcode 2.4.1, i.e. the latest one). */
+ #define LVALUE(x) (&(x) == &(x) || &(x) != &(x))
+ #define DOUBLE_ISINF(x) (LVALUE(x) && ((x) > DBL_MAX || (x) < -DBL_MAX))
++/* The DOUBLE_ISNAN(x) macro is also valid on long double x
++ (assuming that the compiler isn't too broken). */
+ #ifdef MPFR_NANISNAN
+ /* Avoid MIPSpro / IRIX64 / gcc -ffast-math (incorrect) optimizations.
+ The + must not be replaced by a ||. With gcc -ffast-math, NaN is
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2013-09-26 10:52:52.000000000 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2013-10-09 13:34:21.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p2"
++#define MPFR_VERSION_STRING "3.1.2-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2013-09-26 10:52:52.000000000 +0000
++++ mpfr-3.1.2-b/src/version.c 2013-10-09 13:34:21.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p2";
++ return "3.1.2-p3";
+ }
+diff -Naurd mpfr-3.1.2-a/tests/tget_flt.c mpfr-3.1.2-b/tests/tget_flt.c
+--- mpfr-3.1.2-a/tests/tget_flt.c 2013-03-13 15:37:44.000000000 +0000
++++ mpfr-3.1.2-b/tests/tget_flt.c 2013-10-09 13:34:21.000000000 +0000
+@@ -28,9 +28,17 @@
+ main (void)
+ {
+ mpfr_t x, y;
+- float f, g, infp;
++ float f, g;
+ int i;
++#if !defined(MPFR_ERRDIVZERO)
++ float infp;
++#endif
++
++ tests_start_mpfr ();
+
++#if !defined(MPFR_ERRDIVZERO)
++ /* The definition of DBL_POS_INF involves a division by 0. This makes
++ "clang -O2 -fsanitize=undefined -fno-sanitize-recover" fail. */
+ infp = (float) DBL_POS_INF;
+ if (infp * 0.5 != infp)
+ {
+@@ -38,8 +46,7 @@
+ fprintf (stderr, "(this is probably a compiler bug, please report)\n");
+ exit (1);
+ }
+-
+- tests_start_mpfr ();
++#endif
+
+ mpfr_init2 (x, 24);
+ mpfr_init2 (y, 24);
+@@ -353,6 +360,7 @@
+ printf ("expected %.8e, got %.8e\n", g, f);
+ exit (1);
+ }
++#if !defined(MPFR_ERRDIVZERO)
+ f = mpfr_get_flt (x, MPFR_RNDN); /* first round to 2^128 (even rule),
+ thus we should get +Inf */
+ g = infp;
+@@ -376,6 +384,7 @@
+ printf ("expected %.8e, got %.8e\n", g, f);
+ exit (1);
+ }
++#endif
+
+ mpfr_clear (x);
+ mpfr_clear (y);
+diff -Naurd mpfr-3.1.2-a/tests/tset_ld.c mpfr-3.1.2-b/tests/tset_ld.c
+--- mpfr-3.1.2-a/tests/tset_ld.c 2013-03-13 15:37:44.000000000 +0000
++++ mpfr-3.1.2-b/tests/tset_ld.c 2013-10-09 13:34:21.000000000 +0000
+@@ -47,8 +47,11 @@
+ static int
+ Isnan_ld (long double d)
+ {
+- double e = (double) d;
+- if (DOUBLE_ISNAN (e))
++ /* Do not convert d to double as this can give an overflow, which
++ may confuse compilers without IEEE 754 support (such as clang
++ -fsanitize=undefined), or trigger a trap if enabled.
++ The DOUBLE_ISNAN macro should work fine on long double. */
++ if (DOUBLE_ISNAN (d))
+ return 1;
+ LONGDOUBLE_NAN_ACTION (d, goto yes);
+ return 0;
diff --git a/patches/mpfr/3.1.2/140-printf-alt0.patch b/patches/mpfr/3.1.2/140-printf-alt0.patch
new file mode 100644
index 0000000..2451f36
--- /dev/null
+++ b/patches/mpfr/3.1.2/140-printf-alt0.patch
@@ -0,0 +1,84 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2013-11-15 00:51:49.211333830 +0000
++++ mpfr-3.1.2-b/PATCHES 2013-11-15 00:51:49.323334999 +0000
+@@ -0,0 +1 @@
++printf-alt0
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2013-11-15 00:51:49.211333830 +0000
++++ mpfr-3.1.2-b/VERSION 2013-11-15 00:51:49.323334999 +0000
+@@ -1 +1 @@
+-3.1.2-p3
++3.1.2-p4
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2013-11-15 00:51:49.211333830 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2013-11-15 00:51:49.323334999 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p3"
++#define MPFR_VERSION_STRING "3.1.2-p4"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/vasprintf.c mpfr-3.1.2-b/src/vasprintf.c
+--- mpfr-3.1.2-a/src/vasprintf.c 2013-03-13 15:37:37.000000000 +0000
++++ mpfr-3.1.2-b/src/vasprintf.c 2013-11-15 00:51:49.267334408 +0000
+@@ -1040,7 +1040,7 @@
+ }
+
+ /* Determine the different parts of the string representation of the regular
+- number P when SPEC.SPEC is 'e', 'E', 'g', or 'G'.
++ number P when spec.spec is 'e', 'E', 'g', or 'G'.
+ DEC_INFO contains the previously computed exponent and string or is NULL.
+
+ return -1 if some field > INT_MAX */
+@@ -1167,7 +1167,7 @@
+ }
+
+ /* Determine the different parts of the string representation of the regular
+- number P when SPEC.SPEC is 'f', 'F', 'g', or 'G'.
++ number P when spec.spec is 'f', 'F', 'g', or 'G'.
+ DEC_INFO contains the previously computed exponent and string or is NULL.
+
+ return -1 if some field of number_parts is greater than INT_MAX */
+@@ -1559,7 +1559,7 @@
+ /* fractional part */
+ {
+ np->point = MPFR_DECIMAL_POINT;
+- np->fp_trailing_zeros = (spec.spec == 'g' && spec.spec == 'G') ?
++ np->fp_trailing_zeros = (spec.spec == 'g' || spec.spec == 'G') ?
+ spec.prec - 1 : spec.prec;
+ }
+ else if (spec.alt)
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2013-11-15 00:51:49.211333830 +0000
++++ mpfr-3.1.2-b/src/version.c 2013-11-15 00:51:49.323334999 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p3";
++ return "3.1.2-p4";
+ }
+diff -Naurd mpfr-3.1.2-a/tests/tsprintf.c mpfr-3.1.2-b/tests/tsprintf.c
+--- mpfr-3.1.2-a/tests/tsprintf.c 2013-03-13 15:37:44.000000000 +0000
++++ mpfr-3.1.2-b/tests/tsprintf.c 2013-11-15 00:51:49.267334408 +0000
+@@ -456,10 +456,16 @@
+ check_sprintf ("1.999900 ", "%-#10.7RG", x);
+ check_sprintf ("1.9999 ", "%-10.7RG", x);
+ mpfr_set_ui (x, 1, MPFR_RNDN);
++ check_sprintf ("1.", "%#.1Rg", x);
++ check_sprintf ("1. ", "%-#5.1Rg", x);
++ check_sprintf (" 1.0", "%#5.2Rg", x);
+ check_sprintf ("1.00000000000000000000000000000", "%#.30Rg", x);
+ check_sprintf ("1", "%.30Rg", x);
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+- check_sprintf ("0.000000000000000000000000000000", "%#.30Rg", x);
++ check_sprintf ("0.", "%#.1Rg", x);
++ check_sprintf ("0. ", "%-#5.1Rg", x);
++ check_sprintf (" 0.0", "%#5.2Rg", x);
++ check_sprintf ("0.00000000000000000000000000000", "%#.30Rg", x);
+ check_sprintf ("0", "%.30Rg", x);
+
+ /* following tests with precision 53 bits */
diff --git a/patches/mpfr/3.1.2/150-custom_init_set.patch b/patches/mpfr/3.1.2/150-custom_init_set.patch
new file mode 100644
index 0000000..669b91d
--- /dev/null
+++ b/patches/mpfr/3.1.2/150-custom_init_set.patch
@@ -0,0 +1,42 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2013-12-01 11:07:49.575329762 +0000
++++ mpfr-3.1.2-b/PATCHES 2013-12-01 11:07:49.751331625 +0000
+@@ -0,0 +1 @@
++custom_init_set
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2013-12-01 11:07:49.571329714 +0000
++++ mpfr-3.1.2-b/VERSION 2013-12-01 11:07:49.747331585 +0000
+@@ -1 +1 @@
+-3.1.2-p4
++3.1.2-p5
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2013-12-01 11:07:49.571329714 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2013-12-01 11:07:49.747331585 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p4"
++#define MPFR_VERSION_STRING "3.1.2-p5"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+@@ -861,7 +861,7 @@
+ _t = (mpfr_kind_t) _k; \
+ _s = 1; \
+ } else { \
+- _t = (mpfr_kind_t) -k; \
++ _t = (mpfr_kind_t) - _k; \
+ _s = -1; \
+ } \
+ _e = _t == MPFR_REGULAR_KIND ? (e) : \
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2013-12-01 11:07:49.575329762 +0000
++++ mpfr-3.1.2-b/src/version.c 2013-12-01 11:07:49.747331585 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p4";
++ return "3.1.2-p5";
+ }
diff --git a/patches/mpfr/3.1.2/160-li2-return.patch b/patches/mpfr/3.1.2/160-li2-return.patch
new file mode 100644
index 0000000..50cd04d
--- /dev/null
+++ b/patches/mpfr/3.1.2/160-li2-return.patch
@@ -0,0 +1,43 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2014-04-15 21:56:49.609057464 +0000
++++ mpfr-3.1.2-b/PATCHES 2014-04-15 21:56:49.697059857 +0000
+@@ -0,0 +1 @@
++li2-return
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2014-04-15 21:56:49.609057464 +0000
++++ mpfr-3.1.2-b/VERSION 2014-04-15 21:56:49.697059857 +0000
+@@ -1 +1 @@
+-3.1.2-p5
++3.1.2-p6
+diff -Naurd mpfr-3.1.2-a/src/li2.c mpfr-3.1.2-b/src/li2.c
+--- mpfr-3.1.2-a/src/li2.c 2013-03-13 15:37:32.000000000 +0000
++++ mpfr-3.1.2-b/src/li2.c 2014-04-15 21:56:49.653058661 +0000
+@@ -630,5 +630,5 @@
+ return mpfr_check_range (y, inexact, rnd_mode);
+ }
+
+- MPFR_ASSERTN (0); /* should never reach this point */
++ MPFR_RET_NEVER_GO_HERE ();
+ }
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2014-04-15 21:56:49.609057464 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2014-04-15 21:56:49.697059857 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p5"
++#define MPFR_VERSION_STRING "3.1.2-p6"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2014-04-15 21:56:49.609057464 +0000
++++ mpfr-3.1.2-b/src/version.c 2014-04-15 21:56:49.697059857 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p5";
++ return "3.1.2-p6";
+ }
diff --git a/patches/mpfr/3.1.2/170-exp3.patch b/patches/mpfr/3.1.2/170-exp3.patch
new file mode 100644
index 0000000..378c3bf
--- /dev/null
+++ b/patches/mpfr/3.1.2/170-exp3.patch
@@ -0,0 +1,71 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2014-04-15 22:04:57.090286262 +0000
++++ mpfr-3.1.2-b/PATCHES 2014-04-15 22:04:57.162288198 +0000
+@@ -0,0 +1 @@
++exp3
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2014-04-15 22:04:57.086286154 +0000
++++ mpfr-3.1.2-b/VERSION 2014-04-15 22:04:57.162288198 +0000
+@@ -1 +1 @@
+-3.1.2-p6
++3.1.2-p7
+diff -Naurd mpfr-3.1.2-a/src/exp3.c mpfr-3.1.2-b/src/exp3.c
+--- mpfr-3.1.2-a/src/exp3.c 2013-03-13 15:37:34.000000000 +0000
++++ mpfr-3.1.2-b/src/exp3.c 2014-04-15 22:04:57.126287230 +0000
+@@ -283,7 +283,7 @@
+ }
+ }
+
+- if (mpfr_can_round (shift_x > 0 ? t : tmp, realprec, MPFR_RNDD, MPFR_RNDZ,
++ if (mpfr_can_round (shift_x > 0 ? t : tmp, realprec, MPFR_RNDN, MPFR_RNDZ,
+ MPFR_PREC(y) + (rnd_mode == MPFR_RNDN)))
+ {
+ inexact = mpfr_set (y, shift_x > 0 ? t : tmp, rnd_mode);
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2014-04-15 22:04:57.086286154 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2014-04-15 22:04:57.162288198 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p6"
++#define MPFR_VERSION_STRING "3.1.2-p7"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2014-04-15 22:04:57.090286262 +0000
++++ mpfr-3.1.2-b/src/version.c 2014-04-15 22:04:57.162288198 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p6";
++ return "3.1.2-p7";
+ }
+diff -Naurd mpfr-3.1.2-a/tests/texp.c mpfr-3.1.2-b/tests/texp.c
+--- mpfr-3.1.2-a/tests/texp.c 2013-03-13 15:37:44.000000000 +0000
++++ mpfr-3.1.2-b/tests/texp.c 2014-04-15 22:04:57.126287230 +0000
+@@ -150,6 +150,22 @@
+ exit (1);
+ }
+
++ mpfr_set_prec (x, 118);
++ mpfr_set_str_binary (x, "0.1110010100011101010000111110011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E-86");
++ mpfr_set_prec (y, 118);
++ mpfr_exp_2 (y, x, MPFR_RNDU);
++ mpfr_exp_3 (x, x, MPFR_RNDU);
++ if (mpfr_cmp (x, y))
++ {
++ printf ("mpfr_exp_2 and mpfr_exp_3 differ for prec=118\n");
++ printf ("mpfr_exp_2 gives ");
++ mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
++ printf ("\nmpfr_exp_3 gives ");
++ mpfr_out_str (stdout, 2, 0, x, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++
+ mpfr_clear (x);
+ mpfr_clear (y);
+ return 0;
diff --git a/patches/mpfr/3.1.2/180-gmp6-compat.patch b/patches/mpfr/3.1.2/180-gmp6-compat.patch
new file mode 100644
index 0000000..2245c7c
--- /dev/null
+++ b/patches/mpfr/3.1.2/180-gmp6-compat.patch
@@ -0,0 +1,254 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2014-04-15 22:20:32.243481506 +0000
++++ mpfr-3.1.2-b/PATCHES 2014-04-15 22:22:32.418722707 +0000
+@@ -0,0 +1 @@
++gmp6-compat
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2014-04-15 22:20:20.755171478 +0000
++++ mpfr-3.1.2-b/VERSION 2014-04-15 22:21:45.225450147 +0000
+@@ -1 +1 @@
+-3.1.2-p7
++3.1.2-p8
+diff -Naurd mpfr-3.1.2-a/configure mpfr-3.1.2-b/configure
+--- mpfr-3.1.2-a/configure 2013-03-13 15:38:20.000000000 +0000
++++ mpfr-3.1.2-b/configure 2014-04-15 22:21:38.821277476 +0000
+@@ -14545,26 +14545,30 @@
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+-if test "$use_gmp_build" = yes ; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for valid GMP_NUMB_BITS" >&5
+-$as_echo_n "checking for valid GMP_NUMB_BITS... " >&6; }
+- if test "$cross_compiling" = yes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency" >&5
++$as_echo_n "checking for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency... " >&6; }
++if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't test" >&5
+ $as_echo "can't test" >&6; }
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
++#include <stdio.h>
+ #include <limits.h>
+ #include "gmp.h"
+-#include "gmp-impl.h"
+
+ int
+ main ()
+ {
+
+- return GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
+- && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1;
++ if (GMP_NUMB_BITS == sizeof(mp_limb_t) * CHAR_BIT)
++ return 0;
++ fprintf (stderr, "GMP_NUMB_BITS = %ld\n", (long) GMP_NUMB_BITS);
++ fprintf (stderr, "sizeof(mp_limb_t) = %ld\n", (long) sizeof(mp_limb_t));
++ fprintf (stderr, "sizeof(mp_limb_t) * CHAR_BIT = %ld != GMP_NUMB_BITS\n",
++ (long) (sizeof(mp_limb_t) * CHAR_BIT));
++ return 1;
+
+ ;
+ return 0;
+@@ -14577,14 +14581,14 @@
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
+- as_fn_error $? "GMP_NUMB_BITS is incorrect.
+-You probably need to change some of the GMP or MPFR compile options." "$LINENO" 5
++ as_fn_error $? "GMP_NUMB_BITS and sizeof(mp_limb_t) are not consistent.
++You probably need to change some of the GMP or MPFR compile options.
++See 'config.log' for details (search for GMP_NUMB_BITS)." "$LINENO" 5
+ fi
+ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+ fi
+
+-fi
+
+
+ if test "$dont_link_with_gmp" = yes ; then
+diff -Naurd mpfr-3.1.2-a/configure.ac mpfr-3.1.2-b/configure.ac
+--- mpfr-3.1.2-a/configure.ac 2013-03-13 15:37:46.000000000 +0000
++++ mpfr-3.1.2-b/configure.ac 2013-03-13 15:37:46.000000000 +0000
+@@ -435,23 +435,29 @@
+ ])
+ fi
+
+-dnl Check for valid GMP_NUMB_BITS and BYTES_PER_MP_LIMB
++dnl Check for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency.
++dnl Problems may occur if gmp.h was generated with some ABI
++dnl and is used with another ABI (or if nails are used).
+ dnl This test doesn't need to link with libgmp (at least it shouldn't).
+-if test "$use_gmp_build" = yes ; then
+- AC_MSG_CHECKING(for valid GMP_NUMB_BITS)
+- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
++AC_MSG_CHECKING(for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency)
++AC_RUN_IFELSE([AC_LANG_PROGRAM([[
++#include <stdio.h>
+ #include <limits.h>
+ #include "gmp.h"
+-#include "gmp-impl.h"
+ ]], [[
+- return GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
+- && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1;
++ if (GMP_NUMB_BITS == sizeof(mp_limb_t) * CHAR_BIT)
++ return 0;
++ fprintf (stderr, "GMP_NUMB_BITS = %ld\n", (long) GMP_NUMB_BITS);
++ fprintf (stderr, "sizeof(mp_limb_t) = %ld\n", (long) sizeof(mp_limb_t));
++ fprintf (stderr, "sizeof(mp_limb_t) * CHAR_BIT = %ld != GMP_NUMB_BITS\n",
++ (long) (sizeof(mp_limb_t) * CHAR_BIT));
++ return 1;
+ ]])], [AC_MSG_RESULT(yes)], [
+ AC_MSG_RESULT(no)
+- AC_MSG_ERROR([GMP_NUMB_BITS is incorrect.
+-You probably need to change some of the GMP or MPFR compile options.])],
++ AC_MSG_ERROR([GMP_NUMB_BITS and sizeof(mp_limb_t) are not consistent.
++You probably need to change some of the GMP or MPFR compile options.
++See 'config.log' for details (search for GMP_NUMB_BITS).])],
+ [AC_MSG_RESULT([can't test])])
+-fi
+
+
+ dnl We really need to link using libtool. But it is impossible with the current
+diff -Naurd mpfr-3.1.2-a/src/init2.c mpfr-3.1.2-b/src/init2.c
+--- mpfr-3.1.2-a/src/init2.c 2013-03-13 15:37:32.000000000 +0000
++++ mpfr-3.1.2-b/src/init2.c 2014-04-15 22:21:06.220398489 +0000
+@@ -30,11 +30,11 @@
+
+ /* Check if we can represent the number of limbs
+ * associated to the maximum of mpfr_prec_t*/
+- MPFR_ASSERTN( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/BYTES_PER_MP_LIMB) );
++ MPFR_ASSERTN( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/MPFR_BYTES_PER_MP_LIMB) );
+
+- /* Check for correct GMP_NUMB_BITS and BYTES_PER_MP_LIMB */
+- MPFR_ASSERTN( GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
+- && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB );
++ /* Check for correct GMP_NUMB_BITS and MPFR_BYTES_PER_MP_LIMB */
++ MPFR_ASSERTN( GMP_NUMB_BITS == MPFR_BYTES_PER_MP_LIMB * CHAR_BIT
++ && sizeof(mp_limb_t) == MPFR_BYTES_PER_MP_LIMB );
+
+ MPFR_ASSERTN (mp_bits_per_limb == GMP_NUMB_BITS);
+
+diff -Naurd mpfr-3.1.2-a/src/mpfr-gmp.h mpfr-3.1.2-b/src/mpfr-gmp.h
+--- mpfr-3.1.2-a/src/mpfr-gmp.h 2013-03-13 15:37:32.000000000 +0000
++++ mpfr-3.1.2-b/src/mpfr-gmp.h 2014-04-15 22:21:06.220398489 +0000
+@@ -72,7 +72,6 @@
+ #endif
+
+ /* Define some macros */
+-#define BYTES_PER_MP_LIMB (GMP_NUMB_BITS/CHAR_BIT)
+
+ #define MP_LIMB_T_MAX (~(mp_limb_t)0)
+
+@@ -96,19 +95,19 @@
+ #define SHRT_HIGHBIT SHRT_MIN
+
+ /* MP_LIMB macros */
+-#define MPN_ZERO(dst, n) memset((dst), 0, (n)*BYTES_PER_MP_LIMB)
+-#define MPN_COPY_DECR(dst,src,n) memmove((dst),(src),(n)*BYTES_PER_MP_LIMB)
+-#define MPN_COPY_INCR(dst,src,n) memmove((dst),(src),(n)*BYTES_PER_MP_LIMB)
++#define MPN_ZERO(dst, n) memset((dst), 0, (n)*MPFR_BYTES_PER_MP_LIMB)
++#define MPN_COPY_DECR(dst,src,n) memmove((dst),(src),(n)*MPFR_BYTES_PER_MP_LIMB)
++#define MPN_COPY_INCR(dst,src,n) memmove((dst),(src),(n)*MPFR_BYTES_PER_MP_LIMB)
+ #define MPN_COPY(dst,src,n) \
+ do \
+ { \
+ if ((dst) != (src)) \
+ { \
+ MPFR_ASSERTD ((char *) (dst) >= (char *) (src) + \
+- (n) * BYTES_PER_MP_LIMB || \
++ (n) * MPFR_BYTES_PER_MP_LIMB || \
+ (char *) (src) >= (char *) (dst) + \
+- (n) * BYTES_PER_MP_LIMB); \
+- memcpy ((dst), (src), (n) * BYTES_PER_MP_LIMB); \
++ (n) * MPFR_BYTES_PER_MP_LIMB); \
++ memcpy ((dst), (src), (n) * MPFR_BYTES_PER_MP_LIMB); \
+ } \
+ } \
+ while (0)
+diff -Naurd mpfr-3.1.2-a/src/mpfr-impl.h mpfr-3.1.2-b/src/mpfr-impl.h
+--- mpfr-3.1.2-a/src/mpfr-impl.h 2013-10-09 13:34:21.000000000 +0000
++++ mpfr-3.1.2-b/src/mpfr-impl.h 2014-04-15 22:21:06.220398489 +0000
+@@ -191,7 +191,7 @@
+ # endif
+ #endif
+
+-
++#define MPFR_BYTES_PER_MP_LIMB (GMP_NUMB_BITS/CHAR_BIT)
+
+ /******************************************************
+ ******************** Check GMP ***********************
+@@ -930,7 +930,7 @@
+ #define MPFR_SET_ALLOC_SIZE(x, n) \
+ ( ((mp_size_t*) MPFR_MANT(x))[-1] = n)
+ #define MPFR_MALLOC_SIZE(s) \
+- ( sizeof(mpfr_size_limb_t) + BYTES_PER_MP_LIMB * ((size_t) s) )
++ ( sizeof(mpfr_size_limb_t) + MPFR_BYTES_PER_MP_LIMB * ((size_t) s) )
+ #define MPFR_SET_MANT_PTR(x,p) \
+ (MPFR_MANT(x) = (mp_limb_t*) ((mpfr_size_limb_t*) p + 1))
+ #define MPFR_GET_REAL_PTR(x) \
+@@ -964,7 +964,7 @@
+ #endif
+
+ #define MPFR_TMP_LIMBS_ALLOC(N) \
+- ((mp_limb_t *) MPFR_TMP_ALLOC ((size_t) (N) * BYTES_PER_MP_LIMB))
++ ((mp_limb_t *) MPFR_TMP_ALLOC ((size_t) (N) * MPFR_BYTES_PER_MP_LIMB))
+
+ /* temporary allocate 1 limb at xp, and initialize mpfr variable x */
+ /* The temporary var doesn't have any size field, but it doesn't matter
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2014-04-15 22:20:20.755171478 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2014-04-15 22:21:45.225450147 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p7"
++#define MPFR_VERSION_STRING "3.1.2-p8"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/mul.c mpfr-3.1.2-b/src/mul.c
+--- mpfr-3.1.2-a/src/mul.c 2013-03-13 15:37:37.000000000 +0000
++++ mpfr-3.1.2-b/src/mul.c 2014-04-15 22:21:06.224398597 +0000
+@@ -106,7 +106,7 @@
+ MPFR_ASSERTD(tn <= k);
+
+ /* Check for no size_t overflow*/
+- MPFR_ASSERTD((size_t) k <= ((size_t) -1) / BYTES_PER_MP_LIMB);
++ MPFR_ASSERTD((size_t) k <= ((size_t) -1) / MPFR_BYTES_PER_MP_LIMB);
+ MPFR_TMP_MARK(marker);
+ tmp = MPFR_TMP_LIMBS_ALLOC (k);
+
+@@ -301,7 +301,7 @@
+ MPFR_ASSERTD (tn <= k); /* tn <= k, thus no int overflow */
+
+ /* Check for no size_t overflow*/
+- MPFR_ASSERTD ((size_t) k <= ((size_t) -1) / BYTES_PER_MP_LIMB);
++ MPFR_ASSERTD ((size_t) k <= ((size_t) -1) / MPFR_BYTES_PER_MP_LIMB);
+ MPFR_TMP_MARK (marker);
+ tmp = MPFR_TMP_LIMBS_ALLOC (k);
+
+diff -Naurd mpfr-3.1.2-a/src/stack_interface.c mpfr-3.1.2-b/src/stack_interface.c
+--- mpfr-3.1.2-a/src/stack_interface.c 2013-03-13 15:37:32.000000000 +0000
++++ mpfr-3.1.2-b/src/stack_interface.c 2014-04-15 22:21:06.220398489 +0000
+@@ -26,7 +26,7 @@
+ size_t
+ mpfr_custom_get_size (mpfr_prec_t prec)
+ {
+- return MPFR_PREC2LIMBS (prec) * BYTES_PER_MP_LIMB;
++ return MPFR_PREC2LIMBS (prec) * MPFR_BYTES_PER_MP_LIMB;
+ }
+
+ #undef mpfr_custom_init
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2014-04-15 22:20:20.755171478 +0000
++++ mpfr-3.1.2-b/src/version.c 2014-04-15 22:21:45.225450147 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p7";
++ return "3.1.2-p8";
+ }
diff --git a/patches/mpfr/3.1.2/190-div-overflow.patch b/patches/mpfr/3.1.2/190-div-overflow.patch
new file mode 100644
index 0000000..6ff7c4a
--- /dev/null
+++ b/patches/mpfr/3.1.2/190-div-overflow.patch
@@ -0,0 +1,166 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2014-06-30 15:15:25.533266905 +0000
++++ mpfr-3.1.2-b/PATCHES 2014-06-30 15:15:25.617269178 +0000
+@@ -0,0 +1 @@
++div-overflow
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2014-06-30 15:15:25.529266797 +0000
++++ mpfr-3.1.2-b/VERSION 2014-06-30 15:15:25.617269178 +0000
+@@ -1 +1 @@
+-3.1.2-p8
++3.1.2-p9
+diff -Naurd mpfr-3.1.2-a/src/div.c mpfr-3.1.2-b/src/div.c
+--- mpfr-3.1.2-a/src/div.c 2013-03-13 15:37:33.000000000 +0000
++++ mpfr-3.1.2-b/src/div.c 2014-06-30 15:15:25.585268312 +0000
+@@ -750,7 +750,9 @@
+ truncate_check_qh:
+ if (qh)
+ {
+- qexp ++;
++ if (MPFR_LIKELY (qexp < MPFR_EXP_MAX))
++ qexp ++;
++ /* else qexp is now incorrect, but one will still get an overflow */
+ q0p[q0size - 1] = MPFR_LIMB_HIGHBIT;
+ }
+ goto truncate;
+@@ -765,7 +767,9 @@
+ inex = 1; /* always here */
+ if (mpn_add_1 (q0p, q0p, q0size, MPFR_LIMB_ONE << sh))
+ {
+- qexp ++;
++ if (MPFR_LIKELY (qexp < MPFR_EXP_MAX))
++ qexp ++;
++ /* else qexp is now incorrect, but one will still get an overflow */
+ q0p[q0size - 1] = MPFR_LIMB_HIGHBIT;
+ }
+
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2014-06-30 15:15:25.533266905 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2014-06-30 15:15:25.613269070 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p8"
++#define MPFR_VERSION_STRING "3.1.2-p9"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2014-06-30 15:15:25.533266905 +0000
++++ mpfr-3.1.2-b/src/version.c 2014-06-30 15:15:25.613269070 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p8";
++ return "3.1.2-p9";
+ }
+diff -Naurd mpfr-3.1.2-a/tests/tdiv.c mpfr-3.1.2-b/tests/tdiv.c
+--- mpfr-3.1.2-a/tests/tdiv.c 2013-03-13 15:37:44.000000000 +0000
++++ mpfr-3.1.2-b/tests/tdiv.c 2014-06-30 15:15:25.585268312 +0000
+@@ -1104,6 +1104,96 @@
+ #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100, RANDS)
+ #include "tgeneric.c"
+
++static void
++test_extreme (void)
++{
++ mpfr_t x, y, z;
++ mpfr_exp_t emin, emax;
++ mpfr_prec_t p[4] = { 8, 32, 64, 256 };
++ int xi, yi, zi, j, r;
++ unsigned int flags, ex_flags;
++
++ emin = mpfr_get_emin ();
++ emax = mpfr_get_emax ();
++
++ mpfr_set_emin (MPFR_EMIN_MIN);
++ mpfr_set_emax (MPFR_EMAX_MAX);
++
++ for (xi = 0; xi < 4; xi++)
++ {
++ mpfr_init2 (x, p[xi]);
++ mpfr_setmax (x, MPFR_EMAX_MAX);
++ MPFR_ASSERTN (mpfr_check (x));
++ for (yi = 0; yi < 4; yi++)
++ {
++ mpfr_init2 (y, p[yi]);
++ mpfr_setmin (y, MPFR_EMIN_MIN);
++ for (j = 0; j < 2; j++)
++ {
++ MPFR_ASSERTN (mpfr_check (y));
++ for (zi = 0; zi < 4; zi++)
++ {
++ mpfr_init2 (z, p[zi]);
++ RND_LOOP (r)
++ {
++ mpfr_clear_flags ();
++ mpfr_div (z, x, y, (mpfr_rnd_t) r);
++ flags = __gmpfr_flags;
++ MPFR_ASSERTN (mpfr_check (z));
++ ex_flags = MPFR_FLAGS_OVERFLOW | MPFR_FLAGS_INEXACT;
++ if (flags != ex_flags)
++ {
++ printf ("Bad flags in test_extreme on z = a/b"
++ " with %s and\n",
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r));
++ printf ("a = ");
++ mpfr_dump (x);
++ printf ("b = ");
++ mpfr_dump (y);
++ printf ("Expected flags:");
++ flags_out (ex_flags);
++ printf ("Got flags: ");
++ flags_out (flags);
++ printf ("z = ");
++ mpfr_dump (z);
++ exit (1);
++ }
++ mpfr_clear_flags ();
++ mpfr_div (z, y, x, (mpfr_rnd_t) r);
++ flags = __gmpfr_flags;
++ MPFR_ASSERTN (mpfr_check (z));
++ ex_flags = MPFR_FLAGS_UNDERFLOW | MPFR_FLAGS_INEXACT;
++ if (flags != ex_flags)
++ {
++ printf ("Bad flags in test_extreme on z = a/b"
++ " with %s and\n",
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r));
++ printf ("a = ");
++ mpfr_dump (y);
++ printf ("b = ");
++ mpfr_dump (x);
++ printf ("Expected flags:");
++ flags_out (ex_flags);
++ printf ("Got flags: ");
++ flags_out (flags);
++ printf ("z = ");
++ mpfr_dump (z);
++ exit (1);
++ }
++ }
++ mpfr_clear (z);
++ } /* zi */
++ mpfr_nextabove (y);
++ } /* j */
++ mpfr_clear (y);
++ } /* yi */
++ mpfr_clear (x);
++ } /* xi */
++
++ set_emin (emin);
++ set_emax (emax);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -1130,6 +1220,7 @@
+ test_20070603 ();
+ test_20070628 ();
+ test_generic (2, 800, 50);
++ test_extreme ();
+
+ tests_end_mpfr ();
+ return 0;
diff --git a/patches/mpfr/3.1.2/200-vasprintf.patch b/patches/mpfr/3.1.2/200-vasprintf.patch
new file mode 100644
index 0000000..43848f7
--- /dev/null
+++ b/patches/mpfr/3.1.2/200-vasprintf.patch
@@ -0,0 +1,138 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2014-06-30 15:17:53.337268149 +0000
++++ mpfr-3.1.2-b/PATCHES 2014-06-30 15:17:53.417270314 +0000
+@@ -0,0 +1 @@
++vasprintf
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2014-06-30 15:17:53.337268149 +0000
++++ mpfr-3.1.2-b/VERSION 2014-06-30 15:17:53.413270206 +0000
+@@ -1 +1 @@
+-3.1.2-p9
++3.1.2-p10
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2014-06-30 15:17:53.337268149 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2014-06-30 15:17:53.413270206 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p9"
++#define MPFR_VERSION_STRING "3.1.2-p10"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/vasprintf.c mpfr-3.1.2-b/src/vasprintf.c
+--- mpfr-3.1.2-a/src/vasprintf.c 2013-11-15 00:51:49.267334408 +0000
++++ mpfr-3.1.2-b/src/vasprintf.c 2014-06-30 15:17:53.377269231 +0000
+@@ -884,14 +884,18 @@
+ first digit, we want the exponent for radix two and the decimal
+ point AFTER the first digit. */
+ {
+- MPFR_ASSERTN (exp > MPFR_EMIN_MIN /4); /* possible overflow */
++ /* An integer overflow is normally not possible since MPFR_EXP_MIN
++ is twice as large as MPFR_EMIN_MIN. */
++ MPFR_ASSERTN (exp > (MPFR_EXP_MIN + 3) / 4);
+ exp = (exp - 1) * 4;
+ }
+ else
+ /* EXP is the exponent for decimal point BEFORE the first digit, we
+ want the exponent for decimal point AFTER the first digit. */
+ {
+- MPFR_ASSERTN (exp > MPFR_EMIN_MIN); /* possible overflow */
++ /* An integer overflow is normally not possible since MPFR_EXP_MIN
++ is twice as large as MPFR_EMIN_MIN. */
++ MPFR_ASSERTN (exp > MPFR_EXP_MIN);
+ --exp;
+ }
+ }
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2014-06-30 15:17:53.337268149 +0000
++++ mpfr-3.1.2-b/src/version.c 2014-06-30 15:17:53.413270206 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p9";
++ return "3.1.2-p10";
+ }
+diff -Naurd mpfr-3.1.2-a/tests/tsprintf.c mpfr-3.1.2-b/tests/tsprintf.c
+--- mpfr-3.1.2-a/tests/tsprintf.c 2013-11-15 00:51:49.267334408 +0000
++++ mpfr-3.1.2-b/tests/tsprintf.c 2014-06-30 15:17:53.377269231 +0000
+@@ -1184,6 +1184,69 @@
+ check_emax_aux (MPFR_EMAX_MAX);
+ }
+
++static void
++check_emin_aux (mpfr_exp_t e)
++{
++ mpfr_t x;
++ char *s1, s2[256];
++ int i;
++ mpfr_exp_t emin;
++ mpz_t ee;
++
++ MPFR_ASSERTN (e >= LONG_MIN);
++ emin = mpfr_get_emin ();
++ set_emin (e);
++
++ mpfr_init2 (x, 16);
++ mpz_init (ee);
++
++ mpfr_setmin (x, e);
++ mpz_set_si (ee, e);
++ mpz_sub_ui (ee, ee, 1);
++
++ i = mpfr_asprintf (&s1, "%Ra", x);
++ MPFR_ASSERTN (i > 0);
++
++ gmp_snprintf (s2, 256, "0x1p%Zd", ee);
++
++ if (strcmp (s1, s2) != 0)
++ {
++ printf ("Error in check_emin_aux for emin = %ld\n", (long) e);
++ printf ("Expected %s\n", s2);
++ printf ("Got %s\n", s1);
++ exit (1);
++ }
++
++ mpfr_free_str (s1);
++
++ i = mpfr_asprintf (&s1, "%Rb", x);
++ MPFR_ASSERTN (i > 0);
++
++ gmp_snprintf (s2, 256, "1p%Zd", ee);
++
++ if (strcmp (s1, s2) != 0)
++ {
++ printf ("Error in check_emin_aux for emin = %ld\n", (long) e);
++ printf ("Expected %s\n", s2);
++ printf ("Got %s\n", s1);
++ exit (1);
++ }
++
++ mpfr_free_str (s1);
++
++ mpfr_clear (x);
++ mpz_clear (ee);
++ set_emin (emin);
++}
++
++static void
++check_emin (void)
++{
++ check_emin_aux (-15);
++ check_emin_aux (mpfr_get_emin ());
++ check_emin_aux (MPFR_EMIN_MIN);
++}
++
+ int
+ main (int argc, char **argv)
+ {
+@@ -1203,6 +1266,7 @@
+ decimal ();
+ mixed ();
+ check_emax ();
++ check_emin ();
+
+ #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE)
+ locale_da_DK ();
diff --git a/patches/mpfr/3.1.2/210-strtofr.patch b/patches/mpfr/3.1.2/210-strtofr.patch
new file mode 100644
index 0000000..462162e
--- /dev/null
+++ b/patches/mpfr/3.1.2/210-strtofr.patch
@@ -0,0 +1,49 @@
+diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
+--- mpfr-3.1.2-a/PATCHES 2014-12-04 01:41:57.131789485 +0000
++++ mpfr-3.1.2-b/PATCHES 2014-12-04 01:41:57.339791833 +0000
+@@ -0,0 +1 @@
++strtofr
+diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
+--- mpfr-3.1.2-a/VERSION 2014-12-04 01:41:57.127789443 +0000
++++ mpfr-3.1.2-b/VERSION 2014-12-04 01:41:57.339791833 +0000
+@@ -1 +1 @@
+-3.1.2-p10
++3.1.2-p11
+diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
+--- mpfr-3.1.2-a/src/mpfr.h 2014-12-04 01:41:57.127789443 +0000
++++ mpfr-3.1.2-b/src/mpfr.h 2014-12-04 01:41:57.335791790 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 2
+-#define MPFR_VERSION_STRING "3.1.2-p10"
++#define MPFR_VERSION_STRING "3.1.2-p11"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.2-a/src/strtofr.c mpfr-3.1.2-b/src/strtofr.c
+--- mpfr-3.1.2-a/src/strtofr.c 2013-03-13 15:37:32.000000000 +0000
++++ mpfr-3.1.2-b/src/strtofr.c 2014-12-04 01:41:57.287791246 +0000
+@@ -473,8 +473,10 @@
+ /* prec bits corresponds to ysize limbs */
+ ysize_bits = ysize * GMP_NUMB_BITS;
+ /* and to ysize_bits >= prec > MPFR_PREC (x) bits */
+- y = MPFR_TMP_LIMBS_ALLOC (2 * ysize + 1);
+- y += ysize; /* y has (ysize+1) allocated limbs */
++ /* we need to allocate one more limb to work around bug
++ https://gmplib.org/list-archives/gmp-bugs/2013-December/003267.html */
++ y = MPFR_TMP_LIMBS_ALLOC (2 * ysize + 2);
++ y += ysize; /* y has (ysize+2) allocated limbs */
+
+ /* pstr_size is the number of characters we read in pstr->mant
+ to have at least ysize full limbs.
+diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
+--- mpfr-3.1.2-a/src/version.c 2014-12-04 01:41:57.131789485 +0000
++++ mpfr-3.1.2-b/src/version.c 2014-12-04 01:41:57.339791833 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.2-p10";
++ return "3.1.2-p11";
+ }
diff --git a/patches/mpfr/3.1.3/110-lngamma-and-doc.patch b/patches/mpfr/3.1.3/110-lngamma-and-doc.patch
new file mode 100644
index 0000000..d7e1cbf
--- /dev/null
+++ b/patches/mpfr/3.1.3/110-lngamma-and-doc.patch
@@ -0,0 +1,1117 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2015-07-02 10:49:23.950112879 +0000
++++ mpfr-3.1.3-b/PATCHES 2015-07-02 10:49:24.042113845 +0000
+@@ -0,0 +1 @@
++lngamma-and-doc
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/VERSION 2015-07-02 10:49:24.042113845 +0000
+@@ -1 +1 @@
+-3.1.3
++3.1.3-p1
+diff -Naurd mpfr-3.1.3-a/doc/mpfr.texi mpfr-3.1.3-b/doc/mpfr.texi
+--- mpfr-3.1.3-a/doc/mpfr.texi 2015-06-19 19:55:11.000000000 +0000
++++ mpfr-3.1.3-b/doc/mpfr.texi 2015-07-02 10:49:24.018113593 +0000
+@@ -810,13 +810,17 @@
+ When the input point is in the closure of the domain of the mathematical
+ function and an input argument is +0 (resp.@: @minus{}0), one considers
+ the limit when the corresponding argument approaches 0 from above
+-(resp.@: below). If the limit is not defined (e.g., @code{mpfr_log} on
+-@minus{}0), the behavior is specified in the description of the MPFR function.
++(resp.@: below), if possible. If the limit is not defined (e.g.,
++@code{mpfr_sqrt} and @code{mpfr_log} on @minus{}0), the behavior is
++specified in the description of the MPFR function, but must be consistent
++with the rule from the above paragraph (e.g., @code{mpfr_log} on @pom{}0
++gives @minus{}Inf).
+
+ When the result is equal to 0, its sign is determined by considering the
+ limit as if the input point were not in the domain: If one approaches 0
+ from above (resp.@: below), the result is +0 (resp.@: @minus{}0);
+-for example, @code{mpfr_sin} on +0 gives +0.
++for example, @code{mpfr_sin} on @minus{}0 gives @minus{}0 and
++@code{mpfr_acos} on 1 gives +0 (in all rounding modes).
+ In the other cases, the sign is specified in the description of the MPFR
+ function; for example @code{mpfr_max} on @minus{}0 and +0 gives +0.
+
+@@ -832,8 +836,8 @@
+ @c that advantages in practice), like for any bug fix.
+ Example: @code{mpfr_hypot} on (NaN,0) gives NaN, but @code{mpfr_hypot}
+ on (NaN,+Inf) gives +Inf (as specified in @ref{Special Functions}),
+-since for any finite input @var{x}, @code{mpfr_hypot} on (@var{x},+Inf)
+-gives +Inf.
++since for any finite or infinite input @var{x}, @code{mpfr_hypot} on
++(@var{x},+Inf) gives +Inf.
+
+ @node Exceptions, Memory Handling, Floating-Point Values on Special Numbers, MPFR Basics
+ @comment node-name, next, previous, up
+@@ -1581,7 +1585,8 @@
+ @deftypefunx int mpfr_add_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd})
+ @deftypefunx int mpfr_add_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{@var{op1} + @var{op2}} rounded in the direction
+-@var{rnd}. For types having no signed zero, it is considered unsigned
++@var{rnd}. The IEEE-754 rules are used, in particular for signed zeros.
++But for types having no signed zeros, 0 is considered unsigned
+ (i.e., (+0) + 0 = (+0) and (@minus{}0) + 0 = (@minus{}0)).
+ The @code{mpfr_add_d} function assumes that the radix of the @code{double} type
+ is a power of 2, with a precision at most that declared by the C implementation
+@@ -1599,7 +1604,8 @@
+ @deftypefunx int mpfr_sub_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd})
+ @deftypefunx int mpfr_sub_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{@var{op1} - @var{op2}} rounded in the direction
+-@var{rnd}. For types having no signed zero, it is considered unsigned
++@var{rnd}. The IEEE-754 rules are used, in particular for signed zeros.
++But for types having no signed zeros, 0 is considered unsigned
+ (i.e., (+0) @minus{} 0 = (+0), (@minus{}0) @minus{} 0 = (@minus{}0),
+ 0 @minus{} (+0) = (@minus{}0) and 0 @minus{} (@minus{}0) = (+0)).
+ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_d_sub}
+@@ -1615,7 +1621,7 @@
+ Set @var{rop} to @math{@var{op1} @GMPtimes{} @var{op2}} rounded in the
+ direction @var{rnd}.
+ When a result is zero, its sign is the product of the signs of the operands
+-(for types having no signed zero, it is considered positive).
++(for types having no signed zeros, 0 is considered positive).
+ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_mul_d}.
+ @end deftypefun
+
+@@ -1635,7 +1641,7 @@
+ @deftypefunx int mpfr_div_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{@var{op1}/@var{op2}} rounded in the direction @var{rnd}.
+ When a result is zero, its sign is the product of the signs of the operands
+-(for types having no signed zero, it is considered positive).
++(for types having no signed zeros, 0 is considered positive).
+ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_d_div}
+ and @code{mpfr_div_d}.
+ @end deftypefun
+@@ -1643,15 +1649,18 @@
+ @deftypefun int mpfr_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+ @deftypefunx int mpfr_sqrt_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @m{\sqrt{@var{op}}, the square root of @var{op}}
+-rounded in the direction @var{rnd} (set @var{rop} to @minus{}0 if @var{op} is
+-@minus{}0, to be consistent with the IEEE 754 standard).
++rounded in the direction @var{rnd}. Set @var{rop} to @minus{}0 if
++@var{op} is @minus{}0, to be consistent with the IEEE 754 standard.
+ Set @var{rop} to NaN if @var{op} is negative.
+ @end deftypefun
+
+ @deftypefun int mpfr_rec_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @m{1/\sqrt{@var{op}}, the reciprocal square root of @var{op}}
+-rounded in the direction @var{rnd}. Set @var{rop} to +Inf if @var{op} is
+-@pom{}0, +0 if @var{op} is +Inf, and NaN if @var{op} is negative.
++rounded in the direction @var{rnd}. Set @var{rop} to +Inf if @var{op} is
++@pom{}0, +0 if @var{op} is +Inf, and NaN if @var{op} is negative. Warning!
++Therefore the result on @minus{}0 is different from the one of the rSqrt
++function recommended by the IEEE 754-2008 standard (Section 9.2.1), which
++is @minus{}Inf instead of +Inf.
+ @end deftypefun
+
+ @deftypefun int mpfr_cbrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+@@ -1832,7 +1841,9 @@
+ @m{\log_2 @var{op}, log2(@var{op})} or
+ @m{\log_{10} @var{op}, log10(@var{op})}, respectively,
+ rounded in the direction @var{rnd}.
+-Set @var{rop} to @minus{}Inf if @var{op} is @minus{}0
++Set @var{rop} to +0 if @var{op} is 1 (in all rounding modes),
++for consistency with the ISO C99 and IEEE 754-2008 standards.
++Set @var{rop} to @minus{}Inf if @var{op} is @pom{}0
+ (i.e., the sign of the zero has no influence on the result).
+ @end deftypefun
+
+@@ -2003,8 +2014,11 @@
+ @deftypefun int mpfr_lngamma (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to the value of the logarithm of the Gamma function on @var{op},
+ rounded in the direction @var{rnd}.
+-When @math{@minus{}2@var{k}@minus{}1 @le{} @var{op} @le{} @minus{}2@var{k}},
+-@var{k} being a non-negative integer, @var{rop} is set to NaN.
++When @var{op} is 1 or 2, set @var{rop} to +0 (in all rounding modes).
++When @var{op} is an infinity or a nonpositive integer, set @var{rop} to +Inf,
++following the general rules on special values.
++When @math{@minus{}2@var{k}@minus{}1 < @var{op} < @minus{}2@var{k}},
++@var{k} being a nonnegative integer, set @var{rop} to NaN@.
+ See also @code{mpfr_lgamma}.
+ @end deftypefun
+
+@@ -2012,10 +2026,11 @@
+ Set @var{rop} to the value of the logarithm of the absolute value of the
+ Gamma function on @var{op}, rounded in the direction @var{rnd}. The sign
+ (1 or @minus{}1) of Gamma(@var{op}) is returned in the object pointed to
+-by @var{signp}. When @var{op} is an infinity or a non-positive integer, set
+-@var{rop} to +Inf. When @var{op} is NaN, @minus{}Inf or a negative integer,
+-*@var{signp} is undefined, and when @var{op} is @pom{}0, *@var{signp} is
+-the sign of the zero.
++by @var{signp}.
++When @var{op} is 1 or 2, set @var{rop} to +0 (in all rounding modes).
++When @var{op} is an infinity or a nonpositive integer, set @var{rop} to +Inf.
++When @var{op} is NaN, @minus{}Inf or a negative integer, *@var{signp} is
++undefined, and when @var{op} is @pom{}0, *@var{signp} is the sign of the zero.
+ @end deftypefun
+
+ @deftypefun int mpfr_digamma (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+@@ -2064,7 +2079,10 @@
+ @deftypefunx int mpfr_fms (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_t @var{op3}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{(@var{op1} @GMPtimes{} @var{op2}) + @var{op3}}
+ (resp.@: @math{(@var{op1} @GMPtimes{} @var{op2}) - @var{op3}})
+-rounded in the direction @var{rnd}.
++rounded in the direction @var{rnd}. Concerning special values (signed zeros,
++infinities, NaN), these functions behave like a multiplication followed by a
++separate addition or subtraction. That is, the fused operation matters only
++for rounding.
+ @end deftypefun
+
+ @deftypefun int mpfr_agm (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd})
+@@ -2089,8 +2107,8 @@
+ i.e., $\sqrt{x^2+y^2}$,
+ @end tex
+ rounded in the direction @var{rnd}.
+-Special values are handled as described in Section F.9.4.3 of
+-the ISO C99 and IEEE 754-2008 standards:
++Special values are handled as described in the ISO C99 (Section F.9.4.3)
++and IEEE 754-2008 (Section 9.2.1) standards:
+ If @var{x} or @var{y} is an infinity, then +Inf is returned in @var{rop},
+ even if the other number is NaN.
+ @end deftypefun
+diff -Naurd mpfr-3.1.3-a/doc/mpfr.info mpfr-3.1.3-b/doc/mpfr.info
+--- mpfr-3.1.3-a/doc/mpfr.info 2015-06-19 19:55:53.000000000 +0000
++++ mpfr-3.1.3-b/doc/mpfr.info 2015-07-02 10:49:38.718267817 +0000
+@@ -1,4 +1,4 @@
+-This is mpfr.info, produced by makeinfo version 5.2 from mpfr.texi.
++This is mpfr.info, produced by makeinfo version 6.0 from mpfr.texi.
+
+ This manual documents how to install and use the Multiple Precision
+ Floating-Point Reliable Library, version 3.1.3.
+@@ -55,7 +55,7 @@
+ MPFR Copying Conditions
+ ***********************
+
+-The GNU MPFR library (or MPFR for short) is "free"; this means that
++The GNU MPFR library (or MPFR for short) is “free”; this means that
+ everyone is free to use it and free to redistribute it on a free basis.
+ The library is not in the public domain; it is copyrighted and there are
+ restrictions on its distribution, but these restrictions are designed to
+@@ -418,7 +418,7 @@
+ 4.2 Nomenclature and Types
+ ==========================
+
+-A "floating-point number", or "float" for short, is an arbitrary
++A “floating-point number”, or “float” for short, is an arbitrary
+ precision significand (also called mantissa) with a limited precision
+ exponent. The C data type for such objects is ‘mpfr_t’ (internally
+ defined as a one-element array of a structure, and ‘mpfr_ptr’ is the C
+@@ -432,7 +432,7 @@
+ to the other functions supported by MPFR. Unless documented otherwise,
+ the sign bit of a NaN is unspecified.
+
+-The "precision" is the number of bits used to represent the significand
++The “precision” is the number of bits used to represent the significand
+ of a floating-point number; the corresponding C data type is
+ ‘mpfr_prec_t’. The precision can be any integer between ‘MPFR_PREC_MIN’
+ and ‘MPFR_PREC_MAX’. In the current implementation, ‘MPFR_PREC_MIN’ is
+@@ -446,7 +446,7 @@
+ may abort, crash or have undefined behavior (depending on your C
+ implementation).
+
+-The "rounding mode" specifies the way to round the result of a
++The “rounding mode” specifies the way to round the result of a
+ floating-point operation, in case the exact result can not be
+ represented exactly in the destination significand; the corresponding C
+ data type is ‘mpfr_rnd_t’.
+@@ -499,14 +499,14 @@
+ representable numbers, it is rounded to the one with the least
+ significant bit set to zero. For example, the number 2.5, which is
+ represented by (10.1) in binary, is rounded to (10.0)=2 with a precision
+-of two bits, and not to (11.0)=3. This rule avoids the "drift"
++of two bits, and not to (11.0)=3. This rule avoids the “drift”
+ phenomenon mentioned by Knuth in volume 2 of The Art of Computer
+ Programming (Section 4.2.2).
+
+ Most MPFR functions take as first argument the destination variable,
+ as second and following arguments the input variables, as last argument
+ a rounding mode, and have a return value of type ‘int’, called the
+-"ternary value". The value stored in the destination variable is
++“ternary value”. The value stored in the destination variable is
+ correctly rounded, i.e., MPFR behaves as if it computed the result with
+ an infinite precision, then rounded it to the precision of this
+ variable. The input variables are regarded as exact (in particular,
+@@ -572,15 +572,18 @@
+ When the input point is in the closure of the domain of the
+ mathematical function and an input argument is +0 (resp. −0), one
+ considers the limit when the corresponding argument approaches 0 from
+-above (resp. below). If the limit is not defined (e.g., ‘mpfr_log’ on
+-−0), the behavior is specified in the description of the MPFR function.
++above (resp. below), if possible. If the limit is not defined (e.g.,
++‘mpfr_sqrt’ and ‘mpfr_log’ on −0), the behavior is specified in the
++description of the MPFR function, but must be consistent with the rule
++from the above paragraph (e.g., ‘mpfr_log’ on ±0 gives −Inf).
+
+ When the result is equal to 0, its sign is determined by considering
+ the limit as if the input point were not in the domain: If one
+ approaches 0 from above (resp. below), the result is +0 (resp. −0); for
+-example, ‘mpfr_sin’ on +0 gives +0. In the other cases, the sign is
+-specified in the description of the MPFR function; for example
+-‘mpfr_max’ on −0 and +0 gives +0.
++example, ‘mpfr_sin’ on −0 gives −0 and ‘mpfr_acos’ on 1 gives +0 (in all
++rounding modes). In the other cases, the sign is specified in the
++description of the MPFR function; for example ‘mpfr_max’ on −0 and +0
++gives +0.
+
+ When the input point is not in the closure of the domain of the
+ function, the result is NaN. Example: ‘mpfr_sqrt’ on −17 gives NaN.
+@@ -590,8 +593,8 @@
+ numbers; such a case is always explicitly specified in *note MPFR
+ Interface::. Example: ‘mpfr_hypot’ on (NaN,0) gives NaN, but
+ ‘mpfr_hypot’ on (NaN,+Inf) gives +Inf (as specified in *note Special
+-Functions::), since for any finite input X, ‘mpfr_hypot’ on (X,+Inf)
+-gives +Inf.
++Functions::), since for any finite or infinite input X, ‘mpfr_hypot’ on
++(X,+Inf) gives +Inf.
+
+ 
+ File: mpfr.info, Node: Exceptions, Next: Memory Handling, Prev: Floating-Point Values on Special Numbers, Up: MPFR Basics
+@@ -1253,8 +1256,9 @@
+ mpfr_rnd_t RND)
+ -- Function: int mpfr_add_q (mpfr_t ROP, mpfr_t OP1, mpq_t OP2,
+ mpfr_rnd_t RND)
+- Set ROP to OP1 + OP2 rounded in the direction RND. For types
+- having no signed zero, it is considered unsigned (i.e., (+0) + 0 =
++ Set ROP to OP1 + OP2 rounded in the direction RND. The IEEE-754
++ rules are used, in particular for signed zeros. But for types
++ having no signed zeros, 0 is considered unsigned (i.e., (+0) + 0 =
+ (+0) and (−0) + 0 = (−0)). The ‘mpfr_add_d’ function assumes that
+ the radix of the ‘double’ type is a power of 2, with a precision at
+ most that declared by the C implementation (macro
+@@ -1280,8 +1284,9 @@
+ mpfr_rnd_t RND)
+ -- Function: int mpfr_sub_q (mpfr_t ROP, mpfr_t OP1, mpq_t OP2,
+ mpfr_rnd_t RND)
+- Set ROP to OP1 - OP2 rounded in the direction RND. For types
+- having no signed zero, it is considered unsigned (i.e., (+0) − 0 =
++ Set ROP to OP1 - OP2 rounded in the direction RND. The IEEE-754
++ rules are used, in particular for signed zeros. But for types
++ having no signed zeros, 0 is considered unsigned (i.e., (+0) − 0 =
+ (+0), (−0) − 0 = (−0), 0 − (+0) = (−0) and 0 − (−0) = (+0)). The
+ same restrictions than for ‘mpfr_add_d’ apply to ‘mpfr_d_sub’ and
+ ‘mpfr_sub_d’.
+@@ -1300,7 +1305,7 @@
+ mpfr_rnd_t RND)
+ Set ROP to OP1 times OP2 rounded in the direction RND. When a
+ result is zero, its sign is the product of the signs of the
+- operands (for types having no signed zero, it is considered
++ operands (for types having no signed zeros, 0 is considered
+ positive). The same restrictions than for ‘mpfr_add_d’ apply to
+ ‘mpfr_mul_d’.
+
+@@ -1327,21 +1332,24 @@
+ mpfr_rnd_t RND)
+ Set ROP to OP1/OP2 rounded in the direction RND. When a result is
+ zero, its sign is the product of the signs of the operands (for
+- types having no signed zero, it is considered positive). The same
++ types having no signed zeros, 0 is considered positive). The same
+ restrictions than for ‘mpfr_add_d’ apply to ‘mpfr_d_div’ and
+ ‘mpfr_div_d’.
+
+ -- Function: int mpfr_sqrt (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ -- Function: int mpfr_sqrt_ui (mpfr_t ROP, unsigned long int OP,
+ mpfr_rnd_t RND)
+- Set ROP to the square root of OP rounded in the direction RND (set
+- ROP to −0 if OP is −0, to be consistent with the IEEE 754
+- standard). Set ROP to NaN if OP is negative.
++ Set ROP to the square root of OP rounded in the direction RND. Set
++ ROP to −0 if OP is −0, to be consistent with the IEEE 754 standard.
++ Set ROP to NaN if OP is negative.
+
+ -- Function: int mpfr_rec_sqrt (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ Set ROP to the reciprocal square root of OP rounded in the
+ direction RND. Set ROP to +Inf if OP is ±0, +0 if OP is +Inf, and
+- NaN if OP is negative.
++ NaN if OP is negative. Warning! Therefore the result on −0 is
++ different from the one of the rSqrt function recommended by the
++ IEEE 754-2008 standard (Section 9.2.1), which is −Inf instead of
++ +Inf.
+
+ -- Function: int mpfr_cbrt (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ -- Function: int mpfr_root (mpfr_t ROP, mpfr_t OP, unsigned long int K,
+@@ -1515,8 +1523,10 @@
+ -- Function: int mpfr_log2 (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ -- Function: int mpfr_log10 (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ Set ROP to the natural logarithm of OP, log2(OP) or log10(OP),
+- respectively, rounded in the direction RND. Set ROP to −Inf if OP
+- is −0 (i.e., the sign of the zero has no influence on the result).
++ respectively, rounded in the direction RND. Set ROP to +0 if OP is
++ 1 (in all rounding modes), for consistency with the ISO C99 and
++ IEEE 754-2008 standards. Set ROP to −Inf if OP is ±0 (i.e., the
++ sign of the zero has no influence on the result).
+
+ -- Function: int mpfr_exp (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ -- Function: int mpfr_exp2 (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+@@ -1649,17 +1659,21 @@
+
+ -- Function: int mpfr_lngamma (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ Set ROP to the value of the logarithm of the Gamma function on OP,
+- rounded in the direction RND. When −2K−1 <= OP <= −2K, K being a
+- non-negative integer, ROP is set to NaN. See also ‘mpfr_lgamma’.
++ rounded in the direction RND. When OP is 1 or 2, set ROP to +0 (in
++ all rounding modes). When OP is an infinity or a nonpositive
++ integer, set ROP to +Inf, following the general rules on special
++ values. When −2K−1 < OP < −2K, K being a nonnegative integer, set
++ ROP to NaN. See also ‘mpfr_lgamma’.
+
+ -- Function: int mpfr_lgamma (mpfr_t ROP, int *SIGNP, mpfr_t OP,
+ mpfr_rnd_t RND)
+ Set ROP to the value of the logarithm of the absolute value of the
+ Gamma function on OP, rounded in the direction RND. The sign (1 or
+ −1) of Gamma(OP) is returned in the object pointed to by SIGNP.
+- When OP is an infinity or a non-positive integer, set ROP to +Inf.
+- When OP is NaN, −Inf or a negative integer, *SIGNP is undefined,
+- and when OP is ±0, *SIGNP is the sign of the zero.
++ When OP is 1 or 2, set ROP to +0 (in all rounding modes). When OP
++ is an infinity or a nonpositive integer, set ROP to +Inf. When OP
++ is NaN, −Inf or a negative integer, *SIGNP is undefined, and when
++ OP is ±0, *SIGNP is the sign of the zero.
+
+ -- Function: int mpfr_digamma (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+ Set ROP to the value of the Digamma (sometimes also called Psi)
+@@ -1703,7 +1717,10 @@
+ -- Function: int mpfr_fms (mpfr_t ROP, mpfr_t OP1, mpfr_t OP2, mpfr_t
+ OP3, mpfr_rnd_t RND)
+ Set ROP to (OP1 times OP2) + OP3 (resp. (OP1 times OP2) - OP3)
+- rounded in the direction RND.
++ rounded in the direction RND. Concerning special values (signed
++ zeros, infinities, NaN), these functions behave like a
++ multiplication followed by a separate addition or subtraction.
++ That is, the fused operation matters only for rounding.
+
+ -- Function: int mpfr_agm (mpfr_t ROP, mpfr_t OP1, mpfr_t OP2,
+ mpfr_rnd_t RND)
+@@ -1717,9 +1734,10 @@
+ RND)
+ Set ROP to the Euclidean norm of X and Y, i.e., the square root of
+ the sum of the squares of X and Y, rounded in the direction RND.
+- Special values are handled as described in Section F.9.4.3 of the
+- ISO C99 and IEEE 754-2008 standards: If X or Y is an infinity, then
+- +Inf is returned in ROP, even if the other number is NaN.
++ Special values are handled as described in the ISO C99 (Section
++ F.9.4.3) and IEEE 754-2008 (Section 9.2.1) standards: If X or Y is
++ an infinity, then +Inf is returned in ROP, even if the other number
++ is NaN.
+
+ -- Function: int mpfr_ai (mpfr_t ROP, mpfr_t X, mpfr_rnd_t RND)
+ Set ROP to the value of the Airy function Ai on X, rounded in the
+@@ -2670,7 +2688,7 @@
+ 5.16 Internals
+ ==============
+
+-A "limb" means the part of a multi-precision number that fits in a
++A “limb” means the part of a multi-precision number that fits in a
+ single word. Usually a limb contains 32 or 64 bits. The C data type
+ for a limb is ‘mp_limb_t’.
+
+@@ -3140,7 +3158,7 @@
+ 0. PREAMBLE
+
+ The purpose of this License is to make a manual, textbook, or other
+- functional and useful document "free" in the sense of freedom: to
++ functional and useful document “free” in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+@@ -3655,9 +3673,9 @@
+ * Menu:
+
+ * mpfr_abs: Basic Arithmetic Functions.
+- (line 160)
+-* mpfr_acos: Special Functions. (line 51)
+-* mpfr_acosh: Special Functions. (line 115)
++ (line 165)
++* mpfr_acos: Special Functions. (line 53)
++* mpfr_acosh: Special Functions. (line 117)
+ * mpfr_add: Basic Arithmetic Functions.
+ (line 6)
+ * mpfr_add_d: Basic Arithmetic Functions.
+@@ -3670,15 +3688,15 @@
+ (line 8)
+ * mpfr_add_z: Basic Arithmetic Functions.
+ (line 14)
+-* mpfr_agm: Special Functions. (line 210)
+-* mpfr_ai: Special Functions. (line 226)
+-* mpfr_asin: Special Functions. (line 52)
+-* mpfr_asinh: Special Functions. (line 116)
++* mpfr_agm: Special Functions. (line 219)
++* mpfr_ai: Special Functions. (line 236)
++* mpfr_asin: Special Functions. (line 54)
++* mpfr_asinh: Special Functions. (line 118)
+ * mpfr_asprintf: Formatted Output Functions.
+ (line 193)
+-* mpfr_atan: Special Functions. (line 53)
+-* mpfr_atan2: Special Functions. (line 63)
+-* mpfr_atanh: Special Functions. (line 117)
++* mpfr_atan: Special Functions. (line 55)
++* mpfr_atan2: Special Functions. (line 65)
++* mpfr_atanh: Special Functions. (line 119)
+ * mpfr_buildopt_decimal_p: Miscellaneous Functions.
+ (line 162)
+ * mpfr_buildopt_gmpinternals_p: Miscellaneous Functions.
+@@ -3690,7 +3708,7 @@
+ * mpfr_can_round: Rounding Related Functions.
+ (line 39)
+ * mpfr_cbrt: Basic Arithmetic Functions.
+- (line 108)
++ (line 113)
+ * mpfr_ceil: Integer Related Functions.
+ (line 7)
+ * mpfr_check_range: Exception Related Functions.
+@@ -3735,18 +3753,18 @@
+ (line 27)
+ * mpfr_cmp_z: Comparison Functions.
+ (line 11)
+-* mpfr_const_catalan: Special Functions. (line 237)
+-* mpfr_const_euler: Special Functions. (line 236)
+-* mpfr_const_log2: Special Functions. (line 234)
+-* mpfr_const_pi: Special Functions. (line 235)
++* mpfr_const_catalan: Special Functions. (line 247)
++* mpfr_const_euler: Special Functions. (line 246)
++* mpfr_const_log2: Special Functions. (line 244)
++* mpfr_const_pi: Special Functions. (line 245)
+ * mpfr_copysign: Miscellaneous Functions.
+ (line 109)
+-* mpfr_cos: Special Functions. (line 29)
+-* mpfr_cosh: Special Functions. (line 95)
+-* mpfr_cot: Special Functions. (line 47)
+-* mpfr_coth: Special Functions. (line 111)
+-* mpfr_csc: Special Functions. (line 46)
+-* mpfr_csch: Special Functions. (line 110)
++* mpfr_cos: Special Functions. (line 31)
++* mpfr_cosh: Special Functions. (line 97)
++* mpfr_cot: Special Functions. (line 49)
++* mpfr_coth: Special Functions. (line 113)
++* mpfr_csc: Special Functions. (line 48)
++* mpfr_csch: Special Functions. (line 112)
+ * mpfr_custom_get_exp: Custom Interface. (line 75)
+ * mpfr_custom_get_kind: Custom Interface. (line 65)
+ * mpfr_custom_get_significand: Custom Interface. (line 70)
+@@ -3756,47 +3774,47 @@
+ * mpfr_custom_move: Custom Interface. (line 82)
+ * MPFR_DECL_INIT: Initialization Functions.
+ (line 74)
+-* mpfr_digamma: Special Functions. (line 166)
++* mpfr_digamma: Special Functions. (line 172)
+ * mpfr_dim: Basic Arithmetic Functions.
+- (line 166)
++ (line 171)
+ * mpfr_div: Basic Arithmetic Functions.
+- (line 72)
++ (line 74)
+ * mpfr_divby0_p: Exception Related Functions.
+ (line 134)
+ * mpfr_div_2exp: Compatibility with MPF.
+ (line 49)
+ * mpfr_div_2si: Basic Arithmetic Functions.
+- (line 181)
++ (line 186)
+ * mpfr_div_2ui: Basic Arithmetic Functions.
+- (line 179)
++ (line 184)
+ * mpfr_div_d: Basic Arithmetic Functions.
+- (line 84)
++ (line 86)
+ * mpfr_div_q: Basic Arithmetic Functions.
+- (line 88)
++ (line 90)
+ * mpfr_div_si: Basic Arithmetic Functions.
+- (line 80)
++ (line 82)
+ * mpfr_div_ui: Basic Arithmetic Functions.
+- (line 76)
++ (line 78)
+ * mpfr_div_z: Basic Arithmetic Functions.
+- (line 86)
++ (line 88)
+ * mpfr_d_div: Basic Arithmetic Functions.
+- (line 82)
++ (line 84)
+ * mpfr_d_sub: Basic Arithmetic Functions.
+- (line 35)
+-* mpfr_eint: Special Functions. (line 133)
++ (line 36)
++* mpfr_eint: Special Functions. (line 135)
+ * mpfr_eq: Compatibility with MPF.
+ (line 28)
+ * mpfr_equal_p: Comparison Functions.
+ (line 59)
+ * mpfr_erangeflag_p: Exception Related Functions.
+ (line 137)
+-* mpfr_erf: Special Functions. (line 177)
+-* mpfr_erfc: Special Functions. (line 178)
+-* mpfr_exp: Special Functions. (line 23)
+-* mpfr_exp10: Special Functions. (line 25)
+-* mpfr_exp2: Special Functions. (line 24)
+-* mpfr_expm1: Special Functions. (line 129)
+-* mpfr_fac_ui: Special Functions. (line 121)
++* mpfr_erf: Special Functions. (line 183)
++* mpfr_erfc: Special Functions. (line 184)
++* mpfr_exp: Special Functions. (line 25)
++* mpfr_exp10: Special Functions. (line 27)
++* mpfr_exp2: Special Functions. (line 26)
++* mpfr_expm1: Special Functions. (line 131)
++* mpfr_fac_ui: Special Functions. (line 123)
+ * mpfr_fits_intmax_p: Conversion Functions.
+ (line 150)
+ * mpfr_fits_sint_p: Conversion Functions.
+@@ -3815,20 +3833,20 @@
+ (line 147)
+ * mpfr_floor: Integer Related Functions.
+ (line 8)
+-* mpfr_fma: Special Functions. (line 203)
++* mpfr_fma: Special Functions. (line 209)
+ * mpfr_fmod: Integer Related Functions.
+ (line 92)
+-* mpfr_fms: Special Functions. (line 205)
++* mpfr_fms: Special Functions. (line 211)
+ * mpfr_fprintf: Formatted Output Functions.
+ (line 157)
+ * mpfr_frac: Integer Related Functions.
+ (line 76)
+-* mpfr_free_cache: Special Functions. (line 244)
++* mpfr_free_cache: Special Functions. (line 254)
+ * mpfr_free_str: Conversion Functions.
+ (line 137)
+ * mpfr_frexp: Conversion Functions.
+ (line 45)
+-* mpfr_gamma: Special Functions. (line 148)
++* mpfr_gamma: Special Functions. (line 150)
+ * mpfr_get_d: Conversion Functions.
+ (line 7)
+ * mpfr_get_decimal64: Conversion Functions.
+@@ -3887,7 +3905,7 @@
+ (line 56)
+ * mpfr_greater_p: Comparison Functions.
+ (line 55)
+-* mpfr_hypot: Special Functions. (line 218)
++* mpfr_hypot: Special Functions. (line 227)
+ * mpfr_inexflag_p: Exception Related Functions.
+ (line 136)
+ * mpfr_inf_p: Comparison Functions.
+@@ -3922,21 +3940,21 @@
+ (line 31)
+ * mpfr_integer_p: Integer Related Functions.
+ (line 119)
+-* mpfr_j0: Special Functions. (line 182)
+-* mpfr_j1: Special Functions. (line 183)
+-* mpfr_jn: Special Functions. (line 184)
++* mpfr_j0: Special Functions. (line 188)
++* mpfr_j1: Special Functions. (line 189)
++* mpfr_jn: Special Functions. (line 190)
+ * mpfr_lessequal_p: Comparison Functions.
+ (line 58)
+ * mpfr_lessgreater_p: Comparison Functions.
+ (line 64)
+ * mpfr_less_p: Comparison Functions.
+ (line 57)
+-* mpfr_lgamma: Special Functions. (line 157)
+-* mpfr_li2: Special Functions. (line 143)
+-* mpfr_lngamma: Special Functions. (line 152)
++* mpfr_lgamma: Special Functions. (line 162)
++* mpfr_li2: Special Functions. (line 145)
++* mpfr_lngamma: Special Functions. (line 154)
+ * mpfr_log: Special Functions. (line 16)
+ * mpfr_log10: Special Functions. (line 18)
+-* mpfr_log1p: Special Functions. (line 125)
++* mpfr_log1p: Special Functions. (line 127)
+ * mpfr_log2: Special Functions. (line 17)
+ * mpfr_max: Miscellaneous Functions.
+ (line 22)
+@@ -3947,29 +3965,29 @@
+ * mpfr_modf: Integer Related Functions.
+ (line 82)
+ * mpfr_mul: Basic Arithmetic Functions.
+- (line 51)
++ (line 53)
+ * mpfr_mul_2exp: Compatibility with MPF.
+ (line 47)
+ * mpfr_mul_2si: Basic Arithmetic Functions.
+- (line 174)
++ (line 179)
+ * mpfr_mul_2ui: Basic Arithmetic Functions.
+- (line 172)
++ (line 177)
+ * mpfr_mul_d: Basic Arithmetic Functions.
+- (line 57)
++ (line 59)
+ * mpfr_mul_q: Basic Arithmetic Functions.
+- (line 61)
++ (line 63)
+ * mpfr_mul_si: Basic Arithmetic Functions.
+- (line 55)
++ (line 57)
+ * mpfr_mul_ui: Basic Arithmetic Functions.
+- (line 53)
++ (line 55)
+ * mpfr_mul_z: Basic Arithmetic Functions.
+- (line 59)
++ (line 61)
+ * mpfr_nanflag_p: Exception Related Functions.
+ (line 135)
+ * mpfr_nan_p: Comparison Functions.
+ (line 39)
+ * mpfr_neg: Basic Arithmetic Functions.
+- (line 159)
++ (line 164)
+ * mpfr_nextabove: Miscellaneous Functions.
+ (line 15)
+ * mpfr_nextbelow: Miscellaneous Functions.
+@@ -3983,13 +4001,13 @@
+ * mpfr_overflow_p: Exception Related Functions.
+ (line 133)
+ * mpfr_pow: Basic Arithmetic Functions.
+- (line 116)
++ (line 121)
+ * mpfr_pow_si: Basic Arithmetic Functions.
+- (line 120)
++ (line 125)
+ * mpfr_pow_ui: Basic Arithmetic Functions.
+- (line 118)
++ (line 123)
+ * mpfr_pow_z: Basic Arithmetic Functions.
+- (line 122)
++ (line 127)
+ * mpfr_prec_round: Rounding Related Functions.
+ (line 13)
+ * ‘mpfr_prec_t’: Nomenclature and Types.
+@@ -3999,7 +4017,7 @@
+ * mpfr_print_rnd_mode: Rounding Related Functions.
+ (line 71)
+ * mpfr_rec_sqrt: Basic Arithmetic Functions.
+- (line 103)
++ (line 105)
+ * mpfr_regular_p: Comparison Functions.
+ (line 43)
+ * mpfr_reldiff: Compatibility with MPF.
+@@ -4021,11 +4039,11 @@
+ * ‘mpfr_rnd_t’: Nomenclature and Types.
+ (line 34)
+ * mpfr_root: Basic Arithmetic Functions.
+- (line 109)
++ (line 114)
+ * mpfr_round: Integer Related Functions.
+ (line 9)
+-* mpfr_sec: Special Functions. (line 45)
+-* mpfr_sech: Special Functions. (line 109)
++* mpfr_sec: Special Functions. (line 47)
++* mpfr_sech: Special Functions. (line 111)
+ * mpfr_set: Assignment Functions.
+ (line 9)
+ * mpfr_setsign: Miscellaneous Functions.
+@@ -4100,57 +4118,57 @@
+ (line 49)
+ * mpfr_signbit: Miscellaneous Functions.
+ (line 99)
+-* mpfr_sin: Special Functions. (line 30)
+-* mpfr_sinh: Special Functions. (line 96)
+-* mpfr_sinh_cosh: Special Functions. (line 101)
+-* mpfr_sin_cos: Special Functions. (line 35)
++* mpfr_sin: Special Functions. (line 32)
++* mpfr_sinh: Special Functions. (line 98)
++* mpfr_sinh_cosh: Special Functions. (line 103)
++* mpfr_sin_cos: Special Functions. (line 37)
+ * mpfr_si_div: Basic Arithmetic Functions.
+- (line 78)
++ (line 80)
+ * mpfr_si_sub: Basic Arithmetic Functions.
+- (line 31)
++ (line 32)
+ * mpfr_snprintf: Formatted Output Functions.
+ (line 180)
+ * mpfr_sprintf: Formatted Output Functions.
+ (line 170)
+ * mpfr_sqr: Basic Arithmetic Functions.
+- (line 69)
++ (line 71)
+ * mpfr_sqrt: Basic Arithmetic Functions.
+- (line 96)
++ (line 98)
+ * mpfr_sqrt_ui: Basic Arithmetic Functions.
+- (line 97)
++ (line 99)
+ * mpfr_strtofr: Assignment Functions.
+ (line 80)
+ * mpfr_sub: Basic Arithmetic Functions.
+- (line 25)
++ (line 26)
+ * mpfr_subnormalize: Exception Related Functions.
+ (line 60)
+ * mpfr_sub_d: Basic Arithmetic Functions.
+- (line 37)
++ (line 38)
+ * mpfr_sub_q: Basic Arithmetic Functions.
+- (line 43)
++ (line 44)
+ * mpfr_sub_si: Basic Arithmetic Functions.
+- (line 33)
++ (line 34)
+ * mpfr_sub_ui: Basic Arithmetic Functions.
+- (line 29)
++ (line 30)
+ * mpfr_sub_z: Basic Arithmetic Functions.
+- (line 41)
+-* mpfr_sum: Special Functions. (line 252)
++ (line 42)
++* mpfr_sum: Special Functions. (line 262)
+ * mpfr_swap: Assignment Functions.
+ (line 150)
+ * ‘mpfr_t’: Nomenclature and Types.
+ (line 6)
+-* mpfr_tan: Special Functions. (line 31)
+-* mpfr_tanh: Special Functions. (line 97)
++* mpfr_tan: Special Functions. (line 33)
++* mpfr_tanh: Special Functions. (line 99)
+ * mpfr_trunc: Integer Related Functions.
+ (line 10)
+ * mpfr_ui_div: Basic Arithmetic Functions.
+- (line 74)
++ (line 76)
+ * mpfr_ui_pow: Basic Arithmetic Functions.
+- (line 126)
++ (line 131)
+ * mpfr_ui_pow_ui: Basic Arithmetic Functions.
+- (line 124)
++ (line 129)
+ * mpfr_ui_sub: Basic Arithmetic Functions.
+- (line 27)
++ (line 28)
+ * mpfr_underflow_p: Exception Related Functions.
+ (line 132)
+ * mpfr_unordered_p: Comparison Functions.
+@@ -4181,61 +4199,61 @@
+ (line 182)
+ * mpfr_vsprintf: Formatted Output Functions.
+ (line 171)
+-* mpfr_y0: Special Functions. (line 193)
+-* mpfr_y1: Special Functions. (line 194)
+-* mpfr_yn: Special Functions. (line 195)
++* mpfr_y0: Special Functions. (line 199)
++* mpfr_y1: Special Functions. (line 200)
++* mpfr_yn: Special Functions. (line 201)
+ * mpfr_zero_p: Comparison Functions.
+ (line 42)
+-* mpfr_zeta: Special Functions. (line 171)
+-* mpfr_zeta_ui: Special Functions. (line 172)
++* mpfr_zeta: Special Functions. (line 177)
++* mpfr_zeta_ui: Special Functions. (line 178)
+ * mpfr_z_sub: Basic Arithmetic Functions.
+- (line 39)
++ (line 40)
+
+
+ 
+ Tag Table:
+ Node: Top775
+ Node: Copying2007
+-Node: Introduction to MPFR3766
+-Node: Installing MPFR5880
+-Node: Reporting Bugs11323
+-Node: MPFR Basics13353
+-Node: Headers and Libraries13669
+-Node: Nomenclature and Types16828
+-Node: MPFR Variable Conventions18874
+-Node: Rounding Modes20418
+-Ref: ternary value21544
+-Node: Floating-Point Values on Special Numbers23526
+-Node: Exceptions26572
+-Node: Memory Handling29749
+-Node: MPFR Interface30894
+-Node: Initialization Functions33008
+-Node: Assignment Functions40318
+-Node: Combined Initialization and Assignment Functions49673
+-Node: Conversion Functions50974
+-Node: Basic Arithmetic Functions60035
+-Node: Comparison Functions69200
+-Node: Special Functions72687
+-Node: Input and Output Functions86672
+-Node: Formatted Output Functions88644
+-Node: Integer Related Functions98431
+-Node: Rounding Related Functions105051
+-Node: Miscellaneous Functions108888
+-Node: Exception Related Functions117568
+-Node: Compatibility with MPF124386
+-Node: Custom Interface127127
+-Node: Internals131526
+-Node: API Compatibility133066
+-Node: Type and Macro Changes134995
+-Node: Added Functions137844
+-Node: Changed Functions141132
+-Node: Removed Functions145545
+-Node: Other Changes145973
+-Node: Contributors147576
+-Node: References150219
+-Node: GNU Free Documentation License151973
+-Node: Concept Index174562
+-Node: Function and Type Index180659
++Node: Introduction to MPFR3770
++Node: Installing MPFR5884
++Node: Reporting Bugs11327
++Node: MPFR Basics13357
++Node: Headers and Libraries13673
++Node: Nomenclature and Types16832
++Node: MPFR Variable Conventions18894
++Node: Rounding Modes20438
++Ref: ternary value21568
++Node: Floating-Point Values on Special Numbers23554
++Node: Exceptions26813
++Node: Memory Handling29990
++Node: MPFR Interface31135
++Node: Initialization Functions33249
++Node: Assignment Functions40559
++Node: Combined Initialization and Assignment Functions49914
++Node: Conversion Functions51215
++Node: Basic Arithmetic Functions60276
++Node: Comparison Functions69777
++Node: Special Functions73264
++Node: Input and Output Functions87862
++Node: Formatted Output Functions89834
++Node: Integer Related Functions99621
++Node: Rounding Related Functions106241
++Node: Miscellaneous Functions110078
++Node: Exception Related Functions118758
++Node: Compatibility with MPF125576
++Node: Custom Interface128317
++Node: Internals132716
++Node: API Compatibility134260
++Node: Type and Macro Changes136189
++Node: Added Functions139038
++Node: Changed Functions142326
++Node: Removed Functions146739
++Node: Other Changes147167
++Node: Contributors148770
++Node: References151413
++Node: GNU Free Documentation License153167
++Node: Concept Index175760
++Node: Function and Type Index181857
+ 
+ End Tag Table
+
+diff -Naurd mpfr-3.1.3-a/src/lngamma.c mpfr-3.1.3-b/src/lngamma.c
+--- mpfr-3.1.3-a/src/lngamma.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/lngamma.c 2015-07-02 10:49:24.018113593 +0000
+@@ -603,16 +603,17 @@
+ mpfr_get_prec (y), mpfr_log_prec, y, inex));
+
+ /* special cases */
+- if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
++ if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x) ||
++ (MPFR_IS_NEG (x) && mpfr_integer_p (x))))
+ {
+- if (MPFR_IS_NAN (x) || MPFR_IS_NEG (x))
++ if (MPFR_IS_NAN (x))
+ {
+ MPFR_SET_NAN (y);
+ MPFR_RET_NAN;
+ }
+- else /* lngamma(+Inf) = lngamma(+0) = +Inf */
++ else /* lngamma(+/-Inf) = lngamma(nonpositive integer) = +Inf */
+ {
+- if (MPFR_IS_ZERO (x))
++ if (!MPFR_IS_INF (x))
+ mpfr_set_divby0 ();
+ MPFR_SET_INF (y);
+ MPFR_SET_POS (y);
+@@ -620,8 +621,8 @@
+ }
+ }
+
+- /* if x < 0 and -2k-1 <= x <= -2k, then lngamma(x) = NaN */
+- if (MPFR_IS_NEG (x) && (unit_bit (x) == 0 || mpfr_integer_p (x)))
++ /* if -2k-1 < x < -2k <= 0, then lngamma(x) = NaN */
++ if (MPFR_IS_NEG (x) && unit_bit (x) == 0)
+ {
+ MPFR_SET_NAN (y);
+ MPFR_RET_NAN;
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2015-07-02 10:49:24.038113803 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3"
++#define MPFR_VERSION_STRING "3.1.3-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/version.c 2015-07-02 10:49:24.042113845 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3";
++ return "3.1.3-p1";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tlngamma.c mpfr-3.1.3-b/tests/tlngamma.c
+--- mpfr-3.1.3-a/tests/tlngamma.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tlngamma.c 2015-07-02 10:49:24.018113593 +0000
+@@ -33,7 +33,7 @@
+ special (void)
+ {
+ mpfr_t x, y;
+- int inex;
++ int i, inex;
+
+ mpfr_init (x);
+ mpfr_init (y);
+@@ -46,25 +46,29 @@
+ exit (1);
+ }
+
+- mpfr_set_inf (x, -1);
++ mpfr_set_inf (x, 1);
++ mpfr_clear_flags ();
+ mpfr_lngamma (y, x, MPFR_RNDN);
+- if (!mpfr_nan_p (y))
++ if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 || __gmpfr_flags != 0)
+ {
+- printf ("Error for lngamma(-Inf)\n");
++ printf ("Error for lngamma(+Inf)\n");
+ exit (1);
+ }
+
+- mpfr_set_inf (x, 1);
++ mpfr_set_inf (x, -1);
++ mpfr_clear_flags ();
+ mpfr_lngamma (y, x, MPFR_RNDN);
+- if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0)
++ if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 || __gmpfr_flags != 0)
+ {
+- printf ("Error for lngamma(+Inf)\n");
++ printf ("Error for lngamma(-Inf)\n");
+ exit (1);
+ }
+
+ mpfr_set_ui (x, 0, MPFR_RNDN);
++ mpfr_clear_flags ();
+ mpfr_lngamma (y, x, MPFR_RNDN);
+- if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0)
++ if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 ||
++ __gmpfr_flags != MPFR_FLAGS_DIVBY0)
+ {
+ printf ("Error for lngamma(+0)\n");
+ exit (1);
+@@ -72,32 +76,58 @@
+
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+ mpfr_neg (x, x, MPFR_RNDN);
++ mpfr_clear_flags ();
+ mpfr_lngamma (y, x, MPFR_RNDN);
+- if (!mpfr_nan_p (y))
++ if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 ||
++ __gmpfr_flags != MPFR_FLAGS_DIVBY0)
+ {
+ printf ("Error for lngamma(-0)\n");
+ exit (1);
+ }
+
+ mpfr_set_ui (x, 1, MPFR_RNDN);
++ mpfr_clear_flags ();
+ mpfr_lngamma (y, x, MPFR_RNDN);
+- if (MPFR_IS_NAN (y) || mpfr_cmp_ui (y, 0) || MPFR_IS_NEG (y))
++ if (mpfr_cmp_ui0 (y, 0) || MPFR_IS_NEG (y))
+ {
+ printf ("Error for lngamma(1)\n");
+ exit (1);
+ }
+
+- mpfr_set_si (x, -1, MPFR_RNDN);
+- mpfr_lngamma (y, x, MPFR_RNDN);
+- if (!mpfr_nan_p (y))
++ for (i = 1; i <= 5; i++)
+ {
+- printf ("Error for lngamma(-1)\n");
+- exit (1);
++ int c;
++
++ mpfr_set_si (x, -i, MPFR_RNDN);
++ mpfr_clear_flags ();
++ mpfr_lngamma (y, x, MPFR_RNDN);
++ if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 ||
++ __gmpfr_flags != MPFR_FLAGS_DIVBY0)
++ {
++ printf ("Error for lngamma(-%d)\n", i);
++ exit (1);
++ }
++ if (i & 1)
++ {
++ mpfr_nextabove (x);
++ c = '+';
++ }
++ else
++ {
++ mpfr_nextbelow (x);
++ c = '-';
++ }
++ mpfr_lngamma (y, x, MPFR_RNDN);
++ if (!mpfr_nan_p (y))
++ {
++ printf ("Error for lngamma(-%d%cepsilon)\n", i, c);
++ exit (1);
++ }
+ }
+
+ mpfr_set_ui (x, 2, MPFR_RNDN);
+ mpfr_lngamma (y, x, MPFR_RNDN);
+- if (MPFR_IS_NAN (y) || mpfr_cmp_ui (y, 0) || MPFR_IS_NEG (y))
++ if (mpfr_cmp_ui0 (y, 0) || MPFR_IS_NEG (y))
+ {
+ printf ("Error for lngamma(2)\n");
+ exit (1);
+@@ -127,7 +157,7 @@
+ mpfr_set_str (x, CHECK_X2, 10, MPFR_RNDN);
+ mpfr_lngamma (y, x, MPFR_RNDN);
+ mpfr_set_str (x, CHECK_Y2, 10, MPFR_RNDN);
+- if (MPFR_IS_NAN (y) || mpfr_cmp (y, x))
++ if (mpfr_cmp0 (y, x))
+ {
+ printf ("mpfr_lngamma("CHECK_X2") is wrong:\n"
+ "expected ");
+@@ -143,7 +173,7 @@
+ mpfr_lngamma (y, x, MPFR_RNDU);
+ mpfr_set_prec (x, 175);
+ mpfr_set_str_binary (x, "0.1010001100011101101011001101110010100001000001000001110011000001101100001111001001000101011011100100010101011110100111110101010100010011010010000101010111001100011000101111E7");
+- if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++ if (mpfr_cmp0 (x, y))
+ {
+ printf ("Error in mpfr_lngamma (1)\n");
+ exit (1);
+@@ -155,7 +185,7 @@
+ mpfr_lngamma (x, y, MPFR_RNDZ);
+ mpfr_set_prec (y, 21);
+ mpfr_set_str_binary (y, "0.111000101000001100101E9");
+- if (MPFR_IS_NAN (x) || mpfr_cmp (x, y))
++ if (mpfr_cmp0 (x, y))
+ {
+ printf ("Error in mpfr_lngamma (120)\n");
+ printf ("Expected "); mpfr_print_binary (y); puts ("");
+@@ -169,7 +199,7 @@
+ inex = mpfr_lngamma (y, x, MPFR_RNDN);
+ mpfr_set_prec (x, 206);
+ mpfr_set_str_binary (x, "0.10000111011000000011100010101001100110001110000111100011000100100110110010001011011110101001111011110110000001010100111011010000000011100110110101100111000111010011110010000100010111101010001101000110101001E13");
+- if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++ if (mpfr_cmp0 (x, y))
+ {
+ printf ("Error in mpfr_lngamma (768)\n");
+ exit (1);
+@@ -185,7 +215,7 @@
+ mpfr_set_str_binary (x, "0.1100E-66");
+ mpfr_lngamma (y, x, MPFR_RNDN);
+ mpfr_set_str_binary (x, "0.1100E6");
+- if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++ if (mpfr_cmp0 (x, y))
+ {
+ printf ("Error for lngamma(0.1100E-66)\n");
+ exit (1);
+@@ -199,7 +229,7 @@
+ mpfr_lngamma (y, x, MPFR_RNDN);
+ mpfr_set_prec (x, 32);
+ mpfr_set_str_binary (x, "-0.10001000111011111011000010100010E207");
+- if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++ if (mpfr_cmp0 (x, y))
+ {
+ printf ("Error for lngamma(-2^199+0.5)\n");
+ printf ("Got ");
diff --git a/patches/mpfr/3.1.3/120-muldiv-2exp-overflow.patch b/patches/mpfr/3.1.3/120-muldiv-2exp-overflow.patch
new file mode 100644
index 0000000..df711fd
--- /dev/null
+++ b/patches/mpfr/3.1.3/120-muldiv-2exp-overflow.patch
@@ -0,0 +1,161 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2015-07-02 10:50:08.046573308 +0000
++++ mpfr-3.1.3-b/PATCHES 2015-07-02 10:50:08.126574142 +0000
+@@ -0,0 +1 @@
++muldiv-2exp-overflow
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2015-07-02 10:49:24.042113845 +0000
++++ mpfr-3.1.3-b/VERSION 2015-07-02 10:50:08.126574142 +0000
+@@ -1 +1 @@
+-3.1.3-p1
++3.1.3-p2
+diff -Naurd mpfr-3.1.3-a/src/div_2si.c mpfr-3.1.3-b/src/div_2si.c
+--- mpfr-3.1.3-a/src/div_2si.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/div_2si.c 2015-07-02 10:50:08.106573933 +0000
+@@ -49,7 +49,7 @@
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (y, rnd_mode, MPFR_SIGN(y));
+ }
+- else if (MPFR_UNLIKELY(n < 0 && (__gmpfr_emax < MPFR_EMIN_MIN - n ||
++ else if (MPFR_UNLIKELY(n <= 0 && (__gmpfr_emax < MPFR_EMIN_MIN - n ||
+ exp > __gmpfr_emax + n)) )
+ return mpfr_overflow (y, rnd_mode, MPFR_SIGN(y));
+
+diff -Naurd mpfr-3.1.3-a/src/div_2ui.c mpfr-3.1.3-b/src/div_2ui.c
+--- mpfr-3.1.3-a/src/div_2ui.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/div_2ui.c 2015-07-02 10:50:08.106573933 +0000
+@@ -32,7 +32,7 @@
+ rnd_mode),
+ ("y[%Pu]=%.*Rg inexact=%d", mpfr_get_prec(y), mpfr_log_prec, y, inexact));
+
+- if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
++ if (MPFR_UNLIKELY (n == 0 || MPFR_IS_SINGULAR (x)))
+ return mpfr_set (y, x, rnd_mode);
+ else
+ {
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2015-07-02 10:49:24.038113803 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2015-07-02 10:50:08.126574142 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p1"
++#define MPFR_VERSION_STRING "3.1.3-p2"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/mul_2si.c mpfr-3.1.3-b/src/mul_2si.c
+--- mpfr-3.1.3-a/src/mul_2si.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/mul_2si.c 2015-07-02 10:50:08.106573933 +0000
+@@ -39,7 +39,7 @@
+ {
+ mpfr_exp_t exp = MPFR_GET_EXP (x);
+ MPFR_SETRAW (inexact, y, x, exp, rnd_mode);
+- if (MPFR_UNLIKELY( n > 0 && (__gmpfr_emax < MPFR_EMIN_MIN + n ||
++ if (MPFR_UNLIKELY(n >= 0 && (__gmpfr_emax < MPFR_EMIN_MIN + n ||
+ exp > __gmpfr_emax - n)))
+ return mpfr_overflow (y, rnd_mode, MPFR_SIGN(y));
+ else if (MPFR_UNLIKELY(n < 0 && (__gmpfr_emin > MPFR_EMAX_MAX + n ||
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2015-07-02 10:49:24.042113845 +0000
++++ mpfr-3.1.3-b/src/version.c 2015-07-02 10:50:08.126574142 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p1";
++ return "3.1.3-p2";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tmul_2exp.c mpfr-3.1.3-b/tests/tmul_2exp.c
+--- mpfr-3.1.3-a/tests/tmul_2exp.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tmul_2exp.c 2015-07-02 10:50:08.106573933 +0000
+@@ -242,6 +242,76 @@
+ large (MPFR_EMAX_MAX);
+ }
+
++/* Cases where the function overflows on n = 0 when rounding is like
++ away from zero. */
++static void
++overflow0 (mpfr_exp_t emax)
++{
++ mpfr_exp_t old_emax;
++ mpfr_t x, y1, y2;
++ int neg, r, op;
++ static char *sop[4] = { "mul_2ui", "mul_2si", "div_2ui", "div_2si" };
++
++ old_emax = mpfr_get_emax ();
++ set_emax (emax);
++
++ mpfr_init2 (x, 8);
++ mpfr_inits2 (6, y1, y2, (mpfr_ptr) 0);
++
++ mpfr_set_inf (x, 1);
++ mpfr_nextbelow (x);
++
++ for (neg = 0; neg <= 1; neg++)
++ {
++ RND_LOOP (r)
++ {
++ int inex1, inex2;
++ unsigned int flags1, flags2;
++
++ /* Even if there isn't an overflow (rounding ~ toward zero),
++ the result is the same as the one of an overflow. */
++ inex1 = mpfr_overflow (y1, (mpfr_rnd_t) r, neg ? -1 : 1);
++ flags1 = MPFR_FLAGS_INEXACT;
++ if (mpfr_inf_p (y1))
++ flags1 |= MPFR_FLAGS_OVERFLOW;
++ for (op = 0; op < 4; op++)
++ {
++ mpfr_clear_flags ();
++ inex2 =
++ op == 0 ? mpfr_mul_2ui (y2, x, 0, (mpfr_rnd_t) r) :
++ op == 1 ? mpfr_mul_2si (y2, x, 0, (mpfr_rnd_t) r) :
++ op == 2 ? mpfr_div_2ui (y2, x, 0, (mpfr_rnd_t) r) :
++ op == 3 ? mpfr_div_2si (y2, x, 0, (mpfr_rnd_t) r) :
++ (MPFR_ASSERTN (0), 0);
++ flags2 = __gmpfr_flags;
++ if (!(mpfr_equal_p (y1, y2) &&
++ SAME_SIGN (inex1, inex2) &&
++ flags1 == flags2))
++ {
++ printf ("Error in overflow0 for %s, mpfr_%s, emax = %"
++ MPFR_EXP_FSPEC "d,\nx = ",
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r), sop[op],
++ (mpfr_eexp_t) emax);
++ mpfr_dump (x);
++ printf ("Expected ");
++ mpfr_dump (y1);
++ printf (" with inex = %d, flags =", inex1);
++ flags_out (flags1);
++ printf ("Got ");
++ mpfr_dump (y2);
++ printf (" with inex = %d, flags =", inex2);
++ flags_out (flags2);
++ exit (1);
++ }
++ }
++ }
++ mpfr_neg (x, x, MPFR_RNDN);
++ }
++
++ mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
++ set_emax (old_emax);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -334,6 +404,11 @@
+ underflow0 ();
+ large0 ();
+
++ if (mpfr_get_emax () != MPFR_EMAX_MAX)
++ overflow0 (mpfr_get_emax ());
++ overflow0 (MPFR_EMAX_MAX);
++ overflow0 (-1);
++
+ tests_end_mpfr ();
+ return 0;
+ }
diff --git a/patches/mpfr/3.1.3/130-muldiv-2exp-underflow.patch b/patches/mpfr/3.1.3/130-muldiv-2exp-underflow.patch
new file mode 100644
index 0000000..c7be09f
--- /dev/null
+++ b/patches/mpfr/3.1.3/130-muldiv-2exp-underflow.patch
@@ -0,0 +1,217 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2015-07-17 08:54:48.592799981 +0000
++++ mpfr-3.1.3-b/PATCHES 2015-07-17 08:54:48.616811495 +0000
+@@ -0,0 +1 @@
++muldiv-2exp-underflow
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2015-07-02 10:50:08.126574142 +0000
++++ mpfr-3.1.3-b/VERSION 2015-07-17 08:54:48.616811495 +0000
+@@ -1 +1 @@
+-3.1.3-p2
++3.1.3-p3
+diff -Naurd mpfr-3.1.3-a/src/div_2si.c mpfr-3.1.3-b/src/div_2si.c
+--- mpfr-3.1.3-a/src/div_2si.c 2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/src/div_2si.c 2015-07-17 08:54:48.608807656 +0000
+@@ -45,7 +45,8 @@
+ if (rnd_mode == MPFR_RNDN &&
+ (__gmpfr_emin > MPFR_EMAX_MAX - (n - 1) ||
+ exp < __gmpfr_emin + (n - 1) ||
+- (inexact >= 0 && mpfr_powerof2_raw (y))))
++ ((MPFR_IS_NEG (y) ? inexact <= 0 : inexact >= 0) &&
++ mpfr_powerof2_raw (y))))
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (y, rnd_mode, MPFR_SIGN(y));
+ }
+diff -Naurd mpfr-3.1.3-a/src/div_2ui.c mpfr-3.1.3-b/src/div_2ui.c
+--- mpfr-3.1.3-a/src/div_2ui.c 2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/src/div_2ui.c 2015-07-17 08:54:48.608807656 +0000
+@@ -44,7 +44,9 @@
+ if (MPFR_UNLIKELY (n >= diffexp)) /* exp - n <= emin - 1 */
+ {
+ if (rnd_mode == MPFR_RNDN &&
+- (n > diffexp || (inexact >= 0 && mpfr_powerof2_raw (y))))
++ (n > diffexp ||
++ ((MPFR_IS_NEG (y) ? inexact <= 0 : inexact >= 0) &&
++ mpfr_powerof2_raw (y))))
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (y, rnd_mode, MPFR_SIGN (y));
+ }
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2015-07-02 10:50:08.126574142 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2015-07-17 08:54:48.616811495 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p2"
++#define MPFR_VERSION_STRING "3.1.3-p3"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/mul_2si.c mpfr-3.1.3-b/src/mul_2si.c
+--- mpfr-3.1.3-a/src/mul_2si.c 2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/src/mul_2si.c 2015-07-17 08:54:48.608807656 +0000
+@@ -48,7 +48,8 @@
+ if (rnd_mode == MPFR_RNDN &&
+ (__gmpfr_emin > MPFR_EMAX_MAX + (n + 1) ||
+ exp < __gmpfr_emin - (n + 1) ||
+- (inexact >= 0 && mpfr_powerof2_raw (y))))
++ ((MPFR_IS_NEG (y) ? inexact <= 0 : inexact >= 0) &&
++ mpfr_powerof2_raw (y))))
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (y, rnd_mode, MPFR_SIGN(y));
+ }
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2015-07-02 10:50:08.126574142 +0000
++++ mpfr-3.1.3-b/src/version.c 2015-07-17 08:54:48.616811495 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p2";
++ return "3.1.3-p3";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tmul_2exp.c mpfr-3.1.3-b/tests/tmul_2exp.c
+--- mpfr-3.1.3-a/tests/tmul_2exp.c 2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/tests/tmul_2exp.c 2015-07-17 08:54:48.608807656 +0000
+@@ -50,77 +50,82 @@
+ {
+ mpfr_t x, y, z1, z2;
+ mpfr_exp_t emin;
+- int i, k;
++ int i, k, s;
+ int prec;
+ int rnd;
+ int div;
+ int inex1, inex2;
+ unsigned int flags1, flags2;
+
+- /* Test mul_2si(x, e - k), div_2si(x, k - e) and div_2ui(x, k - e)
+- * with emin = e, x = 1 + i/16, i in { -1, 0, 1 }, and k = 1 to 4,
+- * by comparing the result with the one of a simple division.
++ /* Test mul_2si(x, e - k), div_2si(x, k - e) and div_2ui(x, k - e) with
++ * emin = e, x = s * (1 + i/16), i in { -1, 0, 1 }, s in { -1, 1 }, and
++ * k = 1 to 4, by comparing the result with the one of a simple division.
+ */
+ emin = mpfr_get_emin ();
+ set_emin (e);
+ mpfr_inits2 (8, x, y, (mpfr_ptr) 0);
+ for (i = 15; i <= 17; i++)
+- {
+- inex1 = mpfr_set_ui_2exp (x, i, -4, MPFR_RNDN);
+- MPFR_ASSERTN (inex1 == 0);
+- for (prec = 6; prec >= 3; prec -= 3)
+- {
+- mpfr_inits2 (prec, z1, z2, (mpfr_ptr) 0);
+- RND_LOOP (rnd)
+- for (k = 1; k <= 4; k++)
+- {
+- /* The following one is assumed to be correct. */
+- inex1 = mpfr_mul_2si (y, x, e, MPFR_RNDN);
+- MPFR_ASSERTN (inex1 == 0);
+- inex1 = mpfr_set_ui (z1, 1 << k, MPFR_RNDN);
+- MPFR_ASSERTN (inex1 == 0);
+- mpfr_clear_flags ();
+- /* Do not use mpfr_div_ui to avoid the optimization
+- by mpfr_div_2si. */
+- inex1 = mpfr_div (z1, y, z1, (mpfr_rnd_t) rnd);
+- flags1 = __gmpfr_flags;
+-
+- for (div = 0; div <= 2; div++)
++ for (s = 1; s >= -1; s -= 2)
++ {
++ inex1 = mpfr_set_si_2exp (x, s * i, -4, MPFR_RNDN);
++ MPFR_ASSERTN (inex1 == 0);
++ for (prec = 6; prec >= 3; prec -= 3)
++ {
++ mpfr_inits2 (prec, z1, z2, (mpfr_ptr) 0);
++ RND_LOOP (rnd)
++ for (k = 1; k <= 4; k++)
+ {
++ /* The following one is assumed to be correct. */
++ inex1 = mpfr_mul_2si (y, x, e, MPFR_RNDN);
++ MPFR_ASSERTN (inex1 == 0);
++ inex1 = mpfr_set_ui (z1, 1 << k, MPFR_RNDN);
++ MPFR_ASSERTN (inex1 == 0);
+ mpfr_clear_flags ();
+- inex2 = div == 0 ?
+- mpfr_mul_2si (z2, x, e - k, (mpfr_rnd_t) rnd) : div == 1 ?
+- mpfr_div_2si (z2, x, k - e, (mpfr_rnd_t) rnd) :
+- mpfr_div_2ui (z2, x, k - e, (mpfr_rnd_t) rnd);
+- flags2 = __gmpfr_flags;
+- if (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
+- mpfr_equal_p (z1, z2))
+- continue;
+- printf ("Error in underflow(");
+- if (e == MPFR_EMIN_MIN)
+- printf ("MPFR_EMIN_MIN");
+- else if (e == emin)
+- printf ("default emin");
+- else if (e >= LONG_MIN)
+- printf ("%ld", (long) e);
+- else
+- printf ("<LONG_MIN");
+- printf (") with mpfr_%s,\nx = %d/16, prec = %d, k = %d, "
+- "%s\n", div == 0 ? "mul_2si" : div == 1 ?
+- "div_2si" : "div_2ui", i, prec, k,
+- mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
+- printf ("Expected ");
+- mpfr_out_str (stdout, 16, 0, z1, MPFR_RNDN);
+- printf (", inex = %d, flags = %u\n", SIGN (inex1), flags1);
+- printf ("Got ");
+- mpfr_out_str (stdout, 16, 0, z2, MPFR_RNDN);
+- printf (", inex = %d, flags = %u\n", SIGN (inex2), flags2);
+- exit (1);
+- } /* div */
+- } /* k */
+- mpfr_clears (z1, z2, (mpfr_ptr) 0);
+- } /* prec */
+- } /* i */
++ /* Do not use mpfr_div_ui to avoid the optimization
++ by mpfr_div_2si. */
++ inex1 = mpfr_div (z1, y, z1, (mpfr_rnd_t) rnd);
++ flags1 = __gmpfr_flags;
++
++ for (div = 0; div <= 2; div++)
++ {
++ mpfr_clear_flags ();
++ inex2 =
++ div == 0 ?
++ mpfr_mul_2si (z2, x, e - k, (mpfr_rnd_t) rnd) :
++ div == 1 ?
++ mpfr_div_2si (z2, x, k - e, (mpfr_rnd_t) rnd) :
++ mpfr_div_2ui (z2, x, k - e, (mpfr_rnd_t) rnd);
++ flags2 = __gmpfr_flags;
++ if (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
++ mpfr_equal_p (z1, z2))
++ continue;
++ printf ("Error in underflow(");
++ if (e == MPFR_EMIN_MIN)
++ printf ("MPFR_EMIN_MIN");
++ else if (e == emin)
++ printf ("default emin");
++ else if (e >= LONG_MIN)
++ printf ("%ld", (long) e);
++ else
++ printf ("<LONG_MIN");
++ printf (") with mpfr_%s,\nx = %d/16, prec = %d, k = %d,"
++ " %s\n", div == 0 ? "mul_2si" : div == 1 ?
++ "div_2si" : "div_2ui", s * i, prec, k,
++ mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
++ printf ("Expected ");
++ mpfr_out_str (stdout, 16, 0, z1, MPFR_RNDN);
++ printf (", inex = %d, flags = %u\n",
++ SIGN (inex1), flags1);
++ printf ("Got ");
++ mpfr_out_str (stdout, 16, 0, z2, MPFR_RNDN);
++ printf (", inex = %d, flags = %u\n",
++ SIGN (inex2), flags2);
++ exit (1);
++ } /* div */
++ } /* k */
++ mpfr_clears (z1, z2, (mpfr_ptr) 0);
++ } /* prec */
++ } /* i */
+ mpfr_clears (x, y, (mpfr_ptr) 0);
+ set_emin (emin);
+ }
diff --git a/patches/mpfr/3.1.3/140-frexp.patch b/patches/mpfr/3.1.3/140-frexp.patch
new file mode 100644
index 0000000..e0d5e09
--- /dev/null
+++ b/patches/mpfr/3.1.3/140-frexp.patch
@@ -0,0 +1,204 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2015-07-17 08:58:21.094987384 +0000
++++ mpfr-3.1.3-b/PATCHES 2015-07-17 08:58:21.118986898 +0000
+@@ -0,0 +1 @@
++frexp
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2015-07-17 08:54:48.616811495 +0000
++++ mpfr-3.1.3-b/VERSION 2015-07-17 08:58:21.118986898 +0000
+@@ -1 +1 @@
+-3.1.3-p3
++3.1.3-p4
+diff -Naurd mpfr-3.1.3-a/src/frexp.c mpfr-3.1.3-b/src/frexp.c
+--- mpfr-3.1.3-a/src/frexp.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/frexp.c 2015-07-17 08:58:21.106987142 +0000
+@@ -26,6 +26,13 @@
+ mpfr_frexp (mpfr_exp_t *exp, mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
+ {
+ int inex;
++ unsigned int saved_flags = __gmpfr_flags;
++ MPFR_BLOCK_DECL (flags);
++
++ MPFR_LOG_FUNC
++ (("x[%Pu]=%.*Rg rnd=%d", mpfr_get_prec (x), mpfr_log_prec, x, rnd),
++ ("y[%Pu]=%.*Rg exp=%" MPFR_EXP_FSPEC "d inex=%d", mpfr_get_prec (y),
++ mpfr_log_prec, y, (mpfr_eexp_t) *exp, inex));
+
+ if (MPFR_UNLIKELY(MPFR_IS_SINGULAR(x)))
+ {
+@@ -49,8 +56,32 @@
+ }
+ }
+
+- inex = mpfr_set (y, x, rnd);
++ MPFR_BLOCK (flags, inex = mpfr_set (y, x, rnd));
++ __gmpfr_flags = saved_flags;
++
++ /* Possible overflow due to the rounding, no possible underflow. */
++
++ if (MPFR_UNLIKELY (MPFR_OVERFLOW (flags)))
++ {
++ int inex2;
++
++ /* An overflow here means that the exponent of y would be larger than
++ the one of x, thus x would be rounded to the next power of 2, and
++ the returned y should be 1/2 in absolute value, rounded (i.e. with
++ possible underflow or overflow). This also implies that x and y are
++ different objects, so that the exponent of x has not been lost. */
++ MPFR_LOG_MSG (("Internal overflow\n", 0));
++ MPFR_ASSERTD (x != y);
++ *exp = MPFR_GET_EXP (x) + 1;
++ inex2 = mpfr_set_si_2exp (y, MPFR_INT_SIGN (x), -1, rnd);
++ MPFR_LOG_MSG (("inex=%d inex2=%d\n", inex, inex2));
++ if (inex2 != 0)
++ inex = inex2;
++ MPFR_RET (inex);
++ }
++
+ *exp = MPFR_GET_EXP (y);
+- MPFR_SET_EXP (y, 0);
++ /* Do not use MPFR_SET_EXP because the range has not been checked yet. */
++ MPFR_EXP (y) = 0;
+ return mpfr_check_range (y, inex, rnd);
+ }
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2015-07-17 08:54:48.616811495 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2015-07-17 08:58:21.114986979 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p3"
++#define MPFR_VERSION_STRING "3.1.3-p4"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2015-07-17 08:54:48.616811495 +0000
++++ mpfr-3.1.3-b/src/version.c 2015-07-17 08:58:21.118986898 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p3";
++ return "3.1.3-p4";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tfrexp.c mpfr-3.1.3-b/tests/tfrexp.c
+--- mpfr-3.1.3-a/tests/tfrexp.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tfrexp.c 2015-07-17 08:58:21.106987142 +0000
+@@ -129,12 +129,115 @@
+ mpfr_clear (x);
+ }
+
++static void check1 (void)
++{
++ mpfr_exp_t emin, emax, e;
++ mpfr_t x, y1, y2;
++ int r, neg, red;
++
++ emin = mpfr_get_emin ();
++ emax = mpfr_get_emax ();
++ set_emin (MPFR_EMIN_MIN);
++ set_emax (MPFR_EMAX_MAX);
++
++ mpfr_init2 (x, 7);
++ mpfr_inits2 (4, y1, y2, (mpfr_ptr) 0);
++
++ mpfr_set_ui_2exp (x, 1, -2, MPFR_RNDN);
++ while (mpfr_regular_p (x))
++ {
++ /* Test the exponents up to 3 and with the maximum exponent
++ (to check potential intermediate overflow). */
++ if (MPFR_GET_EXP (x) == 4)
++ mpfr_set_exp (x, MPFR_EMAX_MAX);
++ e = MPFR_GET_EXP (x);
++ for (neg = 0; neg < 2; neg++)
++ {
++ RND_LOOP (r)
++ {
++ int inex1, inex2;
++ mpfr_exp_t e1, e2;
++ unsigned int flags1, flags2;
++
++ for (red = 0; red < 2; red++)
++ {
++ if (red)
++ {
++ /* e1: exponent of the rounded value of x. */
++ MPFR_ASSERTN (e1 == e || e1 == e + 1);
++ set_emin (e);
++ set_emax (e);
++ mpfr_clear_flags ();
++ inex1 = e1 < 0 ?
++ mpfr_mul_2ui (y1, x, -e1, (mpfr_rnd_t) r) :
++ mpfr_div_2ui (y1, x, e1, (mpfr_rnd_t) r);
++ flags1 = __gmpfr_flags;
++ }
++ else
++ {
++ inex1 = mpfr_set (y1, x, (mpfr_rnd_t) r);
++ e1 = MPFR_IS_INF (y1) ? e + 1 : MPFR_GET_EXP (y1);
++ flags1 = inex1 != 0 ? MPFR_FLAGS_INEXACT : 0;
++ }
++ mpfr_clear_flags ();
++ inex2 = mpfr_frexp (&e2, y2, x, (mpfr_rnd_t) r);
++ flags2 = __gmpfr_flags;
++ set_emin (MPFR_EMIN_MIN);
++ set_emax (MPFR_EMAX_MAX);
++ if ((!red || e == 0) &&
++ (! mpfr_regular_p (y2) || MPFR_GET_EXP (y2) != 0))
++ {
++ printf ("Error in check1 for %s, red = %d, x = ",
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r), red);
++ mpfr_dump (x);
++ printf ("Expected 1/2 <= |y| < 1, got y = ");
++ mpfr_dump (y2);
++ exit (1);
++ }
++ if (!red)
++ {
++ if (e2 > 0)
++ mpfr_mul_2ui (y2, y2, e2, MPFR_RNDN);
++ else if (e2 < 0)
++ mpfr_div_2ui (y2, y2, -e2, MPFR_RNDN);
++ }
++ if (! (SAME_SIGN (inex1, inex2) &&
++ mpfr_equal_p (y1, y2) &&
++ flags1 == flags2))
++ {
++ printf ("Error in check1 for %s, red = %d, x = ",
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r), red);
++ mpfr_dump (x);
++ printf ("Expected y1 = ");
++ mpfr_dump (y1);
++ printf ("Got y2 = ");
++ mpfr_dump (y2);
++ printf ("Expected inex ~= %d, got %d\n", inex1, inex2);
++ printf ("Expected flags:");
++ flags_out (flags1);
++ printf ("Got flags: ");
++ flags_out (flags2);
++ exit (1);
++ }
++ }
++ }
++ mpfr_neg (x, x, MPFR_RNDN);
++ }
++ mpfr_nextabove (x);
++ }
++
++ mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
++ set_emin (emin);
++ set_emax (emax);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+ tests_start_mpfr ();
+
+ check_special ();
++ check1 ();
+
+ tests_end_mpfr ();
+ return 0;
diff --git a/patches/mpfr/3.1.3/150-divhigh-basecase.patch b/patches/mpfr/3.1.3/150-divhigh-basecase.patch
new file mode 100644
index 0000000..ef8d891
--- /dev/null
+++ b/patches/mpfr/3.1.3/150-divhigh-basecase.patch
@@ -0,0 +1,131 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2015-10-29 13:47:46.735901185 +0000
++++ mpfr-3.1.3-b/PATCHES 2015-10-29 13:47:46.763900609 +0000
+@@ -0,0 +1 @@
++divhigh-basecase
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2015-07-17 08:58:21.118986898 +0000
++++ mpfr-3.1.3-b/VERSION 2015-10-29 13:47:46.763900609 +0000
+@@ -1 +1 @@
+-3.1.3-p4
++3.1.3-p5
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2015-07-17 08:58:21.114986979 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2015-10-29 13:47:46.759900692 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p4"
++#define MPFR_VERSION_STRING "3.1.3-p5"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/mulders.c mpfr-3.1.3-b/src/mulders.c
+--- mpfr-3.1.3-a/src/mulders.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/mulders.c 2015-10-29 13:47:46.751900855 +0000
+@@ -236,9 +236,10 @@
+ that in addition to the limb np[n-1] to reduce, we have at least 2
+ extra limbs, thus accessing np[n-3] is valid. */
+
+- /* warning: we can have np[n-1]=d1 and np[n-2]=d0, but since {np,n} < D,
+- the largest possible partial quotient is B-1 */
+- if (MPFR_UNLIKELY(np[n - 1] == d1 && np[n - 2] == d0))
++ /* Warning: we can have np[n-1]>d1 or (np[n-1]=d1 and np[n-2]>=d0) here,
++ since we truncate the divisor at each step, but since {np,n} < D
++ originally, the largest possible partial quotient is B-1. */
++ if (MPFR_UNLIKELY(np[n-1] > d1 || (np[n-1] == d1 && np[n-2] >= d0)))
+ q2 = ~ (mp_limb_t) 0;
+ else
+ udiv_qr_3by2 (q2, q1, q0, np[n - 1], np[n - 2], np[n - 3],
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2015-07-17 08:58:21.118986898 +0000
++++ mpfr-3.1.3-b/src/version.c 2015-10-29 13:47:46.763900609 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p4";
++ return "3.1.3-p5";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tdiv.c mpfr-3.1.3-b/tests/tdiv.c
+--- mpfr-3.1.3-a/tests/tdiv.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tdiv.c 2015-10-29 13:47:46.751900855 +0000
+@@ -1099,6 +1099,69 @@
+ mpfr_set_emax (old_emax);
+ }
+
++/* Bug in mpfr_divhigh_n_basecase when all limbs of q (except the most
++ significant one) are B-1 where B=2^GMP_NUMB_BITS. Since we truncate
++ the divisor at each step, it might happen at some point that
++ (np[n-1],np[n-2]) > (d1,d0), and not only the equality.
++ Reported by Ricky Farr
++ <https://sympa.inria.fr/sympa/arc/mpfr/2015-10/msg00023.html>
++ To get a failure, a MPFR_DIVHIGH_TAB entry below the MPFR_DIV_THRESHOLD
++ limit must have a value 0. With most mparam.h files, this cannot occur. */
++static void
++test_20151023 (void)
++{
++ mpfr_prec_t p;
++ mpfr_t n, d, q, q0;
++ int inex, i;
++
++ for (p = GMP_NUMB_BITS; p <= 2000; p++)
++ {
++ mpfr_init2 (n, 2*p);
++ mpfr_init2 (d, p);
++ mpfr_init2 (q, p);
++ mpfr_init2 (q0, GMP_NUMB_BITS);
++
++ /* generate a random divisor of p bits */
++ mpfr_urandomb (d, RANDS);
++ /* generate a random quotient of GMP_NUMB_BITS bits */
++ mpfr_urandomb (q0, RANDS);
++ /* zero-pad the quotient to p bits */
++ inex = mpfr_prec_round (q0, p, MPFR_RNDN);
++ MPFR_ASSERTN(inex == 0);
++
++ for (i = 0; i < 3; i++)
++ {
++ /* i=0: try with the original quotient xxx000...000
++ i=1: try with the original quotient minus one ulp
++ i=2: try with the original quotient plus one ulp */
++ if (i == 1)
++ mpfr_nextbelow (q0);
++ else if (i == 2)
++ {
++ mpfr_nextabove (q0);
++ mpfr_nextabove (q0);
++ }
++
++ inex = mpfr_mul (n, d, q0, MPFR_RNDN);
++ MPFR_ASSERTN(inex == 0);
++ mpfr_nextabove (n);
++ mpfr_div (q, n, d, MPFR_RNDN);
++ MPFR_ASSERTN(mpfr_cmp (q, q0) == 0);
++
++ inex = mpfr_mul (n, d, q0, MPFR_RNDN);
++ MPFR_ASSERTN(inex == 0);
++ mpfr_nextbelow (n);
++ mpfr_div (q, n, d, MPFR_RNDN);
++ MPFR_ASSERTN(mpfr_cmp (q, q0) == 0);
++ }
++
++ mpfr_clear (n);
++ mpfr_clear (d);
++ mpfr_clear (q);
++ mpfr_clear (q0);
++ }
++}
++
+ #define TEST_FUNCTION test_div
+ #define TWO_ARGS
+ #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100, RANDS)
+@@ -1219,6 +1282,7 @@
+ consistency ();
+ test_20070603 ();
+ test_20070628 ();
++ test_20151023 ();
+ test_generic (2, 800, 50);
+ test_extreme ();
+
diff --git a/patches/mpfr/3.1.3/160-jn.patch b/patches/mpfr/3.1.3/160-jn.patch
new file mode 100644
index 0000000..e7d04fa
--- /dev/null
+++ b/patches/mpfr/3.1.3/160-jn.patch
@@ -0,0 +1,71 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-15 15:10:03.358066124 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-15 15:10:03.414066216 +0000
+@@ -0,0 +1 @@
++jn
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2015-10-29 13:47:46.763900609 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-15 15:10:03.414066216 +0000
+@@ -1 +1 @@
+-3.1.3-p5
++3.1.3-p6
+diff -Naurd mpfr-3.1.3-a/src/jyn_asympt.c mpfr-3.1.3-b/src/jyn_asympt.c
+--- mpfr-3.1.3-a/src/jyn_asympt.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/jyn_asympt.c 2016-02-15 15:10:03.394066183 +0000
+@@ -253,9 +253,9 @@
+ break;
+ if (diverge != 0)
+ {
+- mpfr_set (c, z, r); /* will force inex=0 below, which means the
+- asymptotic expansion failed */
+- break;
++ MPFR_ZIV_FREE (loop);
++ mpfr_clear (c);
++ return 0; /* means that the asymptotic expansion failed */
+ }
+ MPFR_ZIV_NEXT (loop, w);
+ }
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2015-10-29 13:47:46.759900692 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-15 15:10:03.410066210 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p5"
++#define MPFR_VERSION_STRING "3.1.3-p6"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2015-10-29 13:47:46.763900609 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-15 15:10:03.414066216 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p5";
++ return "3.1.3-p6";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tj0.c mpfr-3.1.3-b/tests/tj0.c
+--- mpfr-3.1.3-a/tests/tj0.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tj0.c 2016-02-15 15:10:03.394066183 +0000
+@@ -99,6 +99,18 @@
+ mpfr_j0 (y, x, MPFR_RNDN);
+ MPFR_ASSERTN (! mpfr_nan_p (y) && mpfr_cmp_ui_2exp (y, 41, -11) == 0);
+
++ /* Bug reported by Fredrik Johansson on 19 Jan 2016 */
++ mpfr_set_prec (x, 53);
++ mpfr_set_str (x, "0x4.3328p+0", 0, MPFR_RNDN);
++ mpfr_set_prec (y, 2);
++ mpfr_j0 (y, x, MPFR_RNDD);
++ /* y should be -0.5 */
++ MPFR_ASSERTN (! mpfr_nan_p (y) && mpfr_cmp_si_2exp (y, -1, -1) == 0);
++ mpfr_set_prec (y, 3);
++ mpfr_j0 (y, x, MPFR_RNDD);
++ /* y should be -0.4375 */
++ MPFR_ASSERTN (! mpfr_nan_p (y) && mpfr_cmp_si_2exp (y, -7, -4) == 0);
++
+ /* Case for which s = 0 in mpfr_jn */
+ mpfr_set_prec (x, 44);
+ mpfr_set_prec (y, 44);
diff --git a/patches/mpfr/3.1.3/170-zeta.patch b/patches/mpfr/3.1.3/170-zeta.patch
new file mode 100644
index 0000000..12faf1d
--- /dev/null
+++ b/patches/mpfr/3.1.3/170-zeta.patch
@@ -0,0 +1,125 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-15 15:11:00.898156344 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-15 15:11:00.966156445 +0000
+@@ -0,0 +1 @@
++zeta
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:10:03.414066216 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-15 15:11:00.966156445 +0000
+@@ -1 +1 @@
+-3.1.3-p6
++3.1.3-p7
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:10:03.410066210 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-15 15:11:00.962156439 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p6"
++#define MPFR_VERSION_STRING "3.1.3-p7"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:10:03.414066216 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-15 15:11:00.966156445 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p6";
++ return "3.1.3-p7";
+ }
+diff -Naurd mpfr-3.1.3-a/src/zeta.c mpfr-3.1.3-b/src/zeta.c
+--- mpfr-3.1.3-a/src/zeta.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/zeta.c 2016-02-15 15:11:00.942156410 +0000
+@@ -377,8 +377,8 @@
+ }
+ }
+
+- /* Check for case s= 1 before changing the exponent range */
+- if (mpfr_cmp (s, __gmpfr_one) ==0)
++ /* Check for case s=1 before changing the exponent range */
++ if (mpfr_cmp (s, __gmpfr_one) == 0)
+ {
+ MPFR_SET_INF (z);
+ MPFR_SET_POS (z);
+@@ -420,7 +420,7 @@
+ MPFR_ZIV_INIT (loop, prec1);
+ for (;;)
+ {
+- mpfr_sub (s1, __gmpfr_one, s, MPFR_RNDN);/* s1 = 1-s */
++ mpfr_sub (s1, __gmpfr_one, s, MPFR_RNDN); /* s1 = 1-s */
+ mpfr_zeta_pos (z_pre, s1, MPFR_RNDN); /* zeta(1-s) */
+ mpfr_gamma (y, s1, MPFR_RNDN); /* gamma(1-s) */
+ if (MPFR_IS_INF (y)) /* Zeta(s) < 0 for -4k-2 < s < -4k,
+@@ -432,17 +432,32 @@
+ break;
+ }
+ mpfr_mul (z_pre, z_pre, y, MPFR_RNDN); /* gamma(1-s)*zeta(1-s) */
+- mpfr_const_pi (p, MPFR_RNDD);
+- mpfr_mul (y, s, p, MPFR_RNDN);
+- mpfr_div_2ui (y, y, 1, MPFR_RNDN); /* s*Pi/2 */
+- mpfr_sin (y, y, MPFR_RNDN); /* sin(Pi*s/2) */
+- mpfr_mul (z_pre, z_pre, y, MPFR_RNDN);
++
++ mpfr_const_pi (p, MPFR_RNDD); /* p is Pi */
++
++ /* multiply z_pre by 2^s*Pi^(s-1) where p=Pi, s1=1-s */
+ mpfr_mul_2ui (y, p, 1, MPFR_RNDN); /* 2*Pi */
+ mpfr_neg (s1, s1, MPFR_RNDN); /* s-1 */
+ mpfr_pow (y, y, s1, MPFR_RNDN); /* (2*Pi)^(s-1) */
+ mpfr_mul (z_pre, z_pre, y, MPFR_RNDN);
+ mpfr_mul_2ui (z_pre, z_pre, 1, MPFR_RNDN);
+
++ /* multiply z_pre by sin(Pi*s/2) */
++ mpfr_mul (y, s, p, MPFR_RNDN);
++ mpfr_div_2ui (p, y, 1, MPFR_RNDN); /* p = s*Pi/2 */
++ mpfr_sin (y, p, MPFR_RNDN); /* y = sin(Pi*s/2) */
++ if (MPFR_GET_EXP(y) < 0) /* take account of cancellation in sin(p) */
++ {
++ mpfr_t t;
++ mpfr_init2 (t, prec1 - MPFR_GET_EXP(y));
++ mpfr_const_pi (t, MPFR_RNDD);
++ mpfr_mul (t, s, t, MPFR_RNDN);
++ mpfr_div_2ui (t, t, 1, MPFR_RNDN);
++ mpfr_sin (y, t, MPFR_RNDN);
++ mpfr_clear (t);
++ }
++ mpfr_mul (z_pre, z_pre, y, MPFR_RNDN);
++
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (z_pre, prec1 - add, precz,
+ rnd_mode)))
+ break;
+diff -Naurd mpfr-3.1.3-a/tests/tzeta.c mpfr-3.1.3-b/tests/tzeta.c
+--- mpfr-3.1.3-a/tests/tzeta.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tzeta.c 2016-02-15 15:11:00.942156410 +0000
+@@ -394,6 +394,27 @@
+ mpfr_nextabove (s);
+ MPFR_ASSERTN (mpfr_equal_p (z, s) && inex > 0);
+
++ /* bug reported by Fredrik Johansson on 19 Jan 2016 */
++ mpfr_set_prec (s, 536);
++ mpfr_set_ui_2exp (s, 1, -424, MPFR_RNDN);
++ mpfr_sub_ui (s, s, 128, MPFR_RNDN); /* -128 + 2^(-424) */
++ for (prec = 6; prec <= 536; prec += 8) /* should go through 318 */
++ {
++ mpfr_set_prec (z, prec);
++ mpfr_zeta (z, s, MPFR_RNDD);
++ mpfr_set_prec (y, prec + 10);
++ mpfr_zeta (y, s, MPFR_RNDD);
++ mpfr_prec_round (y, prec, MPFR_RNDD);
++ if (! mpfr_equal_p (z, y))
++ {
++ printf ("mpfr_zeta fails near -128 for inprec=%lu outprec=%lu\n",
++ (unsigned long) mpfr_get_prec (s), (unsigned long) prec);
++ printf ("expected "); mpfr_dump (y);
++ printf ("got "); mpfr_dump (z);
++ exit (1);
++ }
++ }
++
+ mpfr_clear (s);
+ mpfr_clear (y);
+ mpfr_clear (z);
diff --git a/patches/mpfr/3.1.3/180-sqrt.patch b/patches/mpfr/3.1.3/180-sqrt.patch
new file mode 100644
index 0000000..4887009
--- /dev/null
+++ b/patches/mpfr/3.1.3/180-sqrt.patch
@@ -0,0 +1,97 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-15 15:12:59.450314624 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-15 15:12:59.510314695 +0000
+@@ -0,0 +1 @@
++sqrt
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:11:00.966156445 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-15 15:12:59.510314695 +0000
+@@ -1 +1 @@
+-3.1.3-p7
++3.1.3-p8
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:11:00.962156439 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-15 15:12:59.510314695 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p7"
++#define MPFR_VERSION_STRING "3.1.3-p8"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/sqrt.c mpfr-3.1.3-b/src/sqrt.c
+--- mpfr-3.1.3-a/src/sqrt.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/sqrt.c 2016-02-15 15:12:59.490314671 +0000
+@@ -211,10 +211,11 @@
+ rsize --;
+ sh = 0;
+ }
++ /* now rsize = MPFR_LIMB_SIZE(r) */
+ if (mpn_add_1 (rp0, rp, rsize, MPFR_LIMB_ONE << sh))
+ {
+ expr ++;
+- rp[rsize - 1] = MPFR_LIMB_HIGHBIT;
++ rp0[rsize - 1] = MPFR_LIMB_HIGHBIT;
+ }
+ goto end;
+
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:11:00.966156445 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-15 15:12:59.510314695 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p7";
++ return "3.1.3-p8";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tsqrt.c mpfr-3.1.3-b/tests/tsqrt.c
+--- mpfr-3.1.3-a/tests/tsqrt.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tsqrt.c 2016-02-15 15:12:59.490314671 +0000
+@@ -569,6 +569,35 @@
+ mpfr_clear (y);
+ }
+
++/* Bug reported by Fredrik Johansson, occurring when:
++ - the precision of the result is a multiple of the number of bits
++ per word (GMP_NUMB_BITS),
++ - the rounding mode is to nearest (MPFR_RNDN),
++ - internally, the result has to be rounded up to a power of 2.
++*/
++static void
++bug20160120 (void)
++{
++ mpfr_t x, y;
++
++ mpfr_init2 (x, 4 * GMP_NUMB_BITS);
++ mpfr_init2 (y, GMP_NUMB_BITS);
++
++ mpfr_set_ui (x, 1, MPFR_RNDN);
++ mpfr_nextbelow (x);
++ mpfr_sqrt (y, x, MPFR_RNDN);
++ MPFR_ASSERTN(mpfr_check (y));
++ MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0);
++
++ mpfr_set_prec (y, 2 * GMP_NUMB_BITS);
++ mpfr_sqrt (y, x, MPFR_RNDN);
++ MPFR_ASSERTN(mpfr_check (y));
++ MPFR_ASSERTN(mpfr_cmp_ui (y, 1) == 0);
++
++ mpfr_clear(x);
++ mpfr_clear(y);
++}
++
+ #define TEST_FUNCTION test_sqrt
+ #define TEST_RANDOM_POS 8
+ #include "tgeneric.c"
+@@ -704,6 +733,8 @@
+ data_check ("data/sqrt", mpfr_sqrt, "mpfr_sqrt");
+ bad_cases (mpfr_sqrt, mpfr_sqr, "mpfr_sqrt", 8, -256, 255, 4, 128, 800, 50);
+
++ bug20160120 ();
++
+ tests_end_mpfr ();
+ return 0;
+ }
diff --git a/patches/mpfr/3.1.3/190-si-ops.patch b/patches/mpfr/3.1.3/190-si-ops.patch
new file mode 100644
index 0000000..e4df233
--- /dev/null
+++ b/patches/mpfr/3.1.3/190-si-ops.patch
@@ -0,0 +1,107 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-15 15:17:39.214577503 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-15 15:17:39.282577552 +0000
+@@ -0,0 +1 @@
++si-ops
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:12:59.510314695 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-15 15:17:39.282577552 +0000
+@@ -1 +1 @@
+-3.1.3-p8
++3.1.3-p9
+diff -Naurd mpfr-3.1.3-a/src/div_ui.c mpfr-3.1.3-b/src/div_ui.c
+--- mpfr-3.1.3-a/src/div_ui.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/div_ui.c 2016-02-15 15:17:39.258577534 +0000
+@@ -274,7 +274,8 @@
+ res = mpfr_div_ui (y, x, u, rnd_mode);
+ else
+ {
+- res = -mpfr_div_ui (y, x, -u, MPFR_INVERT_RND (rnd_mode));
++ res = - mpfr_div_ui (y, x, - (unsigned long) u,
++ MPFR_INVERT_RND (rnd_mode));
+ MPFR_CHANGE_SIGN (y);
+ }
+ return res;
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:12:59.510314695 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-15 15:17:39.282577552 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p8"
++#define MPFR_VERSION_STRING "3.1.3-p9"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/mul_ui.c mpfr-3.1.3-b/src/mul_ui.c
+--- mpfr-3.1.3-a/src/mul_ui.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/mul_ui.c 2016-02-15 15:17:39.258577534 +0000
+@@ -126,7 +126,8 @@
+ res = mpfr_mul_ui (y, x, u, rnd_mode);
+ else
+ {
+- res = -mpfr_mul_ui (y, x, -u, MPFR_INVERT_RND (rnd_mode));
++ res = - mpfr_mul_ui (y, x, - (unsigned long) u,
++ MPFR_INVERT_RND (rnd_mode));
+ MPFR_CHANGE_SIGN (y);
+ }
+ return res;
+diff -Naurd mpfr-3.1.3-a/src/si_op.c mpfr-3.1.3-b/src/si_op.c
+--- mpfr-3.1.3-a/src/si_op.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/si_op.c 2016-02-15 15:17:39.258577534 +0000
+@@ -30,7 +30,7 @@
+ if (u >= 0)
+ return mpfr_add_ui (y, x, u, rnd_mode);
+ else
+- return mpfr_sub_ui (y, x, -u, rnd_mode);
++ return mpfr_sub_ui (y, x, - (unsigned long) u, rnd_mode);
+ }
+
+ int
+@@ -39,7 +39,7 @@
+ if (u >= 0)
+ return mpfr_sub_ui (y, x, u, rnd_mode);
+ else
+- return mpfr_add_ui (y, x, -u, rnd_mode);
++ return mpfr_add_ui (y, x, - (unsigned long) u, rnd_mode);
+ }
+
+ int
+@@ -49,9 +49,9 @@
+ return mpfr_ui_sub (y, u, x, rnd_mode);
+ else
+ {
+- int res = -mpfr_add_ui (y, x, -u, MPFR_INVERT_RND (rnd_mode));
+- MPFR_CHANGE_SIGN (y);
+- return res;
++ int res = - mpfr_add_ui (y, x, - (unsigned long) u,
++ MPFR_INVERT_RND (rnd_mode));
++ MPFR_CHANGE_SIGN (y);
++ return res;
+ }
+ }
+-
+diff -Naurd mpfr-3.1.3-a/src/ui_div.c mpfr-3.1.3-b/src/ui_div.c
+--- mpfr-3.1.3-a/src/ui_div.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/ui_div.c 2016-02-15 15:17:39.258577534 +0000
+@@ -106,7 +106,8 @@
+ res = mpfr_ui_div (y, u, x, rnd_mode);
+ else
+ {
+- res = -mpfr_ui_div (y, -u, x, MPFR_INVERT_RND(rnd_mode));
++ res = - mpfr_ui_div (y, - (unsigned long) u, x,
++ MPFR_INVERT_RND(rnd_mode));
+ MPFR_CHANGE_SIGN (y);
+ }
+ return res;
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:12:59.510314695 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-15 15:17:39.282577552 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p8";
++ return "3.1.3-p9";
+ }
diff --git a/patches/mpfr/3.1.3/200-can_round.patch b/patches/mpfr/3.1.3/200-can_round.patch
new file mode 100644
index 0000000..6c0f79a
--- /dev/null
+++ b/patches/mpfr/3.1.3/200-can_round.patch
@@ -0,0 +1,413 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-15 15:19:24.210647274 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-15 15:19:24.274647313 +0000
+@@ -0,0 +1 @@
++can_round
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:17:39.282577552 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-15 15:19:24.274647313 +0000
+@@ -1 +1 @@
+-3.1.3-p9
++3.1.3-p10
+diff -Naurd mpfr-3.1.3-a/src/div.c mpfr-3.1.3-b/src/div.c
+--- mpfr-3.1.3-a/src/div.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/div.c 2016-02-15 15:19:24.250647299 +0000
+@@ -310,24 +310,23 @@
+
+ qp = MPFR_TMP_LIMBS_ALLOC (n);
+ qh = mpfr_divhigh_n (qp, ap, bp, n);
++ MPFR_ASSERTD (qh == 0 || qh == 1);
+ /* in all cases, the error is at most (2n+2) ulps on qh*B^n+{qp,n},
+ cf algorithms.tex */
+
+ p = n * GMP_NUMB_BITS - MPFR_INT_CEIL_LOG2 (2 * n + 2);
+- /* if qh is 1, then we need only PREC(q)-1 bits of {qp,n},
+- if rnd=RNDN, we need to be able to round with a directed rounding
+- and one more bit */
++ /* If rnd=RNDN, we need to be able to round with a directed rounding
++ and one more bit. */
++ if (qh == 1)
++ {
++ mpn_rshift (qp, qp, n, 1);
++ qp[n - 1] |= MPFR_LIMB_HIGHBIT;
++ }
+ if (MPFR_LIKELY (mpfr_round_p (qp, n, p,
+- MPFR_PREC(q) + (rnd_mode == MPFR_RNDN) - qh)))
++ MPFR_PREC(q) + (rnd_mode == MPFR_RNDN))))
+ {
+ /* we can round correctly whatever the rounding mode */
+- if (qh == 0)
+- MPN_COPY (q0p, qp + 1, q0size);
+- else
+- {
+- mpn_rshift (q0p, qp + 1, q0size, 1);
+- q0p[q0size - 1] ^= MPFR_LIMB_HIGHBIT;
+- }
++ MPN_COPY (q0p, qp + 1, q0size);
+ q0p[0] &= ~MPFR_LIMB_MASK(sh); /* put to zero low sh bits */
+
+ if (rnd_mode == MPFR_RNDN) /* round to nearest */
+@@ -335,15 +334,10 @@
+ /* we know we can round, thus we are never in the even rule case:
+ if the round bit is 0, we truncate
+ if the round bit is 1, we add 1 */
+- if (qh == 0)
+- {
+- if (sh > 0)
+- round_bit = (qp[1] >> (sh - 1)) & 1;
+- else
+- round_bit = qp[0] >> (GMP_NUMB_BITS - 1);
+- }
+- else /* qh = 1 */
+- round_bit = (qp[1] >> sh) & 1;
++ if (sh > 0)
++ round_bit = (qp[1] >> (sh - 1)) & 1;
++ else
++ round_bit = qp[0] >> (GMP_NUMB_BITS - 1);
+ if (round_bit == 0)
+ {
+ inex = -1;
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:17:39.282577552 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-15 15:19:24.270647311 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p9"
++#define MPFR_VERSION_STRING "3.1.3-p10"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/round_p.c mpfr-3.1.3-b/src/round_p.c
+--- mpfr-3.1.3-a/src/round_p.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/round_p.c 2016-02-15 15:19:24.250647299 +0000
+@@ -31,7 +31,11 @@
+ {
+ int i1, i2;
+
++ MPFR_ASSERTN(bp[bn - 1] & MPFR_LIMB_HIGHBIT);
++
+ i1 = mpfr_round_p_2 (bp, bn, err0, prec);
++
++ /* compare with mpfr_can_round_raw */
+ i2 = mpfr_can_round_raw (bp, bn, MPFR_SIGN_POS, err0,
+ MPFR_RNDN, MPFR_RNDZ, prec);
+ if (i1 != i2)
+@@ -42,6 +46,7 @@
+ gmp_fprintf (stderr, "%NX\n", bp, bn);
+ MPFR_ASSERTN (0);
+ }
++
+ return i1;
+ }
+ # define mpfr_round_p mpfr_round_p_2
+@@ -62,6 +67,8 @@
+ mp_limb_t tmp, mask;
+ int s;
+
++ MPFR_ASSERTD(bp[bn - 1] & MPFR_LIMB_HIGHBIT);
++
+ err = (mpfr_prec_t) bn * GMP_NUMB_BITS;
+ if (MPFR_UNLIKELY (err0 <= 0 || (mpfr_uexp_t) err0 <= prec || prec >= err))
+ return 0; /* can't round */
+diff -Naurd mpfr-3.1.3-a/src/round_prec.c mpfr-3.1.3-b/src/round_prec.c
+--- mpfr-3.1.3-a/src/round_prec.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/round_prec.c 2016-02-15 15:19:24.250647299 +0000
+@@ -141,24 +141,40 @@
+ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err0,
+ mpfr_rnd_t rnd1, mpfr_rnd_t rnd2, mpfr_prec_t prec)
+ {
+- mpfr_prec_t err;
++ mpfr_prec_t err, prec0 = prec;
+ mp_size_t k, k1, tn;
+ int s, s1;
+ mp_limb_t cc, cc2;
+ mp_limb_t *tmp;
+ MPFR_TMP_DECL(marker);
+
++ MPFR_ASSERTD(bp[bn - 1] & MPFR_LIMB_HIGHBIT);
++
+ if (MPFR_UNLIKELY(err0 < 0 || (mpfr_uexp_t) err0 <= prec))
+ return 0; /* can't round */
+- else if (MPFR_UNLIKELY (prec > (mpfr_prec_t) bn * GMP_NUMB_BITS))
+- { /* then ulp(b) < precision < error */
+- return rnd2 == MPFR_RNDN && (mpfr_uexp_t) err0 - 2 >= prec;
+- /* can round only in rounding to the nearest and err0 >= prec + 2 */
+- }
+
+ MPFR_ASSERT_SIGN(neg);
+ neg = MPFR_IS_NEG_SIGN(neg);
+
++ /* Transform RNDD and RNDU to Zero / Away */
++ MPFR_ASSERTD((neg == 0) || (neg == 1));
++ if (rnd1 != MPFR_RNDN)
++ rnd1 = MPFR_IS_LIKE_RNDZ(rnd1, neg) ? MPFR_RNDZ : MPFR_RNDA;
++ if (rnd2 != MPFR_RNDN)
++ rnd2 = MPFR_IS_LIKE_RNDZ(rnd2, neg) ? MPFR_RNDZ : MPFR_RNDA;
++
++ if (MPFR_UNLIKELY (prec > (mpfr_prec_t) bn * GMP_NUMB_BITS))
++ { /* Then prec < PREC(b): we can round:
++ (i) in rounding to the nearest iff err0 >= prec + 2
++ (ii) in directed rounding mode iff rnd1 is compatible with rnd2
++ and err0 >= prec + 1, unless b = 2^k and rnd1=rnd2=RNDA in
++ which case we need err0 >= prec + 2. */
++ if (rnd2 == MPFR_RNDN)
++ return (mpfr_uexp_t) err0 - 2 >= prec;
++ else
++ return (rnd1 == rnd2) && (mpfr_uexp_t) err0 - 2 >= prec;
++ }
++
+ /* if the error is smaller than ulp(b), then anyway it will propagate
+ up to ulp(b) */
+ err = ((mpfr_uexp_t) err0 > (mpfr_prec_t) bn * GMP_NUMB_BITS) ?
+@@ -168,19 +184,25 @@
+ k = (err - 1) / GMP_NUMB_BITS;
+ MPFR_UNSIGNED_MINUS_MODULO(s, err);
+ /* the error corresponds to bit s in limb k, the most significant limb
+- being limb 0 */
++ being limb 0; in memory, limb k is bp[bn-1-k]. */
+
+ k1 = (prec - 1) / GMP_NUMB_BITS;
+ MPFR_UNSIGNED_MINUS_MODULO(s1, prec);
+- /* the last significant bit is bit s1 in limb k1 */
++ /* the least significant bit is bit s1 in limb k1 */
+
+- /* don't need to consider the k1 most significant limbs */
++ /* We don't need to consider the k1 most significant limbs.
++ They will be considered later only to detect when subtracting
++ the error bound yields a change of binade.
++ Warning! The number with updated bn may no longer be normalized. */
+ k -= k1;
+ bn -= k1;
+ prec -= (mpfr_prec_t) k1 * GMP_NUMB_BITS;
+
+- /* if when adding or subtracting (1 << s) in bp[bn-1-k], it does not
+- change bp[bn-1] >> s1, then we can round */
++ /* We can decide of the correct rounding if rnd2(b-eps) and rnd2(b+eps)
++ give the same result to the target precision 'prec', i.e., if when
++ adding or subtracting (1 << s) in bp[bn-1-k], it does not change the
++ rounding in direction 'rnd2' at ulp-position bp[bn-1] >> s1, taking also
++ into account the possible change of binade. */
+ MPFR_TMP_MARK(marker);
+ tn = bn;
+ k++; /* since we work with k+1 everywhere */
+@@ -190,11 +212,6 @@
+
+ MPFR_ASSERTD (k > 0);
+
+- /* Transform RNDD and RNDU to Zero / Away */
+- MPFR_ASSERTD((neg == 0) || (neg ==1));
+- if (MPFR_IS_RNDUTEST_OR_RNDDNOTTEST(rnd1, neg))
+- rnd1 = MPFR_RNDZ;
+-
+ switch (rnd1)
+ {
+ case MPFR_RNDZ:
+@@ -203,33 +220,54 @@
+ /* mpfr_round_raw2 returns 1 if one should add 1 at ulp(b,prec),
+ and 0 otherwise */
+ cc ^= mpfr_round_raw2 (bp, bn, neg, rnd2, prec);
+- /* cc is the new value of bit s1 in bp[bn-1] */
++ /* cc is the new value of bit s1 in bp[bn-1] after rounding 'rnd2' */
++
+ /* now round b + 2^(MPFR_EXP(b)-err) */
+- cc2 = mpn_add_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
++ mpn_add_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
++ /* if there was a carry here, then necessarily bit s1 of bp[bn-1]
++ changed, thus we surely cannot round for directed rounding, but this
++ will be detected below, with cc2 != cc */
+ break;
+ case MPFR_RNDN:
+ /* Round to nearest */
+- /* first round b+2^(MPFR_EXP(b)-err) */
+- cc = mpn_add_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
++
++ /* first round b+2^(MPFR_EXP(b)-err) */
++ mpn_add_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
++ /* same remark as above in case a carry occurs in mpn_add_1() */
+ cc = (tmp[bn - 1] >> s1) & 1; /* gives 0 when cc=1 */
+ cc ^= mpfr_round_raw2 (tmp, bn, neg, rnd2, prec);
++ /* cc is the new value of bit s1 in bp[bn-1]+eps after rounding 'rnd2' */
++
++ subtract_eps:
+ /* now round b-2^(MPFR_EXP(b)-err) */
+ cc2 = mpn_sub_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
++ /* propagate the potential borrow up to the most significant limb
++ (it cannot propagate further since the most significant limb is
++ at least MPFR_LIMB_HIGHBIT) */
++ for (tn = 0; tn + 1 < k1 && (cc2 != 0); tn ++)
++ cc2 = bp[bn + tn] == 0;
++ /* We have an exponent decrease when either:
++ (i) k1 = 0 and tmp[bn-1] < MPFR_LIMB_HIGHBIT
++ (ii) k1 > 0 and cc <> 0 and bp[bn + tn] = MPFR_LIMB_HIGHBIT
++ (then necessarily tn = k1-1).
++ Then for directed rounding we cannot round,
++ and for rounding to nearest we cannot round when err = prec + 1.
++ */
++ if (((k1 == 0 && tmp[bn - 1] < MPFR_LIMB_HIGHBIT) ||
++ (k1 != 0 && cc2 != 0 && bp[bn + tn] == MPFR_LIMB_HIGHBIT)) &&
++ (rnd2 != MPFR_RNDN || err0 == prec0 + 1))
++ {
++ MPFR_TMP_FREE(marker);
++ return 0;
++ }
+ break;
+ default:
+ /* Round away */
+ cc = (bp[bn - 1] >> s1) & 1;
+ cc ^= mpfr_round_raw2 (bp, bn, neg, rnd2, prec);
+- /* now round b +/- 2^(MPFR_EXP(b)-err) */
+- cc2 = mpn_sub_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
+- break;
+- }
++ /* cc is the new value of bit s1 in bp[bn-1]+eps after rounding 'rnd2' */
+
+- /* if cc2 is 1, then a carry or borrow propagates to the next limb */
+- if (cc2 && cc)
+- {
+- MPFR_TMP_FREE(marker);
+- return 0;
++ goto subtract_eps;
+ }
+
+ cc2 = (tmp[bn - 1] >> s1) & 1;
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:17:39.282577552 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-15 15:19:24.274647313 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p9";
++ return "3.1.3-p10";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tcan_round.c mpfr-3.1.3-b/tests/tcan_round.c
+--- mpfr-3.1.3-a/tests/tcan_round.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tcan_round.c 2016-02-15 15:19:24.250647299 +0000
+@@ -1,4 +1,4 @@
+-/* Test file for mpfr_can_round.
++/* Test file for mpfr_can_round and mpfr_round_p.
+
+ Copyright 1999, 2001-2015 Free Software Foundation, Inc.
+ Contributed by the AriC and Caramel projects, INRIA.
+@@ -41,6 +41,8 @@
+ /* avoid mpn_random which leaks memory */
+ for (i = 0; i < n; i++)
+ buf[i] = randlimb ();
++ /* force the number to be normalized */
++ buf[n - 1] |= MPFR_LIMB_HIGHBIT;
+ p = randlimb() % ((n-1) * GMP_NUMB_BITS) + MPFR_PREC_MIN;
+ err = p + randlimb () % GMP_NUMB_BITS;
+ r1 = mpfr_round_p (buf, n, err, p);
+@@ -57,11 +59,72 @@
+ }
+ }
+
++/* check x=2^i with precision px, error at most 1, and target precision prec */
++static void
++test_pow2 (mpfr_exp_t i, mpfr_prec_t px, mpfr_rnd_t r1, mpfr_rnd_t r2,
++ mpfr_prec_t prec)
++{
++ mpfr_t x;
++ int b, expected_b, b2;
++
++ mpfr_init2 (x, px);
++ mpfr_set_ui_2exp (x, 1, i, MPFR_RNDN);
++ b = !!mpfr_can_round (x, i+1, r1, r2, prec);
++ /* Note: If mpfr_can_round succeeds for both
++ (r1,r2) = (MPFR_RNDD,MPFR_RNDN) and
++ (r1,r2) = (MPFR_RNDU,MPFR_RNDN), then it should succeed for
++ (r1,r2) = (MPFR_RNDN,MPFR_RNDN). So, the condition on prec below
++ for r1 = MPFR_RNDN should be the most restrictive between those
++ for r1 = any directed rounding mode.
++ For r1 like MPFR_RNDA, the unrounded, unknown number may be anyone
++ in [2^i-1,i]. As both 2^i-1 and 2^i fit on i bits, one cannot round
++ in any precision >= i bits, hence the condition prec < i; prec = i-1
++ will work here for r2 = MPFR_RNDN thanks to the even-rounding rule
++ (and also with rounding ties away from zero). */
++ expected_b =
++ MPFR_IS_LIKE_RNDD (r1, MPFR_SIGN_POS) ?
++ (MPFR_IS_LIKE_RNDU (r2, MPFR_SIGN_POS) ? 0 : prec <= i) :
++ MPFR_IS_LIKE_RNDU (r1, MPFR_SIGN_POS) ?
++ (MPFR_IS_LIKE_RNDD (r2, MPFR_SIGN_POS) ? 0 : prec < i) :
++ (r2 != MPFR_RNDN ? 0 : prec < i);
++ /* We only require mpfr_can_round to return 1 when we can really
++ round, it is allowed to return 0 in some rare boundary cases,
++ for example when x = 2^k and the error is 0.25 ulp.
++ Note: if this changes in the future, the test could be improved by
++ removing the "&& expected_b == 0" below. */
++ if (b != expected_b && expected_b == 0)
++ {
++ printf ("Error for x=2^%d, px=%lu, err=%d, r1=%s, r2=%s, prec=%d\n",
++ (int) i, (unsigned long) px, (int) i + 1,
++ mpfr_print_rnd_mode (r1), mpfr_print_rnd_mode (r2), (int) prec);
++ printf ("Expected %d, got %d\n", expected_b, b);
++ exit (1);
++ }
++
++ if (r1 == MPFR_RNDN && r2 == MPFR_RNDZ)
++ {
++ /* Similar test to the one done in src/round_p.c
++ for MPFR_WANT_ASSERT >= 2. */
++ b2 = !!mpfr_round_p (MPFR_MANT(x), MPFR_LIMB_SIZE(x), i+1, prec);
++ if (b2 != b)
++ {
++ printf ("Error for x=2^%d, px=%lu, err=%d, prec=%d\n",
++ (int) i, (unsigned long) px, (int) i + 1, (int) prec);
++ printf ("mpfr_can_round gave %d, mpfr_round_p gave %d\n", b, b2);
++ exit (1);
++ }
++ }
++
++ mpfr_clear (x);
++}
++
+ int
+ main (void)
+ {
+ mpfr_t x;
+- mpfr_prec_t i, j;
++ mpfr_prec_t i, j, k;
++ int r1, r2;
++ int n;
+
+ tests_start_mpfr ();
+
+@@ -111,12 +174,30 @@
+ mpfr_set_str (x, "0.ff4ca619c76ba69", 16, MPFR_RNDZ);
+ for (i = 30; i < 99; i++)
+ for (j = 30; j < 99; j++)
+- {
+- int r1, r2;
+- for (r1 = 0; r1 < MPFR_RND_MAX ; r1++)
+- for (r2 = 0; r2 < MPFR_RND_MAX ; r2++)
+- mpfr_can_round (x, i, (mpfr_rnd_t) r1, (mpfr_rnd_t) r2, j); /* test for assertions */
+- }
++ for (r1 = 0; r1 < MPFR_RND_MAX; r1++)
++ for (r2 = 0; r2 < MPFR_RND_MAX; r2++)
++ {
++ /* test for assertions */
++ mpfr_can_round (x, i, (mpfr_rnd_t) r1, (mpfr_rnd_t) r2, j);
++ }
++
++ test_pow2 (32, 32, MPFR_RNDN, MPFR_RNDN, 32);
++ test_pow2 (174, 174, MPFR_RNDN, MPFR_RNDN, 174);
++ test_pow2 (174, 174, MPFR_RNDU, MPFR_RNDN, 174);
++ test_pow2 (176, 129, MPFR_RNDU, MPFR_RNDU, 174);
++ test_pow2 (176, 2, MPFR_RNDZ, MPFR_RNDZ, 174);
++ test_pow2 (176, 2, MPFR_RNDU, MPFR_RNDU, 176);
++
++ /* Tests for x = 2^i (E(x) = i+1) with error at most 1 = 2^0. */
++ for (n = 0; n < 100; n++)
++ {
++ i = (randlimb() % 200) + 4;
++ for (j = i - 2; j < i + 2; j++)
++ for (r1 = 0; r1 < MPFR_RND_MAX; r1++)
++ for (r2 = 0; r2 < MPFR_RND_MAX; r2++)
++ for (k = MPFR_PREC_MIN; k <= i + 2; k++)
++ test_pow2 (i, k, (mpfr_rnd_t) r1, (mpfr_rnd_t) r2, j);
++ }
+
+ mpfr_clear (x);
+
diff --git a/patches/mpfr/3.1.3/210-fits.patch b/patches/mpfr/3.1.3/210-fits.patch
new file mode 100644
index 0000000..888389c
--- /dev/null
+++ b/patches/mpfr/3.1.3/210-fits.patch
@@ -0,0 +1,584 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-15 15:20:16.854677843 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-15 15:20:16.922677881 +0000
+@@ -0,0 +1 @@
++fits
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:19:24.274647313 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-15 15:20:16.922677881 +0000
+@@ -1 +1 @@
+-3.1.3-p10
++3.1.3-p11
+diff -Naurd mpfr-3.1.3-a/src/fits_intmax.c mpfr-3.1.3-b/src/fits_intmax.c
+--- mpfr-3.1.3-a/src/fits_intmax.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/fits_intmax.c 2016-02-15 15:20:16.898677867 +0000
+@@ -33,6 +33,7 @@
+ int
+ mpfr_fits_intmax_p (mpfr_srcptr f, mpfr_rnd_t rnd)
+ {
++ unsigned int saved_flags;
+ mpfr_exp_t e;
+ int prec;
+ mpfr_t x, y;
+@@ -85,6 +86,7 @@
+ MPFR_ASSERTD (e == prec);
+
+ /* hard case: first round to prec bits, then check */
++ saved_flags = __gmpfr_flags;
+ mpfr_init2 (x, prec);
+ mpfr_set (x, f, rnd);
+
+@@ -97,10 +99,16 @@
+ }
+ else
+ {
+- res = MPFR_GET_EXP (x) == e;
++ /* Warning! Due to the rounding, x can be an infinity. Here we use
++ the fact that singular numbers have a special exponent field,
++ thus well-defined and different from e, in which case this means
++ that the number does not fit. That's why we use MPFR_EXP, not
++ MPFR_GET_EXP. */
++ res = MPFR_EXP (x) == e;
+ }
+
+ mpfr_clear (x);
++ __gmpfr_flags = saved_flags;
+ return res;
+ }
+
+diff -Naurd mpfr-3.1.3-a/src/fits_s.h mpfr-3.1.3-b/src/fits_s.h
+--- mpfr-3.1.3-a/src/fits_s.h 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/fits_s.h 2016-02-15 15:20:16.898677867 +0000
+@@ -29,6 +29,7 @@
+ int
+ FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd)
+ {
++ unsigned int saved_flags;
+ mpfr_exp_t e;
+ int prec;
+ mpfr_t x;
+@@ -81,9 +82,16 @@
+ MPFR_ASSERTD (e == prec);
+
+ /* hard case: first round to prec bits, then check */
++ saved_flags = __gmpfr_flags;
+ mpfr_init2 (x, prec);
+ mpfr_set (x, f, rnd);
+- res = neg ? (mpfr_cmp_si (x, MINIMUM) >= 0) : (MPFR_GET_EXP (x) == e);
++ /* Warning! Due to the rounding, x can be an infinity. Here we use
++ the fact that singular numbers have a special exponent field,
++ thus well-defined and different from e, in which case this means
++ that the number does not fit. That's why we use MPFR_EXP, not
++ MPFR_GET_EXP. */
++ res = neg ? (mpfr_cmp_si (x, MINIMUM) >= 0) : (MPFR_EXP (x) == e);
+ mpfr_clear (x);
++ __gmpfr_flags = saved_flags;
+ return res;
+ }
+diff -Naurd mpfr-3.1.3-a/src/fits_u.h mpfr-3.1.3-b/src/fits_u.h
+--- mpfr-3.1.3-a/src/fits_u.h 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/fits_u.h 2016-02-15 15:20:16.898677867 +0000
+@@ -25,6 +25,7 @@
+ int
+ FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd)
+ {
++ unsigned int saved_flags;
+ mpfr_exp_t e;
+ int prec;
+ TYPE s;
+@@ -62,9 +63,16 @@
+ MPFR_ASSERTD (e == prec);
+
+ /* hard case: first round to prec bits, then check */
++ saved_flags = __gmpfr_flags;
+ mpfr_init2 (x, prec);
+ mpfr_set (x, f, rnd);
+- res = MPFR_GET_EXP (x) == e;
++ /* Warning! Due to the rounding, x can be an infinity. Here we use
++ the fact that singular numbers have a special exponent field,
++ thus well-defined and different from e, in which case this means
++ that the number does not fit. That's why we use MPFR_EXP, not
++ MPFR_GET_EXP. */
++ res = MPFR_EXP (x) == e;
+ mpfr_clear (x);
++ __gmpfr_flags = saved_flags;
+ return res;
+ }
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:19:24.270647311 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-15 15:20:16.922677881 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p10"
++#define MPFR_VERSION_STRING "3.1.3-p11"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:19:24.274647313 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-15 15:20:16.922677881 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p10";
++ return "3.1.3-p11";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tfits.c mpfr-3.1.3-b/tests/tfits.c
+--- mpfr-3.1.3-a/tests/tfits.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tfits.c 2016-02-15 15:20:16.898677867 +0000
+@@ -33,258 +33,225 @@
+ #include "mpfr-intmax.h"
+ #include "mpfr-test.h"
+
+-#define ERROR1(N) \
++#define FTEST_AUX(N,NOT,FCT) \
+ do \
+ { \
+- printf("Error %d for rnd = %s and x = ", N, \
+- mpfr_print_rnd_mode ((mpfr_rnd_t) r)); \
+- mpfr_dump(x); \
+- exit(1); \
++ __gmpfr_flags = ex_flags; \
++ if (NOT FCT (x, (mpfr_rnd_t) r)) \
++ { \
++ printf ("Error %d for %s, rnd = %s and x = ", \
++ N, #FCT, \
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r)); \
++ mpfr_dump (x); \
++ exit (1); \
++ } \
++ if (__gmpfr_flags != ex_flags) \
++ { \
++ unsigned int flags = __gmpfr_flags; \
++ printf ("Flags error %d for %s, rnd = %s and x = ", \
++ N, #FCT, \
++ mpfr_print_rnd_mode ((mpfr_rnd_t) r)); \
++ mpfr_dump(x); \
++ printf ("Expected flags:"); \
++ flags_out (ex_flags); \
++ printf ("Got flags: "); \
++ flags_out (flags); \
++ exit (1); \
++ } \
+ } \
+ while (0)
+
+-static void check_intmax (void);
++#define FTEST(N,NOT,FCT) \
++ do \
++ { \
++ mpfr_exp_t e; \
++ FTEST_AUX (N,NOT,FCT); \
++ if (MPFR_IS_SINGULAR (x)) \
++ break; \
++ e = mpfr_get_exp (x); \
++ set_emin (e); \
++ set_emax (e); \
++ FTEST_AUX (N,NOT,FCT); \
++ set_emin (emin); \
++ set_emax (emax); \
++ } \
++ while (0)
++
++#define CHECK_ALL(N,NOT) \
++ do \
++ { \
++ FTEST (N, NOT, mpfr_fits_ulong_p); \
++ FTEST (N, NOT, mpfr_fits_slong_p); \
++ FTEST (N, NOT, mpfr_fits_uint_p); \
++ FTEST (N, NOT, mpfr_fits_sint_p); \
++ FTEST (N, NOT, mpfr_fits_ushort_p); \
++ FTEST (N, NOT, mpfr_fits_sshort_p); \
++ } \
++ while (0)
++
++#define CHECK_MAX(N,NOT) \
++ do \
++ { \
++ FTEST (N, NOT, mpfr_fits_uintmax_p); \
++ FTEST (N, NOT, mpfr_fits_intmax_p); \
++ } \
++ while (0)
++
++/* V is a non-zero limit for the type (*_MIN for a signed type or *_MAX).
++ * If V is positive, then test V, V + 1/4, V + 3/4 and V + 1.
++ * If V is negative, then test V, V - 1/4, V - 3/4 and V - 1.
++ */
++#define CHECK_LIM(N,V,SET,FCT) \
++ do \
++ { \
++ SET (x, V, MPFR_RNDN); \
++ FTEST (N, !, FCT); \
++ mpfr_set_si_2exp (y, (V) < 0 ? -1 : 1, -2, MPFR_RNDN); \
++ mpfr_add (x, x, y, MPFR_RNDN); \
++ FTEST (N+1, (r == MPFR_RNDN || \
++ MPFR_IS_LIKE_RNDZ (r, (V) < 0)) ^ !!, FCT); \
++ mpfr_add (x, x, y, MPFR_RNDN); \
++ mpfr_add (x, x, y, MPFR_RNDN); \
++ FTEST (N+3, MPFR_IS_LIKE_RNDZ (r, (V) < 0) ^ !!, FCT); \
++ mpfr_add (x, x, y, MPFR_RNDN); \
++ FTEST (N+4, !!, FCT); \
++ } \
++ while (0)
+
+ int
+ main (void)
+ {
++ mpfr_exp_t emin, emax;
+ mpfr_t x, y;
+- int i, r;
++ unsigned int flags[2] = { 0, MPFR_FLAGS_ALL }, ex_flags;
++ int i, r, fi;
+
+ tests_start_mpfr ();
+
+- mpfr_init2 (x, 256);
++ emin = mpfr_get_emin ();
++ emax = mpfr_get_emax ();
++
++ mpfr_init2 (x, sizeof (unsigned long) * CHAR_BIT + 2);
+ mpfr_init2 (y, 8);
+
+ RND_LOOP (r)
+- {
+-
+- /* Check NAN */
+- mpfr_set_nan (x);
+- if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (1);
+- if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (2);
+- if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (3);
+- if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (4);
+- if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (5);
+- if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (6);
++ for (fi = 0; fi < numberof (flags); fi++)
++ {
++ ex_flags = flags[fi];
+
+- /* Check INF */
+- mpfr_set_inf (x, 1);
+- if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (7);
+- if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (8);
+- if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (9);
+- if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (10);
+- if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (11);
+- if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (12);
++ /* Check NaN */
++ mpfr_set_nan (x);
++ CHECK_ALL (1, !!);
+
+- /* Check Zero */
+- MPFR_SET_ZERO (x);
+- if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (13);
+- if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (14);
+- if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (15);
+- if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (16);
+- if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (17);
+- if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (18);
++ /* Check +Inf */
++ mpfr_set_inf (x, 1);
++ CHECK_ALL (2, !!);
+
+- /* Check small positive op */
+- mpfr_set_str1 (x, "1@-1");
+- if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (19);
+- if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (20);
+- if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (21);
+- if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (22);
+- if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (23);
+- if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (24);
++ /* Check -Inf */
++ mpfr_set_inf (x, -1);
++ CHECK_ALL (3, !!);
+
+- /* Check 17 */
+- mpfr_set_ui (x, 17, MPFR_RNDN);
+- if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (25);
+- if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (26);
+- if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (27);
+- if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (28);
+- if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (29);
+- if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (30);
++ /* Check +0 */
++ mpfr_set_zero (x, 1);
++ CHECK_ALL (4, !);
+
+- /* Check all other values */
+- mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
+- mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (31);
+- if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (32);
+- mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
+- if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (33);
+- if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (34);
+- if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (35);
+- if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (36);
+- if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (37);
++ /* Check -0 */
++ mpfr_set_zero (x, -1);
++ CHECK_ALL (5, !);
+
+- mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
+- if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (38);
+- mpfr_set_ui (x, LONG_MAX, MPFR_RNDN);
+- if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (39);
+- mpfr_set_ui (x, UINT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (40);
+- mpfr_set_ui (x, INT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (41);
+- mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (42);
+- mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN);
+- if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (43);
++ /* Check small positive op */
++ mpfr_set_str1 (x, "1@-1");
++ CHECK_ALL (6, !);
+
+- mpfr_set_si (x, 1, MPFR_RNDN);
+- if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (44);
+- if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (45);
++ /* Check 17 */
++ mpfr_set_ui (x, 17, MPFR_RNDN);
++ CHECK_ALL (7, !);
+
+- /* Check negative op */
+- for (i = 1; i <= 4; i++)
+- {
+- int inv;
++ /* Check large values (no fit) */
++ mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN);
++ mpfr_mul_2exp (x, x, 1, MPFR_RNDN);
++ CHECK_ALL (8, !!);
++ mpfr_mul_2exp (x, x, 40, MPFR_RNDN);
++ CHECK_ALL (9, !!);
+
+- mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
+- mpfr_rint (y, x, (mpfr_rnd_t) r);
+- inv = MPFR_NOTZERO (y);
+- if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r) ^ inv)
+- ERROR1 (46);
+- if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r))
+- ERROR1 (47);
+- if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r) ^ inv)
+- ERROR1 (48);
+- if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r))
+- ERROR1 (49);
+- if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r) ^ inv)
+- ERROR1 (50);
+- if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r))
+- ERROR1 (51);
+- }
+- }
++ /* Check a non-integer number just below a power of two. */
++ mpfr_set_ui_2exp (x, 255, -2, MPFR_RNDN);
++ CHECK_ALL (10, !);
+
+- mpfr_clear (x);
+- mpfr_clear (y);
++ /* Check the limits of the types (except 0 for unsigned types) */
++ CHECK_LIM (20, ULONG_MAX, mpfr_set_ui, mpfr_fits_ulong_p);
++ CHECK_LIM (30, LONG_MAX, mpfr_set_si, mpfr_fits_slong_p);
++ CHECK_LIM (35, LONG_MIN, mpfr_set_si, mpfr_fits_slong_p);
++ CHECK_LIM (40, UINT_MAX, mpfr_set_ui, mpfr_fits_uint_p);
++ CHECK_LIM (50, INT_MAX, mpfr_set_si, mpfr_fits_sint_p);
++ CHECK_LIM (55, INT_MIN, mpfr_set_si, mpfr_fits_sint_p);
++ CHECK_LIM (60, USHRT_MAX, mpfr_set_ui, mpfr_fits_ushort_p);
++ CHECK_LIM (70, SHRT_MAX, mpfr_set_si, mpfr_fits_sshort_p);
++ CHECK_LIM (75, SHRT_MIN, mpfr_set_si, mpfr_fits_sshort_p);
+
+- check_intmax ();
++ /* Check negative op */
++ for (i = 1; i <= 4; i++)
++ {
++ int inv;
+
+- tests_end_mpfr ();
+- return 0;
+-}
++ mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
++ mpfr_rint (y, x, (mpfr_rnd_t) r);
++ inv = MPFR_NOTZERO (y);
++ FTEST (80, inv ^ !, mpfr_fits_ulong_p);
++ FTEST (81, !, mpfr_fits_slong_p);
++ FTEST (82, inv ^ !, mpfr_fits_uint_p);
++ FTEST (83, !, mpfr_fits_sint_p);
++ FTEST (84, inv ^ !, mpfr_fits_ushort_p);
++ FTEST (85, !, mpfr_fits_sshort_p);
++ }
++ }
+
+-static void
+-check_intmax (void)
+-{
+ #ifdef _MPFR_H_HAVE_INTMAX_T
+- mpfr_t x, y;
+- int i, r;
+
+- mpfr_init2 (x, sizeof (uintmax_t) * CHAR_BIT);
+- mpfr_init2 (y, 8);
++ mpfr_set_prec (x, sizeof (uintmax_t) * CHAR_BIT + 2);
+
+ RND_LOOP (r)
+ {
+- /* Check NAN */
++ /* Check NaN */
+ mpfr_set_nan (x);
+- if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (52);
+- if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (53);
++ CHECK_MAX (1, !!);
+
+- /* Check INF */
++ /* Check +Inf */
+ mpfr_set_inf (x, 1);
+- if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (54);
+- if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (55);
++ CHECK_MAX (2, !!);
+
+- /* Check Zero */
+- MPFR_SET_ZERO (x);
+- if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (56);
+- if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (57);
++ /* Check -Inf */
++ mpfr_set_inf (x, -1);
++ CHECK_MAX (3, !!);
+
+- /* Check positive small op */
++ /* Check +0 */
++ mpfr_set_zero (x, 1);
++ CHECK_MAX (4, !);
++
++ /* Check -0 */
++ mpfr_set_zero (x, -1);
++ CHECK_MAX (5, !);
++
++ /* Check small positive op */
+ mpfr_set_str1 (x, "1@-1");
+- if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (58);
+- if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (59);
++ CHECK_MAX (6, !);
+
+ /* Check 17 */
+ mpfr_set_ui (x, 17, MPFR_RNDN);
+- if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (60);
+- if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (61);
++ CHECK_MAX (7, !);
+
+ /* Check hugest */
+ mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN);
+- if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (62);
+- if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (63);
++ CHECK_MAX (8, !!);
+
+- /* Check all other values */
+- mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
+- mpfr_add_ui (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (64);
+- mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN);
+- if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (65);
+- mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
+- mpfr_add_ui (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (66);
+- mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN);
+- if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (67);
+- mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN);
+- if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (68);
+- mpfr_sub_ui (x, x, 1, MPFR_RNDN);
+- if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (69);
++ /* Check a non-integer number just below a power of two. */
++ mpfr_set_ui_2exp (x, 255, -2, MPFR_RNDN);
++ CHECK_MAX (10, !);
++
++ /* Check the limits of the types (except 0 for uintmax_t) */
++ CHECK_LIM (20, MPFR_UINTMAX_MAX, mpfr_set_uj, mpfr_fits_uintmax_p);
++ CHECK_LIM (30, MPFR_INTMAX_MAX, mpfr_set_sj, mpfr_fits_intmax_p);
++ CHECK_LIM (35, MPFR_INTMAX_MIN, mpfr_set_sj, mpfr_fits_intmax_p);
+
+ /* Check negative op */
+ for (i = 1; i <= 4; i++)
+@@ -294,14 +261,16 @@
+ mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN);
+ mpfr_rint (y, x, (mpfr_rnd_t) r);
+ inv = MPFR_NOTZERO (y);
+- if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r) ^ inv)
+- ERROR1 (70);
+- if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r))
+- ERROR1 (71);
++ FTEST (80, inv ^ !, mpfr_fits_uintmax_p);
++ FTEST (81, !, mpfr_fits_intmax_p);
+ }
+ }
+
++#endif /* _MPFR_H_HAVE_INTMAX_T */
++
+ mpfr_clear (x);
+ mpfr_clear (y);
+-#endif
++
++ tests_end_mpfr ();
++ return 0;
+ }
diff --git a/patches/mpfr/3.1.3/220-root.patch b/patches/mpfr/3.1.3/220-root.patch
new file mode 100644
index 0000000..9cd62a7
--- /dev/null
+++ b/patches/mpfr/3.1.3/220-root.patch
@@ -0,0 +1,621 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-15 15:20:51.242696408 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-15 15:20:51.306696441 +0000
+@@ -0,0 +1 @@
++root
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:20:16.922677881 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-15 15:20:51.306696441 +0000
+@@ -1 +1 @@
+-3.1.3-p11
++3.1.3-p12
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:20:16.922677881 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-15 15:20:51.302696439 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p11"
++#define MPFR_VERSION_STRING "3.1.3-p12"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/root.c mpfr-3.1.3-b/src/root.c
+--- mpfr-3.1.3-a/src/root.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/root.c 2016-02-15 15:20:51.282696429 +0000
+@@ -23,13 +23,15 @@
+ #define MPFR_NEED_LONGLONG_H
+ #include "mpfr-impl.h"
+
+- /* The computation of y = x^(1/k) is done as follows:
++ /* The computation of y = x^(1/k) is done as follows, except for large
++ values of k, for which this would be inefficient or yield internal
++ integer overflows:
+
+ Let x = sign * m * 2^(k*e) where m is an integer
+
+ with 2^(k*(n-1)) <= m < 2^(k*n) where n = PREC(y)
+
+- and m = s^k + r where 0 <= r and m < (s+1)^k
++ and m = s^k + t where 0 <= t and m < (s+1)^k
+
+ we want that s has n bits i.e. s >= 2^(n-1), or m >= 2^(k*(n-1))
+ i.e. m must have at least k*(n-1)+1 bits
+@@ -38,11 +40,15 @@
+ x^(1/k) = s * 2^e or (s+1) * 2^e according to the rounding mode.
+ */
+
++static int
++mpfr_root_aux (mpfr_ptr y, mpfr_srcptr x, unsigned long k,
++ mpfr_rnd_t rnd_mode);
++
+ int
+ mpfr_root (mpfr_ptr y, mpfr_srcptr x, unsigned long k, mpfr_rnd_t rnd_mode)
+ {
+ mpz_t m;
+- mpfr_exp_t e, r, sh;
++ mpfr_exp_t e, r, sh, f;
+ mpfr_prec_t n, size_m, tmp;
+ int inexact, negative;
+ MPFR_SAVE_EXPO_DECL (expo);
+@@ -55,50 +61,27 @@
+
+ if (MPFR_UNLIKELY (k <= 1))
+ {
+- if (k < 1) /* k==0 => y=x^(1/0)=x^(+Inf) */
+-#if 0
+- /* For 0 <= x < 1 => +0.
+- For x = 1 => 1.
+- For x > 1, => +Inf.
+- For x < 0 => NaN.
+- */
++ if (k == 0)
+ {
+- if (MPFR_IS_NEG (x) && !MPFR_IS_ZERO (x))
+- {
+- MPFR_SET_NAN (y);
+- MPFR_RET_NAN;
+- }
+- inexact = mpfr_cmp (x, __gmpfr_one);
+- if (inexact == 0)
+- return mpfr_set_ui (y, 1, rnd_mode); /* 1 may be Out of Range */
+- else if (inexact < 0)
+- return mpfr_set_ui (y, 0, rnd_mode); /* 0+ */
+- else
+- {
+- mpfr_set_inf (y, 1);
+- return 0;
+- }
++ MPFR_SET_NAN (y);
++ MPFR_RET_NAN;
+ }
+-#endif
+- {
+- MPFR_SET_NAN (y);
+- MPFR_RET_NAN;
+- }
+- else /* y =x^(1/1)=x */
++ else /* y = x^(1/1) = x */
+ return mpfr_set (y, x, rnd_mode);
+ }
+
+ /* Singular values */
+- else if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
++ if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
+ {
+ if (MPFR_IS_NAN (x))
+ {
+ MPFR_SET_NAN (y); /* NaN^(1/k) = NaN */
+ MPFR_RET_NAN;
+ }
+- else if (MPFR_IS_INF (x)) /* +Inf^(1/k) = +Inf
+- -Inf^(1/k) = -Inf if k odd
+- -Inf^(1/k) = NaN if k even */
++
++ if (MPFR_IS_INF (x)) /* +Inf^(1/k) = +Inf
++ -Inf^(1/k) = -Inf if k odd
++ -Inf^(1/k) = NaN if k even */
+ {
+ if (MPFR_IS_NEG(x) && (k % 2 == 0))
+ {
+@@ -106,27 +89,31 @@
+ MPFR_RET_NAN;
+ }
+ MPFR_SET_INF (y);
+- MPFR_SET_SAME_SIGN (y, x);
+- MPFR_RET (0);
+ }
+ else /* x is necessarily 0: (+0)^(1/k) = +0
+ (-0)^(1/k) = -0 */
+ {
+ MPFR_ASSERTD (MPFR_IS_ZERO (x));
+ MPFR_SET_ZERO (y);
+- MPFR_SET_SAME_SIGN (y, x);
+- MPFR_RET (0);
+ }
++ MPFR_SET_SAME_SIGN (y, x);
++ MPFR_RET (0);
+ }
+
+ /* Returns NAN for x < 0 and k even */
+- else if (MPFR_IS_NEG (x) && (k % 2 == 0))
++ if (MPFR_UNLIKELY (MPFR_IS_NEG (x) && (k % 2 == 0)))
+ {
+ MPFR_SET_NAN (y);
+ MPFR_RET_NAN;
+ }
+
+ /* General case */
++
++ /* For large k, use exp(log(x)/k). The threshold of 100 seems to be quite
++ good when the precision goes to infinity. */
++ if (k > 100)
++ return mpfr_root_aux (y, x, k, rnd_mode);
++
+ MPFR_SAVE_EXPO_MARK (expo);
+ mpz_init (m);
+
+@@ -135,31 +122,24 @@
+ mpz_neg (m, m);
+ r = e % (mpfr_exp_t) k;
+ if (r < 0)
+- r += k; /* now r = e (mod k) with 0 <= e < r */
++ r += k; /* now r = e (mod k) with 0 <= r < k */
++ MPFR_ASSERTD (0 <= r && r < k);
+ /* x = (m*2^r) * 2^(e-r) where e-r is a multiple of k */
+
+ MPFR_MPZ_SIZEINBASE2 (size_m, m);
+ /* for rounding to nearest, we want the round bit to be in the root */
+ n = MPFR_PREC (y) + (rnd_mode == MPFR_RNDN);
+
+- /* we now multiply m by 2^(r+k*sh) so that root(m,k) will give
+- exactly n bits: we want k*(n-1)+1 <= size_m + k*sh + r <= k*n
+- i.e. sh = floor ((kn-size_m-r)/k) */
+- if ((mpfr_exp_t) size_m + r > k * (mpfr_exp_t) n)
+- sh = 0; /* we already have too many bits */
++ /* we now multiply m by 2^sh so that root(m,k) will give
++ exactly n bits: we want k*(n-1)+1 <= size_m + sh <= k*n
++ i.e. sh = k*f + r with f = max(floor((k*n-size_m-r)/k),0) */
++ if ((mpfr_exp_t) size_m + r >= k * (mpfr_exp_t) n)
++ f = 0; /* we already have too many bits */
+ else
+- sh = (k * (mpfr_exp_t) n - (mpfr_exp_t) size_m - r) / k;
+- sh = k * sh + r;
+- if (sh >= 0)
+- {
+- mpz_mul_2exp (m, m, sh);
+- e = e - sh;
+- }
+- else if (r > 0)
+- {
+- mpz_mul_2exp (m, m, r);
+- e = e - r;
+- }
++ f = (k * (mpfr_exp_t) n - (mpfr_exp_t) size_m - r) / k;
++ sh = k * f + r;
++ mpz_mul_2exp (m, m, sh);
++ e = e - sh;
+
+ /* invariant: x = m*2^e, with e divisible by k */
+
+@@ -203,3 +183,97 @@
+ MPFR_SAVE_EXPO_FREE (expo);
+ return mpfr_check_range (y, inexact, rnd_mode);
+ }
++
++/* Compute y <- x^(1/k) using exp(log(x)/k).
++ Assume all special cases have been eliminated before.
++ In the extended exponent range, overflows/underflows are not possible.
++ Assume x > 0, or x < 0 and k odd.
++*/
++static int
++mpfr_root_aux (mpfr_ptr y, mpfr_srcptr x, unsigned long k, mpfr_rnd_t rnd_mode)
++{
++ int inexact, exact_root = 0;
++ mpfr_prec_t w; /* working precision */
++ mpfr_t absx, t;
++ MPFR_GROUP_DECL(group);
++ MPFR_TMP_DECL(marker);
++ MPFR_ZIV_DECL(loop);
++ MPFR_SAVE_EXPO_DECL (expo);
++
++ MPFR_TMP_INIT_ABS (absx, x);
++
++ MPFR_TMP_MARK(marker);
++ w = MPFR_PREC(y) + 10;
++ /* Take some guard bits to prepare for the 'expt' lost bits below.
++ If |x| < 2^k, then log|x| < k, thus taking log2(k) bits should be fine. */
++ if (MPFR_GET_EXP(x) > 0)
++ w += MPFR_INT_CEIL_LOG2 (MPFR_GET_EXP(x));
++ MPFR_GROUP_INIT_1(group, w, t);
++ MPFR_SAVE_EXPO_MARK (expo);
++ MPFR_ZIV_INIT (loop, w);
++ for (;;)
++ {
++ mpfr_exp_t expt;
++ unsigned int err;
++
++ mpfr_log (t, absx, MPFR_RNDN);
++ /* t = log|x| * (1 + theta) with |theta| <= 2^(-w) */
++ mpfr_div_ui (t, t, k, MPFR_RNDN);
++ expt = MPFR_GET_EXP (t);
++ /* t = log|x|/k * (1 + theta) + eps with |theta| <= 2^(-w)
++ and |eps| <= 1/2 ulp(t), thus the total error is bounded
++ by 1.5 * 2^(expt - w) */
++ mpfr_exp (t, t, MPFR_RNDN);
++ /* t = |x|^(1/k) * exp(tau) * (1 + theta1) with
++ |tau| <= 1.5 * 2^(expt - w) and |theta1| <= 2^(-w).
++ For |tau| <= 0.5 we have |exp(tau)-1| < 4/3*tau, thus
++ for w >= expt + 2 we have:
++ t = |x|^(1/k) * (1 + 2^(expt+2)*theta2) * (1 + theta1) with
++ |theta1|, |theta2| <= 2^(-w).
++ If expt+2 > 0, as long as w >= 1, we have:
++ t = |x|^(1/k) * (1 + 2^(expt+3)*theta3) with |theta3| < 2^(-w).
++ For expt+2 = 0, we have:
++ t = |x|^(1/k) * (1 + 2^2*theta3) with |theta3| < 2^(-w).
++ Finally for expt+2 < 0 we have:
++ t = |x|^(1/k) * (1 + 2*theta3) with |theta3| < 2^(-w).
++ */
++ err = (expt + 2 > 0) ? expt + 3
++ : (expt + 2 == 0) ? 2 : 1;
++ /* now t = |x|^(1/k) * (1 + 2^(err-w)) thus the error is at most
++ 2^(EXP(t) - w + err) */
++ if (MPFR_LIKELY (MPFR_CAN_ROUND(t, w - err, MPFR_PREC(y), rnd_mode)))
++ break;
++
++ /* If we fail to round correctly, check for an exact result or a
++ midpoint result with MPFR_RNDN (regarded as hard-to-round in
++ all precisions in order to determine the ternary value). */
++ {
++ mpfr_t z, zk;
++
++ mpfr_init2 (z, MPFR_PREC(y) + (rnd_mode == MPFR_RNDN));
++ mpfr_init2 (zk, MPFR_PREC(x));
++ mpfr_set (z, t, MPFR_RNDN);
++ inexact = mpfr_pow_ui (zk, z, k, MPFR_RNDN);
++ exact_root = !inexact && mpfr_equal_p (zk, absx);
++ if (exact_root) /* z is the exact root, thus round z directly */
++ inexact = mpfr_set4 (y, z, rnd_mode, MPFR_SIGN (x));
++ mpfr_clear (zk);
++ mpfr_clear (z);
++ if (exact_root)
++ break;
++ }
++
++ MPFR_ZIV_NEXT (loop, w);
++ MPFR_GROUP_REPREC_1(group, w, t);
++ }
++ MPFR_ZIV_FREE (loop);
++
++ if (!exact_root)
++ inexact = mpfr_set4 (y, t, rnd_mode, MPFR_SIGN (x));
++
++ MPFR_GROUP_CLEAR(group);
++ MPFR_TMP_FREE(marker);
++ MPFR_SAVE_EXPO_FREE (expo);
++
++ return mpfr_check_range (y, inexact, rnd_mode);
++}
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:20:16.922677881 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-15 15:20:51.306696441 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p11";
++ return "3.1.3-p12";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/troot.c mpfr-3.1.3-b/tests/troot.c
+--- mpfr-3.1.3-a/tests/troot.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/troot.c 2016-02-15 15:20:51.282696429 +0000
+@@ -25,6 +25,19 @@
+
+ #include "mpfr-test.h"
+
++#define DEFN(N) \
++ static int root##N (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) \
++ { return mpfr_root (y, x, N, rnd); } \
++ static int pow##N (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd) \
++ { return mpfr_pow_ui (y, x, N, rnd); }
++
++DEFN(2)
++DEFN(3)
++DEFN(4)
++DEFN(5)
++DEFN(17)
++DEFN(120)
++
+ static void
+ special (void)
+ {
+@@ -52,7 +65,7 @@
+ exit (1);
+ }
+
+- /* root(-Inf, 17) = -Inf */
++ /* root(-Inf, 17) = -Inf */
+ mpfr_set_inf (x, -1);
+ mpfr_root (y, x, 17, MPFR_RNDN);
+ if (!mpfr_inf_p (y) || mpfr_sgn (y) > 0)
+@@ -69,7 +82,7 @@
+ exit (1);
+ }
+
+- /* root(+/-0) = +/-0 */
++ /* root(+/-0, k) = +/-0 for k > 0 */
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+ mpfr_root (y, x, 17, MPFR_RNDN);
+ if (mpfr_cmp_ui (y, 0) || mpfr_sgn (y) < 0)
+@@ -190,64 +203,39 @@
+ i = mpfr_root (y, x, 1, MPFR_RNDN);
+ if (mpfr_cmp_ui (x, 17) || i != 0)
+ {
+- printf ("Error in root (17^(1/1))\n");
++ printf ("Error in root for 17^(1/1)\n");
+ exit (1);
+ }
+
+-#if 0
+- /* Check for k == 0:
+- For 0 <= x < 1 => +0.
+- For x = 1 => 1.
+- For x > 1, => +Inf.
+- For x < 0 => NaN. */
+- i = mpfr_root (y, x, 0, MPFR_RNDN);
+- if (!MPFR_IS_INF (y) || !MPFR_IS_POS (y) || i != 0)
+- {
+- printf ("Error in root 17^(1/0)\n");
+- exit (1);
+- }
+- mpfr_set_ui (x, 1, MPFR_RNDN);
+- i = mpfr_root (y, x, 0, MPFR_RNDN);
+- if (mpfr_cmp_ui (y, 1) || i != 0)
+- {
+- printf ("Error in root 1^(1/0)\n");
+- exit (1);
+- }
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+ i = mpfr_root (y, x, 0, MPFR_RNDN);
+- if (!MPFR_IS_ZERO (y) || !MPFR_IS_POS (y) || i != 0)
+- {
+- printf ("Error in root 0+^(1/0)\n");
+- exit (1);
+- }
+- MPFR_CHANGE_SIGN (x);
+- i = mpfr_root (y, x, 0, MPFR_RNDN);
+- if (!MPFR_IS_ZERO (y) || !MPFR_IS_POS (y) || i != 0)
++ if (!MPFR_IS_NAN (y) || i != 0)
+ {
+- printf ("Error in root 0-^(1/0)\n");
++ printf ("Error in root for (+0)^(1/0)\n");
+ exit (1);
+ }
+- mpfr_set_ui_2exp (x, 17, -5, MPFR_RNDD);
++ mpfr_neg (x, x, MPFR_RNDN);
+ i = mpfr_root (y, x, 0, MPFR_RNDN);
+- if (!MPFR_IS_ZERO (y) || !MPFR_IS_POS (y) || i != 0)
++ if (!MPFR_IS_NAN (y) || i != 0)
+ {
+- printf ("Error in root (17/2^5)^(1/0)\n");
++ printf ("Error in root for (-0)^(1/0)\n");
+ exit (1);
+ }
+-#endif
+- mpfr_set_ui (x, 0, MPFR_RNDN);
++
++ mpfr_set_ui (x, 1, MPFR_RNDN);
+ i = mpfr_root (y, x, 0, MPFR_RNDN);
+ if (!MPFR_IS_NAN (y) || i != 0)
+ {
+- printf ("Error in root 0+^(1/0)\n");
++ printf ("Error in root for 1^(1/0)\n");
+ exit (1);
+ }
++
+ /* Check for k==2 */
+ mpfr_set_si (x, -17, MPFR_RNDD);
+ i = mpfr_root (y, x, 2, MPFR_RNDN);
+ if (!MPFR_IS_NAN (y) || i != 0)
+ {
+- printf ("Error in root (-17)^(1/2)\n");
++ printf ("Error in root for (-17)^(1/2)\n");
+ exit (1);
+ }
+
+@@ -255,11 +243,168 @@
+ mpfr_clear (y);
+ }
+
++/* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812779
++ * https://bugzilla.gnome.org/show_bug.cgi?id=756960
++ * is a GNOME Calculator bug (mpfr_root applied on a negative integer,
++ * which is converted to an unsigned integer), but the strange result
++ * is also due to a bug in MPFR.
++ */
++static void
++bigint (void)
++{
++ mpfr_t x, y;
++
++ mpfr_inits2 (64, x, y, (mpfr_ptr) 0);
++
++ mpfr_set_ui (x, 10, MPFR_RNDN);
++ if (sizeof (unsigned long) * CHAR_BIT == 64)
++ {
++ mpfr_root (x, x, ULONG_MAX, MPFR_RNDN);
++ mpfr_set_ui_2exp (y, 1, -63, MPFR_RNDN);
++ mpfr_add_ui (y, y, 1, MPFR_RNDN);
++ if (! mpfr_equal_p (x, y))
++ {
++ printf ("Error in bigint for ULONG_MAX\n");
++ printf ("Expected ");
++ mpfr_dump (y);
++ printf ("Got ");
++ mpfr_dump (x);
++ exit (1);
++ }
++ }
++
++ mpfr_set_ui (x, 10, MPFR_RNDN);
++ mpfr_root (x, x, 1234567890, MPFR_RNDN);
++ mpfr_set_str_binary (y,
++ "1.00000000000000000000000000001000000000101011000101000110010001");
++ if (! mpfr_equal_p (x, y))
++ {
++ printf ("Error in bigint for 1234567890\n");
++ printf ("Expected ");
++ mpfr_dump (y);
++ printf ("Got ");
++ mpfr_dump (x);
++ exit (1);
++ }
++
++ mpfr_clears (x, y, (mpfr_ptr) 0);
++}
++
+ #define TEST_FUNCTION mpfr_root
+ #define INTEGER_TYPE unsigned long
+-#define INT_RAND_FUNCTION() (INTEGER_TYPE) (randlimb () % 3 +2)
++#define INT_RAND_FUNCTION() \
++ (INTEGER_TYPE) (randlimb () & 1 ? randlimb () : randlimb () % 3 + 2)
+ #include "tgeneric_ui.c"
+
++static void
++exact_powers (unsigned long bmax, unsigned long kmax)
++{
++ long b, k;
++ mpz_t z;
++ mpfr_t x, y;
++ int inex, neg;
++
++ mpz_init (z);
++ for (b = 2; b <= bmax; b++)
++ for (k = 1; k <= kmax; k++)
++ {
++ mpz_ui_pow_ui (z, b, k);
++ mpfr_init2 (x, mpz_sizeinbase (z, 2));
++ mpfr_set_ui (x, b, MPFR_RNDN);
++ mpfr_pow_ui (x, x, k, MPFR_RNDN);
++ mpz_set_ui (z, b);
++ mpfr_init2 (y, mpz_sizeinbase (z, 2));
++ for (neg = 0; neg <= 1; neg++)
++ {
++ inex = mpfr_root (y, x, k, MPFR_RNDN);
++ if (inex != 0)
++ {
++ printf ("Error in exact_powers, b=%ld, k=%ld\n", b, k);
++ printf ("Expected inex=0, got %d\n", inex);
++ exit (1);
++ }
++ if (neg && (k & 1) == 0)
++ {
++ if (!MPFR_IS_NAN (y))
++ {
++ printf ("Error in exact_powers, b=%ld, k=%ld\n", b, k);
++ printf ("Expected y=NaN\n");
++ printf ("Got ");
++ mpfr_out_str (stdout, 10, 0, y, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ }
++ else if (MPFR_IS_NAN (y) || mpfr_cmp_si (y, b) != 0)
++ {
++ printf ("Error in exact_powers, b=%ld, k=%ld\n", b, k);
++ printf ("Expected y=%ld\n", b);
++ printf ("Got ");
++ mpfr_out_str (stdout, 10, 0, y, MPFR_RNDN);
++ printf ("\n");
++ exit (1);
++ }
++ mpfr_neg (x, x, MPFR_RNDN);
++ b = -b;
++ }
++ mpfr_clear (x);
++ mpfr_clear (y);
++ }
++ mpz_clear (z);
++}
++
++/* Compare root(x,2^h) with pow(x,2^(-h)). */
++static void
++cmp_pow (void)
++{
++ mpfr_t x, y1, y2;
++ int h;
++
++ mpfr_inits2 (128, x, y1, y2, (mpfr_ptr) 0);
++
++ for (h = 1; h < sizeof (unsigned long) * CHAR_BIT; h++)
++ {
++ unsigned long k = (unsigned long) 1 << h;
++ int i;
++
++ for (i = 0; i < 10; i++)
++ {
++ mpfr_rnd_t rnd;
++ unsigned int flags1, flags2;
++ int inex1, inex2;
++
++ tests_default_random (x, 0, __gmpfr_emin, __gmpfr_emax, 1);
++ rnd = RND_RAND ();
++ mpfr_set_ui_2exp (y1, 1, -h, MPFR_RNDN);
++ mpfr_clear_flags ();
++ inex1 = mpfr_pow (y1, x, y1, rnd);
++ flags1 = __gmpfr_flags;
++ mpfr_clear_flags ();
++ inex2 = mpfr_root (y2, x, k, rnd);
++ flags2 = __gmpfr_flags;
++ if (!(mpfr_equal_p (y1, y2) && SAME_SIGN (inex1, inex2) &&
++ flags1 == flags2))
++ {
++ printf ("Error in cmp_pow on h=%d, i=%d, rnd=%s\n",
++ h, i, mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
++ printf ("x = ");
++ mpfr_dump (x);
++ printf ("pow = ");
++ mpfr_dump (y1);
++ printf ("with inex = %d, flags =", inex1);
++ flags_out (flags1);
++ printf ("root = ");
++ mpfr_dump (y2);
++ printf ("with inex = %d, flags =", inex2);
++ flags_out (flags2);
++ exit (1);
++ }
++ }
++ }
++
++ mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
++}
++
+ int
+ main (void)
+ {
+@@ -270,7 +415,10 @@
+
+ tests_start_mpfr ();
+
++ exact_powers (3, 1000);
+ special ();
++ bigint ();
++ cmp_pow ();
+
+ mpfr_init (x);
+
+@@ -329,6 +477,13 @@
+
+ test_generic_ui (2, 200, 30);
+
++ bad_cases (root2, pow2, "mpfr_root[2]", 8, -256, 255, 4, 128, 800, 40);
++ bad_cases (root3, pow3, "mpfr_root[3]", 8, -256, 255, 4, 128, 800, 40);
++ bad_cases (root4, pow4, "mpfr_root[4]", 8, -256, 255, 4, 128, 800, 40);
++ bad_cases (root5, pow5, "mpfr_root[5]", 8, -256, 255, 4, 128, 800, 40);
++ bad_cases (root17, pow17, "mpfr_root[17]", 8, -256, 255, 4, 128, 800, 40);
++ bad_cases (root120, pow120, "mpfr_root[120]", 8, -256, 255, 4, 128, 800, 40);
++
+ tests_end_mpfr ();
+ return 0;
+ }
diff --git a/patches/mpfr/3.1.3/230-gamma.patch b/patches/mpfr/3.1.3/230-gamma.patch
new file mode 100644
index 0000000..47d4e41
--- /dev/null
+++ b/patches/mpfr/3.1.3/230-gamma.patch
@@ -0,0 +1,77 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-23 07:43:23.702095604 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-23 07:43:23.726095285 +0000
+@@ -0,0 +1 @@
++gamma
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-15 15:20:51.306696441 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-23 07:43:23.726095285 +0000
+@@ -1 +1 @@
+-3.1.3-p12
++3.1.3-p13
+diff -Naurd mpfr-3.1.3-a/src/gamma.c mpfr-3.1.3-b/src/gamma.c
+--- mpfr-3.1.3-a/src/gamma.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/gamma.c 2016-02-23 07:43:23.718095391 +0000
+@@ -70,6 +70,9 @@
+ {
+ mpfr_t x, y;
+ unsigned long r, k;
++ MPFR_SAVE_EXPO_DECL (expo);
++
++ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_init2 (x, 38);
+ mpfr_init2 (y, 38);
+ mpfr_set_ui (x, n, MPFR_RNDZ);
+@@ -86,6 +89,8 @@
+ r -= n / k;
+ mpfr_clear (x);
+ mpfr_clear (y);
++ MPFR_SAVE_EXPO_FREE (expo);
++
+ return r;
+ }
+
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-15 15:20:51.302696439 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-23 07:43:23.726095285 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p12"
++#define MPFR_VERSION_STRING "3.1.3-p13"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-15 15:20:51.306696441 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-23 07:43:23.726095285 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p12";
++ return "3.1.3-p13";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tgamma.c mpfr-3.1.3-b/tests/tgamma.c
+--- mpfr-3.1.3-a/tests/tgamma.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tgamma.c 2016-02-23 07:43:23.718095391 +0000
+@@ -192,6 +192,18 @@
+ exit (1);
+ }
+
++ mpfr_set_prec (x, 2);
++ mpfr_set_prec (y, 2);
++ mpfr_set_ui (x, 2, MPFR_RNDN);
++ mpfr_clear_inexflag ();
++ mpfr_gamma (y, x, MPFR_RNDN);
++ if (mpfr_inexflag_p ())
++ {
++ printf ("Wrong inexact flag for gamma(2)\n");
++ printf ("expected 0, got 1\n");
++ exit (1);
++ }
++
+ mpfr_clear (x);
+ mpfr_clear (y);
+ }
diff --git a/patches/mpfr/3.1.3/240-rem1.patch b/patches/mpfr/3.1.3/240-rem1.patch
new file mode 100644
index 0000000..9d5e3c1
--- /dev/null
+++ b/patches/mpfr/3.1.3/240-rem1.patch
@@ -0,0 +1,337 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-23 07:54:06.617533218 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-23 07:54:06.641532898 +0000
+@@ -0,0 +1 @@
++rem1
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-23 07:43:23.726095285 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-23 07:54:06.641532898 +0000
+@@ -1 +1 @@
+-3.1.3-p13
++3.1.3-p14
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-23 07:43:23.726095285 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-23 07:54:06.641532898 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p13"
++#define MPFR_VERSION_STRING "3.1.3-p14"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/rem1.c mpfr-3.1.3-b/src/rem1.c
+--- mpfr-3.1.3-a/src/rem1.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/rem1.c 2016-02-23 07:54:06.633533004 +0000
+@@ -59,6 +59,7 @@
+ mpfr_exp_t ex, ey;
+ int compare, inex, q_is_odd, sign, signx = MPFR_SIGN (x);
+ mpz_t mx, my, r;
++ int tiny = 0;
+
+ MPFR_ASSERTD (rnd_q == MPFR_RNDN || rnd_q == MPFR_RNDZ);
+
+@@ -109,13 +110,27 @@
+ if (ex <= ey)
+ {
+ /* q = x/y = mx/(my*2^(ey-ex)) */
+- mpz_mul_2exp (my, my, ey - ex); /* divide mx by my*2^(ey-ex) */
+- if (rnd_q == MPFR_RNDZ)
+- /* 0 <= |r| <= |my|, r has the same sign as mx */
+- mpz_tdiv_qr (mx, r, mx, my);
++
++ /* First detect cases where q=0, to avoid creating a huge number
++ my*2^(ey-ex): if sx = mpz_sizeinbase (mx, 2) and sy =
++ mpz_sizeinbase (my, 2), we have x < 2^(ex + sx) and
++ y >= 2^(ey + sy - 1), thus if ex + sx <= ey + sy - 1
++ the quotient is 0 */
++ if (ex + (mpfr_exp_t) mpz_sizeinbase (mx, 2) <
++ ey + (mpfr_exp_t) mpz_sizeinbase (my, 2))
++ {
++ tiny = 1;
++ mpz_set (r, mx);
++ mpz_set_ui (mx, 0);
++ }
+ else
+- /* 0 <= |r| <= |my|, r has the same sign as my */
+- mpz_fdiv_qr (mx, r, mx, my);
++ {
++ mpz_mul_2exp (my, my, ey - ex); /* divide mx by my*2^(ey-ex) */
++
++ /* since mx > 0 and my > 0, we can use mpz_tdiv_qr in all cases */
++ mpz_tdiv_qr (mx, r, mx, my);
++ /* 0 <= |r| <= |my|, r has the same sign as mx */
++ }
+
+ if (rnd_q == MPFR_RNDN)
+ q_is_odd = mpz_tstbit (mx, 0);
+@@ -181,7 +196,20 @@
+ /* FIXME: the comparison 2*r < my could be done more efficiently
+ at the mpn level */
+ mpz_mul_2exp (r, r, 1);
+- compare = mpz_cmpabs (r, my);
++ /* if tiny=1, we should compare r with my*2^(ey-ex) */
++ if (tiny)
++ {
++ if (ex + (mpfr_exp_t) mpz_sizeinbase (r, 2) <
++ ey + (mpfr_exp_t) mpz_sizeinbase (my, 2))
++ compare = 0; /* r*2^ex < my*2^ey */
++ else
++ {
++ mpz_mul_2exp (my, my, ey - ex);
++ compare = mpz_cmpabs (r, my);
++ }
++ }
++ else
++ compare = mpz_cmpabs (r, my);
+ mpz_fdiv_q_2exp (r, r, 1);
+ compare = ((compare > 0) ||
+ ((rnd_q == MPFR_RNDN) && (compare == 0) && q_is_odd));
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-23 07:43:23.726095285 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-23 07:54:06.641532898 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p13";
++ return "3.1.3-p14";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tfmod.c mpfr-3.1.3-b/tests/tfmod.c
+--- mpfr-3.1.3-a/tests/tfmod.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tfmod.c 2016-02-23 07:54:06.633533004 +0000
+@@ -137,89 +137,90 @@
+ special (void)
+ {
+ int inexact;
+- mpfr_t x, y, r, nan;
+- mpfr_inits (x, y, r, nan, (mpfr_ptr) 0);
++ mpfr_t x, y, r, t;
+
+- mpfr_set_nan (nan);
++ mpfr_inits (x, y, r, t, (mpfr_ptr) 0);
++
++ mpfr_set_nan (t);
+
+ /* fmod (NaN, NaN) is NaN */
+ mpfr_set_nan (x);
+ mpfr_set_nan (y);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (NaN, +0) is NaN */
+ mpfr_set_ui (y, 0, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (+1, 0) is NaN */
+ mpfr_set_ui (x, 1, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (0, 0) is NaN */
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (+inf, +0) is NaN */
+ mpfr_set_inf (x, +1);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (-inf, +0) is NaN */
+ mpfr_set_inf (x, -1);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (-inf, -0) is NaN */
+ mpfr_neg (x, x, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (-inf, +1) is NaN */
+ mpfr_set_ui (y, +1, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (+inf, +1) is NaN */
+ mpfr_neg (x, x, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (+inf, -inf) is NaN */
+ mpfr_set_inf (y, -1);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (-inf, -inf) is NaN */
+ mpfr_neg (x, x, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (-inf, +inf) is NaN */
+ mpfr_neg (y, y, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (+inf, +inf) is NaN */
+ mpfr_neg (x, x, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (x, +inf) = x, if x is finite */
+ mpfr_set_ui (x, 1, MPFR_RNDN);
+@@ -271,13 +272,13 @@
+ mpfr_set_ui (y, 0, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (+0, -0) is NaN */
+ mpfr_neg (y, y, MPFR_RNDN);
+ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
+ if (!mpfr_nan_p (r) || inexact != 0)
+- test_failed (r, nan, 0, inexact, x, y, MPFR_RNDN);
++ test_failed (r, t, 0, inexact, x, y, MPFR_RNDN);
+
+ /* fmod (+0, +1) = +0 */
+ mpfr_set_ui (y, 1, MPFR_RNDN);
+@@ -303,7 +304,18 @@
+ if (!mpfr_equal_p (r, x) || inexact != 0)
+ test_failed (r, x, 0, inexact, x, y, MPFR_RNDN);
+
+- mpfr_clears (x, y, r, nan, (mpfr_ptr) 0);
++ mpfr_set_prec (x, 380);
++ mpfr_set_prec (y, 385);
++ mpfr_set_str_binary (x, "0.11011010010110011101011000100100101100101011010001011100110001100101111001010100001011111110111100101110101010110011010101000100000100011101101100001011101110100111101111111010001001000010000110010110011100111000001110111010000100101001010111100100010001101001110100011110010000000001110001111001101100111011001000110110011100100011111110010100011001000001001011010111010000000000E0");
++ mpfr_set_str_binary (y, "0.1100011000011101011010001100010111001110110111001101010010111100111100011010010011011101111101111001010111111110001001100001111101001000000010100101111001001110010110000111001000101010111001001000100101011111000010100110001111000110011011010101111101100110010101011010011101100001011101001000101111110110110110000001001101110111110110111110111111001001011110001110011111100000000000000E-1");
++ mpfr_set_prec (r, 2);
++ inexact = mpfr_fmod (r, x, y, MPFR_RNDA);
++ mpfr_set_prec (t, 2);
++ mpfr_set_ui_2exp (t, 3, -5, MPFR_RNDN);
++ if (mpfr_cmp_ui_2exp (r, 3, -5) || inexact <= 0)
++ test_failed (r, t, 1, inexact, x, y, MPFR_RNDA);
++
++ mpfr_clears (x, y, r, t, (mpfr_ptr) 0);
+ return;
+ }
+
+@@ -313,6 +325,7 @@
+ {
+ mpfr_t x, y, r;
+ int inexact;
++
+ mpfr_inits2 (100, x, y, r, (mpfr_ptr) 0);
+
+ mpfr_set_prec (x, 3);
+@@ -353,7 +366,46 @@
+ mpfr_sin (y, y, MPFR_RNDN);
+ check (r, x, y, MPFR_RNDN);
+
+- mpfr_clears(r, x, y, (mpfr_ptr) 0);
++ mpfr_clears (x, y, r, (mpfr_ptr) 0);
++}
++
++static void
++bug20160217 (void)
++{
++ mpfr_t x, y, r;
++ int inexact, i;
++ mpfr_exp_t emin, emax;
++
++ mpfr_inits2 (53, x, y, r, (mpfr_ptr) 0);
++
++ emin = mpfr_get_emin ();
++ emax = mpfr_get_emax ();
++
++ for (i = 0; i <= 1; i++)
++ {
++ mpfr_set_zero (x, 1);
++ mpfr_nextabove (x);
++ mpfr_set_inf (y, 1);
++ mpfr_nextbelow (y);
++ inexact = mpfr_fmod (r, x, y, MPFR_RNDN);
++ if (!mpfr_equal_p (r, x) || inexact != 0)
++ {
++ printf ("Error for mpfr_fmod (r, nextabove(0), nextbelow(+inf),"
++ " MPFR_RNDN)%s\n", i ? "extended exponent range" : "");
++ printf ("Expected inex = 0, r = ");
++ mpfr_dump (x);
++ printf ("Got inex = %d, r = ", inexact);
++ mpfr_dump (r);
++ exit (1);
++ }
++ set_emin (MPFR_EMIN_MIN);
++ set_emax (MPFR_EMAX_MAX);
++ }
++
++ set_emin (emin);
++ set_emax (emax);
++
++ mpfr_clears (x, y, r, (mpfr_ptr) 0);
+ }
+
+ int
+@@ -362,6 +414,7 @@
+ tests_start_mpfr ();
+
+ bug20090519 ();
++ bug20160217 ();
+
+ test_generic (2, 100, 100);
+
+diff -Naurd mpfr-3.1.3-a/tests/tremquo.c mpfr-3.1.3-b/tests/tremquo.c
+--- mpfr-3.1.3-a/tests/tremquo.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tremquo.c 2016-02-23 07:54:06.633533004 +0000
+@@ -59,6 +59,7 @@
+ {
+ mpfr_t x, y, r;
+ long q[1];
++ int inex;
+
+ if (argc == 3) /* usage: tremquo x y (rnd=MPFR_RNDN implicit) */
+ {
+@@ -281,6 +282,15 @@
+ MPFR_ASSERTN (mpfr_zero_p (r) && MPFR_SIGN (r) > 0);
+ MPFR_ASSERTN (q[0] == 0);
+
++ mpfr_set_prec (x, 380);
++ mpfr_set_prec (y, 385);
++ mpfr_set_str_binary (x, "0.11011010010110011101011000100100101100101011010001011100110001100101111001010100001011111110111100101110101010110011010101000100000100011101101100001011101110100111101111111010001001000010000110010110011100111000001110111010000100101001010111100100010001101001110100011110010000000001110001111001101100111011001000110110011100100011111110010100011001000001001011010111010000000000E-2");
++ mpfr_set_str_binary (y, "0.1100011000011101011010001100010111001110110111001101010010111100111100011010010011011101111101111001010111111110001001100001111101001000000010100101111001001110010110000111001000101010111001001000100101011111000010100110001111000110011011010101111101100110010101011010011101100001011101001000101111110110110110000001001101110111110110111110111111001001011110001110011111100000000000000E-1");
++ mpfr_set_prec (r, 2);
++ inex = mpfr_remainder (r, x, y, MPFR_RNDA);
++ MPFR_ASSERTN(mpfr_cmp_si_2exp (r, -3, -4) == 0);
++ MPFR_ASSERTN(inex < 0);
++
+ mpfr_clear (x);
+ mpfr_clear (y);
+ mpfr_clear (r);
diff --git a/patches/mpfr/3.1.3/250-agm-eq.patch b/patches/mpfr/3.1.3/250-agm-eq.patch
new file mode 100644
index 0000000..e59e914
--- /dev/null
+++ b/patches/mpfr/3.1.3/250-agm-eq.patch
@@ -0,0 +1,105 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-23 07:55:17.208593082 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-23 07:55:17.232592762 +0000
+@@ -0,0 +1 @@
++agm-eq
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-23 07:54:06.641532898 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-23 07:55:17.232592762 +0000
+@@ -1 +1 @@
+-3.1.3-p14
++3.1.3-p15
+diff -Naurd mpfr-3.1.3-a/src/agm.c mpfr-3.1.3-b/src/agm.c
+--- mpfr-3.1.3-a/src/agm.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/agm.c 2016-02-23 07:55:17.224592868 +0000
+@@ -96,10 +96,7 @@
+ /* b (op2) and a (op1) are the 2 operands but we want b >= a */
+ compare = mpfr_cmp (op1, op2);
+ if (MPFR_UNLIKELY( compare == 0 ))
+- {
+- mpfr_set (r, op1, rnd_mode);
+- MPFR_RET (0); /* exact */
+- }
++ return mpfr_set (r, op1, rnd_mode);
+ else if (compare > 0)
+ {
+ mpfr_srcptr t = op1;
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-23 07:54:06.641532898 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-23 07:55:17.232592762 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p14"
++#define MPFR_VERSION_STRING "3.1.3-p15"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-23 07:54:06.641532898 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-23 07:55:17.232592762 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p14";
++ return "3.1.3-p15";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tagm.c mpfr-3.1.3-b/tests/tagm.c
+--- mpfr-3.1.3-a/tests/tagm.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tagm.c 2016-02-23 07:55:17.224592868 +0000
+@@ -169,6 +169,45 @@
+ }
+
+ static void
++check_eq (void)
++{
++ mpfr_t a, b, agm;
++ int p;
++
++ mpfr_init2 (a, 17);
++ mpfr_init2 (b, 9);
++
++ mpfr_set_str_binary (b, "0.101000000E-3");
++ mpfr_set (a, b, MPFR_RNDN);
++
++ for (p = MPFR_PREC_MIN; p <= 2; p++)
++ {
++ int inex;
++
++ mpfr_init2 (agm, p);
++ inex = mpfr_agm (agm, a, b, MPFR_RNDU);
++ if (mpfr_cmp_ui_2exp (agm, 5 - p, -5) != 0)
++ {
++ printf ("Error in check_eq for p = %d: expected %d*2^(-5), got ",
++ p, 5 - p);
++ mpfr_dump (agm);
++ exit (1);
++ }
++ if (inex <= 0)
++ {
++ printf ("Wrong ternary value in check_eq for p = %d\n", p);
++ printf ("expected 1\n");
++ printf ("got %d\n", inex);
++ exit (1);
++ }
++ mpfr_clear (agm);
++ }
++
++ mpfr_clear (a);
++ mpfr_clear (b);
++}
++
++static void
+ check_nans (void)
+ {
+ mpfr_t x, y, m;
+@@ -260,6 +299,7 @@
+ check_nans ();
+
+ check_large ();
++ check_eq ();
+ check4 ("2.0", "1.0", MPFR_RNDN, "1.456791031046906869", -1);
+ check4 ("6.0", "4.0", MPFR_RNDN, "4.949360872472608925", 1);
+ check4 ("62.0", "61.0", MPFR_RNDN, "61.498983718845075902", -1);
diff --git a/patches/mpfr/3.1.3/260-sum.patch b/patches/mpfr/3.1.3/260-sum.patch
new file mode 100644
index 0000000..6fae047
--- /dev/null
+++ b/patches/mpfr/3.1.3/260-sum.patch
@@ -0,0 +1,223 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-23 07:55:54.028346753 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-23 07:55:54.052346433 +0000
+@@ -0,0 +1 @@
++sum
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-23 07:55:17.232592762 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-23 07:55:54.052346433 +0000
+@@ -1 +1 @@
+-3.1.3-p15
++3.1.3-p16
+diff -Naurd mpfr-3.1.3-a/src/mpfr-impl.h mpfr-3.1.3-b/src/mpfr-impl.h
+--- mpfr-3.1.3-a/src/mpfr-impl.h 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/mpfr-impl.h 2016-02-23 07:55:54.040346593 +0000
+@@ -1876,7 +1876,8 @@
+ __MPFR_DECLSPEC int mpfr_check _MPFR_PROTO ((mpfr_srcptr));
+
+ __MPFR_DECLSPEC int mpfr_sum_sort _MPFR_PROTO ((mpfr_srcptr *const,
+- unsigned long, mpfr_srcptr *));
++ unsigned long, mpfr_srcptr *,
++ mpfr_prec_t *));
+
+ __MPFR_DECLSPEC int mpfr_get_cputime _MPFR_PROTO ((void));
+
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-23 07:55:17.232592762 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-23 07:55:54.052346433 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p15"
++#define MPFR_VERSION_STRING "3.1.3-p16"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/sum.c mpfr-3.1.3-b/src/sum.c
+--- mpfr-3.1.3-a/src/sum.c 2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/sum.c 2016-02-23 07:55:54.040346593 +0000
+@@ -45,9 +45,13 @@
+ mpfr_exp_t, mpfr_uexp_t);
+
+ /* Either sort the tab in perm and returns 0
+- Or returns 1 for +INF, -1 for -INF and 2 for NAN */
++ Or returns 1 for +INF, -1 for -INF and 2 for NAN.
++ Also set *maxprec to the maximal precision of tab[0..n-1] and of the
++ initial value of *maxprec.
++*/
+ int
+-mpfr_sum_sort (mpfr_srcptr *const tab, unsigned long n, mpfr_srcptr *perm)
++mpfr_sum_sort (mpfr_srcptr *const tab, unsigned long n, mpfr_srcptr *perm,
++ mpfr_prec_t *maxprec)
+ {
+ mpfr_exp_t min, max;
+ mpfr_uexp_t exp_num;
+@@ -79,6 +83,8 @@
+ if (MPFR_GET_EXP (tab[i]) > max)
+ max = MPFR_GET_EXP(tab[i]);
+ }
++ if (MPFR_PREC (tab[i]) > *maxprec)
++ *maxprec = MPFR_PREC (tab[i]);
+ }
+ if (MPFR_UNLIKELY (sign_inf != 0))
+ return sign_inf;
+@@ -213,7 +219,8 @@
+
+
+ /* Sum a list of float with order given by permutation perm,
+- * intermediate size set to F.
++ * intermediate size set to F. Return non-zero if at least one of
++ * the operations is inexact (thus 0 implies that the sum is exact).
+ * Internal use function.
+ */
+ static int
+@@ -230,16 +237,19 @@
+ for (i = 1; i < n - 1; i++)
+ {
+ MPFR_ASSERTD (!MPFR_IS_NAN (sum) && !MPFR_IS_INF (sum));
+- error_trap |= mpfr_add (sum, sum, tab[i], MPFR_RNDN);
++ if (mpfr_add (sum, sum, tab[i], MPFR_RNDN))
++ error_trap = 1;
+ }
+- error_trap |= mpfr_add (ret, sum, tab[n - 1], MPFR_RNDN);
++ if (mpfr_add (ret, sum, tab[n - 1], MPFR_RNDN))
++ error_trap = 1;
+ mpfr_clear (sum);
+ return error_trap;
+ }
+
+ /* Sum a list of floating-point numbers.
++ * If the return value is 0, then the sum is exact.
++ * Otherwise the return value gives no information.
+ */
+-
+ int
+ mpfr_sum (mpfr_ptr ret, mpfr_ptr *const tab_p, unsigned long n, mpfr_rnd_t rnd)
+ {
+@@ -266,7 +276,8 @@
+ /* Sort and treat special cases */
+ MPFR_TMP_MARK (marker);
+ perm = (mpfr_srcptr *) MPFR_TMP_ALLOC (n * sizeof *perm);
+- error_trap = mpfr_sum_sort (tab, n, perm);
++ prec = MPFR_PREC (ret);
++ error_trap = mpfr_sum_sort (tab, n, perm, &prec);
+ /* Check if there was a NAN or a INF */
+ if (MPFR_UNLIKELY (error_trap != 0))
+ {
+@@ -281,8 +292,7 @@
+ MPFR_RET (0);
+ }
+
+- /* Initial precision */
+- prec = MAX (MPFR_PREC (tab[0]), MPFR_PREC (ret));
++ /* Initial precision is max(prec(ret),prec(tab[0]),...,prec(tab[n-1])) */
+ k = MPFR_INT_CEIL_LOG2 (n) + 1;
+ prec += k + 2;
+ mpfr_init2 (cur_sum, prec);
+@@ -295,8 +305,7 @@
+ error_trap = sum_once (cur_sum, perm, n, prec + k);
+ if (MPFR_LIKELY (error_trap == 0 ||
+ (!MPFR_IS_ZERO (cur_sum) &&
+- mpfr_can_round (cur_sum,
+- MPFR_GET_EXP (cur_sum) - prec + 2,
++ mpfr_can_round (cur_sum, prec - 2,
+ MPFR_RNDN, rnd, MPFR_PREC (ret)))))
+ break;
+ MPFR_ZIV_NEXT (loop, prec);
+@@ -305,11 +314,13 @@
+ MPFR_ZIV_FREE (loop);
+ MPFR_TMP_FREE (marker);
+
+- error_trap |= mpfr_set (ret, cur_sum, rnd);
++ if (mpfr_set (ret, cur_sum, rnd))
++ error_trap = 1;
+ mpfr_clear (cur_sum);
+
+ MPFR_SAVE_EXPO_FREE (expo);
+- error_trap |= mpfr_check_range (ret, 0, rnd);
++ if (mpfr_check_range (ret, 0, rnd))
++ error_trap = 1;
+ return error_trap; /* It doesn't return the ternary value */
+ }
+
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-23 07:55:17.232592762 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-23 07:55:54.052346433 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p15";
++ return "3.1.3-p16";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tsum.c mpfr-3.1.3-b/tests/tsum.c
+--- mpfr-3.1.3-a/tests/tsum.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tsum.c 2016-02-23 07:55:54.040346593 +0000
+@@ -126,6 +126,7 @@
+ mpfr_ptr *tabtmp;
+ mpfr_srcptr *perm;
+ unsigned long i;
++ mpfr_prec_t prec = MPFR_PREC_MIN;
+
+ /* Init stuff */
+ tab = (mpfr_t *) (*__gmp_allocate_func) (n * sizeof (mpfr_t));
+@@ -140,7 +141,7 @@
+ tabtmp[i] = tab[i];
+ }
+
+- mpfr_sum_sort ((mpfr_srcptr *)tabtmp, n, perm);
++ mpfr_sum_sort ((mpfr_srcptr *)tabtmp, n, perm, &prec);
+
+ if (check_is_sorted (n, perm) == 0)
+ {
+@@ -300,6 +301,41 @@
+ mpfr_clears (tab[0], tab[1], tab[2], r, (mpfr_ptr) 0);
+ }
+
++/* bug reported by Joseph S. Myers on 2013-10-27
++ https://sympa.inria.fr/sympa/arc/mpfr/2013-10/msg00015.html */
++static void
++bug20131027 (void)
++{
++ mpfr_t r, t[4];
++ mpfr_ptr p[4];
++ char *s[4] = {
++ "0x1p1000",
++ "-0x0.fffffffffffff80000000000000001p1000",
++ "-0x1p947",
++ "0x1p880"
++ };
++ int i;
++
++ mpfr_init2 (r, 53);
++ for (i = 0; i < 4; i++)
++ {
++ mpfr_init2 (t[i], i == 0 ? 53 : 1000);
++ mpfr_set_str (t[i], s[i], 0, MPFR_RNDN);
++ p[i] = t[i];
++ }
++ mpfr_sum (r, p, 4, MPFR_RNDN);
++
++ if (MPFR_NOTZERO (r))
++ {
++ printf ("mpfr_sum incorrect in bug20131027: expected 0, got\n");
++ mpfr_dump (r);
++ exit (1);
++ }
++
++ for (i = 0; i < 4; i++)
++ mpfr_clear (t[i]);
++ mpfr_clear (r);
++}
+
+ int
+ main (void)
+@@ -310,6 +346,7 @@
+ tests_start_mpfr ();
+
+ check_special ();
++ bug20131027 ();
+ test_sort (1764, 1026);
+ for (p = 2 ; p < 444 ; p += 17)
+ for (n = 2 ; n < 1026 ; n += 42 + p)
diff --git a/patches/mpfr/3.1.3/270-cmp_d.patch b/patches/mpfr/3.1.3/270-cmp_d.patch
new file mode 100644
index 0000000..f22e27a
--- /dev/null
+++ b/patches/mpfr/3.1.3/270-cmp_d.patch
@@ -0,0 +1,219 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES 2016-02-23 12:28:35.578442642 +0000
++++ mpfr-3.1.3-b/PATCHES 2016-02-23 12:28:35.602442321 +0000
+@@ -0,0 +1 @@
++cmp_d
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION 2016-02-23 07:55:54.052346433 +0000
++++ mpfr-3.1.3-b/VERSION 2016-02-23 12:28:35.602442321 +0000
+@@ -1 +1 @@
+-3.1.3-p16
++3.1.3-p17
+diff -Naurd mpfr-3.1.3-a/src/cmp_d.c mpfr-3.1.3-b/src/cmp_d.c
+--- mpfr-3.1.3-a/src/cmp_d.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/cmp_d.c 2016-02-23 12:28:35.590442481 +0000
+@@ -27,12 +27,19 @@
+ {
+ mpfr_t tmp;
+ int res;
++ MPFR_SAVE_EXPO_DECL (expo);
++
++ MPFR_SAVE_EXPO_MARK (expo);
+
+ mpfr_init2 (tmp, IEEE_DBL_MANT_DIG);
+ res = mpfr_set_d (tmp, d, MPFR_RNDN);
+ MPFR_ASSERTD (res == 0);
++
++ mpfr_clear_flags ();
+ res = mpfr_cmp (b, tmp);
+- mpfr_clear (tmp);
++ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
+
++ mpfr_clear (tmp);
++ MPFR_SAVE_EXPO_FREE (expo);
+ return res;
+ }
+diff -Naurd mpfr-3.1.3-a/src/cmp_ld.c mpfr-3.1.3-b/src/cmp_ld.c
+--- mpfr-3.1.3-a/src/cmp_ld.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/cmp_ld.c 2016-02-23 12:28:35.590442481 +0000
+@@ -27,12 +27,19 @@
+ {
+ mpfr_t tmp;
+ int res;
++ MPFR_SAVE_EXPO_DECL (expo);
++
++ MPFR_SAVE_EXPO_MARK (expo);
+
+ mpfr_init2 (tmp, MPFR_LDBL_MANT_DIG);
+ res = mpfr_set_ld (tmp, d, MPFR_RNDN);
+ MPFR_ASSERTD (res == 0);
++
++ mpfr_clear_flags ();
+ res = mpfr_cmp (b, tmp);
+- mpfr_clear (tmp);
++ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
+
++ mpfr_clear (tmp);
++ MPFR_SAVE_EXPO_FREE (expo);
+ return res;
+ }
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h 2016-02-23 07:55:54.052346433 +0000
++++ mpfr-3.1.3-b/src/mpfr.h 2016-02-23 12:28:35.598442376 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p16"
++#define MPFR_VERSION_STRING "3.1.3-p17"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c 2016-02-23 07:55:54.052346433 +0000
++++ mpfr-3.1.3-b/src/version.c 2016-02-23 12:28:35.598442376 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "3.1.3-p16";
++ return "3.1.3-p17";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tcmp_d.c mpfr-3.1.3-b/tests/tcmp_d.c
+--- mpfr-3.1.3-a/tests/tcmp_d.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tcmp_d.c 2016-02-23 12:28:35.590442481 +0000
+@@ -29,8 +29,10 @@
+ main (void)
+ {
+ mpfr_t x;
++ mpfr_exp_t emin;
+
+ tests_start_mpfr ();
++ emin = mpfr_get_emin ();
+
+ mpfr_init2(x, IEEE_DBL_MANT_DIG);
+
+@@ -67,16 +69,31 @@
+ exit (1);
+ }
+
++ /* Test in reduced exponent range. */
++ set_emin (1);
++ mpfr_set_ui (x, 1, MPFR_RNDN);
++ if (mpfr_cmp_d (x, 0.9) <= 0)
++ {
++ printf ("Error in reduced exponent range.\n");
++ exit (1);
++ }
++ set_emin (emin);
++
+ #if !defined(MPFR_ERRDIVZERO)
+ /* Check NAN */
+ {
+ int c;
+
+- mpfr_clear_erangeflag ();
++ mpfr_clear_flags ();
+ c = mpfr_cmp_d (x, DBL_NAN);
+- if (c != 0 || !mpfr_erangeflag_p ())
++ if (c != 0 || __gmpfr_flags != MPFR_FLAGS_ERANGE)
+ {
+ printf ("ERROR for NAN (1)\n");
++ printf ("Expected 0, got %d\n", c);
++ printf ("Expected flags:");
++ flags_out (MPFR_FLAGS_ERANGE);
++ printf ("Got flags: ");
++ flags_out (__gmpfr_flags);
+ #ifdef MPFR_NANISNAN
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
+@@ -84,12 +101,18 @@
+ #endif
+ exit (1);
+ }
++
+ mpfr_set_nan (x);
+- mpfr_clear_erangeflag ();
++ mpfr_clear_flags ();
+ c = mpfr_cmp_d (x, 2.0);
+- if (c != 0 || !mpfr_erangeflag_p ())
++ if (c != 0 || __gmpfr_flags != MPFR_FLAGS_ERANGE)
+ {
+ printf ("ERROR for NAN (2)\n");
++ printf ("Expected 0, got %d\n", c);
++ printf ("Expected flags:");
++ flags_out (MPFR_FLAGS_ERANGE);
++ printf ("Got flags: ");
++ flags_out (__gmpfr_flags);
+ #ifdef MPFR_NANISNAN
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
+diff -Naurd mpfr-3.1.3-a/tests/tcmp_ld.c mpfr-3.1.3-b/tests/tcmp_ld.c
+--- mpfr-3.1.3-a/tests/tcmp_ld.c 2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tcmp_ld.c 2016-02-23 12:28:35.590442481 +0000
+@@ -28,8 +28,10 @@
+ main (void)
+ {
+ mpfr_t x;
++ mpfr_exp_t emin;
+
+ tests_start_mpfr ();
++ emin = mpfr_get_emin ();
+
+ mpfr_init2(x, MPFR_LDBL_MANT_DIG);
+
+@@ -66,16 +68,31 @@
+ exit (1);
+ }
+
++ /* Test in reduced exponent range. */
++ set_emin (1);
++ mpfr_set_ui (x, 1, MPFR_RNDN);
++ if (mpfr_cmp_ld (x, 0.9) <= 0)
++ {
++ printf ("Error in reduced exponent range.\n");
++ exit (1);
++ }
++ set_emin (emin);
++
+ #if !defined(MPFR_ERRDIVZERO)
+ /* Check NAN */
+ {
+ int c;
+
+- mpfr_clear_erangeflag ();
++ mpfr_clear_flags ();
+ c = mpfr_cmp_ld (x, DBL_NAN);
+- if (c != 0 || !mpfr_erangeflag_p ())
++ if (c != 0 || __gmpfr_flags != MPFR_FLAGS_ERANGE)
+ {
+ printf ("ERROR for NAN (1)\n");
++ printf ("Expected 0, got %d\n", c);
++ printf ("Expected flags:");
++ flags_out (MPFR_FLAGS_ERANGE);
++ printf ("Got flags: ");
++ flags_out (__gmpfr_flags);
+ #ifdef MPFR_NANISNAN
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
+@@ -83,12 +100,18 @@
+ #endif
+ exit (1);
+ }
++
+ mpfr_set_nan (x);
+- mpfr_clear_erangeflag ();
++ mpfr_clear_flags ();
+ c = mpfr_cmp_ld (x, 2.0);
+- if (c != 0 || !mpfr_erangeflag_p ())
++ if (c != 0 || __gmpfr_flags != MPFR_FLAGS_ERANGE)
+ {
+ printf ("ERROR for NAN (2)\n");
++ printf ("Expected 0, got %d\n", c);
++ printf ("Expected flags:");
++ flags_out (MPFR_FLAGS_ERANGE);
++ printf ("Got flags: ");
++ flags_out (__gmpfr_flags);
+ #ifdef MPFR_NANISNAN
+ printf ("The reason is that NAN == NAN. Please look at the configure "
+ "output\nand Section \"In case of problem\" of the INSTALL "
diff --git a/patches/strace/4.5.15/100-autoreconf.patch b/patches/strace/4.5.15/100-autoreconf.patch
deleted file mode 100644
index 5ffda82..0000000
--- a/patches/strace/4.5.15/100-autoreconf.patch
+++ /dev/null
@@ -1,761 +0,0 @@
-diff -dur strace-4.5.15.orig/configure strace-4.5.15/configure
---- strace-4.5.15.orig/configure 2007-01-11 23:23:33.000000000 +0100
-+++ strace-4.5.15/configure 2007-07-14 19:18:43.000000000 +0200
-@@ -956,7 +956,7 @@
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
-- cd $ac_popdir
-+ cd "$ac_popdir"
- done
- fi
-
-@@ -2660,8 +2660,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -2719,8 +2718,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -2836,8 +2834,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -2891,8 +2888,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -2937,8 +2933,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -2982,8 +2977,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -3721,8 +3715,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -3786,8 +3779,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -3959,8 +3951,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4032,8 +4023,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4087,8 +4077,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4159,8 +4148,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4214,8 +4202,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4345,8 +4332,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4410,8 +4396,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4454,8 +4439,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4519,8 +4503,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4563,8 +4546,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4628,8 +4610,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4672,8 +4653,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4737,8 +4717,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4781,8 +4760,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4846,8 +4824,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4890,8 +4867,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4955,8 +4931,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -4999,8 +4974,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5064,8 +5038,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5108,8 +5081,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5173,8 +5145,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5217,8 +5188,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5286,8 +5256,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5320,6 +5289,73 @@
-
- fi
-
-+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
-+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
-+if test "${ac_cv_type_statfs64+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+#ifdef LINUX
-+#include <linux/types.h>
-+#include <sys/statfs.h>
-+#else
-+#include <sys/vfs.h>
-+#endif
-+int
-+main ()
-+{
-+struct statfs64 st;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_type_statfs64=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_type_statfs64=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+
-+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
-+echo "${ECHO_T}$ac_cv_type_statfs64" >&6
-+if test "$ac_cv_type_statfs64" = yes
-+then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STATFS64 1
-+_ACEOF
-+
-+fi
-+
-
- echo "$as_me:$LINENO: checking return type of signal handlers" >&5
- echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
-@@ -5360,8 +5396,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5460,8 +5495,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5610,8 +5644,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5668,8 +5701,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5816,8 +5848,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -5968,8 +5999,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6033,8 +6063,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6100,8 +6129,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6147,8 +6175,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6214,8 +6241,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6466,8 +6492,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6532,8 +6557,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6600,8 +6624,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6717,8 +6740,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6812,8 +6834,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -6959,8 +6980,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7020,8 +7040,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7082,8 +7101,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7356,8 +7374,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7401,8 +7418,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7471,8 +7487,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7539,8 +7554,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7585,8 +7599,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7652,8 +7665,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7698,8 +7710,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7767,8 +7778,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7834,8 +7844,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7899,8 +7908,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -7966,8 +7974,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -8032,8 +8039,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -8077,8 +8083,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -8145,8 +8150,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -8218,8 +8222,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -8289,8 +8292,7 @@
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag"
-- || test ! -s conftest.err'
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
-@@ -9293,11 +9295,6 @@
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
- esac
-
-- if test x"$ac_file" != x-; then
-- { echo "$as_me:$LINENO: creating $ac_file" >&5
--echo "$as_me: creating $ac_file" >&6;}
-- rm -f "$ac_file"
-- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
-@@ -9336,6 +9333,12 @@
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-+
-+ if test x"$ac_file" != x-; then
-+ { echo "$as_me:$LINENO: creating $ac_file" >&5
-+echo "$as_me: creating $ac_file" >&6;}
-+ rm -f "$ac_file"
-+ fi
- _ACEOF
- cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
diff --git a/patches/strace/4.5.15/110-dont-use-REG_SYSCALL-for-sh.patch b/patches/strace/4.5.15/110-dont-use-REG_SYSCALL-for-sh.patch
deleted file mode 100644
index 8add445..0000000
--- a/patches/strace/4.5.15/110-dont-use-REG_SYSCALL-for-sh.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -dur strace-4.5.15.orig/process.c strace-4.5.15/process.c
---- strace-4.5.15.orig/process.c 2007-01-11 23:08:38.000000000 +0100
-+++ strace-4.5.15/process.c 2007-07-14 19:19:58.000000000 +0200
-@@ -2679,7 +2679,6 @@
- { 4*REG_GBR, "4*REG_GBR" },
- { 4*REG_MACH, "4*REG_MACH" },
- { 4*REG_MACL, "4*REG_MACL" },
-- { 4*REG_SYSCALL, "4*REG_SYSCALL" },
- { 4*REG_FPUL, "4*REG_FPUL" },
- { 4*REG_FPREG0, "4*REG_FPREG0" },
- { 4*(REG_FPREG0+1), "4*REG_FPREG1" },
diff --git a/patches/strace/4.5.15/120-fix-arm-bad-syscall.patch b/patches/strace/4.5.15/120-fix-arm-bad-syscall.patch
deleted file mode 100644
index aa4c5c4..0000000
--- a/patches/strace/4.5.15/120-fix-arm-bad-syscall.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
---- strace-4.5.15.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100
-+++ strace-4.5.15/syscall.c 2007-07-14 19:21:44.000000000 +0200
-@@ -1045,6 +1045,15 @@
- /*
- * Note: we only deal with only 32-bit CPUs here.
- */
-+
-+ if (!(tcp->flags & TCB_INSYSCALL) &&
-+ (tcp->flags & TCB_WAITEXECVE)) {
-+ /* caught a fake syscall from the execve's exit */
-+ tcp->flags &= ~TCB_WAITEXECVE;
-+ return 0;
-+ }
-+
-+
- if (regs.ARM_cpsr & 0x20) {
- /*
- * Get the Thumb-mode system call number
diff --git a/patches/strace/4.5.15/130-fix-disabled-largefile-syscalls.patch b/patches/strace/4.5.15/130-fix-disabled-largefile-syscalls.patch
deleted file mode 100644
index 22903cd..0000000
--- a/patches/strace/4.5.15/130-fix-disabled-largefile-syscalls.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
---- strace-4.5.15.orig/syscall.c 2007-07-14 19:21:44.000000000 +0200
-+++ strace-4.5.15/syscall.c 2007-07-14 19:22:49.000000000 +0200
-@@ -125,6 +125,18 @@
- #define TP TRACE_PROCESS
- #define TS TRACE_SIGNAL
-
-+#ifndef HAVE_STATFS64
-+/*
-+ * Ugly hacks for systems that do not have LFS
-+ */
-+
-+#define sys_truncate64 sys_truncate
-+#define sys_ftruncate64 sys_ftruncate
-+#define sys_getdents64 sys_getdents
-+#define sys_statfs64 sys_statfs
-+#define sys_fstatfs64 sys_fstatfs
-+#endif
-+
- static const struct sysent sysent0[] = {
- #include "syscallent.h"
- };
diff --git a/patches/strace/4.5.15/140-mips-sprintsigmask-fix.patch b/patches/strace/4.5.15/140-mips-sprintsigmask-fix.patch
deleted file mode 100644
index e2aaa40..0000000
--- a/patches/strace/4.5.15/140-mips-sprintsigmask-fix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -dur strace-4.5.15.orig/signal.c strace-4.5.15/signal.c
---- strace-4.5.15.orig/signal.c 2007-01-11 23:08:38.000000000 +0100
-+++ strace-4.5.15/signal.c 2007-07-14 19:24:43.000000000 +0200
-@@ -1440,7 +1440,7 @@
- tcp->u_rval = tcp->u_error = 0;
- if(tcp->u_arg[0] == 0)
- return 0;
-- tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]);
-+ tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0);
- return RVAL_NONE | RVAL_STR;
- }
- return 0;
diff --git a/patches/strace/4.5.15/150-statfs64-check.patch b/patches/strace/4.5.15/150-statfs64-check.patch
deleted file mode 100644
index a1d8e5f..0000000
--- a/patches/strace/4.5.15/150-statfs64-check.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4
---- strace-4.5.15.orig/acinclude.m4 2004-04-14 04:21:01.000000000 +0200
-+++ strace-4.5.15/acinclude.m4 2007-07-14 19:25:25.000000000 +0200
-@@ -210,6 +210,26 @@
- fi
- ])
-
-+dnl ### A macro to determine whether statfs64 is defined.
-+AC_DEFUN([AC_STATFS64],
-+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
-+AC_CACHE_VAL(ac_cv_type_statfs64,
-+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
-+#include <linux/types.h>
-+#include <sys/statfs.h>
-+#else
-+#include <sys/vfs.h>
-+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
-+AC_MSG_RESULT($ac_cv_type_statfs64)
-+if test "$ac_cv_type_statfs64" = yes
-+then
-+ AC_DEFINE([HAVE_STATFS64], 1,
-+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
-+fi
-+])
-+
-+
-+
- dnl ### A macro to determine if off_t is a long long
- AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
- [AC_MSG_CHECKING(for long long off_t)
-diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
---- strace-4.5.15.orig/configure.ac 2007-01-11 12:37:55.000000000 +0100
-+++ strace-4.5.15/configure.ac 2007-07-14 19:25:25.000000000 +0200
-@@ -169,6 +169,7 @@
- struct stat.st_level,
- struct stat.st_rdev])
- AC_STAT64
-+AC_STATFS64
-
- AC_TYPE_SIGNAL
- AC_TYPE_UID_T
-diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c
---- strace-4.5.15.orig/file.c 2007-01-15 21:25:52.000000000 +0100
-+++ strace-4.5.15/file.c 2007-07-14 19:25:25.000000000 +0200
-@@ -1635,7 +1635,7 @@
- return 0;
- }
-
--#ifdef LINUX
-+#ifdef HAVE_STATFS64
- static void
- printstatfs64(tcp, addr)
- struct tcb *tcp;
diff --git a/patches/strace/4.5.15/160-superh-update.ac.patch b/patches/strace/4.5.15/160-superh-update.ac.patch
deleted file mode 100644
index 75e2cd4..0000000
--- a/patches/strace/4.5.15/160-superh-update.ac.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
---- strace-4.5.15.orig/configure.ac 2007-07-14 19:25:25.000000000 +0200
-+++ strace-4.5.15/configure.ac 2007-07-14 19:27:35.000000000 +0200
-@@ -91,14 +91,14 @@
- arch=hppa
- AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
- ;;
--sh)
-- arch=sh
-- AC_DEFINE([SH], 1, [Define for the SH architecture.])
-- ;;
- sh64)
- arch=sh64
- AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
- ;;
-+sh*)
-+ arch=sh
-+ AC_DEFINE([SH], 1, [Define for the SH architecture.])
-+ ;;
- x86?64*)
- arch=x86_64
- AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
diff --git a/patches/strace/4.5.15/170-undef-CTL_PROC.patch b/patches/strace/4.5.15/170-undef-CTL_PROC.patch
deleted file mode 100644
index cfb8752..0000000
--- a/patches/strace/4.5.15/170-undef-CTL_PROC.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -dur strace-4.5.15.orig/system.c strace-4.5.15/system.c
---- strace-4.5.15.orig/system.c 2007-01-17 00:22:36.000000000 +0100
-+++ strace-4.5.15/system.c 2007-07-14 19:28:41.000000000 +0200
-@@ -1612,7 +1612,9 @@
- { CTL_KERN, "CTL_KERN" },
- { CTL_VM, "CTL_VM" },
- { CTL_NET, "CTL_NET" },
-+#ifdef CTL_PROC
- { CTL_PROC, "CTL_PROC" },
-+#endif
- { CTL_FS, "CTL_FS" },
- { CTL_DEBUG, "CTL_DEBUG" },
- { CTL_DEV, "CTL_DEV" },
diff --git a/patches/strace/4.5.15/180-undef-PACKET_MEMBERSHIP.patch b/patches/strace/4.5.15/180-undef-PACKET_MEMBERSHIP.patch
deleted file mode 100644
index d7a100e..0000000
--- a/patches/strace/4.5.15/180-undef-PACKET_MEMBERSHIP.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -dur strace-4.5.15.orig/net.c strace-4.5.15/net.c
---- strace-4.5.15.orig/net.c 2006-12-13 20:57:23.000000000 +0100
-+++ strace-4.5.15/net.c 2007-07-14 19:29:36.000000000 +0200
-@@ -800,8 +800,12 @@
-
- #ifdef SOL_PACKET
- static const struct xlat sockpacketoptions[] = {
-+#if defined(PACKET_ADD_MEMBERSHIP)
- { PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" },
-+#endif
-+#if defined(PACKET_DROP_MEMBERSHIP)
- { PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"},
-+#endif
- #if defined(PACKET_RECV_OUTPUT)
- { PACKET_RECV_OUTPUT, "PACKET_RECV_OUTPUT" },
- #endif
diff --git a/patches/strace/4.5.15/190-undef-syscall.patch b/patches/strace/4.5.15/190-undef-syscall.patch
deleted file mode 100644
index 7123f04..0000000
--- a/patches/strace/4.5.15/190-undef-syscall.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h
---- strace-4.5.15.orig/linux/syscallent.h 2006-10-16 03:17:52.000000000 +0200
-+++ strace-4.5.15/linux/syscallent.h 2007-07-14 19:30:16.000000000 +0200
-@@ -130,7 +130,11 @@
- { 2, TF, sys_statfs, "statfs" }, /* 99 */
- { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */
- { 3, 0, sys_ioperm, "ioperm" }, /* 101 */
-- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */
-+ { 2, TD, sys_socketcall, "socketcall"
-+#ifdef __NR_socketcall
-+ , SYS_socketcall
-+#endif
-+ }, /* 102 */
- { 3, 0, sys_syslog, "syslog" }, /* 103 */
- { 3, 0, sys_setitimer, "setitimer" }, /* 104 */
- { 2, 0, sys_getitimer, "getitimer" }, /* 105 */
-@@ -145,7 +149,11 @@
- { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */
- { 1, 0, sys_swapoff, "swapoff" }, /* 115 */
- { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */
-- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */
-+ { 6, 0, sys_ipc, "ipc"
-+#ifdef __NR_ipc
-+ , SYS_ipc
-+#endif
-+ }, /* 117 */
- { 1, TD, sys_fsync, "fsync" }, /* 118 */
- { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */
- { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */
-@@ -282,7 +290,11 @@
- { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */
- { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */
- { 5, 0, printargs, "SYS_251" }, /* 251 */
-- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */
-+ { 1, TP, sys_exit, "exit_group"
-+#ifdef __NR_exit_group
-+ , __NR_exit_group
-+#endif
-+ }, /* 252 */
- { 4, 0, printargs, "lookup_dcookie"}, /* 253 */
- { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */
- { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */
-diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
---- strace-4.5.15.orig/syscall.c 2007-07-14 19:22:49.000000000 +0200
-+++ strace-4.5.15/syscall.c 2007-07-14 19:30:16.000000000 +0200
-@@ -2404,14 +2404,18 @@
- switch (known_scno(tcp)) {
- #ifdef LINUX
- #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
-+#ifdef __NR_socketcall
- case SYS_socketcall:
- decode_subcall(tcp, SYS_socket_subcall,
- SYS_socket_nsubcalls, deref_style);
- break;
-+#endif
-+#ifdef __NR_ipc
- case SYS_ipc:
- decode_subcall(tcp, SYS_ipc_subcall,
- SYS_ipc_nsubcalls, shift_style);
- break;
-+#endif
- #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
- #if defined (SPARC) || defined (SPARC64)
- case SYS_socketcall:
diff --git a/patches/strace/4.5.16/100-autoreconf.patch b/patches/strace/4.5.16/100-autoreconf.patch
deleted file mode 100644
index 666ef43..0000000
--- a/patches/strace/4.5.16/100-autoreconf.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure
---- strace-4.5.16.orig/configure 2007-01-11 23:23:33.000000000 +0100
-+++ strace-4.5.16/configure 2007-07-14 19:18:43.000000000 +0200
-@@ -5808,6 +5777,73 @@
-
- fi
-
-+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
-+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
-+if test "${ac_cv_type_statfs64+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+#ifdef LINUX
-+#include <linux/types.h>
-+#include <sys/statfs.h>
-+#else
-+#include <sys/vfs.h>
-+#endif
-+int
-+main ()
-+{
-+struct statfs64 st;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_type_statfs64=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_type_statfs64=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+
-+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
-+echo "${ECHO_T}$ac_cv_type_statfs64" >&6
-+if test "$ac_cv_type_statfs64" = yes
-+then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STATFS64 1
-+_ACEOF
-+
-+fi
-+
-
- { echo "$as_me:$LINENO: checking return type of signal handlers" >&5
- echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
diff --git a/patches/strace/4.5.16/110-dont-use-REG_SYSCALL-for-sh.patch b/patches/strace/4.5.16/110-dont-use-REG_SYSCALL-for-sh.patch
deleted file mode 100644
index ebbf69a..0000000
--- a/patches/strace/4.5.16/110-dont-use-REG_SYSCALL-for-sh.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c
---- strace-4.5.16.orig/process.c 2007-01-11 23:08:38.000000000 +0100
-+++ strace-4.5.16/process.c 2007-07-14 19:19:58.000000000 +0200
-@@ -2685,7 +2685,6 @@
- { 4*REG_GBR, "4*REG_GBR" },
- { 4*REG_MACH, "4*REG_MACH" },
- { 4*REG_MACL, "4*REG_MACL" },
-- { 4*REG_SYSCALL, "4*REG_SYSCALL" },
- { 4*REG_FPUL, "4*REG_FPUL" },
- { 4*REG_FPREG0, "4*REG_FPREG0" },
- { 4*(REG_FPREG0+1), "4*REG_FPREG1" },
diff --git a/patches/strace/4.5.16/120-fix-arm-bad-syscall.patch b/patches/strace/4.5.16/120-fix-arm-bad-syscall.patch
deleted file mode 100644
index d31b9da..0000000
--- a/patches/strace/4.5.16/120-fix-arm-bad-syscall.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
---- strace-4.5.16.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100
-+++ strace-4.5.16/syscall.c 2007-07-14 19:21:44.000000000 +0200
-@@ -1045,6 +1045,15 @@
- /*
- * Note: we only deal with only 32-bit CPUs here.
- */
-+
-+ if (!(tcp->flags & TCB_INSYSCALL) &&
-+ (tcp->flags & TCB_WAITEXECVE)) {
-+ /* caught a fake syscall from the execve's exit */
-+ tcp->flags &= ~TCB_WAITEXECVE;
-+ return 0;
-+ }
-+
-+
- if (regs.ARM_cpsr & 0x20) {
- /*
- * Get the Thumb-mode system call number
diff --git a/patches/strace/4.5.16/130-fix-disabled-largefile-syscalls.patch b/patches/strace/4.5.16/130-fix-disabled-largefile-syscalls.patch
deleted file mode 100644
index 2f47dc9..0000000
--- a/patches/strace/4.5.16/130-fix-disabled-largefile-syscalls.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
---- strace-4.5.16.orig/syscall.c 2007-07-14 19:21:44.000000000 +0200
-+++ strace-4.5.16/syscall.c 2007-07-14 19:22:49.000000000 +0200
-@@ -125,6 +125,18 @@
- #define TP TRACE_PROCESS
- #define TS TRACE_SIGNAL
-
-+#ifndef HAVE_STATFS64
-+/*
-+ * Ugly hacks for systems that do not have LFS
-+ */
-+
-+#define sys_truncate64 sys_truncate
-+#define sys_ftruncate64 sys_ftruncate
-+#define sys_getdents64 sys_getdents
-+#define sys_statfs64 sys_statfs
-+#define sys_fstatfs64 sys_fstatfs
-+#endif
-+
- static const struct sysent sysent0[] = {
- #include "syscallent.h"
- };
diff --git a/patches/strace/4.5.16/140-statfs64-check.patch b/patches/strace/4.5.16/140-statfs64-check.patch
deleted file mode 100644
index 758966b..0000000
--- a/patches/strace/4.5.16/140-statfs64-check.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
---- strace-4.5.16.orig/acinclude.m4 2004-04-14 04:21:01.000000000 +0200
-+++ strace-4.5.16/acinclude.m4 2007-07-14 19:25:25.000000000 +0200
-@@ -210,6 +210,26 @@
- fi
- ])
-
-+dnl ### A macro to determine whether statfs64 is defined.
-+AC_DEFUN([AC_STATFS64],
-+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
-+AC_CACHE_VAL(ac_cv_type_statfs64,
-+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
-+#include <linux/types.h>
-+#include <sys/statfs.h>
-+#else
-+#include <sys/vfs.h>
-+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
-+AC_MSG_RESULT($ac_cv_type_statfs64)
-+if test "$ac_cv_type_statfs64" = yes
-+then
-+ AC_DEFINE([HAVE_STATFS64], 1,
-+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
-+fi
-+])
-+
-+
-+
- dnl ### A macro to determine if off_t is a long long
- AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
- [AC_MSG_CHECKING(for long long off_t)
-diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
---- strace-4.5.16.orig/configure.ac 2007-01-11 12:37:55.000000000 +0100
-+++ strace-4.5.16/configure.ac 2007-07-14 19:25:25.000000000 +0200
-@@ -169,6 +169,7 @@
- struct stat.st_level,
- struct stat.st_rdev])
- AC_STAT64
-+AC_STATFS64
-
- AC_TYPE_SIGNAL
- AC_TYPE_UID_T
-diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c
---- strace-4.5.16.orig/file.c 2007-01-15 21:25:52.000000000 +0100
-+++ strace-4.5.16/file.c 2007-07-14 19:25:25.000000000 +0200
-@@ -1636,7 +1636,7 @@
- return 0;
- }
-
--#ifdef LINUX
-+#ifdef HAVE_STATFS64
- static void
- printstatfs64(tcp, addr)
- struct tcb *tcp;
diff --git a/patches/strace/4.5.16/150-superh-update.ac.patch b/patches/strace/4.5.16/150-superh-update.ac.patch
deleted file mode 100644
index 4129315..0000000
--- a/patches/strace/4.5.16/150-superh-update.ac.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
---- strace-4.5.16.orig/configure.ac 2007-07-14 19:25:25.000000000 +0200
-+++ strace-4.5.16/configure.ac 2007-07-14 19:27:35.000000000 +0200
-@@ -91,14 +91,14 @@
- arch=hppa
- AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
- ;;
--sh)
-- arch=sh
-- AC_DEFINE([SH], 1, [Define for the SH architecture.])
-- ;;
- sh64)
- arch=sh64
- AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
- ;;
-+sh*)
-+ arch=sh
-+ AC_DEFINE([SH], 1, [Define for the SH architecture.])
-+ ;;
- x86?64*)
- arch=x86_64
- AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
diff --git a/patches/strace/4.5.16/160-undef-CTL_PROC.patch b/patches/strace/4.5.16/160-undef-CTL_PROC.patch
deleted file mode 100644
index 9bbd78c..0000000
--- a/patches/strace/4.5.16/160-undef-CTL_PROC.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c
---- strace-4.5.16.orig/system.c 2007-01-17 00:22:36.000000000 +0100
-+++ strace-4.5.16/system.c 2007-07-14 19:28:41.000000000 +0200
-@@ -1612,7 +1612,9 @@
- { CTL_KERN, "CTL_KERN" },
- { CTL_VM, "CTL_VM" },
- { CTL_NET, "CTL_NET" },
-+#ifdef CTL_PROC
- { CTL_PROC, "CTL_PROC" },
-+#endif
- { CTL_FS, "CTL_FS" },
- { CTL_DEBUG, "CTL_DEBUG" },
- { CTL_DEV, "CTL_DEV" },
diff --git a/patches/strace/4.5.16/170-undef-PACKET_MEMBERSHIP.patch b/patches/strace/4.5.16/170-undef-PACKET_MEMBERSHIP.patch
deleted file mode 100644
index 3098f80..0000000
--- a/patches/strace/4.5.16/170-undef-PACKET_MEMBERSHIP.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -dur strace-4.5.16.orig/net.c strace-4.5.16/net.c
---- strace-4.5.16.orig/net.c 2006-12-13 20:57:23.000000000 +0100
-+++ strace-4.5.16/net.c 2007-07-14 19:29:36.000000000 +0200
-@@ -800,8 +800,12 @@
-
- #ifdef SOL_PACKET
- static const struct xlat sockpacketoptions[] = {
-+#if defined(PACKET_ADD_MEMBERSHIP)
- { PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" },
-+#endif
-+#if defined(PACKET_DROP_MEMBERSHIP)
- { PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"},
-+#endif
- #if defined(PACKET_RECV_OUTPUT)
- { PACKET_RECV_OUTPUT, "PACKET_RECV_OUTPUT" },
- #endif
diff --git a/patches/strace/4.5.16/180-undef-syscall.patch b/patches/strace/4.5.16/180-undef-syscall.patch
deleted file mode 100644
index 6194429..0000000
--- a/patches/strace/4.5.16/180-undef-syscall.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h
---- strace-4.5.16.orig/linux/syscallent.h 2006-10-16 03:17:52.000000000 +0200
-+++ strace-4.5.16/linux/syscallent.h 2007-07-14 19:30:16.000000000 +0200
-@@ -130,7 +130,11 @@
- { 2, TF, sys_statfs, "statfs" }, /* 99 */
- { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */
- { 3, 0, sys_ioperm, "ioperm" }, /* 101 */
-- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */
-+ { 2, TD, sys_socketcall, "socketcall"
-+#ifdef __NR_socketcall
-+ , SYS_socketcall
-+#endif
-+ }, /* 102 */
- { 3, 0, sys_syslog, "syslog" }, /* 103 */
- { 3, 0, sys_setitimer, "setitimer" }, /* 104 */
- { 2, 0, sys_getitimer, "getitimer" }, /* 105 */
-@@ -145,7 +149,11 @@
- { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */
- { 1, 0, sys_swapoff, "swapoff" }, /* 115 */
- { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */
-- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */
-+ { 6, 0, sys_ipc, "ipc"
-+#ifdef __NR_ipc
-+ , SYS_ipc
-+#endif
-+ }, /* 117 */
- { 1, TD, sys_fsync, "fsync" }, /* 118 */
- { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */
- { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */
-@@ -282,7 +290,11 @@
- { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */
- { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */
- { 5, 0, printargs, "SYS_251" }, /* 251 */
-- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */
-+ { 1, TP, sys_exit, "exit_group"
-+#ifdef __NR_exit_group
-+ , __NR_exit_group
-+#endif
-+ }, /* 252 */
- { 4, 0, printargs, "lookup_dcookie"}, /* 253 */
- { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */
- { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */
-diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
---- strace-4.5.16.orig/syscall.c 2007-07-14 19:22:49.000000000 +0200
-+++ strace-4.5.16/syscall.c 2007-07-14 19:30:16.000000000 +0200
-@@ -2383,14 +2383,18 @@
- switch (known_scno(tcp)) {
- #ifdef LINUX
- #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
-+#ifdef __NR_socketcall
- case SYS_socketcall:
- decode_subcall(tcp, SYS_socket_subcall,
- SYS_socket_nsubcalls, deref_style);
- break;
-+#endif
-+#ifdef __NR_ipc
- case SYS_ipc:
- decode_subcall(tcp, SYS_ipc_subcall,
- SYS_ipc_nsubcalls, shift_style);
- break;
-+#endif
- #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
- #if defined (SPARC) || defined (SPARC64)
- case SYS_socketcall:
diff --git a/patches/strace/4.5.17/100-autoreconf.patch b/patches/strace/4.5.17/100-autoreconf.patch
deleted file mode 100644
index 5228d32..0000000
--- a/patches/strace/4.5.17/100-autoreconf.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/100-autoreconf.patch
--= BEGIN original header =-
-diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure
--= END original header =-
-diff -durN strace-4.5.17.orig/configure strace-4.5.17/configure
---- strace-4.5.17.orig/configure 2008-07-22 02:43:21.000000000 +0200
-+++ strace-4.5.17/configure 2008-10-24 21:30:13.000000000 +0200
-@@ -5808,6 +5808,73 @@
-
- fi
-
-+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
-+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
-+if test "${ac_cv_type_statfs64+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+#ifdef LINUX
-+#include <linux/types.h>
-+#include <sys/statfs.h>
-+#else
-+#include <sys/vfs.h>
-+#endif
-+int
-+main ()
-+{
-+struct statfs64 st;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_type_statfs64=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_type_statfs64=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+
-+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
-+echo "${ECHO_T}$ac_cv_type_statfs64" >&6
-+if test "$ac_cv_type_statfs64" = yes
-+then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STATFS64 1
-+_ACEOF
-+
-+fi
-+
-
- { echo "$as_me:$LINENO: checking return type of signal handlers" >&5
- echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
diff --git a/patches/strace/4.5.17/110-dont-use-REG_SYSCALL-for-sh.patch b/patches/strace/4.5.17/110-dont-use-REG_SYSCALL-for-sh.patch
deleted file mode 100644
index 4310766..0000000
--- a/patches/strace/4.5.17/110-dont-use-REG_SYSCALL-for-sh.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/110-dont-use-REG_SYSCALL-for-sh.patch
--= BEGIN original header =-
-diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c
--= END original header =-
-diff -durN strace-4.5.17.orig/process.c strace-4.5.17/process.c
---- strace-4.5.17.orig/process.c 2008-07-18 04:16:47.000000000 +0200
-+++ strace-4.5.17/process.c 2008-10-24 21:30:13.000000000 +0200
-@@ -2726,7 +2726,6 @@
- { 4*REG_GBR, "4*REG_GBR" },
- { 4*REG_MACH, "4*REG_MACH" },
- { 4*REG_MACL, "4*REG_MACL" },
-- { 4*REG_SYSCALL, "4*REG_SYSCALL" },
- { 4*REG_FPUL, "4*REG_FPUL" },
- { 4*REG_FPREG0, "4*REG_FPREG0" },
- { 4*(REG_FPREG0+1), "4*REG_FPREG1" },
diff --git a/patches/strace/4.5.17/120-fix-arm-bad-syscall.patch b/patches/strace/4.5.17/120-fix-arm-bad-syscall.patch
deleted file mode 100644
index a5ecaef..0000000
--- a/patches/strace/4.5.17/120-fix-arm-bad-syscall.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/120-fix-arm-bad-syscall.patch
--= BEGIN original header =-
-diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
--= END original header =-
-diff -durN strace-4.5.17.orig/syscall.c strace-4.5.17/syscall.c
---- strace-4.5.17.orig/syscall.c 2008-05-28 01:18:29.000000000 +0200
-+++ strace-4.5.17/syscall.c 2008-10-24 21:30:13.000000000 +0200
-@@ -1016,6 +1016,15 @@
- /*
- * Note: we only deal with only 32-bit CPUs here.
- */
-+
-+ if (!(tcp->flags & TCB_INSYSCALL) &&
-+ (tcp->flags & TCB_WAITEXECVE)) {
-+ /* caught a fake syscall from the execve's exit */
-+ tcp->flags &= ~TCB_WAITEXECVE;
-+ return 0;
-+ }
-+
-+
- if (regs.ARM_cpsr & 0x20) {
- /*
- * Get the Thumb-mode system call number
diff --git a/patches/strace/4.5.17/130-fix-disabled-largefile-syscalls.patch b/patches/strace/4.5.17/130-fix-disabled-largefile-syscalls.patch
deleted file mode 100644
index ef3808e..0000000
--- a/patches/strace/4.5.17/130-fix-disabled-largefile-syscalls.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/130-fix-disabled-largefile-syscalls.patch
--= BEGIN original header =-
-diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
--= END original header =-
-diff -durN strace-4.5.17.orig/syscall.c strace-4.5.17/syscall.c
---- strace-4.5.17.orig/syscall.c 2008-10-24 21:30:13.000000000 +0200
-+++ strace-4.5.17/syscall.c 2008-10-24 21:30:13.000000000 +0200
-@@ -125,6 +125,18 @@
- #define TP TRACE_PROCESS
- #define TS TRACE_SIGNAL
-
-+#ifndef HAVE_STATFS64
-+/*
-+ * Ugly hacks for systems that do not have LFS
-+ */
-+
-+#define sys_truncate64 sys_truncate
-+#define sys_ftruncate64 sys_ftruncate
-+#define sys_getdents64 sys_getdents
-+#define sys_statfs64 sys_statfs
-+#define sys_fstatfs64 sys_fstatfs
-+#endif
-+
- static const struct sysent sysent0[] = {
- #include "syscallent.h"
- };
diff --git a/patches/strace/4.5.17/140-statfs64-check.patch b/patches/strace/4.5.17/140-statfs64-check.patch
deleted file mode 100644
index 3fa0824..0000000
--- a/patches/strace/4.5.17/140-statfs64-check.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/140-statfs64-check.patch
--= BEGIN original header =-
-diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
--= END original header =-
-diff -durN strace-4.5.17.orig/acinclude.m4 strace-4.5.17/acinclude.m4
---- strace-4.5.17.orig/acinclude.m4 2004-04-14 04:21:01.000000000 +0200
-+++ strace-4.5.17/acinclude.m4 2008-10-24 21:30:13.000000000 +0200
-@@ -210,6 +210,26 @@
- fi
- ])
-
-+dnl ### A macro to determine whether statfs64 is defined.
-+AC_DEFUN([AC_STATFS64],
-+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
-+AC_CACHE_VAL(ac_cv_type_statfs64,
-+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
-+#include <linux/types.h>
-+#include <sys/statfs.h>
-+#else
-+#include <sys/vfs.h>
-+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
-+AC_MSG_RESULT($ac_cv_type_statfs64)
-+if test "$ac_cv_type_statfs64" = yes
-+then
-+ AC_DEFINE([HAVE_STATFS64], 1,
-+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
-+fi
-+])
-+
-+
-+
- dnl ### A macro to determine if off_t is a long long
- AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
- [AC_MSG_CHECKING(for long long off_t)
-diff -durN strace-4.5.17.orig/configure.ac strace-4.5.17/configure.ac
---- strace-4.5.17.orig/configure.ac 2008-07-22 02:42:29.000000000 +0200
-+++ strace-4.5.17/configure.ac 2008-10-24 21:30:13.000000000 +0200
-@@ -169,6 +169,7 @@
- struct stat.st_level,
- struct stat.st_rdev])
- AC_STAT64
-+AC_STATFS64
-
- AC_TYPE_SIGNAL
- AC_TYPE_UID_T
-diff -durN strace-4.5.17.orig/file.c strace-4.5.17/file.c
---- strace-4.5.17.orig/file.c 2008-05-20 06:56:18.000000000 +0200
-+++ strace-4.5.17/file.c 2008-10-24 21:30:13.000000000 +0200
-@@ -1703,7 +1703,7 @@
- return 0;
- }
-
--#ifdef LINUX
-+#ifdef HAVE_STATFS64
- static void
- printstatfs64(tcp, addr)
- struct tcb *tcp;
diff --git a/patches/strace/4.5.17/150-undef-CTL_PROC.patch b/patches/strace/4.5.17/150-undef-CTL_PROC.patch
deleted file mode 100644
index 1ce816c..0000000
--- a/patches/strace/4.5.17/150-undef-CTL_PROC.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/150-undef-CTL_PROC.patch
--= BEGIN original header =-
-diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c
--= END original header =-
-diff -durN strace-4.5.17.orig/system.c strace-4.5.17/system.c
---- strace-4.5.17.orig/system.c 2007-01-17 00:22:36.000000000 +0100
-+++ strace-4.5.17/system.c 2008-10-24 21:30:13.000000000 +0200
-@@ -1612,7 +1612,9 @@
- { CTL_KERN, "CTL_KERN" },
- { CTL_VM, "CTL_VM" },
- { CTL_NET, "CTL_NET" },
-+#ifdef CTL_PROC
- { CTL_PROC, "CTL_PROC" },
-+#endif
- { CTL_FS, "CTL_FS" },
- { CTL_DEBUG, "CTL_DEBUG" },
- { CTL_DEV, "CTL_DEV" },
diff --git a/patches/strace/4.5.17/160-undef-syscall.patch b/patches/strace/4.5.17/160-undef-syscall.patch
deleted file mode 100644
index 1d8ebd9..0000000
--- a/patches/strace/4.5.17/160-undef-syscall.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/160-undef-syscall.patch
--= BEGIN original header =-
-diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h
--= END original header =-
-diff -durN strace-4.5.17.orig/linux/syscallent.h strace-4.5.17/linux/syscallent.h
---- strace-4.5.17.orig/linux/syscallent.h 2008-07-18 03:23:49.000000000 +0200
-+++ strace-4.5.17/linux/syscallent.h 2008-10-24 21:30:13.000000000 +0200
-@@ -130,7 +130,11 @@
- { 2, TF, sys_statfs, "statfs" }, /* 99 */
- { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */
- { 3, 0, sys_ioperm, "ioperm" }, /* 101 */
-- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */
-+ { 2, TD, sys_socketcall, "socketcall"
-+#ifdef __NR_socketcall
-+ , SYS_socketcall
-+#endif
-+ }, /* 102 */
- { 3, 0, sys_syslog, "syslog" }, /* 103 */
- { 3, 0, sys_setitimer, "setitimer" }, /* 104 */
- { 2, 0, sys_getitimer, "getitimer" }, /* 105 */
-@@ -145,7 +149,11 @@
- { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */
- { 1, 0, sys_swapoff, "swapoff" }, /* 115 */
- { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */
-- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */
-+ { 6, 0, sys_ipc, "ipc"
-+#ifdef __NR_ipc
-+ , SYS_ipc
-+#endif
-+ }, /* 117 */
- { 1, TD, sys_fsync, "fsync" }, /* 118 */
- { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */
- { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */
-@@ -282,7 +290,11 @@
- { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */
- { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */
- { 5, 0, printargs, "SYS_251" }, /* 251 */
-- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */
-+ { 1, TP, sys_exit, "exit_group"
-+#ifdef __NR_exit_group
-+ , __NR_exit_group
-+#endif
-+ }, /* 252 */
- { 4, 0, printargs, "lookup_dcookie"}, /* 253 */
- { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */
- { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */
-diff -durN strace-4.5.17.orig/syscall.c strace-4.5.17/syscall.c
---- strace-4.5.17.orig/syscall.c 2008-10-24 21:30:13.000000000 +0200
-+++ strace-4.5.17/syscall.c 2008-10-24 21:30:13.000000000 +0200
-@@ -2452,14 +2452,18 @@
- switch (known_scno(tcp)) {
- #ifdef LINUX
- #if !defined (ALPHA) && !defined(MIPS) && !defined(HPPA)
-+#ifdef __NR_socketcall
- case SYS_socketcall:
- decode_subcall(tcp, SYS_socket_subcall,
- SYS_socket_nsubcalls, deref_style);
- break;
-+#endif
-+#ifdef __NR_ipc
- case SYS_ipc:
- decode_subcall(tcp, SYS_ipc_subcall,
- SYS_ipc_nsubcalls, shift_style);
- break;
-+#endif
- #endif /* !(ALPHA || MIPS || HPPA) */
- #endif /* LINUX */
- #ifdef SVR4
diff --git a/patches/strace/4.5.17/170-arm-syscalls.patch b/patches/strace/4.5.17/170-arm-syscalls.patch
deleted file mode 100644
index f3af80d..0000000
--- a/patches/strace/4.5.17/170-arm-syscalls.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Original patch from gentoo: ../../dev/crosstool-NG/ct-ng.trunk/patches/strace/4.5.17/170-arm-syscalls.patch
--= BEGIN original header =-
-Author: Michael Abbott <michael.abbott@diamond.ac.uk>
-Date: Wed Oct 22 08:53:42 2008 +0100
-
- Syscall patch for ARM
- Patch mailed to strace mailing list by Anderson Lizardo, work by
- Bruna Moreira, dated 2008-01-25. Patch cleaned up against 4.5.17 release.
-
-diff --git a/linux/arm/errnoent1.h b/linux/arm/errnoent1.h
-new file mode 100644
-index 0000000..a894827
--= END original header =-
-diff -durN b/linux/arm/errnoent1.h b/linux/arm/errnoent1.h
---- b/linux/arm/errnoent1.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/linux/arm/errnoent1.h 2008-10-24 21:30:13.000000000 +0200
-@@ -0,0 +1,2 @@
-+/* Our second set comes from the i386 files. */
-+#include "../errnoent.h"
-diff -durN b/linux/arm/ioctlent1.h b/linux/arm/ioctlent1.h
---- b/linux/arm/ioctlent1.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/linux/arm/ioctlent1.h 2008-10-24 21:30:13.000000000 +0200
-@@ -0,0 +1,2 @@
-+/* Our second set comes from the i386 files. */
-+#include "../ioctlent.h"
-diff -durN b/linux/arm/signalent1.h b/linux/arm/signalent1.h
---- b/linux/arm/signalent1.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/linux/arm/signalent1.h 2008-10-24 21:30:13.000000000 +0200
-@@ -0,0 +1,2 @@
-+/* Our second set comes from the i386 files. */
-+#include "../signalent.h"
-diff -durN b/linux/arm/syscallent1.h b/linux/arm/syscallent1.h
---- b/linux/arm/syscallent1.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/linux/arm/syscallent1.h 2008-10-24 21:30:13.000000000 +0200
-@@ -0,0 +1,7 @@
-+/* ARM specific syscalls */
-+ { 5, 0, printargs, "SYS_0" }, /* 0 */
-+ { 5, 0, printargs, "breakpoint" }, /* 1 */
-+ { 5, 0, printargs, "cacheflush" }, /* 2 */
-+ { 5, 0, printargs, "usr26" }, /* 3 */
-+ { 5, 0, printargs, "usr32" }, /* 4 */
-+ { 5, 0, printargs, "set_tls" }, /* 5 */
diff --git a/patches/strace/4.5.17/180-no_cachectl.patch b/patches/strace/4.5.17/180-no_cachectl.patch
deleted file mode 100644
index 7fe946b..0000000
--- a/patches/strace/4.5.17/180-no_cachectl.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-This patch is needed on newer uclibc becuase the uclibc header generation
-mechanism generates the sysnum.h properly NR_cacheflush is defined for ARM
-but there is no cachectl.h file which is exported to userspace. Strace
-assumes that if SYS_cacheflush is defined than it icludes asm/cachectl.h
-which breaks the build for ARM now.
-
-This patch adds a check for ARM architecture.
-
--Khem
-
-Here is error
-
-| if ccache arm-angstrom-linux-uclibcgnueabi-gcc -march=armv5te -mtune=arm926ej-s -DHAVE_CONFIG_H -I. -I. -I. -Ilinux/arm -I./linux/arm -Ilinux -I./linux -isystem/home/kraj/work/oe/build/uclibc/tmp-omap5912osk/staging/arm-angstrom-linux-uclibcgnueabi/usr/include -Wall -isystem/home/kraj/work/oe/build/uclibc/tmp-omap5912osk/staging/arm-angstrom-linux-uclibcgnueabi/usr/include -fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -MT term.o -MD -MP -MF ".deps/term.Tpo" -c -o term.o term.c; \
-| then mv -f ".deps/term.Tpo" ".deps/term.Po"; else rm -f ".deps/term.Tpo"; exit 1; fi
-| system.c:69:26: error: asm/cachectl.h: No such file or directory
-| make[1]: *** [system.o] Error 1
-| make[1]: *** Waiting for unfinished jobs....
-| signal.c: In function 'sys_sigreturn':
-| signal.c:1221: warning: passing argument 4 of 'ptrace' makes integer from pointer without a cast
-| make[1]: Leaving directory `/home/kraj/work/oe/build/uclibc/tmp-omap5912osk/work/armv5te-angstrom-linux-uclibcgnueabi/strace-4.5.14-r5/strace-4.5.14'
-| make: *** [all] Error 2
-| FATAL: oe_runmake failed
-
-Index: strace-4.5.14/system.c
-===================================================================
---- strace-4.5.14.orig/system.c 2008-05-15 20:23:16.000000000 -0700
-+++ strace-4.5.14/system.c 2008-05-15 20:24:03.000000000 -0700
-@@ -70,7 +70,7 @@
- #include <linux/capability.h>
- #endif
-
--#ifdef SYS_cacheflush
-+#if defined SYS_cacheflush && !defined ARM
- #include <asm/cachectl.h>
- #endif
diff --git a/patches/strace/4.5.17/190-dirent-include.patch b/patches/strace/4.5.17/190-dirent-include.patch
deleted file mode 100644
index 5f596e1..0000000
--- a/patches/strace/4.5.17/190-dirent-include.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- strace-orig/file.c 2008/05/20 04:56:18 1.92
-+++ strace/file.c 2008/08/01 01:13:10 1.93
-@@ -28,21 +28,22 @@
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
-- * $Id: file.c,v 1.92 2008/05/20 04:56:18 roland Exp $
-+ * $Id: file.c,v 1.93 2008/08/01 01:13:10 roland Exp $
- */
-
- #include "defs.h"
-
- #include <dirent.h>
-+
- #ifdef LINUX
--#define dirent kernel_dirent
--#define dirent64 kernel_dirent64
--#include <linux/types.h>
--#include <linux/dirent.h>
--#undef dirent
--#undef dirent64
-+struct kernel_dirent {
-+ unsigned long d_ino;
-+ unsigned long d_off;
-+ unsigned short d_reclen;
-+ char d_name[1];
-+};
- #else
--#define kernel_dirent dirent
-+# define kernel_dirent dirent
- #endif
-
- #ifdef LINUX
diff --git a/patches/strace/4.5.18/120-fix-arm-bad-syscall.patch b/patches/strace/4.5.18/120-fix-arm-bad-syscall.patch
deleted file mode 100644
index d31b9da..0000000
--- a/patches/strace/4.5.18/120-fix-arm-bad-syscall.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
---- strace-4.5.16.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100
-+++ strace-4.5.16/syscall.c 2007-07-14 19:21:44.000000000 +0200
-@@ -1045,6 +1045,15 @@
- /*
- * Note: we only deal with only 32-bit CPUs here.
- */
-+
-+ if (!(tcp->flags & TCB_INSYSCALL) &&
-+ (tcp->flags & TCB_WAITEXECVE)) {
-+ /* caught a fake syscall from the execve's exit */
-+ tcp->flags &= ~TCB_WAITEXECVE;
-+ return 0;
-+ }
-+
-+
- if (regs.ARM_cpsr & 0x20) {
- /*
- * Get the Thumb-mode system call number
diff --git a/patches/strace/4.5.18/150-undef-CTL_PROC.patch b/patches/strace/4.5.18/150-undef-CTL_PROC.patch
deleted file mode 100644
index 9bbd78c..0000000
--- a/patches/strace/4.5.18/150-undef-CTL_PROC.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c
---- strace-4.5.16.orig/system.c 2007-01-17 00:22:36.000000000 +0100
-+++ strace-4.5.16/system.c 2007-07-14 19:28:41.000000000 +0200
-@@ -1612,7 +1612,9 @@
- { CTL_KERN, "CTL_KERN" },
- { CTL_VM, "CTL_VM" },
- { CTL_NET, "CTL_NET" },
-+#ifdef CTL_PROC
- { CTL_PROC, "CTL_PROC" },
-+#endif
- { CTL_FS, "CTL_FS" },
- { CTL_DEBUG, "CTL_DEBUG" },
- { CTL_DEV, "CTL_DEV" },
diff --git a/patches/strace/4.5.18/160-fix-check-for-linux-netlink.patch b/patches/strace/4.5.18/160-fix-check-for-linux-netlink.patch
new file mode 100644
index 0000000..e12b4e4
--- /dev/null
+++ b/patches/strace/4.5.18/160-fix-check-for-linux-netlink.patch
@@ -0,0 +1,19 @@
+Dmitry V. Levin [Tue, 3 Nov 2009 16:49:49 +0000]
+
+Fix check for linux/netlink.h on Linux 2.6.32-rc5+
+
+* configure.ac (AC_CHECK_HEADERS): In check for linux/netlink.h, include
+ sys/socket.h instead of linux/socket.h beforehand.
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -197,7 +197,7 @@ AC_CHECK_HEADERS([ \
+ ], [], [])
+ AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
+ [], [], [#include <stddef.h>
+-#include <linux/socket.h>])
++#include <sys/socket.h>])
+ AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
+ AC_CHECK_TYPES([struct sigcontext_struct],,, [#include <signal.h>])
+ AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
diff --git a/patches/strace/4.5.18/100-autoreconf.patch b/patches/strace/4.5.18/900-autoreconf.patch
index 666ef43..cff775f 100644
--- a/patches/strace/4.5.18/100-autoreconf.patch
+++ b/patches/strace/4.5.18/900-autoreconf.patch
@@ -1,7 +1,20 @@
+diff -ruN strace-4.5.19.orig/config.h.in strace-4.5.19/config.h.in
+--- strace-4.5.19.orig/config.h.in 2009-10-21 19:41:12.000000000 +0200
++++ strace-4.5.19/config.h.in 2010-01-01 10:39:36.000000000 +0100
+@@ -143,6 +143,9 @@
+ /* Define if stat64 is available in asm/stat.h. */
+ #undef HAVE_STAT64
+
++/* Define if statfs64 is available in sys/statfs.h or sys/vfs.h. */
++#undef HAVE_STATFS64
++
+ /* Define to 1 if stdbool.h conforms to C99. */
+ #undef HAVE_STDBOOL_H
+
diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure
--- strace-4.5.16.orig/configure 2007-01-11 23:23:33.000000000 +0100
+++ strace-4.5.16/configure 2007-07-14 19:18:43.000000000 +0200
-@@ -5808,6 +5777,73 @@
+@@ -5994,6 +5994,73 @@
fi
@@ -72,6 +85,15 @@ diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure
+
+fi
+
-
+
{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
+@@ -7580,7 +7647,7 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <stddef.h>
+-#include <linux/socket.h>
++#include <sys/socket.h>
+
+ #include <$ac_header>
+ _ACEOF
diff --git a/patches/strace/4.5.19/100-autoreconf.patch b/patches/strace/4.5.19/100-autoreconf.patch
deleted file mode 100644
index e7972db..0000000
--- a/patches/strace/4.5.19/100-autoreconf.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-diff -durN strace-4.5.19.orig/configure strace-4.5.19/configure
---- strace-4.5.19.orig/configure 2009-10-21 19:41:11.000000000 +0200
-+++ strace-4.5.19/configure 2009-10-28 18:47:18.000000000 +0100
-@@ -5773,6 +5773,73 @@
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
-+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
-+if test "${ac_cv_type_statfs64+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+#ifdef LINUX
-+#include <linux/types.h>
-+#include <sys/statfs.h>
-+#else
-+#include <sys/vfs.h>
-+#endif
-+int
-+main ()
-+{
-+struct statfs64 st;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_type_statfs64=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_type_statfs64=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+
-+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
-+echo "${ECHO_T}$ac_cv_type_statfs64" >&6
-+if test "$ac_cv_type_statfs64" = yes
-+then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STATFS64 1
-+_ACEOF
-+
-+fi
-+
-
- int
- main ()
diff --git a/patches/strace/4.5.19/110-fix-arm-bad-syscall.patch b/patches/strace/4.5.19/110-fix-arm-bad-syscall.patch
deleted file mode 100644
index 97a60ba..0000000
--- a/patches/strace/4.5.19/110-fix-arm-bad-syscall.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -durN strace-4.5.19.orig/syscall.c strace-4.5.19/syscall.c
---- strace-4.5.19.orig/syscall.c 2009-10-12 21:54:21.000000000 +0200
-+++ strace-4.5.19/syscall.c 2009-10-28 18:47:18.000000000 +0100
-@@ -1022,6 +1022,15 @@
- /*
- * Note: we only deal with only 32-bit CPUs here.
- */
-+
-+ if (!(tcp->flags & TCB_INSYSCALL) &&
-+ (tcp->flags & TCB_WAITEXECVE)) {
-+ /* caught a fake syscall from the execve's exit */
-+ tcp->flags &= ~TCB_WAITEXECVE;
-+ return 0;
-+ }
-+
-+
- if (regs.ARM_cpsr & 0x20) {
- /*
- * Get the Thumb-mode system call number
diff --git a/patches/strace/4.5.19/140-undef-CTL_PROC.patch b/patches/strace/4.5.19/140-undef-CTL_PROC.patch
deleted file mode 100644
index 8284335..0000000
--- a/patches/strace/4.5.19/140-undef-CTL_PROC.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -durN strace-4.5.19.orig/system.c strace-4.5.19/system.c
---- strace-4.5.19.orig/system.c 2009-06-01 11:59:11.000000000 +0200
-+++ strace-4.5.19/system.c 2009-10-28 18:47:18.000000000 +0100
-@@ -1654,7 +1654,9 @@
- { CTL_KERN, "CTL_KERN" },
- { CTL_VM, "CTL_VM" },
- { CTL_NET, "CTL_NET" },
-+#ifdef CTL_PROC
- { CTL_PROC, "CTL_PROC" },
-+#endif
- { CTL_FS, "CTL_FS" },
- { CTL_DEBUG, "CTL_DEBUG" },
- { CTL_DEV, "CTL_DEV" },
diff --git a/patches/strace/4.5.19/170-update-configure.patch b/patches/strace/4.5.19/170-update-configure.patch
index cf90583..5d12276 100644
--- a/patches/strace/4.5.19/170-update-configure.patch
+++ b/patches/strace/4.5.19/170-update-configure.patch
@@ -59,81 +59,7 @@ diff -ruN strace-4.5.19.orig/configure strace-4.5.19/configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
$as_echo_n "checking return type of signal handlers... " >&6; }
-@@ -5773,73 +5811,6 @@
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
--echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
--echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
--if test "${ac_cv_type_statfs64+set}" = set; then
-- echo $ECHO_N "(cached) $ECHO_C" >&6
--else
-- cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h. */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h. */
--#ifdef LINUX
--#include <linux/types.h>
--#include <sys/statfs.h>
--#else
--#include <sys/vfs.h>
--#endif
--int
--main ()
--{
--struct statfs64 st;
-- ;
-- return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-- (eval $ac_compile) 2>conftest.er1
-- ac_status=$?
-- grep -v '^ *+' conftest.er1 >conftest.err
-- rm -f conftest.er1
-- cat conftest.err >&5
-- echo "$as_me:$LINENO: \$? = $ac_status" >&5
-- (exit $ac_status); } &&
-- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-- (eval $ac_try) 2>&5
-- ac_status=$?
-- echo "$as_me:$LINENO: \$? = $ac_status" >&5
-- (exit $ac_status); }; } &&
-- { ac_try='test -s conftest.$ac_objext'
-- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-- (eval $ac_try) 2>&5
-- ac_status=$?
-- echo "$as_me:$LINENO: \$? = $ac_status" >&5
-- (exit $ac_status); }; }; then
-- ac_cv_type_statfs64=yes
--else
-- echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--ac_cv_type_statfs64=no
--fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--fi
--
--echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
--echo "${ECHO_T}$ac_cv_type_statfs64" >&6
--if test "$ac_cv_type_statfs64" = yes
--then
--
--cat >>confdefs.h <<\_ACEOF
--#define HAVE_STATFS64 1
--_ACEOF
--
--fi
--
-
- int
- main ()
-@@ -5947,7 +5918,7 @@
+@@ -5880,7 +5851,7 @@
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <stddef.h>
diff --git a/patches/uClibc-ng/1.0.12/100-provide-_obstack_free.patch b/patches/uClibc-ng/1.0.12/100-provide-_obstack_free.patch
deleted file mode 100644
index 9fd4bc3..0000000
--- a/patches/uClibc-ng/1.0.12/100-provide-_obstack_free.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur uClibc-ng-1.0.12.orig/libc/misc/gnu/obstack.c uClibc-ng-1.0.12/libc/misc/gnu/obstack.c
---- uClibc-ng-1.0.12.orig/libc/misc/gnu/obstack.c 2016-03-13 15:08:44.408962824 -0700
-+++ uClibc-ng-1.0.12/libc/misc/gnu/obstack.c 2016-03-13 15:13:30.129322998 -0700
-@@ -385,7 +385,7 @@
- abort ();
- }
-
--# if 0
-+# if 1
- /* Older versions of libc used a function _obstack_free intended to be
- called by non-GCC compilers. */
- strong_alias (obstack_free, _obstack_free)
diff --git a/samples/sparc-leon-linux-uclibc/crosstool.config b/samples/sparc-leon-linux-uclibc/crosstool.config
index 4afde66..97488a5 100644
--- a/samples/sparc-leon-linux-uclibc/crosstool.config
+++ b/samples/sparc-leon-linux-uclibc/crosstool.config
@@ -9,7 +9,7 @@ CT_TARGET_VENDOR="leon"
CT_KERNEL_linux=y
CT_KERNEL_V_3_10=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
+CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/uClibc.config"
CT_LIBC_UCLIBC_IPV6=y
CT_LIBC_UCLIBC_WCHAR=y
CT_CC_GCC_V_4_9_3=y
diff --git a/samples/sparc-leon-linux-uclibc/uClibc-1.0.12.config b/samples/sparc-leon-linux-uclibc/uClibc.config
index abcfe40..abcfe40 100644
--- a/samples/sparc-leon-linux-uclibc/uClibc-1.0.12.config
+++ b/samples/sparc-leon-linux-uclibc/uClibc.config
diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh
index 806ecca..72baac0 100755
--- a/scripts/addToolVersion.sh
+++ b/scripts/addToolVersion.sh
@@ -16,7 +16,7 @@ doHelp() {
cat <<-EOF
Usage: ${myname} <--tool> <[options] version [...]> ...
'tool' in one of:
- gcc, binutils, glibc, uClibc, newlib, linux, gdb, dmalloc,
+ gcc, binutils, glibc, uClibc, uClibc-ng, newlib, linux, gdb, dmalloc,
duma, strace, ltrace, libelf, gmp, mpfr, isl, cloog, mpc,
mingw-w64, expat, ncurses
@@ -179,6 +179,7 @@ while [ $# -gt 0 ]; do
--binutils) EXP=; OBS=; cat=BINUTILS; tool=binutils; tool_prefix=binutils; dot2suffix=;;
--glibc) EXP=; OBS=; cat=LIBC_GLIBC; tool=glibc; tool_prefix=libc; dot2suffix=;;
--uClibc) EXP=; OBS=; cat=LIBC_UCLIBC; tool=uClibc; tool_prefix=libc; dot2suffix=;;
+ --uClibc-ng)EXP=; OBS=; cat=LIBC_UCLIBC_NG; tool=uClibc; tool_prefix=libc; dot2suffix=;;
--newlib) EXP=; OBS=; cat=LIBC_NEWLIB; tool=newlib; tool_prefix=libc; dot2suffix=;;
--mingw-w64)EXP=; OBS=; cat=WINAPI; tool=mingw; tool_prefix=libc; dot2suffix=;;
--linux) EXP=; OBS=; cat=KERNEL; tool=linux; tool_prefix=kernel; dot2suffix=;;
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index db14728..0e0f8ed 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -436,6 +436,7 @@ do_gcc_core_backend() {
extra_config+=(--disable-libgomp)
extra_config+=(--disable-libmudflap)
+ extra_config+=(--disable-libmpx)
if [ "${CT_CC_GCC_LIBSSP}" = "y" ]; then
extra_config+=(--enable-libssp)
@@ -695,8 +696,16 @@ do_gcc_core_backend() {
CT_DoLog EXTRA "Building ${log_txt}"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} ${core_targets_all}
+ # Do not pass ${JOBSFLAGS} here: recent GCC builds have been failing
+ # in parallel 'make install' at random locations: libitm, libcilk,
+ # always for the files that are installed more than once to the same
+ # location (such as libitm.info).
+ # The symptom is that the install command fails with "File exists"
+ # error; running the same command manually succeeds. It looks like
+ # attempts to remove the destination and re-create it, but another
+ # install gets in the way.
CT_DoLog EXTRA "Installing ${log_txt}"
- CT_DoExecLog ALL ${make} ${JOBSFLAGS} ${core_targets_install}
+ CT_DoExecLog ALL ${make} ${core_targets_install}
# Remove the libtool "pseudo-libraries": having them in the installed
# tree makes the libtoolized utilities that are built next assume
@@ -769,6 +778,35 @@ do_gcc_for_build() {
CT_EndStep
}
+gcc_movelibs() {
+ local multi_flags multi_dir multi_os_dir multi_root multi_index multi_count
+ local gcc_dir
+
+ for arg in "$@"; do
+ eval "${arg// /\\ }"
+ done
+
+ # Move only files, directories are for other multilibs
+ gcc_dir="${CT_PREFIX_DIR}/${CT_TARGET}/lib/${multi_os_dir}"
+ if [ ! -d "${gcc_dir}" ]; then
+ # GCC didn't install anything outside of sysroot
+ return
+ fi
+ ls "${gcc_dir}" | while read f; do
+ case "${f}" in
+ *.ld)
+ # Linker scripts remain in GCC's directory; elf2flt insists on
+ # finding them there.
+ continue
+ ;;
+ esac
+ if [ -f "${gcc_dir}/${f}" ]; then
+ CT_DoExecLog ALL mkdir -p "${multi_root}/lib/${multi_os_dir}"
+ CT_DoExecLog ALL mv "${gcc_dir}/${f}" "${multi_root}/lib/${multi_os_dir}/${f}"
+ fi
+ done
+}
+
#------------------------------------------------------------------------------
# Build final gcc to run on host
do_gcc_for_host() {
@@ -800,10 +838,18 @@ do_gcc_for_host() {
CT_DoStep INFO "Installing final gcc compiler"
CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-final"
-
"${final_backend}" "${final_opts[@]}"
-
CT_Popd
+
+ # GCC installs stuff (including libgcc) into its own /lib dir,
+ # outside of sysroot, breaking linking with -static-libgcc.
+ # Fix up by moving the libraries into the sysroot.
+ if [ "${CT_USE_SYSROOT}" = "y" ]; then
+ CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-gcc-final-movelibs"
+ CT_IterateMultilibs gcc_movelibs movelibs
+ CT_Popd
+ fi
+
CT_EndStep
}
@@ -904,6 +950,14 @@ do_gcc_backend() {
fi
fi
+ if [ "${CT_CC_GCC_HAS_LIBMPX}" = "y" ]; then
+ if [ "${CT_CC_GCC_LIBMPX}" = "y" ]; then
+ extra_config+=(--enable-libmpx)
+ else
+ extra_config+=(--disable-libmpx)
+ fi
+ fi
+
final_LDFLAGS+=("${ldflags}")
# *** WARNING ! ***
@@ -1082,11 +1136,12 @@ do_gcc_backend() {
CT_DoLog EXTRA "Building final gcc compiler"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} all
+ # See the note on issues with parallel 'make install' in GCC above.
CT_DoLog EXTRA "Installing final gcc compiler"
if [ "${CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES}" = "y" ]; then
- CT_DoExecLog ALL ${make} ${JOBSFLAGS} install-strip
+ CT_DoExecLog ALL ${make} install-strip
else
- CT_DoExecLog ALL ${make} ${JOBSFLAGS} install
+ CT_DoExecLog ALL ${make} install
fi
# Remove the libtool "pseudo-libraries": having them in the installed
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 8027b8f..5067455 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -30,7 +30,8 @@ do_libc_get() {
do_libc_extract() {
CT_Extract "${CT_LIBC}-${CT_LIBC_VERSION}"
CT_Pushd "${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
- # Attempt CT_PATCH only if NOT custom
+ # Custom glibc won't get patched, because CT_GetCustom
+ # marks custom glibc as patched.
CT_Patch nochdir "${CT_LIBC}" "${CT_LIBC_VERSION}"
# The configure files may be older than the configure.in files
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index 47e135b..be8d6bf 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -377,6 +377,11 @@ manage_uClibc_config() {
case "${CT_THREADS}:${CT_LIBC_UCLIBC_LNXTHRD}" in
none:)
;;
+ linuxthreads:)
+ # Newer version of uClibc-ng, no old/new dichotomy
+ CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_HAS_LINUXTHREADS" "${dst}"
+ ;;
linuxthreads:old)
CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
CT_KconfigEnableOption "LINUXTHREADS_OLD" "${dst}"