summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-02-24 11:00:05 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-02-24 11:00:05 (GMT)
commit1906cf93f86d8d66f45f90380a8d3da25c087ee5 (patch)
tree90916c99abe1f1ec26709ee420e6c349eda4670a /patches
parent2609573aede4ce198b3462976725b25eb1637d2e (diff)
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!". Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup. That means I'm putting backups in place in the afternoon. That also means we've lost history... :-(
Diffstat (limited to 'patches')
-rw-r--r--patches/binutils/2.11.2/gcc-pr3106.patch28
-rw-r--r--patches/binutils/2.13.90.0.2/README6
-rw-r--r--patches/binutils/2.13.90.0.2/rh62-binutils-2.11.93.0.2-sparc-nonpic.patch96
-rw-r--r--patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-glibc21.patch58
-rw-r--r--patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-gotpc.patch372
-rw-r--r--patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-tpoff32.patch27
-rw-r--r--patches/binutils/2.14.90.0.5/binutils-cross-demangler.patch11
-rw-r--r--patches/binutils/2.14.90.0.5/binutils-sh-relocs.patch38
-rw-r--r--patches/binutils/2.14.90.0.7/binutils-cross-demangler.patch11
-rw-r--r--patches/binutils/2.14.92/binutils-skip-comments.patch101
-rw-r--r--patches/binutils/2.14.92/gccpr15247-fix.patch192
-rw-r--r--patches/binutils/2.14/binutils-sh-relocs.patch38
-rw-r--r--patches/binutils/2.15.90.0.3/binutils-20040817-linkonce.patch118
-rw-r--r--patches/binutils/2.15.90.0.3/binutils-20040820-duplicates.patch74
-rw-r--r--patches/binutils/2.15.90.0.3/binutils-skip-comments.patch101
-rw-r--r--patches/binutils/2.15.90.0.3/gccpr15247-fix.patch192
-rw-r--r--patches/binutils/2.15.91.0.2/binutils-20040817-linkonce.patch118
-rw-r--r--patches/binutils/2.15.91.0.2/binutils-dup-sections.patch68
-rw-r--r--patches/binutils/2.15.91.0.2/binutils-skip-comments.patch101
-rw-r--r--patches/binutils/2.15/002-uclibc.patch144
-rw-r--r--patches/binutils/2.15/100-uclibc-conf.patch692
-rw-r--r--patches/binutils/2.15/210-cflags.patch32
-rw-r--r--patches/binutils/2.15/400-mips-ELF_MAXPAGESIZE-4K.patch26
-rw-r--r--patches/binutils/2.15/600-arm-textrel.patch63
-rw-r--r--patches/binutils/2.15/bfd-hash-tweak.patch24
-rw-r--r--patches/binutils/2.15/binutils-2.15-allow-gcc-4.0.patch75
-rw-r--r--patches/binutils/2.15/binutils-2.15-psignal.patch40
-rw-r--r--patches/binutils/2.15/binutils-2.15-solaris-qsort.patch22
-rw-r--r--patches/binutils/2.15/binutils-2.15-vmx.patch45
-rw-r--r--patches/binutils/2.15/binutils-arm-undef-imm.patch51
-rw-r--r--patches/binutils/2.15/binutils-skip-comments.patch101
-rw-r--r--patches/binutils/2.15/cross-gprof.patch22
-rw-r--r--patches/binutils/2.15/gccpr15247-fix.patch192
-rw-r--r--patches/binutils/2.15/ld-2.15-callahan.patch677
-rw-r--r--patches/binutils/2.15/ld-2.15-stabs-tweak.patch33
-rw-r--r--patches/binutils/2.15/s390-invalid-insn-format.patch42
-rw-r--r--patches/binutils/2.16.1/bfd-hash-tweak.patch23
-rw-r--r--patches/binutils/2.16.1/binutils-2.15-psignal.patch40
-rw-r--r--patches/binutils/2.16.1/binutils-skip-comments.patch95
-rw-r--r--patches/binutils/2.16.1/callahan.patch693
-rw-r--r--patches/binutils/2.16.1/cross-gprof.patch22
-rw-r--r--patches/binutils/2.16.1/stabs-tweak.patch28
-rw-r--r--patches/binutils/2.17.50.0.10/100-uclibc-conf.patch139
-rw-r--r--patches/binutils/2.17.50.0.10/110-arm-eabi-conf.patch24
-rw-r--r--patches/binutils/2.17.50.0.10/300-001_ld_makefile_patch.patch50
-rw-r--r--patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch47
-rw-r--r--patches/binutils/2.17.50.0.8/100-uclibc-conf.patch139
-rw-r--r--patches/binutils/2.17.50.0.8/110-arm-eabi-conf.patch24
-rw-r--r--patches/binutils/2.17.50.0.8/300-001_ld_makefile_patch.patch50
-rw-r--r--patches/binutils/2.17.50.0.8/300-012_check_ldrunpath_length.patch47
-rw-r--r--patches/binutils/2.17.50.0.9/100-uclibc-conf.patch139
-rw-r--r--patches/binutils/2.17.50.0.9/110-arm-eabi-conf.patch24
-rw-r--r--patches/binutils/2.17.50.0.9/300-001_ld_makefile_patch.patch50
-rw-r--r--patches/binutils/2.17.50.0.9/300-012_check_ldrunpath_length.patch47
-rw-r--r--patches/cygwin/1.5.15-1/cygwin-1.5.15-1-crossbuild.patch40
-rw-r--r--patches/gcc/2.95.3/arm-linux.patch647
-rw-r--r--patches/gcc/2.95.3/backport-config.gcc-1.4.patch35
-rw-r--r--patches/gcc/2.95.3/backport-config.gcc-1.92.patch39
-rw-r--r--patches/gcc/2.95.3/config.sub.patch1257
-rw-r--r--patches/gcc/2.95.3/deque-leak-fix.patch31
-rw-r--r--patches/gcc/2.95.3/gcc-2.95.3-cygwin-020611.patch33
-rw-r--r--patches/gcc/2.95.3/gcc-2.95.3-trap-posix.patch44
-rw-r--r--patches/gcc/2.95.3/gcc-pr3106.patch28
-rw-r--r--patches/gcc/2.95.3/threads_snafu.patch28
-rw-r--r--patches/gcc/3.2.3/README-mips1648
-rw-r--r--patches/gcc/3.2.3/README-sh16
-rw-r--r--patches/gcc/3.2.3/config.sub.patch72
-rw-r--r--patches/gcc/3.2.3/gcc-20020722-ppc405erratum77.patch105
-rw-r--r--patches/gcc/3.2.3/gcc-20030210-sh-linux-1.patch1761
-rw-r--r--patches/gcc/3.2.3/gcc-3.2.3-g++.exp.patch98
-rw-r--r--patches/gcc/3.2.3/gcc-3.2.3-libffi-1.patch6864
-rw-r--r--patches/gcc/3.2.3/gcc-3.2.3-ppc-asm-spec.patch54
-rw-r--r--patches/gcc/3.2.3/gcc-3.2.3-trap-posix.patch45
-rw-r--r--patches/gcc/3.2.3/gcc-3.3-libstdc++-v3-dg.exp.patch54
-rw-r--r--patches/gcc/3.2.3/gcc-sh-linux.spec739
-rw-r--r--patches/gcc/3.3.1/compat.exp.patch37
-rw-r--r--patches/gcc/3.3.1/config.sub.patch72
-rw-r--r--patches/gcc/3.3.1/empty6.patch21
-rw-r--r--patches/gcc/3.3.1/gcc-3.2.3-g++.exp.patch100
-rw-r--r--patches/gcc/3.3.1/gcc-3.3-libstdc++-v3-dg.exp.patch54
-rw-r--r--patches/gcc/3.3.1/gcc-3.3.1-trap-posix.patch44
-rw-r--r--patches/gcc/3.3.1/pr10392-1-test.patch65
-rw-r--r--patches/gcc/3.3.1/pr10412-1-test.patch46
-rw-r--r--patches/gcc/3.3.1/pr10589-1-test.patch17
-rw-r--r--patches/gcc/3.3.1/pr11162-1-test.patch25
-rw-r--r--patches/gcc/3.3.1/pr11587-1-test.patch39
-rw-r--r--patches/gcc/3.3.1/pr11736-1-test.patch48
-rw-r--r--patches/gcc/3.3.1/pr11864-1-test.patch45
-rw-r--r--patches/gcc/3.3.1/pr11949-fix.patch61
-rw-r--r--patches/gcc/3.3.1/pr9365-1-test.patch43
-rw-r--r--patches/gcc/3.3.1/sh-pic-set_fpscr.patch61
-rw-r--r--patches/gcc/3.3.1/sh-spec.patch52
-rw-r--r--patches/gcc/3.3.1/sh4-pthread.patch44
-rw-r--r--patches/gcc/3.3.1/thunk3.patch23
-rw-r--r--patches/gcc/3.3.2/empty6.patch21
-rw-r--r--patches/gcc/3.3.2/gcc-3.2.3-g++.exp.patch100
-rw-r--r--patches/gcc/3.3.2/gcc-3.3-libstdc++-v3-dg.exp.patch54
-rw-r--r--patches/gcc/3.3.2/gcc-3.3.2-arm-bigendian.patch65
-rw-r--r--patches/gcc/3.3.2/gcc-3.3.2-trap-posix.patch44
l---------patches/gcc/3.3.2/pr10392-1-test.patch1
l---------patches/gcc/3.3.2/pr10412-1-test.patch1
l---------patches/gcc/3.3.2/pr10589-1-test.patch1
l---------patches/gcc/3.3.2/pr11162-1-test.patch1
l---------patches/gcc/3.3.2/pr11587-1-test.patch1
-rw-r--r--patches/gcc/3.3.2/pr11608-fix.patch31
l---------patches/gcc/3.3.2/pr11736-1-test.patch1
l---------patches/gcc/3.3.2/pr11864-1-test.patch1
-rw-r--r--patches/gcc/3.3.2/pr13260-test.patch56
l---------patches/gcc/3.3.2/pr9365-1-test.patch1
-rw-r--r--patches/gcc/3.3.2/sh-lib1funcs_sizeAndType.patch610
-rw-r--r--patches/gcc/3.3.2/sh-libgcc-hidden.patch122
-rw-r--r--patches/gcc/3.3.2/sh-pic-set_fpscr-gcc-3.3.2.patch67
-rw-r--r--patches/gcc/3.3.2/thunk3.patch23
-rw-r--r--patches/gcc/3.3.3/config.sub.patch72
-rw-r--r--patches/gcc/3.3.3/empty6.patch21
-rw-r--r--patches/gcc/3.3.3/gcc-3.3.2-arm-bigendian.patch65
-rw-r--r--patches/gcc/3.3.3/gcc-3.3.3-trap-posix.patch44
-rw-r--r--patches/gcc/3.3.3/pr10392-1-test.patch65
-rw-r--r--patches/gcc/3.3.3/pr10412-1-test.patch46
-rw-r--r--patches/gcc/3.3.3/pr10589-1-test.patch17
-rw-r--r--patches/gcc/3.3.3/pr11162-1-test.patch25
-rw-r--r--patches/gcc/3.3.3/pr11587-1-test.patch39
-rw-r--r--patches/gcc/3.3.3/pr11608.patch26
-rw-r--r--patches/gcc/3.3.3/pr11736-1-test.patch48
-rw-r--r--patches/gcc/3.3.3/pr11864-1-test.patch45
-rw-r--r--patches/gcc/3.3.3/pr12009.patch85
-rw-r--r--patches/gcc/3.3.3/pr12010.patch81
-rw-r--r--patches/gcc/3.3.3/pr13250-fix.patch19
-rw-r--r--patches/gcc/3.3.3/pr13260-fix-3.3.3.patch246
-rw-r--r--patches/gcc/3.3.3/pr13260-test.patch56
-rw-r--r--patches/gcc/3.3.3/pr15089-fix.patch25
-rw-r--r--patches/gcc/3.3.3/pr9365-1-test.patch43
-rw-r--r--patches/gcc/3.3.3/sh-lib1funcs_sizeAndType.patch610
-rw-r--r--patches/gcc/3.3.3/sh-pic-set_fpscr-gcc-3.3.2.patch67
-rw-r--r--patches/gcc/3.3.3/thunk3.patch23
-rw-r--r--patches/gcc/3.3.4/gcc-3.3.4-arm-bigendian.patch62
-rw-r--r--patches/gcc/3.3.4/gcc-3.3.4-arm-pr22528.patch71
-rw-r--r--patches/gcc/3.3.4/gcc-3.3.4-libstdcxx-sh.patch38
-rw-r--r--patches/gcc/3.3.4/gcc-3.3.4-ppc-asm-spec.patch86
-rw-r--r--patches/gcc/3.3.4/gcc-3.3.4-trap-posix.patch44
-rw-r--r--patches/gcc/3.3.5/gcc-3.3.4-arm-bigendian.patch62
-rw-r--r--patches/gcc/3.3.5/gcc-3.3.4-arm-pr22528.patch71
-rw-r--r--patches/gcc/3.3.6/fix-fixincl.patch70
-rw-r--r--patches/gcc/3.3.6/gcc-3.3.4-arm-bigendian.patch62
-rw-r--r--patches/gcc/3.3.6/gcc-3.3.4-arm-pr22528.patch71
-rw-r--r--patches/gcc/3.3/compat.exp.patch37
-rw-r--r--patches/gcc/3.3/config.sub.patch72
-rw-r--r--patches/gcc/3.3/gcc-3.2.3-g++.exp.patch98
-rw-r--r--patches/gcc/3.3/gcc-3.3-libstdc++-v3-dg.exp.patch54
-rw-r--r--patches/gcc/3.3/sh-pic-set_fpscr.patch60
-rw-r--r--patches/gcc/3.3/sh-predef-gnu_source.patch15
-rw-r--r--patches/gcc/3.3/sh-spec.patch45
-rw-r--r--patches/gcc/3.3/sh4-kaz-workaround.patch145
-rw-r--r--patches/gcc/3.3/sh4-no-fix-protos.patch12
-rw-r--r--patches/gcc/3.3/sh4-pthread.patch42
-rw-r--r--patches/gcc/3.4.0/gcc-3.3.3h-ppc-asm-spec.patch88
-rw-r--r--patches/gcc/3.4.0/gcc-3.4.0-arm-bigendian.patch70
-rw-r--r--patches/gcc/3.4.0/gcc-3.4.0-arm-lib1asm.patch27
-rw-r--r--patches/gcc/3.4.0/gcc-3.4.0-arm-nolibfloat.patch24
-rw-r--r--patches/gcc/3.4.0/gcc-3.4.0-pr14808-refix.patch46
-rw-r--r--patches/gcc/3.4.0/gcc-3.4.0-ultrasparc3-default64.patch52
-rw-r--r--patches/gcc/3.4.0/pr13250-fix.patch19
-rw-r--r--patches/gcc/3.4.0/pr15647-fix.patch288
-rw-r--r--patches/gcc/3.4.1/fix-fixincl.patch70
-rw-r--r--patches/gcc/3.4.1/gcc-3.4-sparc-pr16430-fix.patch42
-rw-r--r--patches/gcc/3.4.1/gcc-3.4.0-arm-bigendian.patch70
-rw-r--r--patches/gcc/3.4.1/gcc-3.4.0-arm-lib1asm.patch27
-rw-r--r--patches/gcc/3.4.1/gcc-3.4.0-arm-nolibfloat.patch24
-rw-r--r--patches/gcc/3.4.1/pr15068-fix.patch44
-rw-r--r--patches/gcc/3.4.2/gcc-3.4.0-arm-bigendian.patch82
-rw-r--r--patches/gcc/3.4.2/gcc-3.4.0-arm-lib1asm.patch27
-rw-r--r--patches/gcc/3.4.2/gcc-3.4.0-arm-nolibfloat.patch24
-rw-r--r--patches/gcc/3.4.3/fix-fixincl.patch70
-rw-r--r--patches/gcc/3.4.3/gcc-3.4.0-arm-bigendian.patch82
-rw-r--r--patches/gcc/3.4.3/gcc-3.4.0-arm-lib1asm.patch27
-rw-r--r--patches/gcc/3.4.3/gcc-3.4.0-arm-nolibfloat.patch24
-rw-r--r--patches/gcc/3.4.3/pr15068-fix.patch44
-rw-r--r--patches/gcc/3.4.3/pr16201-fix.patch149
-rw-r--r--patches/gcc/3.4.3/pr18508-fix.patch143
-rw-r--r--patches/gcc/3.4.4/100-uclibc-conf.patch470
-rw-r--r--patches/gcc/3.4.4/200-uclibc-locale.patch3255
-rw-r--r--patches/gcc/3.4.4/300-libstdc++-pic.patch46
-rw-r--r--patches/gcc/3.4.4/600-gcc34-arm-ldm-peephole.patch65
-rw-r--r--patches/gcc/3.4.4/601-gcc34-arm-ldm-peephole2.patch42
-rw-r--r--patches/gcc/3.4.4/601-gcc34-arm-ldm.patch119
-rw-r--r--patches/gcc/3.4.4/602-sdk-libstdc++-includes.patch22
-rw-r--r--patches/gcc/3.4.4/700-pr15068-fix.patch44
-rw-r--r--patches/gcc/3.4.4/71_all_sh-pr16665-fix.patch43
-rw-r--r--patches/gcc/3.4.4/72_all_sh-no-reorder-blocks.patch13
-rw-r--r--patches/gcc/3.4.4/73_all_sh-pr20617.patch28
-rw-r--r--patches/gcc/3.4.4/800-arm-bigendian.patch66
-rw-r--r--patches/gcc/3.4.4/800-powerpc-libc_stack_end-uclibc.patch15
-rw-r--r--patches/gcc/3.4.4/830-gcc-bug-num-22167.patch16
-rw-r--r--patches/gcc/3.4.4/900-nios2.patch10211
-rw-r--r--patches/gcc/3.4.4/arm-softfloat.patch270
-rw-r--r--patches/gcc/3.4.4/fix-fixincl.patch70
-rw-r--r--patches/gcc/3.4.5/fix-fixincl.patch70
-rw-r--r--patches/gcc/3.4.5/gcc-3.4.0-arm-bigendian.patch82
-rw-r--r--patches/gcc/3.4.5/gcc-3.4.0-arm-lib1asm.patch27
-rw-r--r--patches/gcc/3.4.5/gcc-3.4.0-arm-nolibfloat.patch24
-rw-r--r--patches/gcc/3.4.5/pr15068-fix.patch44
-rw-r--r--patches/gcc/4.0.0/fix-fixincl.patch72
-rw-r--r--patches/gcc/4.0.0/gcc-4.0-arm-bigendian.patch79
-rw-r--r--patches/gcc/4.0.0/pr20815-fix.patch121
-rw-r--r--patches/gcc/4.0.0/pr20973-fix.patch80
-rw-r--r--patches/gcc/4.0.0/pr21173-fix.patch66
-rw-r--r--patches/gcc/4.0.0/pr21951.patch153
-rw-r--r--patches/gcc/4.0.1/fix-fixincl.patch72
-rw-r--r--patches/gcc/4.0.1/pr20815-fix.patch121
-rw-r--r--patches/gcc/4.0.1/pr21951-fix2.patch71
-rw-r--r--patches/gcc/4.0.2/fix-fixincl.patch72
-rw-r--r--patches/gcc/4.0.2/pr20815-fix.patch121
-rw-r--r--patches/gcc/4.0.2/pr21623-workaround.patch53
-rw-r--r--patches/gcc/4.0.3/100-uclibc-conf.patch553
-rw-r--r--patches/gcc/4.0.3/200-uclibc-locale.patch3237
-rw-r--r--patches/gcc/4.0.3/300-libstdc++-pic.patch45
-rw-r--r--patches/gcc/4.0.3/301-missing-execinfo_h.patch11
-rw-r--r--patches/gcc/4.0.3/302-c99-snprintf.patch11
-rw-r--r--patches/gcc/4.0.3/303-c99-complex-ugly-hack.patch12
-rw-r--r--patches/gcc/4.0.3/304-index_macro.patch24
-rw-r--r--patches/gcc/4.0.3/602-sdk-libstdc++-includes.patch22
-rw-r--r--patches/gcc/4.0.3/800-arm-bigendian.patch67
-rw-r--r--patches/gcc/4.0.4/100-uclibc-conf.patch553
-rw-r--r--patches/gcc/4.0.4/200-uclibc-locale.patch3237
-rw-r--r--patches/gcc/4.0.4/300-libstdc++-pic.patch45
-rw-r--r--patches/gcc/4.0.4/301-missing-execinfo_h.patch11
-rw-r--r--patches/gcc/4.0.4/302-c99-snprintf.patch11
-rw-r--r--patches/gcc/4.0.4/303-c99-complex-ugly-hack.patch12
-rw-r--r--patches/gcc/4.0.4/304-index_macro.patch24
-rw-r--r--patches/gcc/4.0.4/602-sdk-libstdc++-includes.patch22
-rw-r--r--patches/gcc/4.0.4/800-arm-bigendian.patch65
-rw-r--r--patches/gcc/4.0.4/801-arm-softfloat.patch14
-rw-r--r--patches/gcc/4.1.0/gcc-4.1-fix-fixincl.patch71
-rw-r--r--patches/gcc/4.1.1/100-uclibc-conf.patch544
-rw-r--r--patches/gcc/4.1.1/110-arm-eabi.patch27
-rw-r--r--patches/gcc/4.1.1/200-uclibc-locale.patch3239
-rw-r--r--patches/gcc/4.1.1/300-libstdc++-pic.patch50
-rw-r--r--patches/gcc/4.1.1/301-missing-execinfo_h.patch11
-rw-r--r--patches/gcc/4.1.1/302-c99-snprintf.patch11
-rw-r--r--patches/gcc/4.1.1/303-c99-complex-ugly-hack.patch12
-rw-r--r--patches/gcc/4.1.1/304-index_macro.patch24
-rw-r--r--patches/gcc/4.1.1/740-sh-pr24836.patch25
-rw-r--r--patches/gcc/4.1.1/800-arm-bigendian.patch67
-rw-r--r--patches/gcc/4.1.1/801-softfloat-fix.patch58
-rw-r--r--patches/gcc/4.1.2/100-uclibc-conf.patch544
-rw-r--r--patches/gcc/4.1.2/110-arm-eabi.patch27
-rw-r--r--patches/gcc/4.1.2/200-uclibc-locale.patch3239
-rw-r--r--patches/gcc/4.1.2/300-libstdc++-pic.patch50
-rw-r--r--patches/gcc/4.1.2/301-missing-execinfo_h.patch11
-rw-r--r--patches/gcc/4.1.2/302-c99-snprintf.patch11
-rw-r--r--patches/gcc/4.1.2/303-c99-complex-ugly-hack.patch12
-rw-r--r--patches/gcc/4.1.2/304-index_macro.patch24
-rw-r--r--patches/gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch12
-rw-r--r--patches/gcc/4.1.2/740-sh-pr24836.patch25
-rw-r--r--patches/gcc/4.1.2/800-arm-bigendian.patch127
-rw-r--r--patches/glibc/2.1.3/README4
-rw-r--r--patches/glibc/2.1.3/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.1.3/backport-config.sub.patch834
-rw-r--r--patches/glibc/2.1.3/el.po.patch40
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-ac_cv_prog_cc_cross.patch44
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-db2.patch17
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-dns.patch21
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-fixup.patch70
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-generic.patch157
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-grp.patch56
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-locale.patch33
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-mntent.patch39
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-sunrpc.patch33
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-configure.patch11
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-dl-machine-i386.patch171
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-errlist.patch48
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-longlong.patch774
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-sscanf.patch73
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-syscall.patch29
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-allow-gcc3-versioninfo.patch17
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-cygwin.patch80
-rw-r--r--patches/glibc/2.1.3/glibc-2.1.3-override.patch48
-rw-r--r--patches/glibc/2.1.3/glibc-2.2.2-export_fp_hw.patch30
-rw-r--r--patches/glibc/2.1.3/glibc-manual-stdin.texi-1.127.patch26
-rw-r--r--patches/glibc/2.1.3/glibc-rpcgen-cpp.patch14
-rw-r--r--patches/glibc/2.1.3/rh62-00-glibc-2.1.3.patch117574
-rw-r--r--patches/glibc/2.1.3/rh62-01-glibc-2.1.3-security.patch32
-rw-r--r--patches/glibc/2.1.3/rh62-02-glibc-2.1.3-locale.patch76
-rw-r--r--patches/glibc/2.1.3/rh62-03-glibc-2.1.3-crypt.patch207
-rw-r--r--patches/glibc/2.1.3/rh62-04-glibc-2.1.3-tzfile.patch22
-rw-r--r--patches/glibc/2.1.3/rh62-06-glibc-2.1.3-preload.patch86
-rw-r--r--patches/glibc/2.1.3/rh62-07-glibc-2.1.3-alpha.patch124
-rw-r--r--patches/glibc/2.1.3/rh62-08-glibc-2.1.3-glob.patch57
-rw-r--r--patches/glibc/2.1.3/rh62-09-glibc-2.1.3-security2.patch66
-rw-r--r--patches/glibc/2.1.3/rh62-10-glibc-2.1.3-xdr_array.patch36
-rw-r--r--patches/glibc/2.1.3/rh62-11-glibc-2.1.3-calloc.patch35
-rw-r--r--patches/glibc/2.1.3/rh62-12-glibc-2.1.3-maxpacket.patch512
-rw-r--r--patches/glibc/2.1.3/rh62-99-glibc-2.1.3-allow-gcc-3.4-dns.patch11
-rw-r--r--patches/glibc/2.1.3/rh62-99-glibc-2.1.3-allow-gcc-3.4-gconv_stubs.patch44
-rw-r--r--patches/glibc/2.1.3/sk.po.patch6678
-rw-r--r--patches/glibc/2.2.2/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.2.2/glibc-2.1.3-allow-gcc-3.4-grp.patch56
-rw-r--r--patches/glibc/2.2.2/glibc-2.1.3-allow-gcc3-sscanf.patch73
-rw-r--r--patches/glibc/2.2.2/glibc-2.1.3-allow-gcc3-versioninfo.patch17
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.2-allow-gcc-3-configure.patch21
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.2-allow-gcc3-dl-machine-i386.patch232
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.2-allow-gcc3-errlist.patch18
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.2-allow-gcc3-longlong.patch811
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.2-export_fp_hw.patch30
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.2-printf-not-macro.patch36
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.2-syslog-bugfix.patch60
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.5-alpha-pwrite64.patch58
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.5-arm-pwrite64.patch30
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.5-i386-pwrite64.patch20
-rw-r--r--patches/glibc/2.2.2/glibc-2.2.5-m68k-pwrite.patch32
-rw-r--r--patches/glibc/2.2.2/glibc-manual-stdin.texi-1.127.patch18
-rw-r--r--patches/glibc/2.2.2/glibc-nss-noopt.patch26
-rw-r--r--patches/glibc/2.2.2/tst-pathopt-cross.patch23
-rw-r--r--patches/glibc/2.2.3/errlist-1.9.patch30
-rw-r--r--patches/glibc/2.2.3/errlist-arm.patch48
-rw-r--r--patches/glibc/2.2.3/glibc-2.2.3-mips-base-addr-got.patch276
-rw-r--r--patches/glibc/2.2.3/glibc-2.2.5-mips-clone-local-label.patch47
-rw-r--r--patches/glibc/2.2.3/glibc-manual-stdin.texi-1.127.patch25
-rw-r--r--patches/glibc/2.2.5/alpha-build-failure.patch37
-rw-r--r--patches/glibc/2.2.5/arm-asm-clobber.patch23
-rw-r--r--patches/glibc/2.2.5/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.2.5/cris-libc-symbols.patch97
-rw-r--r--patches/glibc/2.2.5/cris-stack-direction.patch61
-rw-r--r--patches/glibc/2.2.5/dl-machine-alpha.patch424
-rw-r--r--patches/glibc/2.2.5/dl-machine-arm.patch389
-rw-r--r--patches/glibc/2.2.5/dl-machine-m68k.patch206
-rw-r--r--patches/glibc/2.2.5/dl-machine-sh.patch41
-rw-r--r--patches/glibc/2.2.5/dl-machine-sparc.patch230
-rw-r--r--patches/glibc/2.2.5/errlist-1.9.patch25
-rw-r--r--patches/glibc/2.2.5/errlist-arm.patch48
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-fixup.patch68
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-grp.patch63
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-weakextern.patch48
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-configure.patch21
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-elf-2.patch43
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-elf.patch39
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-gconv.patch226
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-i386.patch49
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-iconv.patch20
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-iconvdata.patch114
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-locale.patch49
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-malloc.patch48
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-mipsel.patch81
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-msort.patch47
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-powerpc-procfs.patch54
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-powerpc.patch23
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-sunrpc.patch221
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-alpha-pwrite64.patch58
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-arm-pwrite64.patch30
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-crosstest.patch27
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-crossyes.patch11
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-cygwin.patch89
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-hhl-powerpc-fpu.patch1134
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-i386-pwrite64.patch20
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-m68k-pwrite.patch32
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-mips-build-gmon.patch86
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-mips-clone-local-label.patch47
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-mips-dl-machine-1.56.patch31
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-mips-dl-machine-1.57.patch43
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-mips-dl-machine-1.59-kinda.patch35
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-mips-dl-machine-1.60.patch53
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-powerpc-as.patch29
-rw-r--r--patches/glibc/2.2.5/glibc-2.2.5-ppc405erratum77.patch65
-rw-r--r--patches/glibc/2.2.5/glibc-2.3.2-allow-gcc-3.5-xdr.patch44
-rw-r--r--patches/glibc/2.2.5/glibc-drow-sh.patch77
-rw-r--r--patches/glibc/2.2.5/glibc-test-lowram.patch14
-rw-r--r--patches/glibc/2.2.5/initfini-alpha.patch125
-rw-r--r--patches/glibc/2.2.5/initfini-ia64.patch219
-rw-r--r--patches/glibc/2.2.5/initfini-sh.patch243
-rw-r--r--patches/glibc/2.2.5/longjmp-sparc.patch75
-rw-r--r--patches/glibc/2.2.5/sh-setjmp-fix.patch29
-rw-r--r--patches/glibc/2.2.5/sprintf-prototype.patch13
-rw-r--r--patches/glibc/2.2.5/sscanf.patch82
-rw-r--r--patches/glibc/2.2.5/unwind-arm.patch19
-rw-r--r--patches/glibc/2.3.2/README-hppa32
-rw-r--r--patches/glibc/2.3.2/arm-asm-clobber.patch26
-rw-r--r--patches/glibc/2.3.2/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.3.2/arm-mcount_internal.patch30
-rw-r--r--patches/glibc/2.3.2/epoll-epollet.patch28
-rw-r--r--patches/glibc/2.3.2/epoll-stdint.patch22
-rw-r--r--patches/glibc/2.3.2/errlist-awk.patch11
-rw-r--r--patches/glibc/2.3.2/fixup.patch74
-rw-r--r--patches/glibc/2.3.2/gcc-pr-9552-workaround.patch20
-rw-r--r--patches/glibc/2.3.2/glibc-2.2.5-crosstest.patch27
-rw-r--r--patches/glibc/2.3.2/glibc-2.2.5-mips-clone-local-label.patch47
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.4-inline.patch23
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.4-nounit.patch137
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.5-PR14096.patch55
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.5-elf.patch34
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.5-gconv.patch228
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.5-msort.patch46
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.5-sunrpc.patch233
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-allow-gcc-3.5-xdr.patch44
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-alpha-pwrite64.patch54
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-arm-fix-strlen.patch54
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-cross-2.patch18
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-cross.patch27
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-cygwin.patch90
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-mips-user.patch588
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-mips.patch60
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-override.patch38
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-powerpc-as.patch58
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-pr139-fix.patch104
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-sh4-socket.patch39
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-sh4-trapa.patch55
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-sparc32-sysdep.patch46
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-sparc64-dl-machine.patch29
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-sparc64-pause.patch22
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-sparc64-pwrite64.patch36
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.2-without-fp.patch89
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.3-allow-gcc-4.0-configure.patch30
-rw-r--r--patches/glibc/2.3.2/glibc-2.3.3-allow-gcc-4.0-powerpc-procfs.patch65
-rw-r--r--patches/glibc/2.3.2/glibc-configure-apple-as.patch23
-rw-r--r--patches/glibc/2.3.2/glibc-drow-sh.patch77
-rw-r--r--patches/glibc/2.3.2/glibc-fp-byteorder.patch203
-rw-r--r--patches/glibc/2.3.2/glibc-test-lowram.patch14
-rw-r--r--patches/glibc/2.3.2/nobits.patch27
-rw-r--r--patches/glibc/2.3.2/old/glibc-2.3.2-powerpc-procfs.patch28
-rw-r--r--patches/glibc/2.3.2/sscanf.patch80
-rw-r--r--patches/glibc/2.3.2/string2-typedef.patch35
-rw-r--r--patches/glibc/2.3.3/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.3.3/bad/glibc-2.3.3-alpha-pwrite64.patch51
-rw-r--r--patches/glibc/2.3.3/fixup.patch74
-rw-r--r--patches/glibc/2.3.3/glibc-2.2.5-allow-gcc-4.0-malloc.patch48
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.4-inline.patch23
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-elf.patch34
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch228
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-msort.patch46
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-sunrpc.patch233
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-xdr.patch44
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-arm-fix-strlen.patch54
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-pr139-fix.patch104
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-sparc32-sysdep.patch46
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-sparc64-dl-machine.patch29
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-without-fp.patch89
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-configure.patch30
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-2.patch53
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-3.patch79
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-i386.patch111
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconv.patch24
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata-2.patch124
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata.patch142
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-locale.patch34
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch77
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-powerpc-procfs.patch65
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-x86_64.patch60
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-alpha-pwrite64.patch41
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-cygwin.patch103
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-libeh-kludge.patch75
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-s390-fadvise64.patch128
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-unwind-dw2.patch66
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-arm.patch117
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-elf.patch61
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc32.patch42
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc64.patch60
-rw-r--r--patches/glibc/2.3.3/glibc-configure-apple-as.patch23
-rw-r--r--patches/glibc/2.3.3/glibc-fp-byteorder.patch203
-rw-r--r--patches/glibc/2.3.4/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.3.4/bad/glibc-2.3.4-cygwin.patch96
-rw-r--r--patches/glibc/2.3.4/fix-pr398.patch70
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-allow-gcc-4.0-arm.patch117
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-allow-gcc-4.0-elf.patch61
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-allow-gcc-4.0-iconvdata.patch44
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-allow-gcc-4.0-powerpc-procfs.patch62
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-allow-gcc-4.0-powerpc32.patch42
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-allow-gcc-4.0-powerpc64.patch60
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-cygwin.patch166
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.4-memcmp.patch46
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.5-allow-gcc4-string.patch83
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.5-allow-gcc4-symbols.patch126
-rw-r--r--patches/glibc/2.3.4/glibc-2.3.5-allow-gcc4-wcstol_l.patch57
-rw-r--r--patches/glibc/2.3.4/glibc-configure-apple-as.patch23
-rw-r--r--patches/glibc/2.3.4/glibc-fp-byteorder.patch203
-rw-r--r--patches/glibc/2.3.4/make-install-lib-all.patch24
-rw-r--r--patches/glibc/2.3.4/pr758.patch256
-rw-r--r--patches/glibc/2.3.5/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.3.5/fix-pr398.patch70
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.4-allow-gcc-4.0-arm.patch117
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.4-allow-gcc-4.0-elf.patch61
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.4-allow-gcc-4.0-iconvdata.patch44
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.4-allow-gcc-4.0-powerpc-procfs.patch62
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.4-allow-gcc-4.0-powerpc32.patch42
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.4-allow-gcc-4.0-powerpc64.patch60
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.4-memcmp.patch46
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.5-allow-gcc-4.0-wordexp.patch19
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.5-allow-gcc4-string.patch83
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.5-allow-gcc4-symbols.patch126
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.5-allow-gcc4-wcstol_l.patch57
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.5-cygwin.patch185
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.5-fix-pr631.patch43
-rw-r--r--patches/glibc/2.3.5/glibc-2.3.5-sh-memset.patch69
-rw-r--r--patches/glibc/2.3.5/glibc-configure-apple-as.patch23
-rw-r--r--patches/glibc/2.3.5/glibc-fp-byteorder.patch203
-rw-r--r--patches/glibc/2.3.5/glibc-mips-bootstrap-gcc-header-install.patch35
-rw-r--r--patches/glibc/2.3.5/make-install-lib-all.patch24
-rw-r--r--patches/glibc/2.3.5/pr758.patch256
-rw-r--r--patches/glibc/2.3.6/arm-ctl_bus_isa.patch53
-rw-r--r--patches/glibc/2.3.6/fix-pr398.patch70
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.5-allow-gcc-4.0-wordexp.patch21
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch59
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.5-cygwin.patch187
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.5-sh-lowlevellock.patch43
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.5-sh-memset.patch30
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-arm.patch35
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-elf.patch67
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.6-configure-apple-as.patch25
-rw-r--r--patches/glibc/2.3.6/glibc-2.3.6-fix-pr631.patch45
-rw-r--r--patches/glibc/2.3.6/glibc-fp-byteorder.patch205
-rw-r--r--patches/glibc/2.3.6/glibc-mips-bootstrap-gcc-header-install.patch37
-rw-r--r--patches/glibc/2.3.6/make-install-lib-all.patch26
-rw-r--r--patches/glibc/2.3.6/maybe/glibc-2.3.6-allow-gcc-4.0-powerpc32.patch45
-rw-r--r--patches/glibc/2.3.6/maybe/glibc-2.3.6-allow-gcc-4.0-powerpc64.patch65
-rw-r--r--patches/glibc/20040827/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/20040827/glibc-2.3.2-sparc64-dl-machine.patch29
-rw-r--r--patches/glibc/20040827/glibc-2.3.3-cygwin.patch103
-rw-r--r--patches/glibc/20040827/glibc-2.3.3-libeh-kludge.patch26
-rw-r--r--patches/glibc/20040827/glibc-configure-apple-as.patch23
-rw-r--r--patches/glibc/20040827/glibc-fp-byteorder.patch203
-rw-r--r--patches/glibc/20050502/make-install-lib-all.patch24
-rw-r--r--patches/glibc/compat-2.1/rh62-09-glibc-compat-2.1.3-security2.patch66
-rw-r--r--patches/glibc/compat-2.1/rh62-12-glibc-compat-2.1.3-maxpacket.patch512
-rw-r--r--patches/glibc/linuxthreads-2.1.3/glibc-2.1.3-allow-gcc3-pthread.patch33
-rw-r--r--patches/glibc/linuxthreads-2.1.3/glibc-2.1.3-allow-gcc3-pthread2.patch18
-rw-r--r--patches/glibc/linuxthreads-2.1.3/rh62-05-glibc-2.1.3-pthread.patch16
-rw-r--r--patches/glibc/linuxthreads-2.1.3/rh62-99-glibc-2.1.3-allow-gcc-3.4-td.patch808
-rw-r--r--patches/glibc/linuxthreads-2.2.2/glibc-linuxthreads-2.2.2-allow-gcc3.patch497
-rw-r--r--patches/glibc/linuxthreads-2.2.2/threadparam.patch69
-rw-r--r--patches/glibc/linuxthreads-2.2.5/glibc-2.2.5-allow-gcc-3.4-td.patch881
-rw-r--r--patches/glibc/linuxthreads-2.2.5/glibc-2.2.5-alpha-self-clobber.patch25
-rw-r--r--patches/glibc/linuxthreads-2.2.5/linuxthreads-2.2.5-ppc405erratum77.patch34
-rw-r--r--patches/glibc/linuxthreads-2.2.5/pt-initfini-alpha.patch119
-rw-r--r--patches/glibc/linuxthreads-2.2.5/pt-initfini-sh.patch267
-rw-r--r--patches/glibc/linuxthreads-2.2.5/threadparam.patch69
-rw-r--r--patches/glibc/linuxthreads-2.3.2/alpha_cfi1.patch136
-rw-r--r--patches/glibc/linuxthreads-2.3.2/alpha_cfi2.patch118
-rw-r--r--patches/glibc/linuxthreads-2.3.2/glibc-2.3.2-sparc64-sigproc.patch26
-rw-r--r--patches/glibc/linuxthreads-2.3.2/glibc-linuxthreads-2.3.2-allow-3.4.patch100
-rw-r--r--patches/glibc/linuxthreads-2.3.2/glibc-linuxthreads-2.3.2-cygwin.patch30
-rw-r--r--patches/glibc/linuxthreads-2.3.2/sysdep-cancel-arm-1.2-1.6.patch53
-rw-r--r--patches/glibc/linuxthreads-2.3.3/glibc-2.3.3-alpha-prolog.patch36
-rw-r--r--patches/glibc/linuxthreads-2.3.3/glibc-linuxthreads-2.3.3-cygwin.patch38
-rw-r--r--patches/glibc/linuxthreads-2.3.4/glibc-linuxthreads-2.3.3-cygwin.patch38
-rw-r--r--patches/glibc/linuxthreads-2.3.4/glibc-linuxthreads-2.3.4-allow-gcc-4.0-rtld.patch89
-rw-r--r--patches/glibc/linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch37
-rw-r--r--patches/glibc/linuxthreads-2.3.6/glibc-linuxthreads-2.3.5-cygwin.patch37
-rw-r--r--patches/glibc/linuxthreads-20040827/glibc-linuxthreads-2.3.3-cygwin.patch38
-rw-r--r--patches/libfloat/990616/100-libfloat_990616-3-lib-versioning.patch48
-rw-r--r--patches/libfloat/990616/200-cross_compile.patch63
-rw-r--r--patches/linux/2.4.26/01-kmap-types-cleanup.patch306
-rw-r--r--patches/linux/2.4.26/kaz-types.patch60
-rw-r--r--patches/linux/2.4.26/linux-2.4-bsd-expr.patch25
-rw-r--r--patches/linux/2.4.26/linux-2.4.21-allow-gcc-3.3-arm-lib.patch203
-rw-r--r--patches/linux/2.4.26/linux-2.4.26-allow-gcc-3.4-arm-kernel.patch23
-rw-r--r--patches/linux/2.4.26/linux-2.4.26-arm-nonofpu.patch40
-rw-r--r--patches/linux/2.4.26/linux-2.4.26-mkdep-xargs.patch28
-rw-r--r--patches/linux/2.4.26/linux-2.4.26-wdt977-uaccess.patch17
-rw-r--r--patches/linux/2.6.11.3/arch_alpha_kernel_srcons.patch134
-rw-r--r--patches/linux/2.6.11.3/kaz-types.patch60
-rw-r--r--patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-i386.patch150
-rw-r--r--patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-m68k.patch32
-rw-r--r--patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch30
-rw-r--r--patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch28
-rw-r--r--patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-i2c.patch58
-rw-r--r--patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch86
-rw-r--r--patches/linux/2.6.5/linux-2.6.5-x86_64-unistd.patch80
-rw-r--r--patches/linux/2.6.6/kaz-types.patch60
-rw-r--r--patches/linux/2.6.6/linux-2.6.5-x86_64-unistd.patch80
-rw-r--r--patches/linux/2.6.6/linux-2.6.8-noshared-kconfig.patch28
-rw-r--r--patches/linux/2.6.7/kaz-types.patch60
-rw-r--r--patches/linux/2.6.7/linux-2.6.7-build_on_case_insensitive_fs-1.patch679
-rw-r--r--patches/linux/2.6.7/linux-2.6.8-noshared-kconfig.patch28
-rw-r--r--patches/linux/2.6.8/kaz-types.patch60
-rw-r--r--patches/linux/2.6.8/linux-2.6.8-allow-gcc-4.0-asm-i386.patch138
-rw-r--r--patches/linux/2.6.8/linux-2.6.8-arm-nonofpu.patch50
-rw-r--r--patches/linux/2.6.8/linux-2.6.8-build_on_case_insensitive_fs.patch725
-rw-r--r--patches/linux/2.6.8/linux-2.6.8-m68k-kludge.patch285
-rw-r--r--patches/linux/2.6.8/linux-2.6.8-noshared-kconfig.patch28
-rw-r--r--patches/uClibc/0.9.28.1/000-string-functions.patch14
-rw-r--r--patches/uClibc/0.9.28.1/001-install_dev.patch22
-rw-r--r--patches/uClibc/0.9.28.1/002-no_LFS-no_readahead.patch14
-rw-r--r--patches/uClibc/0.9.28.1/003-time-locale.patch15
-rw-r--r--patches/uClibc/0.9.28.1/004-uClibc_ctype.patch17
-rw-r--r--patches/uClibc/0.9.28.1/200-custom-ISA.patch31
-rw-r--r--patches/uClibc/0.9.28.1/201-mips-asm.h.patch41
-rw-r--r--patches/uClibc/0.9.28.2/000-string-functions.patch14
-rw-r--r--patches/uClibc/0.9.28.2/001-install_dev.patch22
-rw-r--r--patches/uClibc/0.9.28.2/002-no_LFS-no_readahead.patch14
-rw-r--r--patches/uClibc/0.9.28.2/004-uClibc_ctype.patch17
-rw-r--r--patches/uClibc/0.9.28.2/200-custom-ISA.patch31
-rw-r--r--patches/uClibc/0.9.28.2/201-mips-asm.h.patch41
-rw-r--r--patches/uClibc/0.9.28/000-string-functions.patch11
-rw-r--r--patches/uClibc/0.9.28/001-install_dev.patch39
-rw-r--r--patches/uClibc/0.9.28/002-no_LFS-no_readahead.patch14
-rw-r--r--patches/uClibc/0.9.28/004-uClibc_ctype.patch17
-rw-r--r--patches/uClibc/0.9.28/005-fix_includes.sh.patch316
-rw-r--r--patches/uClibc/0.9.28/200-custom-ISA.patch31
-rw-r--r--patches/uClibc/0.9.28/201-mips-asm.h.patch41
597 files changed, 213618 insertions, 0 deletions
diff --git a/patches/binutils/2.11.2/gcc-pr3106.patch b/patches/binutils/2.11.2/gcc-pr3106.patch
new file mode 100644
index 0000000..c3a0264
--- /dev/null
+++ b/patches/binutils/2.11.2/gcc-pr3106.patch
@@ -0,0 +1,28 @@
+See http://gcc.gnu.org/PR3106
+Backported from gcc-3.0.x
+
+Fixes error
+ .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr'
+ /usr/include/stdio.h:258: error: previous declaration of `sys_nerr'
+ make[1]: *** [strerror.o] Error 1
+ make: *** [all-libiberty] Error 2
+on Mac OS X.
+
+--- binutils-2.11.2/libiberty/strerror.c.old 2004-03-24 16:23:19.000000000 -0800
++++ binutils-2.11.2/libiberty/strerror.c 2004-03-24 16:23:48.000000000 -0800
+@@ -13,6 +13,7 @@
+ incompatible with our later declaration, perhaps by using const
+ attributes. So we hide the declaration in errno.h (if any) using a
+ macro. */
++#define sys_nerr sys_nerr__
+ #define sys_errlist sys_errlist__
+ #endif
+
+@@ -20,6 +21,7 @@
+ #include <errno.h>
+
+ #ifdef HAVE_SYS_ERRLIST
++#undef sys_nerr
+ #undef sys_errlist
+ #endif
+
diff --git a/patches/binutils/2.13.90.0.2/README b/patches/binutils/2.13.90.0.2/README
new file mode 100644
index 0000000..521e669
--- /dev/null
+++ b/patches/binutils/2.13.90.0.2/README
@@ -0,0 +1,6 @@
+The files rh62*.patch are from the Red Hat 6.2 file
+binutils-2.13.90.0.2-2.src.rpm
+
+I am trusting here that Red Hat's patches are appropriate for all CPU
+types. If I'm wrong, just remove the offending patch...
+- Dan Kegel
diff --git a/patches/binutils/2.13.90.0.2/rh62-binutils-2.11.93.0.2-sparc-nonpic.patch b/patches/binutils/2.13.90.0.2/rh62-binutils-2.11.93.0.2-sparc-nonpic.patch
new file mode 100644
index 0000000..f8719a5
--- /dev/null
+++ b/patches/binutils/2.13.90.0.2/rh62-binutils-2.11.93.0.2-sparc-nonpic.patch
@@ -0,0 +1,96 @@
+2002-04-20 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-sparc.c (elf32_sparc_relocate_section): Find real output
+ section with SEC_MERGE.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
+--- binutils/bfd/elf32-sparc.c.jj Sat Apr 20 22:11:57 2002
++++ binutils/bfd/elf32-sparc.c Sat Apr 20 23:06:33 2002
+@@ -1144,7 +1144,7 @@ elf32_sparc_relocate_section (output_bfd
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+- bfd_vma relocation, off;
++ bfd_vma relocation, off, orig_addend = 0;
+ bfd_reloc_status_type r;
+ boolean is_plt = false;
+ boolean unresolved_reloc;
+@@ -1192,6 +1192,7 @@ elf32_sparc_relocate_section (output_bfd
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
++ orig_addend = rel->r_addend;
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+ }
+ else
+@@ -1527,6 +1528,25 @@ elf32_sparc_relocate_section (output_bfd
+ asection *osec;
+
+ osec = sec->output_section;
++ /* FIXME: As soon as making sections zero size
++ is possible, this if can go away. */
++ if (bfd_is_abs_section (osec)
++ && h == NULL
++ && (sec->flags & SEC_MERGE)
++ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
++ && (elf_section_data (sec)->sec_info_type
++ == ELF_INFO_TYPE_MERGE))
++ {
++ asection *msec;
++
++ msec = sec;
++ _bfd_merged_section_offset (output_bfd, &msec,
++ elf_section_data (sec)->sec_info,
++ sym->st_value + orig_addend,
++ (bfd_vma) 0);
++ osec = msec->output_section;
++ }
++
+ indx = elf_section_data (osec)->dynindx;
+
+ /* FIXME: we really should be able to link non-pic
+--- binutils/bfd/elf64-sparc.c.jj Sat Apr 20 22:11:57 2002
++++ binutils/bfd/elf64-sparc.c Sat Apr 20 23:12:18 2002
+@@ -1939,7 +1939,7 @@ sparc64_elf_relocate_section (output_bfd
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+- bfd_vma relocation, off;
++ bfd_vma relocation, off, orig_addend = 0;
+ bfd_reloc_status_type r;
+ boolean is_plt = false;
+ boolean unresolved_reloc;
+@@ -1982,6 +1982,7 @@ sparc64_elf_relocate_section (output_bfd
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
++ orig_addend = rel->r_addend;
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+ }
+ else
+@@ -2211,6 +2212,25 @@ sparc64_elf_relocate_section (output_bfd
+ asection *osec;
+
+ osec = sec->output_section;
++ /* FIXME: As soon as making sections zero size
++ is possible, this if can go away. */
++ if (bfd_is_abs_section (osec)
++ && h == NULL
++ && (sec->flags & SEC_MERGE)
++ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
++ && (elf_section_data (sec)->sec_info_type
++ == ELF_INFO_TYPE_MERGE))
++ {
++ asection *msec;
++
++ msec = sec;
++ _bfd_merged_section_offset (output_bfd, &msec,
++ elf_section_data (sec)->sec_info,
++ sym->st_value + orig_addend,
++ (bfd_vma) 0);
++ osec = msec->output_section;
++ }
++
+ indx = elf_section_data (osec)->dynindx;
+
+ /* FIXME: we really should be able to link non-pic
diff --git a/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-glibc21.patch b/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-glibc21.patch
new file mode 100644
index 0000000..a35b8f8
--- /dev/null
+++ b/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-glibc21.patch
@@ -0,0 +1,58 @@
+--- binutils/ld/emulparams/elf_i386_glibc21.sh.jj Sat Aug 3 17:04:41 2002
++++ binutils/ld/emulparams/elf_i386_glibc21.sh Sat Aug 3 17:04:41 2002
+@@ -0,0 +1,11 @@
++SCRIPT_NAME=elf
++OUTPUT_FORMAT="elf32-i386"
++TEXT_START_ADDR=0x08048000
++MAXPAGESIZE=0x1000
++NONPAGED_TEXT_START_ADDR=0x08048000
++ARCH=i386
++MACHINE=
++NOP=0x9090
++TEMPLATE_NAME=elf32
++GENERATE_SHLIB_SCRIPT=yes
++LIB_PATH=/usr/i386-glibc21-linux/lib:/usr/local/lib
+--- binutils/ld/configure.tgt.jj Thu Aug 1 20:49:32 2002
++++ binutils/ld/configure.tgt Sat Aug 3 17:06:18 2002
+@@ -143,7 +143,8 @@ i[3456]86-*-linux*aout*) targ_emul=i386l
+ ;;
+ i[3456]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+ i[3456]86-*-linux-gnu*) targ_emul=elf_i386
+- targ_extra_emuls=i386linux
++ targ_extra_emuls="i386linux elf_i386_glibc21"
++ targ_extra_libpath=elf_i386_glibc21
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+--- binutils/ld/Makefile.am.jj Thu Aug 1 20:49:32 2002
++++ binutils/ld/Makefile.am Sat Aug 3 17:04:41 2002
+@@ -181,6 +181,7 @@ ALL_EMULATIONS = \
+ eelf_i386.o \
+ eelf_i386_be.o \
+ eelf_i386_chaos.o \
++ eelf_i386_glibc21.o \
+ eelf_i386_fbsd.o \
+ eelf_i386_ldso.o \
+ eelf_s390.o \
+@@ -718,6 +719,9 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf
+ eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_chaos.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
++eelf_i386_glibc21.c: $(srcdir)/emulparams/elf_i386_glibc21.sh \
++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ ${GENSCRIPTS} elf_i386_glibc21 "$(tdir_elf_i386_glibc21)"
+ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
+ $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+--- binutils/ld/Makefile.in.jj Thu Aug 1 20:49:32 2002
++++ binutils/ld/Makefile.in Sat Aug 3 17:07:34 2002
+@@ -1197,6 +1197,9 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf
+ eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_chaos.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
++eelf_i386_glibc21.c: $(srcdir)/emulparams/elf_i386_glibc21.sh \
++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ ${GENSCRIPTS} elf_i386_glibc21 "$(tdir_elf_i386_glibc21)"
+ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
+ $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-gotpc.patch b/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-gotpc.patch
new file mode 100644
index 0000000..030dfa9
--- /dev/null
+++ b/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-gotpc.patch
@@ -0,0 +1,372 @@
+2002-08-03 Jakub Jelinek <jakub@redhat.com>
+
+ * config/tc-i386.c (output_insn): Save frag_now and frag_now_fix ()
+ at start of insn, pass it to output_disp and output_imm.
+ (output_disp): Added arguments. If _GLOBAL_OFFSET_TABLE_ is seen
+ in displacement for R_386_32 reloc, use R_386_GOTPC and compute
+ properly addend.
+ (output_imm): Added arguments. Compute properly addend for
+ R_386_GOTPC.
+ (md_apply_fix3): Remove R_386_GOTPC handling.
+ * testsuite/gas/i386/gotpc.s: New.
+ * testsuite/gas/i386/gotpc.d: New.
+ * testsuite/gas/i386/i386.exp: Add gotpc test.
+
+--- binutils/gas/config/tc-i386.c.jj 2002-07-18 11:35:39.000000000 +0200
++++ binutils/gas/config/tc-i386.c 2002-08-02 21:13:18.000000000 +0200
+@@ -104,8 +104,10 @@ static void output_insn PARAMS ((void));
+ static void output_branch PARAMS ((void));
+ static void output_jump PARAMS ((void));
+ static void output_interseg_jump PARAMS ((void));
+-static void output_imm PARAMS ((void));
+-static void output_disp PARAMS ((void));
++static void output_imm PARAMS ((fragS *insn_start_frag,
++ offsetT insn_start_off));
++static void output_disp PARAMS ((fragS *insn_start_frag,
++ offsetT insn_start_off));
+ #ifndef I386COFF
+ static void s_bss PARAMS ((int));
+ #endif
+@@ -3101,14 +3103,21 @@ output_interseg_jump ()
+ md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2);
+ }
+
++
+ static void
+ output_insn ()
+ {
++ fragS *insn_start_frag;
++ offsetT insn_start_off;
++
+ /* Tie dwarf2 debug info to the address at the start of the insn.
+ We can't do this after the insn has been output as the current
+ frag may have been closed off. eg. by frag_var. */
+ dwarf2_emit_insn (0);
+
++ insn_start_frag = frag_now;
++ insn_start_off = frag_now_fix ();
++
+ /* Output jumps. */
+ if (i.tm.opcode_modifier & Jump)
+ output_branch ();
+@@ -3179,10 +3188,10 @@ output_insn ()
+ }
+
+ if (i.disp_operands)
+- output_disp ();
++ output_disp (insn_start_frag, insn_start_off);
+
+ if (i.imm_operands)
+- output_imm ();
++ output_imm (insn_start_frag, insn_start_off);
+ }
+
+ #ifdef DEBUG386
+@@ -3194,7 +3203,9 @@ output_insn ()
+ }
+
+ static void
+-output_disp ()
++output_disp (insn_start_frag, insn_start_off)
++ fragS *insn_start_frag;
++ offsetT insn_start_off;
+ {
+ char *p;
+ unsigned int n;
+@@ -3224,6 +3235,7 @@ output_disp ()
+ }
+ else
+ {
++ RELOC_ENUM reloc_type;
+ int size = 4;
+ int sign = 0;
+ int pcrel = (i.flags[n] & Operand_PCrel) != 0;
+@@ -3266,16 +3278,50 @@ output_disp ()
+ }
+
+ p = frag_more (size);
++ reloc_type = reloc (size, pcrel, sign, i.reloc[n]);
++#ifdef BFD_ASSEMBLER
++ if (reloc_type == BFD_RELOC_32
++ && GOT_symbol
++ && GOT_symbol == i.op[n].disps->X_add_symbol
++ && (i.op[n].disps->X_op == O_symbol
++ || (i.op[n].disps->X_op == O_add
++ && ((symbol_get_value_expression
++ (i.op[n].disps->X_op_symbol)->X_op)
++ == O_subtract))))
++ {
++ offsetT add;
++
++ if (insn_start_frag == frag_now)
++ add = (p - frag_now->fr_literal) - insn_start_off;
++ else
++ {
++ fragS *fr;
++
++ add = insn_start_frag->fr_fix - insn_start_off;
++ for (fr = insn_start_frag->fr_next;
++ fr && fr != frag_now; fr = fr->fr_next)
++ add += fr->fr_fix;
++ add += p - frag_now->fr_literal;
++ }
++
++ /* We don't support dynamic linking on x86-64 yet. */
++ if (flag_code == CODE_64BIT)
++ abort ();
++ reloc_type = BFD_RELOC_386_GOTPC;
++ i.op[n].disps->X_add_number += add;
++ }
++#endif
+ fix_new_exp (frag_now, p - frag_now->fr_literal, size,
+- i.op[n].disps, pcrel,
+- reloc (size, pcrel, sign, i.reloc[n]));
++ i.op[n].disps, pcrel, reloc_type);
+ }
+ }
+ }
+ }
+
+ static void
+-output_imm ()
++output_imm (insn_start_frag, insn_start_off)
++ fragS *insn_start_frag;
++ offsetT insn_start_off;
+ {
+ char *p;
+ unsigned int n;
+@@ -3328,6 +3374,48 @@ output_imm ()
+ p = frag_more (size);
+ reloc_type = reloc (size, 0, sign, i.reloc[n]);
+ #ifdef BFD_ASSEMBLER
++ /* This is tough to explain. We end up with this one if we
++ * have operands that look like
++ * "_GLOBAL_OFFSET_TABLE_+[.-.L284]". The goal here is to
++ * obtain the absolute address of the GOT, and it is strongly
++ * preferable from a performance point of view to avoid using
++ * a runtime relocation for this. The actual sequence of
++ * instructions often look something like:
++ *
++ * call .L66
++ * .L66:
++ * popl %ebx
++ * addl $_GLOBAL_OFFSET_TABLE_+[.-.L66],%ebx
++ *
++ * The call and pop essentially return the absolute address
++ * of the label .L66 and store it in %ebx. The linker itself
++ * will ultimately change the first operand of the addl so
++ * that %ebx points to the GOT, but to keep things simple, the
++ * .o file must have this operand set so that it generates not
++ * the absolute address of .L66, but the absolute address of
++ * itself. This allows the linker itself simply treat a GOTPC
++ * relocation as asking for a pcrel offset to the GOT to be
++ * added in, and the addend of the relocation is stored in the
++ * operand field for the instruction itself.
++ *
++ * Our job here is to fix the operand so that it would add
++ * the correct offset so that %ebx would point to itself. The
++ * thing that is tricky is that .-.L66 will point to the
++ * beginning of the instruction, so we need to further modify
++ * the operand so that it will point to itself. There are
++ * other cases where you have something like:
++ *
++ * .long $_GLOBAL_OFFSET_TABLE_+[.-.L66]
++ *
++ * and here no correction would be required. Internally in
++ * the assembler we treat operands of this form as not being
++ * pcrel since the '.' is explicitly mentioned, and I wonder
++ * whether it would simplify matters to do it this way. Who
++ * knows. In earlier versions of the PIC patches, the
++ * pcrel_adjust field was used to store the correction, but
++ * since the expression is not pcrel, I felt it would be
++ * confusing to do it this way. */
++
+ if (reloc_type == BFD_RELOC_32
+ && GOT_symbol
+ && GOT_symbol == i.op[n].imms->X_add_symbol
+@@ -3337,11 +3425,26 @@ output_imm ()
+ (i.op[n].imms->X_op_symbol)->X_op)
+ == O_subtract))))
+ {
++ offsetT add;
++
++ if (insn_start_frag == frag_now)
++ add = (p - frag_now->fr_literal) - insn_start_off;
++ else
++ {
++ fragS *fr;
++
++ add = insn_start_frag->fr_fix - insn_start_off;
++ for (fr = insn_start_frag->fr_next;
++ fr && fr != frag_now; fr = fr->fr_next)
++ add += fr->fr_fix;
++ add += p - frag_now->fr_literal;
++ }
++
+ /* We don't support dynamic linking on x86-64 yet. */
+ if (flag_code == CODE_64BIT)
+ abort ();
+ reloc_type = BFD_RELOC_386_GOTPC;
+- i.op[n].imms->X_add_number += 3;
++ i.op[n].imms->X_add_number += add;
+ }
+ #endif
+ fix_new_exp (frag_now, p - frag_now->fr_literal, size,
+@@ -4542,48 +4645,6 @@ md_apply_fix3 (fixP, valP, seg)
+ runtime we merely add the offset to the actual PLT entry. */
+ value = -4;
+ break;
+- case BFD_RELOC_386_GOTPC:
+-
+-/* This is tough to explain. We end up with this one if we have
+- * operands that look like "_GLOBAL_OFFSET_TABLE_+[.-.L284]". The goal
+- * here is to obtain the absolute address of the GOT, and it is strongly
+- * preferable from a performance point of view to avoid using a runtime
+- * relocation for this. The actual sequence of instructions often look
+- * something like:
+- *
+- * call .L66
+- * .L66:
+- * popl %ebx
+- * addl $_GLOBAL_OFFSET_TABLE_+[.-.L66],%ebx
+- *
+- * The call and pop essentially return the absolute address of
+- * the label .L66 and store it in %ebx. The linker itself will
+- * ultimately change the first operand of the addl so that %ebx points to
+- * the GOT, but to keep things simple, the .o file must have this operand
+- * set so that it generates not the absolute address of .L66, but the
+- * absolute address of itself. This allows the linker itself simply
+- * treat a GOTPC relocation as asking for a pcrel offset to the GOT to be
+- * added in, and the addend of the relocation is stored in the operand
+- * field for the instruction itself.
+- *
+- * Our job here is to fix the operand so that it would add the correct
+- * offset so that %ebx would point to itself. The thing that is tricky is
+- * that .-.L66 will point to the beginning of the instruction, so we need
+- * to further modify the operand so that it will point to itself.
+- * There are other cases where you have something like:
+- *
+- * .long $_GLOBAL_OFFSET_TABLE_+[.-.L66]
+- *
+- * and here no correction would be required. Internally in the assembler
+- * we treat operands of this form as not being pcrel since the '.' is
+- * explicitly mentioned, and I wonder whether it would simplify matters
+- * to do it this way. Who knows. In earlier versions of the PIC patches,
+- * the pcrel_adjust field was used to store the correction, but since the
+- * expression is not pcrel, I felt it would be confusing to do it this
+- * way. */
+-
+- value -= 1;
+- break;
+ case BFD_RELOC_386_GOT32:
+ case BFD_RELOC_386_TLS_GD:
+ case BFD_RELOC_386_TLS_LDM:
+--- binutils/gas/testsuite/gas/i386/gotpc.s.jj 2002-08-02 21:17:57.000000000 +0200
++++ binutils/gas/testsuite/gas/i386/gotpc.s 2002-08-03 22:55:47.000000000 +0200
+@@ -0,0 +1,40 @@
++ .text
++test:
++ addl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
++ addl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
++ addl $_GLOBAL_OFFSET_TABLE_, %eax
++ addl $_GLOBAL_OFFSET_TABLE_, %ebx
++ leal _GLOBAL_OFFSET_TABLE+[.-test](%eax), %ebx
++ leal _GLOBAL_OFFSET_TABLE+[.-test](%ebx), %eax
++ leal _GLOBAL_OFFSET_TABLE+[.-test](%eax), %eax
++ leal _GLOBAL_OFFSET_TABLE+[.-test](%ebx), %ebx
++ subl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
++ subl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
++ subl $_GLOBAL_OFFSET_TABLE_, %eax
++ subl $_GLOBAL_OFFSET_TABLE_, %ebx
++ orl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
++ orl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
++ orl $_GLOBAL_OFFSET_TABLE_, %eax
++ orl $_GLOBAL_OFFSET_TABLE_, %ebx
++ movl $_GLOBAL_OFFSET_TABLE_+[.-test], %eax
++ movl $_GLOBAL_OFFSET_TABLE_+[.-test], %ebx
++ movl $_GLOBAL_OFFSET_TABLE_, %eax
++ movl $_GLOBAL_OFFSET_TABLE_, %ebx
++ movl $_GLOBAL_OFFSET_TABLE_+[.-test], foo
++ movl $_GLOBAL_OFFSET_TABLE_+[.-test], %gs:foo
++ gs; movl $_GLOBAL_OFFSET_TABLE_+[.-test], foo
++ movl $_GLOBAL_OFFSET_TABLE_+[.-test], _GLOBAL_OFFSET_TABLE_
++ movl _GLOBAL_OFFSET_TABLE_+[.-test], %eax
++ movl _GLOBAL_OFFSET_TABLE_+[.-test], %ebx
++ movl %eax, _GLOBAL_OFFSET_TABLE_+[.-test]
++ movl %ebx, _GLOBAL_OFFSET_TABLE_+[.-test]
++ movl %eax, %gs:_GLOBAL_OFFSET_TABLE_+[.-test]
++ movl %ebx, %gs:_GLOBAL_OFFSET_TABLE_+[.-test]
++ gs; movl %eax, _GLOBAL_OFFSET_TABLE_+[.-test]
++ gs; movl %ebx, _GLOBAL_OFFSET_TABLE_+[.-test]
++ leal _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %eax
++ leal _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %ebx
++ movl _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %eax
++ movl _GLOBAL_OFFSET_TABLE_@GOTOFF(%ebx), %ebx
++ .long _GLOBAL_OFFSET_TABLE_+[.-test]
++ .long _GLOBAL_OFFSET_TABLE_@GOTOFF
+--- binutils/gas/testsuite/gas/i386/gotpc.d.jj 2002-08-02 21:18:43.000000000 +0200
++++ binutils/gas/testsuite/gas/i386/gotpc.d 2002-08-03 23:05:43.000000000 +0200
+@@ -0,0 +1,52 @@
++#objdump: -drw
++#name: i386 gotpc
++
++.*: +file format .*
++
++Disassembly of section .text:
++
++0+000 <test>:
++ 0: 05 01 00 00 00 [ ]*add \$0x1,%eax 1: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 5: 81 c3 07 00 00 00 [ ]*add \$0x7,%ebx 7: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ b: 05 01 00 00 00 [ ]*add \$0x1,%eax c: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 10: 81 c3 02 00 00 00 [ ]*add \$0x2,%ebx 12: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 16: 8d 98 16 00 00 00 [ ]*lea 0x16\(%eax\),%ebx 18: (R_386_)?(dir)?32 _GLOBAL_OFFSET_TABLE
++ 1c: 8d 83 1c 00 00 00 [ ]*lea 0x1c\(%ebx\),%eax 1e: (R_386_)?(dir)?32 _GLOBAL_OFFSET_TABLE
++ 22: 8d 80 22 00 00 00 [ ]*lea 0x22\(%eax\),%eax 24: (R_386_)?(dir)?32 _GLOBAL_OFFSET_TABLE
++ 28: 8d 9b 28 00 00 00 [ ]*lea 0x28\(%ebx\),%ebx 2a: (R_386_)?(dir)?32 _GLOBAL_OFFSET_TABLE
++ 2e: 2d 2f 00 00 00 [ ]*sub \$0x2f,%eax 2f: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 33: 81 eb 35 00 00 00 [ ]*sub \$0x35,%ebx 35: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 39: 2d 01 00 00 00 [ ]*sub \$0x1,%eax 3a: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 3e: 81 eb 02 00 00 00 [ ]*sub \$0x2,%ebx 40: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 44: 0d 45 00 00 00 [ ]*or \$0x45,%eax 45: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 49: 81 cb 4b 00 00 00 [ ]*or \$0x4b,%ebx 4b: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 4f: 0d 01 00 00 00 [ ]*or \$0x1,%eax 50: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 54: 81 cb 02 00 00 00 [ ]*or \$0x2,%ebx 56: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 5a: b8 5b 00 00 00 [ ]*mov \$0x5b,%eax 5b: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 5f: bb 60 00 00 00 [ ]*mov \$0x60,%ebx 60: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 64: b8 01 00 00 00 [ ]*mov \$0x1,%eax 65: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 69: bb 01 00 00 00 [ ]*mov \$0x1,%ebx 6a: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 6e: c7 05 00 00 00 00 74 00 00 00 [ ]*movl \$0x74,0x0 70: (R_386_)?(dir)?32 foo
++[ ]*74: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 78: 65 c7 05 00 00 00 00 7f 00 00 00 [ ]*movl \$0x7f,%gs:0x0 7b: (R_386_)?(dir)?32 foo
++[ ]*7f: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 83: 65 c7 05 00 00 00 00 8a 00 00 00 [ ]*movl \$0x8a,%gs:0x0 86: (R_386_)?(dir)?32 foo
++[ ]*8a: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 8e: c7 05 02 00 00 00 94 00 00 00 [ ]*movl \$0x94,0x2 90: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++[ ]*94: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 98: a1 99 00 00 00 [ ]*mov 0x99,%eax 99: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ 9d: 8b 1d 9f 00 00 00 [ ]*mov 0x9f,%ebx 9f: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ a3: a3 a4 00 00 00 [ ]*mov %eax,0xa4 a4: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ a8: 89 1d aa 00 00 00 [ ]*mov %ebx,0xaa aa: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ ae: 65 a3 b0 00 00 00 [ ]*mov %eax,%gs:0xb0 b0: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ b4: 65 89 1d b7 00 00 00 [ ]*mov %ebx,%gs:0xb7 b7: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ bb: 65 a3 bd 00 00 00 [ ]*mov %eax,%gs:0xbd bd: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ c1: 65 89 1d c4 00 00 00 [ ]*mov %ebx,%gs:0xc4 c4: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ c8: 8d 83 00 00 00 00 [ ]*lea 0x0\(%ebx\),%eax ca: (R_386_)?GOTOFF _GLOBAL_OFFSET_TABLE_
++ ce: 8d 9b 00 00 00 00 [ ]*lea 0x0\(%ebx\),%ebx d0: (R_386_)?GOTOFF _GLOBAL_OFFSET_TABLE_
++ d4: 8b 83 00 00 00 00 [ ]*mov 0x0\(%ebx\),%eax d6: (R_386_)?GOTOFF _GLOBAL_OFFSET_TABLE_
++ da: 8b 9b 00 00 00 00 [ ]*mov 0x0\(%ebx\),%ebx dc: (R_386_)?GOTOFF _GLOBAL_OFFSET_TABLE_
++ e0: e0 00 [ ]*loopne e2 <test\+0xe2> e0: (R_386_)?GOTPC _GLOBAL_OFFSET_TABLE_
++ e2: 00 00 [ ]*add %al,\(%eax\)
++ e4: 00 00 [ ]*add %al,\(%eax\) e4: (R_386_)?GOTOFF _GLOBAL_OFFSET_TABLE_
++ ...
+--- binutils/gas/testsuite/gas/i386/i386.exp.jj 2002-07-18 11:35:39.000000000 +0200
++++ binutils/gas/testsuite/gas/i386/i386.exp 2002-08-02 21:57:46.000000000 +0200
+@@ -53,6 +53,7 @@ if [expr ([istarget "i*86-*-*"] || [ist
+ run_dump_test "jump"
+ run_dump_test "ssemmx2"
+ run_dump_test "sse2"
++ run_dump_test "gotpc"
+
+ # PIC is only supported on ELF targets.
+ if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"] )
+
diff --git a/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-tpoff32.patch b/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-tpoff32.patch
new file mode 100644
index 0000000..511a11e
--- /dev/null
+++ b/patches/binutils/2.13.90.0.2/rh62-binutils-2.13.90.0.2-tpoff32.patch
@@ -0,0 +1,27 @@
+2002-08-07 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
+ for R_386_TLS_TPOFF32 relocs against symndx 0.
+
+--- binutils/bfd/elf32-i386.c.jj 2002-07-30 16:14:55.000000000 +0200
++++ binutils/bfd/elf32-i386.c 2002-08-07 23:41:48.000000000 +0200
+@@ -2561,13 +2567,17 @@ elf_i386_relocate_section (output_bfd, i
+ outrel.r_offset = (htab->sgot->output_section->vma
+ + htab->sgot->output_offset + off);
+
+- bfd_put_32 (output_bfd, 0,
+- htab->sgot->contents + off);
+ indx = h && h->dynindx != -1 ? h->dynindx : 0;
+ if (r_type == R_386_TLS_GD)
+ dr_type = R_386_TLS_DTPMOD32;
+ else
+ dr_type = R_386_TLS_TPOFF32;
++ if (dr_type == R_386_TLS_TPOFF32 && indx == 0)
++ bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
++ htab->sgot->contents + off);
++ else
++ bfd_put_32 (output_bfd, 0,
++ htab->sgot->contents + off);
+ outrel.r_info = ELF32_R_INFO (indx, dr_type);
+ loc = (Elf32_External_Rel *) htab->srelgot->contents;
+ loc += htab->srelgot->reloc_count++;
diff --git a/patches/binutils/2.14.90.0.5/binutils-cross-demangler.patch b/patches/binutils/2.14.90.0.5/binutils-cross-demangler.patch
new file mode 100644
index 0000000..ec701ce
--- /dev/null
+++ b/patches/binutils/2.14.90.0.5/binutils-cross-demangler.patch
@@ -0,0 +1,11 @@
+--- orig/Makefile.in 2004-05-12 18:22:30.000000000 -0700
++++ binutils-2.14.90.0.5/Makefile.in 2004-05-12 18:26:19.000000000 -0700
+@@ -24384,6 +24384,8 @@
+ # Demangler depends on libiberty.
+ configure-demangler: maybe-configure-libiberty
+ all-demangler: maybe-all-libiberty
++configure-build-demangler: maybe-configure-build-libiberty
++all-build-demangler: maybe-all-build-libiberty
+
+ # The new demangler, which is included in libiberty, is written in C++.
+ # A working C++ compiler is required. For the target demangler, it may
diff --git a/patches/binutils/2.14.90.0.5/binutils-sh-relocs.patch b/patches/binutils/2.14.90.0.5/binutils-sh-relocs.patch
new file mode 100644
index 0000000..ca0f2ac
--- /dev/null
+++ b/patches/binutils/2.14.90.0.5/binutils-sh-relocs.patch
@@ -0,0 +1,38 @@
+Message-Id: <200307311239.h6VCdNe27056@r-rr.iij4u.or.jp>
+To: dank@kegel.com
+Cc: kkojima@rr.iij4u.or.jp
+Subject: Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails
+ with "libc.so: text relocations used" in glibc-2.3.2 for sh4)
+In-Reply-To: Your message of "Wed, 30 Jul 2003 21:55:54 -0700"
+ <3F28A15A.5010400@kegel.com>
+References: <3F28A15A.5010400@kegel.com>
+Date: Thu, 31 Jul 2003 21:47:38 +0900
+From: kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+Dan Kegel <dank@kegel.com> wrote:
+>> I'll give binutils-2.14.90.0.5 a shot, then.
+>
+> No joy - same problem. Guess I'll take this up on binutils and/or libc-alpha.
+
+Please try the patch below, though it's a diff against the current
+binutils CVS.
+
+Regards,
+ kaz
+--
+diff -u3p ORIG/src/bfd/elf32-sh.c LOCAL/src/bfd/elf32-sh.c
+--- src/bfd/elf32-sh.c.old Fri Jul 25 14:46:58 2003
++++ src/bfd/elf32-sh.c Thu Jul 31 21:09:38 2003
+@@ -6497,8 +6497,10 @@ sh_elf_check_relocs (bfd *abfd, struct b
+ sreloc, 2))
+ return FALSE;
+ }
++#if 0
+ if (sec->flags & SEC_READONLY)
+ info->flags |= DF_TEXTREL;
++#endif
+ elf_section_data (sec)->sreloc = sreloc;
+ }
+
+
+
diff --git a/patches/binutils/2.14.90.0.7/binutils-cross-demangler.patch b/patches/binutils/2.14.90.0.7/binutils-cross-demangler.patch
new file mode 100644
index 0000000..ec701ce
--- /dev/null
+++ b/patches/binutils/2.14.90.0.7/binutils-cross-demangler.patch
@@ -0,0 +1,11 @@
+--- orig/Makefile.in 2004-05-12 18:22:30.000000000 -0700
++++ binutils-2.14.90.0.5/Makefile.in 2004-05-12 18:26:19.000000000 -0700
+@@ -24384,6 +24384,8 @@
+ # Demangler depends on libiberty.
+ configure-demangler: maybe-configure-libiberty
+ all-demangler: maybe-all-libiberty
++configure-build-demangler: maybe-configure-build-libiberty
++all-build-demangler: maybe-all-build-libiberty
+
+ # The new demangler, which is included in libiberty, is written in C++.
+ # A working C++ compiler is required. For the target demangler, it may
diff --git a/patches/binutils/2.14.92/binutils-skip-comments.patch b/patches/binutils/2.14.92/binutils-skip-comments.patch
new file mode 100644
index 0000000..804a17e
--- /dev/null
+++ b/patches/binutils/2.14.92/binutils-skip-comments.patch
@@ -0,0 +1,101 @@
+Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
+Fixes
+localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
+when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
+
+Paths adjusted to match crosstool's patcher.
+
+Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
+From: Andreas Schwab <schwab at suse dot de>
+To: Nathan Sidwell <nathan at codesourcery dot com>
+Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
+Date: Fri, 23 Apr 2004 22:27:19 +0200
+Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
+
+Nathan Sidwell <nathan@codesourcery.com> writes:
+
+> Index: read.c
+> ===================================================================
+> RCS file: /cvs/src/src/gas/read.c,v
+> retrieving revision 1.76
+> diff -c -3 -p -r1.76 read.c
+> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
+> --- read.c 18 Mar 2004 09:56:05 -0000
+> *************** read_a_source_file (char *name)
+> *** 1053,1059 ****
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! ignore_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+> --- 1053,1059 ----
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! demand_empty_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+
+This means that the unknown character is no longer ignored, despite the
+comment. As a side effect a line starting with a line comment character
+not followed by APP in NO_APP mode now triggers an error instead of just a
+warning, breaking builds of glibc on m68k-linux. Earlier in
+read_a_source_file where #APP is handled there is another comment that
+claims that unknown comments are ignored, when in fact they aren't (only
+the initial line comment character is skipped).
+
+Note that the presence of #APP will mess up the line counters, but
+that appears to be difficult to fix.
+
+Andreas.
+
+2004-04-23 Andreas Schwab <schwab@suse.de>
+
+ * read.c (read_a_source_file): Ignore unknown text after line
+ comment character. Fix misleading comment.
+
+--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
+@@ -1,6 +1,6 @@
+ /* read.c - read a source file -
+ Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+@@ -950,10 +950,14 @@ read_a_source_file (char *name)
+ unsigned int new_length;
+ char *tmp_buf = 0;
+
+- bump_line_counters ();
+ s = input_line_pointer;
+ if (strncmp (s, "APP\n", 4))
+- continue; /* We ignore it */
++ {
++ /* We ignore it */
++ ignore_rest_of_line ();
++ continue;
++ }
++ bump_line_counters ();
+ s += 4;
+
+ sb_new (&sbuf);
+@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
+ continue;
+ #endif
+ input_line_pointer--;
+- /* Report unknown char as ignored. */
++ /* Report unknown char as error. */
+ demand_empty_rest_of_line ();
+ }
+
+
+--
+Andreas Schwab, SuSE Labs, schwab@suse.de
+SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
+Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
+"And now for something completely different."
diff --git a/patches/binutils/2.14.92/gccpr15247-fix.patch b/patches/binutils/2.14.92/gccpr15247-fix.patch
new file mode 100644
index 0000000..967bf7f
--- /dev/null
+++ b/patches/binutils/2.14.92/gccpr15247-fix.patch
@@ -0,0 +1,192 @@
+See
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247
+
+Fixes spurious error
+/tmp/ccvNi4ou.s: Assembler messages:
+/tmp/ccvNi4ou.s:2310: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/math/dosincos.o] Error 1
+
+when compiling glibc's dosincos.c with gcc-3.4.0
+
+===================================================================
+RCS file: /cvs/src/src/opcodes/sparc-opc.c,v
+retrieving revision 1.9
+retrieving revision 1.10
+diff -u -r1.9 -r1.10
+--- src/opcodes/sparc-opc.c 2004/01/18 23:46:32 1.9
++++ src/opcodes/sparc-opc.c 2004/04/20 10:23:51 1.10
+@@ -1273,110 +1273,72 @@
+ #define FM_DF 2 /* v9 */
+ #define FM_QF 3 /* v9 */
+
+-#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags, v9 }
+-
+-#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 }
++#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags, v9 }
++
++#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 }
+
+ /* FIXME: use fmovicc/fmovfcc? */ /* v9 */
+-#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 }
+-
+-/* v9 */ fmovcc ("fmovda", FM_DF, CONDA, FCONDA, 0),
+-/* v9 */ fmovcc ("fmovqa", FM_QF, CONDA, FCONDA, 0),
+-/* v9 */ fmovcc ("fmovsa", FM_SF, CONDA, FCONDA, 0),
+-/* v9 */ fmovicc ("fmovdcc", FM_DF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovqcc", FM_QF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovscc", FM_SF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovdcs", FM_DF, CONDCS, 0),
+-/* v9 */ fmovicc ("fmovqcs", FM_QF, CONDCS, 0),
+-/* v9 */ fmovicc ("fmovscs", FM_SF, CONDCS, 0),
+-/* v9 */ fmovcc ("fmovde", FM_DF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovqe", FM_QF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovse", FM_SF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovdg", FM_DF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovqg", FM_QF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovsg", FM_SF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovdge", FM_DF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovcc ("fmovqge", FM_QF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovcc ("fmovsge", FM_SF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovicc ("fmovdgeu", FM_DF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovqgeu", FM_QF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovsgeu", FM_SF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovdgu", FM_DF, CONDGU, 0),
+-/* v9 */ fmovicc ("fmovqgu", FM_QF, CONDGU, 0),
+-/* v9 */ fmovicc ("fmovsgu", FM_SF, CONDGU, 0),
+-/* v9 */ fmovcc ("fmovdl", FM_DF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovql", FM_QF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovsl", FM_SF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovdle", FM_DF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovcc ("fmovqle", FM_QF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovcc ("fmovsle", FM_SF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovicc ("fmovdleu", FM_DF, CONDLEU, 0),
+-/* v9 */ fmovicc ("fmovqleu", FM_QF, CONDLEU, 0),
+-/* v9 */ fmovicc ("fmovsleu", FM_SF, CONDLEU, 0),
+-/* v9 */ fmovfcc ("fmovdlg", FM_DF, FCONDLG, 0),
+-/* v9 */ fmovfcc ("fmovqlg", FM_QF, FCONDLG, 0),
+-/* v9 */ fmovfcc ("fmovslg", FM_SF, FCONDLG, 0),
+-/* v9 */ fmovicc ("fmovdlu", FM_DF, CONDLU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovqlu", FM_QF, CONDLU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovslu", FM_SF, CONDLU, F_ALIAS),
+-/* v9 */ fmovcc ("fmovdn", FM_DF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovqn", FM_QF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovsn", FM_SF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovdne", FM_DF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovcc ("fmovqne", FM_QF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovcc ("fmovsne", FM_SF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovicc ("fmovdneg", FM_DF, CONDNEG, 0),
+-/* v9 */ fmovicc ("fmovqneg", FM_QF, CONDNEG, 0),
+-/* v9 */ fmovicc ("fmovsneg", FM_SF, CONDNEG, 0),
+-/* v9 */ fmovcc ("fmovdnz", FM_DF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovqnz", FM_QF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovsnz", FM_SF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovfcc ("fmovdo", FM_DF, FCONDO, 0),
+-/* v9 */ fmovfcc ("fmovqo", FM_QF, FCONDO, 0),
+-/* v9 */ fmovfcc ("fmovso", FM_SF, FCONDO, 0),
+-/* v9 */ fmovicc ("fmovdpos", FM_DF, CONDPOS, 0),
+-/* v9 */ fmovicc ("fmovqpos", FM_QF, CONDPOS, 0),
+-/* v9 */ fmovicc ("fmovspos", FM_SF, CONDPOS, 0),
+-/* v9 */ fmovfcc ("fmovdu", FM_DF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovqu", FM_QF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovsu", FM_SF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovdue", FM_DF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovque", FM_QF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovsue", FM_SF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovdug", FM_DF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovqug", FM_QF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovsug", FM_SF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovduge", FM_DF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovquge", FM_QF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovsuge", FM_SF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovdul", FM_DF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovqul", FM_QF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovsul", FM_SF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovdule", FM_DF, FCONDULE, 0),
+-/* v9 */ fmovfcc ("fmovqule", FM_QF, FCONDULE, 0),
+-/* v9 */ fmovfcc ("fmovsule", FM_SF, FCONDULE, 0),
+-/* v9 */ fmovicc ("fmovdvc", FM_DF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovqvc", FM_QF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovsvc", FM_SF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovdvs", FM_DF, CONDVS, 0),
+-/* v9 */ fmovicc ("fmovqvs", FM_QF, CONDVS, 0),
+-/* v9 */ fmovicc ("fmovsvs", FM_SF, CONDVS, 0),
+-/* v9 */ fmovcc ("fmovdz", FM_DF, CONDZ, FCONDZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovqz", FM_QF, CONDZ, FCONDZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovsz", FM_SF, CONDZ, FCONDZ, F_ALIAS),
+-
++#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 }
++
++#define fmovicc(suffix, cond, flags) /* v9 */ \
++fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags), \
++fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags), \
++fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags)
++
++#define fmovfcc(suffix, fcond, flags) /* v9 */ \
++fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags), \
++fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags), \
++fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags)
++
++#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \
++fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags), \
++fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags), \
++fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags)
++
++/* v9 */ fmovcc ("a", CONDA, FCONDA, 0),
++/* v9 */ fmovicc ("cc", CONDCC, 0),
++/* v9 */ fmovicc ("cs", CONDCS, 0),
++/* v9 */ fmovcc ("e", CONDE, FCONDE, 0),
++/* v9 */ fmovcc ("g", CONDG, FCONDG, 0),
++/* v9 */ fmovcc ("ge", CONDGE, FCONDGE, 0),
++/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS),
++/* v9 */ fmovicc ("gu", CONDGU, 0),
++/* v9 */ fmovcc ("l", CONDL, FCONDL, 0),
++/* v9 */ fmovcc ("le", CONDLE, FCONDLE, 0),
++/* v9 */ fmovicc ("leu", CONDLEU, 0),
++/* v9 */ fmovfcc ("lg", FCONDLG, 0),
++/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS),
++/* v9 */ fmovcc ("n", CONDN, FCONDN, 0),
++/* v9 */ fmovcc ("ne", CONDNE, FCONDNE, 0),
++/* v9 */ fmovicc ("neg", CONDNEG, 0),
++/* v9 */ fmovcc ("nz", CONDNZ, FCONDNZ, F_ALIAS),
++/* v9 */ fmovfcc ("o", FCONDO, 0),
++/* v9 */ fmovicc ("pos", CONDPOS, 0),
++/* v9 */ fmovfcc ("u", FCONDU, 0),
++/* v9 */ fmovfcc ("ue", FCONDUE, 0),
++/* v9 */ fmovfcc ("ug", FCONDUG, 0),
++/* v9 */ fmovfcc ("uge", FCONDUGE, 0),
++/* v9 */ fmovfcc ("ul", FCONDUL, 0),
++/* v9 */ fmovfcc ("ule", FCONDULE, 0),
++/* v9 */ fmovicc ("vc", CONDVC, 0),
++/* v9 */ fmovicc ("vs", CONDVS, 0),
++/* v9 */ fmovcc ("z", CONDZ, FCONDZ, F_ALIAS),
++
++#undef fmoviccx /* v9 */
++#undef fmovfccx /* v9 */
++#undef fmovccx /* v9 */
+ #undef fmovicc /* v9 */
+ #undef fmovfcc /* v9 */
+ #undef fmovcc /* v9 */
diff --git a/patches/binutils/2.14/binutils-sh-relocs.patch b/patches/binutils/2.14/binutils-sh-relocs.patch
new file mode 100644
index 0000000..ca0f2ac
--- /dev/null
+++ b/patches/binutils/2.14/binutils-sh-relocs.patch
@@ -0,0 +1,38 @@
+Message-Id: <200307311239.h6VCdNe27056@r-rr.iij4u.or.jp>
+To: dank@kegel.com
+Cc: kkojima@rr.iij4u.or.jp
+Subject: Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails
+ with "libc.so: text relocations used" in glibc-2.3.2 for sh4)
+In-Reply-To: Your message of "Wed, 30 Jul 2003 21:55:54 -0700"
+ <3F28A15A.5010400@kegel.com>
+References: <3F28A15A.5010400@kegel.com>
+Date: Thu, 31 Jul 2003 21:47:38 +0900
+From: kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+Dan Kegel <dank@kegel.com> wrote:
+>> I'll give binutils-2.14.90.0.5 a shot, then.
+>
+> No joy - same problem. Guess I'll take this up on binutils and/or libc-alpha.
+
+Please try the patch below, though it's a diff against the current
+binutils CVS.
+
+Regards,
+ kaz
+--
+diff -u3p ORIG/src/bfd/elf32-sh.c LOCAL/src/bfd/elf32-sh.c
+--- src/bfd/elf32-sh.c.old Fri Jul 25 14:46:58 2003
++++ src/bfd/elf32-sh.c Thu Jul 31 21:09:38 2003
+@@ -6497,8 +6497,10 @@ sh_elf_check_relocs (bfd *abfd, struct b
+ sreloc, 2))
+ return FALSE;
+ }
++#if 0
+ if (sec->flags & SEC_READONLY)
+ info->flags |= DF_TEXTREL;
++#endif
+ elf_section_data (sec)->sreloc = sreloc;
+ }
+
+
+
diff --git a/patches/binutils/2.15.90.0.3/binutils-20040817-linkonce.patch b/patches/binutils/2.15.90.0.3/binutils-20040817-linkonce.patch
new file mode 100644
index 0000000..97fa6ee
--- /dev/null
+++ b/patches/binutils/2.15.90.0.3/binutils-20040817-linkonce.patch
@@ -0,0 +1,118 @@
+From http://sources.redhat.com/ml/binutils/2004-08/msg00190.html
+
+Date: Tue, 17 Aug 2004 12:04:29 +0200
+From: Jakub Jelinek <jakub at redhat dot com>
+To: binutils at sources dot redhat dot com
+Subject: [PATCH] Fix `defined in discarded section' errors when building ia64 gcc
+Message-ID: <20040817100429.GL30497@sunsite.ms.mff.cuni.cz>
+Reply-To: Jakub Jelinek <jakub at redhat dot com>
+References: <20040817090201.GK30497@sunsite.ms.mff.cuni.cz>
+In-Reply-To: <20040817090201 dot GK30497 at sunsite dot ms dot mff dot cuni dot cz>
+
+On Tue, Aug 17, 2004 at 11:02:01AM +0200, Jakub Jelinek wrote:
+> Current gcc 3.4.x (at least gcc-3_4-rhl-branch) doesn't build with CVS
+> binutils (nor 2.15.91.0.2).
+> The problem is that libstdc++.so linking fails with:
+> `.gnu.linkonce.t._ZNSdD2Ev' referenced in section `.gnu.linkonce.ia64unw._ZNSdD2Ev' of .libs/sstream-inst.o: defined in discarded section `.gnu.linkonce.t._ZNSdD2Ev' of .libs/sstream-inst.o
+> The problem is that both io-inst.s and sstream-inst.s have
+> .gnu.linkonce.t._ZNSdD2Ev definition, but because io-inst.cc
+> also instantiates some templates sstream-inst.cc doesn't instantiate,
+> the inliner can do a better job in io-inst.cc.
+> The result is that _ZNSdD2Ev in io-inst.cc is a leaf routine, while
+> it is not in sstream-inst.cc (in assembly,
+> _ZNSdD2Ev in io-inst.s starts with .prologue and no .save directives,
+> while _ZNSdD2Ev] in sstream-inst.s has .prologue 12, 35 and some
+> .save directives.
+> IA-64 ABI allows leaf routines to have no unwind section at all,
+> which means .gnu.linkonce.ia64unw._ZNSdD2Ev is not created in
+> io-inst.o at all and as .gnu.linkonce.t._ZNSdD2Ev comes first
+> and wins, .gnu.linkonce.ia64unw._ZNSdD2Ev in sstream.o suddenly
+> references a discarded section.
+>
+> Not sure what should be done here, but certainly the compiler
+> isn't at fault here, it is a binutils problem.
+> One fix could be to create empty .gnu.linkonce.ia64unw.* section
+> in assembler, another special case ia64 unwind sections in the linker.
+
+Here is a patch for the first possibility.
+It certainly makes libstdc++.so to link and even the unwind info looks
+good on brief skimming.
+
+2004-08-17 Jakub Jelinek <jakub@redhat.com>
+
+ * config/tc-ia64.c (start_unwind_section): Add linkonce_empty
+ argument, don't do anything if current section is not
+ .gnu.linkonce.t.* and linkonce_empty is set.
+ (generate_unwind_image, dot_endp): Adjust callers, call
+ start_unwind_section (*, 1) if nothing will be put into the
+ section.
+
+--- binutils/gas/config/tc-ia64.c.jj 2004-07-30 11:42:24.000000000 +0200
++++ binutils/gas/config/tc-ia64.c 2004-08-17 13:45:04.288173205 +0200
+@@ -1,5 +1,6 @@
+ /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture.
+- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
++ Free Software Foundation, Inc.
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+ This file is part of GAS, the GNU Assembler.
+@@ -3297,7 +3298,7 @@ static char *special_linkonce_name[] =
+ };
+
+ static void
+-start_unwind_section (const segT text_seg, int sec_index)
++start_unwind_section (const segT text_seg, int sec_index, int linkonce_empty)
+ {
+ /*
+ Use a slightly ugly scheme to derive the unwind section names from
+@@ -3359,6 +3360,8 @@ start_unwind_section (const segT text_se
+ prefix = special_linkonce_name [sec_index - SPECIAL_SECTION_UNWIND];
+ suffix += sizeof (".gnu.linkonce.t.") - 1;
+ }
++ else if (linkonce_empty)
++ return;
+
+ prefix_len = strlen (prefix);
+ suffix_len = strlen (suffix);
+@@ -3444,7 +3447,7 @@ generate_unwind_image (const segT text_s
+ expressionS exp;
+ bfd_reloc_code_real_type reloc;
+
+- start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO);
++ start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO, 0);
+
+ /* Make sure the section has 4 byte alignment for ILP32 and
+ 8 byte alignment for LP64. */
+@@ -3485,6 +3488,8 @@ generate_unwind_image (const segT text_s
+ unwind.personality_routine = 0;
+ }
+ }
++ else
++ start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO, 1);
+
+ free_saved_prologue_counts ();
+ unwind.list = unwind.tail = unwind.current_entry = NULL;
+@@ -4164,7 +4169,7 @@ dot_endp (dummy)
+ subseg_set (md.last_text_seg, 0);
+ unwind.proc_end = expr_build_dot ();
+
+- start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND);
++ start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND, 0);
+
+ /* Make sure that section has 4 byte alignment for ILP32 and
+ 8 byte alignment for LP64. */
+@@ -4204,6 +4209,9 @@ dot_endp (dummy)
+ bytes_per_address);
+
+ }
++ else
++ start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND, 1);
++
+ subseg_set (saved_seg, saved_subseg);
+
+ /* Parse names of main and alternate entry points and set symbol sizes. */
+
+
+ Jakub
+
diff --git a/patches/binutils/2.15.90.0.3/binutils-20040820-duplicates.patch b/patches/binutils/2.15.90.0.3/binutils-20040820-duplicates.patch
new file mode 100644
index 0000000..03f6453
--- /dev/null
+++ b/patches/binutils/2.15.90.0.3/binutils-20040820-duplicates.patch
@@ -0,0 +1,74 @@
+See http://sources.redhat.com/ml/binutils/2004-08/msg00256.html
+
+Date: Fri, 20 Aug 2004 21:13:43 -0400
+From: Daniel Jacobowitz <drow at false dot org>
+To: binutils at sources dot redhat dot com
+Subject: Re: Handle SEC_LINK_DUPLICATES_SAME_CONTENTS for arm-linux
+Message-ID: <20040821011342.GA30319@nevyn.them.org>
+Mail-Followup-To: binutils at sources dot redhat dot com
+References: <20040818145518.GA9774@nevyn.them.org> <20040819055040.GA11820@lucon.org> <20040819080034.GE21716@bubble.modra.org> <20040820173240.GA17678@nevyn.them.org> <20040821003737.GB16016@bubble.modra.org>
+In-Reply-To: <20040821003737 dot GB16016 at bubble dot modra dot org>
+
+On Sat, Aug 21, 2004 at 10:07:38AM +0930, Alan Modra wrote:
+> On Fri, Aug 20, 2004 at 01:32:40PM -0400, Daniel Jacobowitz wrote:
+> > Thanks. How's this?
+>
+> As you might have guessed from my rather slack review of your previous
+> patch, I trust you enough to give the OK without proper review. But
+> since you asked... :)
+
+Checked in as so.
+
+--
+Daniel Jacobowitz
+
+2004-08-20 Daniel Jacobowitz <dan@debian.org>
+
+ * elflink.c (_bfd_elf_section_already_linked): Handle
+ SEC_LINK_DUPLICATES_SAME_CONTENTS.
+
+Index: elflink.c
+===================================================================
+RCS file: /big/fsf/rsync/src-cvs/src/bfd/elflink.c,v
+retrieving revision 1.97
+diff -u -p -r1.97 elflink.c
+--- binutils/bfd/elflink.c 18 Aug 2004 02:45:42 -0000 1.97
++++ binutils/bfd/elflink.c 21 Aug 2004 00:59:08 -0000
+@@ -9366,6 +9366,36 @@ _bfd_elf_section_already_linked (bfd *ab
+ (_("%B: duplicate section `%A' has different size\n"),
+ abfd, sec);
+ break;
++
++ case SEC_LINK_DUPLICATES_SAME_CONTENTS:
++ if (sec->size != l->sec->size)
++ (*_bfd_error_handler)
++ (_("%B: duplicate section `%A' has different size\n"),
++ abfd, sec);
++ else if (sec->size != 0)
++ {
++ bfd_byte *sec_contents, *l_sec_contents;
++
++ if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
++ (*_bfd_error_handler)
++ (_("%B: warning: could not read contents of section `%A'\n"),
++ abfd, sec);
++ else if (!bfd_malloc_and_get_section (l->sec->owner, l->sec,
++ &l_sec_contents))
++ (*_bfd_error_handler)
++ (_("%B: warning: could not read contents of section `%A'\n"),
++ l->sec->owner, l->sec);
++ else if (memcmp (sec_contents, l_sec_contents, sec->size) != 0)
++ (*_bfd_error_handler)
++ (_("%B: warning: duplicate section `%A' has different contents\n"),
++ abfd, sec);
++
++ if (sec_contents)
++ free (sec_contents);
++ if (l_sec_contents)
++ free (l_sec_contents);
++ }
++ break;
+ }
+
+ /* Set the output_section field so that lang_add_section
+
diff --git a/patches/binutils/2.15.90.0.3/binutils-skip-comments.patch b/patches/binutils/2.15.90.0.3/binutils-skip-comments.patch
new file mode 100644
index 0000000..804a17e
--- /dev/null
+++ b/patches/binutils/2.15.90.0.3/binutils-skip-comments.patch
@@ -0,0 +1,101 @@
+Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
+Fixes
+localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
+when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
+
+Paths adjusted to match crosstool's patcher.
+
+Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
+From: Andreas Schwab <schwab at suse dot de>
+To: Nathan Sidwell <nathan at codesourcery dot com>
+Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
+Date: Fri, 23 Apr 2004 22:27:19 +0200
+Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
+
+Nathan Sidwell <nathan@codesourcery.com> writes:
+
+> Index: read.c
+> ===================================================================
+> RCS file: /cvs/src/src/gas/read.c,v
+> retrieving revision 1.76
+> diff -c -3 -p -r1.76 read.c
+> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
+> --- read.c 18 Mar 2004 09:56:05 -0000
+> *************** read_a_source_file (char *name)
+> *** 1053,1059 ****
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! ignore_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+> --- 1053,1059 ----
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! demand_empty_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+
+This means that the unknown character is no longer ignored, despite the
+comment. As a side effect a line starting with a line comment character
+not followed by APP in NO_APP mode now triggers an error instead of just a
+warning, breaking builds of glibc on m68k-linux. Earlier in
+read_a_source_file where #APP is handled there is another comment that
+claims that unknown comments are ignored, when in fact they aren't (only
+the initial line comment character is skipped).
+
+Note that the presence of #APP will mess up the line counters, but
+that appears to be difficult to fix.
+
+Andreas.
+
+2004-04-23 Andreas Schwab <schwab@suse.de>
+
+ * read.c (read_a_source_file): Ignore unknown text after line
+ comment character. Fix misleading comment.
+
+--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
+@@ -1,6 +1,6 @@
+ /* read.c - read a source file -
+ Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+@@ -950,10 +950,14 @@ read_a_source_file (char *name)
+ unsigned int new_length;
+ char *tmp_buf = 0;
+
+- bump_line_counters ();
+ s = input_line_pointer;
+ if (strncmp (s, "APP\n", 4))
+- continue; /* We ignore it */
++ {
++ /* We ignore it */
++ ignore_rest_of_line ();
++ continue;
++ }
++ bump_line_counters ();
+ s += 4;
+
+ sb_new (&sbuf);
+@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
+ continue;
+ #endif
+ input_line_pointer--;
+- /* Report unknown char as ignored. */
++ /* Report unknown char as error. */
+ demand_empty_rest_of_line ();
+ }
+
+
+--
+Andreas Schwab, SuSE Labs, schwab@suse.de
+SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
+Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
+"And now for something completely different."
diff --git a/patches/binutils/2.15.90.0.3/gccpr15247-fix.patch b/patches/binutils/2.15.90.0.3/gccpr15247-fix.patch
new file mode 100644
index 0000000..967bf7f
--- /dev/null
+++ b/patches/binutils/2.15.90.0.3/gccpr15247-fix.patch
@@ -0,0 +1,192 @@
+See
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247
+
+Fixes spurious error
+/tmp/ccvNi4ou.s: Assembler messages:
+/tmp/ccvNi4ou.s:2310: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/math/dosincos.o] Error 1
+
+when compiling glibc's dosincos.c with gcc-3.4.0
+
+===================================================================
+RCS file: /cvs/src/src/opcodes/sparc-opc.c,v
+retrieving revision 1.9
+retrieving revision 1.10
+diff -u -r1.9 -r1.10
+--- src/opcodes/sparc-opc.c 2004/01/18 23:46:32 1.9
++++ src/opcodes/sparc-opc.c 2004/04/20 10:23:51 1.10
+@@ -1273,110 +1273,72 @@
+ #define FM_DF 2 /* v9 */
+ #define FM_QF 3 /* v9 */
+
+-#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags, v9 }
+-
+-#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 }
++#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags, v9 }
++
++#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 }
+
+ /* FIXME: use fmovicc/fmovfcc? */ /* v9 */
+-#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 }
+-
+-/* v9 */ fmovcc ("fmovda", FM_DF, CONDA, FCONDA, 0),
+-/* v9 */ fmovcc ("fmovqa", FM_QF, CONDA, FCONDA, 0),
+-/* v9 */ fmovcc ("fmovsa", FM_SF, CONDA, FCONDA, 0),
+-/* v9 */ fmovicc ("fmovdcc", FM_DF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovqcc", FM_QF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovscc", FM_SF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovdcs", FM_DF, CONDCS, 0),
+-/* v9 */ fmovicc ("fmovqcs", FM_QF, CONDCS, 0),
+-/* v9 */ fmovicc ("fmovscs", FM_SF, CONDCS, 0),
+-/* v9 */ fmovcc ("fmovde", FM_DF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovqe", FM_QF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovse", FM_SF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovdg", FM_DF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovqg", FM_QF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovsg", FM_SF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovdge", FM_DF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovcc ("fmovqge", FM_QF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovcc ("fmovsge", FM_SF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovicc ("fmovdgeu", FM_DF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovqgeu", FM_QF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovsgeu", FM_SF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovdgu", FM_DF, CONDGU, 0),
+-/* v9 */ fmovicc ("fmovqgu", FM_QF, CONDGU, 0),
+-/* v9 */ fmovicc ("fmovsgu", FM_SF, CONDGU, 0),
+-/* v9 */ fmovcc ("fmovdl", FM_DF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovql", FM_QF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovsl", FM_SF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovdle", FM_DF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovcc ("fmovqle", FM_QF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovcc ("fmovsle", FM_SF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovicc ("fmovdleu", FM_DF, CONDLEU, 0),
+-/* v9 */ fmovicc ("fmovqleu", FM_QF, CONDLEU, 0),
+-/* v9 */ fmovicc ("fmovsleu", FM_SF, CONDLEU, 0),
+-/* v9 */ fmovfcc ("fmovdlg", FM_DF, FCONDLG, 0),
+-/* v9 */ fmovfcc ("fmovqlg", FM_QF, FCONDLG, 0),
+-/* v9 */ fmovfcc ("fmovslg", FM_SF, FCONDLG, 0),
+-/* v9 */ fmovicc ("fmovdlu", FM_DF, CONDLU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovqlu", FM_QF, CONDLU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovslu", FM_SF, CONDLU, F_ALIAS),
+-/* v9 */ fmovcc ("fmovdn", FM_DF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovqn", FM_QF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovsn", FM_SF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovdne", FM_DF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovcc ("fmovqne", FM_QF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovcc ("fmovsne", FM_SF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovicc ("fmovdneg", FM_DF, CONDNEG, 0),
+-/* v9 */ fmovicc ("fmovqneg", FM_QF, CONDNEG, 0),
+-/* v9 */ fmovicc ("fmovsneg", FM_SF, CONDNEG, 0),
+-/* v9 */ fmovcc ("fmovdnz", FM_DF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovqnz", FM_QF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovsnz", FM_SF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovfcc ("fmovdo", FM_DF, FCONDO, 0),
+-/* v9 */ fmovfcc ("fmovqo", FM_QF, FCONDO, 0),
+-/* v9 */ fmovfcc ("fmovso", FM_SF, FCONDO, 0),
+-/* v9 */ fmovicc ("fmovdpos", FM_DF, CONDPOS, 0),
+-/* v9 */ fmovicc ("fmovqpos", FM_QF, CONDPOS, 0),
+-/* v9 */ fmovicc ("fmovspos", FM_SF, CONDPOS, 0),
+-/* v9 */ fmovfcc ("fmovdu", FM_DF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovqu", FM_QF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovsu", FM_SF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovdue", FM_DF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovque", FM_QF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovsue", FM_SF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovdug", FM_DF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovqug", FM_QF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovsug", FM_SF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovduge", FM_DF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovquge", FM_QF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovsuge", FM_SF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovdul", FM_DF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovqul", FM_QF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovsul", FM_SF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovdule", FM_DF, FCONDULE, 0),
+-/* v9 */ fmovfcc ("fmovqule", FM_QF, FCONDULE, 0),
+-/* v9 */ fmovfcc ("fmovsule", FM_SF, FCONDULE, 0),
+-/* v9 */ fmovicc ("fmovdvc", FM_DF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovqvc", FM_QF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovsvc", FM_SF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovdvs", FM_DF, CONDVS, 0),
+-/* v9 */ fmovicc ("fmovqvs", FM_QF, CONDVS, 0),
+-/* v9 */ fmovicc ("fmovsvs", FM_SF, CONDVS, 0),
+-/* v9 */ fmovcc ("fmovdz", FM_DF, CONDZ, FCONDZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovqz", FM_QF, CONDZ, FCONDZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovsz", FM_SF, CONDZ, FCONDZ, F_ALIAS),
+-
++#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 }
++
++#define fmovicc(suffix, cond, flags) /* v9 */ \
++fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags), \
++fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags), \
++fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags)
++
++#define fmovfcc(suffix, fcond, flags) /* v9 */ \
++fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags), \
++fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags), \
++fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags)
++
++#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \
++fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags), \
++fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags), \
++fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags)
++
++/* v9 */ fmovcc ("a", CONDA, FCONDA, 0),
++/* v9 */ fmovicc ("cc", CONDCC, 0),
++/* v9 */ fmovicc ("cs", CONDCS, 0),
++/* v9 */ fmovcc ("e", CONDE, FCONDE, 0),
++/* v9 */ fmovcc ("g", CONDG, FCONDG, 0),
++/* v9 */ fmovcc ("ge", CONDGE, FCONDGE, 0),
++/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS),
++/* v9 */ fmovicc ("gu", CONDGU, 0),
++/* v9 */ fmovcc ("l", CONDL, FCONDL, 0),
++/* v9 */ fmovcc ("le", CONDLE, FCONDLE, 0),
++/* v9 */ fmovicc ("leu", CONDLEU, 0),
++/* v9 */ fmovfcc ("lg", FCONDLG, 0),
++/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS),
++/* v9 */ fmovcc ("n", CONDN, FCONDN, 0),
++/* v9 */ fmovcc ("ne", CONDNE, FCONDNE, 0),
++/* v9 */ fmovicc ("neg", CONDNEG, 0),
++/* v9 */ fmovcc ("nz", CONDNZ, FCONDNZ, F_ALIAS),
++/* v9 */ fmovfcc ("o", FCONDO, 0),
++/* v9 */ fmovicc ("pos", CONDPOS, 0),
++/* v9 */ fmovfcc ("u", FCONDU, 0),
++/* v9 */ fmovfcc ("ue", FCONDUE, 0),
++/* v9 */ fmovfcc ("ug", FCONDUG, 0),
++/* v9 */ fmovfcc ("uge", FCONDUGE, 0),
++/* v9 */ fmovfcc ("ul", FCONDUL, 0),
++/* v9 */ fmovfcc ("ule", FCONDULE, 0),
++/* v9 */ fmovicc ("vc", CONDVC, 0),
++/* v9 */ fmovicc ("vs", CONDVS, 0),
++/* v9 */ fmovcc ("z", CONDZ, FCONDZ, F_ALIAS),
++
++#undef fmoviccx /* v9 */
++#undef fmovfccx /* v9 */
++#undef fmovccx /* v9 */
+ #undef fmovicc /* v9 */
+ #undef fmovfcc /* v9 */
+ #undef fmovcc /* v9 */
diff --git a/patches/binutils/2.15.91.0.2/binutils-20040817-linkonce.patch b/patches/binutils/2.15.91.0.2/binutils-20040817-linkonce.patch
new file mode 100644
index 0000000..97fa6ee
--- /dev/null
+++ b/patches/binutils/2.15.91.0.2/binutils-20040817-linkonce.patch
@@ -0,0 +1,118 @@
+From http://sources.redhat.com/ml/binutils/2004-08/msg00190.html
+
+Date: Tue, 17 Aug 2004 12:04:29 +0200
+From: Jakub Jelinek <jakub at redhat dot com>
+To: binutils at sources dot redhat dot com
+Subject: [PATCH] Fix `defined in discarded section' errors when building ia64 gcc
+Message-ID: <20040817100429.GL30497@sunsite.ms.mff.cuni.cz>
+Reply-To: Jakub Jelinek <jakub at redhat dot com>
+References: <20040817090201.GK30497@sunsite.ms.mff.cuni.cz>
+In-Reply-To: <20040817090201 dot GK30497 at sunsite dot ms dot mff dot cuni dot cz>
+
+On Tue, Aug 17, 2004 at 11:02:01AM +0200, Jakub Jelinek wrote:
+> Current gcc 3.4.x (at least gcc-3_4-rhl-branch) doesn't build with CVS
+> binutils (nor 2.15.91.0.2).
+> The problem is that libstdc++.so linking fails with:
+> `.gnu.linkonce.t._ZNSdD2Ev' referenced in section `.gnu.linkonce.ia64unw._ZNSdD2Ev' of .libs/sstream-inst.o: defined in discarded section `.gnu.linkonce.t._ZNSdD2Ev' of .libs/sstream-inst.o
+> The problem is that both io-inst.s and sstream-inst.s have
+> .gnu.linkonce.t._ZNSdD2Ev definition, but because io-inst.cc
+> also instantiates some templates sstream-inst.cc doesn't instantiate,
+> the inliner can do a better job in io-inst.cc.
+> The result is that _ZNSdD2Ev in io-inst.cc is a leaf routine, while
+> it is not in sstream-inst.cc (in assembly,
+> _ZNSdD2Ev in io-inst.s starts with .prologue and no .save directives,
+> while _ZNSdD2Ev] in sstream-inst.s has .prologue 12, 35 and some
+> .save directives.
+> IA-64 ABI allows leaf routines to have no unwind section at all,
+> which means .gnu.linkonce.ia64unw._ZNSdD2Ev is not created in
+> io-inst.o at all and as .gnu.linkonce.t._ZNSdD2Ev comes first
+> and wins, .gnu.linkonce.ia64unw._ZNSdD2Ev in sstream.o suddenly
+> references a discarded section.
+>
+> Not sure what should be done here, but certainly the compiler
+> isn't at fault here, it is a binutils problem.
+> One fix could be to create empty .gnu.linkonce.ia64unw.* section
+> in assembler, another special case ia64 unwind sections in the linker.
+
+Here is a patch for the first possibility.
+It certainly makes libstdc++.so to link and even the unwind info looks
+good on brief skimming.
+
+2004-08-17 Jakub Jelinek <jakub@redhat.com>
+
+ * config/tc-ia64.c (start_unwind_section): Add linkonce_empty
+ argument, don't do anything if current section is not
+ .gnu.linkonce.t.* and linkonce_empty is set.
+ (generate_unwind_image, dot_endp): Adjust callers, call
+ start_unwind_section (*, 1) if nothing will be put into the
+ section.
+
+--- binutils/gas/config/tc-ia64.c.jj 2004-07-30 11:42:24.000000000 +0200
++++ binutils/gas/config/tc-ia64.c 2004-08-17 13:45:04.288173205 +0200
+@@ -1,5 +1,6 @@
+ /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture.
+- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
++ Free Software Foundation, Inc.
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+ This file is part of GAS, the GNU Assembler.
+@@ -3297,7 +3298,7 @@ static char *special_linkonce_name[] =
+ };
+
+ static void
+-start_unwind_section (const segT text_seg, int sec_index)
++start_unwind_section (const segT text_seg, int sec_index, int linkonce_empty)
+ {
+ /*
+ Use a slightly ugly scheme to derive the unwind section names from
+@@ -3359,6 +3360,8 @@ start_unwind_section (const segT text_se
+ prefix = special_linkonce_name [sec_index - SPECIAL_SECTION_UNWIND];
+ suffix += sizeof (".gnu.linkonce.t.") - 1;
+ }
++ else if (linkonce_empty)
++ return;
+
+ prefix_len = strlen (prefix);
+ suffix_len = strlen (suffix);
+@@ -3444,7 +3447,7 @@ generate_unwind_image (const segT text_s
+ expressionS exp;
+ bfd_reloc_code_real_type reloc;
+
+- start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO);
++ start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO, 0);
+
+ /* Make sure the section has 4 byte alignment for ILP32 and
+ 8 byte alignment for LP64. */
+@@ -3485,6 +3488,8 @@ generate_unwind_image (const segT text_s
+ unwind.personality_routine = 0;
+ }
+ }
++ else
++ start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO, 1);
+
+ free_saved_prologue_counts ();
+ unwind.list = unwind.tail = unwind.current_entry = NULL;
+@@ -4164,7 +4169,7 @@ dot_endp (dummy)
+ subseg_set (md.last_text_seg, 0);
+ unwind.proc_end = expr_build_dot ();
+
+- start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND);
++ start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND, 0);
+
+ /* Make sure that section has 4 byte alignment for ILP32 and
+ 8 byte alignment for LP64. */
+@@ -4204,6 +4209,9 @@ dot_endp (dummy)
+ bytes_per_address);
+
+ }
++ else
++ start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND, 1);
++
+ subseg_set (saved_seg, saved_subseg);
+
+ /* Parse names of main and alternate entry points and set symbol sizes. */
+
+
+ Jakub
+
diff --git a/patches/binutils/2.15.91.0.2/binutils-dup-sections.patch b/patches/binutils/2.15.91.0.2/binutils-dup-sections.patch
new file mode 100644
index 0000000..4e4934d
--- /dev/null
+++ b/patches/binutils/2.15.91.0.2/binutils-dup-sections.patch
@@ -0,0 +1,68 @@
+See http://sources.redhat.com/ml/binutils/2004-08/msg00256.html
+
+Date: Fri, 20 Aug 2004 21:13:43 -0400
+From: Daniel Jacobowitz <drow at false dot org>
+To: binutils at sources dot redhat dot com
+Subject: Re: Handle SEC_LINK_DUPLICATES_SAME_CONTENTS for arm-linux
+Message-ID: <20040821011342.GA30319@nevyn.them.org>
+Mail-Followup-To: binutils at sources dot redhat dot com
+References: <20040818145518.GA9774@nevyn.them.org> <20040819055040.GA11820@lucon.org> <20040819080034.GE21716@bubble.modra.org> <20040820173240.GA17678@nevyn.them.org> <20040821003737.GB16016@bubble.modra.org>
+In-Reply-To: <20040821003737 dot GB16016 at bubble dot modra dot org>
+
+On Sat, Aug 21, 2004 at 10:07:38AM +0930, Alan Modra wrote:
+> On Fri, Aug 20, 2004 at 01:32:40PM -0400, Daniel Jacobowitz wrote:
+> > Thanks. How's this?
+>
+> As you might have guessed from my rather slack review of your previous
+> patch, I trust you enough to give the OK without proper review. But
+> since you asked... :)
+
+Checked in as so.
+
+--
+Daniel Jacobowitz
+
+[ rediffed against binutils-2.15.91.0.2, with some elbow grease ]
+
+2004-08-20 Daniel Jacobowitz <dan@debian.org>
+
+ * elflink.c (_bfd_elf_section_already_linked): Handle
+ SEC_LINK_DUPLICATES_SAME_CONTENTS.
+--- binutils-2.15.91.0.2/bfd/elflink.c.old 2004-07-27 21:36:08.000000000 -0700
++++ binutils-2.15.91.0.2/bfd/elflink.c 2004-08-26 06:38:07.000000000 -0700
+@@ -9359,6 +9359,35 @@
+ (_("%s: %s: warning: duplicate section `%s' has different size\n"),
+ bfd_archive_filename (abfd), name);
+ break;
++ case SEC_LINK_DUPLICATES_SAME_CONTENTS:
++ if (sec->size != l->sec->size)
++ (*_bfd_error_handler)
++ (_("%B: duplicate section `%A' has different size\n"),
++ bfd_archive_filename (abfd), sec);
++ else if (sec->size != 0)
++ {
++ bfd_byte *sec_contents, *l_sec_contents;
++
++ if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
++ (*_bfd_error_handler)
++ (_("%B: warning: could not read contents of section `%A'\n"),
++ bfd_archive_filename (abfd), sec);
++ else if (!bfd_malloc_and_get_section (l->sec->owner, l->sec,
++ &l_sec_contents))
++ (*_bfd_error_handler)
++ (_("%B: warning: could not read contents of section `%A'\n"),
++ bfd_archive_filename(l->sec->owner), l->sec);
++ else if (memcmp (sec_contents, l_sec_contents, sec->size) != 0)
++ (*_bfd_error_handler)
++ (_("%B: warning: duplicate section `%A' has different contents\n"),
++ bfd_archive_filename (abfd), sec);
++
++ if (sec_contents)
++ free (sec_contents);
++ if (l_sec_contents)
++ free (l_sec_contents);
++ }
++ break;
+ }
+
+ /* Set the output_section field so that lang_add_section
diff --git a/patches/binutils/2.15.91.0.2/binutils-skip-comments.patch b/patches/binutils/2.15.91.0.2/binutils-skip-comments.patch
new file mode 100644
index 0000000..804a17e
--- /dev/null
+++ b/patches/binutils/2.15.91.0.2/binutils-skip-comments.patch
@@ -0,0 +1,101 @@
+Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
+Fixes
+localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
+when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
+
+Paths adjusted to match crosstool's patcher.
+
+Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
+From: Andreas Schwab <schwab at suse dot de>
+To: Nathan Sidwell <nathan at codesourcery dot com>
+Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
+Date: Fri, 23 Apr 2004 22:27:19 +0200
+Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
+
+Nathan Sidwell <nathan@codesourcery.com> writes:
+
+> Index: read.c
+> ===================================================================
+> RCS file: /cvs/src/src/gas/read.c,v
+> retrieving revision 1.76
+> diff -c -3 -p -r1.76 read.c
+> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
+> --- read.c 18 Mar 2004 09:56:05 -0000
+> *************** read_a_source_file (char *name)
+> *** 1053,1059 ****
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! ignore_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+> --- 1053,1059 ----
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! demand_empty_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+
+This means that the unknown character is no longer ignored, despite the
+comment. As a side effect a line starting with a line comment character
+not followed by APP in NO_APP mode now triggers an error instead of just a
+warning, breaking builds of glibc on m68k-linux. Earlier in
+read_a_source_file where #APP is handled there is another comment that
+claims that unknown comments are ignored, when in fact they aren't (only
+the initial line comment character is skipped).
+
+Note that the presence of #APP will mess up the line counters, but
+that appears to be difficult to fix.
+
+Andreas.
+
+2004-04-23 Andreas Schwab <schwab@suse.de>
+
+ * read.c (read_a_source_file): Ignore unknown text after line
+ comment character. Fix misleading comment.
+
+--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
+@@ -1,6 +1,6 @@
+ /* read.c - read a source file -
+ Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+@@ -950,10 +950,14 @@ read_a_source_file (char *name)
+ unsigned int new_length;
+ char *tmp_buf = 0;
+
+- bump_line_counters ();
+ s = input_line_pointer;
+ if (strncmp (s, "APP\n", 4))
+- continue; /* We ignore it */
++ {
++ /* We ignore it */
++ ignore_rest_of_line ();
++ continue;
++ }
++ bump_line_counters ();
+ s += 4;
+
+ sb_new (&sbuf);
+@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
+ continue;
+ #endif
+ input_line_pointer--;
+- /* Report unknown char as ignored. */
++ /* Report unknown char as error. */
+ demand_empty_rest_of_line ();
+ }
+
+
+--
+Andreas Schwab, SuSE Labs, schwab@suse.de
+SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
+Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
+"And now for something completely different."
diff --git a/patches/binutils/2.15/002-uclibc.patch b/patches/binutils/2.15/002-uclibc.patch
new file mode 100644
index 0000000..c64e74f
--- /dev/null
+++ b/patches/binutils/2.15/002-uclibc.patch
@@ -0,0 +1,144 @@
+diff -uNr binutils-2.15-pristine/bfd/configure binutils-2.15/bfd/configure
+--- binutils-2.15-pristine/bfd/configure 2004-05-17 12:35:57.000000000 -0700
++++ binutils-2.15/bfd/configure 2004-07-19 16:36:19.000000000 -0700
+@@ -1009,7 +1009,7 @@
+ bfd_version_string="\"${VERSION}\""
+ if test x${is_release} = x; then
+ bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
+- bfd_version_string="\"${VERSION} ${bfd_version_date}\""
++ bfd_version_string="\"${VERSION} ${bfd_version_date} uClibc\""
+ fi
+
+
+diff -uNr binutils-2.15-pristine/bfd/elf32-arm.h binutils-2.15/bfd/elf32-arm.h
+--- binutils-2.15-pristine/bfd/elf32-arm.h 2004-05-17 12:35:58.000000000 -0700
++++ binutils-2.15/bfd/elf32-arm.h 2004-07-19 16:37:06.000000000 -0700
+@@ -124,7 +124,7 @@
+
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ #ifdef FOUR_WORD_PLT
+
+diff -uNr binutils-2.15-pristine/bfd/elf32-cris.c binutils-2.15/bfd/elf32-cris.c
+--- binutils-2.15-pristine/bfd/elf32-cris.c 2004-05-17 12:35:58.000000000 -0700
++++ binutils-2.15/bfd/elf32-cris.c 2004-07-19 16:49:59.000000000 -0700
+@@ -536,7 +536,7 @@
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ /* The size in bytes of an entry in the procedure linkage table. */
+
+diff -uNr binutils-2.15-pristine/bfd/elf32-frv.c binutils-2.15/bfd/elf32-frv.c
+--- binutils-2.15-pristine/bfd/elf32-frv.c 2004-05-17 12:35:58.000000000 -0700
++++ binutils-2.15/bfd/elf32-frv.c 2004-07-19 16:49:59.000000000 -0700
+@@ -2913,7 +2913,7 @@
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ #define DEFAULT_STACK_SIZE 0x20000
+
+diff -uNr binutils-2.15-pristine/bfd/elf32-hppa.c binutils-2.15/bfd/elf32-hppa.c
+--- binutils-2.15-pristine/bfd/elf32-hppa.c 2004-05-17 12:35:58.000000000 -0700
++++ binutils-2.15/bfd/elf32-hppa.c 2004-07-19 16:49:59.000000000 -0700
+@@ -115,7 +115,7 @@
+
+ #define PLT_ENTRY_SIZE 8
+ #define GOT_ENTRY_SIZE 4
+-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ static const bfd_byte plt_stub[] =
+ {
+diff -uNr binutils-2.15-pristine/bfd/elf32-ppc.c binutils-2.15/bfd/elf32-ppc.c
+--- binutils-2.15-pristine/bfd/elf32-ppc.c 2004-05-17 12:35:59.000000000 -0700
++++ binutils-2.15/bfd/elf32-ppc.c 2004-07-19 16:49:59.000000000 -0700
+@@ -49,7 +49,7 @@
+
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ /* The size in bytes of an entry in the procedure linkage table. */
+ #define PLT_ENTRY_SIZE 12
+diff -uNr binutils-2.15-pristine/bfd/elf32-s390.c binutils-2.15/bfd/elf32-s390.c
+--- binutils-2.15-pristine/bfd/elf32-s390.c 2004-05-17 12:35:59.000000000 -0700
++++ binutils-2.15/bfd/elf32-s390.c 2004-07-19 16:49:59.000000000 -0700
+@@ -452,7 +452,7 @@
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+diff -uNr binutils-2.15-pristine/bfd/elf32-sparc.c binutils-2.15/bfd/elf32-sparc.c
+--- binutils-2.15-pristine/bfd/elf32-sparc.c 2004-05-17 12:36:00.000000000 -0700
++++ binutils-2.15/bfd/elf32-sparc.c 2004-07-19 16:49:59.000000000 -0700
+@@ -536,7 +536,7 @@
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ /* The nop opcode we use. */
+
+diff -uNr binutils-2.15-pristine/bfd/elf64-ppc.c binutils-2.15/bfd/elf64-ppc.c
+--- binutils-2.15-pristine/bfd/elf64-ppc.c 2004-05-17 12:36:01.000000000 -0700
++++ binutils-2.15/bfd/elf64-ppc.c 2004-07-19 16:49:59.000000000 -0700
+@@ -99,7 +99,7 @@
+
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ /* The size in bytes of an entry in the procedure linkage table. */
+ #define PLT_ENTRY_SIZE 24
+diff -uNr binutils-2.15-pristine/bfd/elf64-s390.c binutils-2.15/bfd/elf64-s390.c
+--- binutils-2.15-pristine/bfd/elf64-s390.c 2004-05-17 12:36:01.000000000 -0700
++++ binutils-2.15/bfd/elf64-s390.c 2004-07-19 16:49:59.000000000 -0700
+@@ -473,7 +473,7 @@
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
+ copying dynamic variables from a shared lib into an app's dynbss
+diff -uNr binutils-2.15-pristine/bfd/elf-m10300.c binutils-2.15/bfd/elf-m10300.c
+--- binutils-2.15-pristine/bfd/elf-m10300.c 2004-05-17 12:35:57.000000000 -0700
++++ binutils-2.15/bfd/elf-m10300.c 2004-07-19 16:49:59.000000000 -0700
+@@ -4026,7 +4026,7 @@
+ /* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ /* Create dynamic sections when linking against a dynamic object. */
+
+diff -uNr binutils-2.15-pristine/bfd/elfxx-ia64.c binutils-2.15/bfd/elfxx-ia64.c
+--- binutils-2.15-pristine/bfd/elfxx-ia64.c 2004-05-17 12:36:02.000000000 -0700
++++ binutils-2.15/bfd/elfxx-ia64.c 2004-07-19 16:49:59.000000000 -0700
+@@ -643,7 +643,7 @@
+ 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
+ };
+
+-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
+
+ static const bfd_byte oor_brl[16] =
+ {
diff --git a/patches/binutils/2.15/100-uclibc-conf.patch b/patches/binutils/2.15/100-uclibc-conf.patch
new file mode 100644
index 0000000..1c7fa4a
--- /dev/null
+++ b/patches/binutils/2.15/100-uclibc-conf.patch
@@ -0,0 +1,692 @@
+diff -urN binutils-2.15-dist/bfd/config.bfd binutils-2.15/bfd/config.bfd
+--- binutils-2.15-dist/bfd/config.bfd 2004-05-17 14:35:56.000000000 -0500
++++ binutils-2.15/bfd/config.bfd 2004-08-04 12:01:44.000000000 -0500
+@@ -126,7 +126,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -136,7 +136,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -213,7 +213,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -221,7 +221,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -360,7 +360,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -371,7 +371,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -494,7 +494,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -508,7 +508,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -683,7 +683,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -955,7 +955,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -987,8 +988,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1149,7 +1150,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1196,7 +1197,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1265,7 +1266,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15-dist/bfd/configure binutils-2.15/bfd/configure
+--- binutils-2.15-dist/bfd/configure 2004-05-17 14:35:57.000000000 -0500
++++ binutils-2.15/bfd/configure 2004-08-04 12:01:44.000000000 -0500
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5376,7 +5381,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5477,7 +5482,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15-dist/bfd/configure.in binutils-2.15/bfd/configure.in
+--- binutils-2.15-dist/bfd/configure.in 2004-05-17 14:35:57.000000000 -0500
++++ binutils-2.15/bfd/configure.in 2004-08-04 12:01:44.000000000 -0500
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -300,7 +300,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -385,7 +385,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15-dist/binutils/configure binutils-2.15/binutils/configure
+--- binutils-2.15-dist/binutils/configure 2004-01-02 11:08:04.000000000 -0600
++++ binutils-2.15/binutils/configure 2004-08-04 12:01:44.000000000 -0500
+@@ -1585,6 +1585,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15-dist/configure binutils-2.15/configure
+--- binutils-2.15-dist/configure 2004-05-17 14:36:20.000000000 -0500
++++ binutils-2.15/configure 2004-08-04 12:01:44.000000000 -0500
+@@ -1288,6 +1288,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15-dist/configure.in binutils-2.15/configure.in
+--- binutils-2.15-dist/configure.in 2004-05-17 14:40:54.000000000 -0500
++++ binutils-2.15/configure.in 2004-08-04 12:01:44.000000000 -0500
+@@ -521,6 +521,18 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15-dist/gas/configure binutils-2.15/gas/configure
+--- binutils-2.15-dist/gas/configure 2004-05-17 14:36:07.000000000 -0500
++++ binutils-2.15/gas/configure 2004-08-04 12:07:50.000000000 -0500
+@@ -3400,6 +3400,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4224,6 +4229,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4240,6 +4246,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4253,6 +4260,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4310,7 +4318,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4370,6 +4380,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4397,6 +4408,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4459,6 +4471,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4486,7 +4499,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4519,6 +4534,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15-dist/gas/configure.in binutils-2.15/gas/configure.in
+--- binutils-2.15-dist/gas/configure.in 2004-05-17 14:36:07.000000000 -0500
++++ binutils-2.15/gas/configure.in 2004-08-04 12:07:21.000000000 -0500
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -280,7 +283,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -333,6 +338,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -360,6 +366,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -419,6 +426,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -439,7 +447,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -472,6 +482,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15-dist/gprof/configure binutils-2.15/gprof/configure
+--- binutils-2.15-dist/gprof/configure 2003-08-26 12:19:19.000000000 -0500
++++ binutils-2.15/gprof/configure 2004-08-04 12:01:45.000000000 -0500
+@@ -1581,6 +1581,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15-dist/ld/configure binutils-2.15/ld/configure
+--- binutils-2.15-dist/ld/configure 2003-04-24 07:36:07.000000000 -0500
++++ binutils-2.15/ld/configure 2004-08-04 12:01:45.000000000 -0500
+@@ -1589,6 +1589,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15-dist/ld/configure.tgt binutils-2.15/ld/configure.tgt
+--- binutils-2.15-dist/ld/configure.tgt 2004-05-17 14:36:15.000000000 -0500
++++ binutils-2.15/ld/configure.tgt 2004-08-04 12:01:45.000000000 -0500
+@@ -30,6 +30,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -59,14 +60,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -118,7 +121,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -128,7 +133,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -152,14 +157,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -259,10 +266,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -364,7 +374,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -381,9 +392,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -396,6 +407,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -429,16 +441,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -461,6 +473,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15-dist/libtool.m4 binutils-2.15/libtool.m4
+--- binutils-2.15-dist/libtool.m4 2003-04-10 22:58:39.000000000 -0500
++++ binutils-2.15/libtool.m4 2004-08-04 12:01:45.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.15-dist/ltconfig binutils-2.15/ltconfig
+--- binutils-2.15-dist/ltconfig 2003-10-03 23:54:47.000000000 -0500
++++ binutils-2.15/ltconfig 2004-08-04 12:01:45.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN binutils-2.15-dist/opcodes/configure binutils-2.15/opcodes/configure
+--- binutils-2.15-dist/opcodes/configure 2003-08-05 04:39:31.000000000 -0500
++++ binutils-2.15/opcodes/configure 2004-08-04 12:01:45.000000000 -0500
+@@ -1700,6 +1700,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/patches/binutils/2.15/210-cflags.patch b/patches/binutils/2.15/210-cflags.patch
new file mode 100644
index 0000000..dc67d3c
--- /dev/null
+++ b/patches/binutils/2.15/210-cflags.patch
@@ -0,0 +1,32 @@
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.am 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am 2004-03-01 16:05:16.000000000 -0600
+@@ -55,10 +55,10 @@
+ MKDOC = chew$(EXEEXT_FOR_BUILD)
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.in 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in 2004-03-01 16:05:03.000000000 -0600
+@@ -469,10 +469,10 @@
+
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
diff --git a/patches/binutils/2.15/400-mips-ELF_MAXPAGESIZE-4K.patch b/patches/binutils/2.15/400-mips-ELF_MAXPAGESIZE-4K.patch
new file mode 100644
index 0000000..e07a7e8
--- /dev/null
+++ b/patches/binutils/2.15/400-mips-ELF_MAXPAGESIZE-4K.patch
@@ -0,0 +1,26 @@
+--- binutils/bfd/elf32-mips.c~
++++ binutils/bfd/elf32-mips.c
+@@ -1611,7 +1611,9 @@
+
+ /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
+ page sizes of up to that limit, so we need to respect it. */
+-#define ELF_MAXPAGESIZE 0x10000
++/*#define ELF_MAXPAGESIZE 0x10000*/
++/* Use 4K to shrink the elf header. NOT for general use! */
++#define ELF_MAXPAGESIZE 0x1000
+ #define elf32_bed elf32_tradbed
+
+ /* Include the target file again for this target. */
+--- binutils/bfd/elfn32-mips.c~
++++ binutils/bfd/elfn32-mips.c
+@@ -1976,7 +1976,9 @@
+
+ /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
+ page sizes of up to that limit, so we need to respect it. */
+-#define ELF_MAXPAGESIZE 0x10000
++/*#define ELF_MAXPAGESIZE 0x10000*/
++/* Use 4K to shrink the elf header. NOT for general use! */
++#define ELF_MAXPAGESIZE 0x1000
+ #define elf32_bed elf32_tradbed
+
+ /* Include the target file again for this target. */
diff --git a/patches/binutils/2.15/600-arm-textrel.patch b/patches/binutils/2.15/600-arm-textrel.patch
new file mode 100644
index 0000000..73d5b9d
--- /dev/null
+++ b/patches/binutils/2.15/600-arm-textrel.patch
@@ -0,0 +1,63 @@
+http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
+--- binutils-2.15.90.0.3-old/bfd/elf32-arm.h 2004-04-12 14:56:33.000000000 -0500
++++ binutils-2.15.90.0.3/bfd/elf32-arm.h 2004-09-03 06:56:40.000000000 -0500
+@@ -87,6 +87,8 @@
+ #endif
+ static bfd_boolean allocate_dynrelocs
+ PARAMS ((struct elf_link_hash_entry *h, PTR inf));
++static bfd_boolean elf32_arm_readonly_dynrelocs
++ PARAMS ((struct elf_link_hash_entry *, PTR));
+ static bfd_boolean create_got_section
+ PARAMS ((bfd * dynobj, struct bfd_link_info * info));
+ static bfd_boolean elf32_arm_create_dynamic_sections
+@@ -3531,6 +3533,37 @@
+ return TRUE;
+ }
+
++/* Find any dynamic relocs that apply to read-only sections. */
++
++static bfd_boolean
++elf32_arm_readonly_dynrelocs (h, inf)
++ struct elf_link_hash_entry *h;
++ PTR inf;
++{
++ struct elf32_arm_link_hash_entry *eh;
++ struct elf32_arm_relocs_copied *p;
++
++ if (h->root.type == bfd_link_hash_warning)
++ h = (struct elf_link_hash_entry *) h->root.u.i.link;
++
++ eh = (struct elf32_arm_link_hash_entry *) h;
++ for (p = eh->relocs_copied; p != NULL; p = p->next)
++ {
++ asection *s = p->section;
++
++ if (s != NULL && (s->flags & SEC_READONLY) != 0)
++ {
++ struct bfd_link_info *info = (struct bfd_link_info *) inf;
++
++ info->flags |= DF_TEXTREL;
++
++ /* Not an error, just cut short the traversal. */
++ return FALSE;
++ }
++ }
++ return TRUE;
++}
++
+ /* Set the sizes of the dynamic sections. */
+
+ static bfd_boolean
+@@ -3740,6 +3773,12 @@
+ return FALSE;
+ }
+
++ /* If any dynamic relocs apply to a read-only section,
++ then we need a DT_TEXTREL entry. */
++ if ((info->flags & DF_TEXTREL) == 0)
++ elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
++ (PTR) info);
++
+ if ((info->flags & DF_TEXTREL) != 0)
+ {
+ if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/patches/binutils/2.15/bfd-hash-tweak.patch b/patches/binutils/2.15/bfd-hash-tweak.patch
new file mode 100644
index 0000000..6b8fc41
--- /dev/null
+++ b/patches/binutils/2.15/bfd-hash-tweak.patch
@@ -0,0 +1,24 @@
+Signed-off-by: dank@kegel.com
+
+Raising the size of the hash table is a noticable win when linking
+at least one large app.
+
+There was a patch,
+http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
+to do this dynamically. No idea why that didn't make it in.
+So this tiny change to raise the default size is just
+a stopgap for now.
+
+
+--- binutils-2.15/bfd/hash.c.old 2003-12-01 01:33:01.000000000 -0500
++++ binutils-2.15/bfd/hash.c 2006-03-01 16:26:26.701991000 -0500
+@@ -295,7 +295,7 @@
+ */
+
+ /* The default number of entries to use when creating a hash table. */
+-#define DEFAULT_SIZE (4051)
++#define DEFAULT_SIZE (32749)
+
+ /* Create a new hash table, given a number of entries. */
+
+
diff --git a/patches/binutils/2.15/binutils-2.15-allow-gcc-4.0.patch b/patches/binutils/2.15/binutils-2.15-allow-gcc-4.0.patch
new file mode 100644
index 0000000..26e5a12
--- /dev/null
+++ b/patches/binutils/2.15/binutils-2.15-allow-gcc-4.0.patch
@@ -0,0 +1,75 @@
+Fix found here: http://www.freelists.org/archives/openbeos/11-2005/msg00090.html
+
+Fixes:
+In file included from ./targ-cpu.h:1,
+ from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/obj-elf.h:42,
+ from ./obj-format.h:1,
+ from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/te-linux.h:4,
+ from ./targ-env.h:1,
+ from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/as.h:626,
+ from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/app.c:30:
+/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/tc-i386.h:451: error: array type has incomplete element type
+make[3]: *** [app.o] Error 1
+make[3]: Leaving directory `/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-binutils/gas'
+
+when building binutils-2.15 with gcc-4.0
+
+
+diff -ur binutils-2.15.old/gas/as.h binutils-2.15/gas/as.h
+--- binutils-2.15.old/gas/as.h 2003-11-22 18:14:21.000000000 -0800
++++ binutils-2.15/gas/as.h 2006-02-14 22:05:35.000000000 -0800
+@@ -605,7 +605,26 @@
+ struct expressionS;
+ struct fix;
+ typedef struct symbol symbolS;
+-struct relax_type;
++
++/* JF moved this here from as.h under the theory that nobody except MACHINE.c
++ and write.c care about it anyway. */
++/* [zooey]: the above no longer holds with gcc4, as it keeps bugging about
++ incomplete element types in arrays, if relax_type isn't defined
++ here. So I moved the definition back from tc.h to here. */
++struct relax_type
++{
++ /* Forward reach. Signed number. > 0. */
++ long rlx_forward;
++ /* Backward reach. Signed number. < 0. */
++ long rlx_backward;
++
++ /* Bytes length of this address. */
++ unsigned char rlx_length;
++
++ /* Next longer relax-state. 0 means there is no 'next' relax-state. */
++ relax_substateT rlx_more;
++};
++
+ typedef struct frag fragS;
+
+ #ifdef BFD_ASSEMBLER
+diff -ur binutils-2.15.old/gas/tc.h binutils-2.15/gas/tc.h
+--- binutils-2.15.old/gas/tc.h 2003-12-03 15:39:38.000000000 -0800
++++ binutils-2.15/gas/tc.h 2006-02-14 22:03:35.000000000 -0800
+@@ -24,23 +24,6 @@
+
+ extern const pseudo_typeS md_pseudo_table[];
+
+-/* JF moved this here from as.h under the theory that nobody except MACHINE.c
+- and write.c care about it anyway. */
+-
+-struct relax_type
+-{
+- /* Forward reach. Signed number. > 0. */
+- long rlx_forward;
+- /* Backward reach. Signed number. < 0. */
+- long rlx_backward;
+-
+- /* Bytes length of this address. */
+- unsigned char rlx_length;
+-
+- /* Next longer relax-state. 0 means there is no 'next' relax-state. */
+- relax_substateT rlx_more;
+-};
+-
+ typedef struct relax_type relax_typeS;
+
+ extern const int md_reloc_size; /* Size of a relocation record */
diff --git a/patches/binutils/2.15/binutils-2.15-psignal.patch b/patches/binutils/2.15/binutils-2.15-psignal.patch
new file mode 100644
index 0000000..98fa600
--- /dev/null
+++ b/patches/binutils/2.15/binutils-2.15-psignal.patch
@@ -0,0 +1,40 @@
+Make psignal prototype in libiberty match that in glibc.
+
+Fixes:
+
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
+/usr/include/signal.h:131: prototype declaration
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
+/usr/include/signal.h:131: prototype declaration
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
+mprotect... make[1]: *** [strsignal.o] Error 1
+make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
+make: *** [all-libiberty] Error 2
+
+when building on red hat 7.1
+though it's a bit of a mystery why libiberty's psignal is being compiled at
+all, since red hat 7.1's glibc supports psignal (hence the error message)
+
+--- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
++++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
+@@ -544,7 +544,7 @@
+
+ /*
+
+-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
+
+ Print @var{message} to the standard error, followed by a colon,
+ followed by the description of the signal specified by @var{signo},
+@@ -557,9 +557,7 @@
+ #ifndef HAVE_PSIGNAL
+
+ void
+-psignal (signo, message)
+- unsigned signo;
+- char *message;
++psignal (int signo, const char *message)
+ {
+ if (signal_names == NULL)
+ {
diff --git a/patches/binutils/2.15/binutils-2.15-solaris-qsort.patch b/patches/binutils/2.15/binutils-2.15-solaris-qsort.patch
new file mode 100644
index 0000000..5fe3623
--- /dev/null
+++ b/patches/binutils/2.15/binutils-2.15-solaris-qsort.patch
@@ -0,0 +1,22 @@
+See http://sources.redhat.com/ml/binutils/2004-06/msg00114.html
+
+--- src/bfd/elflink.c.org 2004-07-05 09:11:42.920597000 -0400
++++ src/bfd/elflink.c 2004-07-05 09:12:59.240847000 -0400
+@@ -2700,7 +2700,7 @@
+ return vdiff > 0 ? 1 : -1;
+ else
+ {
+- long sdiff = h1->root.u.def.section - h2->root.u.def.section;
++ long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
+ if (sdiff != 0)
+ return sdiff > 0 ? 1 : -1;
+ }
+@@ -3954,7 +3954,7 @@
+ i = idx + 1;
+ else
+ {
+- long sdiff = slook - h->root.u.def.section;
++ long sdiff = slook->id - h->root.u.def.section->id;
+ if (sdiff < 0)
+ j = idx;
+ else if (sdiff > 0)
diff --git a/patches/binutils/2.15/binutils-2.15-vmx.patch b/patches/binutils/2.15/binutils-2.15-vmx.patch
new file mode 100644
index 0000000..5ae9efe
--- /dev/null
+++ b/patches/binutils/2.15/binutils-2.15-vmx.patch
@@ -0,0 +1,45 @@
+Grabbed with
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?r1=1.70&r2=1.71&cvsroot=src'
+See
+http://mail.gnu.org/archive/html/bug-binutils/2004-05/msg00071.html
+and
+http://sources.redhat.com/ml/binutils-cvs/2004-05/msg00111.html
+
+This fixes problems like
+{standard input}: Assembler messages:
+{standard input}:1: Error: Unrecognized opcode: `dssall'
+which show up in binutils-2.15 when building the Linux kernel,
+or possibly failed compilations when building setjmp/longjmp in glibc.
+
+An alternative fix would be to pass -many to the assembler.
+A patch to do that for glibc is at
+wget 'http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-05&msgid=40B36E8C.9030609%40us.ibm.com'
+Yet another, better, fix would be for gcc to generate assembly
+that told the assembler which processor type to use.
+Presumably the Linux kernel sources would need a fix, too.
+Probably better to just fix binutils to accept sources that it used to.
+
+
+===================================================================
+RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
+retrieving revision 1.70
+retrieving revision 1.71
+diff -u -r1.70 -r1.71
+--- src/opcodes/ppc-opc.c 2004/05/05 13:43:36 1.70
++++ src/opcodes/ppc-opc.c 2004/05/19 05:11:48 1.71
+@@ -1004,8 +1004,13 @@
+
+ /* If only one bit of the FXM field is set, we can use the new form
+ of the instruction, which is faster. Unlike the Power4 branch hint
+- encoding, this is not backward compatible. */
+- else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
++ encoding, this is not backward compatible. Do not generate the
++ new form unless -mpower4 has been given, or -many and the two
++ operand form of mfcr was used. */
++ else if ((value & -value) == value
++ && ((dialect & PPC_OPCODE_POWER4) != 0
++ || ((dialect & PPC_OPCODE_ANY) != 0
++ && (insn & (0x3ff << 1)) == 19 << 1)))
+ insn |= 1 << 20;
+
+ /* Any other value on mfcr is an error. */
diff --git a/patches/binutils/2.15/binutils-arm-undef-imm.patch b/patches/binutils/2.15/binutils-arm-undef-imm.patch
new file mode 100644
index 0000000..6bf403c
--- /dev/null
+++ b/patches/binutils/2.15/binutils-arm-undef-imm.patch
@@ -0,0 +1,51 @@
+From http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.168&r2=1.169&cvsroot=src
+See also http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-July/023128.html,
+"[CRITICAL PATCH] 2.6: fix silent build error]"
+
+Revision 1.169, Fri Jul 2 11:12:29 2004 UTC (19 hours, 4 minutes ago) by nickc
+Branch: MAIN
+CVS Tags: binutils_latest_snapshot, HEAD
+Changes since 1.168: +14 -1 lines
+
+(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come
+from undefined symbols.
+Always consider this fixup to have been processed as a reloc cannot be
+generated for it.
+
+
+===================================================================
+RCS file: /cvs/src/src/gas/config/tc-arm.c,v
+retrieving revision 1.168
+retrieving revision 1.169
+diff -u -r1.168 -r1.169
+--- src/gas/config/tc-arm.c 2004/04/30 10:51:12 1.168
++++ src/gas/config/tc-arm.c 2004/07/02 11:12:29 1.169
+@@ -12186,6 +12186,20 @@
+ switch (fixP->fx_r_type)
+ {
+ case BFD_RELOC_ARM_IMMEDIATE:
++ /* We claim that this fixup has been processed here,
++ even if in fact we generate an error because we do
++ not have a reloc for it, so tc_gen_reloc will reject it. */
++ fixP->fx_done = 1;
++
++ if (fixP->fx_addsy
++ && ! S_IS_DEFINED (fixP->fx_addsy))
++ {
++ as_bad_where (fixP->fx_file, fixP->fx_line,
++ _("undefined symbol %s used as an immediate value"),
++ S_GET_NAME (fixP->fx_addsy));
++ break;
++ }
++
+ newimm = validate_immediate (value);
+ temp = md_chars_to_number (buf, INSN_SIZE);
+
+@@ -12202,7 +12216,6 @@
+
+ newimm |= (temp & 0xfffff000);
+ md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
+- fixP->fx_done = 1;
+ break;
+
+ case BFD_RELOC_ARM_ADRL_IMMEDIATE:
diff --git a/patches/binutils/2.15/binutils-skip-comments.patch b/patches/binutils/2.15/binutils-skip-comments.patch
new file mode 100644
index 0000000..804a17e
--- /dev/null
+++ b/patches/binutils/2.15/binutils-skip-comments.patch
@@ -0,0 +1,101 @@
+Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
+Fixes
+localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
+when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
+
+Paths adjusted to match crosstool's patcher.
+
+Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
+From: Andreas Schwab <schwab at suse dot de>
+To: Nathan Sidwell <nathan at codesourcery dot com>
+Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
+Date: Fri, 23 Apr 2004 22:27:19 +0200
+Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
+
+Nathan Sidwell <nathan@codesourcery.com> writes:
+
+> Index: read.c
+> ===================================================================
+> RCS file: /cvs/src/src/gas/read.c,v
+> retrieving revision 1.76
+> diff -c -3 -p -r1.76 read.c
+> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
+> --- read.c 18 Mar 2004 09:56:05 -0000
+> *************** read_a_source_file (char *name)
+> *** 1053,1059 ****
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! ignore_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+> --- 1053,1059 ----
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! demand_empty_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+
+This means that the unknown character is no longer ignored, despite the
+comment. As a side effect a line starting with a line comment character
+not followed by APP in NO_APP mode now triggers an error instead of just a
+warning, breaking builds of glibc on m68k-linux. Earlier in
+read_a_source_file where #APP is handled there is another comment that
+claims that unknown comments are ignored, when in fact they aren't (only
+the initial line comment character is skipped).
+
+Note that the presence of #APP will mess up the line counters, but
+that appears to be difficult to fix.
+
+Andreas.
+
+2004-04-23 Andreas Schwab <schwab@suse.de>
+
+ * read.c (read_a_source_file): Ignore unknown text after line
+ comment character. Fix misleading comment.
+
+--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
+@@ -1,6 +1,6 @@
+ /* read.c - read a source file -
+ Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+@@ -950,10 +950,14 @@ read_a_source_file (char *name)
+ unsigned int new_length;
+ char *tmp_buf = 0;
+
+- bump_line_counters ();
+ s = input_line_pointer;
+ if (strncmp (s, "APP\n", 4))
+- continue; /* We ignore it */
++ {
++ /* We ignore it */
++ ignore_rest_of_line ();
++ continue;
++ }
++ bump_line_counters ();
+ s += 4;
+
+ sb_new (&sbuf);
+@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
+ continue;
+ #endif
+ input_line_pointer--;
+- /* Report unknown char as ignored. */
++ /* Report unknown char as error. */
+ demand_empty_rest_of_line ();
+ }
+
+
+--
+Andreas Schwab, SuSE Labs, schwab@suse.de
+SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
+Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
+"And now for something completely different."
diff --git a/patches/binutils/2.15/cross-gprof.patch b/patches/binutils/2.15/cross-gprof.patch
new file mode 100644
index 0000000..ea6c18f
--- /dev/null
+++ b/patches/binutils/2.15/cross-gprof.patch
@@ -0,0 +1,22 @@
+--- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700
++++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700
+@@ -999,7 +999,7 @@
+
+ # Some tools are only suitable for building in a "native" situation.
+ # Remove these if host!=target.
+-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
+--- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700
++++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700
+@@ -236,7 +236,7 @@
+
+ # Some tools are only suitable for building in a "native" situation.
+ # Remove these if host!=target.
+-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
diff --git a/patches/binutils/2.15/gccpr15247-fix.patch b/patches/binutils/2.15/gccpr15247-fix.patch
new file mode 100644
index 0000000..967bf7f
--- /dev/null
+++ b/patches/binutils/2.15/gccpr15247-fix.patch
@@ -0,0 +1,192 @@
+See
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247
+
+Fixes spurious error
+/tmp/ccvNi4ou.s: Assembler messages:
+/tmp/ccvNi4ou.s:2310: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/math/dosincos.o] Error 1
+
+when compiling glibc's dosincos.c with gcc-3.4.0
+
+===================================================================
+RCS file: /cvs/src/src/opcodes/sparc-opc.c,v
+retrieving revision 1.9
+retrieving revision 1.10
+diff -u -r1.9 -r1.10
+--- src/opcodes/sparc-opc.c 2004/01/18 23:46:32 1.9
++++ src/opcodes/sparc-opc.c 2004/04/20 10:23:51 1.10
+@@ -1273,110 +1273,72 @@
+ #define FM_DF 2 /* v9 */
+ #define FM_QF 3 /* v9 */
+
+-#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags, v9 }
+-
+-#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 }
++#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags, v9 }
++
++#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \
++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 }
+
+ /* FIXME: use fmovicc/fmovfcc? */ /* v9 */
+-#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \
+-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \
+-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 }
+-
+-/* v9 */ fmovcc ("fmovda", FM_DF, CONDA, FCONDA, 0),
+-/* v9 */ fmovcc ("fmovqa", FM_QF, CONDA, FCONDA, 0),
+-/* v9 */ fmovcc ("fmovsa", FM_SF, CONDA, FCONDA, 0),
+-/* v9 */ fmovicc ("fmovdcc", FM_DF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovqcc", FM_QF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovscc", FM_SF, CONDCC, 0),
+-/* v9 */ fmovicc ("fmovdcs", FM_DF, CONDCS, 0),
+-/* v9 */ fmovicc ("fmovqcs", FM_QF, CONDCS, 0),
+-/* v9 */ fmovicc ("fmovscs", FM_SF, CONDCS, 0),
+-/* v9 */ fmovcc ("fmovde", FM_DF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovqe", FM_QF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovse", FM_SF, CONDE, FCONDE, 0),
+-/* v9 */ fmovcc ("fmovdg", FM_DF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovqg", FM_QF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovsg", FM_SF, CONDG, FCONDG, 0),
+-/* v9 */ fmovcc ("fmovdge", FM_DF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovcc ("fmovqge", FM_QF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovcc ("fmovsge", FM_SF, CONDGE, FCONDGE, 0),
+-/* v9 */ fmovicc ("fmovdgeu", FM_DF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovqgeu", FM_QF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovsgeu", FM_SF, CONDGEU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovdgu", FM_DF, CONDGU, 0),
+-/* v9 */ fmovicc ("fmovqgu", FM_QF, CONDGU, 0),
+-/* v9 */ fmovicc ("fmovsgu", FM_SF, CONDGU, 0),
+-/* v9 */ fmovcc ("fmovdl", FM_DF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovql", FM_QF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovsl", FM_SF, CONDL, FCONDL, 0),
+-/* v9 */ fmovcc ("fmovdle", FM_DF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovcc ("fmovqle", FM_QF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovcc ("fmovsle", FM_SF, CONDLE, FCONDLE, 0),
+-/* v9 */ fmovicc ("fmovdleu", FM_DF, CONDLEU, 0),
+-/* v9 */ fmovicc ("fmovqleu", FM_QF, CONDLEU, 0),
+-/* v9 */ fmovicc ("fmovsleu", FM_SF, CONDLEU, 0),
+-/* v9 */ fmovfcc ("fmovdlg", FM_DF, FCONDLG, 0),
+-/* v9 */ fmovfcc ("fmovqlg", FM_QF, FCONDLG, 0),
+-/* v9 */ fmovfcc ("fmovslg", FM_SF, FCONDLG, 0),
+-/* v9 */ fmovicc ("fmovdlu", FM_DF, CONDLU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovqlu", FM_QF, CONDLU, F_ALIAS),
+-/* v9 */ fmovicc ("fmovslu", FM_SF, CONDLU, F_ALIAS),
+-/* v9 */ fmovcc ("fmovdn", FM_DF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovqn", FM_QF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovsn", FM_SF, CONDN, FCONDN, 0),
+-/* v9 */ fmovcc ("fmovdne", FM_DF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovcc ("fmovqne", FM_QF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovcc ("fmovsne", FM_SF, CONDNE, FCONDNE, 0),
+-/* v9 */ fmovicc ("fmovdneg", FM_DF, CONDNEG, 0),
+-/* v9 */ fmovicc ("fmovqneg", FM_QF, CONDNEG, 0),
+-/* v9 */ fmovicc ("fmovsneg", FM_SF, CONDNEG, 0),
+-/* v9 */ fmovcc ("fmovdnz", FM_DF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovqnz", FM_QF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovsnz", FM_SF, CONDNZ, FCONDNZ, F_ALIAS),
+-/* v9 */ fmovfcc ("fmovdo", FM_DF, FCONDO, 0),
+-/* v9 */ fmovfcc ("fmovqo", FM_QF, FCONDO, 0),
+-/* v9 */ fmovfcc ("fmovso", FM_SF, FCONDO, 0),
+-/* v9 */ fmovicc ("fmovdpos", FM_DF, CONDPOS, 0),
+-/* v9 */ fmovicc ("fmovqpos", FM_QF, CONDPOS, 0),
+-/* v9 */ fmovicc ("fmovspos", FM_SF, CONDPOS, 0),
+-/* v9 */ fmovfcc ("fmovdu", FM_DF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovqu", FM_QF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovsu", FM_SF, FCONDU, 0),
+-/* v9 */ fmovfcc ("fmovdue", FM_DF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovque", FM_QF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovsue", FM_SF, FCONDUE, 0),
+-/* v9 */ fmovfcc ("fmovdug", FM_DF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovqug", FM_QF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovsug", FM_SF, FCONDUG, 0),
+-/* v9 */ fmovfcc ("fmovduge", FM_DF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovquge", FM_QF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovsuge", FM_SF, FCONDUGE, 0),
+-/* v9 */ fmovfcc ("fmovdul", FM_DF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovqul", FM_QF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovsul", FM_SF, FCONDUL, 0),
+-/* v9 */ fmovfcc ("fmovdule", FM_DF, FCONDULE, 0),
+-/* v9 */ fmovfcc ("fmovqule", FM_QF, FCONDULE, 0),
+-/* v9 */ fmovfcc ("fmovsule", FM_SF, FCONDULE, 0),
+-/* v9 */ fmovicc ("fmovdvc", FM_DF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovqvc", FM_QF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovsvc", FM_SF, CONDVC, 0),
+-/* v9 */ fmovicc ("fmovdvs", FM_DF, CONDVS, 0),
+-/* v9 */ fmovicc ("fmovqvs", FM_QF, CONDVS, 0),
+-/* v9 */ fmovicc ("fmovsvs", FM_SF, CONDVS, 0),
+-/* v9 */ fmovcc ("fmovdz", FM_DF, CONDZ, FCONDZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovqz", FM_QF, CONDZ, FCONDZ, F_ALIAS),
+-/* v9 */ fmovcc ("fmovsz", FM_SF, CONDZ, FCONDZ, F_ALIAS),
+-
++#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \
++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \
++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 }
++
++#define fmovicc(suffix, cond, flags) /* v9 */ \
++fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags), \
++fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags), \
++fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags)
++
++#define fmovfcc(suffix, fcond, flags) /* v9 */ \
++fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags), \
++fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags), \
++fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags)
++
++#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \
++fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags), \
++fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags), \
++fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags)
++
++/* v9 */ fmovcc ("a", CONDA, FCONDA, 0),
++/* v9 */ fmovicc ("cc", CONDCC, 0),
++/* v9 */ fmovicc ("cs", CONDCS, 0),
++/* v9 */ fmovcc ("e", CONDE, FCONDE, 0),
++/* v9 */ fmovcc ("g", CONDG, FCONDG, 0),
++/* v9 */ fmovcc ("ge", CONDGE, FCONDGE, 0),
++/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS),
++/* v9 */ fmovicc ("gu", CONDGU, 0),
++/* v9 */ fmovcc ("l", CONDL, FCONDL, 0),
++/* v9 */ fmovcc ("le", CONDLE, FCONDLE, 0),
++/* v9 */ fmovicc ("leu", CONDLEU, 0),
++/* v9 */ fmovfcc ("lg", FCONDLG, 0),
++/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS),
++/* v9 */ fmovcc ("n", CONDN, FCONDN, 0),
++/* v9 */ fmovcc ("ne", CONDNE, FCONDNE, 0),
++/* v9 */ fmovicc ("neg", CONDNEG, 0),
++/* v9 */ fmovcc ("nz", CONDNZ, FCONDNZ, F_ALIAS),
++/* v9 */ fmovfcc ("o", FCONDO, 0),
++/* v9 */ fmovicc ("pos", CONDPOS, 0),
++/* v9 */ fmovfcc ("u", FCONDU, 0),
++/* v9 */ fmovfcc ("ue", FCONDUE, 0),
++/* v9 */ fmovfcc ("ug", FCONDUG, 0),
++/* v9 */ fmovfcc ("uge", FCONDUGE, 0),
++/* v9 */ fmovfcc ("ul", FCONDUL, 0),
++/* v9 */ fmovfcc ("ule", FCONDULE, 0),
++/* v9 */ fmovicc ("vc", CONDVC, 0),
++/* v9 */ fmovicc ("vs", CONDVS, 0),
++/* v9 */ fmovcc ("z", CONDZ, FCONDZ, F_ALIAS),
++
++#undef fmoviccx /* v9 */
++#undef fmovfccx /* v9 */
++#undef fmovccx /* v9 */
+ #undef fmovicc /* v9 */
+ #undef fmovfcc /* v9 */
+ #undef fmovcc /* v9 */
diff --git a/patches/binutils/2.15/ld-2.15-callahan.patch b/patches/binutils/2.15/ld-2.15-callahan.patch
new file mode 100644
index 0000000..bb4a69c
--- /dev/null
+++ b/patches/binutils/2.15/ld-2.15-callahan.patch
@@ -0,0 +1,677 @@
+Signed-off-by: dank@kegel.com
+Fixes ld speed issue.
+See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
+See thread "Re: optimizations for 3x speedup in ld",
+http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
+
+Wildcard section matching enhancement, backported from the binutils CVS tree.
+Here's the CVS log comment from the original change to ldlang.c:
+
+revision 1.177
+date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51
+2005-04-06 Jakub Jelinek <jakub@redhat.com>
+
+ * ldlang.c: Formatting.
+ (walk_wild_consider_section): Remember return value from wildcardp.
+ (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
+ (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
+
+2005-04-06 Robert O'Callahan <rocallahan@novell.com>
+
+ * ld.h (lean_section_userdata_type): Remove.
+ (fat_section_userdata_type): Remove file field.
+ (SECTION_USERDATA_SIZE): Remove.
+ * ldlang.c (init_os): Eliminate initialization of unused
+ lean_section_userdata_type.
+
+ * ldlang.h (callback_t, walk_wild_section_handler_t): New
+ typedefs.
+ (struct lang_wild_statement_struct): Add walk_wild_section_handler
+ and handler_data fields.
+ * ldlang.c (callback_t): Removed.
+ (walk_wild_consider_section, walk_wild_section_general,
+ section_iterator_callback, find_section, is_simple_wild,
+ match_simple_wild, walk_wild_section_specs1_wild0,
+ walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
+ walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
+ wild_spec_can_overlap, analyze_walk_wild_section_handler): New
+ functions.
+ (lang_add_wild): Call analyze_walk_wild_section_handler.
+ (walk_wild_section): Renamed to walk_wild_section_general and
+ created a wrapper function.
+ (section_iterator_callback_data): New typedef.
+
+Note that bfd_get_section_by_name_if didn't exist in 2.15, so it was backported
+as well.
+
+--- binutils-2.15/bfd/bfd-in2.h.old 2004-05-17 15:35:56.000000000 -0400
++++ binutils-2.15/bfd/bfd-in2.h 2006-02-09 11:54:45.989940000 -0500
+@@ -1425,6 +1425,10 @@
+
+ asection *bfd_get_section_by_name (bfd *abfd, const char *name);
+
++asection *bfd_get_section_by_name_if (bfd *abfd, const char *name,
++ bfd_boolean (*operation) (bfd *, asection *, void *),
++ void *user_storage);
++
+ char *bfd_get_unique_section_name
+ (bfd *abfd, const char *templat, int *count);
+
+--- binutils-2.15/bfd/section.c.old 2003-12-01 01:33:01.000000000 -0500
++++ binutils-2.15/bfd/section.c 2006-01-23 14:16:54.768993000 -0500
+@@ -801,6 +801,57 @@
+
+ /*
+ FUNCTION
++ bfd_get_section_by_name_if
++
++SYNOPSIS
++ asection *bfd_get_section_by_name_if
++ (bfd *abfd,
++ const char *name,
++ bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
++ void *obj);
++
++DESCRIPTION
++ Call the provided function @var{func} for each section
++ attached to the BFD @var{abfd} whose name matches @var{name},
++ passing @var{obj} as an argument. The function will be called
++ as if by
++
++| func (abfd, the_section, obj);
++
++ It returns the first section for which @var{func} returns true,
++ otherwise <<NULL>>.
++
++*/
++
++asection *
++bfd_get_section_by_name_if (bfd *abfd, const char *name,
++ bfd_boolean (*operation) (bfd *,
++ asection *,
++ void *),
++ void *user_storage)
++{
++ struct section_hash_entry *sh;
++ unsigned long hash;
++
++ sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE);
++ if (sh == NULL)
++ return NULL;
++
++ hash = sh->root.hash;
++ do
++ {
++ if ((*operation) (abfd, &sh->section, user_storage))
++ return &sh->section;
++ sh = (struct section_hash_entry *) sh->root.next;
++ }
++ while (sh != NULL && sh->root.hash == hash
++ && strcmp (sh->root.string, name) == 0);
++
++ return NULL;
++}
++
++/*
++FUNCTION
+ bfd_get_unique_section_name
+
+ SYNOPSIS
+--- binutils-2.15/ld/ldlang.c.old 2004-05-17 15:36:16.000000000 -0400
++++ binutils-2.15/ld/ldlang.c 2006-01-23 13:40:12.745499000 -0500
+@@ -81,9 +81,6 @@
+ static void lang_record_phdrs (void);
+ static void lang_do_version_exports_section (void);
+
+-typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
+- asection *, lang_input_statement_type *, void *);
+-
+ /* Exported variables. */
+ lang_output_section_statement_type *abs_output_section;
+ lang_statement_list_type lang_output_section_statement;
+@@ -138,21 +135,71 @@
+
+ /* Generic traversal routines for finding matching sections. */
+
++/* Try processing a section against a wildcard. This just calls
++ the callback unless the filename exclusion list is present
++ and excludes the file. It's hardly ever present so this
++ function is very fast. */
++
++static void
++walk_wild_consider_section (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ asection *s,
++ struct wildcard_list *sec,
++ callback_t callback,
++ void *data)
++{
++ bfd_boolean skip = FALSE;
++ struct name_list *list_tmp;
++
++ /* Don't process sections from files which were
++ excluded. */
++ for (list_tmp = sec->spec.exclude_name_list;
++ list_tmp;
++ list_tmp = list_tmp->next)
++ {
++ bfd_boolean is_wildcard = wildcardp (list_tmp->name);
++ if (is_wildcard)
++ skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
++ else
++ skip = strcmp (list_tmp->name, file->filename) == 0;
++
++ /* If this file is part of an archive, and the archive is
++ excluded, exclude this file. */
++ if (! skip && file->the_bfd != NULL
++ && file->the_bfd->my_archive != NULL
++ && file->the_bfd->my_archive->filename != NULL)
++ {
++ if (is_wildcard)
++ skip = fnmatch (list_tmp->name,
++ file->the_bfd->my_archive->filename,
++ 0) == 0;
++ else
++ skip = strcmp (list_tmp->name,
++ file->the_bfd->my_archive->filename) == 0;
++ }
++
++ if (skip)
++ break;
++ }
++
++ if (!skip)
++ (*callback) (ptr, sec, s, file, data);
++}
++
++/* Lowest common denominator routine that can handle everything correctly,
++ but slowly. */
++
+ static void
+-walk_wild_section (lang_wild_statement_type *ptr,
+- lang_input_statement_type *file,
+- callback_t callback,
+- void *data)
++walk_wild_section_general (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
+ {
+ asection *s;
+-
+- if (file->just_syms_flag)
+- return;
++ struct wildcard_list *sec;
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+- struct wildcard_list *sec;
+-
+ sec = ptr->section_list;
+ if (sec == NULL)
+ (*callback) (ptr, sec, s, file, data);
+@@ -160,39 +207,8 @@
+ while (sec != NULL)
+ {
+ bfd_boolean skip = FALSE;
+- struct name_list *list_tmp;
+-
+- /* Don't process sections from files which were
+- excluded. */
+- for (list_tmp = sec->spec.exclude_name_list;
+- list_tmp;
+- list_tmp = list_tmp->next)
+- {
+- if (wildcardp (list_tmp->name))
+- skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
+- else
+- skip = strcmp (list_tmp->name, file->filename) == 0;
+-
+- /* If this file is part of an archive, and the archive is
+- excluded, exclude this file. */
+- if (! skip && file->the_bfd != NULL
+- && file->the_bfd->my_archive != NULL
+- && file->the_bfd->my_archive->filename != NULL)
+- {
+- if (wildcardp (list_tmp->name))
+- skip = fnmatch (list_tmp->name,
+- file->the_bfd->my_archive->filename,
+- 0) == 0;
+- else
+- skip = strcmp (list_tmp->name,
+- file->the_bfd->my_archive->filename) == 0;
+- }
+-
+- if (skip)
+- break;
+- }
+
+- if (!skip && sec->spec.name != NULL)
++ if (sec->spec.name != NULL)
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+
+@@ -203,13 +219,381 @@
+ }
+
+ if (!skip)
+- (*callback) (ptr, sec, s, file, data);
++ walk_wild_consider_section (ptr, file, s, sec, callback, data);
+
+ sec = sec->next;
+ }
+ }
+ }
+
++/* Routines to find a single section given its name. If there's more
++ than one section with that name, we report that. */
++
++typedef struct
++{
++ asection *found_section;
++ bfd_boolean multiple_sections_found;
++} section_iterator_callback_data;
++
++static bfd_boolean
++section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
++{
++ section_iterator_callback_data *d = data;
++
++ if (d->found_section != NULL)
++ {
++ d->multiple_sections_found = TRUE;
++ return TRUE;
++ }
++
++ d->found_section = s;
++ return FALSE;
++}
++
++static asection *
++find_section (lang_input_statement_type *file,
++ struct wildcard_list *sec,
++ bfd_boolean *multiple_sections_found)
++{
++ section_iterator_callback_data cb_data = { NULL, FALSE };
++
++ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name,
++ section_iterator_callback, &cb_data);
++ *multiple_sections_found = cb_data.multiple_sections_found;
++ return cb_data.found_section;
++}
++
++/* Code for handling simple wildcards without going through fnmatch,
++ which can be expensive because of charset translations etc. */
++
++/* A simple wild is a literal string followed by a single '*',
++ where the literal part is at least 4 characters long. */
++
++static bfd_boolean
++is_simple_wild (const char *name)
++{
++ size_t len = strcspn (name, "*?[");
++ return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
++}
++
++static bfd_boolean
++match_simple_wild (const char *pattern, const char *name)
++{
++ /* The first four characters of the pattern are guaranteed valid
++ non-wildcard characters. So we can go faster. */
++ if (pattern[0] != name[0] || pattern[1] != name[1]
++ || pattern[2] != name[2] || pattern[3] != name[3])
++ return FALSE;
++
++ pattern += 4;
++ name += 4;
++ while (*pattern != '*')
++ if (*name++ != *pattern++)
++ return FALSE;
++
++ return TRUE;
++}
++
++/* Specialized, optimized routines for handling different kinds of
++ wildcards */
++
++static void
++walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ /* We can just do a hash lookup for the section with the right name.
++ But if that lookup discovers more than one section with the name
++ (should be rare), we fall back to the general algorithm because
++ we would otherwise have to sort the sections to make sure they
++ get processed in the bfd's order. */
++ bfd_boolean multiple_sections_found;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ asection *s0 = find_section (file, sec0, &multiple_sections_found);
++
++ if (multiple_sections_found)
++ walk_wild_section_general (ptr, file, callback, data);
++ else if (s0)
++ walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
++}
++
++static void
++walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *wildsec0 = ptr->handler_data[0];
++
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
++ }
++}
++
++static void
++walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ struct wildcard_list *wildsec1 = ptr->handler_data[1];
++ bfd_boolean multiple_sections_found;
++ asection *s0 = find_section (file, sec0, &multiple_sections_found);
++
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ /* Note that if the section was not found, s0 is NULL and
++ we'll simply never succeed the s == s0 test below. */
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ /* Recall that in this code path, a section cannot satisfy more
++ than one spec, so if s == s0 then it cannot match
++ wildspec1. */
++ if (s == s0)
++ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
++ else
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec1, callback,
++ data);
++ }
++ }
++}
++
++static void
++walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ struct wildcard_list *wildsec1 = ptr->handler_data[1];
++ struct wildcard_list *wildsec2 = ptr->handler_data[2];
++ bfd_boolean multiple_sections_found;
++ asection *s0 = find_section (file, sec0, &multiple_sections_found);
++
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ if (s == s0)
++ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
++ else
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
++ else
++ {
++ skip = !match_simple_wild (wildsec2->spec.name, sname);
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
++ data);
++ }
++ }
++ }
++}
++
++static void
++walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ struct wildcard_list *sec1 = ptr->handler_data[1];
++ struct wildcard_list *wildsec2 = ptr->handler_data[2];
++ struct wildcard_list *wildsec3 = ptr->handler_data[3];
++ bfd_boolean multiple_sections_found;
++ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
++
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ s1 = find_section (file, sec1, &multiple_sections_found);
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ if (s == s0)
++ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
++ else
++ if (s == s1)
++ walk_wild_consider_section (ptr, file, s, sec1, callback, data);
++ else
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
++ sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
++ data);
++ else
++ {
++ skip = !match_simple_wild (wildsec3->spec.name, sname);
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec3,
++ callback, data);
++ }
++ }
++ }
++}
++
++static void
++walk_wild_section (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ if (file->just_syms_flag)
++ return;
++
++ (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
++}
++
++/* Returns TRUE when name1 is a wildcard spec that might match
++ something name2 can match. We're conservative: we return FALSE
++ only if the prefixes of name1 and name2 are different up to the
++ first wildcard character. */
++
++static bfd_boolean
++wild_spec_can_overlap (const char *name1, const char *name2)
++{
++ size_t prefix1_len = strcspn (name1, "?*[");
++ size_t prefix2_len = strcspn (name2, "?*[");
++ size_t min_prefix_len;
++
++ /* Note that if there is no wildcard character, then we treat the
++ terminating 0 as part of the prefix. Thus ".text" won't match
++ ".text." or ".text.*", for example. */
++ if (name1[prefix1_len] == '\0')
++ prefix1_len++;
++ if (name2[prefix2_len] == '\0')
++ prefix2_len++;
++
++ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
++
++ return memcmp (name1, name2, min_prefix_len) == 0;
++}
++
++/* Select specialized code to handle various kinds of wildcard
++ statements. */
++
++static void
++analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
++{
++ int sec_count = 0;
++ int wild_name_count = 0;
++ struct wildcard_list *sec;
++ int signature;
++ int data_counter;
++
++ ptr->walk_wild_section_handler = walk_wild_section_general;
++
++ /* Count how many wildcard_specs there are, and how many of those
++ actually use wildcards in the name. Also, bail out if any of the
++ wildcard names are NULL. (Can this actually happen?
++ walk_wild_section used to test for it.) And bail out if any
++ of the wildcards are more complex than a simple string
++ ending in a single '*'. */
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ {
++ ++sec_count;
++ if (sec->spec.name == NULL)
++ return;
++ if (wildcardp (sec->spec.name))
++ {
++ ++wild_name_count;
++ if (!is_simple_wild (sec->spec.name))
++ return;
++ }
++ }
++
++ /* The zero-spec case would be easy to optimize but it doesn't
++ happen in practice. Likewise, more than 4 specs doesn't
++ happen in practice. */
++ if (sec_count == 0 || sec_count > 4)
++ return;
++
++ /* Check that no two specs can match the same section. */
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ {
++ struct wildcard_list *sec2;
++ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
++ {
++ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
++ return;
++ }
++ }
++
++ signature = (sec_count << 8) + wild_name_count;
++ switch (signature)
++ {
++ case 0x0100:
++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
++ break;
++ case 0x0101:
++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
++ break;
++ case 0x0201:
++ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
++ break;
++ case 0x0302:
++ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
++ break;
++ case 0x0402:
++ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
++ break;
++ default:
++ return;
++ }
++
++ /* Now fill the data array with pointers to the specs, first the
++ specs with non-wildcard names, then the specs with wildcard
++ names. It's OK to process the specs in different order from the
++ given order, because we've already determined that no section
++ will match more than one spec. */
++ data_counter = 0;
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ if (!wildcardp (sec->spec.name))
++ ptr->handler_data[data_counter++] = sec;
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ if (wildcardp (sec->spec.name))
++ ptr->handler_data[data_counter++] = sec;
++}
++
+ /* Handle a wild statement for a single file F. */
+
+ static void
+@@ -4353,6 +4737,7 @@
+ new->section_list = section_list;
+ new->keep_sections = keep_sections;
+ lang_list_init (&new->children);
++ analyze_walk_wild_section_handler (new);
+ }
+
+ void
+--- binutils-2.15/ld/ldlang.h.old 2004-05-17 15:36:16.000000000 -0400
++++ binutils-2.15/ld/ldlang.h 2006-01-23 13:32:33.653292000 -0500
+@@ -295,7 +295,17 @@
+ union lang_statement_union *file;
+ } lang_afile_asection_pair_statement_type;
+
+-typedef struct lang_wild_statement_struct
++typedef struct lang_wild_statement_struct lang_wild_statement_type;
++
++typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
++ asection *, lang_input_statement_type *, void *);
++
++typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
++ lang_input_statement_type *,
++ callback_t callback,
++ void *data);
++
++struct lang_wild_statement_struct
+ {
+ lang_statement_header_type header;
+ const char *filename;
+@@ -303,7 +313,10 @@
+ struct wildcard_list *section_list;
+ bfd_boolean keep_sections;
+ lang_statement_list_type children;
+-} lang_wild_statement_type;
++
++ walk_wild_section_handler_t walk_wild_section_handler;
++ struct wildcard_list *handler_data[4];
++};
+
+ typedef struct lang_address_statement_struct
+ {
diff --git a/patches/binutils/2.15/ld-2.15-stabs-tweak.patch b/patches/binutils/2.15/ld-2.15-stabs-tweak.patch
new file mode 100644
index 0000000..bd6ae7a
--- /dev/null
+++ b/patches/binutils/2.15/ld-2.15-stabs-tweak.patch
@@ -0,0 +1,33 @@
+Signed-off-by: dank@kegel.com
+
+See http://sourceware.org/ml/binutils/2005-12/msg00270.html
+http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
+
+STABS hash table size change, backported from the binutils CVS tree. Here's
+the CVS log comment for the original change:
+
+revision 1.25
+date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3
+(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
+bfd_hash_table_init_n(...,251) so that the size of the hash table can be
+controlled by the user.
+
+Note that tunable hash table size changes were added after 2.15. The effect
+of this change is to make bfd use its default hash table size for the stabs
+hash as well.
+
+
+--- binutils-2.15/bfd/stabs.c.old 2004-05-17 15:36:04.000000000 -0400
++++ binutils-2.15/bfd/stabs.c 2006-02-09 15:21:56.567014000 -0500
+@@ -241,9 +241,8 @@
+ goto error_return;
+ /* Make sure the first byte is zero. */
+ (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
+- if (! bfd_hash_table_init_n (&sinfo->includes.root,
+- stab_link_includes_newfunc,
+- 251))
++ if (! bfd_hash_table_init (&sinfo->includes.root,
++ stab_link_includes_newfunc))
+ goto error_return;
+ sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
+ sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;
diff --git a/patches/binutils/2.15/s390-invalid-insn-format.patch b/patches/binutils/2.15/s390-invalid-insn-format.patch
new file mode 100644
index 0000000..3296201
--- /dev/null
+++ b/patches/binutils/2.15/s390-invalid-insn-format.patch
@@ -0,0 +1,42 @@
+Message-ID: <000801c48f60$cec16630$9103a8c0@ULOC5012>
+From: "Michael Geiger" <mcgege@gmx.de>
+To: <dank@kegel.com>
+Subject: Patch for cross compiling s/390 kernel on linux host
+Date: Tue, 31 Aug 2004 15:45:41 +0200
+
+Dear Dan,
+
+I had big problems compiling a kernel for s/390 on my linux host - I tried
+different chains from crosstool-0.28-rc34 and finally succeded with
+gcc-3.3.4-glibc-2.3.2 after applying another patch to binutils-2.15
+(attached).
+All compilations of the different kernel versions I tried stopped with
+"Invalid .insn format" somewhere. I checked the recent cvs version of
+binutils and applied the latest diff to gas/config/tc-s390.c and that solved
+it.
+
+Greetings
+
+Michael Geiger
+
+
+diff -u -r1.39 -r1.40
+--- src/gas/config/tc-s390.c 2004/05/06 11:01:48 1.39
++++ src/gas/config/tc-s390.c 2004/06/15 12:38:08 1.40
+@@ -1596,13 +1596,13 @@
+ if (exp.X_op == O_constant)
+ {
+ if ( ( opformat->oplen == 6
+- && exp.X_add_number >= 0
++ && (addressT) exp.X_add_number >= 0
+ && (addressT) exp.X_add_number < (1ULL << 48))
+ || ( opformat->oplen == 4
+- && exp.X_add_number >= 0
++ && (addressT) exp.X_add_number >= 0
+ && (addressT) exp.X_add_number < (1ULL << 32))
+ || ( opformat->oplen == 2
+- && exp.X_add_number >= 0
++ && (addressT) exp.X_add_number >= 0
+ && (addressT) exp.X_add_number < (1ULL << 16)))
+ md_number_to_chars (insn, exp.X_add_number, opformat->oplen);
+ else
diff --git a/patches/binutils/2.16.1/bfd-hash-tweak.patch b/patches/binutils/2.16.1/bfd-hash-tweak.patch
new file mode 100644
index 0000000..c6de93a
--- /dev/null
+++ b/patches/binutils/2.16.1/bfd-hash-tweak.patch
@@ -0,0 +1,23 @@
+Signed-off-by: dank@kegel.com
+
+Raising the size of the hash table is a noticable win when linking
+at least one large app.
+
+There was a patch,
+http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
+to do this dynamically. No idea why that didn't make it in.
+So this tiny change to raise the default size is just
+a stopgap for now.
+
+
+--- binutils-2.16.1/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800
++++ binutils-2.16.1/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800
+@@ -300,7 +300,7 @@
+ */
+
+ /* The default number of entries to use when creating a hash table. */
+-#define DEFAULT_SIZE 4051
++#define DEFAULT_SIZE 32749
+ static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
+
+ /* Create a new hash table, given a number of entries. */
diff --git a/patches/binutils/2.16.1/binutils-2.15-psignal.patch b/patches/binutils/2.16.1/binutils-2.15-psignal.patch
new file mode 100644
index 0000000..98fa600
--- /dev/null
+++ b/patches/binutils/2.16.1/binutils-2.15-psignal.patch
@@ -0,0 +1,40 @@
+Make psignal prototype in libiberty match that in glibc.
+
+Fixes:
+
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
+/usr/include/signal.h:131: prototype declaration
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
+/usr/include/signal.h:131: prototype declaration
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
+mprotect... make[1]: *** [strsignal.o] Error 1
+make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
+make: *** [all-libiberty] Error 2
+
+when building on red hat 7.1
+though it's a bit of a mystery why libiberty's psignal is being compiled at
+all, since red hat 7.1's glibc supports psignal (hence the error message)
+
+--- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
++++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
+@@ -544,7 +544,7 @@
+
+ /*
+
+-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
+
+ Print @var{message} to the standard error, followed by a colon,
+ followed by the description of the signal specified by @var{signo},
+@@ -557,9 +557,7 @@
+ #ifndef HAVE_PSIGNAL
+
+ void
+-psignal (signo, message)
+- unsigned signo;
+- char *message;
++psignal (int signo, const char *message)
+ {
+ if (signal_names == NULL)
+ {
diff --git a/patches/binutils/2.16.1/binutils-skip-comments.patch b/patches/binutils/2.16.1/binutils-skip-comments.patch
new file mode 100644
index 0000000..0ca9a47
--- /dev/null
+++ b/patches/binutils/2.16.1/binutils-skip-comments.patch
@@ -0,0 +1,95 @@
+[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
+
+Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
+Fixes
+localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
+when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
+
+Paths adjusted to match crosstool's patcher.
+
+Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
+From: Andreas Schwab <schwab at suse dot de>
+To: Nathan Sidwell <nathan at codesourcery dot com>
+Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
+Date: Fri, 23 Apr 2004 22:27:19 +0200
+Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
+
+Nathan Sidwell <nathan@codesourcery.com> writes:
+
+> Index: read.c
+> ===================================================================
+> RCS file: /cvs/src/src/gas/read.c,v
+> retrieving revision 1.76
+> diff -c -3 -p -r1.76 read.c
+> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
+> --- read.c 18 Mar 2004 09:56:05 -0000
+> *************** read_a_source_file (char *name)
+> *** 1053,1059 ****
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! ignore_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+> --- 1053,1059 ----
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! demand_empty_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+
+This means that the unknown character is no longer ignored, despite the
+comment. As a side effect a line starting with a line comment character
+not followed by APP in NO_APP mode now triggers an error instead of just a
+warning, breaking builds of glibc on m68k-linux. Earlier in
+read_a_source_file where #APP is handled there is another comment that
+claims that unknown comments are ignored, when in fact they aren't (only
+the initial line comment character is skipped).
+
+Note that the presence of #APP will mess up the line counters, but
+that appears to be difficult to fix.
+
+Andreas.
+
+2004-04-23 Andreas Schwab <schwab@suse.de>
+
+ * read.c (read_a_source_file): Ignore unknown text after line
+ comment character. Fix misleading comment.
+
+--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
+@@ -950,10 +950,14 @@ read_a_source_file (char *name)
+ unsigned int new_length;
+ char *tmp_buf = 0;
+
+- bump_line_counters ();
+ s = input_line_pointer;
+ if (strncmp (s, "APP\n", 4))
+- continue; /* We ignore it */
++ {
++ /* We ignore it */
++ ignore_rest_of_line ();
++ continue;
++ }
++ bump_line_counters ();
+ s += 4;
+
+ sb_new (&sbuf);
+@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
+ continue;
+ #endif
+ input_line_pointer--;
+- /* Report unknown char as ignored. */
++ /* Report unknown char as error. */
+ demand_empty_rest_of_line ();
+ }
+
+
+--
+Andreas Schwab, SuSE Labs, schwab@suse.de
+SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
+Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
+"And now for something completely different."
diff --git a/patches/binutils/2.16.1/callahan.patch b/patches/binutils/2.16.1/callahan.patch
new file mode 100644
index 0000000..a39050f
--- /dev/null
+++ b/patches/binutils/2.16.1/callahan.patch
@@ -0,0 +1,693 @@
+Signed-off-by: dank@kegel.com
+Fixes ld speed issue.
+See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
+See thread "Re: optimizations for 3x speedup in ld",
+http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
+
+Wildcard section matching enhancement, backported from the binutils CVS tree.
+Here's the CVS log comment from the original change to ldlang.c:
+
+revision 1.177
+date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51
+2005-04-06 Jakub Jelinek <jakub@redhat.com>
+
+ * ldlang.c: Formatting.
+ (walk_wild_consider_section): Remember return value from wildcardp.
+ (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
+ (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
+
+2005-04-06 Robert O'Callahan <rocallahan@novell.com>
+
+ * ld.h (lean_section_userdata_type): Remove.
+ (fat_section_userdata_type): Remove file field.
+ (SECTION_USERDATA_SIZE): Remove.
+ * ldlang.c (init_os): Eliminate initialization of unused
+ lean_section_userdata_type.
+
+ * ldlang.h (callback_t, walk_wild_section_handler_t): New
+ typedefs.
+ (struct lang_wild_statement_struct): Add walk_wild_section_handler
+ and handler_data fields.
+ * ldlang.c (callback_t): Removed.
+ (walk_wild_consider_section, walk_wild_section_general,
+ section_iterator_callback, find_section, is_simple_wild,
+ match_simple_wild, walk_wild_section_specs1_wild0,
+ walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
+ walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
+ wild_spec_can_overlap, analyze_walk_wild_section_handler): New
+ functions.
+ (lang_add_wild): Call analyze_walk_wild_section_handler.
+ (walk_wild_section): Renamed to walk_wild_section_general and
+ created a wrapper function.
+ (section_iterator_callback_data): New typedef.
+
+
+Index: src/ld/ld.h
+===================================================================
+RCS file: /cvs/src/src/ld/ld.h,v
+retrieving revision 1.26
+retrieving revision 1.27
+diff -u -r1.26 -r1.27
+--- binutils/ld/ld.h.old 16 Mar 2005 21:52:42 -0000 1.26
++++ binutils/ld/ld.h 6 Apr 2005 15:33:02 -0000 1.27
+@@ -1,6 +1,6 @@
+ /* ld.h -- general linker header file
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+- 2001, 2002, 2003, 2004
++ 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
+
+ This file is part of GLD, the Gnu Linker.
+@@ -89,28 +89,15 @@
+ struct map_symbol_def *next;
+ };
+
+-/* Extra information we hold on sections */
+-typedef struct lean_user_section_struct {
+- /* For output sections: pointer to the section where this data will go. */
+- struct lang_input_statement_struct *file;
+-} lean_section_userdata_type;
+-
+ /* The initial part of fat_user_section_struct has to be idential with
+ lean_user_section_struct. */
+ typedef struct fat_user_section_struct {
+- /* For output sections: pointer to the section where this data will go. */
+- struct lang_input_statement_struct *file;
+ /* For input sections, when writing a map file: head / tail of a linked
+ list of hash table entries for symbols defined in this section. */
+ struct map_symbol_def *map_symbol_def_head;
+ struct map_symbol_def **map_symbol_def_tail;
+ } fat_section_userdata_type;
+
+-#define SECTION_USERDATA_SIZE \
+- (command_line.reduce_memory_overheads \
+- ? sizeof (lean_section_userdata_type) \
+- : sizeof (fat_section_userdata_type))
+-
+ #define get_userdata(x) ((x)->userdata)
+
+ #define BYTE_SIZE (1)
+Index: src/ld/ldlang.c
+===================================================================
+RCS file: /cvs/src/src/ld/ldlang.c,v
+retrieving revision 1.176
+retrieving revision 1.177
+diff -u -r1.176 -r1.177
+--- binutils/ld/ldlang.c.old 18 Mar 2005 13:56:26 -0000 1.176
++++ binutils/ld/ldlang.c 6 Apr 2005 15:33:02 -0000 1.177
+@@ -84,9 +84,6 @@
+ static void lang_record_phdrs (void);
+ static void lang_do_version_exports_section (void);
+
+-typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
+- asection *, lang_input_statement_type *, void *);
+-
+ /* Exported variables. */
+ lang_output_section_statement_type *abs_output_section;
+ lang_statement_list_type lang_output_section_statement;
+@@ -155,21 +152,71 @@
+
+ /* Generic traversal routines for finding matching sections. */
+
++/* Try processing a section against a wildcard. This just calls
++ the callback unless the filename exclusion list is present
++ and excludes the file. It's hardly ever present so this
++ function is very fast. */
++
++static void
++walk_wild_consider_section (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ asection *s,
++ struct wildcard_list *sec,
++ callback_t callback,
++ void *data)
++{
++ bfd_boolean skip = FALSE;
++ struct name_list *list_tmp;
++
++ /* Don't process sections from files which were
++ excluded. */
++ for (list_tmp = sec->spec.exclude_name_list;
++ list_tmp;
++ list_tmp = list_tmp->next)
++ {
++ bfd_boolean is_wildcard = wildcardp (list_tmp->name);
++ if (is_wildcard)
++ skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
++ else
++ skip = strcmp (list_tmp->name, file->filename) == 0;
++
++ /* If this file is part of an archive, and the archive is
++ excluded, exclude this file. */
++ if (! skip && file->the_bfd != NULL
++ && file->the_bfd->my_archive != NULL
++ && file->the_bfd->my_archive->filename != NULL)
++ {
++ if (is_wildcard)
++ skip = fnmatch (list_tmp->name,
++ file->the_bfd->my_archive->filename,
++ 0) == 0;
++ else
++ skip = strcmp (list_tmp->name,
++ file->the_bfd->my_archive->filename) == 0;
++ }
++
++ if (skip)
++ break;
++ }
++
++ if (!skip)
++ (*callback) (ptr, sec, s, file, data);
++}
++
++/* Lowest common denominator routine that can handle everything correctly,
++ but slowly. */
++
+ static void
+-walk_wild_section (lang_wild_statement_type *ptr,
+- lang_input_statement_type *file,
+- callback_t callback,
+- void *data)
++walk_wild_section_general (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
+ {
+ asection *s;
+-
+- if (file->just_syms_flag)
+- return;
++ struct wildcard_list *sec;
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+- struct wildcard_list *sec;
+-
+ sec = ptr->section_list;
+ if (sec == NULL)
+ (*callback) (ptr, sec, s, file, data);
+@@ -177,39 +224,8 @@
+ while (sec != NULL)
+ {
+ bfd_boolean skip = FALSE;
+- struct name_list *list_tmp;
+
+- /* Don't process sections from files which were
+- excluded. */
+- for (list_tmp = sec->spec.exclude_name_list;
+- list_tmp;
+- list_tmp = list_tmp->next)
+- {
+- if (wildcardp (list_tmp->name))
+- skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
+- else
+- skip = strcmp (list_tmp->name, file->filename) == 0;
+-
+- /* If this file is part of an archive, and the archive is
+- excluded, exclude this file. */
+- if (! skip && file->the_bfd != NULL
+- && file->the_bfd->my_archive != NULL
+- && file->the_bfd->my_archive->filename != NULL)
+- {
+- if (wildcardp (list_tmp->name))
+- skip = fnmatch (list_tmp->name,
+- file->the_bfd->my_archive->filename,
+- 0) == 0;
+- else
+- skip = strcmp (list_tmp->name,
+- file->the_bfd->my_archive->filename) == 0;
+- }
+-
+- if (skip)
+- break;
+- }
+-
+- if (!skip && sec->spec.name != NULL)
++ if (sec->spec.name != NULL)
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+
+@@ -220,13 +236,381 @@
+ }
+
+ if (!skip)
+- (*callback) (ptr, sec, s, file, data);
++ walk_wild_consider_section (ptr, file, s, sec, callback, data);
+
+ sec = sec->next;
+ }
+ }
+ }
+
++/* Routines to find a single section given its name. If there's more
++ than one section with that name, we report that. */
++
++typedef struct
++{
++ asection *found_section;
++ bfd_boolean multiple_sections_found;
++} section_iterator_callback_data;
++
++static bfd_boolean
++section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
++{
++ section_iterator_callback_data *d = data;
++
++ if (d->found_section != NULL)
++ {
++ d->multiple_sections_found = TRUE;
++ return TRUE;
++ }
++
++ d->found_section = s;
++ return FALSE;
++}
++
++static asection *
++find_section (lang_input_statement_type *file,
++ struct wildcard_list *sec,
++ bfd_boolean *multiple_sections_found)
++{
++ section_iterator_callback_data cb_data = { NULL, FALSE };
++
++ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name,
++ section_iterator_callback, &cb_data);
++ *multiple_sections_found = cb_data.multiple_sections_found;
++ return cb_data.found_section;
++}
++
++/* Code for handling simple wildcards without going through fnmatch,
++ which can be expensive because of charset translations etc. */
++
++/* A simple wild is a literal string followed by a single '*',
++ where the literal part is at least 4 characters long. */
++
++static bfd_boolean
++is_simple_wild (const char *name)
++{
++ size_t len = strcspn (name, "*?[");
++ return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
++}
++
++static bfd_boolean
++match_simple_wild (const char *pattern, const char *name)
++{
++ /* The first four characters of the pattern are guaranteed valid
++ non-wildcard characters. So we can go faster. */
++ if (pattern[0] != name[0] || pattern[1] != name[1]
++ || pattern[2] != name[2] || pattern[3] != name[3])
++ return FALSE;
++
++ pattern += 4;
++ name += 4;
++ while (*pattern != '*')
++ if (*name++ != *pattern++)
++ return FALSE;
++
++ return TRUE;
++}
++
++/* Specialized, optimized routines for handling different kinds of
++ wildcards */
++
++static void
++walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ /* We can just do a hash lookup for the section with the right name.
++ But if that lookup discovers more than one section with the name
++ (should be rare), we fall back to the general algorithm because
++ we would otherwise have to sort the sections to make sure they
++ get processed in the bfd's order. */
++ bfd_boolean multiple_sections_found;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ asection *s0 = find_section (file, sec0, &multiple_sections_found);
++
++ if (multiple_sections_found)
++ walk_wild_section_general (ptr, file, callback, data);
++ else if (s0)
++ walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
++}
++
++static void
++walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *wildsec0 = ptr->handler_data[0];
++
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
++ }
++}
++
++static void
++walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ struct wildcard_list *wildsec1 = ptr->handler_data[1];
++ bfd_boolean multiple_sections_found;
++ asection *s0 = find_section (file, sec0, &multiple_sections_found);
++
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ /* Note that if the section was not found, s0 is NULL and
++ we'll simply never succeed the s == s0 test below. */
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ /* Recall that in this code path, a section cannot satisfy more
++ than one spec, so if s == s0 then it cannot match
++ wildspec1. */
++ if (s == s0)
++ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
++ else
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec1, callback,
++ data);
++ }
++ }
++}
++
++static void
++walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ struct wildcard_list *wildsec1 = ptr->handler_data[1];
++ struct wildcard_list *wildsec2 = ptr->handler_data[2];
++ bfd_boolean multiple_sections_found;
++ asection *s0 = find_section (file, sec0, &multiple_sections_found);
++
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ if (s == s0)
++ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
++ else
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
++ else
++ {
++ skip = !match_simple_wild (wildsec2->spec.name, sname);
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
++ data);
++ }
++ }
++ }
++}
++
++static void
++walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ asection *s;
++ struct wildcard_list *sec0 = ptr->handler_data[0];
++ struct wildcard_list *sec1 = ptr->handler_data[1];
++ struct wildcard_list *wildsec2 = ptr->handler_data[2];
++ struct wildcard_list *wildsec3 = ptr->handler_data[3];
++ bfd_boolean multiple_sections_found;
++ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
++
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ s1 = find_section (file, sec1, &multiple_sections_found);
++ if (multiple_sections_found)
++ {
++ walk_wild_section_general (ptr, file, callback, data);
++ return;
++ }
++
++ for (s = file->the_bfd->sections; s != NULL; s = s->next)
++ {
++ if (s == s0)
++ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
++ else
++ if (s == s1)
++ walk_wild_consider_section (ptr, file, s, sec1, callback, data);
++ else
++ {
++ const char *sname = bfd_get_section_name (file->the_bfd, s);
++ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
++ sname);
++
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
++ data);
++ else
++ {
++ skip = !match_simple_wild (wildsec3->spec.name, sname);
++ if (!skip)
++ walk_wild_consider_section (ptr, file, s, wildsec3,
++ callback, data);
++ }
++ }
++ }
++}
++
++static void
++walk_wild_section (lang_wild_statement_type *ptr,
++ lang_input_statement_type *file,
++ callback_t callback,
++ void *data)
++{
++ if (file->just_syms_flag)
++ return;
++
++ (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
++}
++
++/* Returns TRUE when name1 is a wildcard spec that might match
++ something name2 can match. We're conservative: we return FALSE
++ only if the prefixes of name1 and name2 are different up to the
++ first wildcard character. */
++
++static bfd_boolean
++wild_spec_can_overlap (const char *name1, const char *name2)
++{
++ size_t prefix1_len = strcspn (name1, "?*[");
++ size_t prefix2_len = strcspn (name2, "?*[");
++ size_t min_prefix_len;
++
++ /* Note that if there is no wildcard character, then we treat the
++ terminating 0 as part of the prefix. Thus ".text" won't match
++ ".text." or ".text.*", for example. */
++ if (name1[prefix1_len] == '\0')
++ prefix1_len++;
++ if (name2[prefix2_len] == '\0')
++ prefix2_len++;
++
++ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
++
++ return memcmp (name1, name2, min_prefix_len) == 0;
++}
++
++/* Select specialized code to handle various kinds of wildcard
++ statements. */
++
++static void
++analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
++{
++ int sec_count = 0;
++ int wild_name_count = 0;
++ struct wildcard_list *sec;
++ int signature;
++ int data_counter;
++
++ ptr->walk_wild_section_handler = walk_wild_section_general;
++
++ /* Count how many wildcard_specs there are, and how many of those
++ actually use wildcards in the name. Also, bail out if any of the
++ wildcard names are NULL. (Can this actually happen?
++ walk_wild_section used to test for it.) And bail out if any
++ of the wildcards are more complex than a simple string
++ ending in a single '*'. */
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ {
++ ++sec_count;
++ if (sec->spec.name == NULL)
++ return;
++ if (wildcardp (sec->spec.name))
++ {
++ ++wild_name_count;
++ if (!is_simple_wild (sec->spec.name))
++ return;
++ }
++ }
++
++ /* The zero-spec case would be easy to optimize but it doesn't
++ happen in practice. Likewise, more than 4 specs doesn't
++ happen in practice. */
++ if (sec_count == 0 || sec_count > 4)
++ return;
++
++ /* Check that no two specs can match the same section. */
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ {
++ struct wildcard_list *sec2;
++ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
++ {
++ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
++ return;
++ }
++ }
++
++ signature = (sec_count << 8) + wild_name_count;
++ switch (signature)
++ {
++ case 0x0100:
++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
++ break;
++ case 0x0101:
++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
++ break;
++ case 0x0201:
++ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
++ break;
++ case 0x0302:
++ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
++ break;
++ case 0x0402:
++ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
++ break;
++ default:
++ return;
++ }
++
++ /* Now fill the data array with pointers to the specs, first the
++ specs with non-wildcard names, then the specs with wildcard
++ names. It's OK to process the specs in different order from the
++ given order, because we've already determined that no section
++ will match more than one spec. */
++ data_counter = 0;
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ if (!wildcardp (sec->spec.name))
++ ptr->handler_data[data_counter++] = sec;
++ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
++ if (wildcardp (sec->spec.name))
++ ptr->handler_data[data_counter++] = sec;
++}
++
+ /* Handle a wild statement for a single file F. */
+
+ static void
+@@ -1175,17 +1559,12 @@
+ static void
+ init_os (lang_output_section_statement_type *s)
+ {
+- lean_section_userdata_type *new;
+-
+ if (s->bfd_section != NULL)
+ return;
+
+ if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
+ einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
+
+- new = stat_alloc (SECTION_USERDATA_SIZE);
+- memset (new, 0, SECTION_USERDATA_SIZE);
+-
+ s->bfd_section = bfd_get_section_by_name (output_bfd, s->name);
+ if (s->bfd_section == NULL)
+ s->bfd_section = bfd_make_section (output_bfd, s->name);
+@@ -1199,7 +1578,14 @@
+ /* We initialize an output sections output offset to minus its own
+ vma to allow us to output a section through itself. */
+ s->bfd_section->output_offset = 0;
+- get_userdata (s->bfd_section) = new;
++ if (!command_line.reduce_memory_overheads)
++ {
++ fat_section_userdata_type *new
++ = stat_alloc (sizeof (fat_section_userdata_type));
++ memset (new, 0, sizeof (fat_section_userdata_type));
++ get_userdata (s->bfd_section) = new;
++ }
++
+
+ /* If there is a base address, make sure that any sections it might
+ mention are initialized. */
+@@ -4939,6 +5325,7 @@
+ new->section_list = section_list;
+ new->keep_sections = keep_sections;
+ lang_list_init (&new->children);
++ analyze_walk_wild_section_handler (new);
+ }
+
+ void
+Index: src/ld/ldlang.h
+===================================================================
+RCS file: /cvs/src/src/ld/ldlang.h,v
+retrieving revision 1.44
+retrieving revision 1.45
+diff -u -r1.44 -r1.45
+--- binutils/ld/ldlang.h.old 3 Mar 2005 11:51:58 -0000 1.44
++++ binutils/ld/ldlang.h 6 Apr 2005 15:33:03 -0000 1.45
+@@ -298,7 +298,17 @@
+ union lang_statement_union *file;
+ } lang_afile_asection_pair_statement_type;
+
+-typedef struct lang_wild_statement_struct
++typedef struct lang_wild_statement_struct lang_wild_statement_type;
++
++typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
++ asection *, lang_input_statement_type *, void *);
++
++typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
++ lang_input_statement_type *,
++ callback_t callback,
++ void *data);
++
++struct lang_wild_statement_struct
+ {
+ lang_statement_header_type header;
+ const char *filename;
+@@ -306,7 +316,10 @@
+ struct wildcard_list *section_list;
+ bfd_boolean keep_sections;
+ lang_statement_list_type children;
+-} lang_wild_statement_type;
++
++ walk_wild_section_handler_t walk_wild_section_handler;
++ struct wildcard_list *handler_data[4];
++};
+
+ typedef struct lang_address_statement_struct
+ {
diff --git a/patches/binutils/2.16.1/cross-gprof.patch b/patches/binutils/2.16.1/cross-gprof.patch
new file mode 100644
index 0000000..ea6c18f
--- /dev/null
+++ b/patches/binutils/2.16.1/cross-gprof.patch
@@ -0,0 +1,22 @@
+--- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700
++++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700
+@@ -999,7 +999,7 @@
+
+ # Some tools are only suitable for building in a "native" situation.
+ # Remove these if host!=target.
+-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
+--- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700
++++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700
+@@ -236,7 +236,7 @@
+
+ # Some tools are only suitable for building in a "native" situation.
+ # Remove these if host!=target.
+-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
diff --git a/patches/binutils/2.16.1/stabs-tweak.patch b/patches/binutils/2.16.1/stabs-tweak.patch
new file mode 100644
index 0000000..86e3611
--- /dev/null
+++ b/patches/binutils/2.16.1/stabs-tweak.patch
@@ -0,0 +1,28 @@
+Signed-off-by: dank@kegel.com
+
+See http://sourceware.org/ml/binutils/2005-12/msg00270.html
+http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
+
+STABS hash table size change, backported from the binutils CVS tree. Here's
+the CVS log comment for the original change:
+
+revision 1.25
+date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3
+(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
+bfd_hash_table_init_n(...,251) so that the size of the hash table can be
+controlled by the user.
+
+--- binutils/bfd/stabs.c.old 4 May 2005 15:53:39 -0000 1.24
++++ binutils/bfd/stabs.c 29 Dec 2005 10:29:23 -0000 1.25
+@@ -194,9 +194,8 @@
+ goto error_return;
+ /* Make sure the first byte is zero. */
+ (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
+- if (! bfd_hash_table_init_n (&sinfo->includes,
+- stab_link_includes_newfunc,
+- 251))
++ if (! bfd_hash_table_init (&sinfo->includes,
++ stab_link_includes_newfunc))
+ goto error_return;
+ sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
+ if (sinfo->stabstr == NULL)
diff --git a/patches/binutils/2.17.50.0.10/100-uclibc-conf.patch b/patches/binutils/2.17.50.0.10/100-uclibc-conf.patch
new file mode 100644
index 0000000..25222e5
--- /dev/null
+++ b/patches/binutils/2.17.50.0.10/100-uclibc-conf.patch
@@ -0,0 +1,139 @@
+--- binutils-2.16.91.0.7/bfd/configure
++++ binutils-2.16.91.0.7/bfd/configure
+@@ -3576,7 +3576,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/binutils/configure
++++ binutils-2.16.91.0.7/binutils/configure
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/configure
++++ binutils-2.16.91.0.7/configure
+@@ -1270,7 +1270,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -1578,7 +1578,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[3456789]86-*-vsta) ;; # don't add gprof back in
+ i[3456789]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.16.91.0.7/configure.in
++++ binutils-2.16.91.0.7/configure.in
+@@ -468,7 +468,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -776,7 +776,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[[3456789]]86-*-vsta) ;; # don't add gprof back in
+ i[[3456789]]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.16.91.0.7/gas/configure
++++ binutils-2.16.91.0.7/gas/configure
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/gprof/configure
++++ binutils-2.16.91.0.7/gprof/configure
+@@ -3419,6 +3419,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- binutils-2.16.91.0.7/ld/configure
++++ binutils-2.16.91.0.7/ld/configure
+@@ -3413,7 +3413,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/libtool.m4
++++ binutils-2.16.91.0.7/libtool.m4
+@@ -739,7 +739,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/ltconfig
++++ binutils-2.16.91.0.7/ltconfig
+@@ -602,6 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1247,7 +1248,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--- binutils-2.16.91.0.7/opcodes/configure
++++ binutils-2.16.91.0.7/opcodes/configure
+@@ -3579,7 +3579,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
diff --git a/patches/binutils/2.17.50.0.10/110-arm-eabi-conf.patch b/patches/binutils/2.17.50.0.10/110-arm-eabi-conf.patch
new file mode 100644
index 0000000..be85ceb
--- /dev/null
+++ b/patches/binutils/2.17.50.0.10/110-arm-eabi-conf.patch
@@ -0,0 +1,24 @@
+diff -urN binutils-2.16.91.0.7.orig/configure binutils-2.16.91.0.7/configure
+--- binutils-2.16.91.0.7.orig/configure 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure 2006-05-31 14:55:53.000000000 +0300
+@@ -1299,7 +1299,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
+diff -urN binutils-2.16.91.0.7.orig/configure.in binutils-2.16.91.0.7/configure.in
+--- binutils-2.16.91.0.7.orig/configure.in 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure.in 2006-05-31 14:55:53.000000000 +0300
+@@ -497,7 +497,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
diff --git a/patches/binutils/2.17.50.0.10/300-001_ld_makefile_patch.patch b/patches/binutils/2.17.50.0.10/300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000..04a7e61
--- /dev/null
+++ b/patches/binutils/2.17.50.0.10/300-001_ld_makefile_patch.patch
@@ -0,0 +1,50 @@
+#!/bin/sh -e
+## 001_ld_makefile_patch.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: correct where ld scripts are installed
+## DP: Author: Chris Chimelis <chris@debian.org>
+## DP: Upstream status: N/A
+## DP: Date: ??
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+--- binutils-2.16.91.0.1/ld/Makefile.am
++++ binutils-2.16.91.0.1/ld/Makefile.am
+@@ -20,7 +20,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+--- binutils-2.16.91.0.1/ld/Makefile.in
++++ binutils-2.16.91.0.1/ld/Makefile.in
+@@ -268,7 +268,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
diff --git a/patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch b/patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000..498651a
--- /dev/null
+++ b/patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
+## DP: cases where -rpath isn't specified. (#151024)
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
+--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
++++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
+@@ -692,6 +692,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -871,6 +873,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
diff --git a/patches/binutils/2.17.50.0.8/100-uclibc-conf.patch b/patches/binutils/2.17.50.0.8/100-uclibc-conf.patch
new file mode 100644
index 0000000..25222e5
--- /dev/null
+++ b/patches/binutils/2.17.50.0.8/100-uclibc-conf.patch
@@ -0,0 +1,139 @@
+--- binutils-2.16.91.0.7/bfd/configure
++++ binutils-2.16.91.0.7/bfd/configure
+@@ -3576,7 +3576,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/binutils/configure
++++ binutils-2.16.91.0.7/binutils/configure
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/configure
++++ binutils-2.16.91.0.7/configure
+@@ -1270,7 +1270,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -1578,7 +1578,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[3456789]86-*-vsta) ;; # don't add gprof back in
+ i[3456789]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.16.91.0.7/configure.in
++++ binutils-2.16.91.0.7/configure.in
+@@ -468,7 +468,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -776,7 +776,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[[3456789]]86-*-vsta) ;; # don't add gprof back in
+ i[[3456789]]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.16.91.0.7/gas/configure
++++ binutils-2.16.91.0.7/gas/configure
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/gprof/configure
++++ binutils-2.16.91.0.7/gprof/configure
+@@ -3419,6 +3419,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- binutils-2.16.91.0.7/ld/configure
++++ binutils-2.16.91.0.7/ld/configure
+@@ -3413,7 +3413,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/libtool.m4
++++ binutils-2.16.91.0.7/libtool.m4
+@@ -739,7 +739,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/ltconfig
++++ binutils-2.16.91.0.7/ltconfig
+@@ -602,6 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1247,7 +1248,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--- binutils-2.16.91.0.7/opcodes/configure
++++ binutils-2.16.91.0.7/opcodes/configure
+@@ -3579,7 +3579,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
diff --git a/patches/binutils/2.17.50.0.8/110-arm-eabi-conf.patch b/patches/binutils/2.17.50.0.8/110-arm-eabi-conf.patch
new file mode 100644
index 0000000..be85ceb
--- /dev/null
+++ b/patches/binutils/2.17.50.0.8/110-arm-eabi-conf.patch
@@ -0,0 +1,24 @@
+diff -urN binutils-2.16.91.0.7.orig/configure binutils-2.16.91.0.7/configure
+--- binutils-2.16.91.0.7.orig/configure 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure 2006-05-31 14:55:53.000000000 +0300
+@@ -1299,7 +1299,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
+diff -urN binutils-2.16.91.0.7.orig/configure.in binutils-2.16.91.0.7/configure.in
+--- binutils-2.16.91.0.7.orig/configure.in 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure.in 2006-05-31 14:55:53.000000000 +0300
+@@ -497,7 +497,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
diff --git a/patches/binutils/2.17.50.0.8/300-001_ld_makefile_patch.patch b/patches/binutils/2.17.50.0.8/300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000..04a7e61
--- /dev/null
+++ b/patches/binutils/2.17.50.0.8/300-001_ld_makefile_patch.patch
@@ -0,0 +1,50 @@
+#!/bin/sh -e
+## 001_ld_makefile_patch.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: correct where ld scripts are installed
+## DP: Author: Chris Chimelis <chris@debian.org>
+## DP: Upstream status: N/A
+## DP: Date: ??
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+--- binutils-2.16.91.0.1/ld/Makefile.am
++++ binutils-2.16.91.0.1/ld/Makefile.am
+@@ -20,7 +20,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+--- binutils-2.16.91.0.1/ld/Makefile.in
++++ binutils-2.16.91.0.1/ld/Makefile.in
+@@ -268,7 +268,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
diff --git a/patches/binutils/2.17.50.0.8/300-012_check_ldrunpath_length.patch b/patches/binutils/2.17.50.0.8/300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000..498651a
--- /dev/null
+++ b/patches/binutils/2.17.50.0.8/300-012_check_ldrunpath_length.patch
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
+## DP: cases where -rpath isn't specified. (#151024)
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
+--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
++++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
+@@ -692,6 +692,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -871,6 +873,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
diff --git a/patches/binutils/2.17.50.0.9/100-uclibc-conf.patch b/patches/binutils/2.17.50.0.9/100-uclibc-conf.patch
new file mode 100644
index 0000000..25222e5
--- /dev/null
+++ b/patches/binutils/2.17.50.0.9/100-uclibc-conf.patch
@@ -0,0 +1,139 @@
+--- binutils-2.16.91.0.7/bfd/configure
++++ binutils-2.16.91.0.7/bfd/configure
+@@ -3576,7 +3576,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/binutils/configure
++++ binutils-2.16.91.0.7/binutils/configure
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/configure
++++ binutils-2.16.91.0.7/configure
+@@ -1270,7 +1270,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -1578,7 +1578,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[3456789]86-*-vsta) ;; # don't add gprof back in
+ i[3456789]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.16.91.0.7/configure.in
++++ binutils-2.16.91.0.7/configure.in
+@@ -468,7 +468,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -776,7 +776,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[[3456789]]86-*-vsta) ;; # don't add gprof back in
+ i[[3456789]]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.16.91.0.7/gas/configure
++++ binutils-2.16.91.0.7/gas/configure
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/gprof/configure
++++ binutils-2.16.91.0.7/gprof/configure
+@@ -3419,6 +3419,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- binutils-2.16.91.0.7/ld/configure
++++ binutils-2.16.91.0.7/ld/configure
+@@ -3413,7 +3413,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/libtool.m4
++++ binutils-2.16.91.0.7/libtool.m4
+@@ -739,7 +739,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- binutils-2.16.91.0.7/ltconfig
++++ binutils-2.16.91.0.7/ltconfig
+@@ -602,6 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1247,7 +1248,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--- binutils-2.16.91.0.7/opcodes/configure
++++ binutils-2.16.91.0.7/opcodes/configure
+@@ -3579,7 +3579,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
diff --git a/patches/binutils/2.17.50.0.9/110-arm-eabi-conf.patch b/patches/binutils/2.17.50.0.9/110-arm-eabi-conf.patch
new file mode 100644
index 0000000..be85ceb
--- /dev/null
+++ b/patches/binutils/2.17.50.0.9/110-arm-eabi-conf.patch
@@ -0,0 +1,24 @@
+diff -urN binutils-2.16.91.0.7.orig/configure binutils-2.16.91.0.7/configure
+--- binutils-2.16.91.0.7.orig/configure 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure 2006-05-31 14:55:53.000000000 +0300
+@@ -1299,7 +1299,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
+diff -urN binutils-2.16.91.0.7.orig/configure.in binutils-2.16.91.0.7/configure.in
+--- binutils-2.16.91.0.7.orig/configure.in 2006-05-31 14:54:24.000000000 +0300
++++ binutils-2.16.91.0.7/configure.in 2006-05-31 14:55:53.000000000 +0300
+@@ -497,7 +497,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
diff --git a/patches/binutils/2.17.50.0.9/300-001_ld_makefile_patch.patch b/patches/binutils/2.17.50.0.9/300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000..04a7e61
--- /dev/null
+++ b/patches/binutils/2.17.50.0.9/300-001_ld_makefile_patch.patch
@@ -0,0 +1,50 @@
+#!/bin/sh -e
+## 001_ld_makefile_patch.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: correct where ld scripts are installed
+## DP: Author: Chris Chimelis <chris@debian.org>
+## DP: Upstream status: N/A
+## DP: Date: ??
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+--- binutils-2.16.91.0.1/ld/Makefile.am
++++ binutils-2.16.91.0.1/ld/Makefile.am
+@@ -20,7 +20,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+--- binutils-2.16.91.0.1/ld/Makefile.in
++++ binutils-2.16.91.0.1/ld/Makefile.in
+@@ -268,7 +268,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
diff --git a/patches/binutils/2.17.50.0.9/300-012_check_ldrunpath_length.patch b/patches/binutils/2.17.50.0.9/300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000..498651a
--- /dev/null
+++ b/patches/binutils/2.17.50.0.9/300-012_check_ldrunpath_length.patch
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
+## DP: cases where -rpath isn't specified. (#151024)
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
+--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
++++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
+@@ -692,6 +692,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -871,6 +873,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
diff --git a/patches/cygwin/1.5.15-1/cygwin-1.5.15-1-crossbuild.patch b/patches/cygwin/1.5.15-1/cygwin-1.5.15-1-crossbuild.patch
new file mode 100644
index 0000000..d312403
--- /dev/null
+++ b/patches/cygwin/1.5.15-1/cygwin-1.5.15-1-crossbuild.patch
@@ -0,0 +1,40 @@
+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/gcc/2.95.3/arm-linux.patch b/patches/gcc/2.95.3/arm-linux.patch
new file mode 100644
index 0000000..00974f6
--- /dev/null
+++ b/patches/gcc/2.95.3/arm-linux.patch
@@ -0,0 +1,647 @@
+--------- snip -------
+Downloaded from ftp://ftp.linux.org.uk/pub/armlinux/toolchain/src-2.95.3/gcc-2.95.3.diff.bz2
+Not sure what it fixes, but this appears to be The Patch used with gcc-2.95.3 on arm.
+--------- snip -------
+
+diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.c gcc-2.95.3/gcc/config/arm/arm.c
+--- gcc-2.95.3-orig/gcc/config/arm/arm.c Thu Jan 25 15:03:24 2001
++++ gcc-2.95.3/gcc/config/arm/arm.c Fri Jul 20 19:39:11 2001
+@@ -1529,27 +1529,34 @@
+ return gen_rtx_PLUS (Pmode, base, offset);
+ }
+ else if (GET_CODE (orig) == LABEL_REF)
+- current_function_uses_pic_offset_table = 1;
+-
+- return orig;
+-}
++ {
++ current_function_uses_pic_offset_table = 1;
+
+-static rtx pic_rtx;
++ if (NEED_PLT_GOT)
++ {
++ rtx pic_ref, address = gen_reg_rtx (Pmode);
++
++ emit_insn (gen_pic_load_addr (address, orig));
++ pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
++ address);
++ emit_move_insn (address, pic_ref);
++ return address;
++ }
++ }
+
+-int
+-is_pic(x)
+- rtx x;
+-{
+- if (x == pic_rtx)
+- return 1;
+- return 0;
++ return orig;
+ }
+
++/* Generate code to load the PIC register. PROLOGUE is true if
++ called from arm_expand_prologue (in which case we want the
++ generated insns at the start of the function); false if called
++ by an exception receiver that needs the PIC register reloaded
++ (in which case the insns are just dumped at the current location). */
+ void
+-arm_finalize_pic ()
++arm_finalize_pic (int prologue)
+ {
+ #ifndef AOF_ASSEMBLER
+- rtx l1, pic_tmp, pic_tmp2, seq;
++ rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx;
+ rtx global_offset_table;
+
+ if (current_function_uses_pic_offset_table == 0)
+@@ -1578,7 +1585,10 @@
+
+ seq = gen_sequence ();
+ end_sequence ();
+- emit_insn_after (seq, get_insns ());
++ if (prologue)
++ emit_insn_after (seq, get_insns ());
++ else
++ emit_insn (seq);
+
+ /* Need to emit this whether or not we obey regdecls,
+ since setjmp/longjmp can cause life info to screw up. */
+@@ -5327,7 +5337,13 @@
+ if (frame_pointer_needed)
+ live_regs += 4;
+
+- if (live_regs)
++ if (live_regs == 1 && regs_ever_live[LR_REGNUM]
++ && ! lr_save_eliminated && ! really_return)
++ {
++ output_asm_insn (reverse ? "ldr%?%D0\t%|lr, [%|sp}, #4"
++ : "ldr%?%d0\t%|lr, [%|sp], #4", &operand);
++ }
++ else if (live_regs)
+ {
+ if (lr_save_eliminated || ! regs_ever_live[14])
+ live_regs++;
+@@ -5446,7 +5462,7 @@
+ rtx x;
+
+ length = strlen (name);
+- alignlength = (length + 1) + 3 & ~3;
++ alignlength = ((length + 1) + 3) & ~3;
+
+ ASM_OUTPUT_ASCII (stream, name, length + 1);
+ ASM_OUTPUT_ALIGN (stream, 2);
+@@ -5838,6 +5854,9 @@
+ int store_arg_regs = 0;
+ int volatile_func = (optimize > 0
+ && TREE_THIS_VOLATILE (current_function_decl));
++ rtx ip_rtx;
++ int fp_offset = 0;
++ rtx insn;
+
+ /* Naked functions don't have prologues. */
+ if (arm_naked_function_p (current_function_decl))
+@@ -5859,11 +5878,59 @@
+ live_regs_mask |= 0x4000;
+ }
+
++ ip_rtx = gen_rtx_REG (SImode, IP_REGNUM);
++
+ if (frame_pointer_needed)
+ {
++ if (current_function_needs_context)
++ {
++ /* The Static chain register is the same as the IP register
++ used as a scratch register during stack frame creation.
++ To get around this need to find somewhere to store IP
++ whilst the frame is being created. We try the following
++ places in order:
++
++ 1. An unused argument register.
++ 2. A slot on the stack above the frame. (This only
++ works if the function is not a varargs function).
++
++ If neither of these places is available, we abort (for now). */
++ if (regs_ever_live[3] == 0)
++ {
++ insn = gen_rtx_REG (SImode, 3);
++ insn = gen_rtx_SET (SImode, insn, ip_rtx);
++ insn = emit_insn (insn);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++ else if (current_function_pretend_args_size == 0)
++ {
++ insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx);
++ insn = gen_rtx_MEM (SImode, insn);
++ insn = gen_rtx_SET (VOIDmode, insn, ip_rtx);
++ insn = emit_insn (insn);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ fp_offset = 4;
++ }
++ else
++ /* FIXME - the way to handle this situation is to allow
++ the pretend args to be dumped onto the stack, then
++ reuse r3 to save IP. This would involve moving the
++ copying os SP into IP until after the pretend args
++ have been dumped, but this is not too hard. */
++ error ("Unable to find a temporary location for static chanin register");
++ }
++
+ live_regs_mask |= 0xD800;
+- emit_insn (gen_movsi (gen_rtx_REG (SImode, 12),
+- stack_pointer_rtx));
++ if (fp_offset)
++ {
++ insn = gen_rtx_PLUS (SImode, stack_pointer_rtx, GEN_INT (fp_offset));
++ insn = gen_rtx_SET (SImode, ip_rtx, insn);
++ }
++ else
++ insn = gen_movsi (ip_rtx, stack_pointer_rtx);
++
++ insn = emit_insn (insn);
++ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+
+ if (current_function_pretend_args_size)
+@@ -5927,9 +5994,31 @@
+ }
+
+ if (frame_pointer_needed)
+- emit_insn (gen_addsi3 (hard_frame_pointer_rtx, gen_rtx_REG (SImode, 12),
+- (GEN_INT
+- (-(4 + current_function_pretend_args_size)))));
++ {
++ insn = GEN_INT (-(4 + current_function_pretend_args_size + fp_offset));
++ insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn));
++ RTX_FRAME_RELATED_P (insn) = 1;
++
++ if (current_function_needs_context)
++ {
++ /* Recover the static chain register. */
++ if (regs_ever_live [3] == 0)
++ {
++ insn = gen_rtx_REG (SImode, 3);
++ insn = gen_rtx_SET (SImode, ip_rtx, insn);
++ insn = emit_insn (insn);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++ else /* if (current_function_pretend_args_size == 0) */
++ {
++ insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, GEN_INT (4));
++ insn = gen_rtx_MEM (SImode, insn);
++ insn = gen_rtx_SET (SImode, ip_rtx, insn);
++ insn = emit_insn (insn);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++ }
++ }
+
+ if (amount != const0_rtx)
+ {
+diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.h gcc-2.95.3/gcc/config/arm/arm.h
+--- gcc-2.95.3-orig/gcc/config/arm/arm.h Thu Jan 25 15:03:26 2001
++++ gcc-2.95.3/gcc/config/arm/arm.h Fri Jul 20 19:39:11 2001
+@@ -601,14 +601,20 @@
+ (TREE_CODE (EXP) == STRING_CST \
+ && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
+
++#ifndef STRUCTURE_SIZE_BOUNDARY
+ /* Every structures size must be a multiple of 32 bits. */
+ /* This is for compatibility with ARMCC. ARM SDT Reference Manual
+ (ARM DUI 0020D) page 2-20 says "Structures are aligned on word
+ boundaries". */
+-#ifndef STRUCTURE_SIZE_BOUNDARY
+-#define STRUCTURE_SIZE_BOUNDARY 32
++/* Setting this to 32 produces more efficient code, but the value set in previous
++ versions of this toolchain was 8, which produces more compact structures. The
++ command line option -mstructure_size_boundary=<n> can be used to change this
++ value. */
++#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
+ #endif
+
++extern int arm_structure_size_boundary;
++
+ /* Used when parsing command line option -mstructure_size_boundary. */
+ extern const char * structure_size_string;
+
+@@ -768,6 +774,9 @@
+ /* Specify the registers used for certain standard purposes.
+ The values of these macros are register numbers. */
+
++/* Register which holds return address from a subroutine call. */
++#define LR_REGNUM 14
++
+ /* Define this if the program counter is overloaded on a register. */
+ #define PC_REGNUM 15
+
+@@ -777,6 +786,9 @@
+ /* Base register for access to local variables of the function. */
+ #define FRAME_POINTER_REGNUM 25
+
++/* Scratch register - used in all kinds of places, eg trampolines. */
++#define IP_REGNUM 12
++
+ /* Define this to be where the real frame pointer is if it is not possible to
+ work out the offset between the frame pointer and the automatic variables
+ until after register allocation has taken place. FRAME_POINTER_REGNUM
+@@ -798,7 +810,7 @@
+ /* The native (Norcroft) Pascal compiler for the ARM passes the static chain
+ as an invisible last argument (possible since varargs don't exist in
+ Pascal), so the following is not true. */
+-#define STATIC_CHAIN_REGNUM 8
++#define STATIC_CHAIN_REGNUM 12
+
+ /* Register in which address to store a structure value
+ is passed to a function. */
+@@ -1248,7 +1260,12 @@
+ { \
+ int volatile_func = arm_volatile_func (); \
+ if ((FROM) == ARG_POINTER_REGNUM && (TO) == HARD_FRAME_POINTER_REGNUM)\
+- (OFFSET) = 0; \
++ { \
++ if (! current_function_needs_context || ! frame_pointer_needed) \
++ (OFFSET) = 0; \
++ else \
++ (OFFSET) = 4; \
++ } \
+ else if ((FROM) == FRAME_POINTER_REGNUM \
+ && (TO) == STACK_POINTER_REGNUM) \
+ (OFFSET) = (current_function_outgoing_args_size \
+@@ -1379,8 +1396,10 @@
+
+ On the ARM, allow any integer (invalid ones are removed later by insn
+ patterns), nice doubles and symbol_refs which refer to the function's
+- constant pool XXX. */
+-#define LEGITIMATE_CONSTANT_P(X) (! label_mentioned_p (X))
++ constant pool XXX.
++
++ When generating PIC code, allow anything. */
++#define LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X))
+
+ /* Symbols in the text segment can be accessed without indirecting via the
+ constant pool; it may take an extra binary operation, but this is still
+@@ -1496,9 +1515,8 @@
+ && INTVAL (op) <= 31) \
+ goto LABEL; \
+ } \
+- /* NASTY: Since this limits the addressing of unsigned byte loads */ \
+ range = ((MODE) == HImode || (MODE) == QImode) \
+- ? (arm_arch4 ? 256 : 4095) : 4096; \
++ ? (((MODE) == HImode && arm_arch4) ? 256 : 4095) : 4096; \
+ if (code == CONST_INT && INTVAL (INDEX) < range \
+ && INTVAL (INDEX) > -range) \
+ goto LABEL; \
+@@ -1812,14 +1830,15 @@
+ data addresses in memory. */
+ #define PIC_OFFSET_TABLE_REGNUM arm_pic_register
+
+-#define FINALIZE_PIC arm_finalize_pic ()
++#define FINALIZE_PIC arm_finalize_pic (1)
+
+-/* We can't directly access anything that contains a symbol,
++/* We can't directly access anything that contains a symbol or label,
+ nor can we indirect via the constant pool. */
+ #define LEGITIMATE_PIC_OPERAND_P(X) \
+- (! symbol_mentioned_p (X) \
++ (! symbol_mentioned_p (X) && ! label_mentioned_p (X) \
+ && (! CONSTANT_POOL_ADDRESS_P (X) \
+- || ! symbol_mentioned_p (get_pool_constant (X))))
++ || (! symbol_mentioned_p (get_pool_constant (X))) \
++ && (! label_mentioned_p (get_pool_constant (X)))))
+
+ /* We need to know when we are making a constant pool; this determines
+ whether data needs to be in the GOT or can be referenced via a GOT
+@@ -2046,17 +2065,9 @@
+ else output_addr_const(STREAM, X); \
+ }
+
+-/* Handles PIC addr specially */
+ #define OUTPUT_INT_ADDR_CONST(STREAM,X) \
+ { \
+- if (flag_pic && GET_CODE(X) == CONST && is_pic(X)) \
+- { \
+- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 0), 0)); \
+- fputs(" - (", STREAM); \
+- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 1), 0)); \
+- fputs(")", STREAM); \
+- } \
+- else output_addr_const(STREAM, X); \
++ output_addr_const(STREAM, X); \
+ \
+ /* Mark symbols as position independent. We only do this in the \
+ .text segment, not in the .data segment. */ \
+@@ -2170,8 +2181,7 @@
+ int arm_return_in_memory PROTO ((Tree));
+ int legitimate_pic_operand_p PROTO ((Rtx));
+ Rtx legitimize_pic_address PROTO ((Rtx, Mmode, Rtx));
+-int is_pic PROTO ((Rtx));
+-void arm_finalize_pic PROTO ((void));
++void arm_finalize_pic PROTO ((int));
+ int arm_rtx_costs RTX_CODE_PROTO ((Rtx, Rcode));
+ int arm_adjust_cost PROTO ((Rtx, Rtx, Rtx, int));
+ int const_double_rtx_ok_for_fpu PROTO ((Rtx));
+diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.md gcc-2.95.3/gcc/config/arm/arm.md
+--- gcc-2.95.3-orig/gcc/config/arm/arm.md Thu Jan 25 15:03:27 2001
++++ gcc-2.95.3/gcc/config/arm/arm.md Fri Jul 20 19:39:11 2001
+@@ -2629,7 +2629,8 @@
+ : preserve_subexpressions_p ()));
+ DONE;
+ }
+- if (CONSTANT_P (operands[1]) && flag_pic)
++ if ((CONSTANT_P (operands[1]) || symbol_mentioned_p (operands[1])
++ || label_mentioned_p (operands[1])) && flag_pic)
+ operands[1] = legitimize_pic_address (operands[1], SImode,
+ ((reload_in_progress
+ || reload_completed)
+@@ -2721,6 +2722,15 @@
+ return \"add%?\\t%0, %|pc, %0\";
+ ")
+
++(define_expand "builtin_setjmp_receiver"
++ [(label_ref (match_operand 0 "" ""))]
++ "flag_pic"
++ "
++{
++ arm_finalize_pic (0);
++ DONE;
++}")
++
+ ;; If copying one reg to another we can set the condition codes according to
+ ;; its value. Such a move is common after a return from subroutine and the
+ ;; result is being tested against zero.
+@@ -6184,15 +6194,20 @@
+ abort ();
+ return \"\";
+ }
+- strcpy (pattern, \"stmfd\\t%m0!, {%1\");
+- for (i = 1; i < XVECLEN (operands[2], 0); i++)
++ if (XVECLEN (operands[2], 0) > 1)
+ {
+- strcat (pattern, \", %|\");
+- strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i),
++ strcpy (pattern, \"stmfd\\t%m0!, {%1\");
++ for (i = 1; i < XVECLEN (operands[2], 0); i++)
++ {
++ strcat (pattern, \", %|\");
++ strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i),
+ 0))]);
++ }
++ strcat (pattern, \"}\");
++ output_asm_insn (pattern, operands);
+ }
+- strcat (pattern, \"}\");
+- output_asm_insn (pattern, operands);
++ else
++ output_asm_insn (\"str\\t%1, [%m0, #-4]!\", operands);
+ return \"\";
+ }"
+ [(set_attr "type" "store4")])
+diff -urN gcc-2.95.3-orig/gcc/config/arm/elf.h gcc-2.95.3/gcc/config/arm/elf.h
+--- gcc-2.95.3-orig/gcc/config/arm/elf.h Mon May 31 10:21:53 1999
++++ gcc-2.95.3/gcc/config/arm/elf.h Fri Jul 20 19:39:11 2001
+@@ -167,15 +167,6 @@
+ #define MULTILIB_DEFAULTS { "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
+ #endif
+
+-/* Setting this to 32 produces more efficient code, but the value set in previous
+- versions of this toolchain was 8, which produces more compact structures. The
+- command line option -mstructure_size_boundary=<n> can be used to change this
+- value. */
+-#undef STRUCTURE_SIZE_BOUNDARY
+-#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
+-
+-extern int arm_structure_size_boundary;
+-
+ /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
+ is a valid machine specific attribute for DECL.
+ The attributes in ATTRIBUTES have previously been assigned to DECL. */
+diff -urN gcc-2.95.3-orig/gcc/config/arm/linux-gas.h gcc-2.95.3/gcc/config/arm/linux-gas.h
+--- gcc-2.95.3-orig/gcc/config/arm/linux-gas.h Mon Feb 22 17:47:57 1999
++++ gcc-2.95.3/gcc/config/arm/linux-gas.h Fri Jul 20 19:39:11 2001
+@@ -1,6 +1,6 @@
+ /* Definitions of target machine for GNU compiler.
+ ARM Linux-based GNU systems version.
+- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
++ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Russell King <rmk92@ecs.soton.ac.uk>.
+
+ This file is part of GNU CC.
+@@ -79,5 +79,7 @@
+ register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
+ register unsigned long _end __asm ("a2") = (unsigned long) (END); \
+ register unsigned long _flg __asm ("a3") = 0; \
+- __asm __volatile ("swi 0x9f0002"); \
++ __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \
++ : "=r" (_beg) \
++ : "0" (_beg), "r" (_end), "r" (_flg)); \
+ }
+diff -urN gcc-2.95.3-orig/gcc/config/arm/t-linux gcc-2.95.3/gcc/config/arm/t-linux
+--- gcc-2.95.3-orig/gcc/config/arm/t-linux Fri Mar 26 16:30:20 1999
++++ gcc-2.95.3/gcc/config/arm/t-linux Fri Jul 20 20:46:19 2001
+@@ -1,6 +1,6 @@
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference. It is then pointless adding debugging.
+-TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
++TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ # Don't build enquire
+diff -urN gcc-2.95.3-orig/gcc/final.c gcc-2.95.3/gcc/final.c
+--- gcc-2.95.3-orig/gcc/final.c Mon Mar 12 13:07:59 2001
++++ gcc-2.95.3/gcc/final.c Fri Jul 20 19:39:11 2001
+@@ -3652,8 +3652,9 @@
+
+ output_addr_const (file, XEXP (x, 0));
+ fprintf (file, "-");
+- if (GET_CODE (XEXP (x, 1)) == CONST_INT
+- && INTVAL (XEXP (x, 1)) < 0)
++ if ((GET_CODE (XEXP (x, 1)) == CONST_INT
++ && INTVAL (XEXP (x, 1)) < 0)
++ || GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ fprintf (file, ASM_OPEN_PAREN);
+ output_addr_const (file, XEXP (x, 1));
+diff -urN gcc-2.95.3-orig/gcc/function.c gcc-2.95.3/gcc/function.c
+--- gcc-2.95.3-orig/gcc/function.c Thu Jan 25 15:03:15 2001
++++ gcc-2.95.3/gcc/function.c Fri Jul 20 19:39:10 2001
+@@ -3053,6 +3053,105 @@
+ extracted by usage MEM with narrower mode. */
+ static rtx purge_addressof_replacements;
+
++/* Return 1 if X and Y are identical-looking rtx's.
++ This is the Lisp function EQUAL for rtx arguments. */
++
++int
++rtx_equal_for_addressof_p (x, y)
++ rtx x, y;
++{
++ register int i;
++ register int j;
++ register enum rtx_code code;
++ register char *fmt;
++
++ if (x == y)
++ return 1;
++ if (x == 0 || y == 0)
++ return 0;
++
++ code = GET_CODE (x);
++ /* Rtx's of different codes cannot be equal. */
++ if (code != GET_CODE (y))
++ return 0;
++
++ /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent.
++ (REG:SI x) and (REG:HI x) are NOT equivalent.
++ But (MEM:SI x) and (MEM:HI x) are equivalent for our purposes. */
++
++ if (code != MEM && (GET_MODE (x) != GET_MODE (y)))
++ return 0;
++
++ /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */
++
++ if (code == REG)
++ return REGNO (x) == REGNO (y);
++ else if (code == LABEL_REF)
++ return XEXP (x, 0) == XEXP (y, 0);
++ else if (code == SYMBOL_REF)
++ return XSTR (x, 0) == XSTR (y, 0);
++ else if (code == SCRATCH || code == CONST_DOUBLE)
++ return 0;
++
++ /* Compare the elements. If any pair of corresponding elements
++ fail to match, return 0 for the whole things. */
++
++ fmt = GET_RTX_FORMAT (code);
++ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
++ {
++ switch (fmt[i])
++ {
++ case 'w':
++ if (XWINT (x, i) != XWINT (y, i))
++ return 0;
++ break;
++
++ case 'n':
++ case 'i':
++ if (XINT (x, i) != XINT (y, i))
++ return 0;
++ break;
++
++ case 'V':
++ case 'E':
++ /* Two vectors must have the same length. */
++ if (XVECLEN (x, i) != XVECLEN (y, i))
++ return 0;
++
++ /* And the corresponding elements must match. */
++ for (j = 0; j < XVECLEN (x, i); j++)
++ if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0)
++ return 0;
++ break;
++
++ case 'e':
++ if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0)
++ return 0;
++ break;
++
++ case 'S':
++ case 's':
++ if (strcmp (XSTR (x, i), XSTR (y, i)))
++ return 0;
++ break;
++
++ case 'u':
++ /* These are just backpointers, so they don't matter. */
++ break;
++
++ case '0':
++ break;
++
++ /* It is believed that rtx's at this level will never
++ contain anything but integers and other rtx's,
++ except for within LABEL_REFs and SYMBOL_REFs. */
++ default:
++ abort ();
++ }
++ }
++ return 1;
++}
++
+ /* Helper function for purge_addressof. See if the rtx expression at *LOC
+ in INSN needs to be changed. If FORCE, always put any ADDRESSOFs into
+ the stack. */
+@@ -3133,7 +3232,7 @@
+ for (tem = purge_bitfield_addressof_replacements;
+ tem != NULL_RTX;
+ tem = XEXP (XEXP (tem, 1), 1))
+- if (rtx_equal_p (x, XEXP (tem, 0)))
++ if (rtx_equal_for_addressof_p (x, XEXP (tem, 0)))
+ {
+ *loc = XEXP (XEXP (tem, 1), 0);
+ return;
+@@ -3143,7 +3242,7 @@
+ for (tem = purge_addressof_replacements;
+ tem != NULL_RTX;
+ tem = XEXP (XEXP (tem, 1), 1))
+- if (rtx_equal_p (XEXP (x, 0), XEXP (tem, 0)))
++ if (rtx_equal_for_addressof_p (XEXP (x, 0), XEXP (tem, 0)))
+ {
+ rtx z = XEXP (XEXP (tem, 1), 0);
+
+diff -urN gcc-2.95.3-orig/gcc/jump.c gcc-2.95.3/gcc/jump.c
+--- gcc-2.95.3-orig/gcc/jump.c Thu Oct 21 08:24:03 1999
++++ gcc-2.95.3/gcc/jump.c Fri Jul 20 19:39:10 2001
+@@ -115,7 +115,7 @@
+ static rtx delete_unreferenced_labels PROTO((rtx));
+ static void delete_noop_moves PROTO((rtx));
+ static int calculate_can_reach_end PROTO((rtx, int, int));
+-static int duplicate_loop_exit_test PROTO((rtx));
++static int duplicate_loop_exit_test PROTO((rtx, int));
+ static void find_cross_jump PROTO((rtx, rtx, int, rtx *, rtx *));
+ static void do_cross_jump PROTO((rtx, rtx, rtx));
+ static int jump_back_p PROTO((rtx, rtx));
+@@ -338,7 +338,7 @@
+ && simplejump_p (temp1))
+ {
+ temp = PREV_INSN (insn);
+- if (duplicate_loop_exit_test (insn))
++ if (duplicate_loop_exit_test (insn, after_regscan))
+ {
+ changed = 1;
+ next = NEXT_INSN (temp);
+@@ -2548,8 +2548,9 @@
+ values of regno_first_uid and regno_last_uid. */
+
+ static int
+-duplicate_loop_exit_test (loop_start)
++duplicate_loop_exit_test (loop_start, after_regscan)
+ rtx loop_start;
++ int after_regscan;
+ {
+ rtx insn, set, reg, p, link;
+ rtx copy = 0, first_copy = 0;
+@@ -2662,6 +2663,9 @@
+ reg_map[REGNO (reg)] = gen_reg_rtx (GET_MODE (reg));
+ }
+ }
++
++ if (after_regscan)
++ reg_scan_update (exitcode, lastexit, max_reg);
+
+ /* Now copy each insn. */
+ for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn))
+diff -urN gcc-2.95.3-orig/gcc/varasm.c gcc-2.95.3/gcc/varasm.c
+--- gcc-2.95.3-orig/gcc/varasm.c Mon Feb 19 15:02:02 2001
++++ gcc-2.95.3/gcc/varasm.c Fri Jul 20 19:39:11 2001
+@@ -3286,7 +3286,10 @@
+ value->un.addr.offset = - INTVAL (XEXP (x, 1));
+ }
+ else
+- abort ();
++ {
++ value->un.addr.base = x;
++ value->un.addr.offset = 0;
++ }
+ break;
+
+ default:
diff --git a/patches/gcc/2.95.3/backport-config.gcc-1.4.patch b/patches/gcc/2.95.3/backport-config.gcc-1.4.patch
new file mode 100644
index 0000000..141de0c
--- /dev/null
+++ b/patches/gcc/2.95.3/backport-config.gcc-1.4.patch
@@ -0,0 +1,35 @@
+# Taken from http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?r1=1.3&r2=1.4
+# Should fix error
+# Configuration powerpc-host_apple-darwin7.3.0 not supported
+# when configuring gcc-2.95 on Mac OS X for i686 target
+# Also create xm-darwin.h, seems to be required, else we get the error
+# In file included from .../gcc-2.95.3/gcc/gencheck.c:21:
+# hconfig.h:11:30: rs6000/xm-darwin.h: No such file or directory
+# make[1]: *** [gencheck.o] Error 1
+
+
+--- gcc-2.95.3/gcc/configure.old 2004-03-24 12:17:44.000000000 -0800
++++ gcc-2.95.3/gcc/configure 2004-03-24 17:14:38.000000000 -0800
+@@ -5079,6 +5079,10 @@
+ tmake_file=rs6000/t-beos
+ xmake_file=rs6000/x-beos
+ ;;
++ powerpc-*-darwin*)
++ xm_file="rs6000/xm-rs6000.h rs6000/xm-darwin.h"
++ xmake_file=rs6000/x-darwin
++ ;;
+ powerpc-*-sysv* | powerpc-*-elf*)
+ tm_file=rs6000/sysv4.h
+ xm_file="xm-siglist.h rs6000/xm-sysv4.h"
+--- /dev/null 2003-01-30 02:24:37.000000000 -0800
++++ gcc-3.0.4/gcc/config/rs6000/xm-darwin.h 2000-11-20 19:02:09.000000000 -0800
+@@ -0,0 +1,9 @@
++/* Undo the USG definition in xm-rs6000.h, Darwin is a BSD flavor. */
++
++#undef USG
++
++/* Override the usual setting, since Apple's GCC has lame bugs and
++ can't handle the initializers. Someday the bugs will be fixed and
++ we can get rid of this silliness. */
++
++#define HAVE_DESIGNATED_INITIALIZERS 0
diff --git a/patches/gcc/2.95.3/backport-config.gcc-1.92.patch b/patches/gcc/2.95.3/backport-config.gcc-1.92.patch
new file mode 100644
index 0000000..fc55681
--- /dev/null
+++ b/patches/gcc/2.95.3/backport-config.gcc-1.92.patch
@@ -0,0 +1,39 @@
+# Taken from http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?r1=1.91&r2=1.92
+# Should fix error
+# Configuration x86_64-host_unknown-linux-gnu not supported
+# when configuring gcc-2.95 on x86_64 build for i686 target
+# It's a bit silly, since tm_file refers to files that don't exist,
+# but as long as x86_64 is just the build machine, that doesn't matter.
+
+--- gcc-2.95.3/gcc/configure.old 2004-03-24 12:17:44.000000000 -0800
++++ gcc-2.95.3/gcc/configure 2004-03-24 12:19:30.000000000 -0800
+@@ -2929,6 +2929,9 @@
+ i[34567]86-*-*)
+ cpu_type=i386
+ ;;
++ x86_64-*-*)
++ cpu_type=i386
++ ;;
+ hppa*-*-*)
+ cpu_type=pa
+ ;;
+@@ -3643,6 +3646,19 @@
+ thread_file='posix'
+ fi
+ ;;
++ x86_64-*-linux*)
++ xmake_file=x-linux
++ tm_file="i386/biarch64.h i386/i386.h i386/att.h linux.h i386/x86-64.h \
++ i386/linux64.h"
++ tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ float_format=i386
++ if test x$enable_threads = xyes; then
++ thread_file='posix'
++ fi
++ ;;
++
+ i[34567]86-*-gnu*)
+ float_format=i386
+ ;;
diff --git a/patches/gcc/2.95.3/config.sub.patch b/patches/gcc/2.95.3/config.sub.patch
new file mode 100644
index 0000000..c8189b5
--- /dev/null
+++ b/patches/gcc/2.95.3/config.sub.patch
@@ -0,0 +1,1257 @@
+# Backport from gcc-3.3.3
+# Fixes errors like
+# Invalid configuration `x86_64-host_unknown-linux-gnu': machine `x86_64-host_unknown' not recognized
+# Unrecognized host system name x86_64-host_unknown-linux-gnu.
+# when configuring on chip types or operating systems like x86_64 or Darwin
+# which are newer than gcc-2.95
+
+--- gcc-2.95.3/config.sub.old 1999-08-04 01:09:26.000000000 -0700
++++ gcc-2.95.3/config.sub 2004-03-24 11:28:24.000000000 -0800
+@@ -1,6 +1,10 @@
+ #! /bin/sh
+-# Configuration validation subroutine script, version 1.1.
+-# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
++# Configuration validation subroutine script.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++
++timestamp='2003-01-28'
++
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+ # can handle that machine. It does not imply ALL GNU software can.
+@@ -25,6 +29,9 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
++#
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+ # If it is invalid, we print an error message on stderr and exit with code 1.
+@@ -45,30 +52,73 @@
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
+-if [ x$1 = x ]
+-then
+- echo Configuration name missing. 1>&2
+- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+- echo "or $0 ALIAS" 1>&2
+- echo where ALIAS is a recognized configuration type. 1>&2
+- exit 1
+-fi
++me=`echo "$0" | sed -e 's,.*/,,'`
+
+-# First pass through any local machine types.
+-case $1 in
+- *local*)
+- echo $1
+- exit 0
+- ;;
+- *)
+- ;;
++usage="\
++Usage: $0 [OPTION] CPU-MFR-OPSYS
++ $0 [OPTION] ALIAS
++
++Canonicalize a configuration name.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.sub ($timestamp)
++
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
++Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit 0 ;;
++ --version | -v )
++ echo "$version" ; exit 0 ;;
++ --help | --h* | -h )
++ echo "$usage"; exit 0 ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help"
++ exit 1 ;;
++
++ *local*)
++ # First pass through any local machine types.
++ echo $1
++ exit 0;;
++
++ * )
++ break ;;
++ esac
++done
++
++case $# in
++ 0) echo "$me: missing argument$help" >&2
++ exit 1;;
++ 1) ;;
++ *) echo "$me: too many arguments$help" >&2
++ exit 1;;
+ esac
+
+ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- linux-gnu*)
++ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -94,20 +144,28 @@
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple)
++ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+- -sim | -cisco | -oki | -wec | -winbond ) # EGCS LOCAL
++ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+- -scout) # EGCS LOCAL
++ -scout)
+ ;;
+- -wrs) # EGCS LOCAL
++ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
++ -chorusos*)
++ os=-chorusos
++ basic_machine=$1
++ ;;
++ -chorusrdb)
++ os=-chorusrdb
++ basic_machine=$1
++ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+@@ -156,49 +214,72 @@
+ -psos*)
+ os=-psos
+ ;;
++ -mint | -mint[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
++ ;;
+ esac
+
+ # Decode aliases for certain CPU-COMPANY combinations.
+ case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+- | arme[lb] | pyramid | mn10200 | mn10300 \
+- | tron | a29k | 580 | i960 | h8300 \
+- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
+- | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
+- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
+- | 1750a | dsp16xx | pdp11 \
+- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
+- | mipstx39 | mipstx39el \
+- | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x)
+- basic_machine=$basic_machine-unknown
+- ;;
+- m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
+- | h8500 | w65) # EGCS LOCAL
+- ;;
+- thumb)
+- basic_machine=$basic_machine-unknown
+- ;;
+- mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300
++ 1750a | 580 \
++ | a29k \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++ | clipper \
++ | d10v | d30v | dlx | dsp16xx \
++ | fr30 | frv \
++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | i370 | i860 | i960 | ia64 \
++ | ip2k \
++ | m32r | m68000 | m68k | m88k | mcore \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64el \
++ | mips64vr | mips64vrel \
++ | mips64orion | mips64orionel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipstx39 | mipstx39el \
++ | mn10200 | mn10300 \
++ | msp430 \
++ | ns16k | ns32k \
++ | openrisc | or32 \
++ | pdp10 | pdp11 | pj | pjl \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | pyramid \
++ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
++ | sh64 | sh64le \
++ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
++ | strongarm \
++ | tahoe | thumb | tic80 | tron \
++ | v850 | v850e \
++ | we32k \
++ | x86 | xscale | xstormy16 | xtensa \
++ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+- mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100
+- basic_machine=$basic_machine-unknown
+- ;;
+- mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000
+- basic_machine=$basic_machine-unknown
+- ;;
+- mips16)
++ m6811 | m68hc11 | m6812 | m68hc12)
++ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
++ os=-none
+ ;;
+- d10v)
+- basic_machine=$basic_machine-unknown
++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
++
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+- i[34567]86)
++ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+@@ -207,44 +288,62 @@
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+- | xmp-* | ymp-* \
+- | hppa-* | hppa1.0-* | hppa1.1-* \
+- | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
+- | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
+- | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
+- | xps100-* | clipper-* | orion-* \
+- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+- | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \
+- | mips64el-* | mips64orion-* | mips64orionel-* \
+- | mipstx39-* | mipstx39el-* \
+- | f301-* | arm*-*)
+- ;;
+- m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL
+- ;;
+- thumb-*) # EGCS LOCAL angela/thumb
+- ;;
+- v850-*) # EGCS LOCAL
+- ;;
+- d30v-*) # EGCS LOCAL
+- ;;
+- mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300
+- ;;
+- mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100
+- ;;
+- mips16-*) # EGCS LOCAL krk/mips16
+- ;;
+- tic30-*) # EGCS LOCAL ian/tic30
+- ;;
+- c30-*) # EGCS LOCAL ian/tic30
+- basic_machine=tic30-unknown
++ 580-* \
++ | a29k-* \
++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
++ | avr-* \
++ | bs2000-* \
++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
++ | clipper-* | cydra-* \
++ | d10v-* | d30v-* | dlx-* \
++ | elxsi-* \
++ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
++ | h8300-* | h8500-* \
++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++ | i*86-* | i860-* | i960-* | ia64-* \
++ | ip2k-* \
++ | m32r-* \
++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
++ | m88110-* | m88k-* | mcore-* \
++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
++ | mips16-* \
++ | mips64-* | mips64el-* \
++ | mips64vr-* | mips64vrel-* \
++ | mips64orion-* | mips64orionel-* \
++ | mips64vr4100-* | mips64vr4100el-* \
++ | mips64vr4300-* | mips64vr4300el-* \
++ | mips64vr5000-* | mips64vr5000el-* \
++ | mipsisa32-* | mipsisa32el-* \
++ | mipsisa32r2-* | mipsisa32r2el-* \
++ | mipsisa64-* | mipsisa64el-* \
++ | mipsisa64sb1-* | mipsisa64sb1el-* \
++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
++ | mipstx39-* | mipstx39el-* \
++ | msp430-* \
++ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
++ | orion-* \
++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++ | pyramid-* \
++ | romp-* | rs6000-* \
++ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
++ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
++ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
++ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
++ | v850-* | v850e-* | vax-* \
++ | we32k-* \
++ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
++ | xtensa-* \
++ | ymp-* \
++ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+- 386bsd) # EGCS LOCAL
++ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+@@ -254,11 +353,11 @@
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+- a29khif) # EGCS LOCAL
++ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+- adobe68k) # EGCS LOCAL
++ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+@@ -277,21 +376,21 @@
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+- apollo68bsd) # EGCS LOCAL
++ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+@@ -303,6 +402,10 @@
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
++ c90)
++ basic_machine=c90-cray
++ os=-unicos
++ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+@@ -323,27 +426,30 @@
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+- cray | ymp)
+- basic_machine=ymp-cray
+- os=-unicos
+- ;;
+- cray2)
+- basic_machine=cray2-cray
+- os=-unicos
+- ;;
+- [ctj]90-cray)
+- basic_machine=c90-cray
++ cray | j90)
++ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
++ cris | cris-* | etrax*)
++ basic_machine=cris-axis
++ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
++ decsystem10* | dec10*)
++ basic_machine=pdp10-dec
++ os=-tops10
++ ;;
++ decsystem20* | dec20*)
++ basic_machine=pdp10-dec
++ os=-tops20
++ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+@@ -371,7 +477,7 @@
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+- es1800 | OSE68k | ose68k | ose | OSE) # EGCS LOCAL
++ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+@@ -385,6 +491,10 @@
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
++ go32)
++ basic_machine=i386-pc
++ os=-go32
++ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+@@ -393,11 +503,11 @@
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+- h8300xray) # EGCS LOCAL
++ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+- h8500hms) # EGCS LOCAL
++ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+@@ -416,22 +526,6 @@
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+- w89k-*) # EGCS LOCAL
+- basic_machine=hppa1.1-winbond
+- os=-proelf
+- ;;
+- op50n-*) # EGCS LOCAL
+- basic_machine=hppa1.1-oki
+- os=-proelf
+- ;;
+- op60c-*) # EGCS LOCAL
+- basic_machine=hppa1.1-oki
+- os=-proelf
+- ;;
+- hppro) # EGCS LOCAL
+- basic_machine=hppa1.1-hp
+- os=-proelf
+- ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+@@ -441,22 +535,21 @@
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+- hp9k6[0-9][0-9] | hp6[0-9][0-9] )
++ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+- hp9k7[0-79][0-9] | hp7[0-79][0-9] )
++ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+- hp9k78[0-9] | hp78[0-9] )
++ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
+- hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+- hp9k8[0-9][13679] | hp8[0-9][13679] )
++ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+@@ -465,47 +558,42 @@
+ hppa-next)
+ os=-nextstep3
+ ;;
+- hppaosf) # EGCS LOCAL
++ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
++ hppro)
++ basic_machine=hppa1.1-hp
++ os=-proelf
++ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+- os=-mvs
+ ;;
+ # I'm not sure what "Sysv32" means. Should this be sysv3.2?
+- i[34567]86v32)
++ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+- i[34567]86v4*)
++ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+- i[34567]86v)
++ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+- i[34567]86sol2)
++ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+- i386mach) # EGCS LOCAL
++ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+- i386-vsta | vsta) # EGCS LOCAL
++ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+- i386-go32 | go32) # EGCS LOCAL
+- basic_machine=i386-unknown
+- os=-go32
+- ;;
+- i386-mingw32 | mingw32)
+- basic_machine=i386-unknown
+- os=-mingw32
+- ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+@@ -531,16 +619,16 @@
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
++ mingw32)
++ basic_machine=i386-pc
++ os=-mingw32
++ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+- mipsel*-linux*)
+- basic_machine=mipsel-unknown
+- os=-linux-gnu
+- ;;
+- mips*-linux*)
+- basic_machine=mips-unknown
+- os=-linux-gnu
++ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+@@ -548,24 +636,36 @@
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+- monitor) # EGCS LOCAL
++ mmix*)
++ basic_machine=mmix-knuth
++ os=-mmixware
++ ;;
++ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+- msdos) # EGCS LOCAL
+- basic_machine=i386-unknown
++ morphos)
++ basic_machine=powerpc-unknown
++ os=-morphos
++ ;;
++ msdos)
++ basic_machine=i386-pc
+ os=-msdos
+ ;;
++ mvs)
++ basic_machine=i370-ibm
++ os=-mvs
++ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+- basic_machine=i386-unknown # EGCS LOCAL
++ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+- basic_machine=armv4l-corel
++ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+@@ -580,7 +680,7 @@
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+- necv70) # EGCS LOCAL
++ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+@@ -609,18 +709,37 @@
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+- mon960) # EGCS LOCAL
++ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
++ nonstopux)
++ basic_machine=mips-compaq
++ os=-nonstopux
++ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+- OSE68000 | ose68000) # EGCS LOCAL
++ nv1)
++ basic_machine=nv1-cray
++ os=-unicosmp
++ ;;
++ nsr-tandem)
++ basic_machine=nsr-tandem
++ ;;
++ op50n-* | op60c-*)
++ basic_machine=hppa1.1-oki
++ os=-proelf
++ ;;
++ or32 | or32-*)
++ basic_machine=or32-unknown
++ os=-coff
++ ;;
++ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+- os68k) # EGCS LOCAL
++ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+@@ -638,46 +757,60 @@
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+- pc532 | pc532-*)
++ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+- pentium | p5 | k5 | k6 | nexen)
++ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+- pentiumpro | p6 | 6x86)
++ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2)
+- basic_machine=i786-pc
++ basic_machine=i686-pc
+ ;;
+- pentium-* | p5-* | k5-* | k6-* | nexen-*)
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+- pentiumpro-* | p6-* | 6x86-*)
++ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-*)
+- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+- power) basic_machine=rs6000-ibm
++ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+- ;;
++ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+- ;;
++ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
++ ppc64) basic_machine=powerpc64-unknown
++ ;;
++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
++ basic_machine=powerpc64le-unknown
++ ;;
++ ppc64le-* | powerpc64little-*)
++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+- rom68k) # EGCS LOCAL
++ pw32)
++ basic_machine=i586-unknown
++ os=-pw32
++ ;;
++ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+@@ -687,10 +820,22 @@
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+- sa29200) # EGCS LOCAL
++ s390 | s390-*)
++ basic_machine=s390-ibm
++ ;;
++ s390x | s390x-*)
++ basic_machine=s390x-ibm
++ ;;
++ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
++ sb1)
++ basic_machine=mipsisa64sb1-unknown
++ ;;
++ sb1el)
++ basic_machine=mipsisa64sb1el-unknown
++ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+@@ -698,7 +843,7 @@
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+- sparclite-wrs) # EGCS LOCAL
++ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+@@ -709,10 +854,10 @@
+ spur)
+ basic_machine=spur-unknown
+ ;;
+- st2000) # EGCS LOCAL
++ st2000)
+ basic_machine=m68k-tandem
+ ;;
+- stratus) # EGCS LOCAL
++ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+@@ -756,16 +901,40 @@
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
++ sv1)
++ basic_machine=sv1-cray
++ os=-unicos
++ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
++ t3e)
++ basic_machine=alphaev5-cray
++ os=-unicos
++ ;;
++ t90)
++ basic_machine=t90-cray
++ os=-unicos
++ ;;
++ tic4x | c4x*)
++ basic_machine=tic4x-unknown
++ os=-coff
++ ;;
++ tic54x | c54x*)
++ basic_machine=tic54x-unknown
++ os=-coff
++ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ os=-tops20
++ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+@@ -777,7 +946,7 @@
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+- v810 | necv810) # EGCS LOCAL
++ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+@@ -790,8 +959,8 @@
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
+- ;;
++ basic_machine=f301-fujitsu
++ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+@@ -804,18 +973,22 @@
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+- w65*) # EGCS LOCAL
+- basic_machine=w65-wdc
+- os=-none
++ w65*)
++ basic_machine=w65-wdc
++ os=-none
+ ;;
+- xmp)
+- basic_machine=xmp-cray
+- os=-unicos
++ w89k-*)
++ basic_machine=hppa1.1-winbond
++ os=-proelf
+ ;;
+- xps | xps100)
++ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+- z8k-*-coff) # EGCS LOCAL
++ ymp)
++ basic_machine=ymp-cray
++ os=-unicos
++ ;;
++ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+@@ -826,22 +999,15 @@
+
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+- w89k) # EGCS LOCAL
++ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+- op50n) # EGCS LOCAL
++ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+- op60c) # EGCS LOCAL
++ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+- mips)
+- if [ x$os = x-linux-gnu ]; then
+- basic_machine=mips-unknown
+- else
+- basic_machine=mips-mips
+- fi
+- ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+@@ -851,16 +1017,26 @@
+ vax)
+ basic_machine=vax-dec
+ ;;
++ pdp10)
++ # there are many clones, so DEC is not a safe bet
++ basic_machine=pdp10-unknown
++ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+- sparc | sparcv9)
++ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
++ basic_machine=sh-unknown
++ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
++ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+- cydra)
++ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+@@ -869,16 +1045,15 @@
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+- mac | mpw | mac-mpw) # EGCS LOCAL
++ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+- pmac | pmac-mpw) # EGCS LOCAL
++ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+- c4x*)
+- basic_machine=c4x-none
+- os=-coff
+- ;;
++ *-unknown)
++ # Make sure to match an already-canonicalized machine name.
++ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+@@ -935,20 +1110,38 @@
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+- | -interix* | -uwin* )
++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
++ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
++ | -powermax* | -dnix* | -microbsd*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+- # EGCS LOCAL
++ -qnx*)
++ case $basic_machine in
++ x86-* | i*86-*)
++ ;;
++ *)
++ os=-nto$os
++ ;;
++ esac
++ ;;
++ -nto-qnx*)
++ ;;
++ -nto*)
++ os=`echo $os | sed -e 's|nto|nto-qnx|'`
++ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+- | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
++ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+- # END EGCS LOCAL
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+@@ -958,6 +1151,12 @@
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
++ -opened*)
++ os=-openedition
++ ;;
++ -wince*)
++ os=-wince
++ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+@@ -973,14 +1172,23 @@
+ -acis*)
+ os=-aos
+ ;;
+- -386bsd) # EGCS LOCAL
++ -atheos*)
++ os=-atheos
++ ;;
++ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
++ -nova*)
++ os=-rtmk-nova
++ ;;
+ -ns2 )
+- os=-nextstep2
++ os=-nextstep2
++ ;;
++ -nsk*)
++ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+@@ -1007,15 +1215,21 @@
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+- -ose*) # EGCS LOCAL
++ -ose*)
+ os=-ose
+ ;;
+- -es1800*) # EGCS LOCAL
++ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ os=-mint
++ ;;
++ -aros*)
++ os=-aros
++ ;;
+ -none)
+ ;;
+ *)
+@@ -1041,13 +1255,17 @@
+ *-acorn)
+ os=-riscix1.2
+ ;;
+- arm*-corel)
++ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+- pdp11-*)
++ # This must come before the *-dec entry.
++ pdp10-*)
++ os=-tops20
++ ;;
++ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+@@ -1065,15 +1283,18 @@
+ # default.
+ # os=-sunos4
+ ;;
+- m68*-cisco) # EGCS LOCAL
++ m68*-cisco)
+ os=-aout
+ ;;
+- mips*-cisco) # EGCS LOCAL
++ mips*-cisco)
+ os=-elf
+ ;;
+- mips*-*) # EGCS LOCAL
+- os=-elf
+- ;;
++ mips*-*)
++ os=-elf
++ ;;
++ or32-*)
++ os=-coff
++ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+@@ -1086,13 +1307,13 @@
+ *-ibm)
+ os=-aix
+ ;;
+- *-wec) # EGCS LOCAL
++ *-wec)
+ os=-proelf
+ ;;
+- *-winbond) # EGCS LOCAL
++ *-winbond)
+ os=-proelf
+ ;;
+- *-oki) # EGCS LOCAL
++ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+@@ -1137,36 +1358,39 @@
+ *-next)
+ os=-nextstep3
+ ;;
+- *-gould)
++ *-gould)
+ os=-sysv
+ ;;
+- *-highlevel)
++ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+- *-sgi)
++ *-sgi)
+ os=-irix
+ ;;
+- *-siemens)
++ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+- f301-fujitsu)
++ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+- *-rom68k) # EGCS LOCAL
++ *-rom68k)
+ os=-coff
+ ;;
+- *-*bug) # EGCS LOCAL
++ *-*bug)
+ os=-coff
+ ;;
+- *-apple) # EGCS LOCAL
++ *-apple)
+ os=-macos
+ ;;
++ *-atari*)
++ os=-mint
++ ;;
+ *)
+ os=-none
+ ;;
+@@ -1212,27 +1436,41 @@
+ -genix*)
+ vendor=ns
+ ;;
+- -mvs*)
++ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+- -vxsim* | -vxworks*)
++ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+- -hms*) # EGCS LOCAL
++ -hms*)
+ vendor=hitachi
+ ;;
+- -mpw* | -macos*) # EGCS LOCAL
++ -mpw* | -macos*)
+ vendor=apple
+ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ vendor=atari
++ ;;
++ -vos*)
++ vendor=stratus
++ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+ esac
+
+ echo $basic_machine$os
++exit 0
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
diff --git a/patches/gcc/2.95.3/deque-leak-fix.patch b/patches/gcc/2.95.3/deque-leak-fix.patch
new file mode 100644
index 0000000..44d2a01
--- /dev/null
+++ b/patches/gcc/2.95.3/deque-leak-fix.patch
@@ -0,0 +1,31 @@
+[See also http://gcc.gnu.org/ml/libstdc++/2001-11/msg00133.html ]
+
+Date: Fri, 16 Nov 2001 16:06:22 -0500
+From: Phil Edwards <pedwards at disaster dot jaj dot com>
+To: gcc-patches at gcc dot gnu dot org
+Subject: [libstdc++ trunk & 3.0] Fix deque memory leak
+Message-ID: <20011116160622.A23094@disaster.jaj.com>
+
+
+As discussed on the libstdc++ mailing list. Tested on i686/linux.
+
+
+
+2001-11-16 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/stl_deque.h (deque::erase()): Fix memory leak.
+
+
+[rediffed against 2.95.3 -- dank]
+
+--- gcc-2.95.3/libstdc++/stl/stl_deque.h.old 2001-01-01 09:48:22.000000000 -0800
++++ gcc-2.95.3/libstdc++/stl/stl_deque.h 2006-02-18 15:24:17.000000000 -0800
+@@ -1052,7 +1052,7 @@
+ copy_backward(_M_start, __first, __last);
+ iterator __new_start = _M_start + __n;
+ destroy(_M_start, __new_start);
+- _M_destroy_nodes(__new_start._M_node, _M_start._M_node);
++ _M_destroy_nodes(_M_start._M_node, __new_start._M_node); /* fixed per http://gcc.gnu.org/ml/libstdc++/2001-11/msg00139.html */
+ _M_start = __new_start;
+ }
+ else {
diff --git a/patches/gcc/2.95.3/gcc-2.95.3-cygwin-020611.patch b/patches/gcc/2.95.3/gcc-2.95.3-cygwin-020611.patch
new file mode 100644
index 0000000..fb2b8da
--- /dev/null
+++ b/patches/gcc/2.95.3/gcc-2.95.3-cygwin-020611.patch
@@ -0,0 +1,33 @@
+[ Building gcc-2.95.3 on cygwin yields a compiler that sticks a .exe
+ on the end of every executable, even if they're linux executable.
+ This is highly annoying, and causes glibc build failures that look like this:
+ mv: `.../bin/makedb.new' and `.../bin/makedb' are the same file
+ make[2]: *** [.../bin/makedb] Error 1
+ make[2]: Leaving directory `.../gcc-2.95.3-glibc-2.1.3/glibc-2.1.3/db2'
+
+ The mainline solves this with http://gcc.gnu.org/ml/gcc-cvs/2001-04/msg00440.html,
+ but that doesn't apply cleanly to gcc-2.95.3.
+
+ So, I'm using
+ http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/tools-20030314/gcc-2.95.3-cygwin-020611.patch
+ This is the only patch in crosstool that *isn't* suitable for the mainline.
+ I can live with this patch simply because crosstool does not build
+ compilers that target cygwin or VAX/VMS.
+ If that ever changes, I might need to try applying the real patch.
+]
+
+
+
+#
+# This patch can be found at http://www.uclinux.org/pub/uClinux/m68k-elf-tools/
+#
+--- gcc-2.95.3/gcc/config/i386/xm-cygwin.h 1999-04-22 16:40:56.000000000 +0200
++++ gcc-2.95.3-cygwin/gcc/config/i386/xm-cygwin.h 2002-06-11 08:23:18.000000000 +0200
+@@ -19,7 +19,6 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+-#define EXECUTABLE_SUFFIX ".exe"
+ #define NO_SYS_SIGLIST 1
+
+ /* We support both "/" and "\" since everybody tests both but we
diff --git a/patches/gcc/2.95.3/gcc-2.95.3-trap-posix.patch b/patches/gcc/2.95.3/gcc-2.95.3-trap-posix.patch
new file mode 100644
index 0000000..1d18055
--- /dev/null
+++ b/patches/gcc/2.95.3/gcc-2.95.3-trap-posix.patch
@@ -0,0 +1,44 @@
+#
+# Submitted-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2005-04-20
+#
+# Error:
+#
+# creating libintl.h
+# Configuring etc...
+# loading cache ../config.cache
+# checking for a BSD compatible install... (cached) /usr/bin/install -c
+# creating ./config.status
+# creating Makefile
+# trap: usage: trap [-lp] [[arg] signal_spec ...]
+#
+# Description:
+#
+# non-posix conform usage of trap causes bash >= 3.0 to fail
+# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html
+#
+# Status:
+#
+# fixed in gcc >= 3.3.5
+# backport of gcc-3.3.5 fix
+#
+diff -ruN gcc-2.95.3-orig/configure gcc-2.95.3/configure
+--- gcc-2.95.3-orig/configure 1999-04-02 16:17:40.000000000 +0200
++++ gcc-2.95.3/configure 2005-04-20 18:25:45.030488235 +0200
+@@ -687,7 +687,7 @@
+ if test -f skip-this-dir; then
+ # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
+ # and reset the trap handler.
+- trap 0
++ trap '' 0
+ rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
+ # Execute the final clean-up actions
+ ${config_shell} skip-this-dir
+@@ -1599,7 +1599,7 @@
+ # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
+ # and reset the trap handler.
+ rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
+-trap 0
++trap '' 0
+
+ exit 0
+
diff --git a/patches/gcc/2.95.3/gcc-pr3106.patch b/patches/gcc/2.95.3/gcc-pr3106.patch
new file mode 100644
index 0000000..0e077ea
--- /dev/null
+++ b/patches/gcc/2.95.3/gcc-pr3106.patch
@@ -0,0 +1,28 @@
+See http://gcc.gnu.org/PR3106
+Backported from gcc-3.0.x
+
+Fixes error
+ .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr'
+ /usr/include/stdio.h:258: error: previous declaration of `sys_nerr'
+ make[1]: *** [strerror.o] Error 1
+ make: *** [all-libiberty] Error 2
+on Mac OS X.
+
+--- gcc-2.95.3/libiberty/strerror.c.old 2004-03-24 16:23:19.000000000 -0800
++++ gcc-2.95.3/libiberty/strerror.c 2004-03-24 16:23:48.000000000 -0800
+@@ -13,6 +13,7 @@
+ incompatible with our later declaration, perhaps by using const
+ attributes. So we hide the declaration in errno.h (if any) using a
+ macro. */
++#define sys_nerr sys_nerr__
+ #define sys_errlist sys_errlist__
+ #endif
+
+@@ -20,6 +21,7 @@
+ #include <errno.h>
+
+ #ifdef HAVE_SYS_ERRLIST
++#undef sys_nerr
+ #undef sys_errlist
+ #endif
+
diff --git a/patches/gcc/2.95.3/threads_snafu.patch b/patches/gcc/2.95.3/threads_snafu.patch
new file mode 100644
index 0000000..2c5297e
--- /dev/null
+++ b/patches/gcc/2.95.3/threads_snafu.patch
@@ -0,0 +1,28 @@
+This fixes the error
+
+In file included from gthr-default.h:1,
+ from /build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/gthr.h:98,
+ from /build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/libgcc2.c:3034:
+/build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/gthr-posix.h:37: pthread.h: No such file or directory
+make[3]: *** [libgcc2.a] Error 1
+make[3]: Leaving directory `/build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-gcc-core/gcc'
+
+in what I think is a nicer way than the patch used by the arm team,
+i.e. "perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc -D__gthr_posix_h/' gcc/config/arm/t-linux"
+which seems a bit of a kludge.
+
+--- gcc-2.95.3/gcc/configure.old Fri Mar 16 06:13:48 2001
++++ gcc-2.95.3/gcc/configure Sun Jun 8 13:02:20 2003
+@@ -853,9 +853,9 @@
+ # Check whether --enable-threads or --disable-threads was given.
+ if test "${enable_threads+set}" = set; then
+ enableval="$enable_threads"
+- if test x$enable_threads = xno; then
+- enable_threads=''
+-fi
++ #if test x$enable_threads = xno; then
++ #enable_threads=''
++ #fi
+ else
+ enable_threads=''
+ fi
diff --git a/patches/gcc/3.2.3/README-mips b/patches/gcc/3.2.3/README-mips
new file mode 100644
index 0000000..170b21d
--- /dev/null
+++ b/patches/gcc/3.2.3/README-mips
@@ -0,0 +1,1648 @@
+See also http://www.spinics.net/lists/mips/msg12236.html
+
+ftp://ftp.linux-mips.org/pub/linux/mips/redhat/7.3/test/SRPMS/gcc-3.2-7.1.src.rpm
+contains the following patches and spec file.
+You may wish to investigate some of these patches; I haven't.
+I think this is mostly the Red Hat 8.0 srpm for a prerelease gcc-3.2, plus a couple
+mips specific fixes, but you'd have to ask H.J.Lu or compare with the regular
+Red Hat 8.0 srpm to find out.
+In any case, the spec file is interesting reading.
+- Dan K.
+
+total 1164
+ 4 boehm-gc-LINUX.patch
+ 4 boehm-gc-mips.patch
+ 4 contrib-touch.patch
+ 8 gcc-arch.patch
+ 4 gcc-c++-template.patch
+ 4 gcc-copy.patch
+ 4 gcc-cross-bfd.patch
+ 4 gcc-cross.patch
+ 4 gcc-gcj-cross.patch
+ 4 gcc-libffi-mips.patch
+ 4 gcc-libgcc.patch
+ 480 gcc-libstdc++-glibc-2.2.patch
+ 4 gcc-libstdc++-mips.patch
+ 4 gcc-linux-atexit.patch
+ 8 gcc-linux-crt.patch
+ 4 gcc-mips-coff.patch
+ 4 gcc-mips-file.patch
+ 4 gcc-mips-ieee.patch
+ 4 gcc-mips-return.patch
+ 4 gcc-ppc-linux.patch
+ 8 gcc-sizeof.patch
+ 4 gcc-test-atexit.patch
+ 4 gcc-testsuite-c++.patch
+ 4 gcc-var.patch
+ 8 gcc32-2.96-RH-compat.patch
+ 4 gcc32-ada-addr2line.patch
+ 8 gcc32-ada-link.patch
+ 12 gcc32-attr-visibility.patch
+ 4 gcc32-attr-visibility2.patch
+ 4 gcc32-attr-visibility3.patch
+ 4 gcc32-attr-visibility4.patch
+ 4 gcc32-attr-visibility5.patch
+ 8 gcc32-boehm-gc-libs.patch
+ 4 gcc32-bogus-inline.patch
+ 4 gcc32-c++-nrv-test.patch
+ 4 gcc32-c++-pretty_function.patch
+ 16 gcc32-c++-tail-pad-backout.patch
+ 4 gcc32-c++-tsubst-asm.patch
+ 4 gcc32-cfg-eh.patch
+ 4 gcc32-debug-pr7241.patch
+ 4 gcc32-doc-gcov.patch
+ 4 gcc32-duplicate-decl.patch
+ 4 gcc32-dwarf2-pr6381.patch
+ 4 gcc32-dwarf2-pr6436-test.patch
+ 4 gcc32-fde-merge-compat.patch
+ 4 gcc32-fold-const-associate.patch
+ 4 gcc32-fold-const2.patch
+ 24 gcc32-hard-reg-sharing.patch
+ 4 gcc32-hard-reg-sharing2.patch
+ 4 gcc32-i386-default-momit-leaf-frame-pointer.patch
+ 4 gcc32-i386-memtest-test.patch
+ 4 gcc32-i386-no-default-momit-leaf-frame-pointer.patch
+ 4 gcc32-i386-pic-label-thunk.patch
+ 4 gcc32-i386-pr7242.patch
+ 4 gcc32-i386-profile-olfp.patch
+ 4 gcc32-inline-label.patch
+ 4 gcc32-interface_only.patch
+ 4 gcc32-java-no-rpath.patch
+ 20 gcc32-libstdc++-glibc23-1.patch
+ 4 gcc32-libstdc++-glibc23-2.patch
+ 4 gcc32-libstdc++-glibc23-3.patch
+ 4 gcc32-libstdc++-glibc23-4.patch
+ 4 gcc32-loop-prefetch.patch
+ 4 gcc32-pr6842.patch
+ 8 gcc32-rh69989.patch
+ 40 gcc32-s390-java.patch
+ 4 gcc32-sparc-sll1.patch
+ 4 gcc32-test-rh65771.patch
+ 8 gcc32-test-rotate.patch
+ 12 gcc32-tls-dwarf2.patch
+ 140 gcc32-tls.patch
+ 4 gcc32-tls2.patch
+ 4 gcc32-tls3.patch
+ 4 gcc32-tls4.patch
+ 4 gcc32-tls5.patch
+ 24 gcc32-tree-code.patch
+ 4 gcc32-trunc_int_for_mode.patch
+ 4 gcc32-typeof-asm.patch
+ 4 gcc32-x86_64-libiberty-pic.patch
+ 4 gcc32-x86_64-pr7559.patch
+ 4 gcc32-x86_64-q_regs_operand.patch
+ 4 gcc32-x86_64-rip-lowercase.patch
+ 4 libjava-cross.patch
+ 4 libtool-libs.patch
+ 4 libtool-mips.patch
+
+---------- gcc32.spec ---------
+
+%if %{_arch} != %{_build_arch}
+%define cross_compile 1
+%else
+%define cross_compile 0
+%endif
+%{?_with_crosscompile: %{expand: %%define cross_compile 1}}
+
+%if %{cross_compile}
+%define make_check 0
+%else
+%define make_check 1
+%endif
+%{?_without_check: %{expand: %%define make_check 0}}
+%{?_with_check: %{expand: %%define make_check 1}}
+
+%define default 0
+%{?_with_default: %{expand: %%define default 1}}
+
+%define gcconly 0
+%{?_with_gcconly: %{expand: %%define gcconly 1}}
+
+%define DATE 20020903
+%define gcc_version 3.2
+%define gcc_release 7.1
+%ifarch %{ix86} alpha ia64 ppc
+%define build_ada 1
+%else
+%define build_ada 0
+%endif
+%{?_without_ada: %{expand: %%define build_ada 0}}
+%if %{cross_compile}
+%define build_ada 0
+%endif
+Summary: Various compilers (C, C++, Objective-C, Java, ...)
+%if !%{gcconly}
+Name: gcc
+Version: 3.2
+Release: %{gcc_release}
+%else
+Name: gcc-%{gcc_version}
+Version: %{gcc_release}
+Release: 1
+%endif
+Copyright: GPL
+Group: Development/Languages
+Source0: gcc-%{version}-%{DATE}.tar.bz2
+URL: http://gcc.gnu.org
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRequires: binutils >= 2.12.90.0.9-1
+BuildRequires: zlib-devel, gettext, dejagnu
+# Make sure pthread.h doesn't contain __thread tokens
+BuildRequires: glibc-devel >= 2.2.5-36.2
+%if %{build_ada}
+# Ada requires Ada to build
+BuildRequires: gcc-gnat >= 3.1, libgnat >= 3.1
+%endif
+Requires: cpp = %{version}-%{release}
+# Need .eh_frame ld optimizations
+# Need proper visibility support
+Requires: binutils >= 2.12.90.0.7-1
+# Make sure gdb will understand DW_FORM_strp
+Conflicts: gdb < 5.1-2
+Requires: glibc-devel >= 2.2.5-36.2
+Requires: libgcc >= %{version}-%{release}
+%if !%{gcconly}
+Obsoletes: gcc3
+%endif
+Prereq: /sbin/install-info
+
+Patch1: gcc32-2.96-RH-compat.patch
+Patch2: gcc32-boehm-gc-libs.patch
+Patch3: gcc32-bogus-inline.patch
+Patch6: gcc32-fde-merge-compat.patch
+Patch7: gcc32-attr-visibility.patch
+Patch8: gcc32-attr-visibility2.patch
+Patch9: gcc32-duplicate-decl.patch
+Patch10: gcc32-trunc_int_for_mode.patch
+Patch11: gcc32-sparc-sll1.patch
+Patch12: gcc32-x86_64-q_regs_operand.patch
+Patch13: gcc32-dwarf2-pr6381.patch
+Patch14: gcc32-dwarf2-pr6436-test.patch
+Patch15: gcc32-c++-pretty_function.patch
+Patch16: gcc32-c++-tsubst-asm.patch
+Patch18: gcc32-i386-memtest-test.patch
+Patch19: gcc32-fold-const2.patch
+Patch21: gcc32-ada-addr2line.patch
+Patch22: gcc32-ada-link.patch
+Patch23: gcc32-java-no-rpath.patch
+Patch25: gcc32-s390-java.patch
+Patch26: gcc32-test-rotate.patch
+Patch27: gcc32-x86_64-libiberty-pic.patch
+Patch29: gcc32-test-rh65771.patch
+Patch30: gcc32-i386-default-momit-leaf-frame-pointer.patch
+Patch31: gcc32-i386-pic-label-thunk.patch
+Patch34: gcc32-pr6842.patch
+Patch35: gcc32-tls.patch
+Patch36: gcc32-i386-profile-olfp.patch
+Patch37: gcc32-tree-code.patch
+Patch38: gcc32-hard-reg-sharing.patch
+Patch39: gcc32-hard-reg-sharing2.patch
+Patch40: gcc32-c++-nrv-test.patch
+Patch41: gcc32-debug-pr7241.patch
+Patch42: gcc32-i386-pr7242.patch
+Patch43: gcc32-cfg-eh.patch
+Patch44: gcc32-attr-visibility3.patch
+Patch45: gcc32-tls2.patch
+Patch46: gcc32-fold-const-associate.patch
+Patch47: gcc32-inline-label.patch
+Patch48: gcc32-typeof-asm.patch
+Patch50: gcc32-rh69989.patch
+Patch51: gcc32-tls3.patch
+Patch52: gcc32-tls4.patch
+Patch54: gcc32-tls5.patch
+Patch55: gcc32-tls-dwarf2.patch
+Patch56: gcc32-x86_64-pr7559.patch
+Patch57: gcc32-loop-prefetch.patch
+Patch58: gcc32-doc-gcov.patch
+Patch59: gcc32-attr-visibility4.patch
+Patch60: gcc32-c++-tail-pad-backout.patch
+Patch61: gcc32-attr-visibility5.patch
+Patch62: gcc32-i386-no-default-momit-leaf-frame-pointer.patch
+Patch64: gcc32-x86_64-rip-lowercase.patch
+Patch65: gcc32-libstdc++-glibc23-1.patch
+Patch66: gcc32-libstdc++-glibc23-2.patch
+Patch67: gcc32-libstdc++-glibc23-3.patch
+Patch68: gcc32-libstdc++-glibc23-4.patch
+Patch69: gcc32-interface_only.patch
+
+%define _gnu %{nil}
+
+Patch10000: boehm-gc-mips.patch
+Patch10001: boehm-gc-LINUX.patch
+Patch10002: gcc-libffi-mips.patch
+
+Patch11000: gcc-mips-coff.patch
+Patch11001: gcc-mips-file.patch
+Patch11002: gcc-mips-ieee.patch
+Patch11003: gcc-mips-return.patch
+Patch11004: gcc-libstdc++-mips.patch
+Patch11005: libtool-mips.patch
+
+Patch12000: gcc-libgcc.patch
+
+Patch13000: gcc-ppc-linux.patch
+Patch13001: gcc-linux-crt.patch
+
+Patch14000: gcc-linux-atexit.patch
+Patch14001: gcc-test-atexit.patch
+
+Patch15000: gcc-var.patch
+Patch15001: gcc-copy.patch
+
+Patch16000: gcc-c++-template.patch
+Patch16001: gcc-testsuite-c++.patch
+
+Patch17000: gcc-cross.patch
+Patch17001: gcc-cross-bfd.patch
+Patch17002: gcc-sizeof.patch
+Patch17003: gcc-arch.patch
+
+Patch18000: libjava-cross.patch
+Patch18001: gcc-gcj-cross.patch
+
+Patch19000: contrib-touch.patch
+
+Patch20000: libtool-libs.patch
+
+Patch21000: gcc-libstdc++-glibc-2.2.patch
+
+%description
+The gcc package contains the GNU Compiler Collection version 3.2.
+You'll need this package in order to compile C code.
+
+%package -n libgcc
+Summary: GCC version 3.2 shared support library
+Group: System Environment/Libraries
+
+%description -n libgcc
+This package contains GCC shared support library which is needed
+e.g. for exception handling support.
+
+%package c++
+Summary: C++ support for GCC
+Group: Development/Languages
+Requires: gcc = %{version}-%{release}
+Requires: libstdc++ = %{version}
+Requires: libstdc++-devel = %{version}
+Obsoletes: gcc3-c++
+
+%description c++
+This package adds C++ support to the GNU Compiler Collection.
+It includes support for most of the current C++ specification,
+including templates and exception handling.
+
+%package -n libstdc++
+Summary: GNU Standard C++ Library
+Group: System Environment/Libraries
+Obsoletes: libstdc++3
+
+%description -n libstdc++
+The libstdc++ package contains a rewritten standard compliant GCC Standard
+C++ Library.
+
+%package -n libstdc++-devel
+Summary: Header files and libraries for C++ development
+Group: Development/Libraries
+Requires: libstdc++ = %{version}-%{release}
+Obsoletes: libstdc++3-devel
+
+%description -n libstdc++-devel
+This is the GNU implementation of the standard C++ libraries. This
+package includes the header files and libraries needed for C++
+development. This includes rewritten implementation of STL.
+
+%package objc
+Summary: Objective-C support for GCC
+Group: Development/Languages
+Requires: gcc = %{version}-%{release}
+Requires: libobjc = %{version}-%{release}
+Obsoletes: gcc3-objc
+
+%description objc
+gcc-objc provides Objective-C support for the GCC.
+Mainly used on systems running NeXTSTEP, Objective-C is an
+object-oriented derivative of the C language.
+
+%package -n libobjc
+Summary: Objective-C runtime
+Group: System Environment/Libraries
+
+%description -n libobjc
+This package contains Objective-C shared library which is needed to run
+Objective-C dynamically linked programs.
+
+%package g77
+Summary: Fortran 77 support
+Group: Development/Languages
+Requires: gcc = %{version}-%{release}
+Requires: libf2c = %{version}-%{release}
+Prereq: /sbin/install-info
+Obsoletes: gcc3-g77
+
+%description g77
+The gcc-g77 package provides support for compiling Fortran 77
+programs with the GNU Compiler Collection.
+
+%package -n libf2c
+Summary: Fortran 77 runtime
+Group: System Environment/Libraries
+
+%description -n libf2c
+This package contains Fortran 77 shared library which is needed to run
+Fortran 77 dynamically linked programs.
+
+%package java
+Summary: Java support for GCC
+Group: Development/Languages
+Requires: gcc = %{version}-%{release}
+Requires: libgcj >= %{version}, libgcj-devel >= %{version}
+Obsoletes: gcc3-java
+Prereq: /sbin/install-info
+
+%description java
+This package adds support for compiling Java(tm) programs and
+bytecode into native code.
+
+%package -n libgcj
+Summary: Java runtime library for gcc
+Group: System Environment/Libraries
+Requires: zip >= 2.1
+Obsoletes: gcc-libgcj
+Obsoletes: libgcj3
+# Kaffe includes jar too
+Conflicts: kaffe
+
+%description -n libgcj
+The Java(tm) runtime library. You will need this package to run your Java
+programs compiled using the Java compiler from GNU Compiler Collection (gcj).
+
+%package -n libgcj-devel
+Summary: Libraries for Java development using GCC
+Group: Development/Languages
+Requires: zip >= 2.1, libgcj = %{version}
+Obsoletes: libgcj3-devel
+
+%description -n libgcj-devel
+The Java(tm) static libraries and C header files. You will need this
+package to compile your Java programs using the GCC Java compiler (gcj).
+
+%package -n cpp
+Summary: The C Preprocessor.
+Group: Development/Languages
+Prereq: /sbin/install-info
+%ifarch ia64
+Obsoletes: gnupro
+%endif
+
+%description -n cpp
+Cpp is the GNU C-Compatible Compiler Preprocessor.
+Cpp is a macro processor which is used automatically
+by the C compiler to transform your program before actual
+compilation. It is called a macro processor because it allows
+you to define macros, abbreviations for longer
+constructs.
+
+The C preprocessor provides four separate functionalities: the
+inclusion of header files (files of declarations that can be
+substituted into your program); macro expansion (you can define macros,
+and the C preprocessor will replace the macros with their definitions
+throughout the program); conditional compilation (using special
+preprocessing directives, you can include or exclude parts of the
+program according to various conditions); and line control (if you use
+a program to combine or rearrange source files into an intermediate
+file which is then compiled, you can use line control to inform the
+compiler about where each source line originated).
+
+You should install this package if you are a C programmer and you use
+macros.
+
+%package gnat
+Summary: Ada 95 support for GCC
+Group: Development/Languages
+Requires: gcc = %{version}-%{release}, libgnat = %{version}-%{release}
+Obsoletes: gnat-devel, gcc3-gnat
+Prereq: /sbin/install-info
+
+%description gnat
+GNAT is a GNU Ada 95 front-end to GCC. This package includes development tools,
+the documents and Ada 95 compiler.
+
+%package -n libgnat
+Summary: GNU Ada 95 runtime shared libraries
+Group: System Environment/Libraries
+Obsoletes: gnat libgnat3
+
+%description -n libgnat
+GNAT is a GNU Ada 95 front-end to GCC. This package includes shared libraries,
+which are required to run programs compiled with the GNAT.
+
+%prep
+%setup -q -n gcc-%{version}-%{DATE}
+%patch1 -p0 -b .2.96-RH-compat~
+%patch2 -p0 -b .boehm-gc-libs~
+%patch3 -p0 -b .bogus-inline~
+%patch6 -p0 -b .fde-merge-compat~
+%patch7 -p0 -b .attr-visibility~
+%patch8 -p0 -b .attr-visibility2~
+%patch9 -p0 -b .duplicate-decl~
+%patch10 -p0 -b .trunc_int_for_mode~
+%patch11 -p0 -b .sparc-sll1~
+%patch12 -p0 -b .x86_64-q_regs_operand~
+%patch13 -p0 -b .dwarf2-pr6381~
+%patch14 -p0 -b .dwarf2-pr6436-test~
+%patch15 -p0 -b .c++-pretty_function~
+%patch16 -p0 -b .c++-tsubst-asm~
+%patch18 -p0 -b .i386-memtest-test~
+%patch19 -p0 -b .fold-const2~
+%patch21 -p0 -b .ada-addr2line~
+%patch22 -p0 -b .ada-link~
+%patch23 -p0 -b .java-no-rpath~
+%patch25 -p0 -b .s390-java~
+%patch26 -p0 -b .test-rotate~
+%patch27 -p0 -b .x86_64-libiberty-pic~
+%patch29 -p0 -b .test-rh65771~
+%patch30 -p0 -b .i386-default-momit-leaf-frame-pointer~
+%patch31 -p0 -b .i386-pic-label-thunk~
+%patch34 -p0 -b .pr6842~
+%patch35 -p0 -b .tls~
+%patch36 -p0 -b .i386-profile-olfp~
+%patch37 -p0 -b .tree-code~
+%patch38 -p0 -b .hard-reg-sharing~
+%patch39 -p0 -b .hard-reg-sharing2~
+%patch40 -p0 -b .c++-nrv-test~
+%patch41 -p0 -b .debug-pr7241~
+%patch42 -p0 -b .i386-pr7242~
+%patch43 -p0 -b .cfg-eh~
+%patch44 -p0 -b .attr-visibility3~
+%patch45 -p0 -b .tls2~
+%patch46 -p0 -b .fold-const-associate~
+%patch47 -p0 -b .inline-label~
+%patch48 -p0 -b .typeof-asm~
+%patch50 -p0 -b .rh69989~
+%patch51 -p0 -b .tls3~
+%patch52 -p0 -b .tls4~
+%patch54 -p0 -b .tls5~
+%patch55 -p0 -b .tls-dwarf2~
+%patch56 -p0 -b .x86_64-pr7559~
+%patch57 -p0 -b .loop-prefetch~
+%patch58 -p0 -b .doc-gcov~
+%patch59 -p0 -b .attr-visibility4~
+%patch60 -p0 -b .c++-tail-pad-backout~
+%patch61 -p0 -b .attr-visibility5~
+%patch62 -p0 -b .i386-no-default-momit-leaf-frame-pointer~
+%patch64 -p0 -b .x86_64-rip-lowercase~
+%patch65 -p0 -b .libstdc++-glibc23-1~
+%patch66 -p0 -b .libstdc++-glibc23-2~
+%patch67 -p0 -b .libstdc++-glibc23-3~
+%patch68 -p0 -b .libstdc++-glibc23-4~
+%patch69 -p0 -b .interface_only
+
+%patch10000 -p0 -b .mips
+%patch10001 -p0 -b .LINUX
+%patch10002 -p0 -b .mips
+pushd boehm-gc
+autoconf
+popd
+pushd libffi
+autoconf
+# Ignore the error from automake
+automake --cygnus Makefile || :
+popd
+
+%patch11000 -p0 -b .coff
+%patch11001 -p0 -b .file
+%patch11002 -p0 -b .ieee
+%patch11003 -p0 -b .return
+%patch11004 -p0 -b .mips
+%patch11005 -p1 -b .mips
+
+%patch12000 -p0 -b .libgcc
+
+%patch13000 -p0 -b .ppc
+%patch13001 -p0 -b .crt
+
+%patch14000 -p0 -b .order
+%patch14001 -p0 -b .order
+
+%patch15000 -p0 -b .var
+%patch15001 -p0 -b .copy
+
+%patch16000 -p0 -b .template
+%patch16001 -p0 -b .template
+
+%patch17000 -p1 -b .cross
+%patch17001 -p0 -b .cross-bfd
+%patch17002 -p1 -b .sizeof
+%patch17003 -p0 -b .arch
+pushd gcc
+autoheader
+autoconf
+popd
+pushd fastjar
+aclocal
+autoconf
+popd
+pushd libffi
+aclocal
+autoconf
+popd
+
+%patch18000 -p0 -b .cross
+%patch18001 -p0 -b .build
+pushd libjava
+autoconf
+automake --foreign Makefile
+popd
+
+%patch19000 -p0 -b .touch
+
+%patch20000 -p0 -b .libs
+
+%patch21000 -p0 -b .glibc-2.2
+pushd libstdc++-v3
+autoconf
+popd
+
+perl -pi -e 's/3\.2\.1/3.2/' gcc/version.c gcc/f/version.c gcc/ada/gnatvsn.ads
+perl -pi -e 's/"%{gcc_version}"/"%{gcc_version} \(release\)"/' gcc/version.c
+perl -pi -e 's/\((prerelease|experimental|release)\)/\(Red Hat Linux 8.0 %{version}-%{gcc_release}\)/' gcc/version.c gcc/f/version.c
+perl -pi -e 's/\((prerelease|experimental|release)\)/\(%{version}-%{gcc_release}\)/' gcc/ada/gnatvsn.ads
+perl -pi -e 's/#define GCCBUGURL.*$/#define GCCBUGURL "<URL:http:\/\/bugzilla.redhat.com\/bugzilla\/>"/' gcc/system.h
+# The version string is now longer than 32 bytes and the line containing it
+# doesn't fit into 80 columns
+#perl -pi -e 's/:= 32/:= 64/;s/(Gnat_Version_String.*:=)/\1\n /' gcc/ada/gnatvsn.ads
+
+./contrib/gcc_update --touch
+
+%build
+rm -fr obj-%{_target_platform}
+mkdir obj-%{_target_platform}
+cd obj-%{_target_platform}
+
+%if %{_arch} != %{_build_arch}
+%ifos linux
+export ac_cv_func_mmap_anywhere=yes
+export ac_cv_func_mmap_file=yes
+export ac_cv_func_mmap_fixed_mapped=yes
+export ac_cv_func_strncmp_works=yes
+export gcc_cv_func_printf_ptr=yes
+%endif
+%endif
+
+DEFAULT_FLAGS=
+%if %{default}
+%ifarch %{ix86}
+TARGET_CPU="%{_target_cpu}"
+DEFAULT_FLAGS="--with-arch=$TARGET_CPU --with-cpu=$TARGET_CPU"
+%endif
+%endif
+
+CC=%{__cc}
+OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g'`
+CC="$CC" CFLAGS="$OPT_FLAGS" CXXFLAGS="$OPT_FLAGS" XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \
+ ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
+ --enable-shared --enable-threads=posix --disable-checking --host=%{_target_platform} \
+ $DEFAULT_FLAGS \
+%if %{cross_compile}
+ --target=%{_target_platform} --build=%{_build_alias} \
+%endif
+ --with-system-zlib --enable-__cxa_atexit
+
+# We have to make sure all gcc configure files are up to date for
+# parallel build. We have to do it twice due to the stupid Makefile.
+make -C gcc cstamp-h
+make -C gcc cstamp-h
+
+# if RPM_BUILD_NCPUS unset, set it
+if [ -z "$RPM_BUILD_NCPUS" ] ; then
+ if [ -x /usr/bin/getconf ] ; then
+ RPM_BUILD_NCPUS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
+ if [ $RPM_BUILD_NCPUS -eq 0 ]; then
+ RPM_BUILD_NCPUS=1
+ fi
+ else
+ RPM_BUILD_NCPUS=1
+ fi
+fi
+
+RPM_BUILD_NCPUS=`expr $RPM_BUILD_NCPUS + $RPM_BUILD_NCPUS`
+
+cat <<EOF > makefile
+MAKE=make -j $RPM_BUILD_NCPUS
+include Makefile
+CFLAGS:=\$(CFLAGS) -pipe
+CXXFLAGS:=\$(CXXFLAGS) -pipe
+EOF
+
+# FIXME: It is a kludge.
+export GCJFLAGS="$OPT_FLAGS"
+
+%if %{cross_compile}
+make -j$RPM_BUILD_NCPUS \
+ CC=%{__cc} \
+ CXX=%{__cxx} \
+ AR=%{__ar} \
+ AS=%{__as} \
+ LD=%{__ld} \
+ NM=%{__nm} \
+ RANLIB=%{__ranlib} \
+ CC_FOR_TARGET=%{__cc} \
+ GCC_FOR_TARGET=%{__cc} \
+ CXX_FOR_TARGET=%{__cxx} \
+ AR_FOR_TARGET=%{__ar} \
+ AS_FOR_TARGET=%{__as} \
+ LD_FOR_TARGET=%{__ld} \
+ NM_FOR_TARGET=%{__nm} \
+ RANLIB_FOR_TARGET=%{__ranlib} \
+ HOST_CC=cc \
+ CFLAGS_FOR_TARGET="$RPM_OPT_FLAGS -pipe" \
+ CFLAGS_FOR_BUILD="-O -pipe" \
+ CFLAGS="$RPM_OPT_FLAGS -pipe" \
+ CXXFLAGS="$RPM_OPT_FLAGS -pipe"
+%else
+make -j$RPM_BUILD_NCPUS bootstrap-lean
+#make -j$RPM_BUILD_NCPUS bootstrap
+%endif
+
+%if %{build_ada}
+# This doesn't work with -j$RPM_BUILD_NCPUS
+make -C gcc gnatlib-shared
+make -C gcc gnattools
+make -C gcc/ada doc
+%endif
+
+%if %{make_check}
+# run the tests.
+make -j$RPM_BUILD_NCPUS -k check || :
+%ifarch %{ix86}
+ln -sf i686-pc-linux-gnu ../libstdc++-v3/config/abi/%{_target_platform}
+ln -sf i686-pc-linux-gnu ../libstdc++-v3/config/abi/%{_target_platform}-gnu
+%endif
+echo ====================TESTING=========================
+( ../contrib/test_summary || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}'
+%ifarch %{ix86}
+make -C %{_target_platform}/libstdc++-v3 check-abi
+%endif
+echo ====================TESTING END=====================
+#cd %{_target_platform}/libstdc++-v3
+#./mkcheck 0
+#cd ../..
+%endif
+
+%if !%{cross_compile}
+# Make protoize
+make -C gcc CC="./xgcc -B ./ -O2" proto
+%endif
+
+# Make generated man pages even if Pod::Man is not new enough
+perl -pi -e 's/head3/head2/' ../contrib/texi2pod.pl
+for i in ../gcc/doc/*.texi; do
+ cp -a $i $i.orig; sed 's/ftable/table/' $i.orig > $i
+done
+make -C gcc generated-manpages
+for i in ../gcc/doc/*.texi; do mv -f $i.orig $i; done
+
+# Copy various doc files here and there
+cd ..
+mkdir -p rpm.doc/g77 rpm.doc/objc
+mkdir -p rpm.doc/boehm-gc rpm.doc/fastjar rpm.doc/libffi rpm.doc/libjava
+
+(cd gcc/f; for i in ChangeLog*; do
+ cp -p $i ../../rpm.doc/g77/$i.f
+done)
+(cd libf2c; for i in ChangeLog*; do
+ cp -p $i ../rpm.doc/g77/$i.libf2c
+done)
+(cd gcc/objc; for i in README*; do
+ cp -p $i ../../rpm.doc/objc/$i.objc
+done)
+(cd libobjc; for i in README*; do
+ cp -p $i ../rpm.doc/objc/$i.libobjc
+done)
+(cd boehm-gc; for i in ChangeLog*; do
+ cp -p $i ../rpm.doc/boehm-gc/$i.gc
+done)
+(cd fastjar; for i in ChangeLog* README*; do
+ cp -p $i ../rpm.doc/fastjar/$i.fastjar
+done)
+(cd libffi; for i in ChangeLog* README* LICENSE; do
+ cp -p $i ../rpm.doc/libffi/$i.libffi
+done)
+(cd libjava; for i in ChangeLog* README*; do
+ cp -p $i ../rpm.doc/libjava/$i.libjava
+done)
+
+%install
+rm -fr $RPM_BUILD_ROOT
+
+perl -pi -e \
+ 's~href="l(ibstdc|atest)~href="http://gcc.gnu.org/onlinedocs/libstdc++/l\1~' \
+ libstdc++-v3/docs/html/documentation.html
+ln -sf documentation.html libstdc++-v3/docs/html/index.html
+find libstdc++-v3/docs/html -name CVS | xargs rm -rf
+
+cd obj-%{_target_platform}
+TARGET_PLATFORM=%{_target_platform}
+
+# There are some MP bugs in libstdc++ and libjava Makefiles
+make -C %{_target_platform}/libstdc++-v3
+make -C %{_target_platform}/libjava
+
+make prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} \
+%if %{cross_compile}
+ CC=%{__cc} \
+ CXX=%{__cxx} \
+ AR=%{__ar} \
+ AS=%{__as} \
+ LD=%{__ld} \
+ NM=%{__nm} \
+ RANLIB=%{__ranlib} \
+ CC_FOR_TARGET=%{__cc} \
+ GCC_FOR_TARGET=%{__cc} \
+ CXX_FOR_TARGET=%{__cxx} \
+ AR_FOR_TARGET=%{__ar} \
+ AS_FOR_TARGET=%{__as} \
+ LD_FOR_TARGET=%{__ld} \
+ NM_FOR_TARGET=%{__nm} \
+ RANLIB_FOR_TARGET=%{__ranlib} \
+ HOST_CC=cc \
+ CFLAGS_FOR_TARGET="$RPM_OPT_FLAGS -pipe" \
+ CFLAGS_FOR_BUILD="-O -pipe" \
+ CFLAGS="$RPM_OPT_FLAGS -pipe" \
+ CXXFLAGS="$RPM_OPT_FLAGS -pipe" \
+%endif
+ infodir=$RPM_BUILD_ROOT%{_infodir} install
+%if %{build_ada}
+pushd gcc/ada
+cp -a gnat-style.info* gnat_rm.info* $RPM_BUILD_ROOT%{_infodir}/
+for i in gnat_ug_unx.info*; do
+ sed 's/gnat_ug_unx/gnat_ug/g' $i > $RPM_BUILD_ROOT%{_infodir}/`echo $i | sed 's/gnat_ug_unx/gnat_ug/'`
+done
+chmod 644 $RPM_BUILD_ROOT%{_infodir}/gnat*
+popd
+%endif
+
+FULLPATH=$(dirname $RPM_BUILD_ROOT%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/cc1)
+
+file $RPM_BUILD_ROOT/%{_prefix}/bin/* | grep ELF | cut -d':' -f1 | xargs %{__strip} || :
+%{__strip} $FULLPATH/{cc1,cc1obj,cc1plus,cpp0,tradcpp0,f771,jc1,jvgenmain}
+
+# fix some things
+ln -sf gcc $RPM_BUILD_ROOT%{_prefix}/bin/cc
+mkdir -p $RPM_BUILD_ROOT/lib
+ln -sf ..%{_prefix}/bin/cpp $RPM_BUILD_ROOT/lib/cpp
+ln -sf g77 $RPM_BUILD_ROOT%{_prefix}/bin/f77
+rm -f $RPM_BUILD_ROOT%{_infodir}/dir
+gzip -9 $RPM_BUILD_ROOT%{_infodir}/*.info*
+ln -sf gcc $RPM_BUILD_ROOT%{_prefix}/bin/gnatgcc
+
+mv $RPM_BUILD_ROOT%{_prefix}/lib/libgcj.*a $FULLPATH/
+sed 's/-lgcjgc//g;s/-lzgcj//g;s/-lpthread//g' $RPM_BUILD_ROOT%{_prefix}/lib/libgcj.spec > $FULLPATH/libgcj.spec
+mv $RPM_BUILD_ROOT%{_prefix}/include/gc*.h $FULLPATH/include/
+mv $RPM_BUILD_ROOT%{_prefix}/include/j*.h $FULLPATH/include/
+mv -f $RPM_BUILD_ROOT%{_prefix}/include/{java,javax,gnu,org} $FULLPATH/include/
+mkdir -p $FULLPATH/include/gcj
+mv -f $RPM_BUILD_ROOT%{_prefix}/include/gcj/* $FULLPATH/include/gcj/
+rmdir $RPM_BUILD_ROOT%{_prefix}/include/gcj
+
+mkdir -p $RPM_BUILD_ROOT/%{_lib}
+mv -f `find $RPM_BUILD_ROOT%{_prefix}/lib -name libgcc_s.so.1` $RPM_BUILD_ROOT/%{_lib}/libgcc_s-%{gcc_version}-%{DATE}.so.1
+chmod 755 $RPM_BUILD_ROOT/%{_lib}/libgcc_s-%{gcc_version}-%{DATE}.so.1
+ln -sf libgcc_s-%{gcc_version}-%{DATE}.so.1 $RPM_BUILD_ROOT/%{_lib}/libgcc_s.so.1
+ln -sf ../../%{_lib}/libgcc_s.so.1 $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libgcc_s.so
+#ln -sf `echo "%{_prefix}" | sed 's~/[^/]*~\.\./~g'`../%{_lib}/libgcc_s.so.1 \
+# $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libgcc_s.so
+#mv -f $FULLPATH/libobjc.so.1* $RPM_BUILD_ROOT%{_prefix}/%{_lib}/
+%if %{build_ada}
+mv -f $FULLPATH/adalib/libgnarl-*.so.* $RPM_BUILD_ROOT%{_prefix}/%{_lib}/
+mv -f $FULLPATH/adalib/libgnat-*.so.* $RPM_BUILD_ROOT%{_prefix}/%{_lib}/
+rm -f $FULLPATH/adalib/libgnarl.so* $FULLPATH/adalib/libgnat.so*
+%endif
+pushd $FULLPATH
+if [ "%{_lib}" = "lib" ]; then
+ln -sf ../../../libobjc.so.1 libobjc.so
+ln -sf ../../../libstdc++.so.5.* libstdc++.so
+ln -sf ../../../libgcj.so.3.* libgcj.so
+ln -sf ../../../libg2c.so.0.* libg2c.so
+%if %{build_ada}
+cd adalib
+ln -sf ../../../../libgnarl-*.so.* libgnarl.so
+ln -sf ../../../../libgnat-*.so.* libgnat.so
+cd ..
+%endif
+else
+ln -sf ../../../../%{_lib}/libobjc.so.1 libobjc.so
+ln -sf ../../../../%{_lib}/libstdc++.so.5.* libstdc++.so
+ln -sf ../../../../%{_lib}/libgcj.so.3.* libgcj.so
+ln -sf ../../../../%{_lib}/libg2c.so.0.* libg2c.so
+%if %{build_ada}
+cd adalib
+ln -sf ../../../../../%{_lib}/libgnarl-*.so.* libgnarl.so
+ln -sf ../../../../../%{_lib}/libgnat-*.so.* libgnat.so
+cd ..
+%endif
+fi
+mv -f $RPM_BUILD_ROOT%{_prefix}/lib/libstdc++.*a .
+mv -f $RPM_BUILD_ROOT%{_prefix}/lib/libsupc++.*a .
+mv -f $RPM_BUILD_ROOT%{_prefix}/lib/libg2c.*a .
+mv -f $RPM_BUILD_ROOT%{_prefix}/lib/libfrtbegin.*a .
+mv -f $RPM_BUILD_ROOT%{_prefix}/lib/libobjc.*a .
+# Strip debug info from Fortran/ObjC/Java static libraries
+%{__strip} -g libg2c.a libobjc.a libgcj.a
+# Fix up .la files
+for i in *.la; do
+ sed -e '/^libdir/s_%{_prefix}/lib_%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}_' \
+ -e '/^dependency_libs/s_%{_prefix}/lib_%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}_' \
+ -e '/^dependency_libs/s~'\''$~ '\''~' \
+ -e '/^dependency_libs/s~[ ][ ]*~ ~g' \
+ -e '/^dependency_libs/s~-L[^ ]* ~~g' \
+ -e '/^dependency_libs/s~-lgcc_s -lgcc -lc -lgcc_s -lgcc ~~g' \
+ -e '/^dependency_libs/s~-lgcc -lc -lgcc ~~g' \
+ -e '/^dependency_libs/s~-lc ~~g' \
+ -e '/^dependency_libs/s~-lm \(-lm \)*~-lm ~g' \
+ $i > $i.tmp
+ mv -f $i.tmp $i
+done
+popd
+chmod 755 $RPM_BUILD_ROOT%{_prefix}/lib/libg2c.so.0.*
+chmod 755 $RPM_BUILD_ROOT%{_prefix}/lib/libobjc.so.1.*
+%if %{build_ada}
+chmod 755 $RPM_BUILD_ROOT%{_prefix}/lib/libgnarl*so*
+chmod 755 $RPM_BUILD_ROOT%{_prefix}/lib/libgnat*so*
+%endif
+
+cat > $RPM_BUILD_ROOT%{_prefix}/bin/c89 <<"EOF"
+#!/bin/sh
+fl="-std=c89"
+for opt; do
+ case "$opt" in
+ -ansi|-std=c89|-std=iso9899:1990) fl="";;
+ -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
+ exit 1;;
+ esac
+done
+exec %{_prefix}/bin/gcc $fl ${1+"$@"}
+EOF
+cat > $RPM_BUILD_ROOT%{_prefix}/bin/c99 <<"EOF"
+#!/bin/sh
+fl="-std=c99"
+for opt; do
+ case "$opt" in
+ -std=c99|-std=iso9899:1999) fl="";;
+ -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
+ exit 1;;
+ esac
+done
+exec %{_prefix}/bin/gcc $fl ${1+"$@"}
+EOF
+chmod 755 $RPM_BUILD_ROOT%{_prefix}/bin/c?9
+
+cd ..
+%find_lang %{name}
+
+%if %{cross_compile}
+# Install syslimits.h for canadian cross compile.
+pushd $RPM_BUILD_DIR/gcc-%{gcc_version}-%{DATE}/obj-%{_target_platform}
+cp -af ../gcc/gsyslimits.h $FULLPATH/include/syslimits.h
+# Fix the specs file.
+cat gcc/specs |
+awk '
+BEGIN {
+ cross=0;
+}
+/cross_compile/ { print; cross = 1; next; }
+/^1$/ {
+ if (cross == 0) {
+ print;
+ }
+ else {
+ cross = 0;
+ print "0";
+ }
+ next;
+}
+{ print; }
+' > $FULLPATH/specs
+popd
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/install-info \
+ --info-dir=%{_infodir} %{_infodir}/gcc.info.gz
+
+%preun
+if [ $1 = 0 ]; then
+ /sbin/install-info --delete \
+ --info-dir=%{_infodir} %{_infodir}/gcc.info.gz
+fi
+
+%post -n cpp
+/sbin/install-info \
+ --info-dir=%{_infodir} %{_infodir}/cpp.info.gz
+
+%preun -n cpp
+if [ $1 = 0 ]; then
+ /sbin/install-info --delete \
+ --info-dir=%{_infodir} %{_infodir}/cpp.info.gz
+fi
+
+%post g77
+/sbin/install-info \
+ --info-dir=%{_infodir} %{_infodir}/g77.info.gz
+
+%preun g77
+if [ $1 = 0 ]; then
+ /sbin/install-info --delete \
+ --info-dir=%{_infodir} %{_infodir}/g77.info.gz
+fi
+
+%post java
+/sbin/install-info \
+ --info-dir=%{_infodir} %{_infodir}/gcj.info.gz
+
+%preun java
+if [ $1 = 0 ]; then
+ /sbin/install-info --delete \
+ --info-dir=%{_infodir} %{_infodir}/gcj.info.gz
+fi
+
+%post gnat
+/sbin/install-info \
+ --info-dir=%{_infodir} %{_infodir}/gnat_rm.info.gz
+/sbin/install-info \
+ --info-dir=%{_infodir} %{_infodir}/gnat_ug.info.gz
+
+%preun gnat
+if [ $1 = 0 ]; then
+ /sbin/install-info --delete \
+ --info-dir=%{_infodir} %{_infodir}/gnat_rm.info.gz
+ /sbin/install-info --delete \
+ --info-dir=%{_infodir} %{_infodir}/gnat_ug.info.gz
+fi
+
+%post -n libgcc -p /sbin/ldconfig
+
+%postun -n libgcc -p /sbin/ldconfig
+
+%post -n libstdc++ -p /sbin/ldconfig
+
+%postun -n libstdc++ -p /sbin/ldconfig
+
+%post -n libobjc -p /sbin/ldconfig
+
+%postun -n libobjc -p /sbin/ldconfig
+
+%post -n libgcj -p /sbin/ldconfig
+
+%postun -n libgcj -p /sbin/ldconfig
+
+%post -n libf2c -p /sbin/ldconfig
+
+%postun -n libf2c -p /sbin/ldconfig
+
+%post -n libgnat -p /sbin/ldconfig
+
+%postun -n libgnat -p /sbin/ldconfig
+
+%files -f %{name}.lang
+%defattr(-,root,root)
+%{_prefix}/bin/cc
+%{_prefix}/bin/c89
+%{_prefix}/bin/c99
+%{_prefix}/bin/gcc
+%{_prefix}/bin/gcov
+%if !%{cross_compile}
+%{_prefix}/bin/protoize
+%{_prefix}/bin/unprotoize
+%endif
+%{_prefix}/bin/%{_target_platform}-gcc
+%{_mandir}/man1/gcc.1*
+%{_mandir}/man1/gcov.1*
+%{_infodir}/gcc*
+%dir %{_prefix}/lib/gcc-lib
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/stddef.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/stdarg.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/varargs.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/float.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/limits.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/stdbool.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/iso646.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/syslimits.h
+%ifarch %{ix86} x86_64
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/mmintrin.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/xmmintrin.h
+%endif
+%ifarch ia64
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/ia64intrin.h
+%endif
+%ifarch ppc
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/ppc-asm.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/altivec.h
+%endif
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/README
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/cc1
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/collect2
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/crt*.o
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libgcc.a
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libgcc_eh.a
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/specs
+%{_prefix}/%{_lib}/libgcc_s.so
+%doc gcc/README* gcc/*ChangeLog*
+
+%if !%{gcconly}
+%files -n cpp
+%defattr(-,root,root)
+/lib/cpp
+%endif
+%{_prefix}/bin/cpp
+%{_mandir}/man1/cpp.1*
+%{_infodir}/cpp*
+%dir %{_prefix}/lib/gcc-lib
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/cpp0
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/tradcpp0
+
+%files -n libgcc
+%defattr(-,root,root)
+/%{_lib}/libgcc_s-%{gcc_version}-%{DATE}.so.1
+/%{_lib}/libgcc_s.so.1
+
+%if !%{gcconly}
+%files c++
+%defattr(-,root,root)
+%{_prefix}/bin/%{_target_platform}-*++
+%{_prefix}/bin/g++
+%{_prefix}/bin/c++
+%{_prefix}/bin/c++filt
+%{_mandir}/man1/g++.1*
+%dir %{_prefix}/lib/gcc-lib
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/cc1plus
+%doc gcc/cp/ChangeLog*
+
+%files -n libstdc++
+%defattr(-,root,root)
+%{_prefix}/%{_lib}/libstdc++.so.5*
+
+%files -n libstdc++-devel
+%defattr(-,root,root)
+%{_prefix}/include/c++
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libstdc++.so
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libstdc++.a
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libsupc++.a
+%doc libstdc++-v3/ChangeLog* libstdc++-v3/README* libstdc++-v3/docs/html/
+
+%files objc
+%defattr(-,root,root)
+%dir %{_prefix}/lib/gcc-lib
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/objc
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/cc1obj
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libobjc.a
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libobjc.so
+%doc rpm.doc/objc/*
+%doc libobjc/THREADS* libobjc/ChangeLog
+
+%files -n libobjc
+%defattr(-,root,root)
+%{_prefix}/%{_lib}/libobjc.so.1*
+
+%files g77
+%defattr(-,root,root)
+%{_prefix}/bin/g77
+%{_prefix}/bin/f77
+%{_mandir}/man1/g77.1*
+%{_infodir}/g77*
+%dir %{_prefix}/lib/gcc-lib
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/f771
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libfrtbegin.a
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libg2c.a
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libg2c.so
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/g2c.h
+%doc gcc/f/README rpm.doc/g77/*
+
+%files -n libf2c
+%defattr(-,root,root)
+%{_prefix}/%{_lib}/libg2c.so.0*
+
+%files java
+%defattr(-,root,root)
+%{_prefix}/bin/gcj
+%{_prefix}/bin/gcjh
+%{_prefix}/bin/jcf-dump
+%{_prefix}/bin/jv-scan
+%{_mandir}/man1/gcj.1*
+%{_mandir}/man1/gcjh.1*
+%{_mandir}/man1/jcf-dump.1*
+%{_mandir}/man1/jv-scan.1*
+%{_infodir}/gcj*
+%dir %{_prefix}/lib/gcc-lib
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/jc1
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/jvgenmain
+%doc gcc/java/ChangeLog*
+
+%files -n libgcj
+%defattr(-,root,root)
+%{_prefix}/bin/jv-convert
+%{_prefix}/bin/gij
+%{_prefix}/bin/jar
+%{_prefix}/bin/grepjar
+%{_prefix}/bin/rmic
+%{_prefix}/bin/rmiregistry
+%{_mandir}/man1/jv-convert.1*
+%{_mandir}/man1/gij.1*
+%{_mandir}/man1/rmic.1*
+%{_mandir}/man1/rmiregistry.1*
+%{_prefix}/%{_lib}/libgcj.so.*
+%{_prefix}/share/java
+%{_prefix}/lib/security
+
+%files -n libgcj-devel
+%defattr(-,root,root)
+%{_prefix}/bin/addr2name.awk
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libgcj.a
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libgcj.so
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/libgcj.spec
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/gc*.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/j*.h
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/java
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/javax
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/gnu
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/gcj
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/include/org
+%doc rpm.doc/boehm-gc/* rpm.doc/fastjar/* rpm.doc/libffi/*
+%doc rpm.doc/libjava/*
+
+%if %{build_ada}
+%files gnat
+%defattr(-,root,root)
+%{_prefix}/bin/gnat*
+%{_infodir}/gnat*
+%dir %{_prefix}/lib/gcc-lib
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}
+%dir %{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/adainclude
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/adalib
+%{_prefix}/lib/gcc-lib/%{_target_platform}/%{gcc_version}/gnat1
+%doc gcc/ada/ChangeLog
+
+%files -n libgnat
+%defattr(-,root,root)
+%{_prefix}/%{_lib}/libgnat-*.so.*
+%{_prefix}/%{_lib}/libgnarl-*.so.*
+%endif
+%endif
+
+%changelog
+* Tue Sep 3 2002 Bill Nottingham <notting@redhat.com> 3.2-7
+- fix calling of C++ destructors in certain cases
+
+* Tue Sep 3 2002 Jakub Jelinek <jakub@redhat.com> 3.2-6
+- update from CVS (but revert C++ tail padding patches
+ for now)
+- further fixes to make libstdc++-v3 build on glibc 2.3
+- run libstdc++-v3 make check-abi on IA-32 during testing
+
+* Fri Aug 30 2002 Jakub Jelinek <jakub@redhat.com> 3.2-5
+- disable tail copy patches, they seem to still have problems
+- make libstdc++-v3 build on glibc 2.3 (and use thread-local
+ locale model)
+- fix c89 and c99 scripts (#73104)
+
+* Wed Aug 26 2002 Jakub Jelinek <jakub@redhat.com> 3.2-4
+- reorder alpha_encode_section_info checks slightly to fix an ICE
+ when building glibc and to take better advantage of visibility
+ attribute on Alpha
+- as gdb is not there yet, disable -momit-leaf-frame-pointer
+ by default for now on IA-32
+- fix IA-64 bootstrap with tail padding patch (Jason Merrill, Daniel Berlin)
+- fix x86-64 %RIP to %rip, only output (%rip) if no other relocation
+ is used (Richard Henderson)
+
+* Fri Aug 23 2002 Jakub Jelinek <jakub@redhat.com> 3.2-3
+- take advantage of __attribute__((visibility())) on Alpha
+- avoid copying tail padding (Jason Merrill)
+
+* Thu Aug 22 2002 Jakub Jelinek <jakub@redhat.com> 3.2-2
+- fixed Dwarf2 DW_OP_GNU_push_tls_address patch from Richard Henderson
+- don't mention removed -a and -ax options in the documentation
+ (Nathan Sidwell, #72233)
+- fixed __typeof() followed by __asm() redirection from Alexandre Oliva
+
+* Wed Aug 14 2002 Jakub Jelinek <jakub@redhat.com> 3.2-1
+- update to 3.2 release
+- fix x86-64 PR target/7559 (Jan Hubicka)
+- fix -fprefetch-loop-arrays (Janis Johnson)
+- fix x86-64 prefetch (Jan Hubicka)
+
+* Fri Aug 9 2002 Jakub Jelinek <jakub@redhat.com> 3.2-0.3
+- istream fix (Benjamin Kosnik)
+- emit Dwarf2 DW_OP_GNU_push_tls_address extension for TLS (Richard Henderson)
+- temporarily disable __typeof() + __asm() fix
+
+* Thu Aug 8 2002 Jakub Jelinek <jakub@redhat.com> 3.2-0.2
+- update from 3.2 branch
+ - ABI incompatible changes in libstdc++.so.5, long long bitfield
+ layout on IA-32 (both C and C++), oversized bitfields layout
+ on IA-32 and bitfields with base type with __attribute__((aligned ()))
+ - fix strstream segfaults (#68292, Benjamin Kosnik)
+- fix __attribute__((visibility())) together with __asm__()
+ function redirection
+- fix __typeof() followed by __asm() redirection (Alexandre Oliva)
+- fix TLS ICE on glibc (#70061)
+- fix K6 ICE on linux kernel (#69989, Richard Sandiford, Jan Hubicka)
+- fix inlining bug with labels (#70941)
+- fix fold-const bug (#70541)
+- fix PR preprocessor/7358 (Neil Booth)
+- error when mixing __thread and non-__thread declarations
+ (#70059, Aldy Hernandez)
+- fix TLS bug on g++.dg/tls/diag-1.C (Jason Merrill)
+- add -mcmodel= x86-64 documentation (Andreas Jaeger)
+- avoid TLS emitting movl %gs:0, MEMORY on IA-32 (#71033)
+
+* Mon Jul 22 2002 Jakub Jelinek <jakub@redhat.com> 3.2-0.1
+- first attempt for gcc 3.2
+- remove .la files
+
+* Sat Jul 20 2002 Jakub Jelinek <jakub@redhat.com> 3.1-10
+- update from 3.1 branch
+ - add throw() to set_new_handler (Andreas Schwab)
+ - fixed PR optimization/7147, optimization/7153
+- make sure pic register is set up even when the only @PLT calls
+ are done in EH basic blocks (Richard Henderson)
+
+* Sun Jul 14 2002 Jakub Jelinek <jakub@redhat.com> 3.1-9
+- define %%_gnu to nothing for compatibility
+
+* Sat Jul 13 2002 Jakub Jelinek <jakub@redhat.com> 3.1-8
+- update from 3.1 branch
+ - fix OpenOffice miscompilation (PR c++/7279, Jason Merrill)
+ - PRs c++/7224, c++/6255, optimization/7145, c++/6706, preprocessor/7070,
+ middle-end/6963, target/6841, target/6770, target/6719,
+ other/6836, libstdc++/7057, libstdc++/7097, libstdc++/3946,
+ libstdc++/7173
+ - fix a GC bug with named labels in C++ (Jim Wilson)
+ - fix ICE on Mesa (Bernd Schmidt, #65771)
+- added some NRV tests
+- fix typo in i386 specs (PR c/7242)
+- fix IA-32 ICE with shifts by negative values followed by compare
+ (PR middle-end/7245, #68395)
+- fixed DWARF-2 output for const char * (PR debug/7241)
+- actually enable __cxa_atexit for standard compliance at configury time
+- added PPC as Ada enabled architecture
+
+* Wed Jun 19 2002 Jakub Jelinek <jakub@redhat.com> 3.1-7
+- update from 3.1 branch
+ - PRs target/6922, opt/6722, c/7030, c/6677, objc/6834, c++/6892,
+ c++/6723, opt/6793
+- use __cxa_atexit for standard compliance:
+ if your C++ project knows it won't call atexit from within its
+ static constructors, use -fno-use-cxa-atexit to optimize it
+- share hard register rtxs where possible to speed the compiler up (Jeff Law)
+- optimize tree_code_* arrays (Kaveh Ghazi)
+- don't link prefix.o into libgnat, link libgnat against libgcc_s and
+ libgnarl against libgnat
+- fix typo in GNAT %%post (#66847, #66941, #66639)
+- add TLS support
+
+* Fri Jun 7 2002 Jakub Jelinek <jakub@redhat.com> 3.1-6
+- add GNAT
+- remove DT_RPATH from Java binaries (#66103)
+- obsolete kaffe, install jar as %{_prefix}/bin/jar
+- add include/org directory in java
+- add rmic and rmiregistry programs to libgcj
+- add info documentation for gcj and various man pages
+- add message catalogues for da, el, es, fr, ja, nl, sv, tr
+- don't put IA-64 vtables with relocations into read-only sections
+ with -fpic
+
+* Tue Jun 4 2002 Jakub Jelinek <jakub@redhat.com> 3.1-5
+- update from 3.1 branch
+ - PRs optimization/6822, preprocessor/6844, target/6838, target/6788,
+ libstdc++/6886, libstdc++/6795, libstdc++/6811
+- m$ compatibility for unnamed fields as typedef of struct/union
+ (PR c/6660)
+- fix -fverbose-asm with unnamed fields (PR c/6809)
+- fix -mmmx ICE (PR optimization/6842)
+- default to -momit-leaf-frame-pointer on i386 (Richard Henderson)
+- use linkonce section/hidden symbol for i686 pic getpc thunks
+ (Richard Henderson)
+
+* Tue May 28 2002 Jakub Jelinek <jakub@redhat.com> 3.1-4
+- rebuilt
+
+* Sat May 25 2002 Jakub Jelinek <jakub@redhat.com> 3.1-3
+- update from 3.1 branch
+ - PRs other/6782, preprocessor/6780, preprocessor/6517,
+ libstdc++/6282, libstdc++/6701, libstdc++/6701
+ - fix out << "" bug (Ben Kosnik, #65409, PR libstdc++/6750)
+- 3 new patches
+ - fix C++ __PRETTY_FUNCTION__ (PR c++/6794)
+ - fix ICE on jikes (#65379)
+ - add test for fixed mozilla miscompilation
+- include intrinsic headers on IA-32/x86-64, include altivec.h on PPC
+
+* Wed May 22 2002 Jakub Jelinek <jakub@redhat.com> 3.1-2
+- update from 3.1 branch
+- 8 new patches
+ - fix as version test for 2.12.1 and newer binutils non-CVS releases
+ - fix ICE in do_subst (#65049)
+ - fix SSE conditional move (PR target/6753)
+ - fix SPARC CSE ICE (PR optimization/6759)
+ - fix x86_64 dbx64_register_map typo (Jan Hubicka)
+ - fix DWARF-2 with flag_asynchronous_unwind_tables set for leaf
+ functions (Jan Hubicka)
+ - fix DWARF-2 x86_64 __builtin_dwarf_reg_sizes (Jan Hubicka)
+ - fix x86_64 movabsdi (Michael Matz)
+
+* Wed May 15 2002 Jakub Jelinek <jakub@redhat.com> 3.1-1
+- update to 3.1 final
+- 15 new patches
+ - fix PR c/6643
+ - fix fold-const.c typo
+ - fix unitialized pointer-to-member values (Alexandre Oliva)
+ - fix templates with asm inputs (Jason Merrill)
+ - fix -fdata-section (Andreas Schwab)
+ - readd warning about i386 -malign-double into documentation (Jan Hubicka)
+ - fix PR libstdc++/6594 (Ben Kosnik)
+ - fix PR PR libstdc++/6648 (Paolo Carlini)
+ - fix libstdc++ testsuite rlimits (Rainer Orth)
+ - s390 java support (Gerhard Tonn)
+ - rotate testcases (Tom Rix)
+ - build libiberty with -fpic on x86_64 (Andreas Schwab)
+ - fix x86_64 multilib build (Bo Thorsen)
+ - fix x86_64 ASM_OUTPUT_MI_THUNK (Jan Hubicka)
+ - fix loop-2[cd].c tests on i386 (Eric Botcazou)
+- fix typo in g77 info files tweaking
+- fix libgcj.so symlink
+
+* Thu May 9 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.28
+- update to CVS 3.1 branch
+ - PR c++/6212, target/6429, opt/6534, c/6543, target/6561, c/6569
+- fix x86_64 q_regs_operand (Jan Hubicka)
+- better PR c++/6381 fix (Jason Merrill)
+
+* Fri May 3 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.27
+- update to CVS 3.1 branch
+ - PR target/5628, libstdc++/5820, c++/6396, preprocessor/6489,
+ libstdc++/6501, libstdc++/6511, target/6512, libstdc++/6513,
+ bootstrap/6514, opt/6516, bootstrap/6525, c++/6527, libstdc++/6533,
+ target/6540
+- fix PR target/6542, target/6522, libstdc++/6549
+
+* Mon Apr 29 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.26
+- update to CVS 3.1 branch
+ - PR c/3581, libstdc++/4150, libstdc++/4164, c/5154, c/5430, c++/5504,
+ c++/5658, c++/5719, f/6138, libgcj/6158, middle-end/6205, c++/6256,
+ c/6300, c++/6331, c/6343, c/6344, c++/6352, c/6358, libstdc++/6360,
+ c++/6395, target/6413, libstdc++/6414, target/6422, bootstrap/6445,
+ optimization/6475, target/6476, c++/6477, c++/6479, c++/6486, c++/6492,
+ target/6494, target/6496, c/6497, target/6500
+- fix PR c++/6396
+- run make check as part of build process
+
+* Thu Apr 18 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.25
+- update to CVS 3.1 branch
+ - PR opt/420, c++/525, target/817, target/1538, opt/3967, target/3997,
+ opt/4120, bootstrap/4191, opt/4311, optimization/4328, c++/4884, c++/4934,
+ c/5078, c++/5104, opt/5120, c++/5189, c++/5373, target/5446, c/5484,
+ c++/5507, c++/5571, c++/5636, target/5672, target/5715, target/5886,
+ c++/5933, c++/5964, c++/5998, opt/6007, target/6032, target/6041,
+ target/6054, c++/6073, target/6082, optimization/6086, target/6087,
+ middle-end/6096, middle-end/6098, middle-end/6099, middle-end/6100,
+ middle-end/6102, fortran/6106, c++/6119, opt/6165, optimization/6177,
+ c++/6179, optimization/6189, c/6202, c/6223, optimization/6233,
+ middle-end/6279, c/6290, optimization/6305, target/6305, bootstrap/6315,
+ c++/6320...
+- fix PR c++/6316
+
+* Wed Mar 27 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.24
+- update to CVS 3.1 branch
+ - PRs c/5656, c/5972, bootstrap/4192, target/4792, bootstrap/4195,
+ optimization/5854, target/6043, c++/6037, bootstrap/4128, target/5740,
+ c/5597, optimization/5863, optimization/5742, target/3177, c/5354,
+ optimization/5999, target/5977, middle-end/5731, target/5312...
+
+* Fri Mar 15 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.23.1
+- fix info and man page generation
+
+* Thu Mar 14 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.23
+- update to CVS 3.1 branch
+ - fix IA-64 packet selection (PR optimization/5892)
+ - make highest_pow2_factor work for all constants (PR middle-end/5877)
+ - fix -Wunused (#61047)
+ - fix loop on mixed mode class assignments (#60923)
+ - fix wide character literals
+ - support SPARC v9 long distance branches (PR target/5626)
+ - fix SPARC leaf functions
+ - fix a rtl sharing problem (Richard Henderson, #60760,
+ PR optimization/5844)
+ - fix va_arg with variable size types (PR c/3711)
+ - PRs optimization/5901, optimization/5878, 5693, preprocessor/5899
+- fix C++ ?: at the end of stmt expr (PR c++/5373)
+- fix loop unrolling with sibcalls (PR optimization/5891)
+
+* Thu Mar 7 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.22
+- update to CVS 3.1 branch
+ - fix ICE with volatile long long (#60650)
+ - fix tempbuf.h (Philipp Thomas, #60212)
+ - fix -fssa-ccp (Jeff Law, #60651)
+ - versioned libstdc++
+ - backport __attribute__((visibility("..."))) patches from trunk
+- include libstdc++ html documentation
+
+* Tue Feb 5 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.21
+- update to CVS HEAD
+ - fix demangler (H.J. Lu, #59300, #59310)
+ - fix typo in IA-32 specs file (#59081)
+ - support moving SFmode values in MMX regs if -mmmx (#59083)
+ - fix recog_for_combine (#59084)
+ - don't ICE when inserting insns on edge from bb0 to bb0 (Bernd Schmidt,
+ #59087)
+ - make sure configure has not time in the future (#59203)
+ - fix division/modulo by certain constants (#58065, PR c/5304)
+ - fix -Wswitch (PR c/4475)
+
+* Thu Jan 31 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.20
+- update to CVS HEAD
+ - fix jar (Tom Tromey)
+ - fix loop unrolling (Richard Henderson)
+
+* Wed Jan 30 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.19
+- update to CVS HEAD
+ - fix a reload bug on ia32 (#58579, #58648)
+ - issue error about unknown -W* options (#58909)
+ - fix ia64 libbfd miscompilation (#58694)
+ - register all pending unparsed_text structures with GC (#58647)
+ - fix __builtin_apply with ia32 -msse (#58447)
+ - prevent ia64 prologue insns saving regs required for eh from being
+ deleted (#58387)
+
+* Tue Jan 15 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.18
+- update to CVS HEAD
+ - handle static x[] = { [X...Y] = (foo) { Z } } (#58338)
+ - fix getdents.os miscompilation (Richard Henderson, #58308)
+ - fix ICE in try_forward_edges (#58125)
+ - fix ICE with -fexceptions -foptimize-sibling-calls
+
+* Tue Jan 8 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.17
+- avoid division by 0 when computing prediction probabilities (#57992)
+- fix ICE due to store_expr not adjusting value back for mode
+- increase -ftemplate-depth default value to 500
+
+* Mon Jan 7 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.16
+- if using PT_GNU_EH_FRAME registry, work around assembler bug resp. feature
+ and don't provide weak prototypes of functions which won't be used
+- on Alpha, fix a typo so that crtbeginT.o is built and installed
+- fix glibc inl-tester miscompilation on ia32
+
+* Sun Jan 6 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.15
+- update to CVS HEAD (fix glibc bootstrap failure)
+
+* Thu Jan 3 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.14
+- update to CVS HEAD (#57907)
+ - fix alpha bootstrap (Richard Henderson)
+- fix simplification of (div:SI (???:DI ???) (const_int 1))
+ (#57916)
+- add contrib/gcc_update --touch
+
+* Tue Jan 1 2002 Jakub Jelinek <jakub@redhat.com> 3.1-0.13
+- update to CVS HEAD (fix glibc miscompilation on alpha)
+- fix objc to not emit __objc_class_name_* without type and size
+
+* Mon Dec 31 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.12
+- update to CVS HEAD
+- fix sed commands for .la files
+- make Alpha use PT_GNU_EH_FRAME
+
+* Thu Dec 27 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.11
+- update to CVS HEAD (#57165, #57212, #57467, #57488, #57502,
+ #57505, #57574)
+- readd .la files after fixing them up by sed
+- add %%defattr(-,root,root) to libobjc subpackage
+
+* Mon Dec 3 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.10
+- one more gcc.spec fix for passing --gdwarf-2 resp. --gstabs to as
+- fix conditional register dead computation on IA-64
+- fix extern array of incomplete structures handling
+- fix gcc -xc -
+- fix Fortran ICEs with SAVE_EXPRs (Richard Kenner)
+
+* Tue Nov 27 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.9
+- update to CVS HEAD
+- make DWARF 2 preferred debugging format on Linux
+
+* Mon Nov 12 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.8
+- don't ship .la files (#56072)
+- include libfrtbegin.a (#56098)
+
+* Mon Nov 12 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.7
+- update to CVS HEAD
+- back out Nov 7th loop.c change for now
+
+* Fri Nov 9 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.6
+- update to CVS HEAD
+- frame unwind compatibility with 7.[12] binutils
+
+* Tue Nov 6 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.5
+- update to CVS HEAD
+- merge DW_EH_PE_indirect constants and their relocs
+
+* Thu Oct 25 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.4
+- don't loop forever or ICE on bogus array initializers (#53704)
+- fix store motion with pure calls
+- disable store motion for now
+
+* Tue Oct 23 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.3
+- fix inlining of C nested functions with auto prototypes
+
+* Mon Oct 22 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.2
+- update to CVS HEAD
+- tree inlining fix from Alexandre Oliva
+- fix anonymous union ICE on alpha
+
+* Mon Oct 15 2001 Jakub Jelinek <jakub@redhat.com> 3.1-0.1
+- switch package to main compiler from alternate compiler
+- update to CVS HEAD
+- early gcc-2.96-RH compatibility in __frame_state_for
+- change weak function tests for functions always present in GLIBC 2.2
+ into simple non-weak calls in crt*.o to avoid unnecessary symbol
+ lookups and prelink conflicts
+- don't link against libgcc_s C shared libraries
+
+* Tue Oct 2 2001 Jakub Jelinek <jakub@redhat.com> 3.0.1-4
+- update from CVS 3.0 branch
+ - ia64 function descriptors in vtables
+- handle large files in Fortran (#53328)
+- allow Java programs to be statically linked (#53605)
+- remove #include_next patch, Benjamin commited it
+
+* Thu Sep 6 2001 Jakub Jelinek <jakub@redhat.com> 3.0.1-3
+- don't use #include_next in <bits/std_c*> headers (Benjamin Kosnik, #53262)
+
+* Wed Sep 5 2001 Jakub Jelinek <jakub@redhat.com> 3.0.1-2
+- update from CVS 3.0 branch
+- check all gcc-2.96-RH patches whether they have made it into 3.0.1,
+ and if not, whether they are appropriate for 3.0.1
+- 8 new patches
+ - add 36 testcases from gcc-2.96-RH
+ - fix ICE on very questionable C++ code from JDK (#39858, #52960)
+ - fix -frepo (Nathan Sidwell, #52877)
+ - avoid generating bogus .stabs (#49214)
+ - issue a clear error message about invalid ia32 floating point
+ asm constraints (#27137)
+ - fix some comment typos
+ - fix ADDRESSOF recognition (#29686)
+
+* Mon Aug 27 2001 Jakub Jelinek <jakub@redhat.com> 3.0.1-1
+- update from CVS (3.0.1 final)
+- properly handle throw() exception specifiers in template decls (#51824)
+- fix IA-64 varargs handling in presence of additional anonymous arguments
+ (#50757)
+- fix boehm-gc for prelink
+- fix a typo in gcc3-c++ description (#52323)
+- remove Chill from package summary (#51764)
+
+* Tue Aug 7 2001 Jakub Jelinek <jakub@redhat.com> 3.0-6
+- update from CVS
+ - fix glibc vfprintf miscompilation
+- don't warn about if (&foo) if foo is weak (H.J.Lu, #50855)
+
+* Wed Jul 25 2001 Jakub Jelinek <jakub@redhat.com> 3.0-5
+- include libgcjgc.a in libgcj3-devel
+- include libgcjgc.so.* in libgcj3 on ia64
+- remove dependency on libgcj on ia64
+- add ldconfig to libgcj3 post/postun
+
+* Tue Jul 24 2001 Jakub Jelinek <jakub@redhat.com> 3.0-4
+- update from CVS
+- make gcc3-java/libgcj3* packages, so that they can coexist
+ with 2.96-RH Java
+- make sure shared Java libraries are built with proper dependencies
+
+* Wed Jul 11 2001 Jakub Jelinek <jakub@redhat.com> 3.0-3
+- fix libgcc_s.so and libstdc++.so symlinks
+- don't ship jar
+
+* Tue Jul 10 2001 Jakub Jelinek <jakub@redhat.com> 3.0-2
+- move libstdc++.so into gcc-lib
+- add libobjc.so symlink
+
+* Tue Jul 10 2001 Jakub Jelinek <jakub@redhat.com> 3.0-1
+- new rpm
diff --git a/patches/gcc/3.2.3/README-sh b/patches/gcc/3.2.3/README-sh
new file mode 100644
index 0000000..a75042a
--- /dev/null
+++ b/patches/gcc/3.2.3/README-sh
@@ -0,0 +1,16 @@
+http://mirror.sh-linux.org/rpm-2003/SRPMS/gcc-3.2.3-3.src.rpm contains the following patches:
+
+gcc-20030210-sh-linux-1.patch
+gcc-3.2.3-libffi-1.patch
+gcc-3.2.3-sh-linux-dwarf2-1.patch (*not* applied by the spec file, it's in there by accident)
+
+gcc-3.2.3-libffi-1.patch was needed just to build, I think.
+
+After that was applied, sh4 gcc seemed to compile fine, but c++ programs
+failed to execute because libstdc++.so.5 was built without version
+info. This was caused directly by libstdc++-v3/configure setting
+SYMVER_MAP=config/linker-map.dummy because it sees that
+no libgcc_s.so was generated; configure says
+ checking for shared libgcc... no.
+
+Applying gcc-20030210-sh-linux-1.patch in hopes it makes those problems go away.
diff --git a/patches/gcc/3.2.3/config.sub.patch b/patches/gcc/3.2.3/config.sub.patch
new file mode 100644
index 0000000..928f911
--- /dev/null
+++ b/patches/gcc/3.2.3/config.sub.patch
@@ -0,0 +1,72 @@
+When configuring a s390->s390 or cris->cris crosscompiler
+(ok, I haven't hit this yet, but one of these days I'll get me an account
+on an s390, and then I'll need this patch :-), you'll get the
+following error:
+
++ /build/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/gcc-3.3/configure
+--target=s390-unknown-linux-gnu --host=s390-host_unknown-linux-gnu
+--prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2
+--enable-languages=c
+--with-local-prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/s390-
+unknown-linux-gnu --enable-threads=no --without-headers --with-newlib
+--disable-shared
+...
+*** --with-headers is only supported when cross compiling
+
+This error pops up only when you're using Daniel Jacobowitz's technique
+of slightly changing the target and host tuples to make them different
+enough to force gcc's build system to not try to pull in system libraries
+or headers. This technique is needed e.g. to build an x86 -> x86
+cross-compiler.
+(The LFS developers ran into the same bug that prompted me to use
+this technique; they point people who run into it to
+http://linuxfromscratch.org/~greg/pure_lfs.txt, which is a different
+way of avoiding this problem. I think the tuple tweak is the way to go, though.)
+
+config-patches@gnu.org rejected this patch, on the grounds that there
+is only one vendor of each of those two architectures, so the
+canonicalization is by definition correct. When I pointed out the
+difficulty this causes for people building s390 -> s390 or
+cris -> cris compilers that are incompatible with the system
+libraries and thus must be built like cross-compilers, he grumped and said
+"autoconf should let you specify a cross-compiler in some other way than
+comparing tuple strings".
+
+
+
+--- gcc-3.3/config.sub.old Sun Jun 8 20:38:47 2003
++++ gcc-3.3/config.sub Sun Jun 8 20:40:34 2003
+@@ -433,9 +433,12 @@
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+- cris | cris-* | etrax*)
++ cris | etrax*)
+ basic_machine=cris-axis
+ ;;
++ cris-*)
++ basic_machine=cris-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+@@ -820,11 +823,17 @@
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+- s390 | s390-*)
++ s390)
+ basic_machine=s390-ibm
+ ;;
+- s390x | s390x-*)
++ s390-*)
++ basic_machine=s390-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ s390x)
+ basic_machine=s390x-ibm
++ ;;
++ s390x-*)
++ basic_machine=s390x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
diff --git a/patches/gcc/3.2.3/gcc-20020722-ppc405erratum77.patch b/patches/gcc/3.2.3/gcc-20020722-ppc405erratum77.patch
new file mode 100644
index 0000000..bd717f5
--- /dev/null
+++ b/patches/gcc/3.2.3/gcc-20020722-ppc405erratum77.patch
@@ -0,0 +1,105 @@
+# See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html
+# Fixed in gcc-3.3
+
+diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h
+--- gcc-20020722.orig/gcc/config/rs6000/rs6000.h Thu Jul 25 09:32:21 2002
++++ gcc-20020722/gcc/config/rs6000/rs6000.h Thu Jul 25 09:34:45 2002
+@@ -66,7 +66,7 @@
+ %{mcpu=rsc1: -D_ARCH_PWR} \
+ %{mcpu=401: -D_ARCH_PPC} \
+ %{mcpu=403: -D_ARCH_PPC} \
+-%{mcpu=405: -D_ARCH_PPC} \
++%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \
+ %{mcpu=505: -D_ARCH_PPC} \
+ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
+ %{mcpu=602: -D_ARCH_PPC} \
+diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h
+--- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h Thu Jul 25 09:32:30 2002
++++ gcc-20020722/libjava/sysdep/powerpc/locks.h Thu Jul 25 11:39:13 2002
+@@ -11,6 +11,17 @@
+ #ifndef __SYSDEP_LOCKS_H__
+ #define __SYSDEP_LOCKS_H__
+
++#ifdef __PPC405__
++// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN. References:
++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
++// http://www.kegel.com/xgcc3/ppc405erratum77.html
++// FIXME: using dbct instead of sync would be faster
++#define __LIBGCJ_PPC405_ERR77_SYNC "sync \n\t"
++#else
++#define __LIBGCJ_PPC405_ERR77_SYNC
++#endif
++
+ typedef size_t obj_addr_t; /* Integer type big enough for object */
+ /* address. */
+
+@@ -25,6 +36,7 @@
+ "0: lwarx %0,0,%1 ;"
+ " xor. %0,%3,%0;"
+ " bne 1f;"
++ __LIBGCJ_PPC405_ERR77_SYNC
+ " stwcx. %2,0,%1;"
+ " bne- 0b;"
+ "1: "
+@@ -58,6 +70,7 @@
+ "0: lwarx %0,0,%1 ;"
+ " xor. %0,%3,%0;"
+ " bne 1f;"
++ __LIBGCJ_PPC405_ERR77_SYNC
+ " stwcx. %2,0,%1;"
+ " bne- 0b;"
+ "1: "
+diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h
+--- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:32:31 2002
++++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:34:45 2002
+@@ -32,6 +32,17 @@
+
+ typedef int _Atomic_word;
+
++#ifdef __PPC405__
++// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank. References:
++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
++// http://www.kegel.com/xgcc3/ppc405erratum77.html
++// FIXME: using dbct instead of sync would be faster
++#define __LIBSTDCPP_PPC405_ERR77_SYNC "sync \n\t"
++#else
++#define __LIBSTDCPP_PPC405_ERR77_SYNC
++#endif
++
+ static inline _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
+@@ -42,6 +53,7 @@
+ "0:\t"
+ "lwarx %0,0,%2 \n\t"
+ "add%I3 %1,%0,%3 \n\t"
++ __LIBSTDCPP_PPC405_ERR77_SYNC
+ "stwcx. %1,0,%2 \n\t"
+ "bne- 0b \n\t"
+ "/* End exchange & add */"
+@@ -61,6 +73,7 @@
+ "0:\t"
+ "lwarx %0,0,%1 \n\t"
+ "add%I2 %0,%0,%2 \n\t"
++ __LIBSTDCPP_PPC405_ERR77_SYNC
+ "stwcx. %0,0,%1 \n\t"
+ "bne- 0b \n\t"
+ "/* End atomic add */"
+@@ -78,6 +91,7 @@
+ "/* Inline always swap */\n"
+ "0:\t"
+ "lwarx %0,0,%1 \n\t"
++ __LIBSTDCPP_PPC405_ERR77_SYNC
+ "stwcx. %2,0,%1 \n\t"
+ "bne- 0b \n\t"
+ "/* End always swap */"
+@@ -98,6 +112,7 @@
+ "lwarx %0,0,%1 \n\t"
+ "cmpwi %0,0 \n\t"
+ "bne- 1f \n\t"
++ __LIBSTDCPP_PPC405_ERR77_SYNC
+ "stwcx. %2,0,%1 \n\t"
+ "bne- 0b \n"
+ "1:\n\t"
diff --git a/patches/gcc/3.2.3/gcc-20030210-sh-linux-1.patch b/patches/gcc/3.2.3/gcc-20030210-sh-linux-1.patch
new file mode 100644
index 0000000..4393078
--- /dev/null
+++ b/patches/gcc/3.2.3/gcc-20030210-sh-linux-1.patch
@@ -0,0 +1,1761 @@
+diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure
+--- gcc-20030210.orig/boehm-gc/configure Fri Jan 31 19:17:00 2003
++++ gcc-20030210/boehm-gc/configure Sat Feb 22 01:40:14 2003
+@@ -1922,7 +1922,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in
+--- gcc-20030210.orig/config-ml.in Fri Jan 31 19:16:59 2003
++++ gcc-20030210/config-ml.in Sat Feb 22 01:40:14 2003
+@@ -545,6 +545,7 @@
+ if [ -d ../$${dir}/$${lib} ]; then \
+ flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
+ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
++ DESTDIR="$(DESTDIR)" \
+ CFLAGS="$(CFLAGS) $${flags}" \
+ prefix="$(prefix)" \
+ exec_prefix="$(exec_prefix)" \
+diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in
+--- gcc-20030210.orig/debian/edit-specs.in Thu Jan 1 09:00:00 1970
++++ gcc-20030210/debian/edit-specs.in Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,45 @@
++/^*asm:$/ {
++n
++c\
++@AS_ENDIAN_FLAG@ %{mrelax:-relax}
++}
++/^*cpp:$/ {
++n
++c\
++%(cpp_default_cpu_spec) %(subtarget_cpp_spec) %(subtarget_cpp_ptr_spec) %(subtarget_cpp_endian_spec)
++}
++/^*cc1:$/ {
++n
++c\
++-musermode @CC1_CPU_ENDIAN_FLAGS@ %{profile:-p}
++}
++/^*link:$/ {
++n
++c\
++%{!static:--eh-frame-hdr} @LINKER_CPU_ENDIAN_FLAGS@ @LINKER_RPATH_LINK_FLAG@ %{mrelax:-relax} %{shared:-shared} %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static}
++}
++/^*multilib:$/ {
++n
++c\
++. ;
++}
++/^*multilib_matches:$/ {
++n
++c\
++
++}
++/^*multilib_options:$/ {
++n
++c\
++
++}
++/^*subtarget_cpp_endian_spec:$/ {
++n
++c\
++@CPP_ENDIAN_DEF@
++}
++/^*cpp_default_cpu_spec:$/ {
++n
++c\
++@CPP_CPU_DEFS@
++}
+diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux
+--- gcc-20030210.orig/debian/install-CPU-linux Thu Jan 1 09:00:00 1970
++++ gcc-20030210/debian/install-CPU-linux Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,111 @@
++#! /bin/sh
++
++VERSION=$1; shift
++CPU=$1
++
++# literally (binary-ly) same
++PROGS_C="cpp gcc"
++PROGS_ADDITIONAL="c++ g++ g77 gcj"
++
++DRIVERS_C="cc1 cpp0 tradcpp0"
++DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain"
++if [ -z "$STEP1_COMPILER_BUILD" ]; then
++ PROGS="$PROGS_C $PROGS_ADDITIONAL"
++ DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL"
++ INITIAL=""
++else
++ PROGS=$PROGS_C
++ DRIVERS=$DRIVERS_C
++ INITIAL="-initial"
++fi
++
++OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++LIBS_C="libgcc.a"
++LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2"
++LIBS_2="libobjc.a libstdc++.a libsupc++.a"
++INCLUDE="include"
++
++cd debian/gcc-sh-linux-others${INITIAL} || exit 1
++
++# Make directories.
++mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \
++ usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \
++ usr/lib/gcc-lib/${CPU}-linux/${VERSION} \
++ usr/${CPU}-linux usr/${CPU}-linux/lib
++
++# Make symbolic links for include dir.
++(cd usr/${CPU}-linux; ln -s ../sh-linux/include .)
++
++# Make symbolic links for executables.
++(cd usr/bin;
++ for p in ${PROGS}; do
++ ln -s shCPU-linux-GCC ${CPU}-linux-$p
++ done)
++
++case "${CPU}" in
++ sh3)
++ MULTILIBDIR=
++ AS_ENDIAN_FLAG="-little"
++ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
++ CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
++ CC1_CPU_ENDIAN_FLAGS="-ml -m3"
++ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3"
++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib"
++ ;;
++ sh3eb)
++ MULTILIBDIR=/mb
++ AS_ENDIAN_FLAG="-big"
++ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
++ CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
++ CC1_CPU_ENDIAN_FLAGS="-mb -m3"
++ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3"
++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib"
++ ;;
++ sh4)
++ MULTILIBDIR=/m4
++ AS_ENDIAN_FLAG="-little"
++ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
++ CPP_CPU_DEFS="-D__SH4__"
++ CC1_CPU_ENDIAN_FLAGS="-ml -m4"
++ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4"
++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib"
++ ;;
++ sh4eb)
++ MULTILIBDIR=/mb/m4
++ AS_ENDIAN_FLAG="-big"
++ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
++ CPP_CPU_DEFS="-D__SH4__"
++ CC1_CPU_ENDIAN_FLAGS="-mb -m4"
++ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4"
++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib"
++ ;;
++esac
++
++# Make symbolic links for GCC drivers, objects, libraries, and include dir.
++(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION};
++ for f in ${DRIVERS} ${INCLUDE}; do
++ ln -s ../../sh-linux/${VERSION}/$f $f;
++ done
++ for f in ${OBJS} ${LIBS_C}; do
++ ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f;
++ done)
++
++if [ -z "$STEP1_COMPILER_BUILD" ]; then
++ for f in ${LIBS_1} ${LIBS_2}; do
++ mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/;
++ done
++fi
++
++sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \
++ -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \
++ -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \
++ -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \
++ -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \
++ -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \
++ ../edit-specs.in >../edit-specs-${CPU}.sed
++
++sed -f ../edit-specs-${CPU}.sed \
++ ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \
++ > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs
++
++exit 0
+diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink
+--- gcc-20030210.orig/debian/multilib-symlink Thu Jan 1 09:00:00 1970
++++ gcc-20030210/debian/multilib-symlink Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,10 @@
++#! /bin/sh
++
++cd /usr/sh-linux/lib
++ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} .
++cd m4
++ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} .
++cd ../mb
++ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} .
++cd m4
++ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} .
+diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC
+--- gcc-20030210.orig/debian/shCPU-linux-GCC Thu Jan 1 09:00:00 1970
++++ gcc-20030210/debian/shCPU-linux-GCC Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,59 @@
++#! /bin/bash
++
++BASENAME=${0##*/}
++PROG=${BASENAME##*-}
++CPU=${BASENAME%%-*}
++
++if [ "$PROG" = gcc ]; then
++ if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then
++ shift 2
++ exec /usr/bin/gcc "$@"
++ elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then
++ echo ".;"
++ exit 0
++ elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then
++ echo "."
++ exit 0
++ elif [ "$1" = "-dumpspecs" ]; then
++ cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs
++ exit 0
++ fi
++fi
++
++case "${CPU}" in
++ sh3)
++ ARCH=m3
++ DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__"
++ ENDIAN=ml
++ ;;
++ sh3eb)
++ ARCH=m3
++ DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__"
++ ENDIAN=mb
++ ;;
++ sh4)
++ ARCH=m4
++ DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__"
++ ENDIAN=ml
++ ;;
++ sh4eb)
++ ARCH=m4
++ DEFINES="-D__SH4__ -D__BIG_ENDIAN__"
++ ENDIAN=mb
++ ;;
++esac
++
++# Prepend the appropriate options
++# If user specifies some options, it will be overridden
++
++case "${PROG}" in
++ cpp)
++ exec sh-linux-${PROG} $DEFINES "$@"
++ ;;
++ c++|g++|g77|gcc|gcj)
++ exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@"
++ ;;
++esac
++
++echo "Something wrong..."
++exit 1
+diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h
+--- gcc-20030210.orig/gcc/config/sh/elf.h Fri Feb 22 01:42:28 2002
++++ gcc-20030210/gcc/config/sh/elf.h Sat Feb 22 01:40:14 2003
+@@ -170,3 +170,7 @@
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++
++/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it,
++ redundant .align will be generated. */
++#undef ASM_OUTPUT_CASE_LABEL
+diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm
+--- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm Fri Feb 22 01:42:28 2002
++++ gcc-20030210/gcc/config/sh/lib1funcs.asm Sat Feb 22 01:40:14 2003
+@@ -39,8 +39,13 @@
+
+ #ifdef __ELF__
+ #define LOCAL(X) .L_##X
++#define FUNC(X) .type X,@function; .hidden X
++#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X
++#define ENDFUNC(X) _ENDFUNC(X)
+ #else
+ #define LOCAL(X) L_##X
++#define FUNC(X)
++#define ENDFUNC(X)
+ #endif
+
+ #ifdef __linux__
+@@ -91,6 +96,40 @@
+ .global GLOBAL(ashiftrt_r4_31)
+ .global GLOBAL(ashiftrt_r4_32)
+
++ FUNC(GLOBAL(ashiftrt_r4_0))
++ FUNC(GLOBAL(ashiftrt_r4_1))
++ FUNC(GLOBAL(ashiftrt_r4_2))
++ FUNC(GLOBAL(ashiftrt_r4_3))
++ FUNC(GLOBAL(ashiftrt_r4_4))
++ FUNC(GLOBAL(ashiftrt_r4_5))
++ FUNC(GLOBAL(ashiftrt_r4_6))
++ FUNC(GLOBAL(ashiftrt_r4_7))
++ FUNC(GLOBAL(ashiftrt_r4_8))
++ FUNC(GLOBAL(ashiftrt_r4_9))
++ FUNC(GLOBAL(ashiftrt_r4_10))
++ FUNC(GLOBAL(ashiftrt_r4_11))
++ FUNC(GLOBAL(ashiftrt_r4_12))
++ FUNC(GLOBAL(ashiftrt_r4_13))
++ FUNC(GLOBAL(ashiftrt_r4_14))
++ FUNC(GLOBAL(ashiftrt_r4_15))
++ FUNC(GLOBAL(ashiftrt_r4_16))
++ FUNC(GLOBAL(ashiftrt_r4_17))
++ FUNC(GLOBAL(ashiftrt_r4_18))
++ FUNC(GLOBAL(ashiftrt_r4_19))
++ FUNC(GLOBAL(ashiftrt_r4_20))
++ FUNC(GLOBAL(ashiftrt_r4_21))
++ FUNC(GLOBAL(ashiftrt_r4_22))
++ FUNC(GLOBAL(ashiftrt_r4_23))
++ FUNC(GLOBAL(ashiftrt_r4_24))
++ FUNC(GLOBAL(ashiftrt_r4_25))
++ FUNC(GLOBAL(ashiftrt_r4_26))
++ FUNC(GLOBAL(ashiftrt_r4_27))
++ FUNC(GLOBAL(ashiftrt_r4_28))
++ FUNC(GLOBAL(ashiftrt_r4_29))
++ FUNC(GLOBAL(ashiftrt_r4_30))
++ FUNC(GLOBAL(ashiftrt_r4_31))
++ FUNC(GLOBAL(ashiftrt_r4_32))
++
+ .align 1
+ GLOBAL(ashiftrt_r4_32):
+ GLOBAL(ashiftrt_r4_31):
+@@ -170,6 +209,41 @@
+ GLOBAL(ashiftrt_r4_0):
+ rts
+ nop
++
++ ENDFUNC(GLOBAL(ashiftrt_r4_0))
++ ENDFUNC(GLOBAL(ashiftrt_r4_1))
++ ENDFUNC(GLOBAL(ashiftrt_r4_2))
++ ENDFUNC(GLOBAL(ashiftrt_r4_3))
++ ENDFUNC(GLOBAL(ashiftrt_r4_4))
++ ENDFUNC(GLOBAL(ashiftrt_r4_5))
++ ENDFUNC(GLOBAL(ashiftrt_r4_6))
++ ENDFUNC(GLOBAL(ashiftrt_r4_7))
++ ENDFUNC(GLOBAL(ashiftrt_r4_8))
++ ENDFUNC(GLOBAL(ashiftrt_r4_9))
++ ENDFUNC(GLOBAL(ashiftrt_r4_10))
++ ENDFUNC(GLOBAL(ashiftrt_r4_11))
++ ENDFUNC(GLOBAL(ashiftrt_r4_12))
++ ENDFUNC(GLOBAL(ashiftrt_r4_13))
++ ENDFUNC(GLOBAL(ashiftrt_r4_14))
++ ENDFUNC(GLOBAL(ashiftrt_r4_15))
++ ENDFUNC(GLOBAL(ashiftrt_r4_16))
++ ENDFUNC(GLOBAL(ashiftrt_r4_17))
++ ENDFUNC(GLOBAL(ashiftrt_r4_18))
++ ENDFUNC(GLOBAL(ashiftrt_r4_19))
++ ENDFUNC(GLOBAL(ashiftrt_r4_20))
++ ENDFUNC(GLOBAL(ashiftrt_r4_21))
++ ENDFUNC(GLOBAL(ashiftrt_r4_22))
++ ENDFUNC(GLOBAL(ashiftrt_r4_23))
++ ENDFUNC(GLOBAL(ashiftrt_r4_24))
++ ENDFUNC(GLOBAL(ashiftrt_r4_25))
++ ENDFUNC(GLOBAL(ashiftrt_r4_26))
++ ENDFUNC(GLOBAL(ashiftrt_r4_27))
++ ENDFUNC(GLOBAL(ashiftrt_r4_28))
++ ENDFUNC(GLOBAL(ashiftrt_r4_29))
++ ENDFUNC(GLOBAL(ashiftrt_r4_30))
++ ENDFUNC(GLOBAL(ashiftrt_r4_31))
++ ENDFUNC(GLOBAL(ashiftrt_r4_32))
++
+ #endif
+
+ #ifdef L_ashiftrt_n
+@@ -192,6 +266,7 @@
+ !
+
+ .global GLOBAL(ashrsi3)
++ FUNC(GLOBAL(ashrsi3))
+ .align 2
+ GLOBAL(ashrsi3):
+ mov #31,r0
+@@ -319,6 +394,8 @@
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(ashrsi3))
++
+ #endif
+
+ #ifdef L_ashiftlt
+@@ -340,6 +417,7 @@
+ ! (none)
+ !
+ .global GLOBAL(ashlsi3)
++ FUNC(GLOBAL(ashlsi3))
+ .align 2
+ GLOBAL(ashlsi3):
+ mov #31,r0
+@@ -476,6 +554,8 @@
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(ashlsi3))
++
+ #endif
+
+ #ifdef L_lshiftrt
+@@ -497,6 +577,7 @@
+ ! (none)
+ !
+ .global GLOBAL(lshrsi3)
++ FUNC(GLOBAL(lshrsi3))
+ .align 2
+ GLOBAL(lshrsi3):
+ mov #31,r0
+@@ -633,6 +714,8 @@
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(lshrsi3))
++
+ #endif
+
+ #ifdef L_movstr
+@@ -649,76 +732,113 @@
+ add #64,r4
+ .align 4
+ .global GLOBAL(movstrSI64)
++ FUNC(GLOBAL(movstrSI64))
+ GLOBAL(movstrSI64):
+ mov.l @(60,r5),r0
+ mov.l r0,@(60,r4)
+ .global GLOBAL(movstrSI60)
++ FUNC(GLOBAL(movstrSI60))
+ GLOBAL(movstrSI60):
+ mov.l @(56,r5),r0
+ mov.l r0,@(56,r4)
+ .global GLOBAL(movstrSI56)
++ FUNC(GLOBAL(movstrSI56))
+ GLOBAL(movstrSI56):
+ mov.l @(52,r5),r0
+ mov.l r0,@(52,r4)
+ .global GLOBAL(movstrSI52)
++ FUNC(GLOBAL(movstrSI52))
+ GLOBAL(movstrSI52):
+ mov.l @(48,r5),r0
+ mov.l r0,@(48,r4)
+ .global GLOBAL(movstrSI48)
++ FUNC(GLOBAL(movstrSI48))
+ GLOBAL(movstrSI48):
+ mov.l @(44,r5),r0
+ mov.l r0,@(44,r4)
+ .global GLOBAL(movstrSI44)
++ FUNC(GLOBAL(movstrSI44))
+ GLOBAL(movstrSI44):
+ mov.l @(40,r5),r0
+ mov.l r0,@(40,r4)
+ .global GLOBAL(movstrSI40)
++ FUNC(GLOBAL(movstrSI40))
+ GLOBAL(movstrSI40):
+ mov.l @(36,r5),r0
+ mov.l r0,@(36,r4)
+ .global GLOBAL(movstrSI36)
++ FUNC(GLOBAL(movstrSI36))
+ GLOBAL(movstrSI36):
+ mov.l @(32,r5),r0
+ mov.l r0,@(32,r4)
+ .global GLOBAL(movstrSI32)
++ FUNC(GLOBAL(movstrSI32))
+ GLOBAL(movstrSI32):
+ mov.l @(28,r5),r0
+ mov.l r0,@(28,r4)
+ .global GLOBAL(movstrSI28)
++ FUNC(GLOBAL(movstrSI28))
+ GLOBAL(movstrSI28):
+ mov.l @(24,r5),r0
+ mov.l r0,@(24,r4)
+ .global GLOBAL(movstrSI24)
++ FUNC(GLOBAL(movstrSI24))
+ GLOBAL(movstrSI24):
+ mov.l @(20,r5),r0
+ mov.l r0,@(20,r4)
+ .global GLOBAL(movstrSI20)
++ FUNC(GLOBAL(movstrSI20))
+ GLOBAL(movstrSI20):
+ mov.l @(16,r5),r0
+ mov.l r0,@(16,r4)
+ .global GLOBAL(movstrSI16)
++ FUNC(GLOBAL(movstrSI16))
+ GLOBAL(movstrSI16):
+ mov.l @(12,r5),r0
+ mov.l r0,@(12,r4)
+ .global GLOBAL(movstrSI12)
++ FUNC(GLOBAL(movstrSI12))
+ GLOBAL(movstrSI12):
+ mov.l @(8,r5),r0
+ mov.l r0,@(8,r4)
+ .global GLOBAL(movstrSI8)
++ FUNC(GLOBAL(movstrSI8))
+ GLOBAL(movstrSI8):
+ mov.l @(4,r5),r0
+ mov.l r0,@(4,r4)
+ .global GLOBAL(movstrSI4)
++ FUNC(GLOBAL(movstrSI4))
+ GLOBAL(movstrSI4):
+ mov.l @(0,r5),r0
+ mov.l r0,@(0,r4)
++ .global GLOBAL(movstrSI0)
++ FUNC(GLOBAL(movstrSI0))
+ GLOBAL(movstrSI0):
+ rts
+ nop
+
++ ENDFUNC(GLOBAL(movstrSI64))
++ ENDFUNC(GLOBAL(movstrSI60))
++ ENDFUNC(GLOBAL(movstrSI56))
++ ENDFUNC(GLOBAL(movstrSI52))
++ ENDFUNC(GLOBAL(movstrSI48))
++ ENDFUNC(GLOBAL(movstrSI44))
++ ENDFUNC(GLOBAL(movstrSI40))
++ ENDFUNC(GLOBAL(movstrSI36))
++ ENDFUNC(GLOBAL(movstrSI32))
++ ENDFUNC(GLOBAL(movstrSI28))
++ ENDFUNC(GLOBAL(movstrSI24))
++ ENDFUNC(GLOBAL(movstrSI20))
++ ENDFUNC(GLOBAL(movstrSI16))
++ ENDFUNC(GLOBAL(movstrSI12))
++ ENDFUNC(GLOBAL(movstrSI8))
++ ENDFUNC(GLOBAL(movstrSI4))
++ ENDFUNC(GLOBAL(movstrSI0))
++
+ .align 4
+
+ .global GLOBAL(movstr)
++ FUNC(GLOBAL(movstr))
+ GLOBAL(movstr):
+ mov.l @(60,r5),r0
+ mov.l r0,@(60,r4)
+@@ -775,6 +895,8 @@
+ add #64,r5
+ bra GLOBAL(movstr)
+ add #64,r4
++
++ FUNC(GLOBAL(movstr))
+ #endif
+
+ #ifdef L_movstr_i4
+@@ -783,6 +905,10 @@
+ .global GLOBAL(movstr_i4_odd)
+ .global GLOBAL(movstrSI12_i4)
+
++ FUNC(GLOBAL(movstr_i4_even))
++ FUNC(GLOBAL(movstr_i4_odd))
++ FUNC(GLOBAL(movstrSI12_i4))
++
+ .p2align 5
+ L_movstr_2mod4_end:
+ mov.l r0,@(16,r4)
+@@ -791,6 +917,11 @@
+
+ .p2align 2
+
++GLOBAL(movstr_i4_even):
++ mov.l @r5+,r0
++ bra L_movstr_start_even
++ mov.l @r5+,r1
++
+ GLOBAL(movstr_i4_odd):
+ mov.l @r5+,r1
+ add #-4,r4
+@@ -817,10 +948,8 @@
+ rts
+ mov.l r3,@(12,r4)
+
+-GLOBAL(movstr_i4_even):
+- mov.l @r5+,r0
+- bra L_movstr_start_even
+- mov.l @r5+,r1
++ ENDFUNC(GLOBAL(movstr_i4_even))
++ ENDFUNC(GLOBAL(movstr_i4_odd))
+
+ .p2align 4
+ GLOBAL(movstrSI12_i4):
+@@ -831,12 +960,16 @@
+ mov.l r1,@(4,r4)
+ rts
+ mov.l r2,@(8,r4)
++
++ ENDFUNC(GLOBAL(movstrSI12_i4))
++
+ #endif
+
+ #ifdef L_mulsi3
+
+
+ .global GLOBAL(mulsi3)
++ FUNC(GLOBAL(mulsi3))
+
+ ! r4 = aabb
+ ! r5 = ccdd
+@@ -869,7 +1002,7 @@
+ rts
+ add r2,r0
+
+-
++ FUNC(GLOBAL(mulsi3))
+ #endif
+ #endif /* ! __SH5__ */
+ #ifdef L_sdivsi3_i4
+@@ -879,6 +1012,7 @@
+ !! args in r4 and r5, result in fpul, clobber dr0, dr2
+
+ .global GLOBAL(sdivsi3_i4)
++ FUNC(GLOBAL(sdivsi3_i4))
+ GLOBAL(sdivsi3_i4):
+ lds r4,fpul
+ float fpul,dr0
+@@ -888,6 +1022,8 @@
+ rts
+ ftrc dr0,fpul
+
++ ENDFUNC(GLOBAL(sdivsi3_i4))
++
+ #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
+ !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
+
+@@ -896,6 +1032,7 @@
+ .mode SHcompact
+ #endif
+ .global GLOBAL(sdivsi3_i4)
++ FUNC(GLOBAL(sdivsi3_i4))
+ GLOBAL(sdivsi3_i4):
+ sts.l fpscr,@-r15
+ mov #8,r2
+@@ -910,6 +1047,8 @@
+ rts
+ lds.l @r15+,fpscr
+
++ ENDFUNC(GLOBAL(sdivsi3_i4))
++
+ #endif /* ! __SH5__ || __SH5__ == 32 */
+ #endif /* ! __SH4__ */
+ #endif
+@@ -924,9 +1063,10 @@
+ !!
+ !!
+
+-!! args in r4 and r5, result in r0 clobber r1,r2,r3
++!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit
+
+ .global GLOBAL(sdivsi3)
++ FUNC(GLOBAL(sdivsi3))
+ #if __SHMEDIA__
+ #if __SH5__ == 32
+ .section .text..SHmedia32,"ax"
+@@ -1076,6 +1216,7 @@
+ div0: rts
+ mov #0,r0
+
++ ENDFUNC(GLOBAL(sdivsi3))
+ #endif /* ! __SHMEDIA__ */
+ #endif /* ! __SH4__ */
+ #endif
+@@ -1084,9 +1225,11 @@
+ .title "SH DIVIDE"
+ !! 4 byte integer Divide code for the Hitachi SH
+ #ifdef __SH4__
+-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
++!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
++!! and t bit
+
+ .global GLOBAL(udivsi3_i4)
++ FUNC(GLOBAL(udivsi3_i4))
+ GLOBAL(udivsi3_i4):
+ mov #1,r1
+ cmp/hi r1,r5
+@@ -1127,6 +1270,8 @@
+ L1:
+ .double 2147483648
+
++ ENDFUNC(GLOBAL(udivsi3_i4))
++
+ #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
+ !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
+
+@@ -1135,6 +1280,7 @@
+ .mode SHcompact
+ #endif
+ .global GLOBAL(udivsi3_i4)
++ FUNC(GLOBAL(udivsi3_i4))
+ GLOBAL(udivsi3_i4):
+ mov #1,r1
+ cmp/hi r1,r5
+@@ -1183,6 +1329,8 @@
+ #endif
+ .double 2147483648
+
++ ENDFUNC(GLOBAL(udivsi3_i4))
++
+ #endif /* ! __SH5__ || __SH5__ == 32 */
+ #endif /* ! __SH4__ */
+ #endif
+@@ -1199,6 +1347,7 @@
+
+ !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
+ .global GLOBAL(udivsi3)
++ FUNC(GLOBAL(udivsi3))
+
+ #if __SHMEDIA__
+ #if __SH5__ == 32
+@@ -1299,6 +1448,8 @@
+ ret: rts
+ mov r4,r0
+
++ ENDFUNC(GLOBAL(udivsi3))
++
+ #endif /* ! __SHMEDIA__ */
+ #endif /* __SH4__ */
+ #endif
+@@ -1308,6 +1459,7 @@
+ .mode SHcompact
+ #endif
+ .global GLOBAL(set_fpscr)
++ FUNC(GLOBAL(set_fpscr))
+ GLOBAL(set_fpscr):
+ lds r4,fpscr
+ mov.l LOCAL(set_fpscr_L1),r1
+@@ -1340,11 +1492,16 @@
+ .align 2
+ LOCAL(set_fpscr_L1):
+ .long GLOBAL(fpscr_values)
++
++ ENDFUNC(GLOBAL(set_fpscr))
++
++#ifndef NO_FPSCR_VALUES
+ #ifdef __ELF__
+ .comm GLOBAL(fpscr_values),8,4
+ #else
+ .comm GLOBAL(fpscr_values),8
+ #endif /* ELF */
++#endif /* NO_FPSCR_VALUES */
+ #endif /* SH3E / SH4 */
+ #endif /* L_set_fpscr */
+ #ifdef L_ic_invalidate
+@@ -1360,6 +1517,7 @@
+ blink tr0, r63
+ #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
+ .global GLOBAL(ic_invalidate)
++ FUNC(GLOBAL(ic_invalidate))
+ GLOBAL(ic_invalidate):
+ ocbwb @r4
+ mova 0f,r0
+@@ -1382,6 +1540,9 @@
+ nop
+ .endr
+ .endr
++
++ ENDFUNC(GLOBAL(ic_invalidate))
++
+ #endif /* SH4 */
+ #endif /* L_ic_invalidate */
+
+diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver
+--- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver Thu Jan 1 09:00:00 1970
++++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,21 @@
++# In order to work around the very problems that force us to now generally
++# create a libgcc.so, glibc reexported a number of routines from libgcc.a.
++# By now choosing the same version tags for these specific routines, we
++# maintain enough binary compatibility to allow future versions of glibc
++# to defer implementation of these routines to libgcc.so via DT_AUXILIARY.
++
++# Note that we cannot use the default libgcc-glibc.ver file on sh,
++# because GLIBC_2.0 does not exist on this architecture, as the first
++# ever glibc release on the platform was GLIBC_2.2.
++
++%inherit GCC_3.0 GLIBC_2.2
++GLIBC_2.2 {
++ __register_frame
++ __register_frame_table
++ __deregister_frame
++ __register_frame_info
++ __deregister_frame_info
++ __frame_state_for
++ __register_frame_info_table
++}
++
+diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h
+--- gcc-20030210.orig/gcc/config/sh/linux.h Tue Apr 16 05:27:42 2002
++++ gcc-20030210/gcc/config/sh/linux.h Sat Feb 22 01:40:14 2003
+@@ -19,6 +19,10 @@
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
++/* We're not SYSVR4, not having /usr/ccs */
++#undef MD_EXEC_PREFIX
++#undef MD_STARTFILE_PREFIX
++
+ /* Run-time Target Specification. */
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr);
+@@ -39,6 +43,28 @@
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE BITS_PER_WORD
+
++/* This was defined in linux.h. Define it here also. */
++#undef DEFAULT_VTABLE_THUNKS
++#define DEFAULT_VTABLE_THUNKS 1
++
++/* Likewise. */
++#define HANDLE_PRAGMA_PACK_PUSH_POP
++
++/* Pick up the return address upon entry to a procedure. Used for
++ dwarf2 unwind information. This also enables the table driven
++ mechanism. */
++
++#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, PR_REG)
++#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (PR_REG)
++
++#undef CPP_SPEC
++#define CPP_SPEC "\
++ %{m4:-D__SH4__} \
++ %{!m4:%(cpp_default_cpu_spec)} \
++ %(subtarget_cpp_spec) \
++ %(subtarget_cpp_ptr_spec) \
++ %(subtarget_cpp_endian_spec) "
++
+ #undef SUBTARGET_CPP_SPEC
+ #define SUBTARGET_CPP_SPEC "\
+ %{fPIC:-D__PIC__ -D__pic__} \
+@@ -55,36 +81,45 @@
+ #undef CPP_DEFAULT_CPU_SPEC
+ #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__"
+
+-
+ #undef CPP_PREDEFINES
+ #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix"
+
++/* The GNU C++ standard library requires that these macros be defined. */
++#undef CPLUSPLUS_CPP_SPEC
++#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
++
+ #undef ASM_SPEC
+-#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}"
++#define ASM_SPEC "%{mb:-big} %{!mb:-little} %{mrelax:-relax}"
+
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
+-
+-#undef CC1PLUS_SPEC
+-#define CC1PLUS_SPEC \
+- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
++ "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}"
+
++/* XXX: It's wrong if prefix != /usr */
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+- "%{!mb:-m shlelf_linux} %{mrelax:-relax} \
++ "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \
+ %{shared:-shared} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
+- %{!rpath:-rpath /lib}} \
++ %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \
++ %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \
++ %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \
++ %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \
+ %{static:-static}"
+
+ #undef LIB_SPEC
++#undef LIB_SPEC
+ #define LIB_SPEC \
+ "%{shared: -lc} \
+- %{!shared: %{pthread:-lthread} \
+- %{profile:-lc_p} %{!profile: -lc}}"
++ %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \
++ %{profile:-lc_p} %{!profile: -lc}}"
++
++#if defined(HAVE_LD_EH_FRAME_HDR)
++#undef LINK_EH_SPEC
++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+@@ -92,4 +127,40 @@
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} \
+ %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ crti.o%s %{static:crtbeginT.o%s}\
++ %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
++
++#undef FUNCTION_PROFILER
++#define FUNCTION_PROFILER(STREAM,LABELNO) \
++do \
++{ \
++ if (flag_pic) \
++ { \
++ fprintf (STREAM, " mov.l 3f,r1\n"); \
++ fprintf (STREAM, " mova 3f,r0\n"); \
++ fprintf (STREAM, " add r1,r0\n"); \
++ fprintf (STREAM, " mov.l 1f,r1\n"); \
++ fprintf (STREAM, " mov.l @(r0,r1),r1\n"); \
++ } \
++ else \
++ { \
++ fprintf (STREAM, " mov.l 1f,r1\n"); \
++ } \
++ fprintf (STREAM, " sts.l pr,@-r15\n"); \
++ fprintf (STREAM, " mova 2f,r0\n"); \
++ fprintf (STREAM, " jmp @r1\n"); \
++ fprintf (STREAM, " lds r0,pr\n"); \
++ fprintf (STREAM, " .align 2\n"); \
++ if (flag_pic) \
++ { \
++ fprintf (STREAM, "1: .long mcount@GOT\n"); \
++ fprintf (STREAM, "3: .long _GLOBAL_OFFSET_TABLE_\n"); \
++ } \
++ else \
++ { \
++ fprintf (STREAM, "1: .long mcount\n"); \
++ } \
++ fprintf (STREAM, "2: lds.l @r15+,pr\n"); \
++} while (0)
++
++#define NO_SHARED_LIBGCC_MULTILIB
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h
+--- gcc-20030210.orig/gcc/config/sh/sh-protos.h Fri Feb 22 01:42:28 2002
++++ gcc-20030210/gcc/config/sh/sh-protos.h Sat Feb 22 01:40:14 2003
+@@ -74,6 +74,7 @@
+ extern int shl_sext_length PARAMS ((rtx));
+ extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx));
+ extern rtx gen_datalabel_ref PARAMS ((rtx));
++extern int shl_casesi_worker_length PARAMS ((rtx));
+ extern int regs_used PARAMS ((rtx, int));
+ extern void fixup_addr_diff_vecs PARAMS ((rtx));
+ extern int get_dest_uid PARAMS ((rtx, int));
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c
+--- gcc-20030210.orig/gcc/config/sh/sh.c Fri Feb 22 01:42:28 2002
++++ gcc-20030210/gcc/config/sh/sh.c Sat Feb 22 01:40:14 2003
+@@ -2143,6 +2143,48 @@
+ return sym;
+ }
+
++
++/* Function to be used in the length attribute of the casesi_worker
++ instruction. Returns number of instructions, which is half of the
++ length of bytes. */
++
++int
++shl_casesi_worker_length (insn)
++ rtx insn;
++{
++ rtx set_src, label;
++ rtx diff_vec;
++
++ set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
++ if (!(GET_CODE (set_src) == UNSPEC
++ && XINT (set_src, 1) == UNSPEC_CASESI))
++ abort ();
++
++ label = XVECEXP (set_src, 0, 2);
++ if (GET_CODE (label) != LABEL_REF)
++ abort ();
++
++ diff_vec = PATTERN (next_real_insn (XEXP (label, 0)));
++
++ if (GET_CODE (diff_vec) != ADDR_DIFF_VEC)
++ abort ();
++
++ switch (GET_MODE (diff_vec))
++ {
++ case SImode:
++ return 2;
++ case HImode:
++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
++ return 3;
++ return 2;
++ case QImode:
++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
++ return 2;
++ return 1;
++ default:
++ abort ();
++ }
++}
+
+ /* The SH cannot load a large constant into a register, constants have to
+ come from a pc relative load. The reference of a pc relative load
+@@ -3190,7 +3232,7 @@
+ vec_lab = XEXP (XEXP (pat, 0), 0);
+
+ /* Search the matching casesi_jump_2. */
+- for (prev = vec_lab; ; prev = PREV_INSN (prev))
++ for (prev = vec_lab; prev; prev = PREV_INSN (prev))
+ {
+ if (GET_CODE (prev) != JUMP_INSN)
+ continue;
+@@ -3205,6 +3247,13 @@
+ break;
+ }
+
++ if (prev == NULL)
++ { /* Switch statement has been optimized out. */
++ delete_insn (PREV_INSN (insn));
++ delete_insn (insn);
++ continue;
++ }
++
+ /* Emit the reference label of the braf where it belongs, right after
+ the casesi_jump_2 (i.e. braf). */
+ braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0);
+@@ -3223,7 +3272,7 @@
+ rtx barrier_or_label;
+ {
+ rtx next = next_real_insn (barrier_or_label), pat, prev;
+- int slot, credit, jump_to_next;
++ int slot, credit, jump_to_next = 0;
+
+ if (! next)
+ return 0;
+@@ -4507,7 +4556,8 @@
+ if (current_function_varargs || current_function_stdarg)
+ {
+ /* This is not used by the SH3E calling convention */
+- if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI)
++ if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI
++ || TARGET_NO_IMPLICIT_FP)
+ {
+ /* Push arg regs as if they'd been provided by caller in stack. */
+ for (i = 0; i < NPARM_REGS(SImode); i++)
+@@ -5149,7 +5199,8 @@
+ tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
+ tree record;
+
+- if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
++ if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI
++ || TARGET_NO_IMPLICIT_FP)
+ return ptr_type_node;
+
+ record = make_node (RECORD_TYPE);
+@@ -5211,7 +5262,8 @@
+ return;
+ }
+
+- if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
++ if ((! TARGET_SH3E && ! TARGET_SH4)
++ || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP)
+ {
+ std_expand_builtin_va_start (stdarg_p, valist, nextarg);
+ return;
+@@ -5289,7 +5341,8 @@
+ rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
+ pptr_type_node = build_pointer_type (ptr_type_node);
+
+- if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI)
++ if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4)
++ && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP)
+ {
+ tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
+ tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h
+--- gcc-20030210.orig/gcc/config/sh/sh.h Fri Feb 22 01:42:28 2002
++++ gcc-20030210/gcc/config/sh/sh.h Sat Feb 22 01:40:14 2003
+@@ -147,10 +147,10 @@
+ #define HARD_SH4_BIT (1<<5)
+ #define FPU_SINGLE_BIT (1<<7)
+ #define SH4_BIT (1<<12)
++#define NO_IMPLICIT_FP_BIT (1<<3)
+ #define FMOVD_BIT (1<<4)
+ #define SH5_BIT (1<<0)
+ #define SPACE_BIT (1<<13)
+-#define BIGTABLE_BIT (1<<14)
+ #define RELAX_BIT (1<<15)
+ #define USERMODE_BIT (1<<16)
+ #define HITACHI_BIT (1<<22)
+@@ -205,6 +205,9 @@
+ /* Nonzero if we should generate code for a SH5 CPU (either ISA). */
+ #define TARGET_SH5 (target_flags & SH5_BIT)
+
++/* Nonzero if we should not use FPU implicitly. */
++#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT)
++
+ /* Nonzero if we should generate code using the SHcompact instruction
+ set and 32-bit ABI. */
+ #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1)
+@@ -225,6 +228,7 @@
+
+ /* Nonzero if we should generate code using SHmedia FPU instructions. */
+ #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE)
++
+ /* Nonzero if we should generate fmovd. */
+ #define TARGET_FMOVD (target_flags & FMOVD_BIT)
+
+@@ -234,9 +238,6 @@
+ /* Nonzero if we should generate smaller code rather than faster code. */
+ #define TARGET_SMALLCODE (target_flags & SPACE_BIT)
+
+-/* Nonzero to use long jump tables. */
+-#define TARGET_BIGTABLE (target_flags & BIGTABLE_BIT)
+-
+ /* Nonzero to generate pseudo-ops needed by the assembler and linker
+ to do function call relaxing. */
+ #define TARGET_RELAX (target_flags & RELAX_BIT)
+@@ -297,7 +298,6 @@
+ {"5-compact-nofpu", TARGET_NONE, "" }, \
+ {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \
+ {"b", -LITTLE_ENDIAN_BIT, "" }, \
+- {"bigtable", BIGTABLE_BIT, "" }, \
+ {"dalign", DALIGN_BIT, "" }, \
+ {"fmovd", FMOVD_BIT, "" }, \
+ {"hitachi", HITACHI_BIT, "" }, \
+@@ -306,6 +306,7 @@
+ {"isize", ISIZE_BIT, "" }, \
+ {"l", LITTLE_ENDIAN_BIT, "" }, \
+ {"no-ieee", -IEEE_BIT, "" }, \
++ {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" }, \
+ {"padstruct", PADSTRUCT_BIT, "" }, \
+ {"prefergot", PREFERGOT_BIT, "" }, \
+ {"relax", RELAX_BIT, "" }, \
+@@ -2493,16 +2494,22 @@
+ goto LABEL; \
+ }
+
++extern int optimize; /* needed for gen_casesi. */
++extern int optimize_size;
++
+ /* Specify the machine mode that this machine uses
+ for the index in the tablejump instruction. */
+-#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode)
++#define CASE_VECTOR_MODE SImode
+
+ #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \
+ ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \
+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \
+ : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \
+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \
+- : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \
++ : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \
++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \
++ : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \
++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \
+ : SImode)
+
+ /* Define as C expression which evaluates to nonzero if the tablejump
+@@ -3038,10 +3045,7 @@
+ /* Output an absolute table element. */
+
+ #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \
+- if (TARGET_BIGTABLE) \
+- asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); \
+- else \
+- asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); \
++ asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE))
+
+ /* Output various types of constants. */
+
+@@ -3167,8 +3171,6 @@
+ #define sh_cpu_attr ((enum attr_cpu)sh_cpu)
+ extern enum processor_type sh_cpu;
+
+-extern int optimize; /* needed for gen_casesi. */
+-
+ enum mdep_reorg_phase_e
+ {
+ SH_BEFORE_MDEP_REORG,
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md
+--- gcc-20030210.orig/gcc/config/sh/sh.md Sat Nov 23 04:58:06 2002
++++ gcc-20030210/gcc/config/sh/sh.md Sat Feb 22 01:40:14 2003
+@@ -1242,7 +1242,7 @@
+ (clobber (reg:SI PR_REG))
+ (clobber (reg:SI R4_REG))
+ (use (match_operand:SI 1 "arith_reg_operand" "r"))]
+- "TARGET_SH1 && ! TARGET_SH4"
++ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
+ "jsr @%1%#"
+ [(set_attr "type" "sfunc")
+ (set_attr "needs_delay_slot" "yes")])
+@@ -1336,7 +1336,7 @@
+
+ operands[3] = gen_reg_rtx (Pmode);
+ /* Emit the move of the address to a pseudo outside of the libcall. */
+- if (TARGET_HARD_SH4 && TARGET_SH3E)
++ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
+ {
+ emit_move_insn (operands[3],
+ gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\"));
+@@ -1391,7 +1391,7 @@
+ (clobber (reg:SI R2_REG))
+ (clobber (reg:SI R3_REG))
+ (use (match_operand:SI 1 "arith_reg_operand" "r"))]
+- "TARGET_SH1 && ! TARGET_SH4"
++ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
+ "jsr @%1%#"
+ [(set_attr "type" "sfunc")
+ (set_attr "needs_delay_slot" "yes")])
+@@ -1476,7 +1476,7 @@
+
+ operands[3] = gen_reg_rtx (Pmode);
+ /* Emit the move of the address to a pseudo outside of the libcall. */
+- if (TARGET_HARD_SH4 && TARGET_SH3E)
++ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
+ {
+ emit_move_insn (operands[3],
+ gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\"));
+@@ -6446,6 +6446,8 @@
+ case SImode:
+ return \"shll2 %1\;mov.l @(r0,%1),%0\";
+ case HImode:
++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
++ return \"add %1,%1\;mov.w @(r0,%1),%0\;extu.w %0,%0\";
+ return \"add %1,%1\;mov.w @(r0,%1),%0\";
+ case QImode:
+ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
+@@ -6455,7 +6457,15 @@
+ abort ();
+ }
+ }"
+- [(set_attr "length" "4")])
++ [(set (attr "length")
++ (cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1))
++ (const_string "2")
++ (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2))
++ (const_string "4")
++ ;; Put "match_dup" here so that insn_variable_length_p return 1.
++ (ne (match_dup 2) (match_dup 2))
++ (const_string "4")]
++ (const_string "6")))])
+
+ (define_insn "casesi_shift_media"
+ [(set (match_operand 0 "arith_reg_operand" "=r")
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h
+--- gcc-20030210.orig/gcc/config/sh/sh3-linux.h Thu Jan 1 09:00:00 1970
++++ gcc-20030210/gcc/config/sh/sh3-linux.h Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,29 @@
++#undef TARGET_VERSION
++#define TARGET_VERSION fputs (" (SH3 GNU/Linux with ELF)", stderr);
++
++#undef CPP_SPEC
++#define CPP_SPEC \
++ "-D__LITTLE_ENDIAN__ \
++ -D__SH3__ -D__sh3__ \
++ -D__SIZE_TYPE__=unsigned\\ int \
++ -D__PTRDIFF_TYPE__=int \
++ %{fPIC:-D__PIC__ -D__pic__} \
++ %{fpic:-D__PIC__ -D__pic__} \
++ %{posix:-D_POSIX_SOURCE} \
++ %{pthread:-D_REENTRANT -D_PTHREADS}"
++
++#undef ASM_SPEC
++#define ASM_SPEC "%{mrelax:-relax}"
++
++#undef CC1_SPEC
++#define CC1_SPEC \
++ "-musermode -ml -m3 %{profile:-p}"
++
++#undef LINK_SPEC
++#define LINK_SPEC \
++ "%{mrelax:-relax} \
++ %{shared:-shared} \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{static:-static}"
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h
+--- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h Thu Jan 1 09:00:00 1970
++++ gcc-20030210/gcc/config/sh/sh3eb-linux.h Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,29 @@
++#undef TARGET_VERSION
++#define TARGET_VERSION fputs (" (SH3EB GNU/Linux with ELF)", stderr);
++
++#undef CPP_SPEC
++#define CPP_SPEC \
++ "-D__BIG_ENDIAN__ \
++ -D__SH3__ -D__sh3__ \
++ -D__SIZE_TYPE__=unsigned\\ int \
++ -D__PTRDIFF_TYPE__=int \
++ %{fPIC:-D__PIC__ -D__pic__} \
++ %{fpic:-D__PIC__ -D__pic__} \
++ %{posix:-D_POSIX_SOURCE} \
++ %{pthread:-D_REENTRANT -D_PTHREADS}"
++
++#undef ASM_SPEC
++#define ASM_SPEC "%{mrelax:-relax}"
++
++#undef CC1_SPEC
++#define CC1_SPEC \
++ "-musermode -mb -m3 %{profile:-p}"
++
++#undef LINK_SPEC
++#define LINK_SPEC \
++ "%{mrelax:-relax} \
++ %{shared:-shared} \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{static:-static}"
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h
+--- gcc-20030210.orig/gcc/config/sh/sh4-linux.h Thu Jan 1 09:00:00 1970
++++ gcc-20030210/gcc/config/sh/sh4-linux.h Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,29 @@
++#undef TARGET_VERSION
++#define TARGET_VERSION fputs (" (SH4 GNU/Linux with ELF)", stderr);
++
++#undef CPP_SPEC
++#define CPP_SPEC \
++ "-D__LITTLE_ENDIAN__ \
++ -D__SH4__ \
++ -D__SIZE_TYPE__=unsigned\\ int \
++ -D__PTRDIFF_TYPE__=int \
++ %{fPIC:-D__PIC__ -D__pic__} \
++ %{fpic:-D__PIC__ -D__pic__} \
++ %{posix:-D_POSIX_SOURCE} \
++ %{pthread:-D_REENTRANT -D_PTHREADS}"
++
++#undef ASM_SPEC
++#define ASM_SPEC "%{mrelax:-relax}"
++
++#undef CC1_SPEC
++#define CC1_SPEC \
++ "-musermode -ml -m4 %{profile:-p}"
++
++#undef LINK_SPEC
++#define LINK_SPEC \
++ "%{mrelax:-relax} \
++ %{shared:-shared} \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{static:-static}"
+diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h
+--- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h Thu Jan 1 09:00:00 1970
++++ gcc-20030210/gcc/config/sh/sh4eb-linux.h Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,29 @@
++#undef TARGET_VERSION
++#define TARGET_VERSION fputs (" (SH4EB GNU/Linux with ELF)", stderr);
++
++#undef CPP_SPEC
++#define CPP_SPEC \
++ "-D__BIG_ENDIAN__ \
++ -D__SH4__ \
++ -D__SIZE_TYPE__=unsigned\\ int \
++ -D__PTRDIFF_TYPE__=int \
++ %{fPIC:-D__PIC__ -D__pic__} \
++ %{fpic:-D__PIC__ -D__pic__} \
++ %{posix:-D_POSIX_SOURCE} \
++ %{pthread:-D_REENTRANT -D_PTHREADS}"
++
++#undef ASM_SPEC
++#define ASM_SPEC "%{mrelax:-relax}"
++
++#undef CC1_SPEC
++#define CC1_SPEC \
++ "-musermode -mb -m4 %{profile:-p}"
++
++#undef LINK_SPEC
++#define LINK_SPEC \
++ "%{mrelax:-relax} \
++ %{shared:-shared} \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{static:-static}"
+diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux
+--- gcc-20030210.orig/gcc/config/sh/t-linux Thu May 17 12:16:12 2001
++++ gcc-20030210/gcc/config/sh/t-linux Sat Feb 22 01:40:14 2003
+@@ -1,10 +1,20 @@
+-TARGET_LIBGCC2_CFLAGS = -fpic
++TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
++LIBGCC1 = libgcc1-asm.a
++CROSS_LIBGCC1 = libgcc1-asm.a
++LIBGCC1_TEST = libgcc1-test
+ LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
+ _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
+ _ic_invalidate
++LIB2ADDEH = $(srcdir)/unwind-sjlj.c
++LIB2ADDEHDEP = unwind.inc unwind-sjlj.c
+
+-MULTILIB_OPTIONS= mb m3e/m4
++MULTILIB_OPTIONS= mb m4
+ MULTILIB_DIRNAMES=
+ MULTILIB_MATCHES =
+
+-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
++
++# Override t-slibgcc-elf-ver to export some libgcc symbols with
++# the symbol versions that glibc used and SH specific.
++SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
++ $(srcdir)/config/sh/libgcc-glibc.ver
+diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti
+--- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti Thu Jan 1 09:00:00 1970
++++ gcc-20030210/gcc/config/sh/t-linux-nomulti Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,9 @@
++LIBGCC = libgcc.a
++EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o
++
++INSTALL_LIBGCC = install-libgcc
++
++MULTILIB_OPTIONS=
++MULTILIB_DIRNAMES=
++MULTILIB_MATCHES =
++EXTRA_MULTILIB_PARTS=
+diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc
+--- gcc-20030210.orig/gcc/config.gcc Fri Jan 31 19:17:13 2003
++++ gcc-20030210/gcc/config.gcc Sat Feb 22 01:40:14 2003
+@@ -337,9 +337,9 @@
+ sparc*-*-*)
+ cpu_type=sparc
+ ;;
+-sh64-*-*)
+- cpu_type=sh
+- ;;
++sh*-*-*)
++ cpu_type=sh
++ ;;
+ esac
+
+ tm_file=${cpu_type}/${cpu_type}.h
+@@ -3018,9 +3018,31 @@
+ thread_file='rtems'
+ fi
+ ;;
+-sh-*-linux*)
++sh*-*-linux*)
+ tm_file="${tm_file} sh/elf.h sh/linux.h"
+- tmake_file="sh/t-sh sh/t-elf sh/t-linux"
++ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux"
++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
++ case $machine in
++ sh3eb-*)
++ tm_file="${tm_file} sh/sh3eb-linux.h"
++ tmake_file="${tmake_file} sh/t-linux-nomulti"
++ ;;
++ sh4eb-*)
++ tm_file="${tm_file} sh/sh4eb-linux.h"
++ tmake_file="${tmake_file} sh/t-linux-nomulti"
++ ;;
++ sh3-*)
++ tm_file="${tm_file} sh/sh3-linux.h"
++ tmake_file="${tmake_file} sh/t-linux-nomulti"
++ ;;
++ sh4-*)
++ tm_file="${tm_file} sh/sh4-linux.h"
++ tmake_file="${tmake_file} sh/t-linux-nomulti"
++ ;;
++ *)
++ ;;
++ esac
++ xmake_file=x-linux
+ gas=yes gnu_ld=yes
+ float_format=sh
+ ;;
+diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c
+--- gcc-20030210.orig/gcc/dwarf2out.c Mon Feb 10 19:36:25 2003
++++ gcc-20030210/gcc/dwarf2out.c Sat Feb 22 01:40:14 2003
+@@ -10224,7 +10224,9 @@
+ /* We can have a normal definition following an inline one in the
+ case of redefinition of GNU C extern inlines.
+ It seems reasonable to use AT_specification in this case. */
+- && !get_AT_unsigned (old_die, DW_AT_inline))
++ && !get_AT_unsigned (old_die, DW_AT_inline)
++ /* Skip the nested function. */
++ && !decl_function_context (decl))
+ {
+ /* ??? This can happen if there is a bug in the program, for
+ instance, if it has duplicate function definitions. Ideally,
+diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c
+--- gcc-20030210.orig/gcc/final.c Fri Jan 31 19:17:20 2003
++++ gcc-20030210/gcc/final.c Sat Feb 22 01:40:14 2003
+@@ -1128,7 +1128,7 @@
+ }
+ }
+
+- INSN_ADDRESSES (uid) = insn_current_address;
++ INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid];
+
+ if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER
+ || GET_CODE (insn) == CODE_LABEL)
+diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk
+--- gcc-20030210.orig/gcc/mkmap-symver.awk Fri Jan 31 19:17:26 2003
++++ gcc-20030210/gcc/mkmap-symver.awk Sat Feb 22 01:40:14 2003
+@@ -89,7 +89,11 @@
+ output(inherit[lib]);
+
+ printf("%s {\n", lib);
+- printf(" global:\n");
++ for (sym in ver)
++ if ((ver[sym] == lib) && (sym in def))
++ count++;
++ if (count > 0)
++ printf(" global:\n");
+ for (sym in ver)
+ if ((ver[sym] == lib) && (sym in def))
+ {
+diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c
+--- gcc-20030210.orig/gcc/reload1.c Fri Jan 31 19:17:29 2003
++++ gcc-20030210/gcc/reload1.c Sat Feb 22 01:40:14 2003
+@@ -6103,6 +6103,7 @@
+ for (j = 0; j < n_reloads; j++)
+ if (rld[j].in != 0
+ && rld[j].when_needed != RELOAD_OTHER
++ && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS
+ && reg_overlap_mentioned_for_reload_p (rld[j].in,
+ rld[i].in))
+ rld[j].when_needed
+diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c
+--- gcc-20030210.orig/gcc/reorg.c Fri Jan 31 19:17:30 2003
++++ gcc-20030210/gcc/reorg.c Sat Feb 22 01:40:14 2003
+@@ -3265,6 +3265,14 @@
+ || condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0))))
+ continue;
+
++#ifdef MD_CAN_REDIRECT_BRANCH
++ /* On some targets, branches with delay slots can have a limited
++ displacement. Give the back end a chance to tell us we can't do
++ this. */
++ if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn))
++ continue;
++#endif
++
+ target_label = JUMP_LABEL (delay_insn);
+
+ if (target_label)
+diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c
+--- gcc-20030210.orig/gcc/tree-inline.c Fri Jan 31 19:17:33 2003
++++ gcc-20030210/gcc/tree-inline.c Sat Feb 22 01:40:14 2003
+@@ -836,11 +836,17 @@
+
+ /* Don't try to inline functions that are not well-suited to
+ inlining. */
+- if (!inlinable_function_p (fn, id))
+- return NULL_TREE;
++ if (! inlinable_function_p (fn, id)
++ || ! (*lang_hooks.tree_inlining.start_inlining) (fn))
++ {
++ if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline)
++ {
++ warning_with_decl (fn, "inlining failed in call to `%s'");
++ warning ("called from here");
++ }
+
+- if (! (*lang_hooks.tree_inlining.start_inlining) (fn))
+- return NULL_TREE;
++ return NULL_TREE;
++ }
+
+ /* Set the current filename and line number to the function we are
+ inlining so that when we create new _STMT nodes here they get
+diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in
+--- gcc-20030210.orig/libjava/Makefile.in Tue Jan 28 10:44:37 2003
++++ gcc-20030210/libjava/Makefile.in Sat Feb 22 01:40:14 2003
+@@ -1637,6 +1637,7 @@
+ "AS=$(AS)" \
+ "CC=$(CC)" \
+ "CXX=$(CXX)" \
++ "GCJ=$(GCJ)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "NM=$(NM)" \
+diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure
+--- gcc-20030210.orig/libjava/configure Tue Jan 28 10:44:37 2003
++++ gcc-20030210/libjava/configure Sat Feb 22 01:42:11 2003
+@@ -2031,7 +2031,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc
+--- gcc-20030210.orig/libjava/java/net/natInetAddress.cc Tue Mar 5 05:02:19 2002
++++ gcc-20030210/libjava/java/net/natInetAddress.cc Sat Feb 22 01:40:14 2003
+@@ -56,7 +56,7 @@
+ #endif
+
+ #ifndef HAVE_GETHOSTNAME_DECL
+-extern "C" int gethostname (char *name, int namelen);
++extern "C" int gethostname (char *name, unsigned int namelen);
+ #endif
+
+ #ifdef DISABLE_JAVA_NET
+diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4
+--- gcc-20030210.orig/libjava/libltdl/aclocal.m4 Sun Sep 10 17:04:40 2000
++++ gcc-20030210/libjava/libltdl/aclocal.m4 Sat Feb 22 01:40:14 2003
+@@ -573,7 +573,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case "$host_cpu" in
+- alpha* | i*86 | powerpc* | sparc* | ia64* )
++ alpha* | i*86 | powerpc* | sparc* | ia64* | sh*)
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h
+--- gcc-20030210.orig/libjava/sysdep/sh/locks.h Thu Jan 1 09:00:00 1970
++++ gcc-20030210/libjava/sysdep/sh/locks.h Sat Feb 22 01:40:14 2003
+@@ -0,0 +1,72 @@
++// locks.h - Thread synchronization primitives. SuperH implementation.
++
++/* Copyright (C) 2002 Free Software Foundation
++
++ This file is part of libgcj.
++
++This software is copyrighted work licensed under the terms of the
++Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
++details. */
++
++#ifndef __SYSDEP_LOCKS_H__
++#define __SYSDEP_LOCKS_H__
++
++typedef size_t obj_addr_t; /* Integer type big enough for object */
++ /* address. */
++
++static unsigned char __cas_lock = 0;
++
++inline static void
++__cas_start_atomic (void)
++{
++ unsigned int val;
++
++ do
++ __asm__ __volatile__ ("tas.b @%1; movt %0"
++ : "=r" (val)
++ : "r" (&__cas_lock)
++ : "memory");
++ while (val == 0);
++}
++
++inline static void
++__cas_end_atomic (void)
++{
++ __asm__ __volatile__ (" " : : : "memory");
++ __cas_lock = 0;
++}
++
++inline static bool
++compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old,
++ obj_addr_t new_val)
++{
++ bool ret;
++
++ __cas_start_atomic ();
++ if (*addr != old)
++ ret = false;
++ else
++ {
++ *addr = new_val;
++ ret = true;
++ }
++ __cas_end_atomic ();
++
++ return ret;
++}
++
++inline static void
++release_set (volatile obj_addr_t *addr, obj_addr_t new_val)
++{
++ __asm__ __volatile__ (" " : : : "memory");
++ *(addr) = new_val;
++}
++
++inline static bool
++compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old,
++ obj_addr_t new_val)
++{
++ return compare_and_swap (addr, old, new_val);
++}
++
++#endif /* ! __SYSDEP_LOCKS_H__ */
+diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4
+--- gcc-20030210.orig/libstdc++-v3/acinclude.m4 Tue Jan 28 02:30:41 2003
++++ gcc-20030210/libstdc++-v3/acinclude.m4 Sat Feb 22 01:40:14 2003
+@@ -1828,9 +1828,10 @@
+ GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
+
+ # Passed down for canadian crosses.
+- if test x"$CANADIAN" = xyes; then
+- TOPLEVEL_INCLUDES='-I$(includedir)'
+- fi
++ #if test x"$CANADIAN" = xyes; then
++ # TOPLEVEL_INCLUDES='-I$(includedir)'
++ #fi
++ TOPLEVEL_INCLUDES=''
+
+ LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
+
+diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4
+--- gcc-20030210.orig/libstdc++-v3/aclocal.m4 Mon Feb 10 19:36:47 2003
++++ gcc-20030210/libstdc++-v3/aclocal.m4 Sat Feb 22 01:40:14 2003
+@@ -1840,9 +1840,10 @@
+ GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
+
+ # Passed down for canadian crosses.
+- if test x"$CANADIAN" = xyes; then
+- TOPLEVEL_INCLUDES='-I$(includedir)'
+- fi
++ #if test x"$CANADIAN" = xyes; then
++ # TOPLEVEL_INCLUDES='-I$(includedir)'
++ #fi
++ TOPLEVEL_INCLUDES=''
+
+ LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
+
+diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure
+--- gcc-20030210.orig/libstdc++-v3/configure Mon Feb 10 19:37:17 2003
++++ gcc-20030210/libstdc++-v3/configure Sat Feb 22 01:40:14 2003
+@@ -1982,7 +1982,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*)
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+@@ -22340,9 +22340,10 @@
+ GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
+
+ # Passed down for canadian crosses.
+- if test x"$CANADIAN" = xyes; then
+- TOPLEVEL_INCLUDES='-I$(includedir)'
+- fi
++ #if test x"$CANADIAN" = xyes; then
++ # TOPLEVEL_INCLUDES='-I$(includedir)'
++ #fi
++ TOPLEVEL_INCLUDES=''
+
+ LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
+
+diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4
+--- gcc-20030210.orig/libtool.m4 Fri Jan 31 19:16:59 2003
++++ gcc-20030210/libtool.m4 Sat Feb 22 01:40:14 2003
+@@ -597,7 +597,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure
+--- gcc-20030210.orig/zlib/configure Tue Jan 28 10:44:15 2003
++++ gcc-20030210/zlib/configure Sat Feb 22 01:40:14 2003
+@@ -1571,7 +1571,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
diff --git a/patches/gcc/3.2.3/gcc-3.2.3-g++.exp.patch b/patches/gcc/3.2.3/gcc-3.2.3-g++.exp.patch
new file mode 100644
index 0000000..0de46fc
--- /dev/null
+++ b/patches/gcc/3.2.3/gcc-3.2.3-g++.exp.patch
@@ -0,0 +1,98 @@
+g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003
+
+The first hunk fixes the error
+
+/testsuite_flags: /testsuite_flags: No such file or directory
+ while executing
+"exec sh ${odir_v3}/testsuite_flags --build-includes"
+ (procedure "g++_include_flags" line 21)
+ invoked from within
+"g++_include_flags [get_multilibs] "
+ (procedure "g++_init" line 63)
+ invoked from within
+"${tool}_init $test_file_name"
+ (procedure "runtest" line 19)
+ invoked from within
+"runtest $test_name"
+ ("foreach" body line 42)
+ invoked from within
+...
+make[1]: [check-g++] Error 1 (ignored)
+
+The fix isn't especially pretty, but it worked for me, and can't hurt the
+more common native compiler case. Maybe someone who knows the code better
+can come up with a better fix.
+
+The second hunk fixes the error
+
+sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-405-linux-gnu/gcc-3.2.3-glibc-2.2.5/powerpc-405-linux-gnu/./lib/libdl.so.2: ELF file data encoding not little-endian
+
+when trying to compile g++ testcases (!); setting up
+the shared library environment when running crosstests of g++
+should either be done by a special board file, or by
+setting up a remote chroot environment (see http://kegel.com/crosstool),
+not by blithely setting LD_LIBRARY_PATH on the local system.
+
+--- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old Fri Jul 11 15:42:47 2003
++++ gcc-3.2.3/gcc/testsuite/lib/g++.exp Sat Jul 12 12:57:07 2003
+@@ -72,6 +72,8 @@
+ #
+ proc g++_include_flags { paths } {
+ global srcdir
++ global objdir
++ global target_triplet
+ global HAVE_LIBSTDCXX_V3
+ global TESTING_IN_BUILD_TREE
+
+@@ -90,6 +92,20 @@
+
+ if { ${HAVE_LIBSTDCXX_V3} } {
+ set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
++ if { $odir_v3 == "" } {
++ verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
++ # first assume no multilibs
++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
++ }
++ if { $odir_v3 == "" } {
++ verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
++ # assume multilib only one level deep
++ set multisub [file tail $gccpath]
++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
++ }
++ if { $odir_v3 == "" } {
++ error "Can't find libstdc++-v3"
++ }
+ append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
+ } else {
+ set odir_v2 [lookfor_file ${gccpath} libstdc++]
+@@ -192,16 +192,20 @@
+ }
+ }
+
+- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+- # (for the 64-bit ABI). The right way to do this would be to modify
+- # unix.exp -- but that's not an option since it's part of DejaGNU
+- # proper, so we do it here. We really only need to do
+- # this on IRIX, but it shouldn't hurt to do it anywhere else.
+- setenv LD_LIBRARY_PATH $ld_library_path
+- setenv SHLIB_PATH $ld_library_path
+- setenv LD_LIBRARYN32_PATH $ld_library_path
+- setenv LD_LIBRARY64_PATH $ld_library_path
++ if {![is_remote target]} {
++ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
++ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
++ # (for the 64-bit ABI). The right way to do this would be to modify
++ # unix.exp -- but that's not an option since it's part of DejaGNU
++ # proper, so we do it here. We really only need to do
++ # this on IRIX, but it shouldn't hurt to do it anywhere else.
++
++ # Doing this causes us to be unable to run cross-compilers.
++ setenv LD_LIBRARY_PATH $ld_library_path
++ setenv SHLIB_PATH $ld_library_path
++ setenv LD_LIBRARYN32_PATH $ld_library_path
++ setenv LD_LIBRARY64_PATH $ld_library_path
++ }
+
+ return "$flags"
+ }
diff --git a/patches/gcc/3.2.3/gcc-3.2.3-libffi-1.patch b/patches/gcc/3.2.3/gcc-3.2.3-libffi-1.patch
new file mode 100644
index 0000000..db78ba1
--- /dev/null
+++ b/patches/gcc/3.2.3/gcc-3.2.3-libffi-1.patch
@@ -0,0 +1,6864 @@
+diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.am gcc/libffi/Makefile.am
+--- gcc-3.2.2.orig/libffi/Makefile.am Tue Jan 28 10:43:56 2003
++++ gcc/libffi/Makefile.am Tue Jan 28 10:48:33 2003
+@@ -8,14 +8,17 @@
+ src/mips/n32.s src/mips/o32.S src/mips/o32.s \
+ src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
+ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
++ src/x86/ffi64.c src/x86/unix64.S \
+ src/alpha/ffi.c src/alpha/osf.S \
+ src/m68k/ffi.c src/m68k/sysv.S \
+ src/powerpc/ffi.c src/powerpc/sysv.S \
+ src/powerpc/ppc_closure.S src/powerpc/asm.h \
+ src/powerpc/ffi_darwin.c \
+ src/powerpc/darwin.S src/powerpc/aix.S \
+- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
+- src/arm/ffi.c src/arm/sysv.S
++ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \
++ src/arm/ffi.c src/arm/sysv.S \
++ src/s390/ffi.c src/s390/sysv.S \
++ src/sh/ffi.c src/sh/sysv.S
+
+ VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
+
+@@ -83,6 +86,7 @@
+ ffitest_LDFLAGS = -shared-libgcc
+
+ TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
+ TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
+ TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
+ TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
+@@ -91,9 +95,12 @@
+ TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
+ TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
+ TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
+-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S
++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
+ TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
+ TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c
++TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c
++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
++TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c
+
+ ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@)
+ ## Work around automake deficiency
+@@ -103,6 +110,10 @@
+ libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
+ libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
+ endif
++if MIPS_LINUX
++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
++endif
+ if MIPS_SGI
+ libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
+ libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
+@@ -147,6 +158,18 @@
+ libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
+ libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
+ endif
++if S390
++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
++endif
++if X86_64
++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
++endif
++if SH
++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
++libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
++endif
+
+ AM_CFLAGS = -fexceptions
+
+diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.in gcc/libffi/Makefile.in
+--- gcc-3.2.2.orig/libffi/Makefile.in Wed Jan 29 07:59:05 2003
++++ gcc/libffi/Makefile.in Wed Jan 29 07:58:58 2003
+@@ -91,14 +91,17 @@
+ src/mips/n32.s src/mips/o32.S src/mips/o32.s \
+ src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
+ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
++ src/x86/ffi64.c src/x86/unix64.S \
+ src/alpha/ffi.c src/alpha/osf.S \
+ src/m68k/ffi.c src/m68k/sysv.S \
+ src/powerpc/ffi.c src/powerpc/sysv.S \
+ src/powerpc/ppc_closure.S src/powerpc/asm.h \
+ src/powerpc/ffi_darwin.c \
+ src/powerpc/darwin.S src/powerpc/aix.S \
+- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
+- src/arm/ffi.c src/arm/sysv.S
++ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \
++ src/arm/ffi.c src/arm/sysv.S \
++ src/s390/ffi.c src/s390/sysv.S \
++ src/sh/ffi.c src/sh/sysv.S
+
+
+ VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
+@@ -162,6 +165,7 @@
+ ffitest_LDFLAGS = -shared-libgcc
+
+ TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
+ TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
+ TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
+ TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
+@@ -170,14 +174,18 @@
+ TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
+ TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
+ TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
+-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S
++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
+ TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
+ TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c
++TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c
++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
++TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c
+
+ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
+ src/raw_api.c src/java_raw_api.c
+
+ @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
++@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
+ @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
+ @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
+ @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
+@@ -189,7 +197,11 @@
+ @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
+ @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
+ @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
++@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
++@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
++@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
+ @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
++@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
+ @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
+ @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
+ @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
+@@ -201,6 +213,9 @@
+ @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
+ @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
+ @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
++@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
++@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
++@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
+
+ AM_CFLAGS = -fexceptions
+
+@@ -208,7 +223,7 @@
+
+ INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
++mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs
+ CONFIG_HEADER = fficonfig.h
+ CONFIG_CLEAN_FILES =
+ LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
+@@ -220,10 +235,6 @@
+ LIBS = @LIBS@
+ libffi_convenience_la_LDFLAGS =
+ libffi_convenience_la_LIBADD =
+-@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+-@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+-@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
+-@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
+ @ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+ @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+ @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo
+@@ -234,12 +245,29 @@
+ @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+ @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
+ @MIPS_GCC_TRUE@src/mips/n32.lo
+-@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+-@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+-@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
++@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
+ @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+ @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+ @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
++@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
++@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
++@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
++@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
++@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
++@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
++@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
++@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo
++@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
++@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
++@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
++@X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
++@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
++@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \
++@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo
+ @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+ @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+ @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \
+@@ -247,62 +275,75 @@
+ @POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+ @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+ @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
+-@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo
+-@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
+-@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
++@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo
++@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
++@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
++@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
++@MIPS_SGI_TRUE@src/mips/n32.lo
+ @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+ @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+ @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
+ @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \
+ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
+-@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+-@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+-@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
+-@MIPS_SGI_TRUE@src/mips/n32.lo
++@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
++@SH_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@SH_TRUE@src/sh/sysv.lo src/sh/ffi.lo
+ libffi_la_LIBADD =
++@SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
++@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
++@SH_TRUE@src/sh/ffi.lo
++@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
++@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
++@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
++@X86_TRUE@src/x86/sysv.lo
+ @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+ @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+ @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
+ @POWERPC_TRUE@src/powerpc/ppc_closure.lo
+-@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
+-@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
+-@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
+-@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
+-@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
++@MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo
+ @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+ @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+ @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo
+ @POWERPC_AIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+ @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+ @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \
+-@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo
+-@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
+-@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
+-@X86_TRUE@src/x86/sysv.lo
++@POWERPC_AIX_TRUE@src/powerpc/aix_closure.lo
++@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
+ @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
+ @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \
+ @ARM_TRUE@src/arm/ffi.lo
++@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
++@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
++@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
++@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
++@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
++@X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
++@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
++@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \
++@X86_64_TRUE@src/x86/sysv.lo
+ @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+ @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+ @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \
+ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
+-@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+-@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
+ noinst_PROGRAMS = ffitest$(EXEEXT)
+ PROGRAMS = $(noinst_PROGRAMS)
+
+@@ -578,8 +616,8 @@
+ -chmod 777 $(distdir)
+ $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \
+ $(distdir)/src/m68k $(distdir)/src/mips \
+- $(distdir)/src/powerpc $(distdir)/src/sparc \
+- $(distdir)/src/x86
++ $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \
++ $(distdir)/src/sparc $(distdir)/src/x86
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/acinclude.m4 gcc/libffi/acinclude.m4
+--- gcc-3.2.2.orig/libffi/acinclude.m4 Sun Sep 10 16:43:14 2000
++++ gcc/libffi/acinclude.m4 Tue Dec 17 03:22:47 2002
+@@ -4,5 +4,8 @@
+ dnl to add a definition of LIBTOOL to Makefile.in.
+ ifelse(yes,no,[
+ AC_DEFUN([AC_PROG_LIBTOOL],)
++AC_DEFUN([AM_PROG_LIBTOOL],)
+ AC_SUBST(LIBTOOL)
+ ])
++
++sinclude(../config/accross.m4)
+diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/aclocal.m4 gcc/libffi/aclocal.m4
+--- gcc-3.2.2.orig/libffi/aclocal.m4 Fri Feb 1 07:25:31 2002
++++ gcc/libffi/aclocal.m4 Tue Dec 17 03:22:47 2002
+@@ -1,6 +1,6 @@
+-dnl aclocal.m4 generated automatically by aclocal 1.4
++dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+
+-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
++dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+ dnl with or without modifications, as long as this notice is preserved.
+@@ -16,108 +16,15 @@
+ dnl to add a definition of LIBTOOL to Makefile.in.
+ ifelse(yes,no,[
+ AC_DEFUN([AC_PROG_LIBTOOL],)
++AC_DEFUN([AM_PROG_LIBTOOL],)
+ AC_SUBST(LIBTOOL)
+ ])
+
+-AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
+-[changequote(<<, >>)dnl
+-dnl The name to #define.
+-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+-dnl The cache variable name.
+-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
+-changequote([, ])dnl
+-AC_MSG_CHECKING(size of $1)
+-AC_CACHE_VAL(AC_CV_NAME,
+-[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence.
+- AC_TRY_COMPILE([#include "confdefs.h"
+-#include <sys/types.h>
+-$2
+-], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
+- if test x$AC_CV_NAME != x ; then break; fi
+-done
+-])
+-if test x$AC_CV_NAME = x ; then
+- AC_MSG_ERROR([cannot determine a size for $1])
+-fi
+-AC_MSG_RESULT($AC_CV_NAME)
+-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
+-undefine([AC_TYPE_NAME])dnl
+-undefine([AC_CV_NAME])dnl
+-])
+-
+-AC_DEFUN([AC_C_BIGENDIAN_CROSS],
+-[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
+-[ac_cv_c_bigendian=unknown
+-# See if sys/param.h defines the BYTE_ORDER macro.
+-AC_TRY_COMPILE([#include <sys/types.h>
+-#include <sys/param.h>], [
+-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+- bogus endian macros
+-#endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
+-AC_TRY_COMPILE([#include <sys/types.h>
+-#include <sys/param.h>], [
+-#if BYTE_ORDER != BIG_ENDIAN
+- not big endian
+-#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
+-if test $ac_cv_c_bigendian = unknown; then
+-AC_TRY_RUN([main () {
+- /* Are we little or big endian? From Harbison&Steele. */
+- union
+- {
+- long l;
+- char c[sizeof (long)];
+- } u;
+- u.l = 1;
+- exit (u.c[sizeof (long) - 1] == 1);
+-}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes,
+-[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ])
+-fi])
+-if test $ac_cv_c_bigendian = unknown; then
+-AC_MSG_CHECKING(to probe for byte ordering)
+-[
+-cat >conftest.c <<EOF
+-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+-void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
+-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+-void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
+-int main() { _ascii (); _ebcdic (); return 0; }
+-EOF
+-] if test -f conftest.c ; then
+- if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
+- if test `grep -l BIGenDianSyS conftest.o` ; then
+- echo $ac_n ' big endian probe OK, ' 1>&AC_FD_MSG
+- ac_cv_c_bigendian=yes
+- fi
+- if test `grep -l LiTTleEnDian conftest.o` ; then
+- echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG
+- if test $ac_cv_c_bigendian = yes ; then
+- ac_cv_c_bigendian=unknown;
+- else
+- ac_cv_c_bigendian=no
+- fi
+- fi
+- echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG
+- fi
+- fi
+-AC_MSG_RESULT($ac_cv_c_bigendian)
+-fi
+-if test $ac_cv_c_bigendian = yes; then
+- AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian])
+- BYTEORDER=4321
+-else
+- BYTEORDER=1234
+-fi
+-AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN])
+-if test $ac_cv_c_bigendian = unknown; then
+- AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian)
+-fi
+-])
++sinclude(../config/accross.m4)
+
+ # Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+-AC_DEFUN(AM_CONFIG_HEADER,
++AC_DEFUN([AM_CONFIG_HEADER],
+ [AC_PREREQ([2.12])
+ AC_CONFIG_HEADER([$1])
+ dnl When config.status generates a header, we must update the stamp-h file.
+@@ -147,7 +54,7 @@
+ dnl Usage:
+ dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+-AC_DEFUN(AM_INIT_AUTOMAKE,
++AC_DEFUN([AM_INIT_AUTOMAKE],
+ [AC_REQUIRE([AC_PROG_INSTALL])
+ PACKAGE=[$1]
+ AC_SUBST(PACKAGE)
+@@ -175,7 +82,7 @@
+ # Check to make sure that the build environment is sane.
+ #
+
+-AC_DEFUN(AM_SANITY_CHECK,
++AC_DEFUN([AM_SANITY_CHECK],
+ [AC_MSG_CHECKING([whether build environment is sane])
+ # Just in case
+ sleep 1
+@@ -216,7 +123,7 @@
+
+ dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+ dnl The program must properly implement --version.
+-AC_DEFUN(AM_MISSING_PROG,
++AC_DEFUN([AM_MISSING_PROG],
+ [AC_MSG_CHECKING(for working $2)
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+@@ -235,7 +142,7 @@
+
+ # serial 1
+
+-AC_DEFUN(AM_MAINTAINER_MODE,
++AC_DEFUN([AM_MAINTAINER_MODE],
+ [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+@@ -252,7 +159,7 @@
+
+ # Define a conditional.
+
+-AC_DEFUN(AM_CONDITIONAL,
++AC_DEFUN([AM_CONDITIONAL],
+ [AC_SUBST($1_TRUE)
+ AC_SUBST($1_FALSE)
+ if $2; then
+diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure gcc/libffi/configure
+--- gcc-3.2.2.orig/libffi/configure Wed Jan 29 07:59:05 2003
++++ gcc/libffi/configure Sat Feb 1 20:16:19 2003
+@@ -633,17 +633,16 @@
+
+ if test "${srcdir}" = "."; then
+ if test "${with_target_subdir}" != "."; then
+- libffi_basedir="${srcdir}/${with_multisrctop}.."
++ libffi_basedir="${with_multisrctop}../"
+ else
+- libffi_basedir="${srcdir}/${with_multisrctop}"
++ libffi_basedir="${with_multisrctop}"
+ fi
+ else
+- libffi_basedir="${srcdir}"
++ libffi_basedir=
+ fi
+
+-
+ ac_aux_dir=
+-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
++for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+@@ -655,13 +654,14 @@
+ fi
+ done
+ if test -z "$ac_aux_dir"; then
+- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
++ { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; }
+ fi
+ ac_config_guess=$ac_aux_dir/config.guess
+ ac_config_sub=$ac_aux_dir/config.sub
+ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
++
+ # Make sure we can run config.sub.
+ if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+@@ -1238,9 +1238,18 @@
+ ;;
+
+ hpux10.20*|hpux11*)
+- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+- lt_cv_file_magic_cmd=/usr/bin/file
+- lt_cv_file_magic_test_file=/usr/lib/libc.sl
++ case $host_cpu in
++ hppa*)
++ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=/usr/lib/libc.sl
++ ;;
++ ia64*)
++ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
++ ;;
++ esac
+ ;;
+
+ irix5* | irix6*)
+@@ -1267,7 +1276,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+@@ -1330,13 +1339,13 @@
+ deplibs_check_method=$lt_cv_deplibs_check_method
+
+ echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+-echo "configure:1334: checking for object suffix" >&5
++echo "configure:1343: checking for object suffix" >&5
+ if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ rm -f conftest*
+ echo 'int i = 1;' > conftest.$ac_ext
+-if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+@@ -1356,7 +1365,7 @@
+
+
+ echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+-echo "configure:1360: checking for executable suffix" >&5
++echo "configure:1369: checking for executable suffix" >&5
+ if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1366,7 +1375,7 @@
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+- if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
++ if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+@@ -1399,7 +1408,7 @@
+ file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+-echo "configure:1403: checking for ${ac_tool_prefix}file" >&5
++echo "configure:1412: checking for ${ac_tool_prefix}file" >&5
+ if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1461,7 +1470,7 @@
+ if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo $ac_n "checking for file""... $ac_c" 1>&6
+-echo "configure:1465: checking for file" >&5
++echo "configure:1474: checking for file" >&5
+ if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1532,7 +1541,7 @@
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1536: checking for $ac_word" >&5
++echo "configure:1545: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1564,7 +1573,7 @@
+ # Extract the first word of "ranlib", so it can be a program name with args.
+ set dummy ranlib; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1568: checking for $ac_word" >&5
++echo "configure:1577: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1599,7 +1608,7 @@
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1603: checking for $ac_word" >&5
++echo "configure:1612: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1631,7 +1640,7 @@
+ # Extract the first word of "strip", so it can be a program name with args.
+ set dummy strip; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1635: checking for $ac_word" >&5
++echo "configure:1644: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1698,8 +1707,8 @@
+ case $host in
+ *-*-irix6*)
+ # Find out which ABI we are using.
+- echo '#line 1702 "configure"' > conftest.$ac_ext
+- if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ echo '#line 1711 "configure"' > conftest.$ac_ext
++ if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+@@ -1715,12 +1724,70 @@
+ rm -rf conftest*
+ ;;
+
++ia64-*-hpux*)
++ # Find out which ABI we are using.
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ case "`/usr/bin/file conftest.o`" in
++ *ELF-32*)
++ HPUX_IA64_MODE="32"
++ ;;
++ *ELF-64*)
++ HPUX_IA64_MODE="64"
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++
++x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
++ # Find out which ABI we are using.
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ case "`/usr/bin/file conftest.o`" in
++ *32-bit*)
++ case $host in
++ x86_64-*linux*)
++ LD="${LD-ld} -m elf_i386"
++ ;;
++ ppc64-*linux*)
++ LD="${LD-ld} -m elf32ppclinux"
++ ;;
++ s390x-*linux*)
++ LD="${LD-ld} -m elf_s390"
++ ;;
++ sparc64-*linux*)
++ LD="${LD-ld} -m elf32_sparc"
++ ;;
++ esac
++ ;;
++ *64-bit*)
++ case $host in
++ x86_64-*linux*)
++ LD="${LD-ld} -m elf_x86_64"
++ ;;
++ ppc*-*linux*|powerpc*-*linux*)
++ LD="${LD-ld} -m elf64ppc"
++ ;;
++ s390*-*linux*)
++ LD="${LD-ld} -m elf64_s390"
++ ;;
++ sparc*-*linux*)
++ LD="${LD-ld} -m elf64_sparc"
++ ;;
++ esac
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++
+ *-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+-echo "configure:1724: checking whether the C compiler needs -belf" >&5
++echo "configure:1791: checking whether the C compiler needs -belf" >&5
+ if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1733,14 +1800,14 @@
+ cross_compiling=$ac_cv_prog_cc_cross
+
+ cat > conftest.$ac_ext <<EOF
+-#line 1737 "configure"
++#line 1804 "configure"
+ #include "confdefs.h"
+
+ int main() {
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+ else
+@@ -1868,7 +1935,7 @@
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+ # ./install, which can be erroneously created by make from ./install.sh.
+ echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:1872: checking for a BSD compatible install" >&5
++echo "configure:1939: checking for a BSD compatible install" >&5
+ if test -z "$INSTALL"; then
+ if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -1921,7 +1988,7 @@
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+ echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+-echo "configure:1925: checking whether build environment is sane" >&5
++echo "configure:1992: checking whether build environment is sane" >&5
+ # Just in case
+ sleep 1
+ echo timestamp > conftestfile
+@@ -1978,7 +2045,7 @@
+ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+-echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5
++echo "configure:2049: checking whether ${MAKE-make} sets \${MAKE}" >&5
+ set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -2017,7 +2084,7 @@
+
+ missing_dir=`cd $ac_aux_dir && pwd`
+ echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+-echo "configure:2021: checking for working aclocal" >&5
++echo "configure:2088: checking for working aclocal" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -2030,7 +2097,7 @@
+ fi
+
+ echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+-echo "configure:2034: checking for working autoconf" >&5
++echo "configure:2101: checking for working autoconf" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -2043,7 +2110,7 @@
+ fi
+
+ echo $ac_n "checking for working automake""... $ac_c" 1>&6
+-echo "configure:2047: checking for working automake" >&5
++echo "configure:2114: checking for working automake" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -2056,7 +2123,7 @@
+ fi
+
+ echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+-echo "configure:2060: checking for working autoheader" >&5
++echo "configure:2127: checking for working autoheader" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -2069,7 +2136,7 @@
+ fi
+
+ echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+-echo "configure:2073: checking for working makeinfo" >&5
++echo "configure:2140: checking for working makeinfo" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -2086,7 +2153,7 @@
+
+
+ echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+-echo "configure:2090: checking for executable suffix" >&5
++echo "configure:2157: checking for executable suffix" >&5
+ if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2096,7 +2163,7 @@
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+- if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
++ if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+@@ -2117,7 +2184,7 @@
+ ac_exeext=$EXEEXT
+
+ echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+-echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5
++echo "configure:2188: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+ if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+@@ -2143,7 +2210,7 @@
+ # Extract the first word of "gcc", so it can be a program name with args.
+ set dummy gcc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:2147: checking for $ac_word" >&5
++echo "configure:2214: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2173,7 +2240,7 @@
+ # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:2177: checking for $ac_word" >&5
++echo "configure:2244: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2224,7 +2291,7 @@
+ # Extract the first word of "cl", so it can be a program name with args.
+ set dummy cl; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:2228: checking for $ac_word" >&5
++echo "configure:2295: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2256,7 +2323,7 @@
+ fi
+
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++echo "configure:2327: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ ac_ext=c
+ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+@@ -2267,12 +2334,12 @@
+
+ cat > conftest.$ac_ext << EOF
+
+-#line 2271 "configure"
++#line 2338 "configure"
+ #include "confdefs.h"
+
+ main(){return(0);}
+ EOF
+-if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+@@ -2298,12 +2365,12 @@
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "configure:2369: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+ cross_compiling=$ac_cv_prog_cc_cross
+
+ echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:2307: checking whether we are using GNU C" >&5
++echo "configure:2374: checking whether we are using GNU C" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2312,7 +2379,7 @@
+ yes;
+ #endif
+ EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+ else
+ ac_cv_prog_gcc=no
+@@ -2331,7 +2398,7 @@
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5
++echo "configure:2402: checking whether ${CC-cc} accepts -g" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2381,17 +2448,23 @@
+ i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
+ sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
+ sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
+-sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
+-sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
+-alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
++sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
++sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
++alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
+ ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
+ m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
++mips64*-*);;
++mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
+ powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
+ powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
+ powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
+ powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
+ rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
+ arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
++s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
++s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
++x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
++sh-*-linux* | sh[34]